summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorLucas Werkmeister2021-07-31 19:20:02 +0200
committerLucas Werkmeister2021-07-31 19:20:02 +0200
commit8e2039842dde2e7a2760558e2595fbb0315ebebc (patch)
tree3fafcb828c23561ab6c07238a97208f16ac9ffd9 /PKGBUILD
parent91b3f5c58e20272551592c60b65850cca7c8f6dc (diff)
downloadaur-jdk8-graalvm-bin.tar.gz
Install alpm hook recommending `gu rebuild libpolyglot`
Apparently the only reason that the `node --polyglot` added to test.sh in the previous commit worked on my system is that it silently fell back to `node --polyglot --jvm`; however, it’s *supposed* to run polyglot Node + everything else as a native image, without a JVM. And apparently, R can’t be built as a native image (for engineering reasons, I’ve been told), so if it doesn’t fall back to --jvm mode, then our test doesn’t work. Consequently, we should actually specify --polyglot --jvm. The fallback happens when libpolyglot.so is missing. It’s supposed to be built by `gu rebuild libpolyglot`, and apparently `gu` prints a message recommending that you run this command when you use it to install a new language; since we bypass gu, we should print a similar message in our package installation process. We don’t directly run the command for the same reason that gu doesn’t: it’s way too expensive, requiring over four hours of CPU time on my system. Even as a hook, rather than a post-install script (i.e. only running once at the end of all package installs, not once per package), I can’t justify this expenditure for everyone installing the package, especially since most people probably won’t need this (evidently I’ve been using GraalVM for years without ever having built libpolyglot.so). So we just make the hook print a message for users, and they can hopefully decide for themselves if they want to run the command or not. (If people ask about the message in the AUR comments, we can probably iterate on the phrasing a bit.)
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD10
1 files changed, 7 insertions, 3 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 4912879470de..abc54a07e127 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
java_=8
pkgname="jdk${java_}-graalvm-bin"
pkgver=21.2.0
-pkgrel=1
+pkgrel=2
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')
url='https://www.graalvm.org/'
@@ -15,12 +15,16 @@ optdepends=("graal-nodejs-jdk${java_}-bin: Node.js component (used to be bundled
provides=("java-runtime=${java_}"
"java-environment=${java_}")
install="$pkgname.install"
-source=("https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-${pkgver}/graalvm-ce-java${java_}-linux-amd64-${pkgver}.tar.gz")
-sha256sums=('0ea16ff2fe178800195e2918ee7ceee352601d4161a17eac67979febaaecfe05')
+source=("https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-${pkgver}/graalvm-ce-java${java_}-linux-amd64-${pkgver}.tar.gz"
+ 'graalvm-rebuild-libpolyglot.hook')
+sha256sums=('0ea16ff2fe178800195e2918ee7ceee352601d4161a17eac67979febaaecfe05'
+ 'SKIP')
package() {
cd "graalvm-ce-java${java_}-${pkgver}"
mkdir -p "$pkgdir/usr/lib/jvm/java-${java_}-graalvm/"
cp -a -t "$pkgdir/usr/lib/jvm/java-${java_}-graalvm/" *
install -DTm644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+ 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"
}