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, 09 May 2019 23:05:51
Message-Id: 1557443093.8b901cc7b71e0b6745cb8ee783ba3bcbe45c1b90.gyakovlev@gentoo
1 commit: 8b901cc7b71e0b6745cb8ee783ba3bcbe45c1b90
2 Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
3 AuthorDate: Thu May 9 20:58:16 2019 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Thu May 9 23:04:53 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8b901cc7
7
8 dev-java/openjdk: revbump :8, use system-wide ca-certificates
9
10 Bug: https://bugs.gentoo.org/682308
11
12 Package-Manager: Portage-2.3.66, Repoman-2.3.12
13 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
14
15 dev-java/openjdk/openjdk-8.212_p03-r1.ebuild | 241 +++++++++++++++++++++++++++
16 1 file changed, 241 insertions(+)
17
18 diff --git a/dev-java/openjdk/openjdk-8.212_p03-r1.ebuild b/dev-java/openjdk/openjdk-8.212_p03-r1.ebuild
19 new file mode 100644
20 index 00000000000..e660d9aeeba
21 --- /dev/null
22 +++ b/dev-java/openjdk/openjdk-8.212_p03-r1.ebuild
23 @@ -0,0 +1,241 @@
24 +# Copyright 1999-2019 Gentoo Authors
25 +# Distributed under the terms of the GNU General Public License v2
26 +
27 +EAPI=6
28 +
29 +inherit check-reqs eapi7-ver flag-o-matic java-pkg-2 java-vm-2 multiprocessing pax-utils toolchain-funcs
30 +
31 +MY_PV=$(ver_rs 1 'u' 2 '-' ${PV//p/b})
32 +
33 +BASE_URI="https://hg.${PN}.java.net/jdk8u/jdk8u"
34 +
35 +DESCRIPTION="Open source implementation of the Java programming language"
36 +HOMEPAGE="https://openjdk.java.net"
37 +SRC_URI="
38 + ${BASE_URI}/archive/jdk${MY_PV}.tar.bz2 -> ${P}.tar.bz2
39 + ${BASE_URI}/corba/archive/jdk${MY_PV}.tar.bz2 -> ${PN}-corba-${PV}.tar.bz2
40 + ${BASE_URI}/hotspot/archive/jdk${MY_PV}.tar.bz2 -> ${PN}-hotspot-${PV}.tar.bz2
41 + ${BASE_URI}/jaxp/archive/jdk${MY_PV}.tar.bz2 -> ${PN}-jaxp-${PV}.tar.bz2
42 + ${BASE_URI}/jaxws/archive/jdk${MY_PV}.tar.bz2 -> ${PN}-jaxws-${PV}.tar.bz2
43 + ${BASE_URI}/jdk/archive/jdk${MY_PV}.tar.bz2 -> ${PN}-jdk-${PV}.tar.bz2
44 + ${BASE_URI}/langtools/archive/jdk${MY_PV}.tar.bz2 -> ${PN}-langtools-${PV}.tar.bz2
45 + ${BASE_URI}/nashorn/archive/jdk${MY_PV}.tar.bz2 -> ${PN}-nashorn-${PV}.tar.bz2
46 +"
47 +
48 +LICENSE="GPL-2"
49 +SLOT="$(ver_cut 1)"
50 +KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86"
51 +IUSE="alsa debug cups doc examples gentoo-vm headless-awt +jbootstrap nsplugin +pch selinux source +webstart"
52 +
53 +CDEPEND="
54 + media-libs/freetype:2=
55 + >=sys-apps/baselayout-java-0.1.0-r1
56 + sys-libs/zlib
57 + alsa? ( media-libs/alsa-lib )
58 + !headless-awt? (
59 + media-libs/giflib:0/7
60 + x11-libs/libX11
61 + x11-libs/libXext
62 + x11-libs/libXi
63 + x11-libs/libXrender
64 + x11-libs/libXt
65 + x11-libs/libXtst
66 + )
67 +"
68 +
69 +RDEPEND="
70 + ${CDEPEND}
71 + cups? ( net-print/cups )
72 + selinux? ( sec-policy/selinux-java )
73 +"
74 +
75 +# cups headers requied to build, runtime dep is optional
76 +DEPEND="
77 + ${CDEPEND}
78 + net-print/cups
79 + app-arch/zip
80 + app-misc/ca-certificates
81 + dev-lang/perl
82 + dev-libs/openssl:0
83 + media-libs/alsa-lib
84 + !headless-awt? (
85 + x11-base/xorg-proto
86 + )
87 + || (
88 + dev-java/openjdk-bin:${SLOT}
89 + dev-java/icedtea-bin:${SLOT}
90 + dev-java/openjdk:${SLOT}
91 + dev-java/icedtea:${SLOT}
92 + )
93 +"
94 +
95 +PDEPEND="webstart? ( >=dev-java/icedtea-web-1.6.1:0 )
96 + nsplugin? ( >=dev-java/icedtea-web-1.6.1:0[nsplugin] )"
97 +
98 +S="${WORKDIR}/jdk${SLOT}u-jdk${MY_PV}"
99 +
100 +# The space required to build varies wildly depending on USE flags,
101 +# ranging from 2GB to 16GB. This function is certainly not exact but
102 +# should be close enough to be useful.
103 +openjdk_check_requirements() {
104 + local M
105 + M=2048
106 + M=$(( $(usex debug 3 1) * $M ))
107 + M=$(( $(usex jbootstrap 2 1) * $M ))
108 + M=$(( $(usex doc 320 0) + $(usex source 128 0) + 192 + $M ))
109 +
110 + CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE}
111 +}
112 +
113 +pkg_pretend() {
114 + openjdk_check_requirements
115 + has ccache ${FEATURES} && die "FEATURES=ccache doesn't work with ${PN}"
116 +}
117 +
118 +pkg_setup() {
119 + openjdk_check_requirements
120 + java-vm-2_pkg_setup
121 +
122 + JAVA_PKG_WANT_BUILD_VM="openjdk-${SLOT} openjdk-bin-${SLOT} icedtea-${SLOT} icedtea-bin-${SLOT}"
123 + JAVA_PKG_WANT_SOURCE="${SLOT}"
124 + JAVA_PKG_WANT_TARGET="${SLOT}"
125 +
126 + # The nastiness below is necessary while the gentoo-vm USE flag is
127 + # masked. First we call java-pkg-2_pkg_setup if it looks like the
128 + # flag was unmasked against one of the possible build VMs. If not,
129 + # we try finding one of them in their expected locations. This would
130 + # have been slightly less messy if openjdk-bin had been installed to
131 + # /opt/${PN}-${SLOT} or if there was a mechanism to install a VM env
132 + # file but disable it so that it would not normally be selectable.
133 +
134 + local vm
135 + for vm in ${JAVA_PKG_WANT_BUILD_VM}; do
136 + if [[ -d ${EPREFIX}/usr/lib/jvm/${vm} ]]; then
137 + java-pkg-2_pkg_setup
138 + return
139 + fi
140 + done
141 +
142 + if has_version --host-root dev-java/openjdk:${SLOT}; then
143 + export JDK_HOME=${EPREFIX}/usr/$(get_libdir)/openjdk-${SLOT}
144 + else
145 + JDK_HOME=$(best_version --host-root dev-java/openjdk-bin:${SLOT})
146 + [[ -n ${JDK_HOME} ]] || die "Build VM not found!"
147 + JDK_HOME=${JDK_HOME#*/}
148 + JDK_HOME=${EPREFIX}/opt/${JDK_HOME%-r*}
149 + export JDK_HOME
150 + fi
151 +}
152 +
153 +src_prepare() {
154 + default
155 + chmod +x configure || die
156 + local repo
157 + for repo in corba hotspot jdk jaxp jaxws langtools nashorn; do
158 + ln -s ../"${repo}-jdk${MY_PV}" "${repo}" || die
159 + done
160 + # new warnings in new gcc https://bugs.gentoo.org/685426
161 + sed -i '/^WARNINGS_ARE_ERRORS/ s/-Werror/-Wno-error/' \
162 + hotspot/make/linux/makefiles/gcc.make || die
163 +}
164 +
165 +src_configure() {
166 + # general build info found here:
167 + #https://hg.openjdk.java.net/jdk8/jdk8/raw-file/tip/README-builds.html
168 +
169 + # Work around stack alignment issue, bug #647954.
170 + use x86 && append-flags -mincoming-stack-boundary=2
171 +
172 + append-flags -Wno-error
173 +
174 + local myconf=(
175 + --disable-ccache
176 + --enable-unlimited-crypto
177 + --with-boot-jdk="${JDK_HOME}"
178 + --with-extra-cflags="${CFLAGS}"
179 + --with-extra-cxxflags="${CXXFLAGS}"
180 + --with-extra-ldflags="${LDFLAGS}"
181 + --with-giflib=system
182 + --with-jtreg=no
183 + --with-jobs=1
184 + --with-num-cores=1
185 + --with-update-version="$(ver_cut 2)"
186 + --with-build-number="$(ver_cut 4)"
187 + --with-milestone="gentoo"
188 + --with-vendor-name="Gentoo"
189 + --with-vendor-url="https://gentoo.org"
190 + --with-vendor-bug-url="https://bugs.gentoo.org"
191 + --with-vendor-vm-bug-url="https://bugs.openjdk.java.net"
192 + --with-zlib=system
193 + --with-native-debug-symbols=$(usex debug internal none)
194 + $(usex headless-awt --disable-headful '')
195 + )
196 +
197 + # PaX breaks pch, bug #601016
198 + if use pch && ! host-is-pax; then
199 + myconf+=( --enable-precompiled-headers )
200 + else
201 + myconf+=( --disable-precompiled-headers )
202 + fi
203 +
204 + (
205 + unset _JAVA_OPTIONS JAVA JAVAC XARGS
206 + CFLAGS= CXXFLAGS= LDFLAGS= \
207 + CONFIG_SITE=/dev/null \
208 + econf "${myconf[@]}"
209 + )
210 +}
211 +
212 +src_compile() {
213 + emake -j1 LOG=debug JOBS=$(makeopts_jobs)\
214 + $(usex jbootstrap bootcycle-images images) $(usex doc docs '')
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/j2sdk-image || die
222 +
223 + if ! use alsa; then
224 + rm -v jre/lib/$(get_system_arch)/libjsoundalsa.* || die
225 + fi
226 +
227 + if ! use examples ; then
228 + rm -vr demo/ || die
229 + fi
230 +
231 + if ! use source ; then
232 + rm -v src.zip || die
233 + fi
234 +
235 + dodir "${dest}"
236 + cp -pPR * "${ddest}" || die
237 +
238 + dosym "${EPREFIX}"/etc/ssl/certs/java/cacerts "${dest}"/jre/lib/security/cacerts
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/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 +}