Retirement: packages reassigment bicatali
[gentoo.git] / dev-util / bazel / bazel-0.5.4.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit bash-completion-r1 java-pkg-2
7
8 DESCRIPTION="Fast and correct automated build system"
9 HOMEPAGE="http://bazel.io/"
10 SRC_URI="https://github.com/bazelbuild/bazel/releases/download/${PV}/${P}-dist.zip"
11
12 LICENSE="Apache-2.0"
13 SLOT="0"
14 KEYWORDS="~amd64"
15 IUSE="examples tools zsh-completion"
16 # strip corrupts the bazel binary
17 RESTRICT="strip"
18 RDEPEND="virtual/jdk:1.8"
19 DEPEND="${RDEPEND}
20         app-arch/unzip
21         app-arch/zip"
22
23 S="${WORKDIR}"
24
25 pkg_setup() {
26         echo ${PATH} | grep -q ccache && \
27                 ewarn "${PN} usually fails to compile with ccache, you have been warned"
28         java-pkg-2_pkg_setup
29 }
30
31 src_compile() {
32         # F: fopen_wr
33         # S: deny
34         # P: /proc/self/setgroups
35         # A: /proc/self/setgroups
36         # R: /proc/24939/setgroups
37         # C: /usr/lib/systemd/systemd
38         addpredict /proc
39         VERBOSE=yes ./compile.sh || die
40         # Use standalone strategy to deactivate the bazel sandbox, since it
41         # conflicts with FEATURES=sandbox.
42         echo "build --verbose_failures --spawn_strategy=standalone --genrule_strategy=standalone" \
43                 > "${T}/bazelrc" || die
44         output/bazel --bazelrc="${T}/bazelrc" build scripts:bazel-complete.bash || die
45         mv bazel-bin/scripts/bazel-complete.bash output/ || die
46 }
47
48 src_test() {
49         output/bazel test \
50                 --verbose_failures \
51                 --spawn_strategy=standalone \
52                 --genrule_strategy=standalone \
53                 --verbose_test_summary \
54                 examples/cpp:hello-success_test || die
55 }
56
57 src_install() {
58         output/bazel shutdown
59         dobin output/bazel
60         newbashcomp output/bazel-complete.bash ${PN}
61         if use zsh-completion ; then
62                 insinto /usr/share/zsh/site-functions
63                 doins scripts/zsh_completion/_bazel
64         fi
65         if use examples; then
66                 docinto examples
67                 dodoc -r examples/*
68                 docompress -x /usr/share/doc/${PF}/examples
69         fi
70         # could really build tools but I don't know which ones
71         # are actually used
72         if use tools; then
73                 docinto tools
74                 dodoc -r tools/*
75                 docompress -x /usr/share/doc/${PF}/tools
76         fi
77 }