1 |
commit: fe8eba2c445f8c2c0b6d1a618c578b5285dfa17d |
2 |
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu May 9 21:24:59 2019 +0000 |
4 |
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu May 9 23:04:54 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fe8eba2c |
7 |
|
8 |
dev-java/openjdk: revbump :11, 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-11.0.3_p7-r1.ebuild | 222 +++++++++++++++++++++++++++ |
16 |
1 file changed, 222 insertions(+) |
17 |
|
18 |
diff --git a/dev-java/openjdk/openjdk-11.0.3_p7-r1.ebuild b/dev-java/openjdk/openjdk-11.0.3_p7-r1.ebuild |
19 |
new file mode 100644 |
20 |
index 00000000000..6a58e00b1fa |
21 |
--- /dev/null |
22 |
+++ b/dev-java/openjdk/openjdk-11.0.3_p7-r1.ebuild |
23 |
@@ -0,0 +1,222 @@ |
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 autotools check-reqs flag-o-matic java-pkg-2 java-vm-2 multiprocessing pax-utils toolchain-funcs |
30 |
+ |
31 |
+MY_PV=${PV/_p/+} |
32 |
+SLOT=${MY_PV%%[.+]*} |
33 |
+ |
34 |
+DESCRIPTION="Open source implementation of the Java programming language" |
35 |
+HOMEPAGE="https://openjdk.java.net" |
36 |
+SRC_URI="https://hg.${PN}.java.net/jdk-updates/jdk${SLOT}u/archive/jdk-${MY_PV}.tar.bz2" |
37 |
+ |
38 |
+LICENSE="GPL-2" |
39 |
+KEYWORDS="~amd64 ~arm64 ~ppc64" |
40 |
+ |
41 |
+IUSE="alsa cups debug doc examples gentoo-vm headless-awt +jbootstrap nsplugin +pch selinux source systemtap +webstart" |
42 |
+ |
43 |
+CDEPEND=" |
44 |
+ media-libs/freetype:2= |
45 |
+ >=sys-apps/baselayout-java-0.1.0-r1 |
46 |
+ sys-libs/zlib |
47 |
+ systemtap? ( dev-util/systemtap ) |
48 |
+ !headless-awt? ( |
49 |
+ x11-libs/libX11 |
50 |
+ x11-libs/libXext |
51 |
+ x11-libs/libXi |
52 |
+ x11-libs/libXrender |
53 |
+ x11-libs/libXt |
54 |
+ x11-libs/libXtst |
55 |
+ ) |
56 |
+" |
57 |
+ |
58 |
+# cups and alsa required to build, but not to run, make is possible to remove |
59 |
+RDEPEND=" |
60 |
+ ${CDEPEND} |
61 |
+ alsa? ( media-libs/alsa-lib ) |
62 |
+ cups? ( net-print/cups ) |
63 |
+ selinux? ( sec-policy/selinux-java ) |
64 |
+" |
65 |
+ |
66 |
+DEPEND=" |
67 |
+ ${CDEPEND} |
68 |
+ app-arch/zip |
69 |
+ media-libs/alsa-lib |
70 |
+ net-print/cups |
71 |
+ !headless-awt? ( |
72 |
+ x11-base/xorg-proto |
73 |
+ ) |
74 |
+ || ( |
75 |
+ dev-java/openjdk-bin:${SLOT} |
76 |
+ dev-java/openjdk:${SLOT} |
77 |
+ ) |
78 |
+" |
79 |
+ |
80 |
+PDEPEND="webstart? ( >=dev-java/icedtea-web-1.6.1:0 ) |
81 |
+ nsplugin? ( >=dev-java/icedtea-web-1.6.1:0[nsplugin] )" |
82 |
+ |
83 |
+S="${WORKDIR}/jdk${SLOT}u-jdk-${MY_PV}" |
84 |
+ |
85 |
+# The space required to build varies wildly depending on USE flags, |
86 |
+# ranging from 2GB to 16GB. This function is certainly not exact but |
87 |
+# should be close enough to be useful. |
88 |
+openjdk_check_requirements() { |
89 |
+ local M |
90 |
+ M=2048 |
91 |
+ M=$(( $(usex jbootstrap 2 1) * $M )) |
92 |
+ M=$(( $(usex debug 3 1) * $M )) |
93 |
+ M=$(( $(usex doc 320 0) + $(usex source 128 0) + 192 + $M )) |
94 |
+ |
95 |
+ CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE} |
96 |
+} |
97 |
+ |
98 |
+pkg_pretend() { |
99 |
+ openjdk_check_requirements |
100 |
+ has ccache ${FEATURES} && die "FEATURES=ccache doesn't work with ${PN}" |
101 |
+} |
102 |
+ |
103 |
+pkg_setup() { |
104 |
+ openjdk_check_requirements |
105 |
+ java-vm-2_pkg_setup |
106 |
+ |
107 |
+ JAVA_PKG_WANT_BUILD_VM="openjdk-${SLOT} openjdk-bin-${SLOT}" |
108 |
+ JAVA_PKG_WANT_SOURCE="${SLOT}" |
109 |
+ JAVA_PKG_WANT_TARGET="${SLOT}" |
110 |
+ |
111 |
+ # The nastiness below is necessary while the gentoo-vm USE flag is |
112 |
+ # masked. First we call java-pkg-2_pkg_setup if it looks like the |
113 |
+ # flag was unmasked against one of the possible build VMs. If not, |
114 |
+ # we try finding one of them in their expected locations. This would |
115 |
+ # have been slightly less messy if openjdk-bin had been installed to |
116 |
+ # /opt/${PN}-${SLOT} or if there was a mechanism to install a VM env |
117 |
+ # file but disable it so that it would not normally be selectable. |
118 |
+ |
119 |
+ local vm |
120 |
+ for vm in ${JAVA_PKG_WANT_BUILD_VM}; do |
121 |
+ if [[ -d ${EPREFIX}/usr/lib/jvm/${vm} ]]; then |
122 |
+ java-pkg-2_pkg_setup |
123 |
+ return |
124 |
+ fi |
125 |
+ done |
126 |
+ |
127 |
+ if has_version --host-root dev-java/openjdk:${SLOT}; then |
128 |
+ export JDK_HOME=${EPREFIX}/usr/$(get_libdir)/openjdk-${SLOT} |
129 |
+ else |
130 |
+ JDK_HOME=$(best_version --host-root dev-java/openjdk-bin:${SLOT}) |
131 |
+ [[ -n ${JDK_HOME} ]] || die "Build VM not found!" |
132 |
+ JDK_HOME=${JDK_HOME#*/} |
133 |
+ JDK_HOME=${EPREFIX}/opt/${JDK_HOME%-r*} |
134 |
+ export JDK_HOME |
135 |
+ fi |
136 |
+} |
137 |
+ |
138 |
+src_prepare() { |
139 |
+ default |
140 |
+ chmod +x configure || die |
141 |
+} |
142 |
+ |
143 |
+src_configure() { |
144 |
+ # Work around stack alignment issue, bug #647954. in case we ever have x86 |
145 |
+ use x86 && append-flags -mincoming-stack-boundary=2 |
146 |
+ |
147 |
+ # Enabling full docs appears to break doc building. If not |
148 |
+ # explicitly disabled, the flag will get auto-enabled if pandoc and |
149 |
+ # graphviz are detected. pandoc has loads of dependencies anyway. |
150 |
+ # currently it still bundles lcms libpng giflib and libjpeg. |
151 |
+ |
152 |
+ local myconf=( |
153 |
+ --disable-ccache |
154 |
+ --enable-full-docs=no |
155 |
+ --with-boot-jdk="${JDK_HOME}" |
156 |
+ --with-extra-cflags="${CFLAGS}" |
157 |
+ --with-extra-cxxflags="${CXXFLAGS}" |
158 |
+ --with-extra-ldflags="${LDFLAGS}" |
159 |
+ --with-native-debug-symbols=$(usex debug internal none) |
160 |
+ --with-vendor-name="Gentoo" |
161 |
+ --with-vendor-url="https://gentoo.org" |
162 |
+ --with-vendor-bug-url="https://bugs.gentoo.org" |
163 |
+ --with-vendor-vm-bug-url="https://bugs.openjdk.java.net" |
164 |
+ --with-vendor-version-string="${PV}" |
165 |
+ --with-version-pre=gentoo |
166 |
+ --with-version-string=${MY_PV%+*} |
167 |
+ --with-version-build=${MY_PV#*+} |
168 |
+ --with-zlib=system |
169 |
+ --enable-dtrace=$(usex systemtap yes no) |
170 |
+ --enable-headless-only=$(usex headless-awt yes no) |
171 |
+ ) |
172 |
+ |
173 |
+ # PaX breaks pch, bug #601016 |
174 |
+ if use pch && ! host-is-pax; then |
175 |
+ myconf+=( --enable-precompiled-headers ) |
176 |
+ else |
177 |
+ myconf+=( --disable-precompiled-headers ) |
178 |
+ fi |
179 |
+ |
180 |
+ ( |
181 |
+ unset _JAVA_OPTIONS JAVA JAVAC XARGS |
182 |
+ CFLAGS= CXXFLAGS= LDFLAGS= \ |
183 |
+ CONFIG_SITE=/dev/null \ |
184 |
+ econf "${myconf[@]}" |
185 |
+ ) |
186 |
+} |
187 |
+ |
188 |
+src_compile() { |
189 |
+ emake -j1 \ |
190 |
+ $(usex jbootstrap bootcycle-images product-images) $(usex doc docs '') \ |
191 |
+ JOBS=$(makeopts_jobs) LOG=debug CFLAGS_WARNINGS_ARE_ERRORS= # No -Werror |
192 |
+} |
193 |
+ |
194 |
+src_install() { |
195 |
+ local dest="/usr/$(get_libdir)/${PN}-${SLOT}" |
196 |
+ local ddest="${ED}${dest#/}" |
197 |
+ |
198 |
+ cd "${S}"/build/*-release/images/jdk || die |
199 |
+ |
200 |
+ # Oracle and IcedTea have libjsoundalsa.so depending on |
201 |
+ # libasound.so.2 but OpenJDK only has libjsound.so. Weird. |
202 |
+ if ! use alsa ; then |
203 |
+ rm -v lib/libjsound.* || die |
204 |
+ fi |
205 |
+ |
206 |
+ if ! use examples ; then |
207 |
+ rm -vr demo/ || die |
208 |
+ fi |
209 |
+ |
210 |
+ if ! use source ; then |
211 |
+ rm -v lib/src.zip || die |
212 |
+ fi |
213 |
+ |
214 |
+ mv lib/security/cacerts lib/security/cacerts.orig || die |
215 |
+ |
216 |
+ dodir "${dest}" |
217 |
+ cp -pPR * "${ddest}" || die |
218 |
+ |
219 |
+ dosym "${EPREFIX}"/etc/ssl/certs/java/cacerts "${dest}"/lib/security/cacerts |
220 |
+ |
221 |
+ use gentoo-vm && java-vm_install-env "${FILESDIR}"/${PN}-${SLOT}.env.sh |
222 |
+ java-vm_set-pax-markings "${ddest}" |
223 |
+ java-vm_revdep-mask |
224 |
+ java-vm_sandbox-predict /dev/random /proc/self/coredump_filter |
225 |
+ |
226 |
+ if use doc ; then |
227 |
+ insinto /usr/share/doc/${PF}/html |
228 |
+ doins -r "${S}"/build/*-release/images/docs/* |
229 |
+ fi |
230 |
+} |
231 |
+ |
232 |
+pkg_postinst() { |
233 |
+ java-vm-2_pkg_postinst |
234 |
+ |
235 |
+ if use gentoo-vm ; then |
236 |
+ ewarn "WARNING! You have enabled the gentoo-vm USE flag, making this JDK" |
237 |
+ ewarn "recognised by the system. This will almost certainly break things." |
238 |
+ else |
239 |
+ ewarn "The experimental gentoo-vm USE flag has not been enabled so this JDK" |
240 |
+ ewarn "will not be recognised by the system. For example, simply calling" |
241 |
+ ewarn "\"java\" will launch a different JVM. This is necessary until Gentoo" |
242 |
+ ewarn "fully supports Java ${SLOT}. This JDK must therefore be invoked using its" |
243 |
+ ewarn "absolute location under ${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}." |
244 |
+ fi |
245 |
+} |