diff options
author | V3n3RiX <venerix@koprulu.sector> | 2024-08-14 11:06:13 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2024-08-14 11:06:13 +0100 |
commit | e000645bea7492c9f5277722c0ada7e1ee0b4833 (patch) | |
tree | a604499d25e682002ec55cc5e7d14e0c53809199 /dev-lang/go | |
parent | be8708090362c01c6111c4b76f1e395c14d86e00 (diff) |
gentoo auto-resync : 14:08:2024 - 11:06:13
Diffstat (limited to 'dev-lang/go')
-rw-r--r-- | dev-lang/go/Manifest | 2 | ||||
-rw-r--r-- | dev-lang/go/go-1.23.0.ebuild | 162 |
2 files changed, 164 insertions, 0 deletions
diff --git a/dev-lang/go/Manifest b/dev-lang/go/Manifest index acd7a6f809f9..1cc82a893f59 100644 --- a/dev-lang/go/Manifest +++ b/dev-lang/go/Manifest @@ -2,7 +2,9 @@ AUX go-never-download-newer-toolchains.patch 368 BLAKE2B 0c90f46492af80622f430b2 AUX go-sets.conf 256 BLAKE2B 670afd72a2fa961e2b3882ac48d10e9d047af7a68f47bc8c8985b2de7a84022410fb1acfe2c710f8b3804ec3b043bf18c948478cf7d31c982cff47714b309cdf SHA512 028fba72c2d82ef893416970c27cb277be15f7c5c67773c0a62cd8ce2c192813ba851339596f10a6f5394c479e67b62dd4e4520379cc03f764ed4a4ab834fba6 DIST go1.21.13.src.tar.gz 26997630 BLAKE2B 41098fcd889b0501b2580933b144b317e28f86aee30352f32fafdc66f7607677a62927104b10702f01464fe3eff3ed2999c9913756ed8526df49f523c8a6f945 SHA512 f316984154ead8256d9ec0613e3cfef5699553387d87c24bb2a96265f986bf4450838e6451841def3713d65ebaa9bf55e36ff39c5690d79522e1c1ba7655be2f DIST go1.22.6.src.tar.gz 27561569 BLAKE2B 55ce88dc2039d68f14aea0792ed6a1b45c8e262aa73f76f852941aed12019318b3be7938c954fb7c03d7583f930f7a0e5164effc1ec10fc6d0fc282484390e49 SHA512 59f84ba390203271d9fe2d3f04624449d54d3bb73c2b6e54b5f7dc9e9e2dce2192bae07ef56a2afee871cff84d457b90f8a00f4433e072028b97af987f3799e1 +DIST go1.23.0.src.tar.gz 28163301 BLAKE2B 49e382dae5195e4a6544f9bd96b169a4c7a822544c7db07c69566063d3f6c21dbbac9991e7da1a0b946ee59ac8f65589b47edbb9856fed93d37e2bac18f61644 SHA512 5822124ca570662ac8dcec32a79196520ce355fe421d83372f8b8a97b3811de0739edcd7080a23f845cf700a6a26f3af6c93278f6ce485b93120afdd4f6c4f47 EBUILD go-1.21.13.ebuild 5204 BLAKE2B 2fe9369fbc565c10082d5d508c863739e24e85dd491cd3c27691ea3025f06bb94e976c8f109d26455a8560356fbebbaaa5e5d1e034a20b7648596c9f053807d9 SHA512 ed2806d6d1efb4d9194354468157129b9f27483f63ae166d66bb559541880d416254fa1ca39dc2022d485abda6fe771d8311c007eac78ef01a7ce38b9641ed19 EBUILD go-1.22.6.ebuild 4269 BLAKE2B 98523fc945a5383c10e91f37ec15c86a4a6cdd501ed0f4a2fb22ce8771b7d67f95c239a97bb6a4c34c5edf3050c76372afa3954bb843ef7164c89b0e61cf60a9 SHA512 c35a4c9e8eb764683cd9d53fc71e2ff7b5aec00d14f12e0d4a138d23b19974d1999e6c5cc6b5f977740ba5bb59eafb704fd4407395bbb18d276337dc6ed9efaa +EBUILD go-1.23.0.ebuild 4174 BLAKE2B 55fa5a577403deb55f35d277ef4e7b104381982fbeece7b2c6b45f04e0bf49c4ee5e45e6372e80a351017e34d43268081cf5816ae99469d5195a9dadae549271 SHA512 bf66b5a718f227b1163053ce86b187be4e2f80289f9aeb0b8beb5a3ec4a74130fe11d64f587af4059f2a745be4d4d44c66060dd27a4359d95c358001a03b2de4 EBUILD go-9999.ebuild 4274 BLAKE2B 7cbc81bac15c21d76bfadbc9b414ae9fbe7549a49ed2f9b9fae45bd00d6dfc304b054fef08f42f94be45d7c2defc3ebabce9d8f480db5e60c0c4a9e95cdcafd7 SHA512 9c9e3ce9713153f3316f54b96450deeb951c453b2320773771b047d12226db15d724157455fd6a218028d0a49b145c317019190083361f328b4d07001d197fd6 MISC metadata.xml 589 BLAKE2B 341e4c0e91d73ca668c1795035e1223eed60f85c724afd989ef1f8fb69649f7f6eaaf8a5228f6c8f587ffcc40a438c47d332fbe6866839f5a0829872a983f642 SHA512 fe58ddddfbd4d0d060516cb035592a80c0f48e125bb59c95d3c6fac0c182271e2a9ec9bd055b9cc8e6cb8c449e6c483bff4a23c362f532c24255febfdefc273a diff --git a/dev-lang/go/go-1.23.0.ebuild b/dev-lang/go/go-1.23.0.ebuild new file mode 100644 index 000000000000..56fac09b0188 --- /dev/null +++ b/dev-lang/go/go-1.23.0.ebuild @@ -0,0 +1,162 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +export CBUILD=${CBUILD:-${CHOST}} +export CTARGET=${CTARGET:-${CHOST}} + +# See "Bootstrap" in release notes +GO_BOOTSTRAP_MIN=1.20.14 +MY_PV=${PV/_/} + +inherit go-env 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="cpu_flags_x86_sse2" + +RDEPEND=" +arm? ( sys-devel/binutils[gold] ) +arm64? ( sys-devel/binutils[gold] )" +BDEPEND="|| ( + >=dev-lang/go-${GO_BOOTSTRAP_MIN} + >=dev-lang/go-bootstrap-${GO_BOOTSTRAP_MIN} )" + +# 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_tuple() { + echo "$(go-env_goos $@)_$(go-env_goarch $@)" +} + +go_cross_compile() { + [[ $(go_tuple ${CBUILD}) != $(go_tuple) ]] +} + +PATCHES=( + "${FILESDIR}"/go-never-download-newer-toolchains.patch +) + +src_compile() { + if has_version -b ">=dev-lang/go-${GO_BOOTSTRAP_MIN}"; then + export GOROOT_BOOTSTRAP="${BROOT}/usr/lib/go" + elif has_version -b ">=dev-lang/go-bootstrap-${GO_BOOTSTRAP_MIN}"; 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 + + # Go's build script does not use BUILD/HOST/TARGET consistently. :( + export GOHOSTARCH=$(go-env_goarch ${CBUILD}) + export GOHOSTOS=$(go-env_goos ${CBUILD}) + export CC=$(tc-getBUILD_CC) + + export GOARCH=$(go-env_goarch) + export GOOS=$(go-env_goos) + export CC_FOR_TARGET=$(tc-getCC) + export CXX_FOR_TARGET=$(tc-getCXX) + use arm && export GOARM=$(go-env_goarm) + use x86 && export GO386=$(go-env_go386) + + cd src + bash -x ./make.bash || die "build failed" +} + +src_test() { + go_cross_compile && return 0 + + cd src + + # https://github.com/golang/go/issues/42005 + rm cmd/link/internal/ld/fallocate_test.go || die + + PATH="${GOBIN}:${PATH}" \ + ./run.bash -no-rebuild -k || die "tests failed" + cd .. + rm -fr pkg/*_race || die + rm -fr pkg/obj/go-build || die +} + +src_install() { + dodir /usr/lib/go + # The use of cp is deliberate in order to retain permissions + cp -R api bin doc lib pkg misc src test "${ED}"/usr/lib/go + einstalldocs + + insinto /usr/lib/go + doins go.env VERSION* + + # 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" +} |