Lines 1-4
Link Here
|
1 |
# Copyright 1999-2019 Gentoo Authors |
1 |
# Copyright 1999-2020 Gentoo Authors |
2 |
# Distributed under the terms of the GNU General Public License v2 |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
|
3 |
|
4 |
EAPI=7 |
4 |
EAPI=7 |
Lines 10-29
MY_PV=${PV/_/}
Link Here
|
10 |
|
10 |
|
11 |
inherit toolchain-funcs |
11 |
inherit toolchain-funcs |
12 |
|
12 |
|
13 |
BOOTSTRAP_VERSION="bootstrap-1.13.6" |
|
|
14 |
BOOTSTRAP_DIST="https://dev.gentoo.org/~williamh/dist" |
15 |
BOOTSTRAP_URI=" |
16 |
${BOOTSTRAP_DIST}/go-darwin-amd64-${BOOTSTRAP_VERSION}.tbz |
17 |
${BOOTSTRAP_DIST}/go-linux-386-${BOOTSTRAP_VERSION}.tbz |
18 |
${BOOTSTRAP_DIST}/go-linux-amd64-${BOOTSTRAP_VERSION}.tbz |
19 |
${BOOTSTRAP_DIST}/go-linux-arm64-${BOOTSTRAP_VERSION}.tbz |
20 |
${BOOTSTRAP_DIST}/go-linux-arm-${BOOTSTRAP_VERSION}.tbz |
21 |
${BOOTSTRAP_DIST}/go-linux-ppc64-${BOOTSTRAP_VERSION}.tbz |
22 |
${BOOTSTRAP_DIST}/go-linux-ppc64le-${BOOTSTRAP_VERSION}.tbz |
23 |
${BOOTSTRAP_DIST}/go-linux-s390x-${BOOTSTRAP_VERSION}.tbz |
24 |
${BOOTSTRAP_DIST}/go-solaris-amd64-${BOOTSTRAP_VERSION}.tbz |
25 |
" |
26 |
|
27 |
case ${PV} in |
13 |
case ${PV} in |
28 |
*9999*) |
14 |
*9999*) |
29 |
EGIT_REPO_URI="https://github.com/golang/go.git" |
15 |
EGIT_REPO_URI="https://github.com/golang/go.git" |
Lines 46-67
case ${PV} in
Link Here
|
46 |
esac |
32 |
esac |
47 |
esac |
33 |
esac |
48 |
|
34 |
|
49 |
# If gccgo or a previously installed version of dev-lang/go is not being |
|
|
50 |
# used to build Go, there is no way to know the architecture or operating system |
51 |
# of the build machine, so we need to download all of our bootstrap |
52 |
# archives to allow this ebuild to work under crossdev. |
53 |
# |
54 |
# https://bugs.gentoo.org/671394 |
55 |
SRC_URI+="!gccgo? ( !system-bootstrap? ( ${BOOTSTRAP_URI} ) )" |
56 |
|
57 |
DESCRIPTION="A concurrent garbage collected and typesafe programming language" |
35 |
DESCRIPTION="A concurrent garbage collected and typesafe programming language" |
58 |
HOMEPAGE="https://golang.org" |
36 |
HOMEPAGE="https://golang.org" |
59 |
|
37 |
|
60 |
LICENSE="BSD" |
38 |
LICENSE="BSD" |
61 |
SLOT="0/${PV}" |
39 |
SLOT="0/${PV}" |
62 |
IUSE="gccgo system-bootstrap" |
40 |
IUSE="gccgo" |
63 |
|
41 |
|
64 |
BDEPEND="gccgo? ( >=sys-devel/gcc-5[go] )" |
42 |
BDEPEND="gccgo? ( >=sys-devel/gcc-5[go(-)] ) |
|
|
43 |
!gccgo? ( || ( |
44 |
dev-lang/go |
45 |
dev-lang/go-bootstrap |
46 |
) )" |
65 |
RDEPEND="!<dev-go/go-tools-0_pre20150902" |
47 |
RDEPEND="!<dev-go/go-tools-0_pre20150902" |
66 |
|
48 |
|
67 |
# These test data objects have writable/executable stacks. |
49 |
# These test data objects have writable/executable stacks. |
Lines 143-155
go_cross_compile()
Link Here
|
143 |
[[ $(go_tuple ${CBUILD}) != $(go_tuple) ]] |
125 |
[[ $(go_tuple ${CBUILD}) != $(go_tuple) ]] |
144 |
} |
126 |
} |
145 |
|
127 |
|
146 |
pkg_pretend() |
|
|
147 |
{ |
148 |
[[ ${MERGE_TYPE} != binary ]] && |
149 |
use system-bootstrap && ! has_version -b "dev-lang/go" && |
150 |
die "dev-lang/go must be installed to use the system-bootstrap use flag" |
151 |
} |
152 |
|
153 |
src_unpack() |
128 |
src_unpack() |
154 |
{ |
129 |
{ |
155 |
if [[ ${PV} = 9999 ]]; then |
130 |
if [[ ${PV} = 9999 ]]; then |
Lines 157-170
src_unpack()
Link Here
|
157 |
else |
132 |
else |
158 |
unpack "go${MY_PV}.src.tar.gz" |
133 |
unpack "go${MY_PV}.src.tar.gz" |
159 |
fi |
134 |
fi |
160 |
use gccgo || use system-bootstrap || |
|
|
161 |
unpack "go-$(go_os ${CBUILD})-$(go_arch ${CBUILD})-${BOOTSTRAP_VERSION}.tbz" |
162 |
} |
135 |
} |
163 |
|
136 |
|
164 |
src_compile() |
137 |
src_compile() |
165 |
{ |
138 |
{ |
166 |
export GOROOT_BOOTSTRAP="${WORKDIR}"/go-$(go_os ${CBUILD})-$(go_arch ${CBUILD})-bootstrap |
|
|
167 |
if use gccgo; then |
139 |
if use gccgo; then |
|
|
140 |
export GOROOT_BOOTSTRAP="${WORKDIR}/go-bootstrap" |
168 |
mkdir -p "${GOROOT_BOOTSTRAP}/bin" || die |
141 |
mkdir -p "${GOROOT_BOOTSTRAP}/bin" || die |
169 |
local go_binary=$(gcc-config --get-bin-path)/go-$(gcc-major-version) |
142 |
local go_binary=$(gcc-config --get-bin-path)/go-$(gcc-major-version) |
170 |
[[ -x ${go_binary} ]] || go_binary=$( |
143 |
[[ -x ${go_binary} ]] || go_binary=$( |
Lines 173-181
src_compile()
Link Here
|
173 |
[[ -x ${go_binary} ]] || |
146 |
[[ -x ${go_binary} ]] || |
174 |
die "go-$(gcc-major-version): command not found" |
147 |
die "go-$(gcc-major-version): command not found" |
175 |
ln -s "${go_binary}" "${GOROOT_BOOTSTRAP}/bin/go" || die |
148 |
ln -s "${go_binary}" "${GOROOT_BOOTSTRAP}/bin/go" || die |
176 |
elif use system-bootstrap; then |
149 |
elif has_version -b dev-lang/go; then |
177 |
export GOROOT_BOOTSTRAP="${EPREFIX}"/usr/lib/go |
150 |
: |
|
|
151 |
elif has_version -b dev-lang/go-bootstrap; then |
152 |
export GOROOT_BOOTSTRAP="${BROOT}/usr/lib/go-bootstrap" |
153 |
else |
154 |
die "Should not be here, please report a bug" |
178 |
fi |
155 |
fi |
|
|
156 |
|
179 |
export GOROOT_FINAL="${EPREFIX}"/usr/lib/go |
157 |
export GOROOT_FINAL="${EPREFIX}"/usr/lib/go |
180 |
export GOROOT="$(pwd)" |
158 |
export GOROOT="$(pwd)" |
181 |
export GOBIN="${GOROOT}/bin" |
159 |
export GOBIN="${GOROOT}/bin" |