Gentoo Archives: gentoo-commits

From: "Miroslav Šulc" <fordfrog@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-java/openjdk-jre-bin/
Date: Sat, 27 Nov 2021 21:07:26
Message-Id: 1638047239.2e6b5def47c494462e395faade2bc7fd159541cf.fordfrog@gentoo
1 commit: 2e6b5def47c494462e395faade2bc7fd159541cf
2 Author: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
3 AuthorDate: Sat Nov 27 21:06:33 2021 +0000
4 Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
5 CommitDate: Sat Nov 27 21:07:19 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2e6b5def
7
8 dev-java/openjdk-jre-bin: bump to eapi8
9
10 Package-Manager: Portage-3.0.28, Repoman-3.0.3
11 Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>
12
13 .../openjdk-jre-bin-11.0.13_p8-r1.ebuild | 97 ++++++++++++++++++++++
14 .../openjdk-jre-bin-8.312_p07-r1.ebuild | 83 ++++++++++++++++++
15 2 files changed, 180 insertions(+)
16
17 diff --git a/dev-java/openjdk-jre-bin/openjdk-jre-bin-11.0.13_p8-r1.ebuild b/dev-java/openjdk-jre-bin/openjdk-jre-bin-11.0.13_p8-r1.ebuild
18 new file mode 100644
19 index 000000000000..57f5b0dac68d
20 --- /dev/null
21 +++ b/dev-java/openjdk-jre-bin/openjdk-jre-bin-11.0.13_p8-r1.ebuild
22 @@ -0,0 +1,97 @@
23 +# Copyright 1999-2021 Gentoo Authors
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +EAPI=8
27 +
28 +inherit java-vm-2
29 +
30 +abi_uri() {
31 + echo "${2-$1}? (
32 + https://github.com/adoptium/temurin${SLOT}-binaries/releases/download/jdk-${MY_PV}/OpenJDK${SLOT}U-jre_${1}_linux_hotspot_${MY_PV//+/_}.tar.gz
33 + )"
34 +}
35 +
36 +MY_PV=${PV/_p/+}
37 +SLOT=${MY_PV%%[.+]*}
38 +
39 +SRC_URI="
40 + $(abi_uri x64 amd64)
41 +"
42 +
43 +DESCRIPTION="Prebuilt Java JRE binaries provided by AdoptOpenJDK"
44 +HOMEPAGE="https://adoptopenjdk.net"
45 +LICENSE="GPL-2-with-classpath-exception"
46 +KEYWORDS="~amd64"
47 +IUSE="alsa cups +gentoo-vm headless-awt selinux"
48 +
49 +RDEPEND="
50 + media-libs/fontconfig:1.0
51 + media-libs/freetype:2
52 + >net-libs/libnet-1.1
53 + >=sys-apps/baselayout-java-0.1.0-r1
54 + >=sys-libs/glibc-2.2.5:*
55 + sys-libs/zlib
56 + alsa? ( media-libs/alsa-lib )
57 + cups? ( net-print/cups )
58 + selinux? ( sec-policy/selinux-java )
59 + !headless-awt? (
60 + x11-libs/libX11
61 + x11-libs/libXext
62 + x11-libs/libXi
63 + x11-libs/libXrender
64 + x11-libs/libXtst
65 + )"
66 +
67 +RESTRICT="preserve-libs splitdebug"
68 +QA_PREBUILT="*"
69 +
70 +S="${WORKDIR}/jdk-${MY_PV}-jre"
71 +
72 +src_install() {
73 + local dest="/opt/${P}"
74 + local ddest="${ED%/}/${dest#/}"
75 +
76 + # Not sure why they bundle this as it's commonly available and they
77 + # only do so on x86_64. It's needed by libfontmanager.so. IcedTea
78 + # also has an explicit dependency while Oracle seemingly dlopens it.
79 + rm -vf lib/libfreetype.so || die
80 +
81 + # Oracle and IcedTea have libjsoundalsa.so depending on
82 + # libasound.so.2 but AdoptOpenJDK only has libjsound.so. Weird.
83 + if ! use alsa ; then
84 + rm -v lib/libjsound.* || die
85 + fi
86 +
87 + if use headless-awt ; then
88 + rm -v lib/lib*{[jx]awt,splashscreen}* || die
89 + fi
90 +
91 + rm -v lib/security/cacerts || die
92 + dosym ../../../../etc/ssl/certs/java/cacerts "${dest}"/lib/security/cacerts
93 +
94 + dodir "${dest}"
95 + cp -pPR * "${ddest}" || die
96 +
97 + # provide stable symlink
98 + dosym "${P}" "/opt/${PN}-${SLOT}"
99 +
100 + use gentoo-vm && java-vm_install-env "${FILESDIR}"/${PN}-${SLOT}.env.sh
101 + java-vm_set-pax-markings "${ddest}"
102 + java-vm_revdep-mask
103 + java-vm_sandbox-predict /dev/random /proc/self/coredump_filter
104 +}
105 +
106 +pkg_postinst() {
107 + java-vm-2_pkg_postinst
108 +
109 + if use gentoo-vm ; then
110 + ewarn "WARNING! You have enabled the gentoo-vm USE flag, making this JRE"
111 + ewarn "recognised by the system. This will almost certainly break things."
112 + else
113 + ewarn "The experimental gentoo-vm USE flag has not been enabled so this JRE"
114 + ewarn "will not be recognised by the system. For example, simply calling"
115 + ewarn "\"java\" will launch a different JVM. This is necessary until Gentoo"
116 + ewarn "fully supports Java 11. This JRE must therefore be invoked using its"
117 + ewarn "absolute location under ${EPREFIX}/opt/${P}."
118 + fi
119 +}
120
121 diff --git a/dev-java/openjdk-jre-bin/openjdk-jre-bin-8.312_p07-r1.ebuild b/dev-java/openjdk-jre-bin/openjdk-jre-bin-8.312_p07-r1.ebuild
122 new file mode 100644
123 index 000000000000..2d5ee85aa434
124 --- /dev/null
125 +++ b/dev-java/openjdk-jre-bin/openjdk-jre-bin-8.312_p07-r1.ebuild
126 @@ -0,0 +1,83 @@
127 +# Copyright 1999-2021 Gentoo Authors
128 +# Distributed under the terms of the GNU General Public License v2
129 +
130 +EAPI=8
131 +
132 +inherit java-vm-2
133 +
134 +abi_uri() {
135 + echo "${2-$1}? (
136 + https://github.com/adoptium/temurin${SLOT}-binaries/releases/download/jdk${MY_PV}/OpenJDK8U-jre_${1}_linux_hotspot_${MY_PV/-/}.tar.gz
137 + )"
138 +}
139 +
140 +MY_PV=$(ver_rs 1 'u' 2 '-' ${PV//p/b})
141 +SLOT="$(ver_cut 1)"
142 +
143 +DESCRIPTION="Prebuilt Java JRE binaries provided by Eclipse Temurin"
144 +HOMEPAGE="https://adoptium.net"
145 +SRC_URI="
146 + $(abi_uri x64 amd64)
147 +"
148 +
149 +LICENSE="GPL-2-with-classpath-exception"
150 +KEYWORDS="~amd64"
151 +
152 +IUSE="alsa cups headless-awt selinux"
153 +
154 +RDEPEND="
155 + media-libs/fontconfig:1.0
156 + media-libs/freetype:2
157 + >net-libs/libnet-1.1
158 + >=sys-apps/baselayout-java-0.1.0-r1
159 + >=sys-libs/glibc-2.2.5:*
160 + sys-libs/zlib
161 + alsa? ( media-libs/alsa-lib )
162 + cups? ( net-print/cups )
163 + selinux? ( sec-policy/selinux-java )
164 + !headless-awt? (
165 + x11-libs/libX11
166 + x11-libs/libXext
167 + x11-libs/libXi
168 + x11-libs/libXrender
169 + x11-libs/libXtst
170 + )"
171 +
172 +RESTRICT="preserve-libs splitdebug"
173 +QA_PREBUILT="*"
174 +
175 +S="${WORKDIR}/jdk${MY_PV}-jre"
176 +
177 +src_install() {
178 + local dest="/opt/${P}"
179 + local ddest="${ED%/}/${dest#/}"
180 +
181 + rm ASSEMBLY_EXCEPTION LICENSE THIRD_PARTY_README || die
182 +
183 + # this does not exist on arm64 hence -f
184 + rm -fv lib/*/libfreetype.so* || die
185 +
186 + if ! use alsa ; then
187 + rm -v lib/*/libjsoundalsa.so* || die
188 + fi
189 +
190 + if use headless-awt ; then
191 + rm -fvr lib/*/lib*{[jx]awt,splashscreen}* \
192 + bin/policytool || die
193 + fi
194 +
195 + rm -v lib/security/cacerts || die
196 + dosym ../../../../../etc/ssl/certs/java/cacerts \
197 + "${dest}"/lib/security/cacerts
198 +
199 + dodir "${dest}"
200 + cp -pPR * "${ddest}" || die
201 +
202 + # provide stable symlink
203 + dosym "${P}" "/opt/${PN}-${SLOT}"
204 +
205 + java-vm_install-env "${FILESDIR}"/${PN}-${SLOT}.env.sh
206 + java-vm_set-pax-markings "${ddest}"
207 + java-vm_revdep-mask
208 + java-vm_sandbox-predict /dev/random /proc/self/coredump_filter
209 +}