bazel: upgraded package to upstream

Upgraded dev-util/bazel to version 3.2.0 on host

This is required by sci-libs/tensorflow-2.2.0. Unfortunately it isn't
compatible with sci-libs/tensorflow-1.14.0 so will need to submit this
carefully.

Note that we're not removing bazel-0.24.1, as this is still required by
tensorflow-1.14.0 which is still used on boards like gale and mistral.

BUG=b:159987197
TEST=FEATURES=test emerge-{betty,kukui} sci-libs/tensorflow

Cq-Depend: chrome-internal:3141082,chromium:2273357,chrome-internal:3167607
Change-Id: Icc577a4314ea59a10674999bb89842b046b3baf3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/overlays/portage-stable/+/2270557
Commit-Queue: Jim Pollock <jmpollock@chromium.org>
Tested-by: Jim Pollock <jmpollock@chromium.org>
Reviewed-by: Stuart Langley <slangley@chromium.org>
Auto-Submit: Jim Pollock <jmpollock@chromium.org>
diff --git a/dev-util/bazel/Manifest b/dev-util/bazel/Manifest
index 244a1f9..4180750 100644
--- a/dev-util/bazel/Manifest
+++ b/dev-util/bazel/Manifest
@@ -1 +1,2 @@
 DIST bazel-0.24.1-dist.zip 174691842 BLAKE2B 56d42421ac6f5513f019f3b71ca0c5e7b499c199dd8d9f22ca4fdca832527a1974afffccd6bff6b1d29dc3156ee28ba7f91a9a37f2f8524da5c5f30645be97aa SHA512 a78c871eb517ec53a0d1d9592887288fa54e5e9f44b0b7dba44792a74a1ba0c98e38ff2f6094ab6e8b3add3ec4a0188de3b2489d94d419373e210d16db641774
+DIST bazel-3.2.0-dist.zip 269368916 BLAKE2B 1eb54c42e22432d2c836a87179094563b797744de423468bf9bce1b7b4dbcdce20e033ed03c4cd7ea5026c9e0d971e16202aff09f9c45d91c9fc53af6f0f8802 SHA512 fd8191188ecb49087b2b474bc383b2bb5d131460952be64b8930dc7e573fd14f99f231c4270b88fb4c9537fb94a04588fb580891519d20c7b90d705238f17f81
diff --git a/dev-util/bazel/bazel-3.2.0.ebuild b/dev-util/bazel/bazel-3.2.0.ebuild
new file mode 100644
index 0000000..108872a
--- /dev/null
+++ b/dev-util/bazel/bazel-3.2.0.ebuild
@@ -0,0 +1,109 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit bash-completion-r1 java-pkg-2 multiprocessing
+
+DESCRIPTION="Fast and correct automated build system"
+HOMEPAGE="https://bazel.build/"
+
+SRC_URI="https://github.com/bazelbuild/bazel/releases/download/${PV}/${P}-dist.zip"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="*"
+IUSE="examples tools"
+# strip corrupts the bazel binary
+# test fails with network-sandbox: An error occurred during the fetch of repository 'io_bazel_skydoc' (bug 690794)
+RESTRICT="strip test"
+RDEPEND=">=virtual/jdk-1.8:*"
+DEPEND="${RDEPEND}
+	app-arch/unzip
+	app-arch/zip"
+
+S="${WORKDIR}"
+
+bazel-get-flags() {
+	local i fs=()
+	for i in ${CFLAGS}; do
+		fs+=( "--copt=${i}" "--host_copt=${i}" )
+	done
+	for i in ${CXXFLAGS}; do
+		fs+=( "--cxxopt=${i}" "--host_cxxopt=${i}" )
+	done
+	for i in ${CPPFLAGS}; do
+		fs+=( "--copt=${i}" "--host_copt=${i}" )
+		fs+=( "--cxxopt=${i}" "--host_cxxopt=${i}" )
+	done
+	for i in ${LDFLAGS}; do
+		fs+=( "--linkopt=${i}" "--host_linkopt=${i}" )
+	done
+	echo "${fs[*]}"
+}
+
+pkg_setup() {
+	echo ${PATH} | grep -q ccache && \
+		ewarn "${PN} usually fails to compile with ccache, you have been warned"
+	java-pkg-2_pkg_setup
+}
+
+src_unpack() {
+	# Only unpack the main distfile
+	unpack ${P}-dist.zip
+}
+
+src_prepare() {
+	default
+
+	# F: fopen_wr
+	# S: deny
+	# P: /proc/self/setgroups
+	# A: /proc/self/setgroups
+	# R: /proc/24939/setgroups
+	# C: /usr/lib/systemd/systemd
+	addpredict /proc
+}
+
+src_compile() {
+	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 \
+		--bazel=output/bazel \
+		--output=bazel-complete.bash \
+		--prepend=scripts/bazel-complete-header.bash \
+		--prepend=scripts/bazel-complete-template.bash
+}
+
+src_test() {
+	output/bazel test \
+		--verbose_failures \
+		--spawn_strategy=standalone \
+		--genrule_strategy=standalone \
+		--verbose_test_summary \
+		examples/cpp:hello-success_test || die
+	output/bazel shutdown
+}
+
+src_install() {
+	dobin output/bazel
+	newbashcomp bazel-complete.bash ${PN}
+	bashcomp_alias ${PN} ibazel
+	insinto /usr/share/zsh/site-functions
+	doins scripts/zsh_completion/_bazel
+
+	if use examples; then
+		docinto examples
+		dodoc -r examples/*
+		docompress -x /usr/share/doc/${PF}/examples
+	fi
+	# could really build tools but I don't know which ones
+	# are actually used
+	if use tools; then
+		docinto tools
+		dodoc -r tools/*
+		docompress -x /usr/share/doc/${PF}/tools
+		docompress -x /usr/share/doc/${PF}/tools/build_defs/pkg/testdata
+	fi
+}
diff --git a/metadata/md5-cache/dev-util/bazel-3.2.0 b/metadata/md5-cache/dev-util/bazel-3.2.0
new file mode 100644
index 0000000..061804a
--- /dev/null
+++ b/metadata/md5-cache/dev-util/bazel-3.2.0
@@ -0,0 +1,14 @@
+DEFINED_PHASES=compile install preinst prepare setup test unpack
+DEPEND=>=virtual/jdk-1.8:* app-arch/unzip app-arch/zip >=dev-java/java-config-2.2.0-r3
+DESCRIPTION=Fast and correct automated build system
+EAPI=7
+HOMEPAGE=https://bazel.build/
+IUSE=examples tools elibc_FreeBSD
+KEYWORDS=*
+LICENSE=Apache-2.0
+RDEPEND=>=virtual/jdk-1.8:* >=dev-java/java-config-2.2.0-r3
+RESTRICT=strip test
+SLOT=0
+SRC_URI=https://github.com/bazelbuild/bazel/releases/download/3.2.0/bazel-3.2.0-dist.zip
+_eclasses_=bash-completion-r1	47a7402d95930413ce25ba8d857339bb	java-pkg-2	c4e6af2574fd1dc79b43a6e27af4b5fb	java-utils-2	82402a1c36ab4bf38f3313a543f9e827	multilib	2477ebe553d3e4d2c606191fe6c33602	multiprocessing	e32940a7b2a9992ad217eccddb84d548	toolchain-funcs	605c126bed8d87e4378d5ff1645330cb
+_md5_=6567ad9180621d2a11e0d53ff939b033