Gentoo Archives: gentoo-commits

From: Georgy Yakovlev <gyakovlev@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-java/openjdk/
Date: Tue, 13 Sep 2022 23:00:02
Message-Id: 1663109961.ccc68be410a8359f2ae4a92d128c098565cc6185.gyakovlev@gentoo
1 commit: ccc68be410a8359f2ae4a92d128c098565cc6185
2 Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
3 AuthorDate: Tue Sep 13 22:11:23 2022 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Tue Sep 13 22:59:21 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ccc68be4
7
8 dev-java/openjdk: add 11.0.16.1_p1
9
10 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
11
12 dev-java/openjdk/Manifest | 1 +
13 dev-java/openjdk/openjdk-11.0.16.1_p1.ebuild | 294 +++++++++++++++++++++++++++
14 2 files changed, 295 insertions(+)
15
16 diff --git a/dev-java/openjdk/Manifest b/dev-java/openjdk/Manifest
17 index 97f1c6568269..ef2994b225e4 100644
18 --- a/dev-java/openjdk/Manifest
19 +++ b/dev-java/openjdk/Manifest
20 @@ -1,5 +1,6 @@
21 DIST openjdk-11.0.14-riscv.patch.xz 279088 BLAKE2B f67cf5707246b22285de8217b68fb806e3c18b7289cb81428c0fe83c5a4dcd60233be10aaca0853ffb00ac24fa60cae1b1d60ed300ad6bff8b07e881bddf8650 SHA512 32bac5f0c0f5df883de344718586bf798db6c8a5738058ea5d4902f5a0a3fc841c1893dec3379a74b9468c1c37af5c31a3e296476549972d3f1305401354060d
22 DIST openjdk-11.0.15_p10.tar.gz 122902351 BLAKE2B a2dabad415a92765d548b19261e22e2cd483a17b478c8ef98342b44e88b39b23d89d31aecc80f93b27fce8df50ba41f4e6e5f10b66035bbfc1e0c03fc4707a40 SHA512 9d9e631046769d3ad95229172f392649ef4162161eb2d6fa7371665619600a04db440e1b3d30c580e283ad2b6bd7580d1199fc854fad3cb962d79f18b2347c67
23 +DIST openjdk-11.0.16.1_p1.tar.gz 123134756 BLAKE2B 727294bb9d07193bb74b01a3e3e35f491b54be4cf3b6230e59df56ea7a9166b0b138f82b3d3c302c32b21efa8e9ac71437ca430a68a9ad8b69a7755d289bde17 SHA512 c694a8e6b0ff664b2c6a43ef3445d98e3b4ddf59c7fe94a21390b2d7756870ea7c7e34cb99d40bd66708ecaee93ffeb4dfc9ab7e2162bd6fc19479f23963560d
24 DIST openjdk-17.0.3-riscv.patch.xz 296268 BLAKE2B 9b2036493a485a1e245230488a5985af4f5d5c6a85912d73d8a712742fdfc26d5eb08ca8e69dac04f0d516fb361e6ed057c95a3839b04639d129581cf00f0620 SHA512 692b5e39e5c6eb1222f25c3012e9a73366d9c98f5c29c2f2d35f41991cdcb026a644398b6f3fdd8c9d8368b4b1f5dc4d89b3dbd594a2e7751de96a140551d445
25 DIST openjdk-17.0.3_p7.tar.gz 104797560 BLAKE2B 025ff6be360c74288990622bce31769e5780f3f326b0eed2b78a776cc4df8bdf8cb99dfb0d7dd3f03f8558ca9a66acc5c5bd04b227ba4dffe18f8586a287b74b SHA512 3bebaaf0469cd6558a3f033b768005e880ec95d5bb2a24b8929d2f6a05f18ca9977b291ad49b220a904f661cf6b47780a1cfd776109ed11d4e34d5345be8f66c
26 DIST openjdk-17.0.4.1.tar.gz 104917916 BLAKE2B f01101aa5c1fa17ab92134d2d238df266a734ad0d523e0030853b4386c9e021364e1a98644a8f6fd075f42dff1ff2b0d2a0b958c6d99c10c4250043bee36f6a3 SHA512 5b134a93addf17bb9c91e7ea69e25a9db4dbdc27760de3a128e48b20bbfb004722851c27cea4f9d83e3fdab929e89af09cf7879b1d87334cffe600b12ee53150
27
28 diff --git a/dev-java/openjdk/openjdk-11.0.16.1_p1.ebuild b/dev-java/openjdk/openjdk-11.0.16.1_p1.ebuild
29 new file mode 100644
30 index 000000000000..4952d502f500
31 --- /dev/null
32 +++ b/dev-java/openjdk/openjdk-11.0.16.1_p1.ebuild
33 @@ -0,0 +1,294 @@
34 +# Copyright 1999-2022 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI=7
38 +
39 +inherit eapi8-dosym check-reqs flag-o-matic java-pkg-2 java-vm-2 multiprocessing toolchain-funcs
40 +
41 +# we need -ga tag to fetch tarball and unpack it, but exact number everywhere else to
42 +# set build version properly
43 +MY_PV="${PV%_p*}-ga"
44 +SLOT="${MY_PV%%[.+]*}"
45 +
46 +# variable name format: <UPPERCASE_KEYWORD>_XPAK
47 +PPC64_XPAK="11.0.13_p8" # big-endian bootstrap tarball
48 +RISCV_XPAK="11.0.14_p9" # lp64d bootstrap tarball
49 +X86_XPAK="11.0.13_p8"
50 +
51 +# Usage: bootstrap_uri <keyword> <version> [extracond]
52 +# Example: $(bootstrap_uri ppc64 17.0.1_p12 big-endian)
53 +# Output: ppc64? ( big-endian? ( https://...17.0.1_p12-ppc64.tar.xz ) )
54 +bootstrap_uri() {
55 + local baseuri="https://dev.gentoo.org/~arthurzam/distfiles/dev-java/${PN}/${PN}-bootstrap"
56 + local suff="tar.xz"
57 + local kw="${1:?${FUNCNAME[0]}: keyword not specified}"
58 + local ver="${2:?${FUNCNAME[0]}: version not specified}"
59 + local cond="${3-}"
60 +
61 + # here be dragons
62 + echo "${kw}? ( ${cond:+${cond}? (} ${baseuri}-${ver}-${kw}.${suff} ${cond:+) })"
63 +}
64 +
65 +DESCRIPTION="Open source implementation of the Java programming language"
66 +HOMEPAGE="https://openjdk.org"
67 +SRC_URI="
68 + https://github.com/${PN}/jdk${SLOT}u/archive/refs/tags/jdk-${MY_PV}.tar.gz
69 + -> ${P}.tar.gz
70 + !system-bootstrap? (
71 + $(bootstrap_uri ppc64 ${PPC64_XPAK} big-endian)
72 + $(bootstrap_uri riscv ${RISCV_XPAK})
73 + $(bootstrap_uri x86 ${X86_XPAK})
74 + )
75 + riscv? ( https://dev.gentoo.org/~arthurzam/distfiles/dev-java/openjdk/openjdk-11.0.14-riscv.patch.xz )
76 +"
77 +
78 +LICENSE="GPL-2"
79 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
80 +
81 +IUSE="alsa big-endian cups debug doc examples headless-awt javafx +jbootstrap selinux source system-bootstrap systemtap"
82 +
83 +REQUIRED_USE="
84 + javafx? ( alsa !headless-awt )
85 + !system-bootstrap? ( jbootstrap )
86 +"
87 +
88 +COMMON_DEPEND="
89 + media-libs/freetype:2=
90 + media-libs/giflib:0/7
91 + media-libs/harfbuzz:=
92 + media-libs/libpng:0=
93 + media-libs/lcms:2=
94 + sys-libs/zlib
95 + media-libs/libjpeg-turbo:0=
96 + systemtap? ( dev-util/systemtap )
97 +"
98 +
99 +# Many libs are required to build, but not to run, make is possible to remove
100 +# by listing conditionally in RDEPEND unconditionally in DEPEND
101 +RDEPEND="
102 + ${COMMON_DEPEND}
103 + >=sys-apps/baselayout-java-0.1.0-r1
104 + !headless-awt? (
105 + x11-libs/libX11
106 + x11-libs/libXext
107 + x11-libs/libXi
108 + x11-libs/libXrandr
109 + x11-libs/libXrender
110 + x11-libs/libXt
111 + x11-libs/libXtst
112 + )
113 + alsa? ( media-libs/alsa-lib )
114 + cups? ( net-print/cups )
115 + selinux? ( sec-policy/selinux-java )
116 +"
117 +
118 +DEPEND="
119 + ${COMMON_DEPEND}
120 + app-arch/zip
121 + media-libs/alsa-lib
122 + net-print/cups
123 + x11-base/xorg-proto
124 + x11-libs/libX11
125 + x11-libs/libXext
126 + x11-libs/libXi
127 + x11-libs/libXrandr
128 + x11-libs/libXrender
129 + x11-libs/libXt
130 + x11-libs/libXtst
131 + javafx? ( dev-java/openjfx:${SLOT}= )
132 + system-bootstrap? (
133 + || (
134 + dev-java/openjdk-bin:${SLOT}[gentoo-vm(+)]
135 + dev-java/openjdk:${SLOT}[gentoo-vm(+)]
136 + )
137 + )
138 +"
139 +
140 +S="${WORKDIR}/jdk${SLOT}u-jdk-${MY_PV}"
141 +
142 +# The space required to build varies wildly depending on USE flags,
143 +# ranging from 2GB to 16GB. This function is certainly not exact but
144 +# should be close enough to be useful.
145 +openjdk_check_requirements() {
146 + local M
147 + M=2048
148 + M=$(( $(usex jbootstrap 2 1) * $M ))
149 + M=$(( $(usex debug 3 1) * $M ))
150 + M=$(( $(usex doc 320 0) + $(usex source 128 0) + 192 + $M ))
151 +
152 + CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE}
153 +}
154 +
155 +pkg_pretend() {
156 + openjdk_check_requirements
157 + if [[ ${MERGE_TYPE} != binary ]]; then
158 + has ccache ${FEATURES} && die "FEATURES=ccache doesn't work with ${PN}, bug #677876"
159 + fi
160 +}
161 +
162 +pkg_setup() {
163 + openjdk_check_requirements
164 + java-vm-2_pkg_setup
165 +
166 + [[ ${MERGE_TYPE} == "binary" ]] && return
167 +
168 + JAVA_PKG_WANT_BUILD_VM="openjdk-${SLOT} openjdk-bin-${SLOT}"
169 + JAVA_PKG_WANT_SOURCE="${SLOT}"
170 + JAVA_PKG_WANT_TARGET="${SLOT}"
171 +
172 + if use system-bootstrap; then
173 + for vm in ${JAVA_PKG_WANT_BUILD_VM}; do
174 + if [[ -d ${BROOT}/usr/lib/jvm/${vm} ]]; then
175 + java-pkg-2_pkg_setup
176 + return
177 + fi
178 + done
179 + fi
180 +}
181 +
182 +src_prepare() {
183 + use riscv && eapply "${WORKDIR}"/openjdk-11.0.14-riscv.patch
184 + default
185 + chmod +x configure || die
186 +}
187 +
188 +src_configure() {
189 + if ! use system-bootstrap; then
190 + local xpakvar="${ARCH^^}_XPAK"
191 + export JDK_HOME="${WORKDIR}/openjdk-bootstrap-${!xpakvar}"
192 + fi
193 +
194 + # Work around stack alignment issue, bug #647954.
195 + use x86 && append-flags -mincoming-stack-boundary=2
196 +
197 + # Work around -fno-common ( GCC10 default ), bug #713180
198 + append-flags -fcommon
199 +
200 + # Strip some flags users may set, but should not. #818502
201 + filter-flags -fexceptions
202 +
203 + # Enabling full docs appears to break doc building. If not
204 + # explicitly disabled, the flag will get auto-enabled if pandoc and
205 + # graphviz are detected. pandoc has loads of dependencies anyway.
206 +
207 + local myconf=(
208 + --disable-ccache
209 + --disable-precompiled-headers
210 + --enable-full-docs=no
211 + --with-boot-jdk="${JDK_HOME}"
212 + --with-extra-cflags="${CFLAGS}"
213 + --with-extra-cxxflags="${CXXFLAGS}"
214 + --with-extra-ldflags="${LDFLAGS}"
215 + --with-freetype="${XPAK_BOOTSTRAP:-system}"
216 + --with-giflib="${XPAK_BOOTSTRAP:-system}"
217 + --with-harfbuzz="${XPAK_BOOTSTRAP:-system}"
218 + --with-lcms="${XPAK_BOOTSTRAP:-system}"
219 + --with-libjpeg="${XPAK_BOOTSTRAP:-system}"
220 + --with-libpng="${XPAK_BOOTSTRAP:-system}"
221 + --with-native-debug-symbols=$(usex debug internal none)
222 + --with-vendor-name="Gentoo"
223 + --with-vendor-url="https://gentoo.org"
224 + --with-vendor-bug-url="https://bugs.gentoo.org"
225 + --with-vendor-vm-bug-url="https://bugs.openjdk.java.net"
226 + --with-vendor-version-string="${PVR}"
227 + --with-version-pre=""
228 + --with-version-string="${PV%_p*}"
229 + --with-version-build="${PV#*_p}"
230 + --with-zlib="${XPAK_BOOTSTRAP:-system}"
231 + --enable-dtrace=$(usex systemtap yes no)
232 + --enable-headless-only=$(usex headless-awt yes no)
233 + $(tc-is-clang && echo "--with-toolchain-type=clang")
234 + )
235 + ! use riscv && myconf+=( --with-jvm-features=shenandoahgc )
236 +
237 + if use javafx; then
238 + # this is not useful for users, just for upstream developers
239 + # build system compares mesa version in md file
240 + # https://bugs.gentoo.org/822612
241 + export LEGAL_EXCLUDES=mesa3d.md
242 +
243 + local zip="${EPREFIX}/usr/$(get_libdir)/openjfx-${SLOT}/javafx-exports.zip"
244 + if [[ -r ${zip} ]]; then
245 + myconf+=( --with-import-modules="${zip}" )
246 + else
247 + die "${zip} not found or not readable"
248 + fi
249 + fi
250 +
251 + if use !system-bootstrap ; then
252 + addpredict /dev/random
253 + addpredict /proc/self/coredump_filter
254 + fi
255 +
256 + (
257 + unset _JAVA_OPTIONS JAVA JAVA_TOOL_OPTIONS JAVAC XARGS
258 + CFLAGS= CXXFLAGS= LDFLAGS= \
259 + CONFIG_SITE=/dev/null \
260 + econf "${myconf[@]}"
261 + )
262 +}
263 +
264 +src_compile() {
265 + local myemakeargs=(
266 + JOBS=$(makeopts_jobs)
267 + LOG=debug
268 + CFLAGS_WARNINGS_ARE_ERRORS= # No -Werror
269 + NICE= # Use PORTAGE_NICENESS, don't adjust further down
270 + $(usex doc docs '')
271 + $(usex jbootstrap bootcycle-images product-images)
272 + )
273 + emake "${myemakeargs[@]}" -j1 #nowarn
274 +}
275 +
276 +src_install() {
277 + local dest="/usr/$(get_libdir)/${PN}-${SLOT}"
278 + local ddest="${ED}/${dest#/}"
279 +
280 + cd "${S}"/build/*-release/images/jdk || die
281 +
282 + # Create files used as storage for system preferences.
283 + mkdir .systemPrefs || die
284 + touch .systemPrefs/.system.lock || die
285 + touch .systemPrefs/.systemRootModFile || die
286 +
287 + # Oracle and IcedTea have libjsoundalsa.so depending on
288 + # libasound.so.2 but OpenJDK only has libjsound.so. Weird.
289 + if ! use alsa ; then
290 + rm -v lib/libjsound.* || die
291 + fi
292 +
293 + if ! use examples ; then
294 + rm -vr demo/ || die
295 + fi
296 +
297 + if ! use source ; then
298 + rm -v lib/src.zip || die
299 + fi
300 +
301 + rm -v lib/security/cacerts || die
302 +
303 + dodir "${dest}"
304 + cp -pPR * "${ddest}" || die
305 +
306 + dosym8 -r /etc/ssl/certs/java/cacerts "${dest}"/lib/security/cacerts
307 +
308 + # must be done before running itself
309 + java-vm_set-pax-markings "${ddest}"
310 +
311 + einfo "Creating the Class Data Sharing archives and disabling usage tracking"
312 + "${ddest}/bin/java" -server -Xshare:dump -Djdk.disableLastUsageTracking || die
313 +
314 + java-vm_install-env "${FILESDIR}"/${PN}.env.sh
315 + java-vm_revdep-mask
316 + java-vm_sandbox-predict /dev/random /proc/self/coredump_filter
317 +
318 + if use doc ; then
319 + docinto html
320 + dodoc -r "${S}"/build/*-release/images/docs/*
321 + dosym8 -r /usr/share/doc/"${PF}" /usr/share/doc/"${PN}-${SLOT}"
322 + fi
323 +}
324 +
325 +pkg_postinst() {
326 + java-vm-2_pkg_postinst
327 +}