# Contributor: Simon Frankenberger # Maintainer: Simon Frankenberger pkgname=openjdk14 pkgver=14.0.0_p36 #_pkgver=${pkgver/_p8/-ga} _pkgver=14+36 pkgrel=0 pkgdesc="Oracle OpenJDK 14" url="https://hg.openjdk.java.net/jdk-updates/jdk14u" arch="all !x86 !armhf !armv7 !mips !mips64" # oracle dropped support for 32 bit license="GPL-2.0-with-classpath-exception" makedepends="autoconf bash gawk grep make openjdk13-jdk zip alsa-lib-dev cups-dev elfutils-dev fontconfig-dev freetype-dev giflib-dev lcms2-dev libexecinfo-dev libffi-dev libjpeg-turbo-dev libx11-dev libxext-dev libxrandr-dev libxrender-dev libxt-dev libxtst-dev linux-headers zlib-dev" depends="$pkgname-jmods $pkgname-demos $pkgname-doc $pkgname-jdk" # for the virtual openjdk14 package subpackages="$pkgname-jmods:_jmods:noarch $pkgname-demos:_demos:noarch $pkgname-doc:_doc:noarch $pkgname-jre:_jre $pkgname-src:_src:noarch $pkgname-jre-headless:_jre_headless $pkgname-jdk:_jdk" source="jdk-$_pkgver.tar.gz::https://github.com/openjdk/jdk14u/archive/jdk-$_pkgver.tar.gz build.patch aarch64.patch ppc64le.patch make-4.3.patch fix-bootjdk-check.patch HelloWorld.java TestECDSA.java TestCryptoLevel.java Alpine_Bug_10126.java " builddir="$srcdir/jdk14u-jdk-${_pkgver/+/-}" _java_home="/usr/lib/jvm/java-14-openjdk" ldpath="$_java_home/lib:$_java_home/lib/server" sonameprefix="$pkgname:" # enable running the JTReg tests in check? # see comment in that function for explanation _run_jtreg=${_run_jtreg:-0} if [ $_run_jtreg -ne 0 ]; then makedepends="$makedepends java-jtreg" checkdepends="$checkdepends ttf-freefont xvfb-run" fi prepare() { default_prepare # update autoconf files to detect alpine update_config_sub update_config_guess # remove not compilable module (hotspot jdk.hotspot.agent) # this needs libthread_db which is only provided by glibc # # haven't found any way to disable this module so just remove it. rm -r src/jdk.hotspot.agent } build() { if [ $_run_jtreg -ne 0 ]; then _with_jtreg="--with-jtreg=/usr/share/java/jtreg" else _with_jtreg="--with-jtreg=no" fi # CFLAGS, CXXFLAGS and LDFLAGS are ignored as shown by a warning # in the output of ./configure unless used like such: # --with-extra-cflags="$CFLAGS" # --with-extra-cxxflags="$CXXFLAGS" # --with-extra-ldflags="$LDFLAGS" # See also paragraph "Configure Control Variables" from "common/doc/building.md" # shellcheck disable=2097 disable=2098 CFLAGS='' CXXFLAGS='' LDFLAGS='' \ bash ./configure \ --build=$CBUILD \ --host=$CHOST \ --target=$CTARGET \ --prefix="$_java_home" \ --sysconfdir=/etc \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --localstatedir=/var \ --with-extra-cflags="$CFLAGS" \ --with-extra-cxxflags="$CXXFLAGS" \ --with-extra-ldflags="$LDFLAGS" \ --with-zlib=system \ --with-libjpeg=system \ --with-giflib=system \ --with-libpng=system \ --with-lcms=system \ --with-jobs=${JOBS:-4} \ --with-test-jobs=${JOBS:-4} \ --with-native-debug-symbols=none \ $_with_jtreg \ --disable-warnings-as-errors \ --disable-precompiled-headers \ --enable-dtrace=no \ --with-jvm-variants=server \ --with-debug-level=release \ --with-version-pre= \ --with-version-opt="alpine-r$pkgrel" \ --with-version-build=${_pkgver#*+} \ --with-vendor-name="Alpine" \ --with-vendor-url="https://alpinelinux.org/" \ --with-vendor-bug-url="https://gitlab.alpinelinux.org/alpine/aports/issues" \ --with-vendor-vm-bug-url="https://gitlab.alpinelinux.org/alpine/aports/issues" MAKEFLAGS='' make jdk-image } check() { local _java_bin="./build/linux-*-server-release/images/jdk/bin" # 1) compile and run a simple hello world $_java_bin/javac -d . "$srcdir"/HelloWorld.java $_java_bin/java HelloWorld # 2) compile and run a testcase for unlimited policy $_java_bin/javac -d . "$srcdir"/TestCryptoLevel.java $_java_bin/java -cp . --add-opens java.base/javax.crypto=ALL-UNNAMED TestCryptoLevel # 3) compile and run a testcase for ECDSA signatures $_java_bin/javac -d . "$srcdir"/TestECDSA.java $_java_bin/java TestECDSA # 4) compile and run testcase for bug 10126 $_java_bin/javac -d . "$srcdir"/Alpine_Bug_10126.java $_java_bin/java Alpine_Bug_10126 # run the gtest unittest suites # they don't take long, DO NOT DISABLE THEM! MAKEFLAGS='' make test-hotspot-gtest # The jtreg tests take very, very long to finish and show some failures (9 - 12 on my machine, varying between runs) # I think these are not critical and can be safely ignored. # As the tests take too long, they are disabled by default. # When updating this aport please let them run at least once on your machine to see if the failure count changes. if [ $_run_jtreg -ne 0 ]; then _logfile=$( mktemp -p "$builddir" ) MAKEFLAGS='' xvfb-run make \ run-test-tier1 \ run-test-tier2 \ run-test-tier3 \ | tee "$_logfile" msg "---------------------------------------" msg "The build log can be found at $_logfile" # abort the build so you may take a look at the logfile false return 1 fi } package() { mkdir -p "$pkgdir/$_java_home" cp -r build/linux-*-server-release/images/jdk/* "$pkgdir/$_java_home" } _jmods() { pkgdesc="Oracle OpenJDK 14 (jmods)" depends="" _fromroot="$pkgdir/$_java_home" _toroot="$subpkgdir/$_java_home" mkdir -p "$_toroot" mv "$_fromroot/jmods" "$_toroot" } _demos() { pkgdesc="Oracle OpenJDK 14 (demos)" depends="" _fromroot="$pkgdir/$_java_home" _toroot="$subpkgdir/$_java_home" mkdir -p "$_toroot" mv "$_fromroot/demo" "$_toroot" } _doc() { pkgdesc="Oracle OpenJDK 14 (Documentation)" depends="" _fromroot="$pkgdir/$_java_home" _toroot="$subpkgdir/$_java_home" mkdir -p "$_toroot" mv "$_fromroot/man" "$_toroot" } _jre() { pkgdesc="Oracle OpenJDK 14 (JRE)" depends="$pkgname-jre-headless" _fromroot="$pkgdir/$_java_home" _toroot="$subpkgdir/$_java_home" mkdir -p "$_toroot/lib" mv "$_fromroot/lib/libawt_xawt.so" \ "$_fromroot/lib/libfontmanager.so" \ "$_fromroot/lib/libjavajpeg.so" \ "$_fromroot/lib/libjawt.so" \ "$_fromroot/lib/libjsound.so" \ "$_fromroot/lib/liblcms.so" \ "$_fromroot/lib/libsplashscreen.so" \ "$_toroot/lib" } _src() { pkgdesc="Oracle OpenJDK 14 (sources)" depends="$pkgname-jre-headless" mkdir -p "$subpkgdir/$_java_home"/lib mv "$pkgdir"/$_java_home/lib/src.zip \ "$subpkgdir"/$_java_home/lib/ } _jre_headless() { pkgdesc="Oracle OpenJDK 14 (JRE headless)" depends="java-common java-cacerts" _fromroot="$pkgdir/$_java_home" _toroot="$subpkgdir/$_java_home" mkdir -p "$_toroot" mv "$_fromroot/lib" "$_toroot" mkdir -p "$_toroot/bin" for i in java \ jjs \ keytool \ rmid \ rmiregistry; do mv "$_fromroot/bin/$i" "$_toroot/bin/$i" done mv "$_fromroot/legal" "$_toroot" mv "$_fromroot/conf" "$_toroot" mv "$_fromroot/release" "$_toroot" cp "$builddir/ASSEMBLY_EXCEPTION" "$_toroot" cp "$builddir/LICENSE" "$_toroot" cp "$builddir/README" "$_toroot" # symlink to shared cacerts store rm "$_toroot/lib/security/cacerts" ln -sf /etc/ssl/certs/java/cacerts \ "$_toroot/lib/security/cacerts" # symlink for java-common to work (expects jre in $_java_home/jre) ln -sf . "$_toroot/jre" } _jdk() { pkgdesc="Oracle OpenJDK 14 (JDK)" depends="$pkgname-jre" _fromroot="$pkgdir/$_java_home" _toroot="$subpkgdir/$_java_home" mkdir -p "$_toroot" mv "$_fromroot/bin" "$_toroot" mv "$_fromroot/include" "$_toroot" } sha512sums="5d6c8697a156d807e03ef2185e9361dc1789c322dd9143bc2448a28aa2e5cbd74a09a67f52c45abbef186f09453ce9429c9202099c1adac4c21555f4a57a50b0 jdk-14+36.tar.gz 365baa5a2bc9c6414eb4d22aaaefe8132b4e9aca521617a8fcefe5d7dcac68b7081d624ec518247488b8c69f35d32d25369f2499c338fe49dddfe386188dae93 build.patch 97c5bdc3933bd7656a0d61d3cce9b1bf78d097712ee42776c48f659b06f1164c7098e0276c8d3ef171126ffb15a0745119105eac498e8b43307c779dc09bae02 aarch64.patch d1289ffbc0a631f15397f8fad9e2a07f0f4dde44ddd93c878934a93084609d136fbce1c39acaa35f3ca5f0979e7c0ce5ead6994e71ebf90fe1cd31b024e5c708 ppc64le.patch b8b420b9e73da54decbec04fab9ac1c79f3c01ef2f9af132cf98a008f9ff6544e67d98c109f8c48f224df9581a8b40399db25099766d9f3f9b11dafe5114c545 make-4.3.patch e54c69db6e97c9d7057275f6749565a748f42dadb397b2f3975d99608c4037ad93c84cf828c7e2955b1b4f1899dcc25069c8c6d675f1e963adf3f1223a47d56c fix-bootjdk-check.patch d1767dddd8e0956e25c0f77ed45c6fc86a1191bae1704a6dc33be490fd20eaa50461fe5c2a3349512059d555651e2eb41437dd3c1096c351e8ee68b4534a2579 HelloWorld.java 27e91edef89d26c0c5b9a813e2045f8d2b348745a506ae37b34b660fa7093da9a4e0e676ea41dc4a5c901bce02e5304d95e90f68d6c99cbf461b2da40a7a9853 TestECDSA.java b02dff8d549f88317bb4c741a9e269e8d59eef990197d085388fc49c7423a4eb9367dbe1e02bffb10e7862f5980301eb58d4494e177d0e8f60af6b05c7fbbe60 TestCryptoLevel.java fadd06c034614a25537246dfd66a4645c2a4c673f16b5d3e8abdd89c81baf04bd2797b26b0e589ec11ee08b90783b232a6d06c72589d211a5e10b8638a627911 Alpine_Bug_10126.java"