1 |
commit: 167c53006749b6bbf952c80af0e0b5a7d31eca32 |
2 |
Author: William Hubbs <williamh <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Apr 29 16:24:04 2019 +0000 |
4 |
Commit: William Hubbs <williamh <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Apr 29 16:30:30 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=167c5300 |
7 |
|
8 |
dev-lang/go: add system-bootstrap use flag |
9 |
|
10 |
If a previous version of dev-lang/go is installed, you can use this use |
11 |
flag to skip downloading the bootstrap archives and bootstrap the new |
12 |
version using the already-installed version. |
13 |
|
14 |
For the initial installation of dev-lang/go, we have to download all of |
15 |
the bootstrap archives to make the go ebuild work under crossdev. For |
16 |
this reason, system-bootstrap cannot be turned on by default. |
17 |
|
18 |
Bug: https://bugs.gentoo.org/671394 |
19 |
closes: https://bugs.gentoo.org/684652 |
20 |
Copyright: Sony Interactive Entertainment Inc. |
21 |
Package-Manager: Portage-2.3.62, Repoman-2.3.12 |
22 |
Signed-off-by: William Hubbs <williamh <AT> gentoo.org> |
23 |
|
24 |
dev-lang/go/go-1.11.9.ebuild | 19 ++++++++++++------- |
25 |
dev-lang/go/go-1.12.4.ebuild | 19 ++++++++++++------- |
26 |
dev-lang/go/metadata.xml | 7 ++++++- |
27 |
3 files changed, 30 insertions(+), 15 deletions(-) |
28 |
|
29 |
diff --git a/dev-lang/go/go-1.11.9.ebuild b/dev-lang/go/go-1.11.9.ebuild |
30 |
index 8fafeb455ba..a53df7c0956 100644 |
31 |
--- a/dev-lang/go/go-1.11.9.ebuild |
32 |
+++ b/dev-lang/go/go-1.11.9.ebuild |
33 |
@@ -48,20 +48,20 @@ case ${PV} in |
34 |
esac |
35 |
esac |
36 |
|
37 |
-# If gccgo is not being used to build Go, there is no way to know the |
38 |
-# architecture or operating system of the build machine, so we need to |
39 |
-# download all of our bootstrap archives to allow this ebuild to work |
40 |
-# under crossdev. |
41 |
+# If gccgo or a previously installed version of dev-lang/go is not being |
42 |
+# used to build Go, there is no way to know the architecture or operating system |
43 |
+# of the build machine, so we need to download all of our bootstrap |
44 |
+# archives to allow this ebuild to work under crossdev. |
45 |
# |
46 |
# https://bugs.gentoo.org/671394 |
47 |
-SRC_URI+="!gccgo? ( ${BOOTSTRAP_URI} )" |
48 |
+SRC_URI+="!gccgo? ( !system-bootstrap? ( ${BOOTSTRAP_URI} ) )" |
49 |
|
50 |
DESCRIPTION="A concurrent garbage collected and typesafe programming language" |
51 |
HOMEPAGE="https://golang.org" |
52 |
|
53 |
LICENSE="BSD" |
54 |
SLOT="0/${PV}" |
55 |
-IUSE="gccgo" |
56 |
+IUSE="gccgo system-bootstrap" |
57 |
|
58 |
BDEPEND="gccgo? ( >=sys-devel/gcc-5[go] )" |
59 |
RDEPEND="!<dev-go/go-tools-0_pre20150902" |
60 |
@@ -151,6 +151,9 @@ pkg_pretend() |
61 |
if [[ $(go_tuple) != $(go_tuple ${CTARGET}) ]]; then |
62 |
die "CHOST CTARGET pair unsupported: CHOST=${CHOST} CTARGET=${CTARGET}" |
63 |
fi |
64 |
+ [[ ${MERGE_TYPE} != binary ]] && |
65 |
+ use system-bootstrap && ! has_version "dev-lang/go" && |
66 |
+ die "dev-lang/go must be installed to use the system-bootstrap use flag" |
67 |
} |
68 |
|
69 |
src_unpack() |
70 |
@@ -160,7 +163,7 @@ src_unpack() |
71 |
else |
72 |
unpack "go${MY_PV}.src.tar.gz" |
73 |
fi |
74 |
- use gccgo || |
75 |
+ use gccgo || use system-bootstrap || |
76 |
unpack "go-$(go_os ${CBUILD})-$(go_arch ${CBUILD})-${BOOTSTRAP_VERSION}.tbz" |
77 |
} |
78 |
|
79 |
@@ -176,6 +179,8 @@ src_compile() |
80 |
[[ -x ${go_binary} ]] || |
81 |
die "go-$(gcc-major-version): command not found" |
82 |
ln -s "${go_binary}" "${GOROOT_BOOTSTRAP}/bin/go" || die |
83 |
+ elif use system-bootstrap; then |
84 |
+ export GOROOT_BOOTSTRAP="${EPREFIX}"/usr/lib/go |
85 |
fi |
86 |
export GOROOT_FINAL="${EPREFIX}"/usr/lib/go |
87 |
export GOROOT="$(pwd)" |
88 |
|
89 |
diff --git a/dev-lang/go/go-1.12.4.ebuild b/dev-lang/go/go-1.12.4.ebuild |
90 |
index 8fafeb455ba..a53df7c0956 100644 |
91 |
--- a/dev-lang/go/go-1.12.4.ebuild |
92 |
+++ b/dev-lang/go/go-1.12.4.ebuild |
93 |
@@ -48,20 +48,20 @@ case ${PV} in |
94 |
esac |
95 |
esac |
96 |
|
97 |
-# If gccgo is not being used to build Go, there is no way to know the |
98 |
-# architecture or operating system of the build machine, so we need to |
99 |
-# download all of our bootstrap archives to allow this ebuild to work |
100 |
-# under crossdev. |
101 |
+# If gccgo or a previously installed version of dev-lang/go is not being |
102 |
+# used to build Go, there is no way to know the architecture or operating system |
103 |
+# of the build machine, so we need to download all of our bootstrap |
104 |
+# archives to allow this ebuild to work under crossdev. |
105 |
# |
106 |
# https://bugs.gentoo.org/671394 |
107 |
-SRC_URI+="!gccgo? ( ${BOOTSTRAP_URI} )" |
108 |
+SRC_URI+="!gccgo? ( !system-bootstrap? ( ${BOOTSTRAP_URI} ) )" |
109 |
|
110 |
DESCRIPTION="A concurrent garbage collected and typesafe programming language" |
111 |
HOMEPAGE="https://golang.org" |
112 |
|
113 |
LICENSE="BSD" |
114 |
SLOT="0/${PV}" |
115 |
-IUSE="gccgo" |
116 |
+IUSE="gccgo system-bootstrap" |
117 |
|
118 |
BDEPEND="gccgo? ( >=sys-devel/gcc-5[go] )" |
119 |
RDEPEND="!<dev-go/go-tools-0_pre20150902" |
120 |
@@ -151,6 +151,9 @@ pkg_pretend() |
121 |
if [[ $(go_tuple) != $(go_tuple ${CTARGET}) ]]; then |
122 |
die "CHOST CTARGET pair unsupported: CHOST=${CHOST} CTARGET=${CTARGET}" |
123 |
fi |
124 |
+ [[ ${MERGE_TYPE} != binary ]] && |
125 |
+ use system-bootstrap && ! has_version "dev-lang/go" && |
126 |
+ die "dev-lang/go must be installed to use the system-bootstrap use flag" |
127 |
} |
128 |
|
129 |
src_unpack() |
130 |
@@ -160,7 +163,7 @@ src_unpack() |
131 |
else |
132 |
unpack "go${MY_PV}.src.tar.gz" |
133 |
fi |
134 |
- use gccgo || |
135 |
+ use gccgo || use system-bootstrap || |
136 |
unpack "go-$(go_os ${CBUILD})-$(go_arch ${CBUILD})-${BOOTSTRAP_VERSION}.tbz" |
137 |
} |
138 |
|
139 |
@@ -176,6 +179,8 @@ src_compile() |
140 |
[[ -x ${go_binary} ]] || |
141 |
die "go-$(gcc-major-version): command not found" |
142 |
ln -s "${go_binary}" "${GOROOT_BOOTSTRAP}/bin/go" || die |
143 |
+ elif use system-bootstrap; then |
144 |
+ export GOROOT_BOOTSTRAP="${EPREFIX}"/usr/lib/go |
145 |
fi |
146 |
export GOROOT_FINAL="${EPREFIX}"/usr/lib/go |
147 |
export GOROOT="$(pwd)" |
148 |
|
149 |
diff --git a/dev-lang/go/metadata.xml b/dev-lang/go/metadata.xml |
150 |
index f981de1f10b..8d9af604ec9 100644 |
151 |
--- a/dev-lang/go/metadata.xml |
152 |
+++ b/dev-lang/go/metadata.xml |
153 |
@@ -11,6 +11,11 @@ |
154 |
channels and a clean syntax. |
155 |
</longdescription> |
156 |
<use> |
157 |
- <flag name="gccgo">Enable bootstrapping using gccgo</flag> |
158 |
+ <flag name="gccgo"> |
159 |
+ Bootstrap using <pkg>sys-devel/gcc</pkg>[go] |
160 |
+ </flag> |
161 |
+ <flag name="system-bootstrap"> |
162 |
+ Bootstrap using previously installed <pkg>dev-lang/go</pkg> |
163 |
+ </flag> |
164 |
</use> |
165 |
</pkgmetadata> |