/[gentoo-x86]/dev-lang/go/go-1.0.2.ebuild
Gentoo

Contents of /dev-lang/go/go-1.0.2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Mon Jul 30 18:49:38 2012 UTC (2 years, 4 months ago) by williamh
Branch: MAIN
Add go version 1.0.2 to the tree and sync live ebuild.
This also includes a patch from upstream to add the pax flags header to
binaries.

(Portage version: 2.2.0_alpha120/cvs/Linux i686)

1 williamh 1.1 # Copyright 1999-2012 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3     # $Header: /var/cvsroot/gentoo-x86/dev-lang/go/go-1.0.1.ebuild,v 1.4 2012/06/12 22:24:11 williamh Exp $
4    
5     EAPI=4
6    
7     EHG_REPO_URI="https://go.googlecode.com/hg"
8    
9     [[ ${PV} == 9999 ]] && vcs=mercurial
10    
11     inherit $vcs bash-completion-r1 elisp-common eutils
12    
13     if [[ ${PV} != 9999 ]]; then
14     SRC_URI="http://go.googlecode.com/files/go${PV}.src.tar.gz"
15     # Upstream only supports go on amd64, arm and x86 architectures.
16     KEYWORDS="-* ~amd64 ~x86"
17     fi
18    
19     DESCRIPTION="A concurrent garbage collected and typesafe programming language"
20     HOMEPAGE="http://www.golang.org"
21    
22     LICENSE="BSD"
23     SLOT="0"
24     IUSE="bash-completion emacs vim-syntax zsh-completion"
25    
26     DEPEND="sys-apps/ed
27     ${COMMON_DEPEND}"
28     RDEPEND="bash-completion? ( app-shells/bash-completion )
29     emacs? ( virtual/emacs )
30     vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )
31     zsh-completion? ( app-shells/zsh-completion )
32     ${COMMON_DEPEND}"
33    
34     # The go language stores binary data for packages in *.a files.
35     # These are _NOT_ libraries, and should not be stripped.
36     STRIP_MASK="/usr/lib/go/pkg/linux*/*.a"
37    
38     [[ ${PV} == 9999 ]] || S="${WORKDIR}"/go
39    
40     src_prepare()
41     {
42     if [[ ${PV} != 9999 ]]; then
43     epatch "${FILESDIR}"/${P}-hardened.patch
44     fi
45     epatch_user
46     }
47    
48     src_compile()
49     {
50     export HOST_EXTRA_CFLAGS="${CFLAGS}"
51     export HOST_EXTRA_LDFLAGS="${LDFLAGS}"
52     export GOROOT_FINAL=/usr/lib/go
53     export GOROOT="$(pwd)"
54     export GOBIN="${GOROOT}/bin"
55    
56     cd src
57     ./make.bash || die "build failed"
58     cd ..
59    
60     if use emacs; then
61     elisp-compile misc/emacs/*.el
62     fi
63     }
64    
65     src_test()
66     {
67     cd src
68     PATH="$GOBIN:${PATH}" ./run.bash --no-rebuild --banner || die "tests failed"
69     }
70    
71     src_install()
72     {
73     dobin bin/*
74     dodoc AUTHORS CONTRIBUTORS PATENTS README
75    
76     dodir /usr/lib/go
77     insinto /usr/lib/go
78    
79     # There is a known issue which requires the source tree to be installed [1].
80     # Once this is fixed, we can consider using the doc use flag to control
81     # installing the doc and src directories.
82     # [1] http://code.google.com/p/go/issues/detail?id=2775
83     doins -r doc lib pkg src
84    
85     if use bash-completion; then
86     dobashcomp misc/bash/go
87     fi
88    
89     if use emacs; then
90     elisp-install ${PN} misc/emacs/*.el misc/emacs/*.elc
91     fi
92    
93     if use vim-syntax; then
94     insinto /usr/share/vim/vimfiles
95     doins -r misc/vim/ftdetect
96     doins -r misc/vim/ftplugin
97     doins -r misc/vim/syntax
98     doins -r misc/vim/plugin
99     doins -r misc/vim/indent
100     fi
101    
102     if use zsh-completion; then
103     insinto /usr/share/zsh/site-functions
104     doins misc/zsh/go
105     fi
106    
107     fperms -R +x /usr/lib/go/pkg/tool
108     }
109    
110     pkg_postinst()
111     {
112     if use emacs; then
113     elisp-site-regen
114     fi
115    
116     # If the go tool sees a package file timestamped older than a dependancy it
117     # will rebuild that file. So, in order to stop go from rebuilding lots of
118     # packages for every build we need to fix the timestamps. The compiler and
119     # linker are also checked - so we need to fix them too.
120     ebegin "fixing timestamps to avoid unnecessary rebuilds"
121     tref="usr/lib/go/pkg/*/runtime.a"
122     find "${ROOT}"usr/lib/go/pkg -type f \
123     -exec touch -r "${ROOT}"${tref} {} \;
124     eend $?
125     }
126    
127     pkg_postrm()
128     {
129     if use emacs; then
130     elisp-site-regen
131     fi
132     }

  ViewVC Help
Powered by ViewVC 1.1.20