1 |
commit: 0f2489c12930d4a832d1cc5979b2c64c20d682d9 |
2 |
Author: William Hubbs <williamh <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Dec 29 17:29:37 2016 +0000 |
4 |
Commit: William Hubbs <williamh <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Dec 29 17:30:11 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0f2489c1 |
7 |
|
8 |
dev-lang/go: multiple live ebuild cleanups |
9 |
|
10 |
- drop the kernel_* use flags |
11 |
- clean up version tests |
12 |
- do not run tests on releases |
13 |
- use einstalldocs to install documentation |
14 |
|
15 |
Package-Manager: Portage-2.3.0, Repoman-2.3.1 |
16 |
|
17 |
dev-lang/go/go-9999.ebuild | 95 ++++++++++++++++++++++------------------------ |
18 |
1 file changed, 46 insertions(+), 49 deletions(-) |
19 |
|
20 |
diff --git a/dev-lang/go/go-9999.ebuild b/dev-lang/go/go-9999.ebuild |
21 |
index 58d44c5..2be3584 100644 |
22 |
--- a/dev-lang/go/go-9999.ebuild |
23 |
+++ b/dev-lang/go/go-9999.ebuild |
24 |
@@ -13,42 +13,43 @@ inherit toolchain-funcs |
25 |
|
26 |
BOOTSTRAP_DIST="https://dev.gentoo.org/~williamh/dist" |
27 |
SRC_URI="!gccgo? ( |
28 |
-kernel_Darwin? ( |
29 |
- x64-macos? ( ${BOOTSTRAP_DIST}/go-darwin-amd64-bootstrap.tbz ) |
30 |
+amd64? ( ${BOOTSTRAP_DIST}/go-linux-amd64-bootstrap.tbz ) |
31 |
+arm? ( ${BOOTSTRAP_DIST}/go-linux-arm-bootstrap.tbz ) |
32 |
+arm64? ( ${BOOTSTRAP_DIST}/go-linux-arm64-bootstrap.tbz ) |
33 |
+ppc64? ( |
34 |
+ ${BOOTSTRAP_DIST}/go-linux-ppc64-bootstrap.tbz |
35 |
+ ${BOOTSTRAP_DIST}/go-linux-ppc64le-bootstrap.tbz |
36 |
) |
37 |
-kernel_FreeBSD? ( |
38 |
+s390? ( ${BOOTSTRAP_DIST}/go-linux-s390x-bootstrap.tbz ) |
39 |
+x86? ( ${BOOTSTRAP_DIST}/go-linux-386-bootstrap-1.tbz ) |
40 |
amd64-fbsd? ( ${BOOTSTRAP_DIST}/go-freebsd-amd64-bootstrap.tbz ) |
41 |
x86-fbsd? ( ${BOOTSTRAP_DIST}/go-freebsd-386-bootstrap-1.tbz ) |
42 |
-) |
43 |
-kernel_linux? ( |
44 |
- amd64? ( ${BOOTSTRAP_DIST}/go-linux-amd64-bootstrap.tbz ) |
45 |
- arm? ( ${BOOTSTRAP_DIST}/go-linux-arm-bootstrap.tbz ) |
46 |
- arm64? ( ${BOOTSTRAP_DIST}/go-linux-arm64-bootstrap.tbz ) |
47 |
- ppc64? ( |
48 |
- ${BOOTSTRAP_DIST}/go-linux-ppc64-bootstrap.tbz |
49 |
- ${BOOTSTRAP_DIST}/go-linux-ppc64le-bootstrap.tbz |
50 |
- ) |
51 |
- s390? ( ${BOOTSTRAP_DIST}/go-linux-s390x-bootstrap.tbz ) |
52 |
- x86? ( ${BOOTSTRAP_DIST}/go-linux-386-bootstrap-1.tbz ) |
53 |
-) |
54 |
-kernel_SunOS? ( |
55 |
- x64-solaris? ( ${BOOTSTRAP_DIST}/go-solaris-amd64-bootstrap.tbz ) |
56 |
-) |
57 |
+x64-macos? ( ${BOOTSTRAP_DIST}/go-darwin-amd64-bootstrap.tbz ) |
58 |
+x64-solaris? ( ${BOOTSTRAP_DIST}/go-solaris-amd64-bootstrap.tbz ) |
59 |
) |
60 |
" |
61 |
|
62 |
-if [[ ${PV} = 9999 ]]; then |
63 |
+case ${PV} in |
64 |
+*9999*) |
65 |
EGIT_REPO_URI="git://github.com/golang/go.git" |
66 |
inherit git-r3 |
67 |
-else |
68 |
+ ;; |
69 |
+*) |
70 |
SRC_URI+="https://storage.googleapis.com/golang/go${MY_PV}.src.tar.gz" |
71 |
+ S="${WORKDIR}"/go |
72 |
case ${PV} in |
73 |
- *9999*|*_rc*) ;; |
74 |
- *) |
75 |
- KEYWORDS="-* ~amd64 ~arm ~arm64 ~ppc64 ~x86 ~amd64-fbsd ~x86-fbsd ~x64-macos ~x64-solaris" |
76 |
- ;; |
77 |
+ *_beta*|*_rc*) ;; |
78 |
+ *) |
79 |
+ KEYWORDS="-* ~amd64 ~arm ~arm64 ~ppc64 ~x86 ~amd64-fbsd ~x86-fbsd ~x64-macos ~x64-solaris" |
80 |
+ # The upstream tests fail under portage but pass if the build is |
81 |
+ # run according to their documentation [1]. |
82 |
+ # I am restricting the tests on released versions until this is |
83 |
+ # solved. |
84 |
+ # [1] https://golang.org/issues/18442 |
85 |
+ RESTRICT="test" |
86 |
+ ;; |
87 |
esac |
88 |
-fi |
89 |
+esac |
90 |
|
91 |
DESCRIPTION="A concurrent garbage collected and typesafe programming language" |
92 |
HOMEPAGE="http://www.golang.org" |
93 |
@@ -61,7 +62,11 @@ DEPEND="gccgo? ( >=sys-devel/gcc-5[go] )" |
94 |
RDEPEND="!<dev-go/go-tools-0_pre20150902" |
95 |
|
96 |
# These test data objects have writable/executable stacks. |
97 |
-QA_EXECSTACK="usr/lib/go/src/debug/elf/testdata/*.obj" |
98 |
+QA_EXECSTACK=" |
99 |
+ usr/lib/go/src/debug/elf/testdata/*.obj |
100 |
+ usr/lib/go/src/go/internal/gccgoimporter/testdata/unicode.gox |
101 |
+ usr/lib/go/src/go/internal/gccgoimporter/testdata/time.gox |
102 |
+ " |
103 |
|
104 |
# Do not complain about CFLAGS, etc, since Go doesn't use them. |
105 |
QA_FLAGS_IGNORED='.*' |
106 |
@@ -71,16 +76,17 @@ REQUIRES_EXCLUDE="/usr/lib/go/src/debug/elf/testdata/*" |
107 |
# The tools in /usr/lib/go should not cause the multilib-strict check to fail. |
108 |
QA_MULTILIB_PATHS="usr/lib/go/pkg/tool/.*/.*" |
109 |
|
110 |
-# The go language uses *.a files which are _NOT_ libraries and should not be |
111 |
-# stripped. The test data objects should also be left alone and unstripped. |
112 |
-STRIP_MASK="/usr/lib/go/pkg/*.a |
113 |
- /usr/lib/go/src/debug/elf/testdata/* |
114 |
- /usr/lib/go/src/debug/dwarf/testdata/* |
115 |
- /usr/lib/go/src/runtime/race/*.syso" |
116 |
+# Do not strip this package. Stripping is unsupported upstream and may |
117 |
+# fail. |
118 |
+RESTRICT+="strip" |
119 |
|
120 |
-if [[ ${PV} != 9999 ]]; then |
121 |
- S="${WORKDIR}"/go |
122 |
-fi |
123 |
+DOCS=( |
124 |
+AUTHORS |
125 |
+CONTRIBUTING.md |
126 |
+CONTRIBUTORS |
127 |
+PATENTS |
128 |
+README.md |
129 |
+) |
130 |
|
131 |
go_arch() |
132 |
{ |
133 |
@@ -190,25 +196,17 @@ src_test() |
134 |
|
135 |
cd src |
136 |
PATH="${GOBIN}:${PATH}" \ |
137 |
- ./run.bash -no-rebuild || die "tests failed" |
138 |
+ ./run.bash -no-rebuild || die "tests failed" |
139 |
} |
140 |
|
141 |
src_install() |
142 |
{ |
143 |
- local bin_path f x |
144 |
- |
145 |
+ einstalldocs |
146 |
dodir /usr/lib/go |
147 |
- insinto /usr/lib/go |
148 |
- |
149 |
- # There is a known issue which requires the source tree to be installed [1]. |
150 |
- # Once this is fixed, we can consider using the doc use flag to control |
151 |
- # installing the doc and src directories. |
152 |
- # [1] https://golang.org/issue/2775 |
153 |
- doins -r bin doc lib pkg src |
154 |
- fperms -R +x /usr/lib/go/bin /usr/lib/go/pkg/tool |
155 |
- |
156 |
- cp -a misc "${D}"/usr/lib/go/misc |
157 |
+ # deliberately use cp to retain permissions |
158 |
+ cp -R api bin doc lib pkg misc src test "${ED}"/usr/lib/go |
159 |
|
160 |
+ local bin_path f x |
161 |
if go_cross_compile; then |
162 |
bin_path="bin/$(go_tuple)" |
163 |
else |
164 |
@@ -218,5 +216,4 @@ src_install() |
165 |
f=${x##*/} |
166 |
dosym ../lib/go/${bin_path}/${f} /usr/bin/${f} |
167 |
done |
168 |
- dodoc AUTHORS CONTRIBUTORS PATENTS README.md |
169 |
} |