Gentoo Archives: gentoo-commits

From: Sebastien Fabbro <bicatali@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/bazel/
Date: Sat, 29 Oct 2016 00:52:31
Message-Id: 1477702292.3609f624e1e5179c4d1ddaccc876a38ec5ab7de3.bicatali@gentoo
1 commit: 3609f624e1e5179c4d1ddaccc876a38ec5ab7de3
2 Author: Sébastien Fabbro <bicatali <AT> gentoo <DOT> org>
3 AuthorDate: Sat Oct 29 00:51:32 2016 +0000
4 Commit: Sebastien Fabbro <bicatali <AT> gentoo <DOT> org>
5 CommitDate: Sat Oct 29 00:51:32 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3609f624
7
8 dev-util/bazel: add test, build verbosity, use flags and warn on ccache
9 Was committing almost simultaneously as initial import.
10 Added myself as maintainer and:
11 - build verbosity
12 - ccache failed on me, so adding a warning for the user
13 - option to install examples, tools, and zsh-completion
14
15 Package-Manager: portage-2.3.2
16
17 dev-util/bazel/bazel-0.3.2-r1.ebuild | 65 ++++++++++++++++++++++++++++++++++++
18 dev-util/bazel/metadata.xml | 13 ++++++++
19 2 files changed, 78 insertions(+)
20
21 diff --git a/dev-util/bazel/bazel-0.3.2-r1.ebuild b/dev-util/bazel/bazel-0.3.2-r1.ebuild
22 new file mode 100644
23 index 00000000..a78ef97
24 --- /dev/null
25 +++ b/dev-util/bazel/bazel-0.3.2-r1.ebuild
26 @@ -0,0 +1,65 @@
27 +# Copyright 1999-2016 Gentoo Foundation
28 +# Distributed under the terms of the GNU General Public License v2
29 +# $Id$
30 +
31 +EAPI=6
32 +
33 +inherit bash-completion-r1 java-pkg-2
34 +
35 +DESCRIPTION="Fast and correct automated build system"
36 +HOMEPAGE="http://bazel.io/"
37 +SRC_URI="https://github.com/bazelbuild/bazel/archive/${PV}.tar.gz -> ${P}.tar.gz"
38 +
39 +LICENSE="Apache-2.0"
40 +SLOT="0"
41 +KEYWORDS="~amd64"
42 +IUSE="examples tools zsh-completion"
43 +# strip corrupts the bazel binary
44 +RESTRICT="strip"
45 +DEPEND="virtual/jdk:1.8"
46 +RDEPEND="${DEPEND}"
47 +
48 +pkg_setup() {
49 + echo ${PATH} | grep -q ccache && \
50 + ewarn "${PN} usually fails to compile with ccache, you have been warned"
51 + java-pkg-2_pkg_setup
52 +}
53 +
54 +src_compile() {
55 + VERBOSE=yes ./compile.sh || die
56 + # Use standalone strategy to deactivate the bazel sandbox, since it
57 + # conflicts with FEATURES=sandbox.
58 + echo "build --verbose_failures --spawn_strategy=standalone --genrule_strategy=standalone" \
59 + > "${T}/bazelrc" || die
60 + output/bazel --bazelrc="${T}/bazelrc" build //scripts:bazel-complete.bash || die
61 +}
62 +
63 +src_test() {
64 + output/bazel test \
65 + --verbose_failures \
66 + --spawn_strategy=standalone \
67 + --genrule_strategy=standalone \
68 + --verbose_test_summary \
69 + examples/cpp:hello-success_test || die
70 +}
71 +
72 +src_install() {
73 + dobin output/bazel
74 + newbashcomp bazel-bin/scripts/bazel-complete.bash ${PN}
75 + if use zsh-completion ; then
76 + insinto /usr/share/zsh/site-functions
77 + doins scripts/zsh_completion/_bazel
78 + fi
79 + if use examples; then
80 + docinto examples
81 + doins -r examples/*
82 + docompress -x /usr/share/doc/${PF}/examples
83 + fi
84 + # could really build tools but I don't know which ones
85 + # are actually used
86 + if use tools; then
87 + docinto tools
88 + doins -r tools/*
89 + docompress -x /usr/share/doc/${PF}/tools
90 + fi
91 +}
92
93 diff --git a/dev-util/bazel/metadata.xml b/dev-util/bazel/metadata.xml
94 index 6fa3754..518e125 100644
95 --- a/dev-util/bazel/metadata.xml
96 +++ b/dev-util/bazel/metadata.xml
97 @@ -4,7 +4,20 @@
98 <maintainer type="person">
99 <email>zmedico@g.o</email>
100 </maintainer>
101 + <maintainer type="person">
102 + <email>bicatali@g.o</email>
103 + </maintainer>
104 <upstream>
105 <remote-id type="github">bazelbuild/bazel</remote-id>
106 </upstream>
107 + <longdescription>
108 + Bazel is Google's own build tool. Bazel has built-in support for
109 + building both client and server software, including client
110 + applications for both Android and iOS platforms. It also provides
111 + an extensible framework that you can use to develop your own build
112 + rules.
113 + </longdescription>
114 + <use>
115 + <flag name="tools">Install extra bazel tools to build from sources</flag>
116 + </use>
117 </pkgmetadata>