1 # Copyright 1999-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
10 DESCRIPTION
="Oracle's Java SE Development Kit"
11 HOMEPAGE
="http://www.oracle.com/technetwork/java/javase/"
12 SRC_URI
="jdk-${MY_PV}-linux-x64.tar.gz"
13 S
="${WORKDIR}/jdk1.8.0_${PV/8./}"
17 IUSE
="+alsa cups headless-awt selinux +source +javafx fontconfig"
18 REQUIRED_USE
="javafx? ( alsa )"
21 >=sys-apps/baselayout-java-0.1.0-r1
22 fontconfig? ( media-libs/fontconfig:1.0 )
23 elibc_glibc? ( >=sys-libs/glibc-2.2.5:* )
24 elibc_musl? ( sys-libs/musl )
25 alsa? ( media-libs/alsa-lib )
26 cups? ( net-print/cups )
27 selinux? ( sec-policy/selinux-java )
52 ewarn
"\e[1;33m############################################################################## \e[0m"
53 ewarn
"\e[1;33m# If you're seeing this warning on your screen,please pay attention: # \e[0m"
54 ewarn
"\e[1;33m# Portage can not download JDK tar file directly from Oracle's website # \e[0m"
55 ewarn
"\e[1;33m# Please download it manually to your distfiles directory # \e[0m"
56 ewarn
"\e[1;33m# Distfile directory is '/var/cache/distfile' by default # \e[0m"
57 ewarn
"\e[1;33m# Please download 'x64 Compressed Archive' file from following url: # \e[0m"
58 ewarn
"\e[1;33m# https://www.oracle.com/java/technologies/downloads/#java8-linux # \e[0m"
59 ewarn
"\e[1;33m# If the above mentioned URL does not point to the correct version anymore, # \e[0m"
60 ewarn
"\e[1;33m# please download the file from Oracle's Java download archive # \e[0m"
61 ewarn
"\e[1;33m# Do Not Continue untill you put it to your distfiles directory # \e[0m"
62 ewarn
"\e[1;33m############################################################################## \e[0m"
63 ewarn
"\e[1;33m# Portage没法直接从甲骨文官网下载jdk压缩包文件\e[0m"
64 ewarn
"\e[1;33m# 请先别急着继续,仔细读上述提示!!\e[0m"
67 RESTRICT
="preserve-libs splitdebug fetch"
71 local dest
="/opt/${P}"
72 local ddest
="${ED}/${dest#/}"
74 # There is a libav*.so* related problem not yet get fixed
75 # Maybe downgrading ffmpeg version can resolve this,or maybe should wait for Oracle to make
76 # jdk use high versioned .so stuff.
77 rm COPYRIGHT LICENSE README.html THIRDPARTYLICENSEREADME-JAVAFX.txt THIRDPARTYLICENSEREADME.txt || die
80 rm -v jre
/lib
/*/libjsoundalsa.so
* || die
83 if use headless-awt
; then
84 rm -fvr {,jre
/}lib
/*/lib
*{[jx
]awt
,splashscreen
}* \
85 {,jre
/}bin
/policytool bin
/appletviewer || die
88 if ! use
source ; then
89 rm -v src.
zip javafx-src.
zip || die
90 elif ! use javafx
; then
91 rm -v javafx-src.
zip jre
/lib
/*/lib
*{decora
,fx
,glass
,prism
}* \
92 jre
/lib
/*/libgstreamer-lite.
* {,jre
/}lib
/{,ext
/}*fx
* \
93 bin
/*javafx
* bin
/javapackager || die
96 if use fontconfig
; then
97 rm -v jre
/lib
/fontconfig.
* || die
100 rm -v jre
/lib
/security
/cacerts || die
101 dosym ..
/..
/..
/..
/..
/etc
/ssl
/certs
/java
/cacerts \
102 "${dest}"/jre
/lib
/security
/cacerts
105 cp -pPR * "${ddest}" || die
107 # provide stable symlink
108 dosym
"${P}" "/opt/${PN}-${SLOT}"
110 java-vm_install-env
"${FILESDIR}"/"${PN}"-"${SLOT}".env.sh
111 java-vm_set-pax-markings
"${ddest}"
113 java-vm_sandbox-predict
/dev
/random
/proc
/self
/coredump_filter
117 java-vm-2_pkg_postinst
118 if ! use headless-awt
&& ! use javafx
; then
119 ewarn
"\e[1;33mYou have disabled the javafx flag. Some modern desktop Java applications\e[0m"
120 ewarn
"\e[1;33mrequire this and they may fail with a confusing error message.\e[0m"