Gentoo Archives: gentoo-commits

From: William Hubbs <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/go/
Date: Thu, 23 Jan 2020 15:07:11
Message-Id: 1579792014.a14e084227448f5a706a71aa802905d11f79a9f3.williamh@gentoo
1 commit: a14e084227448f5a706a71aa802905d11f79a9f3
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jan 23 15:06:17 2020 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Thu Jan 23 15:06:54 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a14e0842
7
8 dev-lang/go: rework bootstrap logic to use dev-lang/go-bootstrap
9
10 This eliminates the need for the system-bootstrap USE flag. Once
11 dev-lang/go is installed, dev-lang/go-bootstrap can be depcleaned.
12
13 (change by williamh)
14 The original patch allowed go to be used to bootstrap itself once it was
15 installed, but that could lead to a situation where go-1.14 was being
16 used to bootstrap go-1.13 for example, and I'm not sure that would be a
17 good idea.
18
19 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
20 Signed-off-by: William Hubbs <williamh <AT> gentoo.org>
21
22 dev-lang/go/go-9999.ebuild | 47 ++++++++++------------------------------------
23 1 file changed, 10 insertions(+), 37 deletions(-)
24
25 diff --git a/dev-lang/go/go-9999.ebuild b/dev-lang/go/go-9999.ebuild
26 index 7516b365dbd..635b905c4d9 100644
27 --- a/dev-lang/go/go-9999.ebuild
28 +++ b/dev-lang/go/go-9999.ebuild
29 @@ -1,4 +1,4 @@
30 -# Copyright 1999-2019 Gentoo Authors
31 +# Copyright 1999-2020 Gentoo Authors
32 # Distributed under the terms of the GNU General Public License v2
33
34 EAPI=7
35 @@ -10,20 +10,6 @@ MY_PV=${PV/_/}
36
37 inherit toolchain-funcs
38
39 -BOOTSTRAP_VERSION="bootstrap-1.13.6"
40 -BOOTSTRAP_DIST="https://dev.gentoo.org/~williamh/dist"
41 -BOOTSTRAP_URI="
42 - ${BOOTSTRAP_DIST}/go-darwin-amd64-${BOOTSTRAP_VERSION}.tbz
43 - ${BOOTSTRAP_DIST}/go-linux-386-${BOOTSTRAP_VERSION}.tbz
44 - ${BOOTSTRAP_DIST}/go-linux-amd64-${BOOTSTRAP_VERSION}.tbz
45 - ${BOOTSTRAP_DIST}/go-linux-arm64-${BOOTSTRAP_VERSION}.tbz
46 - ${BOOTSTRAP_DIST}/go-linux-arm-${BOOTSTRAP_VERSION}.tbz
47 - ${BOOTSTRAP_DIST}/go-linux-ppc64-${BOOTSTRAP_VERSION}.tbz
48 - ${BOOTSTRAP_DIST}/go-linux-ppc64le-${BOOTSTRAP_VERSION}.tbz
49 - ${BOOTSTRAP_DIST}/go-linux-s390x-${BOOTSTRAP_VERSION}.tbz
50 - ${BOOTSTRAP_DIST}/go-solaris-amd64-${BOOTSTRAP_VERSION}.tbz
51 -"
52 -
53 case ${PV} in
54 *9999*)
55 EGIT_REPO_URI="https://github.com/golang/go.git"
56 @@ -46,22 +32,15 @@ case ${PV} in
57 esac
58 esac
59
60 -# If gccgo or a previously installed version of dev-lang/go is not being
61 -# used to build Go, there is no way to know the architecture or operating system
62 -# of the build machine, so we need to download all of our bootstrap
63 -# archives to allow this ebuild to work under crossdev.
64 -#
65 -# https://bugs.gentoo.org/671394
66 -SRC_URI+="!gccgo? ( !system-bootstrap? ( ${BOOTSTRAP_URI} ) )"
67 -
68 DESCRIPTION="A concurrent garbage collected and typesafe programming language"
69 HOMEPAGE="https://golang.org"
70
71 LICENSE="BSD"
72 SLOT="0/${PV}"
73 -IUSE="gccgo system-bootstrap"
74 +IUSE="gccgo"
75
76 -BDEPEND="gccgo? ( >=sys-devel/gcc-5[go] )"
77 +BDEPEND="gccgo? ( >=sys-devel/gcc-5[go(-)] )
78 + !gccgo? ( >=dev-lang/go-bootstrap-1.13.6 )"
79 RDEPEND="!<dev-go/go-tools-0_pre20150902"
80
81 # These test data objects have writable/executable stacks.
82 @@ -143,13 +122,6 @@ go_cross_compile()
83 [[ $(go_tuple ${CBUILD}) != $(go_tuple) ]]
84 }
85
86 -pkg_pretend()
87 -{
88 - [[ ${MERGE_TYPE} != binary ]] &&
89 - use system-bootstrap && ! has_version -b "dev-lang/go" &&
90 - die "dev-lang/go must be installed to use the system-bootstrap use flag"
91 -}
92 -
93 src_unpack()
94 {
95 if [[ ${PV} = 9999 ]]; then
96 @@ -157,14 +129,12 @@ src_unpack()
97 else
98 unpack "go${MY_PV}.src.tar.gz"
99 fi
100 - use gccgo || use system-bootstrap ||
101 - unpack "go-$(go_os ${CBUILD})-$(go_arch ${CBUILD})-${BOOTSTRAP_VERSION}.tbz"
102 }
103
104 src_compile()
105 {
106 - export GOROOT_BOOTSTRAP="${WORKDIR}"/go-$(go_os ${CBUILD})-$(go_arch ${CBUILD})-bootstrap
107 if use gccgo; then
108 + export GOROOT_BOOTSTRAP="${WORKDIR}/go-bootstrap"
109 mkdir -p "${GOROOT_BOOTSTRAP}/bin" || die
110 local go_binary=$(gcc-config --get-bin-path)/go-$(gcc-major-version)
111 [[ -x ${go_binary} ]] || go_binary=$(
112 @@ -173,9 +143,12 @@ src_compile()
113 [[ -x ${go_binary} ]] ||
114 die "go-$(gcc-major-version): command not found"
115 ln -s "${go_binary}" "${GOROOT_BOOTSTRAP}/bin/go" || die
116 - elif use system-bootstrap; then
117 - export GOROOT_BOOTSTRAP="${EPREFIX}"/usr/lib/go
118 + elif has_version -b dev-lang/go-bootstrap; then
119 + export GOROOT_BOOTSTRAP="${BROOT}/usr/lib/go-bootstrap"
120 + else
121 + die "Should not be here, please report a bug"
122 fi
123 +
124 export GOROOT_FINAL="${EPREFIX}"/usr/lib/go
125 export GOROOT="$(pwd)"
126 export GOBIN="${GOROOT}/bin"