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