summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hubbs <williamh@gentoo.org>2016-04-09 12:35:57 -0500
committerWilliam Hubbs <williamh@gentoo.org>2016-04-09 12:43:10 -0500
commit266654a48bf9ccbc8f0556aa8660eaab78bb7bb9 (patch)
treed16a64c61c53a448985388f3798b42f5f7133e34 /dev-lang/go/go-9999.ebuild
parentdev-perl/Net-Telnet: Remove old (diff)
downloadgentoo-266654a48bf9ccbc8f0556aa8660eaab78bb7bb9.tar.gz
gentoo-266654a48bf9ccbc8f0556aa8660eaab78bb7bb9.tar.bz2
gentoo-266654a48bf9ccbc8f0556aa8660eaab78bb7bb9.zip
dev-lang/go: add support for bootstrapping with gccgo
I would like to thank Zac Medico for the patch. This allows a user to bootstrap go with gcc's go compiler if they have it installed. Bug: https://bugs.gentoo.org/show_bug.cgi?id=576290 Package-Manager: portage-2.2.26
Diffstat (limited to 'dev-lang/go/go-9999.ebuild')
-rw-r--r--dev-lang/go/go-9999.ebuild15
1 files changed, 12 insertions, 3 deletions
diff --git a/dev-lang/go/go-9999.ebuild b/dev-lang/go/go-9999.ebuild
index ecfde4e21b2f..5a65136e3dbc 100644
--- a/dev-lang/go/go-9999.ebuild
+++ b/dev-lang/go/go-9999.ebuild
@@ -12,7 +12,7 @@ MY_PV=${PV/_/}
inherit toolchain-funcs
BOOTSTRAP_DIST="https://dev.gentoo.org/~williamh/dist"
-SRC_URI="
+SRC_URI="!gccgo? (
kernel_Darwin? (
x64-macos? ( ${BOOTSTRAP_DIST}/go-darwin-amd64-bootstrap.tbz )
)
@@ -30,6 +30,7 @@ kernel_linux? (
kernel_SunOS? (
x64-solaris? ( ${BOOTSTRAP_DIST}/go-solaris-amd64-bootstrap.tbz )
)
+)
"
if [[ ${PV} = 9999 ]]; then
@@ -52,9 +53,9 @@ HOMEPAGE="http://www.golang.org"
LICENSE="BSD"
SLOT="0/${PV}"
-IUSE=""
+IUSE="gccgo"
-DEPEND=""
+DEPEND="gccgo? ( >=sys-devel/gcc-5[go] )"
RDEPEND="!<dev-go/go-tools-0_pre20150902"
# These test data objects have writable/executable stacks.
@@ -146,6 +147,14 @@ src_unpack()
src_compile()
{
export GOROOT_BOOTSTRAP="${WORKDIR}"/go-$(go_os)-$(go_arch)-bootstrap
+ if use gccgo; then
+ mkdir -p "${GOROOT_BOOTSTRAP}/bin" || die
+ local go_binary=$(type -P go-5 2>/dev/null)
+ [[ -x ${go_binary} ]] || go_binary=$(
+ find "${EPREFIX}"/usr/${CHOST}/gcc-bin/*/go-5 | sort -V | tail -n1)
+ [[ -x ${go_binary} ]] || die "go-5: command not found"
+ ln -s "${go_binary}" "${GOROOT_BOOTSTRAP}/bin/go" || die
+ fi
export GOROOT_FINAL="${EPREFIX}"/usr/lib/go
export GOROOT="$(pwd)"
export GOBIN="${GOROOT}/bin"