icedtea-bin, jdk, jre: upgraded packages to upstream

Upgraded dev-java/icedtea-bin to 3.4.0 on amd64
Upgraded virtual/jdk to 1.8.0-r3 on amd64
Upgraded virtual/jre to 1.8.0-r1 on amd64

This is a partial revert of https://crrev.com/c/2284327. After removing
IcedTea, it turned out chromeos-base/autotest-tests-cheets still needs
Java 8 or 9 in order to run Android CTS for P, which was not clearly
declared in DEPEND before.

BUG=b:160661271
BUG=chromium:1105515
TEST=CQ passes

Change-Id: I763b45a8558f20880170d9a83177dca15368347a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/overlays/portage-stable/+/2299919
Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
Commit-Queue: Ricardo Quesada <ricardoq@chromium.org>
Tested-by: Tetsui Ohkubo <tetsui@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
diff --git a/dev-java/icedtea-bin/Manifest b/dev-java/icedtea-bin/Manifest
new file mode 100644
index 0000000..2b898ab
--- /dev/null
+++ b/dev-java/icedtea-bin/Manifest
@@ -0,0 +1,10 @@
+DIST icedtea-bin-core-3.4.0-amd64.tar.xz 61846296 SHA256 254e4e889061e8632cbb61b86b568e9e8c143342e3fdb02cfa96f068ec0db7a9 SHA512 56bd24ec9dfc75256201a930274713630f1fb062747f721cbe75e2de41a60497f2dd9294a9b726614ce3e260400a663a2c25fd43c31705318d646b58383ba960 WHIRLPOOL 9695ee029e0df02493ddd92d6f74818d145d9fb0426838c6312d8bca949599cd11cf29d7b05929fd366deea3adedce2cfa2d6ee6ba5d7727e7e4d23532ad66e8
+DIST icedtea-bin-core-3.4.0-arm.tar.xz 53464220 SHA256 c5a793a6b967943bf51d334db15ea8608358d308dd9c5c8ba7ea4609d6d5ef85 SHA512 5bb1986caeedbdcae26637a4bea1177fc5cf89fa026245093083d9ff6d1a378878286ef7f6e5bd9527ce6fca3a6a5e9e152f87f68ce56afa66a86f65f4d6817a WHIRLPOOL 7a08039cd6934c73db4c72fa787566880d8ed66c47bf28a76bd4913695c2526c05464cb8a15522816abbf3d3fb5f9e76373e7ae51019cd21f1005ccd53a4624f
+DIST icedtea-bin-core-3.4.0-ppc64.tar.xz 54156476 SHA256 4ab0d286746e583be1d630e1e125a1abb9c77b0933f4e3d5002bcfef8e421b17 SHA512 705cd2479622db75af6732afd79fc20cb1f20d2b402372b0e40225dfc20d9d96fa5ae85654b6dc77cbf79257064f48e39bd02d35fe1d70881d96d1c64cf3730f WHIRLPOOL 0cf0e7097d4a33d448906109fe8b27cd9bbbdf715d690cae4704a339c82831ca65ab6b8ca4efb99ee4c99c24cd78384aae953b7f2e1cc14e4652c5aebf1c44fe
+DIST icedtea-bin-core-3.4.0-x86.tar.xz 61316304 SHA256 673dd4eb192b769c3781d3f286fb7cfcd71ca61a376070d511239f6903ff2e65 SHA512 52091c3e5eb7b453169d87aeeda348c122d5c7c03ec801fde11cb6cdb6f97ae5daa4889bfb724a50feba63ab073ca5a2c341c67a812ccb2bcd0f3866c11e74a2 WHIRLPOOL 6ee9e1239eb5981bb66056256e4c3d1e49b1dd91a9eb988bbc3146cf2317c07aed15d8e1bb8929cadbb4b235cbee7f7bbe9bf45e2eb3283cff7f5598cf2f058b
+DIST icedtea-bin-doc-3.4.0.tar.xz 11684272 SHA256 fb6d16f81bfc1b6d8c9bbf93a07797a3b667c7e3fbf6083292cfb858b6f58056 SHA512 06682cdb16fa7a49918f892aeb9ab6bf3fb4a4fc2b64cc555b38d38f826a70fa2451a5c549d0f1c113fc20f216d9ae3ab2fd81cd88ea79a14af94854e9ef3799 WHIRLPOOL 666aec67b8f1fe8d4bc2bdb0a5873ece59cebb44c480074d694365a04c40c17bc54913394fcbf6ce6257bac35e9e831217ec0806e63d9f7a66a97a480e6d4dbd
+DIST icedtea-bin-examples-3.4.0-amd64.tar.xz 1856216 SHA256 05d187bf937fb162ec828ae7fe214e739d4fb1d237320897eff5e196626c86af SHA512 0ec78903919ad524cdd0d9458c6c2ab437d38f2487807e8854e28df04a8126a43529f22080958e90ec16d7a0d9c72d01570058b383e507b2f1a96b7b7d9578e3 WHIRLPOOL 8dfaed413f1f722458e3b1c5616beacebe65b9a8dbec4e892e0c3b69135a0fbc3c2af2aba19ec0a2841a15bdbab4e051275e1ef84a2c870c6e2c6e11e3be85cb
+DIST icedtea-bin-examples-3.4.0-arm.tar.xz 1840060 SHA256 546f99327d2dc1908a057842781c91693bd92c18663e4af65ab82da929de64cf SHA512 0bd3a13f77e69099b11c0dfee8437b43d64bee4f9ed411af523042c5a53ebff592832e5ff8973bfd9c2858789938b1cabbd230e9b6498721249315b7442a7d9e WHIRLPOOL e9096453f7d8fbde8636981aa140d7606380c05b31d8b1fa03430438f4650bc87dc51e890b8416d2fc06922a8e32f7ce32cb8ef0fdcf89dc0fc6706392904a2b
+DIST icedtea-bin-examples-3.4.0-ppc64.tar.xz 1848048 SHA256 0fe715e84b6f405dc4a24e4c0e958b4691938c12452452747eccee3983c74967 SHA512 89565814818b8a07db3e65b49fd1d750521018ae9acc7800184fe511e327b904fdd6d91c7d7bdf85243685719ee9981abd19d4a727c12b936d75acc57ed80f76 WHIRLPOOL dd8a28b15c32c35c9bdfba9a24b6417ea984c15395de106e432b99dd2874a2aa90abd62aaf11f8ad822418ec1bf0068126c433115ee65b5e41d7fbd062538025
+DIST icedtea-bin-examples-3.4.0-x86.tar.xz 1862844 SHA256 e61b53cb1320492ddadcf428ffc15f9a6178ebcffbeefc2bce8a870021ed809a SHA512 128f6afab5f634bab49c11e41b2e763629a728364031b5e27ab84240878b0c07cabaf94b3b7c43182fd6776a48c341074957b250f036ce42fae84754339282e3 WHIRLPOOL 37f60ac345a34dc708de62b89779eaf010438a18f49d6d3cc07b0bed8c080596e01169185c4d1e8579efa83559bb98d8d0c56694507530d53059dc0bd0105701
+DIST icedtea-bin-src-3.4.0.tar.xz 45704380 SHA256 c5a91481c3830148041404785316a203e37cbc3f8673cc97feccff443a4d61a5 SHA512 00cf87bbcb271202aaa08efdb3d804f92a5a8f158f998f689f0360a715485180c767fead34cbfdb8230465427227edf9c16c8779ee010301f25a7a2ad8a06c54 WHIRLPOOL bf80985e409636a0d0bab7849efd48eb19ea8bfaac75663e106129c9b2f511865f3ccaac4cd2a9f2402ae70d905aad2efd6a3edab2dcd0503f423f3ba645d4b7
diff --git a/dev-java/icedtea-bin/files/icedtea-bin-8.env b/dev-java/icedtea-bin/files/icedtea-bin-8.env
new file mode 100644
index 0000000..91343cf
--- /dev/null
+++ b/dev-java/icedtea-bin/files/icedtea-bin-8.env
@@ -0,0 +1,17 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+VERSION="IcedTea JDK @PV@"
+JAVA_HOME="@GENTOO_PORTAGE_EPREFIX@/opt/icedtea-bin-@PV@"
+JDK_HOME="@GENTOO_PORTAGE_EPREFIX@/opt/icedtea-bin-@PV@"
+JAVAC="${JAVA_HOME}/bin/javac"
+PATH="${JAVA_HOME}/bin:${JAVA_HOME}/jre/bin"
+ROOTPATH="${JAVA_HOME}/bin:${JAVA_HOME}/jre/bin"
+LDPATH="${JAVA_HOME}/jre/lib/@PLATFORM@/:${JAVA_HOME}/jre/lib/@PLATFORM@/server/"
+MANPATH="@GENTOO_PORTAGE_EPREFIX@/opt/icedtea-bin-@PV@/man"
+PROVIDES_TYPE="JDK JRE"
+PROVIDES_VERSION="1.8"
+# Taken from sun.boot.class.path property
+BOOTCLASSPATH="${JAVA_HOME}/jre/lib/resources.jar:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/jre/lib/sunrsasign.jar:${JAVA_HOME}/jre/lib/jsse.jar:${JAVA_HOME}/jre/lib/jce.jar:${JAVA_HOME}/jre/lib/charsets.jar:${JAVA_HOME}/jre/lib/jfr.jar"
+GENERATION="2"
+ENV_VARS="JAVA_HOME JDK_HOME JAVAC PATH ROOTPATH LDPATH MANPATH"
diff --git a/dev-java/icedtea-bin/files/icedtea-bin.env.sh b/dev-java/icedtea-bin/files/icedtea-bin.env.sh
new file mode 100644
index 0000000..f85be43
--- /dev/null
+++ b/dev-java/icedtea-bin/files/icedtea-bin.env.sh
@@ -0,0 +1,17 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+VERSION="IcedTea JDK ${PV}$(multilib_is_native_abi || printf ' ('${ABI}')')"
+JAVA_HOME="${EPREFIX}/opt/icedtea-bin-${PV}$(multilib_is_native_abi || printf -- -${ABI})"
+JDK_HOME="${EPREFIX}/opt/icedtea-bin-${PV}$(multilib_is_native_abi || printf -- -${ABI})"
+JAVAC="\${JAVA_HOME}/bin/javac"
+PATH="\${JAVA_HOME}/bin:\${JAVA_HOME}/jre/bin"
+ROOTPATH="\${JAVA_HOME}/bin:\${JAVA_HOME}/jre/bin"
+LDPATH="\${JAVA_HOME}/jre/lib/$(get_system_arch)/:\${JAVA_HOME}/jre/lib/$(get_system_arch)/server/$([[ ${SLOT} = 7 ]] && printf :\${JAVA_HOME}/jre/lib/$(get_system_arch)/xawt/)"
+MANPATH="${EPREFIX}/opt/icedtea-bin-${PV}/man"
+PROVIDES_TYPE="JDK JRE"
+PROVIDES_VERSION="1.${SLOT}"
+# Taken from sun.boot.class.path property
+BOOTCLASSPATH="\${JAVA_HOME}/jre/lib/resources.jar:\${JAVA_HOME}/jre/lib/rt.jar:\${JAVA_HOME}/jre/lib/sunrsasign.jar:\${JAVA_HOME}/jre/lib/jsse.jar:\${JAVA_HOME}/jre/lib/jce.jar:\${JAVA_HOME}/jre/lib/charsets.jar:\${JAVA_HOME}/jre/lib/jfr.jar"
+GENERATION="2"
+ENV_VARS="JAVA_HOME JDK_HOME JAVAC PATH ROOTPATH LDPATH MANPATH"
diff --git a/dev-java/icedtea-bin/icedtea-bin-3.4.0.ebuild b/dev-java/icedtea-bin/icedtea-bin-3.4.0.ebuild
new file mode 100644
index 0000000..5afb195
--- /dev/null
+++ b/dev-java/icedtea-bin/icedtea-bin-3.4.0.ebuild
@@ -0,0 +1,152 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+# Don't block arm. See bug #600134.
+#MULTILIB_COMPAT=( abi_ppc_64 abi_x86_{32,64} )
+KEYWORDS="-* amd64 ~arm ppc64 x86"
+
+inherit java-vm-2 multilib-build toolchain-funcs
+
+BASE_URI="https://dev.gentoo.org/~chewi/distfiles"
+SRC_URI="doc? ( ${BASE_URI}/${PN}-doc-${PV}.tar.xz )
+	source? ( ${BASE_URI}/${PN}-src-${PV}.tar.xz )
+	multilib? ( amd64? ( abi_x86_32? ( ${BASE_URI}/${PN}-core-${PV}-x86.tar.xz ) ) )"
+
+for abi in amd64 arm ppc64 x86; do
+	SRC_URI+="
+		${abi}? (
+			${BASE_URI}/${PN}-core-${PV}-${abi}.tar.xz
+			examples? ( ${BASE_URI}/${PN}-examples-${PV}-${abi}.tar.xz )
+		)"
+done
+
+DESCRIPTION="A Gentoo-made binary build of the IcedTea JDK"
+HOMEPAGE="http://icedtea.classpath.org"
+LICENSE="GPL-2-with-classpath-exception"
+SLOT="8"
+
+IUSE="+alsa +cups doc examples +gtk headless-awt multilib nsplugin pulseaudio selinux source +webstart"
+REQUIRED_USE="gtk? ( !headless-awt ) nsplugin? ( !headless-awt )"
+
+RESTRICT="preserve-libs strip"
+QA_PREBUILT="opt/.*"
+
+RDEPEND=">=dev-libs/glib-2.36:2%
+	>=media-libs/fontconfig-2.11:1.0%
+	>=media-libs/freetype-2.5.5:2%
+	>=media-libs/lcms-2.6:2%
+	>=sys-libs/zlib-1.2.8-r1%
+	virtual/jpeg:62%
+	alsa? ( >=media-libs/alsa-lib-1.0% )
+	cups? ( >=net-print/cups-2.0% )
+	gtk? (
+		>=dev-libs/atk-2.16.0%
+		>=x11-libs/cairo-1.14.2%
+		x11-libs/gdk-pixbuf:2%
+		>=x11-libs/gtk+-2.24:2%
+		>=x11-libs/pango-1.36%
+	)
+	!headless-awt? (
+		media-libs/giflib:0/7%
+		=media-libs/libpng-1.6*%
+		>=x11-libs/libX11-1.6%
+		>=x11-libs/libXcomposite-0.4%
+		>=x11-libs/libXext-1.3%
+		>=x11-libs/libXi-1.7%
+		>=x11-libs/libXrender-0.9.8%
+		>=x11-libs/libXtst-1.2%
+	)"
+
+RDEPEND=">=sys-devel/gcc-4.9.0[multilib?]
+	>=sys-libs/glibc-2.22[multilib?]
+	virtual/ttf-fonts
+	selinux? ( sec-policy/selinux-java )
+	multilib? ( ${RDEPEND//%/[${MULTILIB_USEDEP}]} )
+	!multilib? ( ${RDEPEND//%/} )"
+
+PDEPEND="webstart? ( >=dev-java/icedtea-web-1.6.1:0 )
+	nsplugin? ( >=dev-java/icedtea-web-1.6.1:0[nsplugin] )
+	pulseaudio? ( dev-java/icedtea-sound )"
+
+S="${WORKDIR}"
+
+pkg_pretend() {
+	if [[ "$(tc-is-softfloat)" != "no" ]]; then
+		die "These binaries require a hardfloat system."
+	fi
+}
+
+src_prepare() {
+	default
+
+	if ! use alsa; then
+		rm -v */jre/lib/*/libjsoundalsa.* || die
+	fi
+
+	if use headless-awt; then
+		rm -vr */jre/lib/*/lib*{[jx]awt,splashscreen}* \
+		   */{,jre/}bin/policytool */bin/appletviewer || die
+	fi
+}
+
+multilib_src_install() {
+	local dest="/opt/${P}-${ABI}"
+	dest="${dest/%-${DEFAULT_ABI}/}"
+	local ddest="${ED}${dest#/}"
+	dodir "${dest}"
+
+	if multilib_is_native_abi; then
+		dodoc ${P}-${ABI}/doc/{ASSEMBLY_EXCEPTION,AUTHORS,NEWS,README,THIRD_PARTY_README}
+		use doc && dodoc -r ${P}/doc/html
+
+		# doins doesn't preserve executable bits.
+		cp -pRP ${P}-${ABI}/{bin,include,jre,lib,man} "${ddest}" || die
+
+		if use examples; then
+			cp -pRP ${P}-${ABI}/{demo,sample} "${ddest}" || die
+		fi
+
+		if use source; then
+			cp ${P}/src.zip "${ddest}" || die
+		fi
+
+		# Use default VMHANDLE.
+		java-vm_install-env "${FILESDIR}/icedtea-bin.env.sh"
+	else
+		local x native=$(get_system_arch ${DEFAULT_ABI})
+
+		for x in {,/jre}/{bin,lib/$(get_system_arch)} /jre/lib/rt.jar; do
+			dodir "${dest}"${x%/*}
+			cp -pRP ${P}-${ABI}${x} "${ddest}"${x} || die
+		done
+
+		for x in ${P}-${DEFAULT_ABI}{,/jre}/lib/*; do
+			[[ ${x##*/} = ${native} ]] && continue
+			[[ -e "${ddest}"/${x#*/} ]] && continue
+			dosym "${EPREFIX}"/opt/${P}/${x#*/} "${dest}"/${x#*/}
+		done
+
+		# Use ABI-suffixed VMHANDLE.
+		VMHANDLE+="-${ABI}" java-vm_install-env "${FILESDIR}/icedtea-bin.env.sh"
+	fi
+
+	# Both icedtea itself and the icedtea ebuild set PAX markings but we
+	# disable them for the icedtea-bin build because the line below will
+	# respect end-user settings when icedtea-bin is actually installed.
+	java-vm_set-pax-markings "${ddest}"
+
+	# Each invocation appends to the config.
+	java-vm_revdep-mask "${EPREFIX}${dest}"
+}
+
+src_install() {
+	if use multilib; then
+		multilib_foreach_abi multilib_src_install
+	else
+		multilib_src_install
+	fi
+
+	java-vm_sandbox-predict /proc/self/coredump_filter
+}
diff --git a/dev-java/icedtea-bin/metadata.xml b/dev-java/icedtea-bin/metadata.xml
new file mode 100644
index 0000000..33843e4
--- /dev/null
+++ b/dev-java/icedtea-bin/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+  <maintainer type="project">
+  <email>java@gentoo.org</email>
+  <name>Java</name>
+  </maintainer>
+<use>
+  <flag name="headless-awt">Don't install the X backend for AWT, needed by some GUIs (used to be X flag)</flag>
+  <flag name="nss">Enable NSS security provider support</flag>
+  <flag name="webstart">Provide javaws command through symlink to icedtea-web</flag>
+</use>
+</pkgmetadata>
diff --git a/virtual/jdk/jdk-1.8.0-r3.ebuild b/virtual/jdk/jdk-1.8.0-r3.ebuild
new file mode 100644
index 0000000..2989932
--- /dev/null
+++ b/virtual/jdk/jdk-1.8.0-r3.ebuild
@@ -0,0 +1,14 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+DESCRIPTION="Virtual for Java Development Kit (JDK)"
+SLOT="1.8"
+KEYWORDS="*"
+
+RDEPEND="|| (
+		dev-java/icedtea-bin:8
+		dev-java/icedtea:8
+		dev-java/oracle-jdk-bin:1.8
+	)"
diff --git a/virtual/jre/jre-1.8.0-r1.ebuild b/virtual/jre/jre-1.8.0-r1.ebuild
new file mode 100644
index 0000000..805cffa
--- /dev/null
+++ b/virtual/jre/jre-1.8.0-r1.ebuild
@@ -0,0 +1,13 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+DESCRIPTION="Virtual for Java Runtime Environment (JRE)"
+SLOT="1.8"
+KEYWORDS="*"
+
+RDEPEND="|| (
+		virtual/jdk:1.8
+		dev-java/oracle-jre-bin:1.8
+	)"