dev-util/bazel: pull latest upstream revision.

This CL applies the Gentoo patch
https://github.com/gentoo/gentoo/commit/554a3365c8a6807a02976a55462a9708638457e2
which was developed in collaboration with Chromium OS engineers to make
Bazel compilation respect Portage build flags.

This is a necessary step towards compiling Bazel with Clang.

This CL differs from the upstream patch in a small and typical way;
patchset 1 is the exact state of Gentoo's ebuild for reference.

TEST=`sudo emerge bazel`
BUG=chromium:979911

Change-Id: If5b9d959dd830375ec7523437832b5b3decebef8
Reviewed-on: https://chromium-review.googlesource.com/1686800
Tested-by: Michael Martis <martis@chromium.org>
Commit-Ready: Michael Martis <martis@chromium.org>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Michael Martis <martis@chromium.org>
Reviewed-by: Andrew Moylan <amoylan@chromium.org>
diff --git a/dev-util/bazel/bazel-0.24.1-r1.ebuild b/dev-util/bazel/bazel-0.24.1-r1.ebuild
new file mode 120000
index 0000000..8e56a46
--- /dev/null
+++ b/dev-util/bazel/bazel-0.24.1-r1.ebuild
@@ -0,0 +1 @@
+bazel-0.24.1.ebuild
\ No newline at end of file
diff --git a/dev-util/bazel/bazel-0.24.1.ebuild b/dev-util/bazel/bazel-0.24.1.ebuild
index 582a9ba..86d7017 100644
--- a/dev-util/bazel/bazel-0.24.1.ebuild
+++ b/dev-util/bazel/bazel-0.24.1.ebuild
@@ -13,15 +13,15 @@
 LICENSE="Apache-2.0"
 SLOT="0"
 KEYWORDS="*"
-IUSE="examples tools"
+IUSE="examples test tools"
 # strip corrupts the bazel binary
-RESTRICT="strip"
-RDEPEND="virtual/jdk:1.8"
+RESTRICT="strip test? ( network-sandbox ) !test? ( test )"
+RDEPEND=">=virtual/jdk-1.8:*"
 DEPEND="${RDEPEND}
-	app-arch/unzip"
+	app-arch/unzip
+	app-arch/zip"
 
 S="${WORKDIR}"
-QA_FLAGS_IGNORED="usr/bin/bazel"
 
 bazel-get-flags() {
 	local i fs=()
@@ -62,23 +62,10 @@
 	# R: /proc/24939/setgroups
 	# C: /usr/lib/systemd/systemd
 	addpredict /proc
-
-	# Use standalone strategy to deactivate the bazel sandbox, since it
-	# conflicts with FEATURES=sandbox.
-	cat > "${T}/bazelrc" <<-EOF || die
-		build --verbose_failures
-		build --spawn_strategy=standalone --genrule_strategy=standalone
-
-		build --distdir="${S}/derived/distdir/"
-		build --jobs=$(makeopts_jobs) $(bazel-get-flags)
-
-		test --verbose_failures --verbose_test_summary
-		test --spawn_strategy=standalone --genrule_strategy=standalone
-		EOF
 }
 
 src_compile() {
-	export EXTRA_BAZEL_ARGS="--jobs=$(makeopts_jobs) --host_javabase=@local_jdk//:jdk"
+	export EXTRA_BAZEL_ARGS="--jobs=$(makeopts_jobs) $(bazel-get-flags) --host_javabase=@local_jdk//:jdk"
 	VERBOSE=yes ./compile.sh || die
 
 	./scripts/generate_bash_completion.sh \
@@ -116,5 +103,6 @@
 		docinto tools
 		dodoc -r tools/*
 		docompress -x /usr/share/doc/${PF}/tools
+		docompress -x /usr/share/doc/${PF}/tools/build_defs/pkg/testdata
 	fi
 }