summaryrefslogtreecommitdiff
path: root/user/openjdk14/APKBUILD
diff options
context:
space:
mode:
authorZach van Rijn <me@zv.io>2022-02-04 23:53:34 +0000
committerZach van Rijn <me@zv.io>2022-11-02 11:12:02 -0500
commit43f068ae24b0088de194d165482e80cf5197ad92 (patch)
treef3dec4e0d475be74efdbb212015e499e6e3bfe57 /user/openjdk14/APKBUILD
parent837ad061996d6e76158598a88a3101cfbe95bee3 (diff)
downloadpackages-43f068ae24b0088de194d165482e80cf5197ad92.tar.gz
packages-43f068ae24b0088de194d165482e80cf5197ad92.tar.bz2
packages-43f068ae24b0088de194d165482e80cf5197ad92.tar.xz
packages-43f068ae24b0088de194d165482e80cf5197ad92.zip
user/openjdk14: new package
Diffstat (limited to 'user/openjdk14/APKBUILD')
-rw-r--r--user/openjdk14/APKBUILD307
1 files changed, 307 insertions, 0 deletions
diff --git a/user/openjdk14/APKBUILD b/user/openjdk14/APKBUILD
new file mode 100644
index 000000000..62893fdac
--- /dev/null
+++ b/user/openjdk14/APKBUILD
@@ -0,0 +1,307 @@
+# Contributor: Simon Frankenberger <simon-alpine@fraho.eu>
+# Maintainer: Zach van Rijn <me@zv.io>
+pkgname=openjdk14
+pkgver=14.0.2_p12
+_pkgver=${pkgver%_p*}-ga
+pkgrel=2
+pkgdesc="Oracle OpenJDK 14"
+provider_priority=14
+url="https://hg.openjdk.java.net/jdk-updates/jdk14u"
+# x86, armhf and armv7 are not supported by Oracle due to being 32-bit
+# mips64 and riscv64 blocked by openjdk13
+arch="all !x86 !armhf !armv7 !mips64 !riscv64"
+license="GPL-2.0-with-classpath-exception"
+makedepends="autoconf
+ bash
+ file
+ 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
+ utmps-dev
+ zlib-dev
+ cmd:which
+ "
+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
+ fix-bootjdk-check.patch
+ gcc10-compilation-fix.patch
+ JDK-8245051.patch
+
+ HelloWorld.java
+ TestECDSA.java
+ TestCryptoLevel.java
+ Alpine_Bug_10126.java
+"
+builddir="$srcdir/jdk14u-jdk-$(printf "%s" "${_pkgver}" | tr '+' '-')"
+
+_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() {
+ export PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+ 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"
+ provides=java-jre
+ _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"
+ provides=java-jre-headless
+ _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"
+ provides=java-jdk
+ _fromroot="$pkgdir/$_java_home"
+ _toroot="$subpkgdir/$_java_home"
+
+ mkdir -p "$_toroot"
+ mv "$_fromroot/bin" "$_toroot"
+ mv "$_fromroot/include" "$_toroot"
+}
+
+sha512sums="e76b7908e7b1375029564d39386c86b640fcb61c7152bdda7249a6455516792830f17e987c98790ae5983087b928be6f5d572b8b10f3e2318d2d993f5f22ed62 jdk-14.0.2-ga.tar.gz
+c2da2d73f47c71768028a31282438389ef4f06d0985b8c4d769487745bd14ce65fbb430a2f420eb6dba8af7a69927f0e8cba285c7e0b17bde234357792534ba7 build.patch
+f7fd94b04740e2a3f966577a5c02f7d6db38ef0ab3ef7b3183cd3ba3d8ff7304e3151fba03a4bcbb9f82f380a723d7823794e168ebf9f2fa8d5e7a9dbc895ce9 aarch64.patch
+a02b35842c71ee5513d24e82b4edcda4943af6aaa54188775d2a36e9e70d35d16823df92df6390ceee222a1a7661ac6116e6edaf5c67bfe239efb15eb6457f57 ppc64le.patch
+a916200ffdd4e4be0233fa020a30f4b0aabb92dc1956ce75e4372afc6fb22cad8333770d5381086e91c1ed4159a9620a37de3e5b175c8f025ec9040ad016fce2 fix-bootjdk-check.patch
+32dbebd5d2f6741e9917af89ec86308dbd766dfb24ddee6f42bfe8b68a4d82c5dd886a061147c3aab75c8092b30c93aec49737458716c7af8900d5d73dfb0567 gcc10-compilation-fix.patch
+0254dae7aef9bd6c4e19ac3c31f0b7bf8f818ead8858b1cd4e29e4572a5b0932de1ba498ba2c60a03dce77da235fdad23e7a4be5bea298bba3951752d313d1b4 JDK-8245051.patch
+d1767dddd8e0956e25c0f77ed45c6fc86a1191bae1704a6dc33be490fd20eaa50461fe5c2a3349512059d555651e2eb41437dd3c1096c351e8ee68b4534a2579 HelloWorld.java
+27e91edef89d26c0c5b9a813e2045f8d2b348745a506ae37b34b660fa7093da9a4e0e676ea41dc4a5c901bce02e5304d95e90f68d6c99cbf461b2da40a7a9853 TestECDSA.java
+b02dff8d549f88317bb4c741a9e269e8d59eef990197d085388fc49c7423a4eb9367dbe1e02bffb10e7862f5980301eb58d4494e177d0e8f60af6b05c7fbbe60 TestCryptoLevel.java
+cc466f64fcc8762cf6e3c1f5739be6425209b27aa58acff4e7eb126003d61fa18266f0e79e57e9d84224654010185ab45dc0a8043543dea227258458a00a1eb1 Alpine_Bug_10126.java"