# Contributor: Timo Teras # Contributor: Jakub Jirutka # Maintainer: Timo Teras pkgname=openjdk8 _icedteaver=3.5.0 # pkgver is .. # Check http://icedtea.classpath.org/wiki/Main_Page when updating! pkgver=8.141.15 pkgrel=0 pkgdesc="OpenJDK 8 provided by IcedTea" url="http://icedtea.classpath.org/" arch="all" license="custom" depends="$pkgname-jre java-cacerts" options="sover-namecheck" makedepends="bash findutils tar zip file paxmark gawk util-linux libxslt autoconf automake linux-headers sed xz coreutils openjdk7 ca-certificates nss-dev nss-static cups-dev jpeg-dev giflib-dev libpng-dev libxt-dev lcms2-dev libxp-dev libxtst-dev libxinerama-dev zlib-dev libxrender-dev alsa-lib-dev freetype-dev fontconfig-dev gtk+2.0-dev krb5-dev attr-dev pcsc-lite-dev lksctp-tools-dev libxcomposite-dev" case $CARCH in x86) _jarch=i386;; x86_64) _jarch=amd64;; arm*) _jarch=arm;; *) _jarch="$CARCH";; esac _bootstrap_java_home="/usr/lib/jvm/java-1.7-openjdk" _java_home="/usr/lib/jvm/java-1.8-openjdk" _jrelib="$_java_home/jre/lib/$_jarch" # Exclude xawt from ldpath to avoid duplicate provides for libmawt.so # (also in headless). in future this should be a virtual provides. ldpath="$_jrelib:$_jrelib/native_threads:$_jrelib/headless:$_jrelib/server:$_jrelib/jli" sonameprefix="$pkgname:" subpackages="$pkgname-dbg $pkgname-jre-lib:jrelib:noarch $pkgname-jre $pkgname-jre-base:jrebase $pkgname-doc $pkgname-demos" _dropsver=$_icedteaver _dropsurl="http://icedtea.classpath.org/download/drops/icedtea8/$_dropsver" source="http://icedtea.classpath.org/download/source/icedtea-$_icedteaver.tar.gz openjdk-$_dropsver.tar.xz::$_dropsurl/openjdk.tar.xz corba-$_dropsver.tar.xz::$_dropsurl/corba.tar.xz jaxp-$_dropsver.tar.xz::$_dropsurl/jaxp.tar.xz jaxws-$_dropsver.tar.xz::$_dropsurl/jaxws.tar.xz jdk-$_dropsver.tar.xz::$_dropsurl/jdk.tar.xz langtools-$_dropsver.tar.xz::$_dropsurl/langtools.tar.xz hotspot-$_dropsver.tar.xz::$_dropsurl/hotspot.tar.xz nashorn-$_dropsver.tar.xz::$_dropsurl/nashorn.tar.xz fix-paxmark.patch icedtea-hotspot-musl.patch icedtea-hotspot-musl-ppc.patch icedtea-hotspot-noagent-musl.patch icedtea-jdk-execinfo.patch icedtea-jdk-fix-ipv6-init.patch icedtea-jdk-fix-libjvm-load.patch icedtea-jdk-musl.patch icedtea-jdk-includes.patch icedtea-jdk-getmntent-buffer.patch icedtea-autoconf-config.patch icedtea-jdk-tls-nist-curves.patch " builddir="$srcdir/icedtea-$_icedteaver" unpack() { if [ -z "$force" ]; then verify || return 1 initdcheck || return 1 fi mkdir -p "$srcdir" msg "Unpacking sources..." tar -C "$srcdir" -zxf icedtea-$_icedteaver.tar.gz || return 1 } prepare() { cd "$builddir" local ver_u=$(sed -En 's/^JDK_UPDATE_VERSION\s*=\s*(\S+).*/\1/p' Makefile.am) local ver_b=$(sed -En 's/^BUILD_VERSION\s*=\s*b(\S+).*/\1/p' Makefile.am) [ "${pkgver#*.}" = "$ver_u.$ver_b" ] \ || die "Version mismatch, source is 8.$ver_u.$ver_b, but abuild defines $pkgver!" # Busybox sha256 does not support longopts. sed -e "s/--check/-c/g" -i Makefile.am local patch; for patch in $source; do case $patch in icedtea-*.patch) cp ../$patch patches ;; *.patch) msg "Applying patch $patch" patch -p1 -i "$srcdir"/$patch || return 1 ;; esac done ./autogen.sh } build() { export JAVA_HOME="$_bootstrap_java_home" export PATH="$JAVA_HOME/bin:$PATH" if [ -z "$JOBS" ]; then export JOBS=$(printf '%s\n' "$MAKEFLAGS" | sed -n -e 's/.*-j\([0-9]\+\).*/\1/p') fi DISTRIBUTION_PATCHES="" local patch; for patch in $source; do case $patch in icedtea-*.patch) DISTRIBUTION_PATCHES="$DISTRIBUTION_PATCHES patches/$patch" ;; esac done export DISTRIBUTION_PATCHES echo "icedtea patches: $DISTRIBUTION_PATCHES" cd "$builddir" ./configure \ --build=$CBUILD \ --host=$CHOST \ --prefix="$_java_home" \ --sysconfdir=/etc \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --localstatedir=/var \ --disable-dependency-tracking \ --disable-downloading \ --disable-precompiled-headers \ --with-parallel-jobs=${JOBS:-2} \ --with-hotspot-build=default \ --with-openjdk-src-zip="$srcdir/openjdk-$_dropsver.tar.xz" \ --with-hotspot-src-zip="$srcdir/hotspot-$_dropsver.tar.xz" \ --with-corba-src-zip="$srcdir/corba-$_dropsver.tar.xz" \ --with-jaxp-src-zip="$srcdir/jaxp-$_dropsver.tar.xz" \ --with-jaxws-src-zip="$srcdir/jaxws-$_dropsver.tar.xz" \ --with-jdk-src-zip="$srcdir/jdk-$_dropsver.tar.xz" \ --with-langtools-src-zip="$srcdir/langtools-$_dropsver.tar.xz" \ --with-nashorn-src-zip="$srcdir/nashorn-$_dropsver.tar.xz" \ --with-pax=paxmark \ --with-jdk-home="$_bootstrap_java_home" \ --with-pkgversion="Alpine ${pkgver}-r${pkgrel}" \ --enable-nss \ --enable-sunec \ --enable-non-nss-curves \ || return 1 make || return 1 } # TODO: Run tests or at least try to compile and run hello world. check() { cd "$builddir"/openjdk.build/images/j2sdk-image ./bin/java -version } package() { cd "$builddir" mkdir -p "$pkgdir"/$_java_home cp -a openjdk.build/images/j2sdk-image/* "$pkgdir"/$_java_home/ || return 1 rm "$pkgdir"/$_java_home/src.zip # This archive contains absolute paths from the build environment, # so it does not work on the target system. User can generate it # running `java -Xshare:dump`. rm -f "$pkgdir"/$_jrelib/server/classes.jsa # pax mark again (due to fakeroot xattr handling bug) ./pax-mark-vm "$pkgdir"/$_java_home true || return 1 # symlink to shared java cacerts store rm -f "$pkgdir"/$_java_home/jre/lib/security/cacerts ln -sf /etc/ssl/certs/java/cacerts \ "$pkgdir"/$_java_home/jre/lib/security/cacerts } jrelib() { pkgdesc="OpenJDK 8 Java Runtime (class libraries)" depends="" local file dir for file in jre/lib/images \ jre/lib/*.jar \ jre/lib/security \ jre/lib/ext/*.jar \ jre/lib/cmm \ jre/ASSEMBLY_EXCEPTION \ jre/THIRD_PARTY_README \ jre/LICENSE; do dir=${file%/*} mkdir -p "$subpkgdir"/$_java_home/$dir mv "$pkgdir"/$_java_home/$file "$subpkgdir"/$_java_home/$dir || return 1 done } jre() { pkgdesc="OpenJDK 8 Java Runtime" local file dir mkdir -p "$subpkgdir" for file in jre/bin/policytool \ bin/appletviewer \ bin/policytool \ jre/lib/$_jarch/libawt_xawt.so \ jre/lib/$_jarch/libfontmanager.so \ jre/lib/$_jarch/libjawt.so \ jre/lib/$_jarch/libjsoundalsa.so \ jre/lib/$_jarch/libsplashscreen.so; do dir=${file%/*} mkdir -p "$subpkgdir"/$_java_home/$dir mv "$pkgdir"/$_java_home/$file "$subpkgdir"/$_java_home/$dir || return 1 done # Pax mark again (due to fakeroot xattr handling bug). "$builddir"/pax-mark-vm "$subpkgdir"/$_java_home true || return 1 } jrebase() { pkgdesc="OpenJDK 8 Java Runtime (no GUI support)" depends="$pkgname-jre-lib java-common java-cacerts" mkdir -p "$subpkgdir"/$_java_home/bin \ "$subpkgdir"/$_java_home/lib/$_jarch mv "$pkgdir"/$_java_home/lib/$_jarch/jli \ "$subpkgdir"/$_java_home/lib/$_jarch/ || return 1 local file; for file in java orbd rmid servertool unpack200 keytool \ pack200 rmiregistry tnameserv; do mv "$pkgdir"/$_java_home/bin/$file "$subpkgdir"/$_java_home/bin/ || return 1 done # Rest of the jre subdir (which were not taken by -jre subpkg). mv "$pkgdir"/$_java_home/jre "$subpkgdir"/$_java_home/ || return 1 # Pax mark again (due to fakeroot xattr handling bug). "$builddir"/pax-mark-vm "$subpkgdir"/$_java_home true || return 1 } doc() { default_doc || return 1 mkdir -p "$subpkgdir"/$_java_home/ mv "$pkgdir"/$_java_home/man "$subpkgdir"/$_java_home/ } demos() { pkgdesc="OpenJDK 8 Java Demos and Samples" depends="$pkgname" mkdir -p "$subpkgdir"/$_java_home/ mv "$pkgdir"/$_java_home/demo "$pkgdir"/$_java_home/sample \ "$subpkgdir"/$_java_home/ } sha512sums="0fc51b7e8b39670b1439cdfb947e215d6c92e64950002aa7b63a7051a27f60335aa477f166e0ee43b70faf19bb1c67678b458e0cec4333b20d76484ebcb5c476 icedtea-3.5.0.tar.gz 88f6dabebe20f9feedf1de69c486fb8d1d4239b25f845c998c64cf6f1f783cf86cc98feb87f50a5256a2a340e23d2d3452827c39a65e371e54477479ee2b7be4 openjdk-3.5.0.tar.xz 37d42af8663ac0af58c494406360e421dd1f707d98b9a00bb0149a51ccdee809524bc1f307d207360e7bc3f1c0d6a585c085ad0395075a54553226b9fb1874a4 corba-3.5.0.tar.xz 70f9c3c8beb119760356c46c64cc382c783d4aa4f940627169541ea98c07b32af1c67f266a24c6f211e9eb4c37e25a8d124868abfbe7538787a17e66a731f93f jaxp-3.5.0.tar.xz ff10229eeefc1cc08f6f7216b985f092b0bdcc10a33c1c9a962120e93e7ad3d15672b22ac73f3218a59334bf585d8116203d87883f07a5a2a1c2403007fd6720 jaxws-3.5.0.tar.xz caeafb2efdfb6cacedab1fe13f23822baf5dcd599403a4cc057e6814d224cdf2ec5cdfb8c55ab8a5efb1e0f68b2d784226431a54e3711aa99dbee4ac20ef60fa jdk-3.5.0.tar.xz 8260e326b3aa42f8ec9de18a7b8eeaa52b2610f63426d7a1a143a7f27b849c60a9a47397de565bc3fb0e9761178e2cb68af15c996d848e20f5016111dd22a4cd langtools-3.5.0.tar.xz 098251daba090465cffebc7fe8486140709726607b93aacd9052a85903fb252aef689611f85deb5324a99e037256cef18a8035fc3d47c8a38b2b47f0e7d1c70d hotspot-3.5.0.tar.xz ac0c7adce68d3e85bd708b055b8a1661ac9a24301a10c009f030be947d194cf8f7cf856923ddfc29b6c2d61ea62d7fdfc260abc4664fb0f3bdaf1e9ecdc767d7 nashorn-3.5.0.tar.xz 1f470432275d5beaa8b4e4352a2f24a4a00593546dc4f3bd857794c89e521e8e6d6abc540762bbd769be3e1e3da058e134dc5dc066d12b9b8a1f0656040a795c fix-paxmark.patch bfa16565d71453a0ba4204cb7ee0f8cb8c9a272c4d71d1357af4425183e64ef8df77ae1df1bbb0f984cf2d6d04a49124a6ef50f09dfee80c5b5734596e0b2a8e icedtea-hotspot-musl.patch e5cf4d70f96fc1e72ae8b97a887adb96092ff36584711cbb8de9d9fa9e859cb8731d638838de0d9591239fc44ffe5c74422d1842bd9f10a0c00dff1627bdeeef icedtea-hotspot-musl-ppc.patch 3c592a14f1806a431290a96a8c1413ca1cc621e73a87ed778fa98878c82809bd924072210d4e4127a6c0c32ff557d749f6c9b3ce31cbca083b013240b618b224 icedtea-hotspot-noagent-musl.patch f6365cfafafa008bd6c1bf0ccec01a63f8a39bd1a8bc87baa492a27234d47793ba02d455e5667a873ef50148df3baaf6a8421e2da0b15faac675867da714dd5f icedtea-jdk-execinfo.patch 48533f87fc2cf29d26b259be0df51087d2fe5b252e72d00c6ea2f4add7b0fb113141718c116279c5905e03f64a1118082e719393786811367cf4d472b5d36774 icedtea-jdk-fix-ipv6-init.patch b135991c76b0db8fa7c363e0903624668e11eda7b54a943035c214aa4d7fc8c3e8110ed200edcec82792f3c9393150a9bd628625ddf7f3e55720ff163fbbb471 icedtea-jdk-fix-libjvm-load.patch cdebe2c59657e7fd317a4841b2fbe95d9e8d7ee9d1593edf352ed7f49a92a42cbce82cbaa404d3f02c6d273eae03222a79559c09bf6cf439396c5ec5434f5458 icedtea-jdk-musl.patch e8d9f1b867bf4fc84aa00d1237b264bcf503b1ed5f34735e14b0b747a728953fe0051a5af69ed058d377fbf65d8be1ed9e38fe5fc6edb2d50b31f34bf3ba91dc icedtea-jdk-includes.patch 7e6fa46b10c630517bfa46943858aea1d032c12d32ba3fcb7a2143ae1e896c34fa4cb8f925af80cb19f8e29149b835aa054adfd30ebb00539f6c78588d6f5211 icedtea-jdk-getmntent-buffer.patch 662d662d0a7a84be2978e921317589f212f3ba3b7629527ba0f1140b5ac4c1024893e0ed176211688ed1a4505968c4befc841ed57ffcdbb9d355c2cb0571b167 icedtea-autoconf-config.patch 313ba3467efad73120d307c16be8e793fa39de92d6c28c2faed11c14dd6f60e0f1a290f330d4dc849ae8f97c7bea84eec2d0be02c70bc9903664e22497dd2d22 icedtea-jdk-tls-nist-curves.patch"