1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
10 https://github.com/AdoptOpenJDK/openjdk${SLOT}-binaries/releases/download/jdk-${MY_PV}/OpenJDK${SLOT}U-jre_${1}_linux_hotspot_${MY_PV//+/_}.tar.gz
21 DESCRIPTION="Prebuilt Java JRE binaries provided by AdoptOpenJDK"
22 HOMEPAGE="https://adoptopenjdk.net"
23 LICENSE="GPL-2-with-classpath-exception"
25 IUSE="alsa cups +gentoo-vm headless-awt nsplugin selinux webstart"
28 media-libs/fontconfig:1.0
31 >=sys-apps/baselayout-java-0.1.0-r1
32 >=sys-libs/glibc-2.2.5:*
34 alsa? ( media-libs/alsa-lib )
35 cups? ( net-print/cups )
36 selinux? ( sec-policy/selinux-java )
45 PDEPEND="webstart? ( >=dev-java/icedtea-web-1.6.1:0 )
46 nsplugin? ( >=dev-java/icedtea-web-1.6.1:0[nsplugin] )"
48 RESTRICT="preserve-libs splitdebug"
51 S="${WORKDIR}/jdk-${MY_PV}-jre"
54 local dest="/opt/${P}"
55 local ddest="${ED%/}/${dest#/}"
57 # Not sure why they bundle this as it's commonly available and they
58 # only do so on x86_64. It's needed by libfontmanager.so. IcedTea
59 # also has an explicit dependency while Oracle seemingly dlopens it.
60 rm -vf lib/libfreetype.so || die
62 # Oracle and IcedTea have libjsoundalsa.so depending on
63 # libasound.so.2 but AdoptOpenJDK only has libjsound.so. Weird.
65 rm -v lib/libjsound.* || die
68 if use headless-awt ; then
69 rm -v lib/lib*{[jx]awt,splashscreen}* || die
72 rm -v lib/security/cacerts || die
73 dosym ../../../../etc/ssl/certs/java/cacerts "${dest}"/lib/security/cacerts
76 cp -pPR * "${ddest}" || die
78 use gentoo-vm && java-vm_install-env "${FILESDIR}"/${PN}-${SLOT}.env.sh
79 java-vm_set-pax-markings "${ddest}"
81 java-vm_sandbox-predict /dev/random /proc/self/coredump_filter
85 java-vm-2_pkg_postinst
87 if use gentoo-vm ; then
88 ewarn "WARNING! You have enabled the gentoo-vm USE flag, making this JRE"
89 ewarn "recognised by the system. This will almost certainly break things."
91 ewarn "The experimental gentoo-vm USE flag has not been enabled so this JRE"
92 ewarn "will not be recognised by the system. For example, simply calling"
93 ewarn "\"java\" will launch a different JVM. This is necessary until Gentoo"
94 ewarn "fully supports Java 11. This JRE must therefore be invoked using its"
95 ewarn "absolute location under ${EPREFIX}/opt/${P}."