summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucas Werkmeister2018-04-28 20:15:12 +0200
committerLucas Werkmeister2018-04-28 20:15:12 +0200
commit4bbf5e0d279bfcf056629a73f6e6ce1bf5e2dee5 (patch)
treef67da3f4b41e85b233d22253a38d02a5be590fb9
downloadaur-4bbf5e0d279bfcf056629a73f6e6ce1bf5e2dee5.tar.gz
Initial commit
Extract the jar file under Graal’s JAVA_HOME, and then adjust permissions and symlinks according to the respective META-INF files (since the zip format is not guaranteed to support them). This is enough to make R work (assuming /usr/lib/jvm/default/bin/ is in your PATH), including polyglot use (R --polyglot, eval.polyglot()), but apparently not to enable other Graal languages to use R. I’m not sure why that is, or if that’s even a fault of this package (I seem to get the same result when installing the package with `gu` directly).
-rw-r--r--.SRCINFO15
-rw-r--r--PKGBUILD55
2 files changed, 70 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..0014f3c5c5b7
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,15 @@
+# Generated by mksrcinfo v8
+# Sat Apr 28 18:14:47 UTC 2018
+pkgbase = fastr
+ pkgdesc = Graal based, high-performance implementation of the R language
+ pkgver = 1.0.0_rc1
+ pkgrel = 1
+ url = https://github.com/oracle/fastr
+ arch = x86_64
+ license = GPL3
+ depends = graal
+ source = https://github.com/oracle/fastr/releases/download/vm-1.0.0-rc1/r-installable-linux-amd64.jar
+ sha256sums = 8293611f4640de8a5783ae23e4ad5c853117b66b589c015fc1f8a8ac6c8e8c68
+
+pkgname = fastr
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..9c0fb57bb15d
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,55 @@
+# Maintainer: Lucas Werkmeister <mail@lucaswerkmeister.de>
+
+pkgname=fastr
+pkgver_=1.0.0-rc1
+pkgver=${pkgver_/-/_}
+pkgrel=1
+pkgdesc='Graal based, high-performance implementation of the R language'
+arch=('x86_64')
+url='https://github.com/oracle/fastr'
+license=('GPL3')
+depends=('graal')
+makedepends=()
+optdepends=()
+source=("https://github.com/oracle/fastr/releases/download/vm-${pkgver_}/r-installable-linux-amd64.jar")
+sha256sums=('8293611f4640de8a5783ae23e4ad5c853117b66b589c015fc1f8a8ac6c8e8c68')
+
+package() {
+ local file eq permissions mode name target
+
+ mkdir -p "$pkgdir/usr/lib/jvm/java-8-graal/"
+ cp -a -t "$pkgdir/usr/lib/jvm/java-8-graal/" docs/ jre/
+
+ printf '\n' >> META-INF/permissions
+ while read -r file eq permissions; do
+ if [[ $eq != '=' ]]; then
+ printf >&2 'second word should be "=": %s %s %s\n' "$file" "$eq" "$permissions"
+ return 1
+ fi
+ case $permissions in
+ 'rw-------') mode=600;;
+ 'rw-r--r--') mode=644;;
+ 'rw-rw-r--') mode=664;;
+ 'rwxr-xr-x') mode=755;;
+ 'rwxrwxr-x') mode=775;;
+ 'rwxrwxrwx') continue;; # symbolic link
+ *)
+ printf >&2 'unknown permissions: %s\n' "$permissions"
+ return 1
+ ;;
+ esac
+ chmod "$mode" -- "$pkgdir/usr/lib/jvm/java-8-graal/$file"
+ done < META-INF/permissions
+
+ printf '\n' >> META-INF/symlinks
+ while read -r name eq target; do
+ if [[ $eq != '=' ]]; then
+ printf >&2 'second word should be "=": %s %s %s\n' "$name" "$eq" "$target"
+ return 1
+ fi
+ mkdir -p -- "$pkgdir/usr/lib/jvm/java-8-graal/$(dirname -- "$name")"
+ ln -s -- "$target" "$pkgdir/usr/lib/jvm/java-8-graal/$name"
+ done < META-INF/symlinks
+
+ install -Dm644 jre/languages/R/GraalCE_R_license_3rd_party_license.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}