From 9986a0a50b13cab9be2ab958724f9c8fa769b756 Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Sat, 23 Jul 2011 15:03:42 +0400 Subject: Added Go (golang) --- dev-lang/golang/Manifest | 1 + dev-lang/golang/golang-9999.ebuild | 120 +++++++++++++++++++++++++++++++++++++ 2 files changed, 121 insertions(+) create mode 100644 dev-lang/golang/Manifest create mode 100644 dev-lang/golang/golang-9999.ebuild diff --git a/dev-lang/golang/Manifest b/dev-lang/golang/Manifest new file mode 100644 index 0000000..09e0dbe --- /dev/null +++ b/dev-lang/golang/Manifest @@ -0,0 +1 @@ +EBUILD golang-9999.ebuild 2135 RMD160 b4846feb82213a2e1bd536b117e304e5d1cbeb01 SHA1 4e0d47e621596ef1ef116246b17fda0f01919d2a SHA256 f686f0a4faf5bdc1afa95bb9c28142a00b1be65b76c2561810debd2e00f2d250 diff --git a/dev-lang/golang/golang-9999.ebuild b/dev-lang/golang/golang-9999.ebuild new file mode 100644 index 0000000..ae28e54 --- /dev/null +++ b/dev-lang/golang/golang-9999.ebuild @@ -0,0 +1,120 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="4" +inherit elisp-common eutils mercurial toolchain-funcs + +DESCRIPTION="The Go Programming Language" +HOMEPAGE="http://golang.org/" +SRC_URI="" +EHG_REPO_URI="https://go.googlecode.com/hg/" +EHG_REVISION="release" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="emacs vim-syntax doc" + +RESTRICT="test" + +RDEPEND="sys-devel/gcc" +DEPEND="${RDEPEND} + emacs? ( virtual/emacs ) + sys-devel/bison + sys-apps/ed" + +S="${WORKDIR}/hg" + +ENVFILE="${WORKDIR}/50${PN}" + +src_prepare() { + GOBIN="${WORKDIR}/bin" + mkdir -p "${GOBIN}" || die + + sed -i \ + -e "/^GOBIN=/s:=.*:=${GOBIN}:" \ + -e "/MAKEFLAGS=/s:=.*:=${MAKEOPTS}:" \ + src/make.bash || die + + case ${ARCH} in + x86) + GOARCH="386" + ;; + *) + GOARCH="${ARCH}" + ;; + esac + + case ${CHOST} in + *-darwin*) + GOOS="darwin" + ;; + *) + GOOS="linux" + ;; + esac +# *-nacl*) +# GOOS="nacl" +# ;; + + cat > "${ENVFILE}" <> "${ENVFILE}" + + export GOBIN GOROOT GOARCH GOOS +} + +src_compile() { + cd src + PATH="${GOBIN}:${PATH}" GOROOT="${S}" CC="$(tc-getCC)" ./make.bash || die + if use emacs ; then + elisp-compile "${S}"/misc/emacs/*.el || die + fi +} + +src_test() { + cd src + PATH="${GOBIN}:${PATH}" GOROOT="${S}" CC="$(tc-getCC)" ./run.bash || die +} + +src_install() { + dobin "${GOBIN}"/* || die + + insinto "${GOROOT}" + doins -r pkg || die + + insinto "${GOROOT}/src" + doins src/Make.* || die + + insinto "${GOROOT}/src/pkg/runtime" + doins src/pkg/runtime/*.h || die + + if use emacs ; then + elisp-install ${PN} "${S}"/misc/emacs/*.el* || die "elisp-install failed" + fi + + if use vim-syntax ; then + insinto /usr/share/vim/vimfiles/syntax + doins "${S}"/misc/vim/syntax/go.vim || die + insinto /usr/share/vim/vimfiles/ftdetect + doins "${S}"/misc/vim/ftdetect/gofiletype.vim || die + fi + + doenvd "${ENVFILE}" || die + + if use doc ; then + dodoc AUTHORS CONTRIBUTORS README || die + dohtml -r doc/* || die + fi +} + +pkg_postinst() { + elog "please don't forget to source /etc/profile" +} + -- cgit v1.2.3