1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 # Build written by Andrew John Hughes (gnu_andrew@member.fsf.org)
6 # *********************************************************
7 # * IF YOU CHANGE THIS EBUILD, CHANGE ICEDTEA-6.* AS WELL *
8 # *********************************************************
13 inherit check-reqs flag-o-matic java-pkg-2 java-vm-2 multiprocessing pax-utils prefix versionator xdg-utils
15 ICEDTEA_VER=$(get_version_component_range 1-3)
16 ICEDTEA_BRANCH=$(get_version_component_range 1-2)
17 ICEDTEA_PKG=icedtea-${ICEDTEA_VER}
18 ICEDTEA_PRE=$(get_version_component_range _)
20 CORBA_TARBALL="a37140ba122d.tar.xz"
21 JAXP_TARBALL="9f2145980ba0.tar.xz"
22 JAXWS_TARBALL="af5760dceec0.tar.xz"
23 JDK_TARBALL="ce6c8c2cad27.tar.xz"
24 LANGTOOLS_TARBALL="ccec65feaaac.tar.xz"
25 OPENJDK_TARBALL="454c6cbb8073.tar.xz"
26 NASHORN_TARBALL="13722b4babad.tar.xz"
27 HOTSPOT_TARBALL="4ccc1ae03940.tar.xz"
28 SHENANDOAH_TARBALL="9e52f8d3b511.tar.xz"
29 AARCH32_TARBALL="0d7b61c79fee.tar.xz"
31 CACAO_TARBALL="cacao-c182f119eaad.tar.xz"
32 JAMVM_TARBALL="jamvm-ec18fb9e49e62dce16c5094ef1527eed619463aa.tar.gz"
34 CORBA_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-corba-${CORBA_TARBALL}"
35 JAXP_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-jaxp-${JAXP_TARBALL}"
36 JAXWS_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-jaxws-${JAXWS_TARBALL}"
37 JDK_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-jdk-${JDK_TARBALL}"
38 LANGTOOLS_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-langtools-${LANGTOOLS_TARBALL}"
39 OPENJDK_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-openjdk-${OPENJDK_TARBALL}"
40 NASHORN_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-nashorn-${NASHORN_TARBALL}"
41 HOTSPOT_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-hotspot-${HOTSPOT_TARBALL}"
42 SHENANDOAH_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-shenandoah-${SHENANDOAH_TARBALL}"
43 AARCH32_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-aarch32-${AARCH32_TARBALL}"
45 CACAO_GENTOO_TARBALL="icedtea-${CACAO_TARBALL}"
46 JAMVM_GENTOO_TARBALL="icedtea-${JAMVM_TARBALL}"
48 DROP_URL="https://icedtea.classpath.org/download/drops"
49 ICEDTEA_URL="${DROP_URL}/icedtea${SLOT}/${ICEDTEA_VER}"
51 DESCRIPTION="A harness to build OpenJDK using Free Software build tools and dependencies"
52 HOMEPAGE="https://icedtea.classpath.org"
53 SRC_PKG="${ICEDTEA_PKG}.tar.xz"
55 https://icedtea.classpath.org/download/source/${SRC_PKG}
56 ${ICEDTEA_URL}/openjdk.tar.xz -> ${OPENJDK_GENTOO_TARBALL}
57 ${ICEDTEA_URL}/corba.tar.xz -> ${CORBA_GENTOO_TARBALL}
58 ${ICEDTEA_URL}/jaxp.tar.xz -> ${JAXP_GENTOO_TARBALL}
59 ${ICEDTEA_URL}/jaxws.tar.xz -> ${JAXWS_GENTOO_TARBALL}
60 ${ICEDTEA_URL}/jdk.tar.xz -> ${JDK_GENTOO_TARBALL}
61 ${ICEDTEA_URL}/hotspot.tar.xz -> ${HOTSPOT_GENTOO_TARBALL}
62 ${ICEDTEA_URL}/nashorn.tar.xz -> ${NASHORN_GENTOO_TARBALL}
63 ${ICEDTEA_URL}/langtools.tar.xz -> ${LANGTOOLS_GENTOO_TARBALL}
64 shenandoah? ( ${ICEDTEA_URL}/shenandoah.tar.xz -> ${SHENANDOAH_GENTOO_TARBALL} )
65 arm? ( ${ICEDTEA_URL}/aarch32.tar.xz -> ${AARCH32_GENTOO_TARBALL} )
66 ${DROP_URL}/cacao/${CACAO_TARBALL} -> ${CACAO_GENTOO_TARBALL}
67 ${DROP_URL}/jamvm/${JAMVM_TARBALL} -> ${JAMVM_GENTOO_TARBALL}"
69 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"
70 KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
72 IUSE="+alsa cacao +cups doc examples +gtk headless-awt
73 jamvm +jbootstrap kerberos libressl nsplugin pax_kernel +pch
74 pulseaudio sctp selinux shenandoah smartcard +source +system-lcms test +webstart zero"
76 REQUIRED_USE="gtk? ( !headless-awt )"
78 # Ideally the following were optional at build time.
80 >=media-libs/alsa-lib-1.0"
82 >=net-print/cups-1.2.12"
84 >=media-libs/giflib-4.1.6:0=
85 >=media-libs/libpng-1.2:0=
86 >=x11-libs/libX11-1.1.3
87 >=x11-libs/libXext-1.1.1
88 >=x11-libs/libXi-1.1.3
89 >=x11-libs/libXrender-0.9.4
90 >=x11-libs/libXtst-1.0.3
91 x11-libs/libXcomposite"
94 >=x11-libs/libXau-1.0.3
95 >=x11-libs/libXdmcp-1.0.2
96 >=x11-libs/libXinerama-1.0.2"
98 # The Javascript requirement is obsolete; OpenJDK 8+ has Nashorn
100 >=dev-libs/glib-2.26:2=
101 >=dev-util/systemtap-1
102 media-libs/fontconfig:1.0=
103 >=media-libs/freetype-2.5.3:2=
104 >=sys-libs/zlib-1.2.3
106 kerberos? ( virtual/krb5 )
107 sctp? ( net-misc/lksctp-tools )
108 smartcard? ( sys-apps/pcsc-lite )
109 system-lcms? ( >=media-libs/lcms-2.9:2= )"
111 # Gtk+ will move to COMMON_DEP in time; PR1982
112 # gsettings-desktop-schemas will be needed for native proxy support; PR1976
113 RDEPEND="${COMMON_DEP}
115 !dev-java/icedtea-web:7
116 >=gnome-base/gsettings-desktop-schemas-3.12.2
117 >=sys-apps/baselayout-java-0.1.0-r1
119 alsa? ( ${ALSA_COMMON_DEP} )
120 cups? ( ${CUPS_COMMON_DEP} )
122 >=dev-libs/atk-1.30.0
123 >=x11-libs/cairo-1.8.8
124 x11-libs/gdk-pixbuf:2
125 >=x11-libs/gtk+-2.8:2
126 >=x11-libs/pango-1.24.5
128 !headless-awt? ( ${X_COMMON_DEP} )
129 selinux? ( sec-policy/selinux-java )"
131 # ca-certificates, perl and openssl are used for the cacerts keystore generation
132 # perl is needed for running the SystemTap tests and the bootstrap javac
133 # lsb-release is used to obtain distro information for the version & crash dump output
134 # attr is needed for xattr.h which defines the extended attribute syscalls used by NIO2
135 # x11-libs/libXt is needed for headers only (Intrinsic.h, IntrinsicP.h, Shell.h, StringDefs.h)
136 # Ant is no longer needed under the new build system
137 DEPEND="${COMMON_DEP} ${ALSA_COMMON_DEP} ${CUPS_COMMON_DEP} ${X_COMMON_DEP} ${X_DEPEND}
139 dev-java/icedtea-bin:8
142 dev-java/openjdk-bin:8
147 app-misc/ca-certificates
149 !libressl? ( dev-libs/openssl:0 )
150 libressl? ( dev-libs/libressl:0 )
155 pax_kernel? ( sys-apps/elfix )"
157 PDEPEND="webstart? ( >=dev-java/icedtea-web-1.6.1:0 )
158 nsplugin? ( >=dev-java/icedtea-web-1.6.1:0[nsplugin] )
159 pulseaudio? ( dev-java/icedtea-sound )"
161 S="${WORKDIR}"/${ICEDTEA_PKG}
163 icedtea_check_requirements() {
164 local CHECKREQS_DISK_BUILD
167 CHECKREQS_DISK_BUILD="9000M"
169 CHECKREQS_DISK_BUILD="8500M"
172 check-reqs_pkg_${EBUILD_PHASE}
176 icedtea_check_requirements
180 icedtea_check_requirements
182 JAVA_PKG_WANT_BUILD_VM="
183 icedtea-8 icedtea-bin-8
184 openjdk-8 openjdk-bin-8"
185 JAVA_PKG_WANT_SOURCE="1.5"
186 JAVA_PKG_WANT_TARGET="1.5"
197 # For bootstrap builds as the sandbox control file might not yet exist.
198 addpredict /proc/self/coredump_filter
200 # icedtea doesn't like some locales. #330433 #389717
201 export LANG="C" LC_ALL="C"
203 local cacao_config config hotspot_port hs_config jamvm_config use_cacao use_jamvm use_zero zero_config
204 local vm=$(java-pkg_get-current-vm)
206 # gcj-jdk ensures ecj is present.
207 if use jbootstrap || has "${vm}" gcj-jdk; then
208 use jbootstrap || einfo "bootstrap is necessary when building with ${vm}, ignoring USE=\"-jbootstrap\""
209 config+=" --enable-bootstrap"
211 config+=" --disable-bootstrap"
214 # Use Zero if requested
219 # Use JamVM if requested
224 # Use CACAO if requested
229 # Are we on a architecture with a HotSpot port?
230 # In-tree JIT ports are available for amd64, arm, arm64, ppc64 (be&le), SPARC and x86.
231 if { use amd64 || use arm || use arm64 || use ppc64 || use sparc || use x86; }; then
233 # Work around stack alignment issue, bug #647954.
234 use x86 && append-flags -mincoming-stack-boundary=2
237 # Always use HotSpot as the primary VM if available. #389521 #368669 #357633 ...
238 # Otherwise use Zero for now until alternate VMs are working
239 if test "x${hotspot_port}" != "xyes"; then
243 if use shenandoah; then
244 if { use amd64 || use arm64; }; then
245 hs_config="--with-hotspot-build=shenandoah"
246 hs_config+=" --with-hotspot-src-zip="${DISTDIR}/${SHENANDOAH_GENTOO_TARBALL}""
248 eerror "Shenandoah is only supported on arm64 and x86_64. Please re-build with USE="-shenandoah""
252 hs_config="--with-hotspot-src-zip="${DISTDIR}/${AARCH32_GENTOO_TARBALL}""
254 hs_config="--with-hotspot-src-zip="${DISTDIR}/${HOTSPOT_GENTOO_TARBALL}""
258 # Turn on JamVM if needed (non-HS archs) or requested
259 if test "x${use_jamvm}" = "xyes"; then
260 if test "x${hotspot_port}" = "xyes"; then
261 ewarn 'Enabling JamVM on an architecture with HotSpot support; issues may result.'
262 ewarn 'If so, please rebuild with USE="-jamvm"'
264 ewarn 'JamVM is known to still have issues with IcedTea 3.x; please rebuild with USE="-jamvm"'
265 jamvm_config="--enable-jamvm"
268 # Turn on CACAO if needed (non-HS archs) or requested
269 if test "x${use_cacao}" = "xyes"; then
270 if test "x${hotspot_port}" = "xyes"; then
271 ewarn 'Enabling CACAO on an architecture with HotSpot support; issues may result.'
272 ewarn 'If so, please rebuild with USE="-cacao"'
274 ewarn 'CACAO is known to still have issues with IcedTea 3.x; please rebuild with USE="-cacao"'
275 cacao_config="--enable-cacao"
278 # Turn on Zero if needed (non-HS/CACAO archs) or requested
279 if test "x${use_zero}" = "xyes"; then
280 if test "x${hotspot_port}" = "xyes"; then
281 ewarn 'Enabling Zero on an architecture with HotSpot support; performance will be significantly reduced.'
283 zero_config="--enable-zero"
286 # PaX breaks pch, bug #601016
287 if use pch && ! host-is-pax; then
288 config+=" --enable-precompiled-headers"
290 config+=" --disable-precompiled-headers"
293 config+=" --with-parallel-jobs=$(makeopts_jobs)"
295 unset JAVA_HOME JDK_HOME CLASSPATH JAVAC JAVACFLAGS
298 --with-openjdk-src-zip="${DISTDIR}/${OPENJDK_GENTOO_TARBALL}" \
299 --with-corba-src-zip="${DISTDIR}/${CORBA_GENTOO_TARBALL}" \
300 --with-jaxp-src-zip="${DISTDIR}/${JAXP_GENTOO_TARBALL}" \
301 --with-jaxws-src-zip="${DISTDIR}/${JAXWS_GENTOO_TARBALL}" \
302 --with-jdk-src-zip="${DISTDIR}/${JDK_GENTOO_TARBALL}" \
303 --with-langtools-src-zip="${DISTDIR}/${LANGTOOLS_GENTOO_TARBALL}" \
304 --with-nashorn-src-zip="${DISTDIR}/${NASHORN_GENTOO_TARBALL}" \
305 --with-cacao-src-zip="${DISTDIR}/${CACAO_GENTOO_TARBALL}" \
306 --with-jamvm-src-zip="${DISTDIR}/${JAMVM_GENTOO_TARBALL}" \
307 --with-jdk-home="$(java-config -O)" \
308 --prefix="${EPREFIX}/usr/$(get_libdir)/icedtea${SLOT}" \
309 --mandir="${EPREFIX}/usr/$(get_libdir)/icedtea${SLOT}/man" \
310 --docdir="${EPREFIX}/usr/share/doc/${PF}" \
311 --htmldir="${EPREFIX}/usr/share/doc/${PF}/html" \
312 --with-pkgversion="Gentoo ${PF}" \
314 --disable-downloading --disable-Werror --disable-tests \
315 --disable-systemtap-tests --enable-improved-font-rendering \
316 --enable-system-jpeg --enable-system-zlib \
317 $(use_enable headless-awt headless) \
318 $(use_enable !headless-awt system-gif) \
319 $(use_enable !headless-awt system-png) \
320 $(use_enable doc docs) \
321 $(use_enable kerberos system-kerberos) \
322 $(use_enable system-lcms) \
323 $(use_with pax_kernel pax "${EPREFIX}/usr/sbin/paxmark.sh") \
324 $(use_enable sctp system-sctp) \
325 $(use_enable smartcard system-pcsc) \
326 ${zero_config} ${cacao_config} ${jamvm_config} ${hs_config}
340 local dest="/usr/$(get_libdir)/icedtea${SLOT}"
341 local ddest="${ED}${dest#/}"
344 rm -v "${ddest}"/jre/lib/$(get_system_arch)/libjsoundalsa.* || die
347 if ! use examples; then
348 rm -r "${ddest}"/demo "${ddest}"/sample || die
351 if ! use source; then
352 rm -v "${ddest}"/src.zip || die
355 dosym /usr/share/doc/${PF} /usr/share/doc/${PN}${SLOT}
357 # Fix the permissions.
358 find "${ddest}" \! -type l \( -perm /111 -exec chmod 755 {} \; -o -exec chmod 644 {} \; \) || die
360 dosym "${EPREFIX}"/etc/ssl/certs/java/cacerts "${dest}"/jre/lib/security/cacerts
362 java-vm_install-env "${FILESDIR}/icedtea.env.sh"
363 java-vm_sandbox-predict /proc/self/coredump_filter
367 xdg_icon_cache_update
368 java-vm-2_pkg_postinst
372 xdg_icon_cache_update