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