add jdk21-graalvm-bin
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/cron/woodpecker Pipeline was successful

This commit is contained in:
nyyu 2023-09-22 19:03:06 +02:00
parent c5eaab3d6e
commit f469bee728
4 changed files with 118 additions and 0 deletions

View file

@ -0,0 +1,25 @@
pkgbase = jdk21-graalvm-bin
pkgdesc = Universal virtual machine for running applications written in a variety of languages (JVM-based, LLVM-based, or other), Java 21 version
pkgver = 21.0.0
pkgrel = 1
url = https://www.graalvm.org/
install = jdk21-graalvm-bin.install
arch = x86_64
arch = aarch64
license = custom
depends = java-runtime-common
depends = java-environment-common
optdepends = graaljs-jdk21-bin: JavaScript component (used to be bundled with this package before the 22.2.0 release)
optdepends = graal-llvm-jdk21-bin: LLVM component (used to be bundled with this package before the 22.2.0 release)
optdepends = graal-visualvm-jdk21-bin: VisualVM component (used to be bundled with this package before the 22.2.0 release)
provides = java-runtime=21
provides = java-environment=21
options = staticlibs
source = graalvm-rebuild-libpolyglot.hook
sha256sums = eae72b5a2a2826eed7e4be5710d33f82934622a390ab6a9f009ed7753359e02e
source_x86_64 = https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-21.0.0/graalvm-community-jdk-21.0.0_linux-x64_bin.tar.gz
sha256sums_x86_64 = 6c422941ccc58be5b891bb6499feeb72cd2b74d6729a29bf1fb8cc1a7d58b319
source_aarch64 = https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-21.0.0/graalvm-community-jdk-21.0.0_linux-aarch64_bin.tar.gz
sha256sums_aarch64 = bb4e92cf7eae91e474061aeae5ae75053a65cd558dbee76947827bf54d1b30a5
pkgname = jdk21-graalvm-bin

View file

@ -0,0 +1,35 @@
graal_=21.0.0
jdk_=${graal_%%+*}
java_=${jdk_%%.*}
pkgname="jdk${java_}-graalvm-bin"
pkgver=21.0.0
pkgrel=1
pkgdesc="Universal virtual machine for running applications written in a variety of languages (JVM-based, LLVM-based, or other), Java ${java_} version"
arch=('x86_64'
'aarch64')
url='https://www.graalvm.org/'
license=('custom')
depends=('java-runtime-common'
'java-environment-common')
makedepends=()
optdepends=("graaljs-jdk${java_}-bin: JavaScript component (used to be bundled with this package before the 22.2.0 release)"
"graal-llvm-jdk${java_}-bin: LLVM component (used to be bundled with this package before the 22.2.0 release)"
"graal-visualvm-jdk${java_}-bin: VisualVM component (used to be bundled with this package before the 22.2.0 release)")
provides=("java-runtime=${java_}"
"java-environment=${java_}")
options=('staticlibs')
install="$pkgname.install"
source=('graalvm-rebuild-libpolyglot.hook')
sha256sums=('eae72b5a2a2826eed7e4be5710d33f82934622a390ab6a9f009ed7753359e02e')
sha256sums_x86_64=('6c422941ccc58be5b891bb6499feeb72cd2b74d6729a29bf1fb8cc1a7d58b319')
sha256sums_aarch64=('bb4e92cf7eae91e474061aeae5ae75053a65cd558dbee76947827bf54d1b30a5')
source_x86_64=("https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-${jdk_}/graalvm-community-jdk-${jdk_}_linux-x64_bin.tar.gz")
source_aarch64=("https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-${jdk_}/graalvm-community-jdk-${jdk_}_linux-aarch64_bin.tar.gz")
package() {
cd "graalvm-community-openjdk-21+35.1"
mkdir -p "$pkgdir/usr/lib/jvm/java-${java_}-graalvm/"
cp -a -t "$pkgdir/usr/lib/jvm/java-${java_}-graalvm/" *
sed "s/JAVA/${java_}/g" < "../graalvm-rebuild-libpolyglot.hook" > "graalvm-jdk${java_}-rebuild-libpolyglot.hook"
install -DTm644 "graalvm-jdk${java_}-rebuild-libpolyglot.hook" "$pkgdir/usr/share/libalpm/hooks/graalvm-jdk${java_}-rebuild-libpolyglot.hook"
}

View file

@ -0,0 +1,11 @@
[Trigger]
Type = Path
Operation = Install
Operation = Upgrade
Operation = Remove
Target = usr/lib/jvm/java-JAVA-graalvm/*
[Action]
Description = Suggest rebuilding GraalVM libpolyglot component
When = PostTransaction
Exec = /usr/bin/printf '%s\n' 'Changes to GraalVM detected.' 'You may need to rebuild libpolyglot (and possibly other components) with the following command:' ' /usr/lib/jvm/java-JAVA-graalvm/bin/gu rebuild libpolyglot' "Note that this will take a while (which is why it's not done automatically):" 'the package maintainer has experienced CPU times upwards of _four hours_.' '(However, it parallelizes fairly well, so wall-clock time will depend on your CPU.)' "If you don't rebuild libpolyglot, then --polyglot without --jvm probably won't work right."

View file

@ -0,0 +1,47 @@
THIS_JDK='java-21-graalvm'
fix_default() {
if [ ! -x /usr/bin/java ]; then
/usr/bin/archlinux-java unset
echo ""
else
/usr/bin/archlinux-java get
fi
}
post_install() {
default=$(fix_default)
case ${default} in
"")
/usr/bin/archlinux-java set ${THIS_JDK}
;;
${THIS_JDK})
# Nothing
;;
*)
echo "Default Java environment is already set to '${default}'"
echo "See 'archlinux-java help' to change it"
;;
esac
if [ ! -f /etc/ssl/certs/java/cacerts ]; then
/usr/bin/update-ca-trust
fi
}
post_upgrade() {
default=$(fix_default)
if [ -z "${default}" ]; then
/usr/bin/archlinux-java set ${THIS_JDK}
fi
if [ ! -f /etc/ssl/certs/java/cacerts ]; then
/usr/bin/update-ca-trust
fi
}
pre_remove() {
if [ "x$(fix_default)" = "x${THIS_JDK}" ]; then
/usr/bin/archlinux-java unset
fi
}