summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucas Werkmeister2019-11-25 00:31:32 +0100
committerLucas Werkmeister2019-11-25 00:48:39 +0100
commita902a721179578fde41e6b77d34240df21c09b56 (patch)
tree00bfd4e967711411e97cbddbfd5d86ca99b49f9e
downloadaur-a902a721179578fde41e6b77d34240df21c09b56.tar.gz
Initial commit
With the 19.3.0 release, GraalVM supports two Java versions: Java 8 and Java 11. This also affects all sibling packages, including FastR, so the former fastr-bin package is split in two: fastr-jdk8-bin (this package) and fastr-jdk11-bin. We use this opportunity to make several other adjustments as well. We no longer provide a version of the package name without the “-bin” suffix. It doesn’t seem likely that a built-from-source version will be added to the AUR soon, and other packages like jdk8-openj9-bin or jdk8-j9-bin don’t provide non-bin versions either. Since this release no longer includes the GCC libraries required by FastR, we have to depend on gcc-libs and also gcc6-libs (FastR requires an older version of libgfortran.so than the one provided by gcc-libs). gcc6-libs doesn’t install its libs into /usr/lib, so we symlink its libgfortran.so.3 into FastR’s lib folder; this works for R, but not for Rscript, so for now the Rscript launcher is slightly tweaked to update the LD_LIBRARY_PATH. This may change in the future, depending on feedback from the FastR developers. And finally, a .gitignore file never hurts.
-rw-r--r--.SRCINFO16
-rw-r--r--.gitignore9
-rw-r--r--PKGBUILD66
3 files changed, 91 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..1034b907b941
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,16 @@
+pkgbase = fastr-jdk8-bin
+ pkgdesc = GraalVM-based, high-performance implementation of the R language (Java 8 version)
+ pkgver = 19.3.0
+ pkgrel = 1
+ url = https://github.com/oracle/fastr
+ arch = x86_64
+ license = GPL3
+ depends = jdk8-graalvm-bin
+ depends = gcc-libs
+ depends = gcc6-libs
+ depends = sed
+ source = https://github.com/oracle/fastr/releases/download/vm-19.3.0/r-installable-java8-linux-amd64-19.3.0.jar
+ sha256sums = 9b2b87d30c67579eea3c2fe92b28ebc71fabf7b2573f711b8618a064a1f7288f
+
+pkgname = fastr-jdk8-bin
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..88c136076055
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,9 @@
+# source
+/*.jar
+
+# build
+/src/
+/pkg/
+
+# package
+/*.pkg.tar*
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..d2ab7384dfd4
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,66 @@
+# Maintainer: Lucas Werkmeister <mail@lucaswerkmeister.de>
+
+java_=8
+pkgname_=fastr
+pkgname="${pkgname_}-jdk${java_}-bin"
+pkgver=19.3.0
+pkgrel=1
+pkgdesc="GraalVM-based, high-performance implementation of the R language (Java ${java_} version)"
+arch=('x86_64')
+url='https://github.com/oracle/fastr'
+license=('GPL3')
+depends=("jdk${java_}-graalvm-bin"
+ 'gcc-libs' # for libgomp.so.1 and others
+ 'gcc6-libs' # for libgfortran.so.3 (gcc-libs has .so.5)
+ 'sed') # for Rscript fix; TODO remove once no longer needed
+source=("https://github.com/oracle/$pkgname_/releases/download/vm-${pkgver}/r-installable-java${java_}-linux-amd64-${pkgver}.jar")
+sha256sums=('9b2b87d30c67579eea3c2fe92b28ebc71fabf7b2573f711b8618a064a1f7288f')
+
+package() {
+ local file eq permissions mode name target
+
+ mkdir -p "$pkgdir/usr/lib/jvm/java-${java_}-graalvm/"
+ cp -a -t "$pkgdir/usr/lib/jvm/java-${java_}-graalvm/" jre/ LICENSE_FASTR 3rd_party_licenses_fastr.txt
+
+ 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--r--') mode=744;; # oracle/fastr#119
+ '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-${java_}-graalvm/$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-${java_}-graalvm/$(dirname -- "$name")"
+ ln -s -- "$target" "$pkgdir/usr/lib/jvm/java-${java_}-graalvm/$name"
+ done < META-INF/symlinks
+
+ ln -s -- '/usr/lib/gcc/x86_64-pc-linux-gnu/6.5.0/libgfortran.so.3' "$pkgdir/usr/lib/jvm/java-${java_}-graalvm/jre/languages/R/lib/libgfortran.so.3"
+
+ install -DTm644 LICENSE_FASTR "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+
+ sed -i "/^exec/ i\\
+# added by AUR package, hopefully temporarily\\
+export LD_LIBRARY_PATH=/usr/lib/jvm/java-${java_}-graalvm/jre/languages/R/lib\${LD_LIBRARY_PATH:+:\$LD_LIBRARY_PATH}\\
+
+" "$pkgdir/usr/lib/jvm/java-${java_}-graalvm/jre/languages/R/bin/Rscript"
+}