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-bin/
Date: Sat, 27 Nov 2021 21:07:27
Message-Id: 1638047239.903778d910b218e3f1fafdce0c06514a1cc213fb.fordfrog@gentoo
1 commit: 903778d910b218e3f1fafdce0c06514a1cc213fb
2 Author: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
3 AuthorDate: Sat Nov 27 21:04:12 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=903778d9
7
8 dev-java/openjdk-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-bin/openjdk-bin-11.0.13_p8-r1.ebuild | 136 +++++++++++++++++++
14 .../openjdk-bin/openjdk-bin-17.0.1_p12-r1.ebuild | 147 +++++++++++++++++++++
15 .../openjdk-bin/openjdk-bin-8.312_p07-r1.ebuild | 123 +++++++++++++++++
16 3 files changed, 406 insertions(+)
17
18 diff --git a/dev-java/openjdk-bin/openjdk-bin-11.0.13_p8-r1.ebuild b/dev-java/openjdk-bin/openjdk-bin-11.0.13_p8-r1.ebuild
19 new file mode 100644
20 index 000000000000..95bcdeba00a6
21 --- /dev/null
22 +++ b/dev-java/openjdk-bin/openjdk-bin-11.0.13_p8-r1.ebuild
23 @@ -0,0 +1,136 @@
24 +# Copyright 1999-2021 Gentoo Authors
25 +# Distributed under the terms of the GNU General Public License v2
26 +
27 +EAPI=8
28 +
29 +inherit java-vm-2 toolchain-funcs
30 +
31 +abi_uri() {
32 + local os=linux
33 + case ${2} in
34 + *-macos) os=mac ;;
35 + *-solaris) os=solaris ;;
36 + esac
37 + echo "${2-$1}? (
38 + https://github.com/adoptium/temurin${SLOT}-binaries/releases/download/jdk-${MY_PV}/OpenJDK${SLOT}U-jdk_${1}_${os}_hotspot_${MY_PV//+/_}.tar.gz
39 + )"
40 +}
41 +
42 +MY_PV=${PV/_p/+}
43 +SLOT=${MY_PV%%[.+]*}
44 +
45 +SRC_URI="
46 + $(abi_uri arm)
47 + $(abi_uri aarch64 arm64)
48 + $(abi_uri ppc64le ppc64)
49 + $(abi_uri x64 amd64)
50 + $(abi_uri x64 x64-macos)
51 +"
52 +
53 +DESCRIPTION="Prebuilt Java JDK binaries provided by Eclipse Temurin"
54 +HOMEPAGE="https://adoptium.net"
55 +LICENSE="GPL-2-with-classpath-exception"
56 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x64-macos"
57 +IUSE="alsa cups +gentoo-vm headless-awt selinux source"
58 +
59 +RDEPEND="
60 + >=sys-apps/baselayout-java-0.1.0-r1
61 + kernel_linux? (
62 + media-libs/fontconfig:1.0
63 + media-libs/freetype:2
64 + media-libs/harfbuzz
65 + >=sys-libs/glibc-2.2.5:*
66 + sys-libs/zlib
67 + alsa? ( media-libs/alsa-lib )
68 + cups? ( net-print/cups )
69 + selinux? ( sec-policy/selinux-java )
70 + !headless-awt? (
71 + x11-libs/libX11
72 + x11-libs/libXext
73 + x11-libs/libXi
74 + x11-libs/libXrender
75 + x11-libs/libXtst
76 + )
77 + )"
78 +
79 +RESTRICT="preserve-libs splitdebug"
80 +QA_PREBUILT="*"
81 +
82 +S="${WORKDIR}/jdk-${MY_PV}"
83 +
84 +pkg_pretend() {
85 + if [[ "$(tc-is-softfloat)" != "no" ]]; then
86 + die "These binaries require a hardfloat system."
87 + fi
88 +}
89 +
90 +src_unpack() {
91 + default
92 + if [[ ${A} == *_mac_* ]] ; then
93 + mv -v "${S}/Contents/Home/"* "${S}" || die
94 + rm -Rf "${S}/Contents" # drop macOS executable
95 + fi
96 +}
97 +
98 +src_install() {
99 + local dest="/opt/${P}"
100 + local ddest="${ED%/}/${dest#/}"
101 +
102 + # on macOS if they would exist they would be called .dylib, but most
103 + # importantly, there are no different providers, so everything
104 + # that's shipped works.
105 + if [[ ${A} != *_mac_* ]] ; then
106 + # Not sure why they bundle this as it's commonly available and they
107 + # only do so on x86_64. It's needed by libfontmanager.so. IcedTea
108 + # also has an explicit dependency while Oracle seemingly dlopens it.
109 + rm -vf lib/libfreetype.so || die
110 +
111 + # prefer system copy # https://bugs.gentoo.org/776676
112 + rm -vf lib/libharfbuzz.so || die
113 +
114 + # Oracle and IcedTea have libjsoundalsa.so depending on
115 + # libasound.so.2 but AdoptOpenJDK only has libjsound.so. Weird.
116 + if ! use alsa ; then
117 + rm -v lib/libjsound.* || die
118 + fi
119 +
120 + if use headless-awt ; then
121 + rm -v lib/lib*{[jx]awt,splashscreen}* || die
122 + fi
123 + fi
124 +
125 + if ! use source ; then
126 + rm -v lib/src.zip || die
127 + fi
128 +
129 + rm -v lib/security/cacerts || die
130 + dosym ../../../../etc/ssl/certs/java/cacerts \
131 + "${dest}"/lib/security/cacerts
132 +
133 + dodir "${dest}"
134 + cp -pPR * "${ddest}" || die
135 +
136 + # provide stable symlink
137 + dosym "${P}" "/opt/${PN}-${SLOT}"
138 +
139 + use gentoo-vm && java-vm_install-env "${FILESDIR}"/${PN}-${SLOT}.env.sh
140 + java-vm_set-pax-markings "${ddest}"
141 + java-vm_revdep-mask
142 + java-vm_sandbox-predict /dev/random /proc/self/coredump_filter
143 +}
144 +
145 +pkg_postinst() {
146 + java-vm-2_pkg_postinst
147 +
148 + if use gentoo-vm ; then
149 + ewarn "WARNING! You have enabled the gentoo-vm USE flag, making this JDK"
150 + ewarn "recognised by the system. This will almost certainly break"
151 + ewarn "many java ebuilds as they are not ready for openjdk-11"
152 + else
153 + ewarn "The experimental gentoo-vm USE flag has not been enabled so this JDK"
154 + ewarn "will not be recognised by the system. For example, simply calling"
155 + ewarn "\"java\" will launch a different JVM. This is necessary until Gentoo"
156 + ewarn "fully supports Java 11. This JDK must therefore be invoked using its"
157 + ewarn "absolute location under ${EPREFIX}/opt/${P}."
158 + fi
159 +}
160
161 diff --git a/dev-java/openjdk-bin/openjdk-bin-17.0.1_p12-r1.ebuild b/dev-java/openjdk-bin/openjdk-bin-17.0.1_p12-r1.ebuild
162 new file mode 100644
163 index 000000000000..e95578814cd8
164 --- /dev/null
165 +++ b/dev-java/openjdk-bin/openjdk-bin-17.0.1_p12-r1.ebuild
166 @@ -0,0 +1,147 @@
167 +# Copyright 1999-2021 Gentoo Authors
168 +# Distributed under the terms of the GNU General Public License v2
169 +
170 +EAPI=8
171 +
172 +inherit java-vm-2 toolchain-funcs
173 +
174 +abi_uri() {
175 + local baseuri="https://github.com/adoptium/temurin${SLOT}-binaries/releases/download/jdk-${MY_PV}/"
176 + local musl=
177 + local os=linux
178 +
179 + case ${2} in
180 + *-macos) os=mac ;;
181 + *-solaris) os=solaris ;;
182 + esac
183 +
184 + if [[ ${3} == musl ]]; then
185 + os=alpine-linux
186 + musl=true
187 + fi
188 +
189 + echo "${2-$1}? (
190 + ${musl:+ elibc_musl? ( }
191 + ${baseuri}/OpenJDK${SLOT}U-jdk_${1}_${os}_hotspot_${MY_PV//+/_}.tar.gz
192 + ${musl:+ ) } )"
193 +}
194 +
195 +MY_PV=${PV/_p/+}
196 +SLOT=${MY_PV%%[.+]*}
197 +
198 +SRC_URI="
199 + $(abi_uri arm)
200 + $(abi_uri aarch64 arm64)
201 + $(abi_uri ppc64le ppc64)
202 + $(abi_uri x64 amd64)
203 + $(abi_uri x64 amd64 musl)
204 + $(abi_uri x64 x64-macos)
205 +"
206 +
207 +DESCRIPTION="Prebuilt Java JDK binaries provided by Eclipse Temurin"
208 +HOMEPAGE="https://adoptium.net"
209 +LICENSE="GPL-2-with-classpath-exception"
210 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x64-macos"
211 +IUSE="alsa cups +gentoo-vm headless-awt selinux source"
212 +
213 +RDEPEND="
214 + >=sys-apps/baselayout-java-0.1.0-r1
215 + kernel_linux? (
216 + media-libs/fontconfig:1.0
217 + media-libs/freetype:2
218 + media-libs/harfbuzz
219 + elibc_glibc? ( >=sys-libs/glibc-2.2.5:* )
220 + sys-libs/zlib
221 + alsa? ( media-libs/alsa-lib )
222 + cups? ( net-print/cups )
223 + selinux? ( sec-policy/selinux-java )
224 + !headless-awt? (
225 + x11-libs/libX11
226 + x11-libs/libXext
227 + x11-libs/libXi
228 + x11-libs/libXrender
229 + x11-libs/libXtst
230 + )
231 + )"
232 +
233 +RESTRICT="preserve-libs splitdebug"
234 +QA_PREBUILT="*"
235 +
236 +S="${WORKDIR}/jdk-${MY_PV}"
237 +
238 +pkg_pretend() {
239 + if [[ "$(tc-is-softfloat)" != "no" ]]; then
240 + die "These binaries require a hardfloat system."
241 + fi
242 +}
243 +
244 +src_unpack() {
245 + default
246 + if [[ ${A} == *_mac_* ]] ; then
247 + mv -v "${S}/Contents/Home/"* "${S}" || die
248 + rm -Rf "${S}/Contents" # drop macOS executable
249 + fi
250 +}
251 +
252 +src_install() {
253 + local dest="/opt/${P}"
254 + local ddest="${ED%/}/${dest#/}"
255 +
256 + # on macOS if they would exist they would be called .dylib, but most
257 + # importantly, there are no different providers, so everything
258 + # that's shipped works.
259 + if [[ ${A} != *_mac_* ]] ; then
260 + # Not sure why they bundle this as it's commonly available and they
261 + # only do so on x86_64. It's needed by libfontmanager.so. IcedTea
262 + # also has an explicit dependency while Oracle seemingly dlopens it.
263 + rm -vf lib/libfreetype.so || die
264 +
265 + # prefer system copy # https://bugs.gentoo.org/776676
266 + rm -vf lib/libharfbuzz.so || die
267 +
268 + # Oracle and IcedTea have libjsoundalsa.so depending on
269 + # libasound.so.2 but AdoptOpenJDK only has libjsound.so. Weird.
270 + if ! use alsa ; then
271 + rm -v lib/libjsound.* || die
272 + fi
273 +
274 + if use headless-awt ; then
275 + rm -v lib/lib*{[jx]awt,splashscreen}* || die
276 + fi
277 + fi
278 +
279 + if ! use source ; then
280 + rm -v lib/src.zip || die
281 + fi
282 +
283 + rm -v lib/security/cacerts || die
284 + dosym ../../../../etc/ssl/certs/java/cacerts \
285 + "${dest}"/lib/security/cacerts
286 +
287 + dodir "${dest}"
288 + cp -pPR * "${ddest}" || die
289 +
290 + # provide stable symlink
291 + dosym "${P}" "/opt/${PN}-${SLOT}"
292 +
293 + use gentoo-vm && java-vm_install-env "${FILESDIR}"/${PN}-${SLOT}.env.sh
294 + java-vm_set-pax-markings "${ddest}"
295 + java-vm_revdep-mask
296 + java-vm_sandbox-predict /dev/random /proc/self/coredump_filter
297 +}
298 +
299 +pkg_postinst() {
300 + java-vm-2_pkg_postinst
301 +
302 + if use gentoo-vm ; then
303 + ewarn "WARNING! You have enabled the gentoo-vm USE flag, making this JDK"
304 + ewarn "recognised by the system. This will almost certainly break"
305 + ewarn "many java ebuilds as they are not ready for openjdk-${SLOT}"
306 + else
307 + ewarn "The experimental gentoo-vm USE flag has not been enabled so this JDK"
308 + ewarn "will not be recognised by the system. For example, simply calling"
309 + ewarn "\"java\" will launch a different JVM. This is necessary until Gentoo"
310 + ewarn "fully supports Java ${SLOT}. This JDK must therefore be invoked using its"
311 + ewarn "absolute location under ${EPREFIX}/opt/${P}."
312 + fi
313 +}
314
315 diff --git a/dev-java/openjdk-bin/openjdk-bin-8.312_p07-r1.ebuild b/dev-java/openjdk-bin/openjdk-bin-8.312_p07-r1.ebuild
316 new file mode 100644
317 index 000000000000..465e0a290547
318 --- /dev/null
319 +++ b/dev-java/openjdk-bin/openjdk-bin-8.312_p07-r1.ebuild
320 @@ -0,0 +1,123 @@
321 +# Copyright 1999-2021 Gentoo Authors
322 +# Distributed under the terms of the GNU General Public License v2
323 +
324 +EAPI=8
325 +
326 +inherit java-vm-2
327 +
328 +abi_uri() {
329 + local os=linux
330 + case ${2} in
331 + *-macos) os=mac ;;
332 + *-solaris) os=solaris ;;
333 + esac
334 + echo "${2-$1}? (
335 + https://github.com/adoptium/temurin${SLOT}-binaries/releases/download/jdk${MY_PV}/OpenJDK8U-jdk_${1}_${os}_hotspot_${3-${MY_PV/-/}}.tar.gz
336 + )"
337 +}
338 +
339 +# they have different tarball names for different arches...
340 +# https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u282-b08/OpenJDK8U-jdk_x64_linux_hotspot_8u282b08.tar.gz
341 +# https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u282-b08/OpenJDK8U-jdk_aarch64_linux_hotspot_jdk8u282-b08.tar.gz
342 +
343 +MY_PV=$(ver_rs 1 'u' 2 '-' ${PV//p/b})
344 +SLOT="$(ver_cut 1)"
345 +
346 +DESCRIPTION="Prebuilt Java JDK binaries provided by Eclipse Temurin"
347 +HOMEPAGE="https://adoptium.net"
348 +SRC_URI="
349 + $(abi_uri aarch64 arm64)
350 + $(abi_uri arm)
351 + $(abi_uri ppc64le ppc64)
352 + $(abi_uri x64 amd64)
353 + $(abi_uri x64 x64-macos)
354 +"
355 +
356 +LICENSE="GPL-2-with-classpath-exception"
357 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x64-macos"
358 +
359 +IUSE="alsa cups examples headless-awt selinux source"
360 +
361 +RDEPEND="
362 + >=sys-apps/baselayout-java-0.1.0-r1
363 + kernel_linux? (
364 + media-libs/fontconfig:1.0
365 + media-libs/freetype:2
366 + >=sys-libs/glibc-2.2.5:*
367 + sys-libs/zlib
368 + alsa? ( media-libs/alsa-lib )
369 + arm? ( dev-libs/libffi-compat:6 )
370 + cups? ( net-print/cups )
371 + selinux? ( sec-policy/selinux-java )
372 + !headless-awt? (
373 + x11-libs/libX11
374 + x11-libs/libXext
375 + x11-libs/libXi
376 + x11-libs/libXrender
377 + x11-libs/libXtst
378 + )
379 + )
380 +"
381 +
382 +RESTRICT="preserve-libs strip"
383 +QA_PREBUILT="*"
384 +
385 +S="${WORKDIR}/jdk${MY_PV}"
386 +
387 +src_unpack() {
388 + default
389 + # 753575
390 + if use arm; then
391 + mv -v "${S}"* "${S}" || die
392 + elif [[ ${A} == *_mac_* ]] ; then
393 + mv -v "${S}/Contents/Home/"* "${S}" || die
394 + rm -Rf "${S}/Contents" # drop macOS executable
395 + fi
396 +}
397 +
398 +src_install() {
399 + local dest="/opt/${P}"
400 + local ddest="${ED%/}/${dest#/}"
401 +
402 + rm ASSEMBLY_EXCEPTION LICENSE THIRD_PARTY_README || die
403 +
404 + # on macOS if they would exist they would be called .dylib, but most
405 + # importantly, there are no different providers, so everything
406 + # that's shipped works.
407 + if [[ ${A} != *_mac_* ]] ; then
408 + # this does not exist on arm64 hence -f
409 + rm -fv jre/lib/*/libfreetype.so* || die
410 +
411 + if ! use alsa ; then
412 + rm -v jre/lib/*/libjsoundalsa.so* || die
413 + fi
414 +
415 + if ! use examples ; then
416 + rm -vr sample || die
417 + fi
418 +
419 + if use headless-awt ; then
420 + rm -fvr {,jre/}lib/*/lib*{[jx]awt,splashscreen}* \
421 + {,jre/}bin/policytool bin/appletviewer || die
422 + fi
423 + fi
424 +
425 + if ! use source ; then
426 + rm -v src.zip || die
427 + fi
428 +
429 + rm -v jre/lib/security/cacerts || die
430 + dosym ../../../../../etc/ssl/certs/java/cacerts \
431 + "${dest}"/jre/lib/security/cacerts
432 +
433 + dodir "${dest}"
434 + cp -pPR * "${ddest}" || die
435 +
436 + # provide stable symlink
437 + dosym "${P}" "/opt/${PN}-${SLOT}"
438 +
439 + java-vm_install-env "${FILESDIR}"/${PN}-${SLOT}.env.sh
440 + java-vm_set-pax-markings "${ddest}"
441 + java-vm_revdep-mask
442 + java-vm_sandbox-predict /dev/random /proc/self/coredump_filter
443 +}