summaryrefslogtreecommitdiff
path: root/dev-lang
diff options
context:
space:
mode:
Diffstat (limited to 'dev-lang')
-rw-r--r--dev-lang/Manifest.gzbin19351 -> 19354 bytes
-rw-r--r--dev-lang/dafny-bin/Manifest4
-rw-r--r--dev-lang/dafny-bin/dafny-bin-3.9.0.ebuild (renamed from dev-lang/dafny-bin/dafny-bin-3.7.3.ebuild)5
-rw-r--r--dev-lang/go/Manifest4
-rw-r--r--dev-lang/go/go-1.18.7.ebuild196
-rw-r--r--dev-lang/go/go-1.19.2.ebuild201
6 files changed, 406 insertions, 4 deletions
diff --git a/dev-lang/Manifest.gz b/dev-lang/Manifest.gz
index 93a3f8603b73..fbf96b813526 100644
--- a/dev-lang/Manifest.gz
+++ b/dev-lang/Manifest.gz
Binary files differ
diff --git a/dev-lang/dafny-bin/Manifest b/dev-lang/dafny-bin/Manifest
index b92c4e5aac3f..2c521fb36cd8 100644
--- a/dev-lang/dafny-bin/Manifest
+++ b/dev-lang/dafny-bin/Manifest
@@ -1,7 +1,7 @@
-DIST dafny-3.7.3-x64-ubuntu-16.04.zip 76169341 BLAKE2B eb8bee64a0bd39b8af0996e298590c83bcf306dbfda5bc486ef70b13187b4fc0131fd2b98d5eb1b87a3177b1f25c5cd64b82522e4d57cf1b0d2aa1eb34869789 SHA512 0bdda39e8ae22eff72bd57e4ef5f07495e27156b11ff553a2e1f76731d7daa5ce6ac4f4d8b16b3365eacbbd25bc81d88cbfece9a0350e2a0faac2a035f3d5561
DIST dafny-3.8.0-x64-ubuntu-16.04.zip 76181911 BLAKE2B 9fbae78bb08ed448a164188758c53de6eb928f16e941ee2830c5d8ed3980e3f4ccdd4f1b99c30061a5838ef96dd71ad0ac4a69ffdf45ca8a428e37cbd1f8049d SHA512 43628709dfe34d91fda3b723e4f9deacace463a4002c520d62b319f3618b2e62dec93e2fd913926e41c8ef75dd3535a909c4eeb2e58e00faa6ffdd1f028f8277
DIST dafny-3.8.1-x64-ubuntu-16.04.zip 76192825 BLAKE2B fbfe65f917fb1c04151969e466097ea5703b70fea5c2e04ed6ed756d05c3c46796951d641cca66c30b59d4b70dcee2bef9c7ccac6cd04fe3204b41a08910197c SHA512 ae10f912977827525902317a2215b3066f4271efd2dfdf314859b8c82cfb18ea881bafba5bde0d9f31f3b1429bef252774ca7a495f6661dff7f9f0d5fe042806
-EBUILD dafny-bin-3.7.3.ebuild 1166 BLAKE2B 066750b3d98c2d45365ac4fac90d43f823136a5df64fc81c6f035fe8a332ed15c1af46af5b52fd3f711377fb4204879c036fd4e7b3d5dbaca7072e8d1be9cd75 SHA512 17ec7f94bbc31b704fbd8707321e35ef2ae0dbf6f20137fab34f4c6dce5fc7c34bcde0022f4ed053c2257992ff7b6402c10f1954dccbcb1656a9c96b01e5c695
+DIST dafny-3.9.0-x64-ubuntu-16.04.zip 76348358 BLAKE2B aa217b8583a54f11e23769c214bff182025d7a8669a27f63ef3ee161640f1637d3eebc3e154c44d6cb0dc07060ac0bb3ba38dc7504af04c7a3c04425ee7437df SHA512 e595c80eed0c994a5e2f6cc34b18262f3401d7968e9da32449638591898998a56de70989240e8227ed6c40946205ba20542ac13e4e90cc597de657d81d389060
EBUILD dafny-bin-3.8.0.ebuild 1229 BLAKE2B a65e97fadfae1e22527a69db2d1ebf42be9fae233780727890c6938b8405c07818f2ed555a3786ce177e969d64398f95b6a1614767c75de63b80f456a769a48a SHA512 126232acf51c98a755d74d3aec72c7950448ed5f343e98936f387681d0de6ce365cb79eca300ae630f892afe0cc1b38ce9b7bcb054a07c8e1c80b25169c7a421
EBUILD dafny-bin-3.8.1.ebuild 1229 BLAKE2B a65e97fadfae1e22527a69db2d1ebf42be9fae233780727890c6938b8405c07818f2ed555a3786ce177e969d64398f95b6a1614767c75de63b80f456a769a48a SHA512 126232acf51c98a755d74d3aec72c7950448ed5f343e98936f387681d0de6ce365cb79eca300ae630f892afe0cc1b38ce9b7bcb054a07c8e1c80b25169c7a421
+EBUILD dafny-bin-3.9.0.ebuild 1187 BLAKE2B e2b627626e5fc6201744d9aa3fe69850759a0bcfad60fbd897261b64690bb83b03b514da15e8a4a2c3c063a54679ce353fa44fa3e2f4d40db309149bf61b9314 SHA512 ec9791c3d2ea90d4a22671a514c9fee759c51dc70dfd3be3203dd2b3c566843f45274602102b0bafd0dbbb20cf05c304154af1533126e4461a5f60f577e73c17
MISC metadata.xml 1814 BLAKE2B cf1e080cccf3392a44bbf4b94350cf2d83b4704120c193421e5b0952e36bd07d5d2079968c8fc39b4cfc78daf2fb6aa8e58e71b92d4cf1abe3a7cf4297edb750 SHA512 dfd3eb544a7e76ae7d40a993559291348c3ecb58d433f90b44cb67743879e2ca1f7bb249135e39a98b6c41dd32f439c165a4ad0e6a3bd7572f5786b346df70bb
diff --git a/dev-lang/dafny-bin/dafny-bin-3.7.3.ebuild b/dev-lang/dafny-bin/dafny-bin-3.9.0.ebuild
index 8601d4b64977..c7dbe567fbba 100644
--- a/dev-lang/dafny-bin/dafny-bin-3.7.3.ebuild
+++ b/dev-lang/dafny-bin/dafny-bin-3.9.0.ebuild
@@ -9,7 +9,7 @@ SRC_URI="https://github.com/dafny-lang/dafny/releases/download/v${PV}/dafny-${PV
LICENSE="MIT"
SLOT="0"
-KEYWORDS="-* ~amd64" # Binaries are compiled only for x86_64.
+KEYWORDS="-* ~amd64"
REQUIRED_USE="elibc_glibc"
RDEPEND="
@@ -28,7 +28,8 @@ src_prepare() {
# Remove bundled z3.
# NOTICE: New versions do not need the bundled one but older versions
# hardcoded the path relative to "dafny" binary.
- # While bumping make sure to verify that system's "z3" is used.
+ # While bumping make sure to verify that system's "z3" is used
+ # by, for example, compiling/verifying a simple dafny program.
rm -r z3 || die
}
diff --git a/dev-lang/go/Manifest b/dev-lang/go/Manifest
index d30e1da1eb00..5d3d9818b31b 100644
--- a/dev-lang/go/Manifest
+++ b/dev-lang/go/Manifest
@@ -1,9 +1,13 @@
AUX go-sets.conf 313 BLAKE2B 03e94776e317d34b72bfb8385b8b0dfa6a599a6086e4d0c9214e7b49293768947c21d9afb323ffcc7fd85ba0af72d9cb243dbb571eee9eb81de9400fd5f5e79c SHA512 7d01b98bc8d1b609183682dd942bd4c9fa757a98243c7de3cf6c497c7bc20b8cdbe59dd669ce4bb11f914a0e9b6d100e65cea2dffd99f38be50b18e0ecf66315
DIST go1.18.5.src.tar.gz 22847094 BLAKE2B 8edf133aa5b1fa4076db72bd7c63240db6cbd6b9b4725c2a71384ff302bee77e193bcfad6b55bfd31ee58f08fc59d9bbee5750d9227598fe402d6293863595ff SHA512 4ba69ad49b5c17963fdc39ae7f5360fa38950db39ec1fb9b52744d6a209abf177dab6bd587e7457c83a4fd265589907ec241d8b09d0eac76cf984243a14500ef
DIST go1.18.6.src.tar.gz 22865753 BLAKE2B fc86e509006e61434bcf6968aca345474560457be1573c836f24cd1d173d7cd515bbe70376d4231cd4318c77bd8e7c3af1101ded8403b3ca8f0afd08563a38ba SHA512 2af66b09bfe033b413eb7603a73a490319bf49fec0a2e20c40350e60b9ef35250a6dc8544c5fc67bd1ede55e242d056e7749f69ef500a38b1efe4b8f93078de3
+DIST go1.18.7.src.tar.gz 22872579 BLAKE2B 194ef3440c0e23c4409e433fa9c62419d9aa7c3445bacd45c905cb78b480882e220ca5cb0a45ebe071d8c6592db470832f9358b36b18af557a4684ef6872c456 SHA512 cf1ff024e94b900b87cc52d3ec04b0f7f853880a99c416791ad4b9af5f8e50ec82fbe00788bc8dcc184ef5ce1a9df17f5f5e95cf01c0c8138f28f53d691ca5d4
DIST go1.19.1.src.tar.gz 26527375 BLAKE2B 80e80189e7e94f0a6bcb5dfdccc56fa3fee82d461816606b5600f6238f8929bb230c74c527ca01a087024002f9e9eb807997bd43639a7af81774d731361ce3a2 SHA512 7e8cf557f05d5a537f9305bb9c19cf8ab9ce640376e5ea97ff0d490b016364936e8dfc129462760c4e817af01fdf09e3f815b88412f9985bb254dfa3167752c0
+DIST go1.19.2.src.tar.gz 26534465 BLAKE2B 9b1eb84a8d840facf69dde8f6263d08239b67b583b3b4fdf0aa5c03cb15c41c0dd6b10df61bfe7d1b02eeb0d1eb97fc5adeaa71e9745318c2648057be3f37259 SHA512 72901e5eaf1857b22bf62a82690579aa4bd8b8130f16416313d249600c99e1ae3c1451ac5c53138ce41dd39dd72dcf8d0f3592b98f4239754efcf4f8b0103cb4
EBUILD go-1.18.5.ebuild 4798 BLAKE2B 8857c2432424a27febc299a46ca61bfd267d9a1d2fad7116096e5938a519410d35bf90b61a1827e2ad769986b9406ecd0bf1b9197e64b8a176e0a8d9dbb600eb SHA512 9e2efbcb8652fd203e239626f2ace311dba12c591829ce00e4204f28c3d908adeca69d1a17855c2544f2f8bc5d88a636a3d1c806d36542788c1949204b5535b8
EBUILD go-1.18.6.ebuild 4799 BLAKE2B 0d764bfef4365902950fdf72ee7ba01a6d09791e342bfc12dc8f113634549b323d997f653399e62a9f5b47670607683580b42b83c8434521c3d99f77ab3123b5 SHA512 2104e572fd37817cf5b66a765bbd533c8ee93c82c4672059f68eba83210363664a16c8e7721ba92622f2238e52f0d12137b0a8d92e453946eed99adde8b57a4a
+EBUILD go-1.18.7.ebuild 4803 BLAKE2B d2b93e9fca1ebcc0619b6c72c724c95da3b7b0223f2d0ac95081096fcf2c5123f0c4f8284fc935450780545c1d408f71ad905ad12029c02dee9eec1f2e4f45b9 SHA512 356f3323b209c69113a81920367ac38793bf3d8599fa71d64838027da0db878430fa0856ec0d74db943752e211c2fbc410eec30fae3f15a4fb8cc53b15f63580
EBUILD go-1.19.1.ebuild 5055 BLAKE2B 495d5f984812d96ae6079cbbd1d4ebb8a0d0cc96e01950ec29e8ac008a8da99fe0f722adc8a7a30d829ef33c0fcb75562b6d7904c428550846fc23777c61abd3 SHA512 427faf40bee0c22c5f4df9e2aecbd09b4e6c8b38eb6206a2bc89dc99c2a10a61601b7b1e46c3d1ebbcb9243a3c23b86a9f8df1624523d5d05231be3f2e9f76a0
+EBUILD go-1.19.2.ebuild 5059 BLAKE2B 494ce3c3bf014b06d6024a2f89d96499c1924547c38617ada01fd4bf61329541d94df164b8c1682d9984ec34dd16278dc016853b32af8f4ef3afaac8c87b23d1 SHA512 91cd271b2c243b5ec3ed92d91f600d2af3e7ec24dee25d477f75d80cf9d86c106086de9af3a0d6c99cdf0e64ba4f350a72ae8d2f6108cb496ddbcbd84f03466f
EBUILD go-9999.ebuild 4798 BLAKE2B 50daca174e8bc89f747432e96bc7d66e6c7dd50320d0b4c97754bb90267d62b700d34c250a892fdf60c907fa5eb881dd7adb3e64eba7ceb240740bd90c399f83 SHA512 051671c9a99efe554f9ed66423a20d053546ba68fdbf8a900e4ef0a365622bf8fcc976c678e393ade4a5475e01ccc53668d61d98e1b976e69de030662498273a
MISC metadata.xml 537 BLAKE2B 8017fd0edeef2ec4b17f75e8686f6014ce3c3e39b7083c347f601de9b15f34896305d6041edd0bc2b6a0687a69827c9dcecb2f07ca5994f29a3c0f8014c0604b SHA512 5f6b42721e1602efab24f33955806c33ace6433e17b41755dbee47abea79a2744292148c330d6e5a04612b0b451545c32241236cc8f211c5e7cf22c8cdebc778
diff --git a/dev-lang/go/go-1.18.7.ebuild b/dev-lang/go/go-1.18.7.ebuild
new file mode 100644
index 000000000000..c340b5873264
--- /dev/null
+++ b/dev-lang/go/go-1.18.7.ebuild
@@ -0,0 +1,196 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+
+MY_PV=${PV/_/}
+
+inherit toolchain-funcs
+
+case ${PV} in
+*9999*)
+ EGIT_REPO_URI="https://github.com/golang/go.git"
+ inherit git-r3
+ ;;
+*)
+ SRC_URI="https://storage.googleapis.com/golang/go${MY_PV}.src.tar.gz "
+ S="${WORKDIR}"/go
+ case ${PV} in
+ *_beta*|*_rc*) ;;
+ *)
+ KEYWORDS="-* ~amd64 ~arm ~arm64 ~ppc64 ~riscv ~s390 ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x64-solaris"
+ ;;
+ esac
+esac
+
+DESCRIPTION="A concurrent garbage collected and typesafe programming language"
+HOMEPAGE="https://go.dev"
+
+LICENSE="BSD"
+SLOT="0/${PV}"
+IUSE="cpu_flags_x86_sse2"
+
+BDEPEND="|| (
+ dev-lang/go
+ dev-lang/go-bootstrap )"
+
+# the *.syso files have writable/executable stacks
+QA_EXECSTACK='*.syso'
+
+# Do not complain about CFLAGS, etc, since Go doesn't use them.
+QA_FLAGS_IGNORED='.*'
+
+# The tools in /usr/lib/go should not cause the multilib-strict check to fail.
+QA_MULTILIB_PATHS="usr/lib/go/pkg/tool/.*/.*"
+
+# This package triggers "unrecognized elf file(s)" notices on riscv.
+# https://bugs.gentoo.org/794046
+QA_PREBUILT='.*'
+
+# Do not strip this package. Stripping is unsupported upstream and may
+# fail.
+RESTRICT+=" strip"
+
+DOCS=(
+AUTHORS
+CONTRIBUTING.md
+CONTRIBUTORS
+PATENTS
+README.md
+)
+
+go_arch() {
+ # By chance most portage arch names match Go
+ local tc_arch=$(tc-arch $@)
+ case "${tc_arch}" in
+ x86) echo 386;;
+ x64-*) echo amd64;;
+ ppc64) [[ $(tc-endian $@) = big ]] && echo ppc64 || echo ppc64le ;;
+ riscv) echo riscv64 ;;
+ s390) echo s390x ;;
+ *) echo "${tc_arch}";;
+ esac
+}
+
+go_arm() {
+ case "${1:-${CHOST}}" in
+ armv5*) echo 5;;
+ armv6*) echo 6;;
+ armv7*) echo 7;;
+ *)
+ die "unknown GOARM for ${1:-${CHOST}}"
+ ;;
+ esac
+}
+
+go_os() {
+ case "${1:-${CHOST}}" in
+ *-linux*) echo linux;;
+ *-darwin*) echo darwin;;
+ *-freebsd*) echo freebsd;;
+ *-netbsd*) echo netbsd;;
+ *-openbsd*) echo openbsd;;
+ *-solaris*) echo solaris;;
+ *-cygwin*|*-interix*|*-winnt*)
+ echo windows
+ ;;
+ *)
+ die "unknown GOOS for ${1:-${CHOST}}"
+ ;;
+ esac
+}
+
+go_tuple() {
+ echo "$(go_os $@)_$(go_arch $@)"
+}
+
+go_cross_compile() {
+ [[ $(go_tuple ${CBUILD}) != $(go_tuple) ]]
+}
+
+src_compile() {
+ if has_version -b dev-lang/go; then
+ export GOROOT_BOOTSTRAP="${BROOT}/usr/lib/go"
+ elif has_version -b dev-lang/go-bootstrap; then
+ export GOROOT_BOOTSTRAP="${BROOT}/usr/lib/go-bootstrap"
+ else
+ eerror "Go cannot be built without go or go-bootstrap installed"
+ die "Should not be here, please report a bug"
+ fi
+
+ export GOROOT_FINAL="${EPREFIX}"/usr/lib/go
+ export GOROOT="${PWD}"
+ export GOBIN="${GOROOT}/bin"
+
+ # Go's build script does not use BUILD/HOST/TARGET consistently. :(
+ export GOHOSTARCH=$(go_arch ${CBUILD})
+ export GOHOSTOS=$(go_os ${CBUILD})
+ export CC=$(tc-getBUILD_CC)
+
+ export GOARCH=$(go_arch)
+ export GOOS=$(go_os)
+ export CC_FOR_TARGET=$(tc-getCC)
+ export CXX_FOR_TARGET=$(tc-getCXX)
+ use arm && export GOARM=$(go_arm)
+ use x86 && export GO386=$(usex cpu_flags_x86_sse2 '' 'softfloat')
+
+ cd src
+ bash -x ./make.bash || die "build failed"
+}
+
+src_test() {
+ go_cross_compile && return 0
+
+ cd src
+ PATH="${GOBIN}:${PATH}" \
+ ./run.bash -no-rebuild || die "tests failed"
+ cd ..
+ rm -fr pkg/*_race || die
+ rm -fr pkg/obj/go-build || die
+}
+
+src_install() {
+ # There is a known issue which requires the source tree to be installed [1].
+ # Once this is fixed, we can consider using the doc use flag to control
+ # installing the doc and src directories.
+ # The use of cp is deliberate in order to retain permissions
+ # [1] https://golang.org/issue/2775
+ dodir /usr/lib/go
+ cp -R api bin doc lib pkg misc src test "${ED}"/usr/lib/go
+ einstalldocs
+
+ # testdata directories are not needed on the installed system
+ rm -fr $(find "${ED}"/usr/lib/go -iname testdata -type d -print)
+
+ local bin_path
+ if go_cross_compile; then
+ bin_path="bin/$(go_tuple)"
+ else
+ bin_path=bin
+ fi
+ local f x
+ for x in ${bin_path}/*; do
+ f=${x##*/}
+ dosym ../lib/go/${bin_path}/${f} /usr/bin/${f}
+ done
+
+ # install the @golang-rebuild set for Portage
+ insinto /usr/share/portage/config/sets
+ newins "${FILESDIR}"/go-sets.conf go.conf
+}
+
+pkg_postinst() {
+ [[ -z ${REPLACING_VERSIONS} ]] && return
+ elog "After ${CATEGORY}/${PN} is updated it is recommended to rebuild"
+ elog "all packages compiled with previous versions of ${CATEGORY}/${PN}"
+ elog "due to the static linking nature of go."
+ elog "If this is not done, the packages compiled with the older"
+ elog "version of the compiler will not be updated until they are"
+ elog "updated individually, which could mean they will have"
+ elog "vulnerabilities."
+ elog "Run 'emerge @golang-rebuild' to rebuild all 'go' packages"
+ elog "See https://bugs.gentoo.org/752153 for more info"
+}
diff --git a/dev-lang/go/go-1.19.2.ebuild b/dev-lang/go/go-1.19.2.ebuild
new file mode 100644
index 000000000000..5e8e4e56890a
--- /dev/null
+++ b/dev-lang/go/go-1.19.2.ebuild
@@ -0,0 +1,201 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+
+MY_PV=${PV/_/}
+
+inherit toolchain-funcs
+
+case ${PV} in
+*9999*)
+ EGIT_REPO_URI="https://github.com/golang/go.git"
+ inherit git-r3
+ ;;
+*)
+ SRC_URI="https://storage.googleapis.com/golang/go${MY_PV}.src.tar.gz "
+ S="${WORKDIR}"/go
+ case ${PV} in
+ *_beta*|*_rc*) ;;
+ *)
+ KEYWORDS="-* ~amd64 ~arm ~arm64 ~loong ~mips ~ppc64 ~riscv ~s390 ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x64-solaris"
+ ;;
+ esac
+esac
+
+DESCRIPTION="A concurrent garbage collected and typesafe programming language"
+HOMEPAGE="https://go.dev"
+
+LICENSE="BSD"
+SLOT="0/${PV}"
+IUSE="abi_mips_o32 abi_mips_n64 cpu_flags_x86_sse2"
+
+BDEPEND="|| (
+ dev-lang/go
+ dev-lang/go-bootstrap )"
+
+# the *.syso files have writable/executable stacks
+QA_EXECSTACK='*.syso'
+
+# Do not complain about CFLAGS, etc, since Go doesn't use them.
+QA_FLAGS_IGNORED='.*'
+
+# The tools in /usr/lib/go should not cause the multilib-strict check to fail.
+QA_MULTILIB_PATHS="usr/lib/go/pkg/tool/.*/.*"
+
+# This package triggers "unrecognized elf file(s)" notices on riscv.
+# https://bugs.gentoo.org/794046
+QA_PREBUILT='.*'
+
+# Do not strip this package. Stripping is unsupported upstream and may
+# fail.
+RESTRICT+=" strip"
+
+DOCS=(
+ CONTRIBUTING.md
+ PATENTS
+ README.md
+ SECURITY.md
+)
+
+go_arch() {
+ # By chance most portage arch names match Go
+ local tc_arch=$(tc-arch $@)
+ case "${tc_arch}" in
+ x86) echo 386;;
+ x64-*) echo amd64;;
+ loong) echo loong64;;
+ mips) if use abi_mips_o32; then
+ [[ $(tc-endian $@) = big ]] && echo mips || echo mipsle
+ elif use abi_mips_n64; then
+ [[ $(tc-endian $@) = big ]] && echo mips64 || echo mips64le
+ fi ;;
+ ppc64) [[ $(tc-endian $@) = big ]] && echo ppc64 || echo ppc64le ;;
+ riscv) echo riscv64 ;;
+ s390) echo s390x ;;
+ *) echo "${tc_arch}";;
+ esac
+}
+
+go_arm() {
+ case "${1:-${CHOST}}" in
+ armv5*) echo 5;;
+ armv6*) echo 6;;
+ armv7*) echo 7;;
+ *)
+ die "unknown GOARM for ${1:-${CHOST}}"
+ ;;
+ esac
+}
+
+go_os() {
+ case "${1:-${CHOST}}" in
+ *-linux*) echo linux;;
+ *-darwin*) echo darwin;;
+ *-freebsd*) echo freebsd;;
+ *-netbsd*) echo netbsd;;
+ *-openbsd*) echo openbsd;;
+ *-solaris*) echo solaris;;
+ *-cygwin*|*-interix*|*-winnt*)
+ echo windows
+ ;;
+ *)
+ die "unknown GOOS for ${1:-${CHOST}}"
+ ;;
+ esac
+}
+
+go_tuple() {
+ echo "$(go_os $@)_$(go_arch $@)"
+}
+
+go_cross_compile() {
+ [[ $(go_tuple ${CBUILD}) != $(go_tuple) ]]
+}
+
+src_compile() {
+ if has_version -b dev-lang/go; then
+ export GOROOT_BOOTSTRAP="${BROOT}/usr/lib/go"
+ elif has_version -b dev-lang/go-bootstrap; then
+ export GOROOT_BOOTSTRAP="${BROOT}/usr/lib/go-bootstrap"
+ else
+ eerror "Go cannot be built without go or go-bootstrap installed"
+ die "Should not be here, please report a bug"
+ fi
+
+ export GOROOT_FINAL="${EPREFIX}"/usr/lib/go
+ export GOROOT="${PWD}"
+ export GOBIN="${GOROOT}/bin"
+
+ # Go's build script does not use BUILD/HOST/TARGET consistently. :(
+ export GOHOSTARCH=$(go_arch ${CBUILD})
+ export GOHOSTOS=$(go_os ${CBUILD})
+ export CC=$(tc-getBUILD_CC)
+
+ export GOARCH=$(go_arch)
+ export GOOS=$(go_os)
+ export CC_FOR_TARGET=$(tc-getCC)
+ export CXX_FOR_TARGET=$(tc-getCXX)
+ use arm && export GOARM=$(go_arm)
+ use x86 && export GO386=$(usex cpu_flags_x86_sse2 '' 'softfloat')
+
+ cd src
+ bash -x ./make.bash || die "build failed"
+}
+
+src_test() {
+ go_cross_compile && return 0
+
+ cd src
+ PATH="${GOBIN}:${PATH}" \
+ ./run.bash -no-rebuild || die "tests failed"
+ cd ..
+ rm -fr pkg/*_race || die
+ rm -fr pkg/obj/go-build || die
+}
+
+src_install() {
+ # There is a known issue which requires the source tree to be installed [1].
+ # Once this is fixed, we can consider using the doc use flag to control
+ # installing the doc and src directories.
+ # The use of cp is deliberate in order to retain permissions
+ # [1] https://golang.org/issue/2775
+ dodir /usr/lib/go
+ cp -R api bin doc lib pkg misc src test "${ED}"/usr/lib/go
+ einstalldocs
+
+ # testdata directories are not needed on the installed system
+ rm -fr $(find "${ED}"/usr/lib/go -iname testdata -type d -print)
+
+ local bin_path
+ if go_cross_compile; then
+ bin_path="bin/$(go_tuple)"
+ else
+ bin_path=bin
+ fi
+ local f x
+ for x in ${bin_path}/*; do
+ f=${x##*/}
+ dosym ../lib/go/${bin_path}/${f} /usr/bin/${f}
+ done
+
+ # install the @golang-rebuild set for Portage
+ insinto /usr/share/portage/config/sets
+ newins "${FILESDIR}"/go-sets.conf go.conf
+}
+
+pkg_postinst() {
+ [[ -z ${REPLACING_VERSIONS} ]] && return
+ elog "After ${CATEGORY}/${PN} is updated it is recommended to rebuild"
+ elog "all packages compiled with previous versions of ${CATEGORY}/${PN}"
+ elog "due to the static linking nature of go."
+ elog "If this is not done, the packages compiled with the older"
+ elog "version of the compiler will not be updated until they are"
+ elog "updated individually, which could mean they will have"
+ elog "vulnerabilities."
+ elog "Run 'emerge @golang-rebuild' to rebuild all 'go' packages"
+ elog "See https://bugs.gentoo.org/752153 for more info"
+}