# Contributor: Timo Teras # Contributor: Jakub Jirutka # Maintainer: Timo Teras pkgname=openjdk7 _icedteaver=2.6.18 _icedteaversrc=$_icedteaver # pkgver is . # check icedtea JDK when updating pkgver=7.221.$_icedteaver pkgrel=0 pkgdesc="OpenJDK 7 via IcedTea" url="https://icedtea.classpath.org/" arch="all" license="GPL-2.0 with Classpath" depends="$pkgname-jre java-cacerts" options="sover-namecheck" makedepends="bash findutils tar zip file paxmark gawk util-linux libxslt autoconf automake linux-headers coreutils ca-certificates nss-dev 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 pcsc-lite-dev lksctp-tools-dev libxcomposite-dev nss-static xz" install="" # upstream binary versions RHINO_VER=1.7.7.2 ANT_VER=1.9.11 case $CARCH in x86) _jarch=i386;; x86_64) _jarch=amd64;; aarch64) _jarch=aarch64;; arm*) _jarch=arm # openjdk has quite a bit of arm assembly producing textrels # and it's non trivial to fix. allow it for now. options="$options textrels";; s390x) _jarch=s390x;; ppc64le) _jarch=ppc64le;; esac INSTALL_BASE=/usr/lib/jvm/java-1.7-openjdk _jrelib="$INSTALL_BASE/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-jre-lib:jrelib:noarch $pkgname-jre $pkgname-jre-base:jrebase $pkgname-doc:doc" if [ "$BOOTSTRAP" != "no" ]; then makedepends="$makedepends java-gcj-compat" BOOTSTRAP_JAVA_HOME=/usr/lib/jvm/java-1.5-gcj/ else makedepends="$makedepends $pkgname" BOOTSTRAP_JAVA_HOME="$INSTALL_BASE" fi _dropsver=$_icedteaver _dropsurl=https://icedtea.classpath.org/download/drops/icedtea7/$_dropsver source="https://icedtea.classpath.org/download/source/icedtea-$_icedteaversrc.tar.xz openjdk-$_dropsver.tar.bz2::$_dropsurl/openjdk.tar.bz2 corba-$_dropsver.tar.bz2::$_dropsurl/corba.tar.bz2 jaxp-$_dropsver.tar.bz2::$_dropsurl/jaxp.tar.bz2 jaxws-$_dropsver.tar.bz2::$_dropsurl/jaxws.tar.bz2 jdk-$_dropsver.tar.bz2::$_dropsurl/jdk.tar.bz2 langtools-$_dropsver.tar.bz2::$_dropsurl/langtools.tar.bz2 hotspot-$_dropsver.tar.bz2::$_dropsurl/hotspot.tar.bz2 https://archive.apache.org/dist/ant/binaries/apache-ant-$ANT_VER-bin.tar.gz https://github.com/mozilla/rhino/releases/download/Rhino${RHINO_VER//./_}_Release/rhino-$RHINO_VER.zip icedtea-pr64174.patch icedtea-hotspot-musl.patch icedtea-hotspot-musl-ppc.patch icedtea-hotspot-noagent-musl.patch icedtea-hotspot-uclibc-fixes.patch icedtea-jdk-fix-build.patch icedtea-jdk-execinfo.patch icedtea-jdk-fix-ipv6-init.patch icedtea-jdk-musl.patch icedtea-jdk-no-soname.patch icedtea-jdk-xattr.patch icedtea-cpio.patch fix-xattr-include.patch " # secfixes: # 7.221.2.6.18-r0: # - CVE-2019-2602 # - CVE-2019-2684 # - CVE-2019-2698 # 7.211.2.6.17-r0: # - CVE-2018-11212 # - CVE-2019-2422 # - CVE_2019-2426 # 7.201.2.6.16-r0: # - CVE-2018-3136 # - CVE-2018-3139 # - CVE-2018-3149 # - CVE-2018-3169 # - CVE-2018-3180 # - CVE-2018-3214 # - CVE-2018-13785 builddir="$srcdir/icedtea-$_icedteaver" unpack() { if [ -z "$force" ]; then verify initdcheck fi mkdir -p "$srcdir" msg "Unpacking sources..." tar -C "$srcdir" -xf icedtea-$_icedteaversrc.tar.xz tar -C "$srcdir" -xf apache-ant-$ANT_VER-bin.tar.gz unzip -o -q "rhino-$RHINO_VER.zip" -d "$srcdir" } prepare() { cd "$builddir" # Busybox sha256 does not support longopts sed -e "s/--check/-c/g" -i Makefile.am for patch in $source; do case $patch in icedtea-*.patch) cp ../$patch patches ;; *.patch) msg "Applying patch $patch" patch -p1 -i "$srcdir"/$patch ;; esac done ./autogen.sh } build() { [ -z "$JOBS" ] && export JOBS=$(echo $MAKEFLAGS | sed -n -e 's/.*-j\([0-9]\+\).*/\1/p') export ALT_PARALLEL_COMPILE_JOBS="${JOBS:-2}" export HOTSPOT_BUILD_JOBS="${JOBS:-2}" export JAVA_HOME=$BOOTSTRAP_JAVA_HOME export PATH=$JAVA_HOME/bin:$srcdir/apache-ant-$ANT_VER/bin:$PATH export DISTRIBUTION_PATCHES="" # Explicitly set the C++ standard as the default has changed on GCC 6+ # and disable optimizations that lead to a broken JVM. These options # has been adopted from the Fedora package. export EXTRA_CPP_FLAGS="$CXXFLAGS -std=gnu++98 -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-strict-overflow" # CXXFLAGS doesn't make it to all calls, so we set the C++ standard # version for C too. export EXTRA_CFLAGS="$CFLAGS -std=gnu++98 -Wno-error -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-strict-overflow" local patch for patch in $source; do case $patch in icedtea-*.patch) export DISTRIBUTION_PATCHES="$DISTRIBUTION_PATCHES patches/$patch" ;; esac done echo "icedtea patches: $DISTRIBUTION_PATCHES" # --disable-arm32-jit: https://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2942 cd "$builddir" ./configure \ --build=$CBUILD \ --host=$CHOST \ --prefix=$INSTALL_BASE \ --sysconfdir=/etc \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --localstatedir=/var \ --with-parallel-jobs=${JOBS:-2} \ --disable-dependency-tracking \ --disable-downloading \ --disable-arm32-jit \ --with-rhino=$srcdir/rhino$RHINO_VER/lib/rhino-$RHINO_VER.jar \ --with-openjdk-src-zip=$srcdir/openjdk-$_dropsver.tar.bz2 \ --with-hotspot-src-zip=$srcdir/hotspot-$_dropsver.tar.bz2 \ --with-corba-src-zip=$srcdir/corba-$_dropsver.tar.bz2 \ --with-jaxp-src-zip=$srcdir/jaxp-$_dropsver.tar.bz2 \ --with-jaxws-src-zip=$srcdir/jaxws-$_dropsver.tar.bz2 \ --with-jdk-src-zip=$srcdir/jdk-$_dropsver.tar.bz2 \ --with-langtools-src-zip=$srcdir/langtools-$_dropsver.tar.bz2 \ --with-pax=paxmark \ --with-jdk-home=$BOOTSTRAP_JAVA_HOME \ --with-pkgversion="Alpine ${pkgver}-r${pkgrel}" msg "Icedtea boot" make -j1 icedtea-boot SHELL=/bin/bash msg "Icedtea boot done" make } package() { mkdir -p "$pkgdir"/$INSTALL_BASE cp -a "$builddir"/openjdk.build/j2sdk-image/* "$pkgdir"/$INSTALL_BASE rm "$pkgdir"/$INSTALL_BASE/src.zip # pax mark again (due to fakeroot xattr handling bug) "$builddir"/pax-mark-vm "$pkgdir"/$INSTALL_BASE # symlink to shared java cacerts store rm -f "$pkgdir"/$INSTALL_BASE/jre/lib/security/cacerts ln -sf /etc/ssl/certs/java/cacerts \ "$pkgdir"/$INSTALL_BASE/jre/lib/security/cacerts } jrelib() { pkgdesc="OpenJDK 7 Java Runtime (class libraries)" depends="" local A; for A in jre/lib/zi 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 local dirname=${A%/*} mkdir -p "$subpkgdir"/$INSTALL_BASE/$dirname mv "$pkgdir"/$INSTALL_BASE/$A "$subpkgdir"/$INSTALL_BASE/$dirname done } jrebase() { pkgdesc="OpenJDK 7 Java Runtime (no GUI support)" depends="$pkgname-jre-lib java-common java-cacerts" mkdir -p "$subpkgdir"/$INSTALL_BASE/bin local A; for A in java orbd rmid servertool unpack200 keytool \ pack200 rmiregistry tnameserv; do mv "$pkgdir"/$INSTALL_BASE/bin/$A "$subpkgdir"/$INSTALL_BASE/bin done # rest of the jre subdir (which were not taken by -jre subpkg) mv "$pkgdir"/$INSTALL_BASE/jre "$subpkgdir"/$INSTALL_BASE # pax mark again (due to fakeroot xattr handling bug) "$builddir"/pax-mark-vm "$subpkgdir"/$INSTALL_BASE } jre() { pkgdesc="OpenJDK 7 Java Runtime" # manually depend to avoid clash with libgcj's libjvm.so depends="so:openjdk7:libjvm.so=0" mkdir -p "$subpkgdir" local A; for A in jre/bin/policytool \ bin/appletviewer \ bin/policytool \ jre/lib/$_jarch/xawt \ jre/lib/$_jarch/libsplashscreen.so; do local dirname=${A%/*} mkdir -p "$subpkgdir"/$INSTALL_BASE/$dirname mv "$pkgdir"/$INSTALL_BASE/$A "$subpkgdir"/$INSTALL_BASE/$dirname done # pax mark again (due to fakeroot xattr handling bug) "$builddir"/pax-mark-vm "$subpkgdir"/$INSTALL_BASE } doc() { default_doc mkdir -p "$subpkgdir"/$INSTALL_BASE/ mv "$pkgdir"/$INSTALL_BASE/man "$subpkgdir"/$INSTALL_BASE/ } sha512sums="202038af902c7619e787c3f55ccc4ab5b758a72e4c841d17065809d2331ed4f8ed7a2bce753917d9e6215525ba56840793c9a9850142e865edde1a92a7e5806d icedtea-2.6.18.tar.xz af8bbdad44448fb73d4f8ac87c00fa2198b7d6a401b9af9c8330768aa5ca395b50ff85f053b02a3e6d4b166b0a8f7badf6bd3c983cc9b2e35f157d0389983982 openjdk-2.6.18.tar.bz2 0c688037efebbea1175ae26fc77be205cb43f8de886b00a6d89d35666c523bad8dbde3be636a428bff1331e89c4a6acf2aefc5611e65e4a3a7b617e240c536bf corba-2.6.18.tar.bz2 0a23f37bf35537333d93c88e6f3e018af32f9019ec081e679a4f204848851f4fbcf47f2c0e58e27b8a0c5fdfc9897d427070e62022afcfc42ad70bb413f12c1e jaxp-2.6.18.tar.bz2 1b2b8fd93e9f94af202c3816b4ecaa8c0809d5eed5962ff57f2edd15232abcaa11d4ac74bfb5b9f9121e5cdec3ea33559ebcc5605d8aa1fd013152abafe14aa9 jaxws-2.6.18.tar.bz2 82d8b69f6ba3eeb3825275506704b793b5c3ea416da04319fd62948c7fa9db9a4bcb96b0b43d13fc58fbaf2f8d4b5eea098d98d5da68977cb41f9614e8c30933 jdk-2.6.18.tar.bz2 b64c832474295b3c8d3a22a906b156555171128002c1870d071c98902f7b611d8d0f0dab4c98bf21a102011a7bf2a542d0207cdbe23433a77073670a17eb6322 langtools-2.6.18.tar.bz2 bff77060aa4ccceec62fc14a1c47ba6d31d510353050b9b213ef87a58b82132e5cad72c59ff38f50a2c290fd2cfd84e0db9768e205d72865b6fc4b6d15fb5f0c hotspot-2.6.18.tar.bz2 0da12cb0f761b8cb76e042449e7d93f43236e7bc948e337215470a70031f0a2dda6d1b508f9397b283808d84c4ebddb31558fe1cd8e6e6469c1dd390d69ec6e7 apache-ant-1.9.11-bin.tar.gz 1b9e8721749e81c5420a00af1e00ee0e4f48624ccb4e9aa969032114116ad50f59b254d4d16d74feff74de64157cc8b0a2ead9b555907c84b7055b796fba9a75 rhino-1.7.7.2.zip dbebef0b6246ffaba8d10e1b672821b55e69950961dcfd265f8b37a8123a71bd80b33a1e4f1ea27343e08803744138687c6ee367e4158bc3540f5d886c0e9cb4 icedtea-pr64174.patch f62b942f0bacda8e37d0f1876d8ba14ddb4fc55a7d5fd1019463744927f40f422a85e9ee051948d566242f5a785aa28f275eb58768611283cba89af91235f43c icedtea-hotspot-musl.patch e5cf4d70f96fc1e72ae8b97a887adb96092ff36584711cbb8de9d9fa9e859cb8731d638838de0d9591239fc44ffe5c74422d1842bd9f10a0c00dff1627bdeeef icedtea-hotspot-musl-ppc.patch e7a2c1771bb582d427041f8d22e48c0daf8f20d7c0926cbce3549d49c4e949359ee25a35682b486e82f3e390535c950c5beee3bd8d06fb5a717b50f2d9b2a6bc icedtea-hotspot-noagent-musl.patch 822eee0dc4d3ba677a289dfeb3668b536d2d626708390a9d9702fb4144a481fd443a215a0d2041c6026113837aafa4ba0b5e9ead8589d2da6717a238bbc95a5a icedtea-hotspot-uclibc-fixes.patch 213a537de5f011cb39d608515c3413513ac75fb93593f9a9ef4205f71d72bdd8b097c80db185f7b26021d5bb85045b866f34f3478482dc4189972d8614a13458 icedtea-jdk-fix-build.patch 0391970e6a32946aa3cccf38fdef9c0fe2af26cd0df824b98aa2fcfa1bf661d4a68e339bffcfd16f386c565fc68bb28a29208a67d4bad8a0e847ad02bd8becbb icedtea-jdk-execinfo.patch 48533f87fc2cf29d26b259be0df51087d2fe5b252e72d00c6ea2f4add7b0fb113141718c116279c5905e03f64a1118082e719393786811367cf4d472b5d36774 icedtea-jdk-fix-ipv6-init.patch 44a35941c80f408d0607e32763b3b6ccee21e1d39886309327d3d74d2900117e4346ef59e77c663fd022fec10ee8f365eeb46c1260014d5765d226ce175ce3c5 icedtea-jdk-musl.patch bf4b184e170f7b0ff64ab30d2162784fe2bd5460d1fa31973259f7065fd4c511c46f97724fe2bd72bb94e9006cb568d0e0c87d1a9c90819e65880f8f44830bb1 icedtea-jdk-no-soname.patch e703e5f68e63f130e758b3fa813872363090c08eee6a6366f4784cf6a191a90a3642ec71e016bd05e48a66ad0ae56db8b0e318b101aca5d0885af8705423b770 icedtea-jdk-xattr.patch a54c79c82afa1bc95265397b274260584c8b8c6be1651ddfb907d9523a809ea4581409e0d3fb0bbb63ef5a204e8ce29b7940e78cd640af1f490ae938c59129b6 icedtea-cpio.patch 4c874f0e9f3f54f688a1faf64fa3734e31f139f465ce77d12aac87558764ef66055de6cfac5b60efef2833c64256136c70f3cf5dc2712de62fc5dbebe3a8fbcd fix-xattr-include.patch"