Gentoo Archives: gentoo-commits

From: Jason Zaman <perfinion@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/bazel/
Date: Thu, 31 Mar 2022 01:18:50
Message-Id: 1648688934.88d2c96be2b1be7bea774f960baec15c49a09386.perfinion@gentoo
1 commit: 88d2c96be2b1be7bea774f960baec15c49a09386
2 Author: Jason Zaman <perfinion <AT> gentoo <DOT> org>
3 AuthorDate: Mon Mar 21 05:17:22 2022 +0000
4 Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org>
5 CommitDate: Thu Mar 31 01:08:54 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=88d2c96b
7
8 dev-util/bazel: Bump 5.0.0
9
10 Closes: https://bugs.gentoo.org/832399
11 Package-Manager: Portage-3.0.30, Repoman-3.0.3
12 Signed-off-by: Jason Zaman <perfinion <AT> gentoo.org>
13
14 dev-util/bazel/Manifest | 1 +
15 dev-util/bazel/bazel-5.0.0.ebuild | 95 +++++++++++++++++++++++++++++++++++++++
16 2 files changed, 96 insertions(+)
17
18 diff --git a/dev-util/bazel/Manifest b/dev-util/bazel/Manifest
19 index 987213efe6b9..187f2c4ce9fe 100644
20 --- a/dev-util/bazel/Manifest
21 +++ b/dev-util/bazel/Manifest
22 @@ -1,2 +1,3 @@
23 DIST bazel-3.7.2-dist.zip 313677756 BLAKE2B cd6363762c68d25739a6bf6c13f10e191302a10b6fb7d97455effbc678d4f0b644c76115cad478aad7c09f703d9e594f4bdb8669ed6ab97d6a559a27723c510c SHA512 e8746ef5ec22feb95e9dbbddb3fb56cf8f49c80f326fc2a4e0ce2619607826fac22f46bfb995daee55bf9ffabb9d646b8454be2bce7b479da5cf2a7e5b3be62b
24 DIST bazel-4.2.2-dist.zip 279304631 BLAKE2B 2a32838e50b63c4b6400aced10085c6c9aacf28641ea555a44b9c4ed8991fc29658b4d420b26179e8eed0e00cfe7391e8eec84c7851f17493c74d1c5682427af SHA512 123f73dc87053e37705bb729f82bd722d6d2799fe106f79c51cf5566fb2771d824108cbe275aad55ae590b970c549008b433704cbf1245394769e950796eb8db
25 +DIST bazel-5.0.0-dist.zip 235894565 BLAKE2B 3798eb9111772809f0345e0c74bef38d8f9d44a7f20844f20aad187a2e177f4999ffa0e1cc1719e4284cdc7c72295bb903d32ce56821c72ee2908f4d939d0769 SHA512 2a9a972d1cce6b50f959fec3d37506914208169c8aa36e5ec5f9a27942e9beff1080a544a18e9bd5eb13dc434c1864cda0594e6da5b78c2f41085abf808c22d7
26
27 diff --git a/dev-util/bazel/bazel-5.0.0.ebuild b/dev-util/bazel/bazel-5.0.0.ebuild
28 new file mode 100644
29 index 000000000000..778608f34249
30 --- /dev/null
31 +++ b/dev-util/bazel/bazel-5.0.0.ebuild
32 @@ -0,0 +1,95 @@
33 +# Copyright 1999-2022 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=8
37 +
38 +inherit bash-completion-r1 bazel java-pkg-2 multiprocessing
39 +
40 +DESCRIPTION="Fast and correct automated build system"
41 +HOMEPAGE="https://bazel.build/"
42 +
43 +SRC_URI="https://github.com/bazelbuild/bazel/releases/download/${PV}/${P}-dist.zip"
44 +
45 +LICENSE="Apache-2.0"
46 +SLOT="0"
47 +KEYWORDS="~amd64"
48 +IUSE="examples tools"
49 +# strip corrupts the bazel binary
50 +# test fails with network-sandbox: An error occurred during the fetch of repository 'io_bazel_skydoc' (bug 690794)
51 +RESTRICT="strip test"
52 +RDEPEND=">=virtual/jdk-11:*"
53 +DEPEND="${RDEPEND}
54 + app-arch/unzip
55 + app-arch/zip"
56 +
57 +S="${WORKDIR}"
58 +
59 +pkg_setup() {
60 + if has ccache ${FEATURES}; then
61 + ewarn "${PN} usually fails to compile with ccache, you have been warned"
62 + fi
63 + java-pkg-2_pkg_setup
64 +}
65 +
66 +src_unpack() {
67 + # Only unpack the main distfile
68 + unpack ${P}-dist.zip
69 +}
70 +
71 +src_prepare() {
72 + default
73 +
74 + # F: fopen_wr
75 + # S: deny
76 + # P: /proc/self/setgroups
77 + # A: /proc/self/setgroups
78 + # R: /proc/24939/setgroups
79 + # C: /usr/lib/systemd/systemd
80 + addpredict /proc
81 +}
82 +
83 +src_compile() {
84 + export JAVA_HOME=$(java-config --jre-home) # so keepwork works
85 + export EXTRA_BAZEL_ARGS="--jobs=$(makeopts_jobs) $(bazel_get_flags)
86 + --java_runtime_version=local_jdk
87 + --tool_java_runtime_version=local_jdk"
88 + VERBOSE=yes ./compile.sh || die "Failed compiling bazel"
89 +
90 + ./scripts/generate_bash_completion.sh \
91 + --bazel=output/bazel \
92 + --output=bazel-complete.bash \
93 + --prepend=scripts/bazel-complete-header.bash \
94 + --prepend=scripts/bazel-complete-template.bash || die "Failed to generate bash completions"
95 +}
96 +
97 +src_test() {
98 + output/bazel test \
99 + --verbose_failures \
100 + --spawn_strategy=standalone \
101 + --genrule_strategy=standalone \
102 + --verbose_test_summary \
103 + examples/cpp:hello-success_test || die
104 + output/bazel shutdown
105 +}
106 +
107 +src_install() {
108 + dobin output/bazel
109 + newbashcomp bazel-complete.bash ${PN}
110 + bashcomp_alias ${PN} ibazel
111 + insinto /usr/share/zsh/site-functions
112 + doins scripts/zsh_completion/_bazel
113 +
114 + if use examples; then
115 + docinto examples
116 + dodoc -r examples/*
117 + docompress -x /usr/share/doc/${PF}/examples
118 + fi
119 + # could really build tools but I don't know which ones
120 + # are actually used
121 + if use tools; then
122 + docinto tools
123 + dodoc -r tools/*
124 + docompress -x /usr/share/doc/${PF}/tools
125 + docompress -x /usr/share/doc/${PF}/tools/build_defs/pkg/testdata
126 + fi
127 +}