app-editors/zed: add 0.144.3, drop 0.143.7
[gentoo-zh.git] / dev-java / oraclejdk-bin / oraclejdk-bin-8.391.ebuild
blob063c7d470a52a4806e4e966cdef84873bd0849d5
1 # Copyright 1999-2023 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 inherit java-vm-2
8 MY_PV=${PV/./u}
9 SLOT=$(ver_cut 1)
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/"
15 LICENSE="OTN"
16 KEYWORDS="~amd64"
17 IUSE="alsa cups headless-awt selinux +source +javafx fontconfig"
18 REQUIRED_USE="javafx? ( alsa )"
19 QA_PREBUILT="*"
21 RDEPEND="
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 )
29         !headless-awt? (
30                 x11-libs/libX11
31                 x11-libs/libXext
32                 x11-libs/libXi
33                 x11-libs/libXrender
34                 x11-libs/libXtst
35         )
36         javafx? (
37                 media-libs/freetype:2
38                 dev-libs/glib:2
39                 dev-libs/libxml2:2
40                 dev-libs/libxslt
41                 media-libs/freetype:2
42                 x11-libs/cairo
43                 x11-libs/gtk+:2
44                 x11-libs/gtk+:3
45                 x11-libs/libX11
46                 x11-libs/libXtst
47                 x11-libs/libXxf86vm
48                 x11-libs/pango
49                 virtual/opengl
50                 )"
52 pkg_nofetch() {
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"
69 QA_PREBUILT="*"
71 S="${WORKDIR}/jdk1.8.0_${PV/8./}"
73 src_install() {
74         local dest="/opt/${P}"
75         local ddest="${ED}/${dest#/}"
76         # Notion:
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
82         if ! use alsa ; then
83                 rm -v jre/lib/*/libjsoundalsa.so* || die
84         fi
86         if use headless-awt ; then
87                 rm -fvr {,jre/}lib/*/lib*{[jx]awt,splashscreen}* \
88                         {,jre/}bin/policytool bin/appletviewer || die
89         fi
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
97         fi
99         if use fontconfig ; then
100                 rm -v jre/lib/fontconfig.* || die
101         fi
103         rm -v jre/lib/security/cacerts || die
104         dosym ../../../../../etc/ssl/certs/java/cacerts \
105                 "${dest}"/jre/lib/security/cacerts
107         dodir "${dest}"
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}"
115         java-vm_revdep-mask
116         java-vm_sandbox-predict /dev/random /proc/self/coredump_filter
119 pkg_postinst() {
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"
124         fi