Line 0
Link Here
|
0 |
- |
1 |
# Copyright 1999-2019 Gentoo Authors |
|
|
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
|
4 |
# Build written by Andrew John Hughes (gnu_andrew@member.fsf.org) |
5 |
|
6 |
EAPI="6" |
7 |
SLOT="8" |
8 |
|
9 |
inherit check-reqs flag-o-matic gnome2-utils java-pkg-2 java-vm-2 multiprocessing pax-utils prefix versionator |
10 |
|
11 |
ICEDTEA_VER=$(get_version_component_range 1-3) |
12 |
ICEDTEA_BRANCH=$(get_version_component_range 1-2) |
13 |
ICEDTEA_PKG=icedtea-${ICEDTEA_VER} |
14 |
ICEDTEA_PRE=$(get_version_component_range _) |
15 |
|
16 |
CORBA_TARBALL="8249f00d6619.tar.xz" |
17 |
JAXP_TARBALL="a1b060ef4f06.tar.xz" |
18 |
JAXWS_TARBALL="c0f01861a7fd.tar.xz" |
19 |
JDK_TARBALL="6e67500d0ed8.tar.xz" |
20 |
LANGTOOLS_TARBALL="7036a6fa432e.tar.xz" |
21 |
OPENJDK_TARBALL="90de74e82bfb.tar.xz" |
22 |
NASHORN_TARBALL="6cf21321f367.tar.xz" |
23 |
HOTSPOT_TARBALL="4e4ead43a282.tar.xz" |
24 |
SHENANDOAH_TARBALL="bc4deb768b1d.tar.xz" |
25 |
AARCH32_TARBALL="f38b47a322eb.tar.xz" |
26 |
|
27 |
CACAO_TARBALL="cacao-c182f119eaad.tar.xz" |
28 |
JAMVM_TARBALL="jamvm-ec18fb9e49e62dce16c5094ef1527eed619463aa.tar.gz" |
29 |
|
30 |
CORBA_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-corba-${CORBA_TARBALL}" |
31 |
JAXP_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-jaxp-${JAXP_TARBALL}" |
32 |
JAXWS_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-jaxws-${JAXWS_TARBALL}" |
33 |
JDK_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-jdk-${JDK_TARBALL}" |
34 |
LANGTOOLS_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-langtools-${LANGTOOLS_TARBALL}" |
35 |
OPENJDK_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-openjdk-${OPENJDK_TARBALL}" |
36 |
NASHORN_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-nashorn-${NASHORN_TARBALL}" |
37 |
HOTSPOT_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-hotspot-${HOTSPOT_TARBALL}" |
38 |
SHENANDOAH_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-shenandoah-${SHENANDOAH_TARBALL}" |
39 |
AARCH32_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-aarch32-${AARCH32_TARBALL}" |
40 |
|
41 |
CACAO_GENTOO_TARBALL="icedtea-${CACAO_TARBALL}" |
42 |
JAMVM_GENTOO_TARBALL="icedtea-${JAMVM_TARBALL}" |
43 |
|
44 |
DROP_URL="http://icedtea.classpath.org/download/drops" |
45 |
ICEDTEA_URL="${DROP_URL}/icedtea${SLOT}/${ICEDTEA_VER}" |
46 |
|
47 |
DESCRIPTION="A harness to build OpenJDK using Free Software build tools and dependencies" |
48 |
HOMEPAGE="http://icedtea.classpath.org" |
49 |
SRC_PKG="${ICEDTEA_PKG}.tar.xz" |
50 |
SRC_URI=" |
51 |
http://icedtea.classpath.org/download/source/${SRC_PKG} |
52 |
${ICEDTEA_URL}/openjdk.tar.xz -> ${OPENJDK_GENTOO_TARBALL} |
53 |
${ICEDTEA_URL}/corba.tar.xz -> ${CORBA_GENTOO_TARBALL} |
54 |
${ICEDTEA_URL}/jaxp.tar.xz -> ${JAXP_GENTOO_TARBALL} |
55 |
${ICEDTEA_URL}/jaxws.tar.xz -> ${JAXWS_GENTOO_TARBALL} |
56 |
${ICEDTEA_URL}/jdk.tar.xz -> ${JDK_GENTOO_TARBALL} |
57 |
${ICEDTEA_URL}/hotspot.tar.xz -> ${HOTSPOT_GENTOO_TARBALL} |
58 |
${ICEDTEA_URL}/nashorn.tar.xz -> ${NASHORN_GENTOO_TARBALL} |
59 |
${ICEDTEA_URL}/langtools.tar.xz -> ${LANGTOOLS_GENTOO_TARBALL} |
60 |
shenandoah? ( ${ICEDTEA_URL}/shenandoah.tar.xz -> ${SHENANDOAH_GENTOO_TARBALL} ) |
61 |
arm? ( ${ICEDTEA_URL}/aarch32.tar.xz -> ${AARCH32_GENTOO_TARBALL} ) |
62 |
${DROP_URL}/cacao/${CACAO_TARBALL} -> ${CACAO_GENTOO_TARBALL} |
63 |
${DROP_URL}/jamvm/${JAMVM_TARBALL} -> ${JAMVM_GENTOO_TARBALL}" |
64 |
|
65 |
LICENSE="Apache-1.1 Apache-2.0 GPL-1 GPL-2 GPL-2-with-linking-exception LGPL-2 MPL-1.0 MPL-1.1 public-domain W3C" |
66 |
KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86" |
67 |
|
68 |
IUSE="+alsa cacao +cups doc examples +gtk headless-awt |
69 |
jamvm +jbootstrap kerberos libressl nsplugin pax_kernel +pch |
70 |
pulseaudio sctp selinux shenandoah smartcard +source +sunec +system-lcms test +webstart zero" |
71 |
|
72 |
REQUIRED_USE="gtk? ( !headless-awt )" |
73 |
|
74 |
# Ideally the following were optional at build time. |
75 |
ALSA_COMMON_DEP=" |
76 |
>=media-libs/alsa-lib-1.0" |
77 |
CUPS_COMMON_DEP=" |
78 |
>=net-print/cups-1.2.12" |
79 |
X_COMMON_DEP=" |
80 |
>=media-libs/giflib-4.1.6:0= |
81 |
>=media-libs/libpng-1.2:0= |
82 |
>=x11-libs/libX11-1.1.3 |
83 |
>=x11-libs/libXext-1.1.1 |
84 |
>=x11-libs/libXi-1.1.3 |
85 |
>=x11-libs/libXrender-0.9.4 |
86 |
>=x11-libs/libXtst-1.0.3 |
87 |
x11-libs/libXcomposite" |
88 |
X_DEPEND=" |
89 |
x11-base/xorg-proto |
90 |
>=x11-libs/libXau-1.0.3 |
91 |
>=x11-libs/libXdmcp-1.0.2 |
92 |
>=x11-libs/libXinerama-1.0.2" |
93 |
|
94 |
# The Javascript requirement is obsolete; OpenJDK 8+ has Nashorn |
95 |
COMMON_DEP=" |
96 |
>=dev-libs/glib-2.26:2= |
97 |
>=dev-util/systemtap-1 |
98 |
media-libs/fontconfig:1.0= |
99 |
>=media-libs/freetype-2.5.3:2= |
100 |
>=sys-libs/zlib-1.2.3 |
101 |
virtual/jpeg:0= |
102 |
kerberos? ( virtual/krb5 ) |
103 |
sctp? ( net-misc/lksctp-tools ) |
104 |
smartcard? ( sys-apps/pcsc-lite ) |
105 |
sunec? ( >=dev-libs/nss-3.16.1-r1 ) |
106 |
system-lcms? ( >=media-libs/lcms-2.9:2= )" |
107 |
|
108 |
# Gtk+ will move to COMMON_DEP in time; PR1982 |
109 |
# gsettings-desktop-schemas will be needed for native proxy support; PR1976 |
110 |
RDEPEND="${COMMON_DEP} |
111 |
!dev-java/icedtea:0 |
112 |
!dev-java/icedtea-web:7 |
113 |
>=gnome-base/gsettings-desktop-schemas-3.12.2 |
114 |
virtual/ttf-fonts |
115 |
alsa? ( ${ALSA_COMMON_DEP} ) |
116 |
cups? ( ${CUPS_COMMON_DEP} ) |
117 |
gtk? ( |
118 |
>=dev-libs/atk-1.30.0 |
119 |
>=x11-libs/cairo-1.8.8 |
120 |
x11-libs/gdk-pixbuf:2 |
121 |
>=x11-libs/gtk+-2.8:2 |
122 |
>=x11-libs/pango-1.24.5 |
123 |
) |
124 |
!headless-awt? ( ${X_COMMON_DEP} ) |
125 |
selinux? ( sec-policy/selinux-java )" |
126 |
|
127 |
# ca-certificates, perl and openssl are used for the cacerts keystore generation |
128 |
# perl is needed for running the SystemTap tests and the bootstrap javac |
129 |
# lsb-release is used to obtain distro information for the version & crash dump output |
130 |
# attr is needed for xattr.h which defines the extended attribute syscalls used by NIO2 |
131 |
# x11-libs/libXt is needed for headers only (Intrinsic.h, IntrinsicP.h, Shell.h, StringDefs.h) |
132 |
# Ant is no longer needed under the new build system |
133 |
DEPEND="${COMMON_DEP} ${ALSA_COMMON_DEP} ${CUPS_COMMON_DEP} ${X_COMMON_DEP} ${X_DEPEND} |
134 |
|| ( |
135 |
dev-java/icedtea-bin:8 |
136 |
dev-java/icedtea:8 |
137 |
) |
138 |
app-arch/cpio |
139 |
app-arch/unzip |
140 |
app-arch/zip |
141 |
app-misc/ca-certificates |
142 |
dev-lang/perl |
143 |
!libressl? ( dev-libs/openssl:0 ) |
144 |
libressl? ( dev-libs/libressl:0 ) |
145 |
sys-apps/attr |
146 |
sys-apps/lsb-release |
147 |
x11-libs/libXt |
148 |
virtual/pkgconfig |
149 |
pax_kernel? ( sys-apps/elfix )" |
150 |
|
151 |
PDEPEND="webstart? ( >=dev-java/icedtea-web-1.6.1:0 ) |
152 |
nsplugin? ( >=dev-java/icedtea-web-1.6.1:0[nsplugin] ) |
153 |
pulseaudio? ( dev-java/icedtea-sound )" |
154 |
|
155 |
S="${WORKDIR}"/${ICEDTEA_PKG} |
156 |
|
157 |
icedtea_check_requirements() { |
158 |
local CHECKREQS_DISK_BUILD |
159 |
|
160 |
if use doc; then |
161 |
CHECKREQS_DISK_BUILD="9000M" |
162 |
else |
163 |
CHECKREQS_DISK_BUILD="8500M" |
164 |
fi |
165 |
|
166 |
check-reqs_pkg_${EBUILD_PHASE} |
167 |
} |
168 |
|
169 |
pkg_pretend() { |
170 |
icedtea_check_requirements |
171 |
} |
172 |
|
173 |
pkg_setup() { |
174 |
icedtea_check_requirements |
175 |
|
176 |
JAVA_PKG_WANT_BUILD_VM=" |
177 |
icedtea-8 icedtea-bin-8 |
178 |
icedtea-7 icedtea-bin-7" |
179 |
JAVA_PKG_WANT_SOURCE="1.5" |
180 |
JAVA_PKG_WANT_TARGET="1.5" |
181 |
|
182 |
java-vm-2_pkg_setup |
183 |
java-pkg-2_pkg_setup |
184 |
} |
185 |
|
186 |
src_unpack() { |
187 |
unpack ${SRC_PKG} |
188 |
} |
189 |
|
190 |
src_configure() { |
191 |
# For bootstrap builds as the sandbox control file might not yet exist. |
192 |
addpredict /proc/self/coredump_filter |
193 |
|
194 |
# icedtea doesn't like some locales. #330433 #389717 |
195 |
export LANG="C" LC_ALL="C" |
196 |
|
197 |
local cacao_config config hotspot_port hs_config jamvm_config use_cacao use_jamvm use_zero zero_config |
198 |
local vm=$(java-pkg_get-current-vm) |
199 |
|
200 |
# gcj-jdk ensures ecj is present. |
201 |
if use jbootstrap || has "${vm}" gcj-jdk; then |
202 |
use jbootstrap || einfo "bootstrap is necessary when building with ${vm}, ignoring USE=\"-jbootstrap\"" |
203 |
config+=" --enable-bootstrap" |
204 |
else |
205 |
config+=" --disable-bootstrap" |
206 |
fi |
207 |
|
208 |
# Use Zero if requested |
209 |
if use zero; then |
210 |
use_zero="yes" |
211 |
fi |
212 |
|
213 |
# Use JamVM if requested |
214 |
if use jamvm; then |
215 |
use_jamvm="yes" |
216 |
fi |
217 |
|
218 |
# Use CACAO if requested |
219 |
if use cacao; then |
220 |
use_cacao="yes" |
221 |
fi |
222 |
|
223 |
# Are we on a architecture with a HotSpot port? |
224 |
# In-tree JIT ports are available for amd64, arm, arm64, ppc64 (be&le), SPARC and x86. |
225 |
if { use amd64 || use arm || use arm64 || use ppc64 || use sparc || use x86; }; then |
226 |
hotspot_port="yes" |
227 |
|
228 |
# Work around stack alignment issue, bug #647954. |
229 |
use x86 && append-flags -mincoming-stack-boundary=2 |
230 |
fi |
231 |
|
232 |
# Always use HotSpot as the primary VM if available. #389521 #368669 #357633 ... |
233 |
# Otherwise use Zero for now until alternate VMs are working |
234 |
if test "x${hotspot_port}" != "xyes"; then |
235 |
use_zero="yes" |
236 |
fi |
237 |
|
238 |
if use shenandoah; then |
239 |
if { use amd64 || use arm64; }; then |
240 |
hs_config="--with-hotspot-build=shenandoah" |
241 |
hs_config+=" --with-hotspot-src-zip="${DISTDIR}/${SHENANDOAH_GENTOO_TARBALL}"" |
242 |
else |
243 |
eerror "Shenandoah is only supported on arm64 and x86_64. Please re-build with USE="-shenandoah"" |
244 |
fi |
245 |
else |
246 |
if use arm ; then |
247 |
hs_config="--with-hotspot-src-zip="${DISTDIR}/${AARCH32_GENTOO_TARBALL}"" |
248 |
else |
249 |
hs_config="--with-hotspot-src-zip="${DISTDIR}/${HOTSPOT_GENTOO_TARBALL}"" |
250 |
fi |
251 |
fi |
252 |
|
253 |
# Turn on JamVM if needed (non-HS archs) or requested |
254 |
if test "x${use_jamvm}" = "xyes"; then |
255 |
if test "x${hotspot_port}" = "xyes"; then |
256 |
ewarn 'Enabling JamVM on an architecture with HotSpot support; issues may result.' |
257 |
ewarn 'If so, please rebuild with USE="-jamvm"' |
258 |
fi |
259 |
ewarn 'JamVM is known to still have issues with IcedTea 3.x; please rebuild with USE="-jamvm"' |
260 |
jamvm_config="--enable-jamvm" |
261 |
fi |
262 |
|
263 |
# Turn on CACAO if needed (non-HS archs) or requested |
264 |
if test "x${use_cacao}" = "xyes"; then |
265 |
if test "x${hotspot_port}" = "xyes"; then |
266 |
ewarn 'Enabling CACAO on an architecture with HotSpot support; issues may result.' |
267 |
ewarn 'If so, please rebuild with USE="-cacao"' |
268 |
fi |
269 |
ewarn 'CACAO is known to still have issues with IcedTea 3.x; please rebuild with USE="-cacao"' |
270 |
cacao_config="--enable-cacao" |
271 |
fi |
272 |
|
273 |
# Turn on Zero if needed (non-HS/CACAO archs) or requested |
274 |
if test "x${use_zero}" = "xyes"; then |
275 |
if test "x${hotspot_port}" = "xyes"; then |
276 |
ewarn 'Enabling Zero on an architecture with HotSpot support; performance will be significantly reduced.' |
277 |
fi |
278 |
zero_config="--enable-zero" |
279 |
fi |
280 |
|
281 |
# PaX breaks pch, bug #601016 |
282 |
if use pch && ! host-is-pax; then |
283 |
config+=" --enable-precompiled-headers" |
284 |
else |
285 |
config+=" --disable-precompiled-headers" |
286 |
fi |
287 |
|
288 |
config+=" --with-parallel-jobs=$(makeopts_jobs)" |
289 |
|
290 |
unset JAVA_HOME JDK_HOME CLASSPATH JAVAC JAVACFLAGS |
291 |
|
292 |
econf ${config} \ |
293 |
--with-openjdk-src-zip="${DISTDIR}/${OPENJDK_GENTOO_TARBALL}" \ |
294 |
--with-corba-src-zip="${DISTDIR}/${CORBA_GENTOO_TARBALL}" \ |
295 |
--with-jaxp-src-zip="${DISTDIR}/${JAXP_GENTOO_TARBALL}" \ |
296 |
--with-jaxws-src-zip="${DISTDIR}/${JAXWS_GENTOO_TARBALL}" \ |
297 |
--with-jdk-src-zip="${DISTDIR}/${JDK_GENTOO_TARBALL}" \ |
298 |
--with-langtools-src-zip="${DISTDIR}/${LANGTOOLS_GENTOO_TARBALL}" \ |
299 |
--with-nashorn-src-zip="${DISTDIR}/${NASHORN_GENTOO_TARBALL}" \ |
300 |
--with-cacao-src-zip="${DISTDIR}/${CACAO_GENTOO_TARBALL}" \ |
301 |
--with-jamvm-src-zip="${DISTDIR}/${JAMVM_GENTOO_TARBALL}" \ |
302 |
--with-jdk-home="$(java-config -O)" \ |
303 |
--prefix="${EPREFIX}/usr/$(get_libdir)/icedtea${SLOT}" \ |
304 |
--mandir="${EPREFIX}/usr/$(get_libdir)/icedtea${SLOT}/man" \ |
305 |
--docdir="${EPREFIX}/usr/share/doc/${PF}" \ |
306 |
--htmldir="${EPREFIX}/usr/share/doc/${PF}/html" \ |
307 |
--with-pkgversion="Gentoo ${PF}" \ |
308 |
--disable-ccache \ |
309 |
--disable-downloading --disable-Werror --disable-tests \ |
310 |
--disable-systemtap-tests --enable-improved-font-rendering \ |
311 |
--enable-system-jpeg --enable-system-zlib \ |
312 |
$(use_enable headless-awt headless) \ |
313 |
$(use_enable !headless-awt system-gif) \ |
314 |
$(use_enable !headless-awt system-png) \ |
315 |
$(use_enable doc docs) \ |
316 |
$(use_enable kerberos system-kerberos) \ |
317 |
$(use_enable system-lcms) \ |
318 |
$(use_with pax_kernel pax "${EPREFIX}/usr/sbin/paxmark.sh") \ |
319 |
$(use_enable sctp system-sctp) \ |
320 |
$(use_enable smartcard system-pcsc) \ |
321 |
$(use_enable sunec) \ |
322 |
${zero_config} ${cacao_config} ${jamvm_config} ${hs_config} |
323 |
} |
324 |
|
325 |
src_compile() { |
326 |
default |
327 |
} |
328 |
|
329 |
src_test() { |
330 |
default |
331 |
} |
332 |
|
333 |
src_install() { |
334 |
default |
335 |
|
336 |
local dest="/usr/$(get_libdir)/icedtea${SLOT}" |
337 |
local ddest="${ED}${dest#/}" |
338 |
|
339 |
if ! use alsa; then |
340 |
rm -v "${ddest}"/jre/lib/$(get_system_arch)/libjsoundalsa.* || die |
341 |
fi |
342 |
|
343 |
if ! use examples; then |
344 |
rm -r "${ddest}"/demo "${ddest}"/sample || die |
345 |
fi |
346 |
|
347 |
if ! use source; then |
348 |
rm -v "${ddest}"/src.zip || die |
349 |
fi |
350 |
|
351 |
# Fix the permissions. |
352 |
find "${ddest}" \! -type l \( -perm /111 -exec chmod 755 {} \; -o -exec chmod 644 {} \; \) || die |
353 |
|
354 |
# We need to generate keystore - bug #273306 |
355 |
einfo "Generating cacerts file from certificates in ${EPREFIX}/usr/share/ca-certificates/" |
356 |
mkdir "${T}/certgen" && cd "${T}/certgen" || die |
357 |
cp "${FILESDIR}/generate-cacerts.pl" . && chmod +x generate-cacerts.pl || die |
358 |
for c in "${EPREFIX}"/usr/share/ca-certificates/*/*.crt; do |
359 |
openssl x509 -text -in "${c}" >> all.crt || die |
360 |
done |
361 |
./generate-cacerts.pl "${ddest}/bin/keytool" all.crt || die |
362 |
cp -vRP cacerts "${ddest}/jre/lib/security/" || die |
363 |
chmod 644 "${ddest}/jre/lib/security/cacerts" || die |
364 |
|
365 |
java-vm_install-env "${FILESDIR}/icedtea.env.sh" |
366 |
java-vm_sandbox-predict /proc/self/coredump_filter |
367 |
} |
368 |
|
369 |
pkg_preinst() { |
370 |
# From 3.4.0 onwards, the arm directory is a symlink to the aarch32 |
371 |
# directory. We need to clear the old directory for a clean upgrade. |
372 |
if use arm; then |
373 |
local dir |
374 |
for dir in "${EROOT}usr/$(get_libdir)/icedtea${SLOT}"/{lib,jre/lib}/arm; do |
375 |
if [[ -d ${dir} && ! -L ${dir} ]]; then |
376 |
rm -r "${dir}" || die |
377 |
fi |
378 |
done |
379 |
fi |
380 |
|
381 |
gnome2_icon_savelist |
382 |
} |
383 |
|
384 |
pkg_postinst() { |
385 |
gnome2_icon_cache_update |
386 |
java-vm-2_pkg_postinst |
387 |
} |
388 |
|
389 |
pkg_postrm() { |
390 |
gnome2_icon_cache_update |
391 |
java-vm-2_pkg_postrm |
392 |
} |