1 # Copyright 2023-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
8 DESCRIPTION
="Oracle's Java SE Development Kit"
9 HOMEPAGE
="https://www.oracle.com/java"
10 SRC_URI
="https://download.oracle.com/java/21/archive/jdk-${PV}_linux-x64_bin.tar.gz"
11 S
="${WORKDIR}/jdk-${PV}"
15 IUSE
="alsa +commercial cups headless-awt +source"
16 RESTRICT
="bindist mirror preserve-libs strip"
20 alsa? ( media-libs/alsa-lib )
21 media-libs/fontconfig:1.0
31 cups? ( net-print/cups )
34 local dest
="/opt/${P}"
35 local ddest
="${ED}/${dest#/}"
36 rm LICENSE README release || die
37 # Create files used as storage for system preferences.
38 mkdir .systemPrefs || die
39 touch .systemPrefs
/.system.lock || die
40 touch .systemPrefs
/.systemRootModFile || die
41 # Seems like that we do not need alsa anymore
43 rm -v lib
/libjsound.so || die
46 if ! use commercial
; then
47 rm -vfr bin
/jfr jmods
/*.jfr.
* lib
/jfr
* legal
/*.jfr || die
50 if use headless-awt
; then
51 rm -vf lib
/lib
*{[jx
]awt
,splashscreen
}* || die
54 if ! use
source ; then
55 rm -v lib
/src.
zip || die
58 rm -v lib
/security
/cacerts || die
59 dosym
-r /etc
/ssl
/certs
/java
/cacerts
"${dest}"/lib
/security
/cacerts
62 cp -pPR * "${ddest}" || die
64 java-vm_install-env
"${FILESDIR}"/"${PN}"-"${SLOT}".env.sh
65 java-vm_set-pax-markings
"${ddest}"
67 java-vm_sandbox-predict
/dev
/random
/proc
/self
/coredump_filter