1 # Copyright 1999-2014 Gentoo Foundation |
|
2 # Distributed under the terms of the GNU General Public License v2 |
|
3 # $Header: /var/cvsroot/gentoo-x86/dev-java/icedtea/icedtea-7.2.4.5.ebuild,v 1.1 2014/02/03 08:49:54 sera Exp $ |
|
4 # Build written by Andrew John Hughes (gnu_andrew@member.fsf.org) |
|
5 |
|
6 # ********************************************************* |
|
7 # * IF YOU CHANGE THIS EBUILD, CHANGE ICEDTEA-6.* AS WELL * |
|
8 # ********************************************************* |
|
9 |
|
10 EAPI="5" |
|
11 |
|
12 inherit java-pkg-2 java-vm-2 pax-utils prefix versionator virtualx |
|
13 |
|
14 ICEDTEA_VER=$(get_version_component_range 2-) |
|
15 ICEDTEA_BRANCH=$(get_version_component_range 2-3) |
|
16 ICEDTEA_PKG=icedtea-${ICEDTEA_VER} |
|
17 CORBA_TARBALL="3594dbde270d.tar.gz" |
|
18 JAXP_TARBALL="8fe156ad49e2.tar.gz" |
|
19 JAXWS_TARBALL="32ea8b1ed91a.tar.gz" |
|
20 JDK_TARBALL="9db88c18e114.tar.gz" |
|
21 LANGTOOLS_TARBALL="dabd37b7e295.tar.gz" |
|
22 OPENJDK_TARBALL="410eb7fef869.tar.gz" |
|
23 HOTSPOT_TARBALL="2cb58882dac3.tar.gz" |
|
24 CACAO_TARBALL="e215e36be9fc.tar.gz" |
|
25 JAMVM_TARBALL="jamvm-ac22c9948434e528ece451642b4ebde40953ee7e.tar.gz" |
|
26 |
|
27 CORBA_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-corba-${CORBA_TARBALL}" |
|
28 JAXP_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-jaxp-${JAXP_TARBALL}" |
|
29 JAXWS_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-jaxws-${JAXWS_TARBALL}" |
|
30 JDK_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-jdk-${JDK_TARBALL}" |
|
31 LANGTOOLS_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-langtools-${LANGTOOLS_TARBALL}" |
|
32 OPENJDK_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-openjdk-${OPENJDK_TARBALL}" |
|
33 HOTSPOT_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-hotspot-${HOTSPOT_TARBALL}" |
|
34 CACAO_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-cacao-${CACAO_TARBALL}" |
|
35 JAMVM_GENTOO_TARBALL="icedtea-${ICEDTEA_BRANCH}-${JAMVM_TARBALL}" |
|
36 |
|
37 DESCRIPTION="A harness to build OpenJDK using Free Software build tools and dependencies" |
|
38 HOMEPAGE="http://icedtea.classpath.org" |
|
39 SRC_PKG="${ICEDTEA_PKG}.tar.xz" |
|
40 SRC_URI=" |
|
41 http://icedtea.classpath.org/download/source/${SRC_PKG} |
|
42 http://icedtea.classpath.org/hg/release/icedtea7-forest-${ICEDTEA_BRANCH}/archive/${OPENJDK_TARBALL} |
|
43 -> ${OPENJDK_GENTOO_TARBALL} |
|
44 http://icedtea.classpath.org/hg/release/icedtea7-forest-${ICEDTEA_BRANCH}/corba/archive/${CORBA_TARBALL} |
|
45 -> ${CORBA_GENTOO_TARBALL} |
|
46 http://icedtea.classpath.org/hg/release/icedtea7-forest-${ICEDTEA_BRANCH}/jaxp/archive/${JAXP_TARBALL} |
|
47 -> ${JAXP_GENTOO_TARBALL} |
|
48 http://icedtea.classpath.org/hg/release/icedtea7-forest-${ICEDTEA_BRANCH}/jaxws/archive/${JAXWS_TARBALL} |
|
49 -> ${JAXWS_GENTOO_TARBALL} |
|
50 http://icedtea.classpath.org/hg/release/icedtea7-forest-${ICEDTEA_BRANCH}/jdk/archive/${JDK_TARBALL} |
|
51 -> ${JDK_GENTOO_TARBALL} |
|
52 http://icedtea.classpath.org/hg/release/icedtea7-forest-${ICEDTEA_BRANCH}/hotspot/archive/${HOTSPOT_TARBALL} |
|
53 -> ${HOTSPOT_GENTOO_TARBALL} |
|
54 http://icedtea.classpath.org/hg/release/icedtea7-forest-${ICEDTEA_BRANCH}/langtools/archive/${LANGTOOLS_TARBALL} |
|
55 -> ${LANGTOOLS_GENTOO_TARBALL} |
|
56 http://icedtea.classpath.org/download/drops/cacao/${CACAO_TARBALL} -> ${CACAO_GENTOO_TARBALL} |
|
57 http://icedtea.classpath.org/download/drops/jamvm/${JAMVM_TARBALL} -> ${JAMVM_GENTOO_TARBALL}" |
|
58 |
|
59 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" |
|
60 SLOT="7" |
|
61 KEYWORDS="~amd64 ~ia64 ~x86" |
|
62 |
|
63 IUSE="+X +alsa cacao cjk +cups debug doc examples javascript +jbootstrap kerberos +nsplugin |
|
64 +nss pax_kernel pulseaudio +source test +webstart" |
|
65 |
|
66 # Ideally the following were optional at build time. |
|
67 ALSA_COMMON_DEP=" |
|
68 >=media-libs/alsa-lib-1.0" |
|
69 CUPS_COMMON_DEP=" |
|
70 >=net-print/cups-1.2.12" |
|
71 X_COMMON_DEP=" |
|
72 >=dev-libs/atk-1.30.0 |
|
73 >=dev-libs/glib-2.26 |
|
74 media-libs/fontconfig |
|
75 >=media-libs/freetype-2.3.5:2= |
|
76 >=x11-libs/cairo-1.8.8:= |
|
77 x11-libs/gdk-pixbuf:2 |
|
78 >=x11-libs/gtk+-2.8:2= |
|
79 >=x11-libs/libX11-1.1.3 |
|
80 >=x11-libs/libXext-1.1.1 |
|
81 >=x11-libs/libXi-1.1.3 |
|
82 >=x11-libs/libXrender-0.9.4 |
|
83 >=x11-libs/libXtst-1.0.3 |
|
84 >=x11-libs/pango-1.24.5" |
|
85 X_DEPEND=" |
|
86 >=x11-libs/libXau-1.0.3 |
|
87 >=x11-libs/libXdmcp-1.0.2 |
|
88 >=x11-libs/libXinerama-1.0.2 |
|
89 x11-proto/inputproto |
|
90 >=x11-proto/xextproto-7.1.1 |
|
91 x11-proto/xineramaproto |
|
92 x11-proto/xproto" |
|
93 |
|
94 COMMON_DEP=" |
|
95 >=media-libs/giflib-4.1.6:= |
|
96 >=media-libs/lcms-2.5 |
|
97 >=media-libs/libpng-1.2:= |
|
98 >=sys-libs/zlib-1.2.3:= |
|
99 virtual/jpeg:0= |
|
100 javascript? ( dev-java/rhino:1.6 ) |
|
101 nss? ( >=dev-libs/nss-3.12.5-r1 ) |
|
102 pulseaudio? ( >=media-sound/pulseaudio-0.9.11:= ) |
|
103 kerberos? ( virtual/krb5 ) |
|
104 >=dev-util/systemtap-1" |
|
105 |
|
106 # cups is needed for X. #390945 #390975 |
|
107 RDEPEND="${COMMON_DEP} |
|
108 !dev-java/icedtea:0 |
|
109 X? ( |
|
110 ${CUPS_COMMON_DEP} |
|
111 ${X_COMMON_DEP} |
|
112 media-fonts/dejavu |
|
113 cjk? ( |
|
114 media-fonts/arphicfonts |
|
115 media-fonts/baekmuk-fonts |
|
116 media-fonts/lklug |
|
117 media-fonts/lohit-fonts |
|
118 media-fonts/sazanami |
|
119 ) |
|
120 ) |
|
121 alsa? ( ${ALSA_COMMON_DEP} ) |
|
122 cups? ( ${CUPS_COMMON_DEP} )" |
|
123 |
|
124 # Only ant-core-1.8.1 has fixed ant -diagnostics when xerces+xalan are not present. |
|
125 # ca-certificates, perl and openssl are used for the cacerts keystore generation |
|
126 # xext headers have two variants depending on version - bug #288855 |
|
127 # autoconf - as long as we use eautoreconf, version restrictions for bug #294918 |
|
128 DEPEND="${COMMON_DEP} ${ALSA_COMMON_DEP} ${CUPS_COMMON_DEP} ${X_COMMON_DEP} |
|
129 || ( |
|
130 >=dev-java/gcj-jdk-4.3 |
|
131 dev-java/icedtea-bin:7 |
|
132 dev-java/icedtea-bin:6 |
|
133 dev-java/icedtea:7 |
|
134 dev-java/icedtea:6 |
|
135 ) |
|
136 app-arch/cpio |
|
137 app-arch/unzip |
|
138 app-arch/zip |
|
139 app-misc/ca-certificates |
|
140 dev-lang/perl |
|
141 >=dev-libs/libxslt-1.1.26 |
|
142 dev-libs/openssl |
|
143 virtual/pkgconfig |
|
144 sys-apps/attr |
|
145 sys-apps/lsb-release |
|
146 ${X_DEPEND} |
|
147 pax_kernel? ( sys-apps/paxctl )" |
|
148 |
|
149 PDEPEND="webstart? ( dev-java/icedtea-web:7 ) |
|
150 nsplugin? ( dev-java/icedtea-web:7[nsplugin] )" |
|
151 |
|
152 S="${WORKDIR}"/${ICEDTEA_PKG} |
|
153 |
|
154 pkg_setup() { |
|
155 JAVA_PKG_WANT_BUILD_VM=" |
|
156 icedtea-7 icedtea-bin-7 icedtea7 |
|
157 icedtea-6 icedtea-bin-6 icedtea6 icedtea6-bin |
|
158 gcj-jdk" |
|
159 JAVA_PKG_WANT_SOURCE="1.5" |
|
160 JAVA_PKG_WANT_TARGET="1.5" |
|
161 |
|
162 java-vm-2_pkg_setup |
|
163 java-pkg-2_pkg_setup |
|
164 } |
|
165 |
|
166 src_unpack() { |
|
167 unpack ${SRC_PKG} |
|
168 } |
|
169 |
|
170 java_prepare() { |
|
171 # For bootstrap builds as the sandbox control file might not yet exist. |
|
172 addpredict /proc/self/coredump_filter |
|
173 |
|
174 # icedtea doesn't like some locales. #330433 #389717 |
|
175 export LANG="C" LC_ALL="C" |
|
176 |
|
177 # apply paxctl-ng patch |
|
178 epatch "${FILESDIR}/${PN}-use-paxctl-ng.patch" |
|
179 } |
|
180 |
|
181 src_configure() { |
|
182 local config bootstrap use_zero zero_config |
|
183 local vm=$(java-pkg_get-current-vm) |
|
184 |
|
185 # Whether to bootstrap |
|
186 bootstrap="disable" |
|
187 if use jbootstrap; then |
|
188 bootstrap="enable" |
|
189 fi |
|
190 |
|
191 if has "${vm}" gcj-jdk; then |
|
192 # gcj-jdk ensures ecj is present. |
|
193 use jbootstrap || einfo "bootstrap is necessary when building with ${vm}, ignoring USE=\"-jbootstrap\"" |
|
194 bootstrap="enable" |
|
195 local ecj_jar="$(readlink "${EPREFIX}"/usr/share/eclipse-ecj/ecj.jar)" |
|
196 config="${config} --with-ecj-jar=${ecj_jar}" |
|
197 fi |
|
198 |
|
199 config="${config} --${bootstrap}-bootstrap" |
|
200 |
|
201 # Use CACAO if requested |
|
202 if use cacao; then |
|
203 use_cacao="yes"; |
|
204 fi |
|
205 |
|
206 # Always use HotSpot as the primary VM if available. #389521 #368669 #357633 ... |
|
207 # Otherwise use CACAO |
|
208 if ! has "${ARCH}" amd64 sparc x86 ; then |
|
209 if has "${ARCH}" ppc ppc64 arm ; then |
|
210 use_cacao="yes"; |
|
211 else |
|
212 use_zero="yes"; |
|
213 fi |
|
214 fi |
|
215 |
|
216 # Turn on CACAO if needed (non-HS archs) or requested |
|
217 if test "x${use_cacao}" = "xyes"; then |
|
218 cacao_config="--enable-cacao"; |
|
219 fi |
|
220 |
|
221 # Turn on Zero if needed (non-HS/CACAO archs) or requested |
|
222 if test "x${use_zero}" = "xyes"; then |
|
223 zero_config="--enable-zero"; |
|
224 fi |
|
225 |
|
226 # OpenJDK-specific parallelism support. Bug #389791, #337827 |
|
227 # Implementation modified from waf-utils.eclass |
|
228 # Note that "-j" is converted to "-j1" as the system doesn't support --load-average |
|
229 local procs=$(echo -j1 ${MAKEOPTS} | sed -r "s/.*(-j\s*|--jobs=)([0-9]+).*/\2/" ) |
|
230 config="${config} --with-parallel-jobs=${procs}"; |
|
231 einfo "Configuring using --with-parallel-jobs=${procs}" |
|
232 |
|
233 if use javascript ; then |
|
234 config="${config} --with-rhino=$(java-pkg_getjar rhino-1.6 js.jar)" |
|
235 else |
|
236 config="${config} --without-rhino" |
|
237 fi |
|
238 |
|
239 unset JAVA_HOME JDK_HOME CLASSPATH JAVAC JAVACFLAGS |
|
240 |
|
241 econf ${config} \ |
|
242 --with-openjdk-src-zip="${DISTDIR}/${OPENJDK_GENTOO_TARBALL}" \ |
|
243 --with-corba-src-zip="${DISTDIR}/${CORBA_GENTOO_TARBALL}" \ |
|
244 --with-jaxp-src-zip="${DISTDIR}/${JAXP_GENTOO_TARBALL}" \ |
|
245 --with-jaxws-src-zip="${DISTDIR}/${JAXWS_GENTOO_TARBALL}" \ |
|
246 --with-jdk-src-zip="${DISTDIR}/${JDK_GENTOO_TARBALL}" \ |
|
247 --with-hotspot-src-zip="${DISTDIR}/${HOTSPOT_GENTOO_TARBALL}" \ |
|
248 --with-langtools-src-zip="${DISTDIR}/${LANGTOOLS_GENTOO_TARBALL}" \ |
|
249 --with-cacao-src-zip="${DISTDIR}/${CACAO_GENTOO_TARBALL}" \ |
|
250 --with-jamvm-src-zip="${DISTDIR}/${JAMVM_GENTOO_TARBALL}" \ |
|
251 --with-jdk-home="$(java-config -O)" \ |
|
252 --with-abs-install-dir=/usr/$(get_libdir)/icedtea${SLOT} \ |
|
253 --disable-downloading --disable-Werror \ |
|
254 --enable-system-lcms \ |
|
255 $(use_enable !debug optimizations) \ |
|
256 $(use_enable doc docs) \ |
|
257 $(use_enable nss) \ |
|
258 $(use_enable pulseaudio pulse-java) \ |
|
259 $(use_enable kerberos system-kerberos) \ |
|
260 $(use_with pax_kernel pax paxctl-ng) \ |
|
261 ${zero_config} ${cacao_config} |
|
262 } |
|
263 |
|
264 src_compile() { |
|
265 # Would use GENTOO_VM otherwise. |
|
266 export ANT_RESPECT_JAVA_HOME=TRUE |
|
267 |
|
268 # With ant >=1.8.2 all required tasks are part of ant-core |
|
269 export ANT_TASKS="none" |
|
270 |
|
271 emake |
|
272 } |
|
273 |
|
274 src_test() { |
|
275 # Use Xvfb for tests |
|
276 unset DISPLAY |
|
277 |
|
278 Xemake check |
|
279 } |
|
280 |
|
281 src_install() { |
|
282 local dest="/usr/$(get_libdir)/icedtea${SLOT}" |
|
283 local ddest="${ED}/${dest}" |
|
284 dodir "${dest}" |
|
285 |
|
286 dodoc README NEWS AUTHORS |
|
287 dosym /usr/share/doc/${PF} /usr/share/doc/${PN}${SLOT} |
|
288 |
|
289 cd openjdk.build/j2sdk-image || die |
|
290 |
|
291 # Ensures HeadlessGraphicsEnvironment is used. |
|
292 if ! use X; then |
|
293 rm -r jre/lib/$(get_system_arch)/xawt || die |
|
294 fi |
|
295 |
|
296 # Don't hide classes |
|
297 rm lib/ct.sym || die |
|
298 |
|
299 #402507 |
|
300 mkdir jre/.systemPrefs || die |
|
301 touch jre/.systemPrefs/.system.lock || die |
|
302 touch jre/.systemPrefs/.systemRootModFile || die |
|
303 |
|
304 # doins can't handle symlinks. |
|
305 cp -vRP bin include jre lib man "${ddest}" || die |
|
306 |
|
307 dodoc ASSEMBLY_EXCEPTION THIRD_PARTY_README |
|
308 |
|
309 if use doc; then |
|
310 # java-pkg_dohtml needed for package-list #302654 |
|
311 java-pkg_dohtml -r ../docs/* || die |
|
312 fi |
|
313 |
|
314 if use examples; then |
|
315 dodir "${dest}/share"; |
|
316 cp -vRP demo sample "${ddest}/share/" || die |
|
317 fi |
|
318 |
|
319 if use source; then |
|
320 cp src.zip "${ddest}" || die |
|
321 fi |
|
322 |
|
323 # Fix the permissions. |
|
324 find "${ddest}" \! -type l \( -perm /111 -exec chmod 755 {} \; -o -exec chmod 644 {} \; \) || die |
|
325 |
|
326 # Needs to be done before generating cacerts |
|
327 java-vm_set-pax-markings "${ddest}" |
|
328 |
|
329 # We need to generate keystore - bug #273306 |
|
330 einfo "Generating cacerts file from certificates in ${EPREFIX}/usr/share/ca-certificates/" |
|
331 mkdir "${T}/certgen" && cd "${T}/certgen" || die |
|
332 cp "${FILESDIR}/generate-cacerts.pl" . && chmod +x generate-cacerts.pl || die |
|
333 for c in "${EPREFIX}"/usr/share/ca-certificates/*/*.crt; do |
|
334 openssl x509 -text -in "${c}" >> all.crt || die |
|
335 done |
|
336 ./generate-cacerts.pl "${ddest}/bin/keytool" all.crt || die |
|
337 cp -vRP cacerts "${ddest}/jre/lib/security/" || die |
|
338 chmod 644 "${ddest}/jre/lib/security/cacerts" || die |
|
339 |
|
340 # OpenJDK7 should be able to use fontconfig instead, but wont hurt to |
|
341 # install it anyway. Bug 390663 |
|
342 cp "${FILESDIR}"/fontconfig.Gentoo.properties.src "${T}"/fontconfig.Gentoo.properties || die |
|
343 eprefixify "${T}"/fontconfig.Gentoo.properties |
|
344 insinto "${dest}"/jre/lib |
|
345 doins "${T}"/fontconfig.Gentoo.properties |
|
346 |
|
347 set_java_env "${FILESDIR}/icedtea.env" |
|
348 if ! use X || ! use alsa || ! use cups; then |
|
349 java-vm_revdep-mask "${dest}" |
|
350 fi |
|
351 java-vm_sandbox-predict /proc/self/coredump_filter |
|
352 } |
|
353 |
|
354 pkg_preinst() { |
|
355 if has_version "<=dev-java/icedtea-7.2.0:7"; then |
|
356 # portage would preserve the symlink otherwise, related to bug #384397 |
|
357 rm -f "${EROOT}/usr/lib/jvm/icedtea7" |
|
358 elog "To unify the layout and simplify scripts, the identifier of Icedtea-7*" |
|
359 elog "has changed from 'icedtea7' to 'icedtea-7' starting from version 7.2.0-r1" |
|
360 elog "If you had icedtea7 as system VM, the change should be automatic, however" |
|
361 elog "build VM settings in /etc/java-config-2/build/jdk.conf are not changed" |
|
362 elog "and the same holds for any user VM settings. Sorry for the inconvenience." |
|
363 fi |
|
364 } |
|