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