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