summaryrefslogtreecommitdiff
path: root/dev-java/openjdk
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-04-28 09:54:45 +0100
committerV3n3RiX <venerix@redcorelinux.org>2019-04-28 09:54:45 +0100
commitb7ebc951da8800f711142f69d9d958bde67a112d (patch)
treee318514216845acb8f2e49fff7a5cba4027e9d91 /dev-java/openjdk
parentdc7cbdfa65fd814b3b9aa3c56257da201109e807 (diff)
gentoo resync : 28.04.2019
Diffstat (limited to 'dev-java/openjdk')
-rw-r--r--dev-java/openjdk/Manifest11
-rw-r--r--dev-java/openjdk/openjdk-11.0.3_p7.ebuild217
-rw-r--r--dev-java/openjdk/openjdk-8.212_p03.ebuild248
3 files changed, 476 insertions, 0 deletions
diff --git a/dev-java/openjdk/Manifest b/dev-java/openjdk/Manifest
index 869e478fd39d..ffd589d9957f 100644
--- a/dev-java/openjdk/Manifest
+++ b/dev-java/openjdk/Manifest
@@ -2,14 +2,25 @@ AUX generate-cacerts.pl 11051 BLAKE2B e6d54319153735bd4b445581dfbd2b78e2e27a19f3
AUX openjdk-11.env.sh 537 BLAKE2B 404aeaf3d4df54b66193b8e09521ad2e55a23dc0603beea9911e4c91ab96e30c0f4aa4a0e96b1982874e055af3b9923689657b58dc02b37f91163659343ed2f9 SHA512 f4a41891b0187048a21b1af43053375e62de249e3ba210c3cfd59178c9f4c667ff83f10ee85f9ae37db097e862ff7233f5136569d0cb1399dbf48cea075cfc6e
AUX openjdk-8.env.sh 746 BLAKE2B b8a18bb5e2dd3c4722b78531428d4291236a6295973fdcd65c64469b3a49a520686ff8d884c0b3d5dd9017ff4027d2fc1d78d57f062a4cf8910e0bab3ed444cc SHA512 2c65d1875406deabbfadb798501de15850775a4a049f073cdfda684ca1bff4b531b93596ee91a7caf77ff6c377457093f72c7bde4b995bce9ffbc4a8fcceb6dd
DIST jdk-11.0.2+7.tar.bz2 90189455 BLAKE2B 37473a8db4c6ad6789ea67b44f4dda94b9f59143c681a206aa0931b3a2a376fbc480c0c5a6b617072cf9ce1faca34a6c5c5e56cfec9fbf5482b82520fb2463c4 SHA512 03214d9fc920c04f3057594efa78ff588a630e6c594e5bbcc24b4c327fa08273ce060063d98720cdc04bc6978a3d04e172f38ba7a3bcabf02dd5dad397fd9952
+DIST jdk-11.0.3+7.tar.bz2 90300528 BLAKE2B db566140028ddbf9f6e10eaaac018ddf3ad13a954500c73abde8aec5c673c375f2cf0e56bc75c410a4ff90e6cb8e9c4580bb5719786e34865f00a92bd3ea8431 SHA512 46c1c13165e7d5ef480052810ccdc1b5d55f6b2b542e10303d3940536df7f17bf3d8a0cf774e73dc25af7cd69432790656a03c66d2df9efaf71cb9e44c2da684
DIST openjdk-8.202_p08.tar.bz2 449202 BLAKE2B 8f7442918c083e94cda0e029cf2348dd9242653027f84d66deebe162e0928b2c6a86d3f273ba235bad5e5656f2b109e6521aaccfa81332fea92873d008ac0c0d SHA512 586713b889dd60c7dc65fccd39ef3ddd985ebb95a7c6c1feaef3c8d76fd1d929bbf19a99f72274c1afb77bd7f80b581d44add4aa232358d8951f7cc5befb43d0
+DIST openjdk-8.212_p03.tar.bz2 451800 BLAKE2B f8466a0d99650a07e3ff21e8dc06252ef9d31ce15e22c6ede15fc4c7b1633820e84e67aa501e816101c6bd473293fb897645b2df1530d8f7b81c6e8e6d38ce3a SHA512 ccc642da05aa00cfcc46c1eb759391dd2242218b7392bced77481600aa15b3b1d0a0c03380f59b6a6d038311721f249de1a6b116c6f651193cfb57b89fba4866
DIST openjdk-corba-8.202_p08.tar.bz2 1033539 BLAKE2B 9cbe20fb771157142329db037866ec7d67ff7e70318bec8b74034ce59574cd730975f0e7a3d6b88fc946b1d340558a92ca867639765a205883481fd071d7059e SHA512 9b25132c76f559055698c52888f6cae287096e05b89541cb8e445b46a488126a38e58d4f28649e277862eac7aa20f75f64dbcdcf56c900dcb0530a9545c4f717
+DIST openjdk-corba-8.212_p03.tar.bz2 1033709 BLAKE2B f59b294e62425b63e881ed5534ae9beb3cc51351ff197995503671ec52ad82e34e145f8c9790dc88e4f452b4e09af80143fd0f7e0fda588b00eed08d4b2bc861 SHA512 3a786a372ab6b849a6ccd944cdfdc0aa9994a6a9f4d52afccad7d6b187e46a1fd0be30bde3da1eb03988034c36b4590b55379819245fb6f5ed4d75a958e9caa3
DIST openjdk-hotspot-8.202_p08.tar.bz2 7918616 BLAKE2B a35cedf99a5067896dc498d4baa9b10f4ceb1ffcf946632b578c45d6354e4d025d82462797e56773507e504e5e25a25cdf63485460f9a8df234474a2e110f91a SHA512 ab53e77a4081a34c250750d7b975f790936cf370e81807d0081b006a12c0ceb452f54bd40cc8085a9f16047d270b9b610ee777f6fcd1431ff9d77461c32db464
+DIST openjdk-hotspot-8.212_p03.tar.bz2 7925246 BLAKE2B b405362450186d50228ddaf78907a98365c34d5e09a95064dc39bbc88328d1bf37e23791322fb68a44d90753cd68139627d235852dd1e03ad2b0535982badeaf SHA512 e8c8f9151c94bd821fa6810a0c70ed2749e0c39f66108deccc68718f106eb1731c91b13fb502c4a4be425ee04ecd909937247efb5891aac1ca27ee16d7bbf290
DIST openjdk-jaxp-8.202_p08.tar.bz2 2733553 BLAKE2B 53341136b427152115ea0d4f758228090a607270104c88ebb61bc442ddd51a43cfed03c34660a47ab55bb601e1a9d8bf4fcdab05874bf0a5ada33b1ecb60df45 SHA512 9671fb56b6127359376cc2f85d91eb027fb1df1f808e36abbe3a1265d88d50809c34d73b84f52fb6e058ef78017d8d7a24bd097a9d720ad70a6861aa9fcc80f2
+DIST openjdk-jaxp-8.212_p03.tar.bz2 2734510 BLAKE2B fa920514fd499019a8f3d03edf895c11b3d67617b645444025cc5406216fed0ecb9340a08b8e314c43d0ced0ffbc1e3940f7c719930d5e4cdf9b24653d6249f8 SHA512 200516ef92b9fd50b4e7814b2f5f62c344b4654c8c836e0166c9e3669992d2fe231d3e262bc9be54d8793d6c4a3d6bdee5c93a6b6a3b6481d6a234f26dfb2a32
DIST openjdk-jaxws-8.202_p08.tar.bz2 2541554 BLAKE2B a92aae4290e1901b736a6a93aed3b8c4bca14046a1f3eb9939ea9bf8ae0cd09785cf37045a8274641f13e543b49114ff158b9bc0cdd58163b42791e952ac76d0 SHA512 ce385f247a57695f716894137d868fa492d610776d120966c86b741688d6df54ae9538da7cf7b9530212a288ac4ff0d156e09bd5d01305b8165b939fa518fede
+DIST openjdk-jaxws-8.212_p03.tar.bz2 2540937 BLAKE2B 53c2793d9071f408a3704dacc4d61ac8f1b8ead33e75d309f217a05514661f14656711d017bcdde5821e114c5010d4417ac283571c2a52c28885d6736468402e SHA512 3e336e8cab78636b82488b7da183ba4ba2b84c0a2cb72a369c4352aaeb0fa5da05660c830db12a486e1cdfbc7a88a748d88284ca86c45b890a40dc1d23f3915a
DIST openjdk-jdk-8.202_p08.tar.bz2 46618401 BLAKE2B e73b1341b837a0983ded4b4969ce83f9b77283e1d4d51e8d31a1b7401961a0b78943a41d2fe0aa724d85ac93dc3082511bcea341e87daecd070278ae59c8f240 SHA512 20e6747b506091383166298aeed6ff4ffd9deb92f20765ef839bf46d3ecae6b1aa218eb6857e6541df0522b8d571379341e94eb5bef765a1164cf9f59b20dfac
+DIST openjdk-jdk-8.212_p03.tar.bz2 46720739 BLAKE2B af515701052ede8b6cf828cc74f1f5938dad0874a12ed3c5c3f7b03be1f43108fce5e1820452a87e098c3469922227950f6f4fea33306f7b426487b48cc4b993 SHA512 9b3342419c82a8f243d2a7523d83b395c89629820fd99ba387991656e5754ed067877bf12b7e780368dd4bdb6eba10be09e63b1301bcbc0aa29e86e84ec394a3
DIST openjdk-langtools-8.202_p08.tar.bz2 2392880 BLAKE2B 45ebebe4864e3274e14cf27986cd96facfe2f8e5c1292344e05743d1448f95367caf0f68886c506ce10435fbf53948c6b9f7087ad5d2cd090cf0f1becb962843 SHA512 a1e1c3dc06b3a58082e1d67d58ffeaf0bc3c5534fd1ba368e835a54d3c6ba9232e277ae685ed3ff5ccdf3cd7fe0612ad78a08ed55d1d2d06de54914a19377907
+DIST openjdk-langtools-8.212_p03.tar.bz2 2393112 BLAKE2B 96656795114bad1d2e5eabace5d1c6568646084421fbaa43045ce0ec8d222f1a7e8629e4b86bdd5ff8eb51e90ea1eaafab3e94f34c41932754249f17b2e447f8 SHA512 15b931432cb14cf60c73627bd70e66f6d18ff25763a7b8758109cf8746d278d6c2b5d945a9f0b948a76c0813b5f42c988a3d10ac13165ec12e0f4d9eab98f369
DIST openjdk-nashorn-8.202_p08.tar.bz2 2854026 BLAKE2B 05ba828160270e52f27023db83b1ffc4e6611b7a74b300a93a6d476f319a265834b48c7de57b0d3bea502d88279e72fd9cfbc5f3eb0e719650e34e82ba4a3d09 SHA512 bea0eaa4b2247cf1e5ee33613754c8f2f6ffe074a7be562f26e63c6327f56d67f60d4877dd363ed8a812689db1d837f5c257637460e247a1592c3258f3add11b
+DIST openjdk-nashorn-8.212_p03.tar.bz2 2854888 BLAKE2B 3e5a1867d8a5db301fb3512ebdc4dea8f8226fe3308142d6f3f616795c9cee0d598a257ccd7e790ec440c966339399776d1118764dbf882a46a2daa32d81ddd5 SHA512 5c7fba1d567aa1d0602ef045b24a8624fed9ced72b3bae030ee15ea133ed2223e402cc08c996ff253c4792570da87b7713f351c84704b12556466349f6452f74
EBUILD openjdk-11.0.2_p7.ebuild 5902 BLAKE2B f1cc664b678083e0562941837947798c92a64c4e00d16c3f9463877b68b3f18516e747a2f176cb12275e6efee5bb751aaedaf32f24057d4ac972db442f68afda SHA512 d4b49df6be291a6876ea04115909806e16102de96bbbe9d3e614c1ba7ff136e3062c73a9f464d1ad35a34efab4a82f1ed11514767e56febcbc5f49f86d390d9d
+EBUILD openjdk-11.0.3_p7.ebuild 6121 BLAKE2B dbce68ee1e261c329ce13dbb17f43cf5c4441bf5b64c085180bbf7074252ebf98fa55d42083b3ced85194132de75f202beb94a6270694681566133b604cdb871 SHA512 e14acf622315f699dad6f7f9bb41fc911658311cb7d1628d1b61e7e1d82b709a51a438f954d68bed0e1c360281c44779aca11e38159b209f28dd9429e5aff345
EBUILD openjdk-8.202_p08.ebuild 7135 BLAKE2B 367571346274382c2442fa350517a5a1271def6c376a141d2719100e5776f5822d96691dab389b37b20a1baf370e8228fa6c9bba47d07660b95aa8bf8c0e3225 SHA512 5aecfd0bb06fdd13994ead308d1641018f002ab4b037df535b6c17c5876953ef656f6baf7a32fd976edf2b661685b21906ad65cddd040cd2c10d366f6fed2188
+EBUILD openjdk-8.212_p03.ebuild 7319 BLAKE2B 304bc5decc78bdc2f2faddc16ea9aab7fccbcd5ac13d61bddc632947898d72fd5ebddca519609118df50ad0bbbb3dec0ef5c19ad546c3a4060b47284e96d08bc SHA512 e8215d1c26fac6949a384cd39a830f4428b285853db6cd9c50c3805e1880ed4e3d85ca7042ea50f00b29470c85b4da2086474454103bba6a71d8412923073a6c
MISC metadata.xml 1053 BLAKE2B bc7d07c481cee341f2778eef806dae3484592c5c8ca8e015ab4cca6dc64b8d225e1eff1f03f9c7b4d06751282e566624644348eece51dbb03a603b960b6ed84d SHA512 4a749d32cf21c2a517558c2e06ed9e5cd2470db8ba758847f727a8da82252a209e00c3d23f8896d5fb99aeb4f07df8717764a2f52c81261050b88dc91b61dab7
diff --git a/dev-java/openjdk/openjdk-11.0.3_p7.ebuild b/dev-java/openjdk/openjdk-11.0.3_p7.ebuild
new file mode 100644
index 000000000000..026d272de5ec
--- /dev/null
+++ b/dev-java/openjdk/openjdk-11.0.3_p7.ebuild
@@ -0,0 +1,217 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools check-reqs flag-o-matic java-pkg-2 java-vm-2 multiprocessing pax-utils toolchain-funcs
+
+MY_PV=${PV/_p/+}
+SLOT=${MY_PV%%[.+]*}
+
+DESCRIPTION="Open source implementation of the Java programming language"
+HOMEPAGE="https://openjdk.java.net"
+SRC_URI="https://hg.${PN}.java.net/jdk-updates/jdk${SLOT}u/archive/jdk-${MY_PV}.tar.bz2"
+
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~arm64 ~ppc64"
+
+IUSE="alsa cups debug doc examples gentoo-vm headless-awt +jbootstrap nsplugin +pch selinux source systemtap +webstart"
+
+CDEPEND="
+ media-libs/freetype:2=
+ sys-libs/zlib
+ systemtap? ( dev-util/systemtap )
+ !headless-awt? (
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXi
+ x11-libs/libXrender
+ x11-libs/libXt
+ x11-libs/libXtst
+ )
+"
+
+# cups and alsa required to build, but not to run, make is possible to remove
+RDEPEND="
+ ${CDEPEND}
+ alsa? ( media-libs/alsa-lib )
+ cups? ( net-print/cups )
+ selinux? ( sec-policy/selinux-java )
+"
+
+DEPEND="
+ ${CDEPEND}
+ app-arch/zip
+ media-libs/alsa-lib
+ net-print/cups
+ !headless-awt? (
+ x11-base/xorg-proto
+ )
+ || (
+ dev-java/openjdk-bin:${SLOT}
+ dev-java/openjdk:${SLOT}
+ )
+"
+
+PDEPEND="webstart? ( >=dev-java/icedtea-web-1.6.1:0 )
+ nsplugin? ( >=dev-java/icedtea-web-1.6.1:0[nsplugin] )"
+
+S="${WORKDIR}/jdk${SLOT}u-jdk-${MY_PV}"
+
+# The space required to build varies wildly depending on USE flags,
+# ranging from 2GB to 16GB. This function is certainly not exact but
+# should be close enough to be useful.
+openjdk_check_requirements() {
+ local M
+ M=2048
+ M=$(( $(usex jbootstrap 2 1) * $M ))
+ M=$(( $(usex debug 3 1) * $M ))
+ M=$(( $(usex doc 320 0) + $(usex source 128 0) + 192 + $M ))
+
+ CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE}
+}
+
+pkg_pretend() {
+ openjdk_check_requirements
+ has ccache ${FEATURES} && die "FEATURES=ccache doesn't work with ${PN}"
+}
+
+pkg_setup() {
+ openjdk_check_requirements
+ java-vm-2_pkg_setup
+
+ JAVA_PKG_WANT_BUILD_VM="openjdk-${SLOT} openjdk-bin-${SLOT}"
+ JAVA_PKG_WANT_SOURCE="${SLOT}"
+ JAVA_PKG_WANT_TARGET="${SLOT}"
+
+ # The nastiness below is necessary while the gentoo-vm USE flag is
+ # masked. First we call java-pkg-2_pkg_setup if it looks like the
+ # flag was unmasked against one of the possible build VMs. If not,
+ # we try finding one of them in their expected locations. This would
+ # have been slightly less messy if openjdk-bin had been installed to
+ # /opt/${PN}-${SLOT} or if there was a mechanism to install a VM env
+ # file but disable it so that it would not normally be selectable.
+
+ local vm
+ for vm in ${JAVA_PKG_WANT_BUILD_VM}; do
+ if [[ -d ${EPREFIX}/usr/lib/jvm/${vm} ]]; then
+ java-pkg-2_pkg_setup
+ return
+ fi
+ done
+
+ if has_version --host-root dev-java/openjdk:${SLOT}; then
+ export JDK_HOME=${EPREFIX}/usr/$(get_libdir)/openjdk-${SLOT}
+ else
+ JDK_HOME=$(best_version --host-root dev-java/openjdk-bin:${SLOT})
+ [[ -n ${JDK_HOME} ]] || die "Build VM not found!"
+ JDK_HOME=${JDK_HOME#*/}
+ JDK_HOME=${EPREFIX}/opt/${JDK_HOME%-r*}
+ export JDK_HOME
+ fi
+}
+
+src_prepare() {
+ default
+ chmod +x configure || die
+}
+
+src_configure() {
+ # Work around stack alignment issue, bug #647954. in case we ever have x86
+ use x86 && append-flags -mincoming-stack-boundary=2
+
+ # Enabling full docs appears to break doc building. If not
+ # explicitly disabled, the flag will get auto-enabled if pandoc and
+ # graphviz are detected. pandoc has loads of dependencies anyway.
+ # currently it still bundles lcms libpng giflib and libjpeg.
+
+ local myconf=(
+ --disable-ccache
+ --enable-full-docs=no
+ --with-boot-jdk="${JDK_HOME}"
+ --with-extra-cflags="${CFLAGS}"
+ --with-extra-cxxflags="${CXXFLAGS}"
+ --with-extra-ldflags="${LDFLAGS}"
+ --with-native-debug-symbols=$(usex debug internal none)
+ --with-vendor-name="Gentoo"
+ --with-vendor-url="https://gentoo.org"
+ --with-vendor-bug-url="https://bugs.gentoo.org"
+ --with-vendor-vm-bug-url="https://bugs.openjdk.java.net"
+ --with-vendor-version-string="${PV}"
+ --with-version-pre=gentoo
+ --with-version-string=${MY_PV%+*}
+ --with-version-build=${MY_PV#*+}
+ --with-zlib=system
+ --enable-dtrace=$(usex systemtap yes no)
+ --enable-headless-only=$(usex headless-awt yes no)
+ )
+
+ # PaX breaks pch, bug #601016
+ if use pch && ! host-is-pax; then
+ myconf+=( --enable-precompiled-headers )
+ else
+ myconf+=( --disable-precompiled-headers )
+ fi
+
+ (
+ unset _JAVA_OPTIONS JAVA JAVAC XARGS
+ CFLAGS= CXXFLAGS= LDFLAGS= \
+ CONFIG_SITE=/dev/null \
+ econf "${myconf[@]}"
+ )
+}
+
+src_compile() {
+ emake -j1 \
+ $(usex jbootstrap bootcycle-images product-images) $(usex doc docs '') \
+ JOBS=$(makeopts_jobs) LOG=debug CFLAGS_WARNINGS_ARE_ERRORS= # No -Werror
+}
+
+src_install() {
+ local dest="/usr/$(get_libdir)/${PN}-${SLOT}"
+ local ddest="${ED}${dest#/}"
+
+ cd "${S}"/build/*-release/images/jdk || die
+
+ # Oracle and IcedTea have libjsoundalsa.so depending on
+ # libasound.so.2 but OpenJDK only has libjsound.so. Weird.
+ if ! use alsa ; then
+ rm -v lib/libjsound.* || die
+ fi
+
+ if ! use examples ; then
+ rm -vr demo/ || die
+ fi
+
+ if ! use source ; then
+ rm -v lib/src.zip || die
+ fi
+
+ dodir "${dest}"
+ cp -pPR * "${ddest}" || die
+
+ use gentoo-vm && java-vm_install-env "${FILESDIR}"/${PN}-${SLOT}.env.sh
+ java-vm_set-pax-markings "${ddest}"
+ java-vm_revdep-mask
+ java-vm_sandbox-predict /dev/random /proc/self/coredump_filter
+
+ if use doc ; then
+ insinto /usr/share/doc/${PF}/html
+ doins -r "${S}"/build/*-release/images/docs/*
+ fi
+}
+
+pkg_postinst() {
+ java-vm-2_pkg_postinst
+
+ if use gentoo-vm ; then
+ ewarn "WARNING! You have enabled the gentoo-vm USE flag, making this JDK"
+ ewarn "recognised by the system. This will almost certainly break things."
+ else
+ ewarn "The experimental gentoo-vm USE flag has not been enabled so this JDK"
+ ewarn "will not be recognised by the system. For example, simply calling"
+ ewarn "\"java\" will launch a different JVM. This is necessary until Gentoo"
+ ewarn "fully supports Java ${SLOT}. This JDK must therefore be invoked using its"
+ ewarn "absolute location under ${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}."
+ fi
+}
diff --git a/dev-java/openjdk/openjdk-8.212_p03.ebuild b/dev-java/openjdk/openjdk-8.212_p03.ebuild
new file mode 100644
index 000000000000..e190f2bf302a
--- /dev/null
+++ b/dev-java/openjdk/openjdk-8.212_p03.ebuild
@@ -0,0 +1,248 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit check-reqs eapi7-ver flag-o-matic java-pkg-2 java-vm-2 multiprocessing pax-utils toolchain-funcs
+
+MY_PV=$(ver_rs 1 'u' 2 '-' ${PV//p/b})
+
+BASE_URI="https://hg.${PN}.java.net/jdk8u/jdk8u"
+
+DESCRIPTION="Open source implementation of the Java programming language"
+HOMEPAGE="https://openjdk.java.net"
+SRC_URI="
+ ${BASE_URI}/archive/jdk${MY_PV}.tar.bz2 -> ${P}.tar.bz2
+ ${BASE_URI}/corba/archive/jdk${MY_PV}.tar.bz2 -> ${PN}-corba-${PV}.tar.bz2
+ ${BASE_URI}/hotspot/archive/jdk${MY_PV}.tar.bz2 -> ${PN}-hotspot-${PV}.tar.bz2
+ ${BASE_URI}/jaxp/archive/jdk${MY_PV}.tar.bz2 -> ${PN}-jaxp-${PV}.tar.bz2
+ ${BASE_URI}/jaxws/archive/jdk${MY_PV}.tar.bz2 -> ${PN}-jaxws-${PV}.tar.bz2
+ ${BASE_URI}/jdk/archive/jdk${MY_PV}.tar.bz2 -> ${PN}-jdk-${PV}.tar.bz2
+ ${BASE_URI}/langtools/archive/jdk${MY_PV}.tar.bz2 -> ${PN}-langtools-${PV}.tar.bz2
+ ${BASE_URI}/nashorn/archive/jdk${MY_PV}.tar.bz2 -> ${PN}-nashorn-${PV}.tar.bz2
+"
+
+LICENSE="GPL-2"
+SLOT="$(ver_cut 1)"
+KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86"
+IUSE="alsa debug cups doc examples gentoo-vm headless-awt +jbootstrap nsplugin +pch selinux source +webstart"
+
+CDEPEND="
+ media-libs/freetype:2=
+ sys-libs/zlib
+ alsa? ( media-libs/alsa-lib )
+ !headless-awt? (
+ media-libs/giflib:0/7
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXi
+ x11-libs/libXrender
+ x11-libs/libXt
+ x11-libs/libXtst
+ )
+"
+
+RDEPEND="
+ ${CDEPEND}
+ cups? ( net-print/cups )
+ selinux? ( sec-policy/selinux-java )
+"
+
+# cups headers requied to build, runtime dep is optional
+DEPEND="
+ ${CDEPEND}
+ net-print/cups
+ app-arch/zip
+ app-misc/ca-certificates
+ dev-lang/perl
+ dev-libs/openssl:0
+ media-libs/alsa-lib
+ !headless-awt? (
+ x11-base/xorg-proto
+ )
+ || (
+ dev-java/openjdk-bin:${SLOT}
+ dev-java/icedtea-bin:${SLOT}
+ dev-java/openjdk:${SLOT}
+ dev-java/icedtea:${SLOT}
+ )
+"
+
+PDEPEND="webstart? ( >=dev-java/icedtea-web-1.6.1:0 )
+ nsplugin? ( >=dev-java/icedtea-web-1.6.1:0[nsplugin] )"
+
+S="${WORKDIR}/jdk${SLOT}u-jdk${MY_PV}"
+
+# The space required to build varies wildly depending on USE flags,
+# ranging from 2GB to 16GB. This function is certainly not exact but
+# should be close enough to be useful.
+openjdk_check_requirements() {
+ local M
+ M=2048
+ M=$(( $(usex debug 3 1) * $M ))
+ M=$(( $(usex jbootstrap 2 1) * $M ))
+ M=$(( $(usex doc 320 0) + $(usex source 128 0) + 192 + $M ))
+
+ CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE}
+}
+
+pkg_pretend() {
+ openjdk_check_requirements
+ has ccache ${FEATURES} && die "FEATURES=ccache doesn't work with ${PN}"
+}
+
+pkg_setup() {
+ openjdk_check_requirements
+ java-vm-2_pkg_setup
+
+ JAVA_PKG_WANT_BUILD_VM="openjdk-${SLOT} openjdk-bin-${SLOT} icedtea-${SLOT} icedtea-bin-${SLOT}"
+ JAVA_PKG_WANT_SOURCE="${SLOT}"
+ JAVA_PKG_WANT_TARGET="${SLOT}"
+
+ # The nastiness below is necessary while the gentoo-vm USE flag is
+ # masked. First we call java-pkg-2_pkg_setup if it looks like the
+ # flag was unmasked against one of the possible build VMs. If not,
+ # we try finding one of them in their expected locations. This would
+ # have been slightly less messy if openjdk-bin had been installed to
+ # /opt/${PN}-${SLOT} or if there was a mechanism to install a VM env
+ # file but disable it so that it would not normally be selectable.
+
+ local vm
+ for vm in ${JAVA_PKG_WANT_BUILD_VM}; do
+ if [[ -d ${EPREFIX}/usr/lib/jvm/${vm} ]]; then
+ java-pkg-2_pkg_setup
+ return
+ fi
+ done
+
+ if has_version --host-root dev-java/openjdk:${SLOT}; then
+ export JDK_HOME=${EPREFIX}/usr/$(get_libdir)/openjdk-${SLOT}
+ else
+ JDK_HOME=$(best_version --host-root dev-java/openjdk-bin:${SLOT})
+ [[ -n ${JDK_HOME} ]] || die "Build VM not found!"
+ JDK_HOME=${JDK_HOME#*/}
+ JDK_HOME=${EPREFIX}/opt/${JDK_HOME%-r*}
+ export JDK_HOME
+ fi
+}
+
+src_prepare() {
+ default
+ chmod +x configure || die
+ local repo
+ for repo in corba hotspot jdk jaxp jaxws langtools nashorn; do
+ ln -s ../"${repo}-jdk${MY_PV}" "${repo}" || die
+ done
+
+ # linux 5 is ok https://bugs.gentoo.org/679506
+ sed -i '/^SUPPORTED_OS_VERSION/ s/ 4%/ 4% 5%/' hotspot/make/linux/Makefile || die
+}
+
+src_configure() {
+ # general build info found here:
+ #https://hg.openjdk.java.net/jdk8/jdk8/raw-file/tip/README-builds.html
+
+ # Work around stack alignment issue, bug #647954.
+ use x86 && append-flags -mincoming-stack-boundary=2
+
+ append-flags -Wno-error
+
+ local myconf=(
+ --disable-ccache
+ --enable-unlimited-crypto
+ --with-boot-jdk="${JDK_HOME}"
+ --with-extra-cflags="${CFLAGS}"
+ --with-extra-cxxflags="${CXXFLAGS}"
+ --with-extra-ldflags="${LDFLAGS}"
+ --with-giflib=system
+ --with-jtreg=no
+ --with-jobs=1
+ --with-num-cores=1
+ --with-update-version="$(ver_cut 2)"
+ --with-build-number="$(ver_cut 4)"
+ --with-milestone="gentoo"
+ --with-vendor-name="Gentoo"
+ --with-vendor-url="https://gentoo.org"
+ --with-vendor-bug-url="https://bugs.gentoo.org"
+ --with-vendor-vm-bug-url="https://bugs.openjdk.java.net"
+ --with-zlib=system
+ --with-native-debug-symbols=$(usex debug internal none)
+ $(usex headless-awt --disable-headful '')
+ )
+
+ # PaX breaks pch, bug #601016
+ if use pch && ! host-is-pax; then
+ myconf+=( --enable-precompiled-headers )
+ else
+ myconf+=( --disable-precompiled-headers )
+ fi
+
+ (
+ unset _JAVA_OPTIONS JAVA JAVAC XARGS
+ CFLAGS= CXXFLAGS= LDFLAGS= \
+ CONFIG_SITE=/dev/null \
+ econf "${myconf[@]}"
+ )
+}
+
+src_compile() {
+ emake -j1 LOG=debug JOBS=$(makeopts_jobs)\
+ $(usex jbootstrap bootcycle-images images) $(usex doc docs '')
+}
+
+src_install() {
+ local dest="/usr/$(get_libdir)/${PN}-${SLOT}"
+ local ddest="${ED}${dest#/}"
+
+ cd "${S}"/build/*-release/images/j2sdk-image || die
+
+ if ! use alsa; then
+ rm -v jre/lib/$(get_system_arch)/libjsoundalsa.* || die
+ fi
+
+ if ! use examples ; then
+ rm -vr demo/ || die
+ fi
+
+ if ! use source ; then
+ rm -v src.zip || die
+ fi
+
+ dodir "${dest}"
+ cp -pPR * "${ddest}" || die
+
+ einfo "Generating cacerts file from certificates in ${EPREFIX}/usr/share/ca-certificates/"
+ mkdir "${T}/certgen" && cd "${T}/certgen" || die
+ cp "${FILESDIR}/generate-cacerts.pl" . && chmod +x generate-cacerts.pl || die
+ for c in "${EPREFIX}"/usr/share/ca-certificates/*/*.crt; do
+ openssl x509 -text -in "${c}" >> all.crt || die
+ done
+ ./generate-cacerts.pl "${ddest}/bin/keytool" all.crt || die
+ cp -vRP cacerts "${ddest}/jre/lib/security/" || die
+ chmod 644 "${ddest}/jre/lib/security/cacerts" || die
+
+ use gentoo-vm && java-vm_install-env "${FILESDIR}"/${PN}-${SLOT}.env.sh
+ java-vm_set-pax-markings "${ddest}"
+ java-vm_revdep-mask
+ java-vm_sandbox-predict /dev/random /proc/self/coredump_filter
+
+ if use doc ; then
+ insinto /usr/share/doc/${PF}/html
+ doins -r "${S}"/build/*-release/docs/*
+ fi
+}
+
+pkg_postinst() {
+ java-vm-2_pkg_postinst
+
+ if use gentoo-vm ; then
+ ewarn "WARNING! You have enabled the gentoo-vm USE flag, making this JDK"
+ ewarn "recognised by the system. This will almost certainly break things."
+ else
+ ewarn "The experimental gentoo-vm USE flag has not been enabled so this JDK"
+ ewarn "will not be recognised by the system. For example, simply calling"
+ ewarn "\"java\" will launch a different JVM. This is necessary until Gentoo"
+ ewarn "fully supports Java ${SLOT}. This JDK must therefore be invoked using its"
+ ewarn "absolute location under ${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}."
+ fi
+}