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