diff options
author | Lucas Werkmeister | 2019-05-30 12:55:04 +0200 |
---|---|---|
committer | Lucas Werkmeister | 2019-05-30 12:55:04 +0200 |
commit | 23cee886c38666638963c6fe205d584cd6d626fa (patch) | |
tree | 54d5a171fb733c98fe2ddeb6a1a628d2e8050fc8 /PKGBUILD | |
download | aur-23cee886c38666638963c6fe205d584cd6d626fa.tar.gz |
Initial commit
Mostly copied from the graalpython-bin PKGBUILD (which is mostly the
same as the other Graal PKGBUILDs, that’s just the one I decided to
copy), with minor adjustments where necessary.
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..cec27c94a96d --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,60 @@ +# Maintainer: Lucas Werkmeister <mail@lucaswerkmeister.de> + +pkgname_=graal-native-image +pkgname=${pkgname_}-bin +pkgver_=19.0.0 +pkgver=${pkgver_/-/_} +pkgrel=1 +pkgdesc='Plugin to turn Graal-based applications into native binary images' +arch=('x86_64') +url='https://github.com/oracle/graal' +license=('custom') +depends=('graal') +makedepends=() +optdepends=() +provides=("$pkgname_") +conflicts=("$pkgname_") +source=("https://github.com/oracle/graal/releases/download/vm-${pkgver_}/native-image-installable-svm-linux-amd64-${pkgver_}.jar") +sha256sums=('1c794a3c038f4e6bb90542cf13ba3c6c793dcd193462bf56b8713fd24386e344') + +package() { + local file eq permissions mode name target + + mkdir -p "$pkgdir/usr/lib/jvm/java-8-graal/" "$pkgdir/usr/bin/" + cp -a -t "$pkgdir/usr/lib/jvm/java-8-graal/" 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 -DTm644 jre/lib/svm/LICENSE_NATIVEIMAGE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE" + + ln -s ../lib/jvm/java-8-graal/bin/${pkgname_} "$pkgdir/usr/bin/" +} |