/[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.5 - (show annotations) (download)
Tue Apr 16 06:22:21 2013 UTC (2 years, 1 month ago) by williamh
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +1 -1 lines
FILE REMOVED
remove old version

(Portage version: 2.2.0_alpha173/cvs/Linux i686, signed Manifest commit with key 0x30C46538)

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

  ViewVC Help
Powered by ViewVC 1.1.20