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