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: Mon, 11 Jun 2018 18:24:26
Message-Id: 1528741287.59832c2ae8b20635e3ae3f34ce426bedbda0205a.perfinion@gentoo
1 commit: 59832c2ae8b20635e3ae3f34ce426bedbda0205a
2 Author: Jason Zaman <perfinion <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jun 10 05:30:52 2018 +0000
4 Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org>
5 CommitDate: Mon Jun 11 18:21:27 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=59832c2a
7
8 dev-util/bazel: bump 0.14.1
9
10 Package-Manager: Portage-2.3.40, Repoman-2.3.9
11
12 dev-util/bazel/Manifest | 2 +
13 dev-util/bazel/bazel-0.14.1.ebuild | 141 +++++++++++++++++++++++++++++++++++++
14 2 files changed, 143 insertions(+)
15
16 diff --git a/dev-util/bazel/Manifest b/dev-util/bazel/Manifest
17 index f54010da7c1..1d86787612f 100644
18 --- a/dev-util/bazel/Manifest
19 +++ b/dev-util/bazel/Manifest
20 @@ -1,3 +1,5 @@
21 DIST bazel-0.10.1-dist.zip 92973197 BLAKE2B a1d681407e2c72a57b3dcbb5e2afc49e59670be65da3d7d038dc3b8593bc0ab5b4a06c8dd8fc8a617a92eef2fc26a049b6de9a1eab0d05f31efb2fbeeb9ce711 SHA512 1894c951fd39a084011f89dd0d458e182525c2bfd6c80da071865e981e21a8c2b8363530ab53af18e6deae4a488744d6d2b7a5a4acf04715c2e26560a01df707
22 DIST bazel-0.13.0-dist.zip 90105262 BLAKE2B cb065025524123babef187bac2e1f54f43645d08cb1282a5fe8f8c8b090e595570646072e2380836e2c43403f7953f97321becc24b743d7b9ab43ad208cf2c2d SHA512 3c128e551cff1b685250a68892ca3e1ad6be8b152ee2b8eb527c94adbb8fd50c70e703a363bb938916275030ddb14d756c14e4dc238e7a7b40289c700c5d53c7
23 +DIST bazel-0.14.1-dist.zip 89415405 BLAKE2B 7be5d4630d024d235a66f6bdf495c282b04a4034dde156c50d37a7e2eb3bf98df0caead7887f421b664fe92486e6baa5cd90e61b1e82b07b1691dc509ab93a68 SHA512 02c7125438f060d8e5e25b91ce3ca76fac6681b4f12033d807955a4ca5a5c22a3508a7229581b7349f35f343911f8408f43f8d78d54601277576dd32539e4681
24 DIST bazel-0.7.0-dist.zip 84669893 BLAKE2B 2f8bbe3a48224a797bdebdaad8f7c403c8b0232ada5eee8c8619f241e9670dda311b9280f48b5e2013079f959891d94f55aee2af0dfae9fc4f6a486663fa245d SHA512 039ab6a04fd4422bd14503187e6cc0d07301723b3ecae906606fa12ccea72190d82237899c103c1adfdf05dc8672887790780ddfb4cce87cd590adbde3d3f6d4
25 +DIST google-desugar_jdk_libs-f5e6d80c6b4ec6b0a46603f72b015d45cf3c11cd.zip 1056996 BLAKE2B bf168c41a9958bcdc679a40d1e88911c6af0e47207362204326b712e0129b37348360a855f44af8b76acc46108ac89a707d0c0f793500c513a919070248939b9 SHA512 40cb9ffcaa3c57c69bcbec7b070fad5865e7317817049b7588dd42899054eb97cd17cb0019df99ad2324ed8e2efd8334cd83ace758a4c2d3f453503ccf54a91e
26
27 diff --git a/dev-util/bazel/bazel-0.14.1.ebuild b/dev-util/bazel/bazel-0.14.1.ebuild
28 new file mode 100644
29 index 00000000000..b972de19c2d
30 --- /dev/null
31 +++ b/dev-util/bazel/bazel-0.14.1.ebuild
32 @@ -0,0 +1,141 @@
33 +# Copyright 1999-2018 Gentoo Foundation
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 +bazel_external_uris="https://github.com/google/desugar_jdk_libs/archive/f5e6d80c6b4ec6b0a46603f72b015d45cf3c11cd.zip -> google-desugar_jdk_libs-f5e6d80c6b4ec6b0a46603f72b015d45cf3c11cd.zip"
44 +SRC_URI="https://github.com/bazelbuild/bazel/releases/download/${PV}/${P}-dist.zip
45 + ${bazel_external_uris}"
46 +
47 +LICENSE="Apache-2.0"
48 +SLOT="0"
49 +KEYWORDS="~amd64"
50 +IUSE="examples tools zsh-completion"
51 +# strip corrupts the bazel binary
52 +RESTRICT="strip"
53 +RDEPEND="virtual/jdk:1.8"
54 +DEPEND="${RDEPEND}
55 + app-arch/unzip
56 + app-arch/zip"
57 +
58 +S="${WORKDIR}"
59 +
60 +bazel-get-flags() {
61 + local i fs=()
62 + for i in ${CFLAGS}; do
63 + fs+=( "--copt=${i}" "--host_copt=${i}" )
64 + done
65 + for i in ${CXXFLAGS}; do
66 + fs+=( "--cxxopt=${i}" "--host_cxxopt=${i}" )
67 + done
68 + for i in ${CPPFLAGS}; do
69 + fs+=( "--copt=${i}" "--host_copt=${i}" )
70 + fs+=( "--cxxopt=${i}" "--host_cxxopt=${i}" )
71 + done
72 + for i in ${LDFLAGS}; do
73 + fs+=( "--linkopt=${i}" "--host_linkopt=${i}" )
74 + done
75 + echo "${fs[*]}"
76 +}
77 +
78 +load_distfiles() {
79 + # Populate the bazel distdir to fetch from since it cannot use the network
80 + local s d uri rename
81 + mkdir -p "${T}/bazel-distdir" || die "failed to create distdir"
82 +
83 + while read uri rename d; do
84 + [[ -z "$uri" ]] && continue
85 + if [[ "$rename" == "->" ]]; then
86 + s="${uri##*/}"
87 + einfo "Copying $d to bazel distdir $s ..."
88 + else
89 + s="${uri##*/}"
90 + d="${s}"
91 + einfo "Copying $d to bazel distdir ..."
92 + fi
93 + cp "${DISTDIR}/${d}" "${T}/bazel-distdir/${s}" || die
94 + done <<< "${bazel_external_uris}"
95 +}
96 +
97 +pkg_setup() {
98 + echo ${PATH} | grep -q ccache && \
99 + ewarn "${PN} usually fails to compile with ccache, you have been warned"
100 + java-pkg-2_pkg_setup
101 +}
102 +
103 +src_unpack() {
104 + # Only unpack the main distfile
105 + unpack ${P}-dist.zip
106 +}
107 +
108 +src_prepare() {
109 + load_distfiles
110 + default
111 +
112 + # F: fopen_wr
113 + # S: deny
114 + # P: /proc/self/setgroups
115 + # A: /proc/self/setgroups
116 + # R: /proc/24939/setgroups
117 + # C: /usr/lib/systemd/systemd
118 + addpredict /proc
119 +
120 + # Use standalone strategy to deactivate the bazel sandbox, since it
121 + # conflicts with FEATURES=sandbox.
122 + cat > "${T}/bazelrc" <<-EOF
123 + build --verbose_failures
124 + build --spawn_strategy=standalone --genrule_strategy=standalone
125 +
126 + build --experimental_distdir=${T}/bazel-distdir
127 + build --jobs=$(makeopts_jobs) $(bazel-get-flags)
128 +
129 + test --verbose_failures --verbose_test_summary
130 + test --spawn_strategy=standalone --genrule_strategy=standalone
131 + EOF
132 +
133 + echo "import ${T}/bazelrc" >> "${S}/.bazelrc"
134 +}
135 +
136 +src_compile() {
137 + export EXTRA_BAZEL_ARGS="--jobs=$(makeopts_jobs)"
138 + VERBOSE=yes ./compile.sh || die
139 + output/bazel --bazelrc="${T}/bazelrc" build scripts:bazel-complete.bash || die
140 + mv bazel-bin/scripts/bazel-complete.bash output/ || die
141 +}
142 +
143 +src_test() {
144 + output/bazel test \
145 + --verbose_failures \
146 + --spawn_strategy=standalone \
147 + --genrule_strategy=standalone \
148 + --verbose_test_summary \
149 + examples/cpp:hello-success_test || die
150 +}
151 +
152 +src_install() {
153 + output/bazel shutdown
154 + dobin output/bazel
155 + newbashcomp output/bazel-complete.bash ${PN}
156 + bashcomp_alias ${PN} ibazel
157 + if use zsh-completion ; then
158 + insinto /usr/share/zsh/site-functions
159 + doins scripts/zsh_completion/_bazel
160 + fi
161 + if use examples; then
162 + docinto examples
163 + dodoc -r examples/*
164 + docompress -x /usr/share/doc/${PF}/examples
165 + fi
166 + # could really build tools but I don't know which ones
167 + # are actually used
168 + if use tools; then
169 + docinto tools
170 + dodoc -r tools/*
171 + docompress -x /usr/share/doc/${PF}/tools
172 + fi
173 +}