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: Mon, 28 Jan 2019 19:51:50
Message-Id: 1548645790.ef3753f1b7bf08b4ef3d5261953a38b496746da6.gyakovlev@gentoo
1 commit: ef3753f1b7bf08b4ef3d5261953a38b496746da6
2 Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jan 28 03:12:52 2019 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Mon Jan 28 03:23:10 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ef3753f1
7
8 dev-java/openjdk: bump to 11.0.2+7
9
10 make cups optional. it's still required to build, but can be
11 removed later.
12
13 Removed jvm variants support. It was incomplete and overly complex.
14 Greater flexibility can be achieved via features.
15
16 If you want to enable or disable certain features you can pass
17 --with-jvm-features=[-feature|feature] to ebuild via EXTRA_ECONF
18 The following JVM features are available:
19
20 compiler1 compiler2 zero minimal dtrace jvmti jvmci
21 graal vm-structs jni-check services management cmsgc
22 epsilongc g1gc parallelgc serialgc zgc nmt cds
23 static-build link-time-opt aot jfr
24
25 Which are valid to use depends on the target platform
26
27 Note: in this version zgc (zero garbage collector) is not enabled yet.
28 It will be enabled by default on supported arches starting with 11.0.3
29 https://wiki.openjdk.java.net/display/zgc/Main
30
31 to enable it for this build pass --with-jvm-features=zgc via EXTRA_ECONF
32
33 Package-Manager: Portage-2.3.58, Repoman-2.3.12
34 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
35
36 dev-java/openjdk/Manifest | 1 +
37 dev-java/openjdk/openjdk-11.0.2_p7.ebuild | 211 ++++++++++++++++++++++++++++++
38 2 files changed, 212 insertions(+)
39
40 diff --git a/dev-java/openjdk/Manifest b/dev-java/openjdk/Manifest
41 index 351991ab4ea..ad45e64d341 100644
42 --- a/dev-java/openjdk/Manifest
43 +++ b/dev-java/openjdk/Manifest
44 @@ -1 +1,2 @@
45 DIST jdk-11.0.1+13.tar.bz2 90134818 BLAKE2B c79f32dc5b531a06317afb87ef15495267e914b9b292a1d434514a90298d8234e7e0ba92659416b15d9392c7513d976a0c81411953cb6706a27ee57c965e36fb SHA512 c534c2fa8dcd4fdebef6f00473d5ceaae4a33bd1e1a417846508e25f154b1ded649a73468c8c71ac0c1e27bab5f641a3b480a264b532a0c30be2869c3d11a15d
46 +DIST jdk-11.0.2+7.tar.bz2 90189455 BLAKE2B 37473a8db4c6ad6789ea67b44f4dda94b9f59143c681a206aa0931b3a2a376fbc480c0c5a6b617072cf9ce1faca34a6c5c5e56cfec9fbf5482b82520fb2463c4 SHA512 03214d9fc920c04f3057594efa78ff588a630e6c594e5bbcc24b4c327fa08273ce060063d98720cdc04bc6978a3d04e172f38ba7a3bcabf02dd5dad397fd9952
47
48 diff --git a/dev-java/openjdk/openjdk-11.0.2_p7.ebuild b/dev-java/openjdk/openjdk-11.0.2_p7.ebuild
49 new file mode 100644
50 index 00000000000..1a48fa81cb9
51 --- /dev/null
52 +++ b/dev-java/openjdk/openjdk-11.0.2_p7.ebuild
53 @@ -0,0 +1,211 @@
54 +# Copyright 1999-2019 Gentoo Authors
55 +# Distributed under the terms of the GNU General Public License v2
56 +
57 +EAPI=6
58 +
59 +inherit autotools check-reqs flag-o-matic java-pkg-2 java-vm-2 multiprocessing pax-utils toolchain-funcs
60 +
61 +MY_PV=${PV/_p/+}
62 +SLOT=${MY_PV%%[.+]*}
63 +
64 +DESCRIPTION="Open source implementation of the Java programming language"
65 +HOMEPAGE="https://openjdk.java.net"
66 +SRC_URI="https://hg.${PN}.java.net/jdk-updates/jdk${SLOT}u/archive/jdk-${MY_PV}.tar.bz2"
67 +
68 +LICENSE="GPL-2"
69 +KEYWORDS="~amd64 ~arm64 ~ppc64"
70 +
71 +IUSE="alsa cups debug doc examples gentoo-vm headless-awt +jbootstrap nsplugin +pch selinux source systemtap +webstart"
72 +
73 +CDEPEND="
74 + media-libs/freetype:2=
75 + sys-libs/zlib
76 + systemtap? ( dev-util/systemtap )
77 + !headless-awt? (
78 + x11-libs/libX11
79 + x11-libs/libXext
80 + x11-libs/libXi
81 + x11-libs/libXrender
82 + x11-libs/libXt
83 + x11-libs/libXtst
84 + )
85 +"
86 +
87 +# cups and alsa required to build, but not to run, make is possible to remove
88 +RDEPEND="
89 + ${CDEPEND}
90 + alsa? ( media-libs/alsa-lib )
91 + cups? ( net-print/cups )
92 + selinux? ( sec-policy/selinux-java )
93 +"
94 +
95 +DEPEND="
96 + ${CDEPEND}
97 + app-arch/zip
98 + media-libs/alsa-lib
99 + net-print/cups
100 + !headless-awt? (
101 + x11-base/xorg-proto
102 + )
103 + || (
104 + dev-java/openjdk-bin:${SLOT}
105 + dev-java/openjdk:${SLOT}
106 + )
107 +"
108 +
109 +PDEPEND="webstart? ( >=dev-java/icedtea-web-1.6.1:0 )
110 + nsplugin? ( >=dev-java/icedtea-web-1.6.1:0[nsplugin] )"
111 +
112 +S="${WORKDIR}/jdk${SLOT}u-jdk-${MY_PV}"
113 +
114 +# The space required to build varies wildly depending on USE flags,
115 +# ranging from 2GB to 16GB. This function is certainly not exact but
116 +# should be close enough to be useful.
117 +openjdk_check_requirements() {
118 + local M
119 + M=2048
120 + M=$(( $(usex jbootstrap 2 1) * $M ))
121 + M=$(( $(usex debug 3 1) * $M ))
122 + M=$(( $(usex doc 320 0) + $(usex source 128 0) + 192 + $M ))
123 +
124 + CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE}
125 +}
126 +
127 +pkg_pretend() {
128 + openjdk_check_requirements
129 +}
130 +
131 +pkg_setup() {
132 + openjdk_check_requirements
133 + java-vm-2_pkg_setup
134 +
135 + JAVA_PKG_WANT_BUILD_VM="openjdk-${SLOT} openjdk-bin-${SLOT}"
136 + JAVA_PKG_WANT_SOURCE="${SLOT}"
137 + JAVA_PKG_WANT_TARGET="${SLOT}"
138 +
139 + # The nastiness below is necessary while the gentoo-vm USE flag is
140 + # masked. First we call java-pkg-2_pkg_setup if it looks like the
141 + # flag was unmasked against one of the possible build VMs. If not,
142 + # we try finding one of them in their expected locations. This would
143 + # have been slightly less messy if openjdk-bin had been installed to
144 + # /opt/${PN}-${SLOT} or if there was a mechanism to install a VM env
145 + # file but disable it so that it would not normally be selectable.
146 +
147 + local vm
148 + for vm in ${JAVA_PKG_WANT_BUILD_VM}; do
149 + if [[ -d ${EPREFIX}/usr/lib/jvm/${vm} ]]; then
150 + java-pkg-2_pkg_setup
151 + return
152 + fi
153 + done
154 +
155 + if has_version --host-root dev-java/openjdk:${SLOT}; then
156 + export JDK_HOME=${EPREFIX}/usr/$(get_libdir)/openjdk-${SLOT}
157 + else
158 + JDK_HOME=$(best_version --host-root dev-java/openjdk-bin:${SLOT})
159 + [[ -n ${JDK_HOME} ]] || die "Build VM not found!"
160 + JDK_HOME=${JDK_HOME#*/}
161 + JDK_HOME=${EPREFIX}/opt/${JDK_HOME%-r*}
162 + export JDK_HOME
163 + fi
164 +}
165 +
166 +src_prepare() {
167 + default
168 + chmod +x configure || die
169 +}
170 +
171 +src_configure() {
172 + # Work around stack alignment issue, bug #647954. in case we ever have x86
173 + use x86 && append-flags -mincoming-stack-boundary=2
174 +
175 + # Enabling full docs appears to break doc building. If not
176 + # explicitly disabled, the flag will get auto-enabled if pandoc and
177 + # graphviz are detected. pandoc has loads of dependencies anyway.
178 + # currently it still bundles lcms libpng giflib and libjpeg.
179 +
180 + local myconf=(
181 + --disable-ccache
182 + --enable-full-docs=no
183 + --with-boot-jdk="${JDK_HOME}"
184 + --with-extra-cflags="${CFLAGS}"
185 + --with-extra-cxxflags="${CXXFLAGS}"
186 + --with-extra-ldflags="${LDFLAGS}"
187 + --with-native-debug-symbols=$(usex debug internal none)
188 + --with-version-pre=gentoo
189 + --with-version-string=${MY_PV%+*}
190 + --with-version-build=${MY_PV#*+}
191 + --with-zlib=system
192 + --enable-dtrace=$(usex systemtap yes no)
193 + --enable-headless-only=$(usex headless-awt yes no)
194 + )
195 +
196 + # PaX breaks pch, bug #601016
197 + if use pch && ! host-is-pax; then
198 + myconf+=( --enable-precompiled-headers )
199 + else
200 + myconf+=( --disable-precompiled-headers )
201 + fi
202 +
203 + (
204 + unset JAVA JAVAC XARGS
205 + CFLAGS= CXXFLAGS= LDFLAGS= \
206 + CONFIG_SITE=/dev/null \
207 + econf "${myconf[@]}"
208 + )
209 +}
210 +
211 +src_compile() {
212 + emake -j1 \
213 + $(usex jbootstrap bootcycle-images product-images) $(usex doc docs '') \
214 + JOBS=$(makeopts_jobs) LOG=debug CFLAGS_WARNINGS_ARE_ERRORS= # No -Werror
215 +}
216 +
217 +src_install() {
218 + local dest="/usr/$(get_libdir)/${PN}-${SLOT}"
219 + local ddest="${ED}${dest#/}"
220 +
221 + cd "${S}"/build/*-release/images/jdk || die
222 +
223 + # Oracle and IcedTea have libjsoundalsa.so depending on
224 + # libasound.so.2 but OpenJDK only has libjsound.so. Weird.
225 + if ! use alsa ; then
226 + rm -v lib/libjsound.* || die
227 + fi
228 +
229 + if ! use examples ; then
230 + rm -vr demo/ || die
231 + fi
232 +
233 + if ! use source ; then
234 + rm -v lib/src.zip || die
235 + fi
236 +
237 + dodir "${dest}"
238 + cp -pPR * "${ddest}" || die
239 +
240 + use gentoo-vm && java-vm_install-env "${FILESDIR}"/${PN}-${SLOT}.env.sh
241 + java-vm_set-pax-markings "${ddest}"
242 + java-vm_revdep-mask
243 + java-vm_sandbox-predict /dev/random /proc/self/coredump_filter
244 +
245 + if use doc ; then
246 + insinto /usr/share/doc/${PF}/html
247 + doins -r "${S}"/build/*-release/images/docs/*
248 + fi
249 +}
250 +
251 +pkg_postinst() {
252 + java-vm-2_pkg_postinst
253 +
254 + if use gentoo-vm ; then
255 + ewarn "WARNING! You have enabled the gentoo-vm USE flag, making this JDK"
256 + ewarn "recognised by the system. This will almost certainly break things."
257 + else
258 + ewarn "The experimental gentoo-vm USE flag has not been enabled so this JDK"
259 + ewarn "will not be recognised by the system. For example, simply calling"
260 + ewarn "\"java\" will launch a different JVM. This is necessary until Gentoo"
261 + ewarn "fully supports Java ${SLOT}. This JDK must therefore be invoked using its"
262 + ewarn "absolute location under ${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}."
263 + fi
264 +}