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: Sat, 17 Nov 2018 17:32:16
Message-Id: 1542475879.48acaad70cd384e76be3aeea79b5a11b4f762fe6.perfinion@gentoo
1 commit: 48acaad70cd384e76be3aeea79b5a11b4f762fe6
2 Author: Jason Zaman <perfinion <AT> gentoo <DOT> org>
3 AuthorDate: Fri Nov 16 08:17:01 2018 +0000
4 Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org>
5 CommitDate: Sat Nov 17 17:31:19 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=48acaad7
7
8 dev-util/bazel: bump to 0.19.0
9
10 Closes: https://bugs.gentoo.org/669950
11 Signed-off-by: Jason Zaman <perfinion <AT> gentoo.org>
12 Package-Manager: Portage-2.3.51, Repoman-2.3.11
13
14 dev-util/bazel/Manifest | 1 +
15 dev-util/bazel/bazel-0.19.0.ebuild | 125 +++++++++++++++++++++++++++++++++++++
16 2 files changed, 126 insertions(+)
17
18 diff --git a/dev-util/bazel/Manifest b/dev-util/bazel/Manifest
19 index 118c5d73044..5947b51ba1c 100644
20 --- a/dev-util/bazel/Manifest
21 +++ b/dev-util/bazel/Manifest
22 @@ -1,2 +1,3 @@
23 DIST bazel-0.17.2-dist.zip 79230155 BLAKE2B 62a60011f9605a1d615e648fdbb98b193561e1d86a7562ccb10fdbb8b6986e17a72c4076dbdbf6baf8a7af83e320af2c4e4b65b5b2101d845597ddd688194ba5 SHA512 0d277e20eac6fc972a31be1c77a750f6585d16beabfe7dd096db4103f0f191958aa83b52203b91d4df5b486ff20004c0b4b22125e58379f64f68abc4a87ac326
24 DIST bazel-0.18.0-dist.zip 86890953 BLAKE2B 53da2c2d4467f1f7dd2e613a347acd0ea547bd41fe49fa39cbbcb92c337dca43412ac9b65abf7a3e00c322b8fea075cbdef0da5b064bf4e22aaaa4c545c539de SHA512 128e1041ae0d85be26933bb107b406ca4ab177f00eec2ee1d791ec9089c0cb384857b532498276480d1063b82e7a9a809b9f8a0d0715260534c3e3d202d6cf13
25 +DIST bazel-0.19.0-dist.zip 87333329 BLAKE2B a9a0002b6a1dc98d3c753b9e37001f41c0e9b3e8628600d10d7ffb379686a2fef33032b8264e72cb787135be0a5a3c26aa452320b309da10ed8a1f8fe6667046 SHA512 ea67fb4d13487d24a0442084f42ff3c082a107c56a06d882f579064f17c545d6e9b5f0c4d724238c22e9b3bad12c68c60c58b59f82d9e957fe3af222d44bc969
26
27 diff --git a/dev-util/bazel/bazel-0.19.0.ebuild b/dev-util/bazel/bazel-0.19.0.ebuild
28 new file mode 100644
29 index 00000000000..dda30d67945
30 --- /dev/null
31 +++ b/dev-util/bazel/bazel-0.19.0.ebuild
32 @@ -0,0 +1,125 @@
33 +# Copyright 1999-2018 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=6
37 +
38 +inherit bash-completion-r1 java-pkg-2 multiprocessing
39 +
40 +DESCRIPTION="Fast and correct automated build system"
41 +HOMEPAGE="http://bazel.io/"
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 +RESTRICT="strip"
51 +RDEPEND="virtual/jdk:1.8"
52 +DEPEND="${RDEPEND}
53 + app-arch/unzip"
54 +
55 +S="${WORKDIR}"
56 +QA_FLAGS_IGNORED="usr/bin/bazel"
57 +
58 +bazel-get-flags() {
59 + local i fs=()
60 + for i in ${CFLAGS}; do
61 + fs+=( "--copt=${i}" "--host_copt=${i}" )
62 + done
63 + for i in ${CXXFLAGS}; do
64 + fs+=( "--cxxopt=${i}" "--host_cxxopt=${i}" )
65 + done
66 + for i in ${CPPFLAGS}; do
67 + fs+=( "--copt=${i}" "--host_copt=${i}" )
68 + fs+=( "--cxxopt=${i}" "--host_cxxopt=${i}" )
69 + done
70 + for i in ${LDFLAGS}; do
71 + fs+=( "--linkopt=${i}" "--host_linkopt=${i}" )
72 + done
73 + echo "${fs[*]}"
74 +}
75 +
76 +pkg_setup() {
77 + echo ${PATH} | grep -q ccache && \
78 + ewarn "${PN} usually fails to compile with ccache, you have been warned"
79 + java-pkg-2_pkg_setup
80 +}
81 +
82 +src_unpack() {
83 + # Only unpack the main distfile
84 + unpack ${P}-dist.zip
85 +}
86 +
87 +src_prepare() {
88 + default
89 +
90 + sed -i 's@//src:bazel@//src:bazel_nojdk@' scripts/BUILD || die
91 +
92 + # F: fopen_wr
93 + # S: deny
94 + # P: /proc/self/setgroups
95 + # A: /proc/self/setgroups
96 + # R: /proc/24939/setgroups
97 + # C: /usr/lib/systemd/systemd
98 + addpredict /proc
99 +
100 + # Use standalone strategy to deactivate the bazel sandbox, since it
101 + # conflicts with FEATURES=sandbox.
102 + cat > "${T}/bazelrc" <<-EOF
103 + build --verbose_failures
104 + build --spawn_strategy=standalone --genrule_strategy=standalone
105 +
106 + build --distdir=${S}/derived/distdir/
107 + build --jobs=$(makeopts_jobs) $(bazel-get-flags)
108 +
109 + test --verbose_failures --verbose_test_summary
110 + test --spawn_strategy=standalone --genrule_strategy=standalone
111 + EOF
112 +}
113 +
114 +src_compile() {
115 + export EXTRA_BAZEL_ARGS="--jobs=$(makeopts_jobs)"
116 + VERBOSE=yes ./compile.sh || die
117 +
118 + local OPTS=""
119 + if [[ $(java-config -g PROVIDES_VERSION) == "1.8" ]]; then
120 + OPTS="--java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8"
121 + OPTS+=" --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8"
122 + fi
123 +
124 + output/bazel --bazelrc="${T}/bazelrc" build ${OPTS} //scripts:bazel-complete.bash || die
125 + output/bazel shutdown
126 +}
127 +
128 +src_test() {
129 + output/bazel test \
130 + --verbose_failures \
131 + --spawn_strategy=standalone \
132 + --genrule_strategy=standalone \
133 + --verbose_test_summary \
134 + examples/cpp:hello-success_test || die
135 + output/bazel shutdown
136 +}
137 +
138 +src_install() {
139 + dobin output/bazel
140 + newbashcomp bazel-bin/scripts/bazel-complete.bash ${PN}
141 + bashcomp_alias ${PN} ibazel
142 + insinto /usr/share/zsh/site-functions
143 + doins scripts/zsh_completion/_bazel
144 +
145 + if use examples; then
146 + docinto examples
147 + dodoc -r examples/*
148 + docompress -x /usr/share/doc/${PF}/examples
149 + fi
150 + # could really build tools but I don't know which ones
151 + # are actually used
152 + if use tools; then
153 + docinto tools
154 + dodoc -r tools/*
155 + docompress -x /usr/share/doc/${PF}/tools
156 + fi
157 +}