summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Cruanes2019-03-24 20:49:19 -0500
committerSimon Cruanes2019-03-24 20:49:19 -0500
commit324137ac1f5b155a9849bbf708059af8d4d4f349 (patch)
tree7fcec4802921dc358c9308d91f7c4be1b114feb9
downloadaur-324137ac1f5b155a9849bbf708059af8d4d4f349.tar.gz
add esy 0.5.6, an ocaml package manager
-rw-r--r--.SRCINFO13
-rw-r--r--PKGBUILD37
2 files changed, 50 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..42748a937829
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,13 @@
+pkgbase = esy
+ pkgdesc = package manager for OCaml/Reason
+ pkgver = 0.5.6
+ pkgrel = 0
+ url = https://esy.sh/
+ arch = x86
+ arch = x86_64
+ license = custom
+ makedepends = npm>=6.9
+ depends = gcc-libs
+
+pkgname = esy
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..6e8a3c3c8141
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,37 @@
+# Maintainer: das_kube
+pkgname='esy'
+pkgver='0.5.6'
+arch=('x86' 'x86_64')
+pkgrel='0'
+pkgdesc="package manager for OCaml/Reason"
+url="https://esy.sh/"
+license=('custom')
+depends=('bash' 'gcc-libs')
+makedepends=('npm>=6.9')
+
+prepare() {
+ # directory for node_modules
+ mkdir -p snapshot
+ cd snapshot/
+ npm init -y
+ npm install "esy@${pkgver}" --no-scripts
+}
+
+build() {
+ # magic script to invoke the actual esy binary
+ echo > esy.sh '#!/bin/sh
+exec /opt/esy/node_modules/esy/_build/default/bin/esy.exe
+'
+
+ # cleanup
+ find snapshot -type d \( -name 'platform-linux' -or -name 'platform-darwin' \
+ -or -name 'platform-windows' -or -name 'platform-win32' \) -exec rm -rf {} \; -prune
+ find snapshot -name '*.exe' -exec chmod a+x {} \;
+}
+
+package() {
+ mkdir -p "$pkgdir/usr/bin/"
+ mkdir -p "$pkgdir/opt/"
+ install -Dm755 esy.sh "$pkgdir/usr/bin/esy"
+ cp -r snapshot/ "$pkgdir/opt/esy"
+}