Add OpenJDK 12-15.

Co-authored-by: Darren Blaber.
This commit is contained in:
Andrius Štikonas 2020-09-27 14:03:39 +01:00
parent 66ea9d7e13
commit b3e687aa77
9 changed files with 1186 additions and 0 deletions

View File

@ -2,9 +2,17 @@ AUX bootcycle_jobs.patch 1273 BLAKE2B 4ff4b9f629167230aa0800da4559b1d31028924971
AUX generate-cacerts.pl 11051 BLAKE2B e6d54319153735bd4b445581dfbd2b78e2e27a19f3b8a78d2fe6912efa207d133fa550652295648bc0bd1370956f71374d4b42de71776fa253f44d4e9dff2527 SHA512 22d1be675362c09ed61af4dc3ece14cab81e9514937d588ff5d324e61b7eba7d3dd99b26bc5ec0953365de56d099f708b2afdb13cca37bc4ff07fd8ce31fbe97
AUX openjdk-10.env.sh 537 BLAKE2B 404aeaf3d4df54b66193b8e09521ad2e55a23dc0603beea9911e4c91ab96e30c0f4aa4a0e96b1982874e055af3b9923689657b58dc02b37f91163659343ed2f9 SHA512 f4a41891b0187048a21b1af43053375e62de249e3ba210c3cfd59178c9f4c667ff83f10ee85f9ae37db097e862ff7233f5136569d0cb1399dbf48cea075cfc6e
AUX openjdk-11.env.sh 537 BLAKE2B 404aeaf3d4df54b66193b8e09521ad2e55a23dc0603beea9911e4c91ab96e30c0f4aa4a0e96b1982874e055af3b9923689657b58dc02b37f91163659343ed2f9 SHA512 f4a41891b0187048a21b1af43053375e62de249e3ba210c3cfd59178c9f4c667ff83f10ee85f9ae37db097e862ff7233f5136569d0cb1399dbf48cea075cfc6e
AUX openjdk-12.env.sh 537 BLAKE2B 404aeaf3d4df54b66193b8e09521ad2e55a23dc0603beea9911e4c91ab96e30c0f4aa4a0e96b1982874e055af3b9923689657b58dc02b37f91163659343ed2f9 SHA512 f4a41891b0187048a21b1af43053375e62de249e3ba210c3cfd59178c9f4c667ff83f10ee85f9ae37db097e862ff7233f5136569d0cb1399dbf48cea075cfc6e
AUX openjdk-13.env.sh 537 BLAKE2B 404aeaf3d4df54b66193b8e09521ad2e55a23dc0603beea9911e4c91ab96e30c0f4aa4a0e96b1982874e055af3b9923689657b58dc02b37f91163659343ed2f9 SHA512 f4a41891b0187048a21b1af43053375e62de249e3ba210c3cfd59178c9f4c667ff83f10ee85f9ae37db097e862ff7233f5136569d0cb1399dbf48cea075cfc6e
AUX openjdk-14.env.sh 537 BLAKE2B 404aeaf3d4df54b66193b8e09521ad2e55a23dc0603beea9911e4c91ab96e30c0f4aa4a0e96b1982874e055af3b9923689657b58dc02b37f91163659343ed2f9 SHA512 f4a41891b0187048a21b1af43053375e62de249e3ba210c3cfd59178c9f4c667ff83f10ee85f9ae37db097e862ff7233f5136569d0cb1399dbf48cea075cfc6e
AUX openjdk-15.env.sh 537 BLAKE2B 404aeaf3d4df54b66193b8e09521ad2e55a23dc0603beea9911e4c91ab96e30c0f4aa4a0e96b1982874e055af3b9923689657b58dc02b37f91163659343ed2f9 SHA512 f4a41891b0187048a21b1af43053375e62de249e3ba210c3cfd59178c9f4c667ff83f10ee85f9ae37db097e862ff7233f5136569d0cb1399dbf48cea075cfc6e
AUX openjdk-9.env.sh 537 BLAKE2B 404aeaf3d4df54b66193b8e09521ad2e55a23dc0603beea9911e4c91ab96e30c0f4aa4a0e96b1982874e055af3b9923689657b58dc02b37f91163659343ed2f9 SHA512 f4a41891b0187048a21b1af43053375e62de249e3ba210c3cfd59178c9f4c667ff83f10ee85f9ae37db097e862ff7233f5136569d0cb1399dbf48cea075cfc6e
DIST jdk-10.0.2+13.tar.bz2 88365048 BLAKE2B f898a0976cff12cca439ccdba2bf7eff7fcbc5f00709fa41302fd781819a44165fa864d5e551023c507ad18dc957abd24b15744fc6dc5304ee1a26bd4cb8cb86 SHA512 7491da11d5e0013db75d33e09be7a91ac0dbcde6282541a39fe471fd5368d49b15403bc7508b330ca60210b3ca02730743ba280657283a231853f6882a3ca74d
DIST jdk-11.0.5+10.tar.bz2 90613232 BLAKE2B 0a3cba851ac967d84f97ae1e7972d3ab593dbc76fb20664c4e7950380ad91acee7e263a2989930b45346cd170da71c500db9d8a0a6ac88982d77607089b95513 SHA512 0d52c78e217b79756be0fc6b3f9204bae254ec7b9ae10b6c3114463a9c028143807f4422711f0c02b81a034ae6e88fa2efc6bed85022720807344230a8aa12a6
DIST openjdk-12.0.2_p1.tar.bz2 83912905 BLAKE2B cf81872dc9a68758bd46a0c486893321461323872d204028b84c36fdd8f9de54c88bb70d4f0c50b7370f589a424852e74a383dea71e17c227ac740283dd933e4 SHA512 53c66ae9bdc6aa47b05f57845d696edf55c5e5eeb6c7dd6cd46b9a0cfad9864db846ac88e00aefbc86ff9ffa77ab9bcf9cf3c73b7f3b797ad68d9e8609438dd9
DIST openjdk-13.0.4_p1.tar.bz2 83507118 BLAKE2B 500985c9b406ec62fdbacf8f1c5350c48dbd029384313a5a95632f860ba20191e1f9be79fe860c3f9a6d8461ed2207be97f03fb8b740cbd7ae1f04242691c05f SHA512 2f2f30e3450ed2f73b56ad722784d8d01b3bddf46c55b1f2bd283920c7eb51c94816048021d68e8d9ab524a1db4979f2926684c6441c49fe092c1778ced346d5
DIST openjdk-14.0.2_p1.tar.gz 109297285 BLAKE2B be60397242955b3479bfee9cc1b43e2c5ddc404c20e310ece294fa9cbd3b9cb32e198bd4d241c3731efc92cb17e36efbd8b30fa618bd4cbec9ec139283e82518 SHA512 e76b7908e7b1375029564d39386c86b640fcb61c7152bdda7249a6455516792830f17e987c98790ae5983087b928be6f5d572b8b10f3e2318d2d993f5f22ed62
DIST openjdk-15.0.0_p36.tar.gz 101812870 BLAKE2B 1028ab04825941452b603998f05e2a7e419931979a19855f6ea6c1578c331704ac19ae77043a4f44b2f5d9d481b9a9eaad6c3e3eec9154789d54980ba0295bb7 SHA512 c08d2818de06569278b67954556221ed7c6ab6848ffc57823b789f370ebdd332d2803979a5a254e8f9f669ea161bb479f66ad4e1490b37889d38233b6cca4357
DIST openjdk-9.0.4_p12.tar.bz2 823756 BLAKE2B f1b457655520b983597b15254323abdb0c39feaff78ce36d88ef556a086d9f9333ceddec63d945ca28bb06f4a06c2bc1344051ac2c1df55a01728016ff7255c1 SHA512 cef3655ae7db657e6c81aa86587e451e58896bb6ee786495f6d757096334435b6a4de26ec3ec927da2487e135f09ce26414f8d6b9b9c508a28d3087be286b1ec
DIST openjdk-corba-9.0.4_p12.tar.bz2 1002503 BLAKE2B 789664686432cee36e7e165aa4ac6e9a2ed1a1a85a961cd362d9bbdf59d7c7077b71bd2fc59e03f3e3a8cdbc4443a7e359fbfbbbaebfe29bbd220e3cafc3a298 SHA512 455998437a9e3ff538b921025d57e19e6fb5148b3f124c9c427c3604689884d81b3ce5c9dbd93d88de26bf1b43ce76d75f75afd95e473a94973a668575e41748
DIST openjdk-hotspot-9.0.4_p12.tar.bz2 11411231 BLAKE2B a21a5003266f6d8f60adaf78b109d496e46058841d0ab2c8f17256a503124b36e18908240f04fdbb16c056a1f68608f891fed1dbb9c9a0b2bb2326a303a32a4f SHA512 49d93764b13085a5626bec1c3d4e790f8748c24577a4e990e76bd1006721a5b8b9a256c40bf6419df4dda6f6390e457485f90c1b1101c010476a04d9056e9f16
@ -15,5 +23,9 @@ DIST openjdk-langtools-9.0.4_p12.tar.bz2 4497608 BLAKE2B 382bfa6119345f1983cf5a1
DIST openjdk-nashorn-9.0.4_p12.tar.bz2 8961760 BLAKE2B 2ff03adf87a0e0561d52529cf95b8fb827e75773462be7ecddd60dc966e1a229b897eb65a0301a531dfcaff884122e612f1a24b5d5fbc8f0352a8d84218423d7 SHA512 848c6ece418e250561572ad704baeb565580098cfc5f849d4e1a3b41b916aae3487eb4d8d0b319f3a503d122ec064ed4de0678d06821c9a2bdb09c990e589c97
EBUILD openjdk-10.0.2_p13.ebuild 7530 BLAKE2B e3d307b1af2c32f19cfe001a0009634aa377429bea882dd51a2a4fb714bc6934d9b700b1d3c2a8db25901f93f02bb8990a5016315b810dce7b1b10c986c424de SHA512 434b71216129c6a42c89b01d37d6b21205549a9caadd0e075771f5e514557d392d7f4b00dbe2a86cdbec6fa17648da952b356d667ac6bd594aa0a07c1ce762c8
EBUILD openjdk-11.0.5_p10.ebuild 7663 BLAKE2B 71e3d5259823f5a1944dda4b2394265799b007fe79057bc5e22a7aba550d8b6c4de52f1f2b0fa7b7d4288fa6d4247537012e1209215a4872361c9557e1d0e8f0 SHA512 f6323118aa9dabb339b48b98e7219043b700471e4652e9d0b4fca1b20baa55d0ffcd989e02bf7ea8b5cfe88865eaf5e863b5dc1729f706bcf7b2e5d67fc16fbd
EBUILD openjdk-12.0.2_p1.ebuild 7781 BLAKE2B 9ac75843354349bc67d28277933a6ea6a5307db8bea5390d9e798414e02a7ffb483011caccd0b7b409ddb98443e0045dda0bb0d57fc192e00884e70326d5f50e SHA512 d99c2bf7cc4997219a043fabbde56e2d7f821933e308085fb666027fbe2548102d55a55f84f639b3ce787782b8d6558ec01695103691de5ebb8ab53bd0718ddc
EBUILD openjdk-13.0.4_p1.ebuild 7781 BLAKE2B 9ac75843354349bc67d28277933a6ea6a5307db8bea5390d9e798414e02a7ffb483011caccd0b7b409ddb98443e0045dda0bb0d57fc192e00884e70326d5f50e SHA512 d99c2bf7cc4997219a043fabbde56e2d7f821933e308085fb666027fbe2548102d55a55f84f639b3ce787782b8d6558ec01695103691de5ebb8ab53bd0718ddc
EBUILD openjdk-14.0.2_p1.ebuild 8298 BLAKE2B 8dc89c9353b7233b06099f8a171efc579a0e0df7d07e1d62f823124158eaccd464e2389dec87eb84b7818a5e13d7b1581e9c204adcd695bec381efba8bc0c738 SHA512 b98ec119c4e7e61a8490544833b1649655b1f03e5694e64ba739396698294da106306cea70241e689144912bccef2d334841c73d3e22d5653d96e043c37304c5
EBUILD openjdk-15.0.0_p36.ebuild 8298 BLAKE2B 8dc89c9353b7233b06099f8a171efc579a0e0df7d07e1d62f823124158eaccd464e2389dec87eb84b7818a5e13d7b1581e9c204adcd695bec381efba8bc0c738 SHA512 b98ec119c4e7e61a8490544833b1649655b1f03e5694e64ba739396698294da106306cea70241e689144912bccef2d334841c73d3e22d5653d96e043c37304c5
EBUILD openjdk-9.0.4_p12.ebuild 7431 BLAKE2B 0f3e942d48e787a54429ad6a7f076b4ec20800b918d82d3797810c8db390297f68457590481450649df1d8581a029616a5c98330229892e3e5f12f9dafa87916 SHA512 5ca4c6294546be74e19a85fe827a74d72dabd39049153043c92ef8b8432c42d6845fa202e68a5936eb2bc6ceb2fb86572fb7a74305ad5aa292055d200f571b68
MISC metadata.xml 1398 BLAKE2B 7b99e080f6dc261c94314c7f7a0314ee25b48752ca494dd23d1534c5e8e3f930601262a0316ed674786c5fd960dfbc25dd6c6768cd06325ef45c0b41f920eafc SHA512 1747f484c6f784cb551f0969aab9ca1e6c42509c06b6187b72f3e16861ce3e2e71e131deb1ae6ebe2eda1c768276794cd5a0db7918eb419b9502a3c45bf78959

View File

@ -0,0 +1,16 @@
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
VERSION="OpenJDK ${PV}"
JAVA_HOME="${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}"
JDK_HOME="${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}"
JAVAC="\${JAVA_HOME}/bin/javac"
PATH="\${JAVA_HOME}/bin"
ROOTPATH="\${JAVA_HOME}/bin"
LDPATH="\${JAVA_HOME}/lib/:\${JAVA_HOME}/lib/server/"
MANPATH=""
PROVIDES_TYPE="JDK JRE"
PROVIDES_VERSION="${SLOT}"
BOOTCLASSPATH=""
GENERATION="2"
ENV_VARS="JAVA_HOME JDK_HOME JAVAC PATH ROOTPATH LDPATH MANPATH"

View File

@ -0,0 +1,16 @@
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
VERSION="OpenJDK ${PV}"
JAVA_HOME="${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}"
JDK_HOME="${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}"
JAVAC="\${JAVA_HOME}/bin/javac"
PATH="\${JAVA_HOME}/bin"
ROOTPATH="\${JAVA_HOME}/bin"
LDPATH="\${JAVA_HOME}/lib/:\${JAVA_HOME}/lib/server/"
MANPATH=""
PROVIDES_TYPE="JDK JRE"
PROVIDES_VERSION="${SLOT}"
BOOTCLASSPATH=""
GENERATION="2"
ENV_VARS="JAVA_HOME JDK_HOME JAVAC PATH ROOTPATH LDPATH MANPATH"

View File

@ -0,0 +1,16 @@
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
VERSION="OpenJDK ${PV}"
JAVA_HOME="${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}"
JDK_HOME="${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}"
JAVAC="\${JAVA_HOME}/bin/javac"
PATH="\${JAVA_HOME}/bin"
ROOTPATH="\${JAVA_HOME}/bin"
LDPATH="\${JAVA_HOME}/lib/:\${JAVA_HOME}/lib/server/"
MANPATH=""
PROVIDES_TYPE="JDK JRE"
PROVIDES_VERSION="${SLOT}"
BOOTCLASSPATH=""
GENERATION="2"
ENV_VARS="JAVA_HOME JDK_HOME JAVAC PATH ROOTPATH LDPATH MANPATH"

View File

@ -0,0 +1,16 @@
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
VERSION="OpenJDK ${PV}"
JAVA_HOME="${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}"
JDK_HOME="${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}"
JAVAC="\${JAVA_HOME}/bin/javac"
PATH="\${JAVA_HOME}/bin"
ROOTPATH="\${JAVA_HOME}/bin"
LDPATH="\${JAVA_HOME}/lib/:\${JAVA_HOME}/lib/server/"
MANPATH=""
PROVIDES_TYPE="JDK JRE"
PROVIDES_VERSION="${SLOT}"
BOOTCLASSPATH=""
GENERATION="2"
ENV_VARS="JAVA_HOME JDK_HOME JAVAC PATH ROOTPATH LDPATH MANPATH"

View File

@ -0,0 +1,274 @@
# Copyright 1999-2020 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
# we need -ga tag to fetch tarball and unpack it, but exact number everywhere else to
# set build version properly
MY_PV="${PV%_p*}-ga"
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 -> ${P}.tar.bz2"
LICENSE="GPL-2"
KEYWORDS="amd64 ~arm arm64 ~ppc64"
IUSE="alsa cups debug doc examples gentoo-vm headless-awt javafx +jbootstrap +pch selinux source systemtap"
COMMON_DEPEND="
media-libs/freetype:2=
media-libs/giflib:0/7
media-libs/libpng:0=
media-libs/lcms:2=
sys-libs/zlib
virtual/jpeg:0=
systemtap? ( dev-util/systemtap )
"
# Many libs are required to build, but not to run, make is possible to remove
# by listing conditionally in RDEPEND unconditionally in DEPEND
RDEPEND="
${COMMON_DEPEND}
>=sys-apps/baselayout-java-0.1.0-r1
!headless-awt? (
x11-libs/libX11
x11-libs/libXext
x11-libs/libXi
x11-libs/libXrandr
x11-libs/libXrender
x11-libs/libXt
x11-libs/libXtst
)
alsa? ( media-libs/alsa-lib )
cups? ( net-print/cups )
selinux? ( sec-policy/selinux-java )
"
DEPEND="
${COMMON_DEPEND}
app-arch/zip
media-libs/alsa-lib
net-print/cups
x11-base/xorg-proto
x11-libs/libX11
x11-libs/libXext
x11-libs/libXi
x11-libs/libXrandr
x11-libs/libXrender
x11-libs/libXt
x11-libs/libXtst
javafx? ( dev-java/openjfx:${SLOT}= )
|| (
dev-java/openjdk-bin:${SLOT}
dev-java/openjdk:${SLOT}
dev-java/openjdk-bin:$((SLOT-1))
dev-java/openjdk:$((SLOT-1))
)
"
REQUIRED_USE="javafx? ( alsa !headless-awt )"
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
if [[ ${MERGE_TYPE} != binary ]]; then
has ccache ${FEATURES} && die "FEATURES=ccache doesn't work with ${PN}"
fi
}
pkg_setup() {
openjdk_check_requirements
java-vm-2_pkg_setup
JAVA_PKG_WANT_BUILD_VM="openjdk-${SLOT} openjdk-bin-${SLOT} openjdk-$((SLOT-1)) openjdk-bin-$((SLOT-1))"
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
if [[ ${MERGE_TYPE} != "binary" ]]; then
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
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
# Work around -fno-common ( GCC10 default ), bug #713180
append-flags -fcommon
# 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.
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-giflib=system
--with-lcms=system
--with-libjpeg=system
--with-libpng=system
--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="${PVR}"
--with-version-pre=""
--with-version-string="${PV%_p*}"
--with-version-build="${PV#*_p}"
--with-zlib=system
--disable-warnings-as-errors
--enable-dtrace=$(usex systemtap yes no)
--enable-headless-only=$(usex headless-awt yes no)
)
if use javafx; then
local zip="${EROOT%/}/usr/$(get_libdir)/openjfx-${SLOT}/javafx-exports.zip"
if [[ -r ${zip} ]]; then
myconf+=( --with-import-modules="${zip}" )
else
die "${zip} not found or not readable"
fi
fi
# 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 JAVA_TOOL_OPTIONS JAVAC XARGS
CFLAGS= CXXFLAGS= LDFLAGS= \
CONFIG_SITE=/dev/null \
econf "${myconf[@]}"
)
}
src_compile() {
local myemakeargs=(
JOBS=$(makeopts_jobs)
LOG=debug
ALL_NAMED_TESTS= # Build error
$(usex doc docs '')
$(usex jbootstrap bootcycle-images product-images)
)
emake "${myemakeargs[@]}" -j1 #nowarn
}
src_install() {
local dest="/usr/$(get_libdir)/${PN}-${SLOT}"
local ddest="${ED}${dest#/}"
cd "${S}"/build/*-release/images/jdk || die
# Create files used as storage for system preferences.
mkdir .systemPrefs || die
touch .systemPrefs/.system.lock || die
touch .systemPrefs/.systemRootModFile || 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
rm -v lib/security/cacerts || die
dodir "${dest}"
cp -pPR * "${ddest}" || die
dosym ../../../../../etc/ssl/certs/java/cacerts "${dest}"/lib/security/cacerts
# must be done before running itself
java-vm_set-pax-markings "${ddest}"
einfo "Creating the Class Data Sharing archives and disabling usage tracking"
"${ddest}/bin/java" -server -Xshare:dump -Djdk.disableLastUsageTracking || die
use gentoo-vm && java-vm_install-env "${FILESDIR}"/${PN}-${SLOT}.env.sh
java-vm_revdep-mask
java-vm_sandbox-predict /dev/random /proc/self/coredump_filter
if use doc ; then
docinto html
dodoc -r "${S}"/build/*-release/images/docs/*
dosym ../../../usr/share/doc/"${PF}" /usr/share/doc/"${PN}-${SLOT}"
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"
ewarn "many java ebuilds as they are not ready for openjdk-11"
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
}

View File

@ -0,0 +1,274 @@
# Copyright 1999-2020 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
# we need -ga tag to fetch tarball and unpack it, but exact number everywhere else to
# set build version properly
MY_PV="${PV%_p*}-ga"
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 -> ${P}.tar.bz2"
LICENSE="GPL-2"
KEYWORDS="amd64 ~arm arm64 ~ppc64"
IUSE="alsa cups debug doc examples gentoo-vm headless-awt javafx +jbootstrap +pch selinux source systemtap"
COMMON_DEPEND="
media-libs/freetype:2=
media-libs/giflib:0/7
media-libs/libpng:0=
media-libs/lcms:2=
sys-libs/zlib
virtual/jpeg:0=
systemtap? ( dev-util/systemtap )
"
# Many libs are required to build, but not to run, make is possible to remove
# by listing conditionally in RDEPEND unconditionally in DEPEND
RDEPEND="
${COMMON_DEPEND}
>=sys-apps/baselayout-java-0.1.0-r1
!headless-awt? (
x11-libs/libX11
x11-libs/libXext
x11-libs/libXi
x11-libs/libXrandr
x11-libs/libXrender
x11-libs/libXt
x11-libs/libXtst
)
alsa? ( media-libs/alsa-lib )
cups? ( net-print/cups )
selinux? ( sec-policy/selinux-java )
"
DEPEND="
${COMMON_DEPEND}
app-arch/zip
media-libs/alsa-lib
net-print/cups
x11-base/xorg-proto
x11-libs/libX11
x11-libs/libXext
x11-libs/libXi
x11-libs/libXrandr
x11-libs/libXrender
x11-libs/libXt
x11-libs/libXtst
javafx? ( dev-java/openjfx:${SLOT}= )
|| (
dev-java/openjdk-bin:${SLOT}
dev-java/openjdk:${SLOT}
dev-java/openjdk-bin:$((SLOT-1))
dev-java/openjdk:$((SLOT-1))
)
"
REQUIRED_USE="javafx? ( alsa !headless-awt )"
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
if [[ ${MERGE_TYPE} != binary ]]; then
has ccache ${FEATURES} && die "FEATURES=ccache doesn't work with ${PN}"
fi
}
pkg_setup() {
openjdk_check_requirements
java-vm-2_pkg_setup
JAVA_PKG_WANT_BUILD_VM="openjdk-${SLOT} openjdk-bin-${SLOT} openjdk-$((SLOT-1)) openjdk-bin-$((SLOT-1))"
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
if [[ ${MERGE_TYPE} != "binary" ]]; then
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
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
# Work around -fno-common ( GCC10 default ), bug #713180
append-flags -fcommon
# 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.
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-giflib=system
--with-lcms=system
--with-libjpeg=system
--with-libpng=system
--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="${PVR}"
--with-version-pre=""
--with-version-string="${PV%_p*}"
--with-version-build="${PV#*_p}"
--with-zlib=system
--disable-warnings-as-errors
--enable-dtrace=$(usex systemtap yes no)
--enable-headless-only=$(usex headless-awt yes no)
)
if use javafx; then
local zip="${EROOT%/}/usr/$(get_libdir)/openjfx-${SLOT}/javafx-exports.zip"
if [[ -r ${zip} ]]; then
myconf+=( --with-import-modules="${zip}" )
else
die "${zip} not found or not readable"
fi
fi
# 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 JAVA_TOOL_OPTIONS JAVAC XARGS
CFLAGS= CXXFLAGS= LDFLAGS= \
CONFIG_SITE=/dev/null \
econf "${myconf[@]}"
)
}
src_compile() {
local myemakeargs=(
JOBS=$(makeopts_jobs)
LOG=debug
ALL_NAMED_TESTS= # Build error
$(usex doc docs '')
$(usex jbootstrap bootcycle-images product-images)
)
emake "${myemakeargs[@]}" -j1 #nowarn
}
src_install() {
local dest="/usr/$(get_libdir)/${PN}-${SLOT}"
local ddest="${ED}${dest#/}"
cd "${S}"/build/*-release/images/jdk || die
# Create files used as storage for system preferences.
mkdir .systemPrefs || die
touch .systemPrefs/.system.lock || die
touch .systemPrefs/.systemRootModFile || 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
rm -v lib/security/cacerts || die
dodir "${dest}"
cp -pPR * "${ddest}" || die
dosym ../../../../../etc/ssl/certs/java/cacerts "${dest}"/lib/security/cacerts
# must be done before running itself
java-vm_set-pax-markings "${ddest}"
einfo "Creating the Class Data Sharing archives and disabling usage tracking"
"${ddest}/bin/java" -server -Xshare:dump -Djdk.disableLastUsageTracking || die
use gentoo-vm && java-vm_install-env "${FILESDIR}"/${PN}-${SLOT}.env.sh
java-vm_revdep-mask
java-vm_sandbox-predict /dev/random /proc/self/coredump_filter
if use doc ; then
docinto html
dodoc -r "${S}"/build/*-release/images/docs/*
dosym ../../../usr/share/doc/"${PF}" /usr/share/doc/"${PN}-${SLOT}"
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"
ewarn "many java ebuilds as they are not ready for openjdk-11"
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
}

View File

@ -0,0 +1,281 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit versionator autotools check-reqs flag-o-matic java-pkg-2 java-vm-2 multiprocessing pax-utils toolchain-funcs
# we need -ga tag to fetch tarball and unpack it, but exact number everywhere else to
# set build version properly
MY_PV="${PV/_p/+}"
FULL_VERSION="${PV%_p*}"
SLOT=$(get_major_version)
# First release of major jdk releases do not contain u at end jdk<slot>.
# so 15.0.0 would fetch jdk-15-ga.tar.gz from jdk15, 15.0.1 jdk-15.0.1-ga.tar.gz from jdk15u
if [ $(get_after_major_version $FULL_VERSION) = "0.0" ]; then
SRC_URI="https://github.com/openjdk/jdk${SLOT}/archive/jdk-${SLOT}-ga.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/jdk${SLOT}-jdk-${SLOT}-ga"
else
SRC_URI="https://github.com/openjdk/jdk${SLOT}u/archive/jdk-${FULL_VERSION}-ga.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/jdk${SLOT}u-jdk-${FULL_VERSION}-ga"
fi
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/archi${SLOT}/jdk-${MY_PV}.tar.bz2 -> ${P}.tar.bz2"
LICENSE="GPL-2"
KEYWORDS="amd64 ~arm arm64 ~ppc64"
IUSE="alsa cups debug doc examples gentoo-vm headless-awt javafx +jbootstrap +pch selinux source systemtap"
COMMON_DEPEND="
media-libs/freetype:2=
media-libs/giflib:0/7
media-libs/libpng:0=
media-libs/lcms:2=
sys-libs/zlib
virtual/jpeg:0=
systemtap? ( dev-util/systemtap )
"
# Many libs are required to build, but not to run, make is possible to remove
# by listing conditionally in RDEPEND unconditionally in DEPEND
RDEPEND="
${COMMON_DEPEND}
>=sys-apps/baselayout-java-0.1.0-r1
!headless-awt? (
x11-libs/libX11
x11-libs/libXext
x11-libs/libXi
x11-libs/libXrandr
x11-libs/libXrender
x11-libs/libXt
x11-libs/libXtst
)
alsa? ( media-libs/alsa-lib )
cups? ( net-print/cups )
selinux? ( sec-policy/selinux-java )
"
DEPEND="
${COMMON_DEPEND}
app-arch/zip
media-libs/alsa-lib
net-print/cups
x11-base/xorg-proto
x11-libs/libX11
x11-libs/libXext
x11-libs/libXi
x11-libs/libXrandr
x11-libs/libXrender
x11-libs/libXt
x11-libs/libXtst
javafx? ( dev-java/openjfx:${SLOT}= )
|| (
dev-java/openjdk-bin:$((SLOT-1))
dev-java/openjdk:$((SLOT-1))
dev-java/openjdk-bin:${SLOT}
dev-java/openjdk:${SLOT}
)
"
REQUIRED_USE="javafx? ( alsa !headless-awt )"
# 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
if [[ ${MERGE_TYPE} != binary ]]; then
has ccache ${FEATURES} && die "FEATURES=ccache doesn't work with ${PN}"
fi
}
pkg_setup() {
openjdk_check_requirements
java-vm-2_pkg_setup
JAVA_PKG_WANT_BUILD_VM="openjdk-${SLOT} openjdk-$((SLOT-1)) openjdk-bin-${SLOT} openjdk-bin-$((SLOT-1))"
JAVA_PKG_WANT_SOURCE="$((SLOT-1))"
JAVA_PKG_WANT_TARGET="$((SLOT-1))"
# 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
if [[ ${MERGE_TYPE} != "binary" ]]; then
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
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
# Work around -fno-common ( GCC10 default ), bug #713180
append-flags -fcommon
# 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.
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-giflib=system
--with-lcms=system
--with-libjpeg=system
--with-libpng=system
--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="${PVR}"
--with-version-pre=""
--with-version-string="${PV%_p*}"
--with-version-build="${PV#*_p}"
--with-zlib=system
--enable-dtrace=$(usex systemtap yes no)
--enable-headless-only=$(usex headless-awt yes no)
)
if use javafx; then
local zip="${EROOT%/}/usr/$(get_libdir)/openjfx-${SLOT}/javafx-exports.zip"
if [[ -r ${zip} ]]; then
myconf+=( --with-import-modules="${zip}" )
else
die "${zip} not found or not readable"
fi
fi
# 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 JAVA_TOOL_OPTIONS JAVAC XARGS
CFLAGS= CXXFLAGS= LDFLAGS= \
CONFIG_SITE=/dev/null \
econf "${myconf[@]}"
)
}
src_compile() {
local myemakeargs=(
JOBS=$(makeopts_jobs)
LOG=debug
CFLAGS_WARNINGS_ARE_ERRORS= # No -Werror
$(usex doc docs '')
$(usex jbootstrap bootcycle-images product-images)
)
emake "${myemakeargs[@]}" -j1 #nowarn
}
src_install() {
local dest="/usr/$(get_libdir)/${PN}-${SLOT}"
local ddest="${ED}${dest#/}"
cd "${S}"/build/*-release/images/jdk || die
# Create files used as storage for system preferences.
mkdir .systemPrefs || die
touch .systemPrefs/.system.lock || die
touch .systemPrefs/.systemRootModFile || 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
rm -v lib/security/cacerts || die
dodir "${dest}"
cp -pPR * "${ddest}" || die
dosym ../../../../../etc/ssl/certs/java/cacerts "${dest}"/lib/security/cacerts
# must be done before running itself
java-vm_set-pax-markings "${ddest}"
einfo "Creating the Class Data Sharing archives and disabling usage tracking"
"${ddest}/bin/java" -server -Xshare:dump -Djdk.disableLastUsageTracking || die
use gentoo-vm && java-vm_install-env "${FILESDIR}"/${PN}-${SLOT}.env.sh
java-vm_revdep-mask
java-vm_sandbox-predict /dev/random /proc/self/coredump_filter
if use doc ; then
docinto html
dodoc -r "${S}"/build/*-release/images/docs/*
dosym ../../../usr/share/doc/"${PF}" /usr/share/doc/"${PN}-${SLOT}"
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"
ewarn "many java ebuilds as they are not ready for openjdk-11"
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
}

View File

@ -0,0 +1,281 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit versionator autotools check-reqs flag-o-matic java-pkg-2 java-vm-2 multiprocessing pax-utils toolchain-funcs
# we need -ga tag to fetch tarball and unpack it, but exact number everywhere else to
# set build version properly
MY_PV="${PV/_p/+}"
FULL_VERSION="${PV%_p*}"
SLOT=$(get_major_version)
# First release of major jdk releases do not contain u at end jdk<slot>.
# so 15.0.0 would fetch jdk-15-ga.tar.gz from jdk15, 15.0.1 jdk-15.0.1-ga.tar.gz from jdk15u
if [ $(get_after_major_version $FULL_VERSION) = "0.0" ]; then
SRC_URI="https://github.com/openjdk/jdk${SLOT}/archive/jdk-${SLOT}-ga.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/jdk${SLOT}-jdk-${SLOT}-ga"
else
SRC_URI="https://github.com/openjdk/jdk${SLOT}u/archive/jdk-${FULL_VERSION}-ga.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/jdk${SLOT}u-jdk-${FULL_VERSION}-ga"
fi
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/archi${SLOT}/jdk-${MY_PV}.tar.bz2 -> ${P}.tar.bz2"
LICENSE="GPL-2"
KEYWORDS="amd64 ~arm arm64 ~ppc64"
IUSE="alsa cups debug doc examples gentoo-vm headless-awt javafx +jbootstrap +pch selinux source systemtap"
COMMON_DEPEND="
media-libs/freetype:2=
media-libs/giflib:0/7
media-libs/libpng:0=
media-libs/lcms:2=
sys-libs/zlib
virtual/jpeg:0=
systemtap? ( dev-util/systemtap )
"
# Many libs are required to build, but not to run, make is possible to remove
# by listing conditionally in RDEPEND unconditionally in DEPEND
RDEPEND="
${COMMON_DEPEND}
>=sys-apps/baselayout-java-0.1.0-r1
!headless-awt? (
x11-libs/libX11
x11-libs/libXext
x11-libs/libXi
x11-libs/libXrandr
x11-libs/libXrender
x11-libs/libXt
x11-libs/libXtst
)
alsa? ( media-libs/alsa-lib )
cups? ( net-print/cups )
selinux? ( sec-policy/selinux-java )
"
DEPEND="
${COMMON_DEPEND}
app-arch/zip
media-libs/alsa-lib
net-print/cups
x11-base/xorg-proto
x11-libs/libX11
x11-libs/libXext
x11-libs/libXi
x11-libs/libXrandr
x11-libs/libXrender
x11-libs/libXt
x11-libs/libXtst
javafx? ( dev-java/openjfx:${SLOT}= )
|| (
dev-java/openjdk-bin:$((SLOT-1))
dev-java/openjdk:$((SLOT-1))
dev-java/openjdk-bin:${SLOT}
dev-java/openjdk:${SLOT}
)
"
REQUIRED_USE="javafx? ( alsa !headless-awt )"
# 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
if [[ ${MERGE_TYPE} != binary ]]; then
has ccache ${FEATURES} && die "FEATURES=ccache doesn't work with ${PN}"
fi
}
pkg_setup() {
openjdk_check_requirements
java-vm-2_pkg_setup
JAVA_PKG_WANT_BUILD_VM="openjdk-${SLOT} openjdk-$((SLOT-1)) openjdk-bin-${SLOT} openjdk-bin-$((SLOT-1))"
JAVA_PKG_WANT_SOURCE="$((SLOT-1))"
JAVA_PKG_WANT_TARGET="$((SLOT-1))"
# 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
if [[ ${MERGE_TYPE} != "binary" ]]; then
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
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
# Work around -fno-common ( GCC10 default ), bug #713180
append-flags -fcommon
# 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.
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-giflib=system
--with-lcms=system
--with-libjpeg=system
--with-libpng=system
--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="${PVR}"
--with-version-pre=""
--with-version-string="${PV%_p*}"
--with-version-build="${PV#*_p}"
--with-zlib=system
--enable-dtrace=$(usex systemtap yes no)
--enable-headless-only=$(usex headless-awt yes no)
)
if use javafx; then
local zip="${EROOT%/}/usr/$(get_libdir)/openjfx-${SLOT}/javafx-exports.zip"
if [[ -r ${zip} ]]; then
myconf+=( --with-import-modules="${zip}" )
else
die "${zip} not found or not readable"
fi
fi
# 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 JAVA_TOOL_OPTIONS JAVAC XARGS
CFLAGS= CXXFLAGS= LDFLAGS= \
CONFIG_SITE=/dev/null \
econf "${myconf[@]}"
)
}
src_compile() {
local myemakeargs=(
JOBS=$(makeopts_jobs)
LOG=debug
CFLAGS_WARNINGS_ARE_ERRORS= # No -Werror
$(usex doc docs '')
$(usex jbootstrap bootcycle-images product-images)
)
emake "${myemakeargs[@]}" -j1 #nowarn
}
src_install() {
local dest="/usr/$(get_libdir)/${PN}-${SLOT}"
local ddest="${ED}${dest#/}"
cd "${S}"/build/*-release/images/jdk || die
# Create files used as storage for system preferences.
mkdir .systemPrefs || die
touch .systemPrefs/.system.lock || die
touch .systemPrefs/.systemRootModFile || 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
rm -v lib/security/cacerts || die
dodir "${dest}"
cp -pPR * "${ddest}" || die
dosym ../../../../../etc/ssl/certs/java/cacerts "${dest}"/lib/security/cacerts
# must be done before running itself
java-vm_set-pax-markings "${ddest}"
einfo "Creating the Class Data Sharing archives and disabling usage tracking"
"${ddest}/bin/java" -server -Xshare:dump -Djdk.disableLastUsageTracking || die
use gentoo-vm && java-vm_install-env "${FILESDIR}"/${PN}-${SLOT}.env.sh
java-vm_revdep-mask
java-vm_sandbox-predict /dev/random /proc/self/coredump_filter
if use doc ; then
docinto html
dodoc -r "${S}"/build/*-release/images/docs/*
dosym ../../../usr/share/doc/"${PF}" /usr/share/doc/"${PN}-${SLOT}"
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"
ewarn "many java ebuilds as they are not ready for openjdk-11"
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
}