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