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 )
)
kernel_SunOS? (
x64-solaris? ( ${BOOTSTRAP_DIST}/go-solaris-amd64-bootstrap.tbz )
)
+)
"
if [[ ${PV} = 9999 ]]; then
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.
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"
Rob Pike. It has garbage collection, coroutines, communication
channels and a clean syntax.
</longdescription>
+ <use>
+ <flag name="gccgo">Enable bootstrapping using gccgo</flag>
+ </use>
</pkgmetadata>