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