blob: 15cde0c4a3ec15409839339f6e0292be366c368a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# Maintainer: das_kube
pkgname='esy'
pkgver='0.6.2'
arch=('i686' 'x86_64')
pkgrel='1'
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 > /dev/null 2> /dev/null
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"
}
|