summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Zaman <perfinion@gentoo.org>2022-03-20 22:17:22 -0700
committerJason Zaman <perfinion@gentoo.org>2022-03-30 18:08:54 -0700
commit88d2c96be2b1be7bea774f960baec15c49a09386 (patch)
tree126e55bbe8049d72a3f296574c97614717c0e2e1 /dev-util/bazel
parentsys-apps/util-linux: fix verify-sig BDEPEND (conditional only) (diff)
downloadgentoo-88d2c96be2b1be7bea774f960baec15c49a09386.tar.gz
gentoo-88d2c96be2b1be7bea774f960baec15c49a09386.tar.bz2
gentoo-88d2c96be2b1be7bea774f960baec15c49a09386.zip
dev-util/bazel: Bump 5.0.0
Closes: https://bugs.gentoo.org/832399 Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Jason Zaman <perfinion@gentoo.org>
Diffstat (limited to 'dev-util/bazel')
-rw-r--r--dev-util/bazel/Manifest1
-rw-r--r--dev-util/bazel/bazel-5.0.0.ebuild95
2 files changed, 96 insertions, 0 deletions
diff --git a/dev-util/bazel/Manifest b/dev-util/bazel/Manifest
index 987213efe6b9..187f2c4ce9fe 100644
--- a/dev-util/bazel/Manifest
+++ b/dev-util/bazel/Manifest
@@ -1,2 +1,3 @@
DIST bazel-3.7.2-dist.zip 313677756 BLAKE2B cd6363762c68d25739a6bf6c13f10e191302a10b6fb7d97455effbc678d4f0b644c76115cad478aad7c09f703d9e594f4bdb8669ed6ab97d6a559a27723c510c SHA512 e8746ef5ec22feb95e9dbbddb3fb56cf8f49c80f326fc2a4e0ce2619607826fac22f46bfb995daee55bf9ffabb9d646b8454be2bce7b479da5cf2a7e5b3be62b
DIST bazel-4.2.2-dist.zip 279304631 BLAKE2B 2a32838e50b63c4b6400aced10085c6c9aacf28641ea555a44b9c4ed8991fc29658b4d420b26179e8eed0e00cfe7391e8eec84c7851f17493c74d1c5682427af SHA512 123f73dc87053e37705bb729f82bd722d6d2799fe106f79c51cf5566fb2771d824108cbe275aad55ae590b970c549008b433704cbf1245394769e950796eb8db
+DIST bazel-5.0.0-dist.zip 235894565 BLAKE2B 3798eb9111772809f0345e0c74bef38d8f9d44a7f20844f20aad187a2e177f4999ffa0e1cc1719e4284cdc7c72295bb903d32ce56821c72ee2908f4d939d0769 SHA512 2a9a972d1cce6b50f959fec3d37506914208169c8aa36e5ec5f9a27942e9beff1080a544a18e9bd5eb13dc434c1864cda0594e6da5b78c2f41085abf808c22d7
diff --git a/dev-util/bazel/bazel-5.0.0.ebuild b/dev-util/bazel/bazel-5.0.0.ebuild
new file mode 100644
index 000000000000..778608f34249
--- /dev/null
+++ b/dev-util/bazel/bazel-5.0.0.ebuild
@@ -0,0 +1,95 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 bazel java-pkg-2 multiprocessing
+
+DESCRIPTION="Fast and correct automated build system"
+HOMEPAGE="https://bazel.build/"
+
+SRC_URI="https://github.com/bazelbuild/bazel/releases/download/${PV}/${P}-dist.zip"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="examples tools"
+# strip corrupts the bazel binary
+# test fails with network-sandbox: An error occurred during the fetch of repository 'io_bazel_skydoc' (bug 690794)
+RESTRICT="strip test"
+RDEPEND=">=virtual/jdk-11:*"
+DEPEND="${RDEPEND}
+ app-arch/unzip
+ app-arch/zip"
+
+S="${WORKDIR}"
+
+pkg_setup() {
+ if has ccache ${FEATURES}; then
+ ewarn "${PN} usually fails to compile with ccache, you have been warned"
+ fi
+ java-pkg-2_pkg_setup
+}
+
+src_unpack() {
+ # Only unpack the main distfile
+ unpack ${P}-dist.zip
+}
+
+src_prepare() {
+ default
+
+ # F: fopen_wr
+ # S: deny
+ # P: /proc/self/setgroups
+ # A: /proc/self/setgroups
+ # R: /proc/24939/setgroups
+ # C: /usr/lib/systemd/systemd
+ addpredict /proc
+}
+
+src_compile() {
+ export JAVA_HOME=$(java-config --jre-home) # so keepwork works
+ export EXTRA_BAZEL_ARGS="--jobs=$(makeopts_jobs) $(bazel_get_flags)
+ --java_runtime_version=local_jdk
+ --tool_java_runtime_version=local_jdk"
+ VERBOSE=yes ./compile.sh || die "Failed compiling bazel"
+
+ ./scripts/generate_bash_completion.sh \
+ --bazel=output/bazel \
+ --output=bazel-complete.bash \
+ --prepend=scripts/bazel-complete-header.bash \
+ --prepend=scripts/bazel-complete-template.bash || die "Failed to generate bash completions"
+}
+
+src_test() {
+ output/bazel test \
+ --verbose_failures \
+ --spawn_strategy=standalone \
+ --genrule_strategy=standalone \
+ --verbose_test_summary \
+ examples/cpp:hello-success_test || die
+ output/bazel shutdown
+}
+
+src_install() {
+ dobin output/bazel
+ newbashcomp bazel-complete.bash ${PN}
+ bashcomp_alias ${PN} ibazel
+ insinto /usr/share/zsh/site-functions
+ doins scripts/zsh_completion/_bazel
+
+ if use examples; then
+ docinto examples
+ dodoc -r examples/*
+ docompress -x /usr/share/doc/${PF}/examples
+ fi
+ # could really build tools but I don't know which ones
+ # are actually used
+ if use tools; then
+ docinto tools
+ dodoc -r tools/*
+ docompress -x /usr/share/doc/${PF}/tools
+ docompress -x /usr/share/doc/${PF}/tools/build_defs/pkg/testdata
+ fi
+}