summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD8
1 files changed, 7 insertions, 1 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 23ab826f1064..bdc751b967b4 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -8,17 +8,21 @@ arch=('any')
url="https://github.com/vs-ude/fyr"
license=('BSD')
depends=('nodejs' 'gcc')
-makedepends=('npm')
+makedepends=('npm' 'jq')
source=("https://registry.npmjs.org/$pkgname/-/$pkgname-$pkgver.tgz")
sha256sums=('6ba62ad3035a4b27176fd4d36081148c767f970deff9734bcc69032a28e38207')
package() {
+ # install production dependencies; this will also recompile the runtime using gcc
npm install -g --user root --prefix "$pkgdir"/usr "$srcdir"/$pkgname-$pkgver.tgz
# Non-deterministic race in npm gives 777 permissions to random directories.
# See https://github.com/npm/npm/issues/9359 for details.
find "${pkgdir}"/usr -type d -exec chmod 755 {} +
+ # Remove references to $pkgdir
+ find "$pkgdir" -name package.json -print0 | xargs -r -0 sed -i '/_where/d'
+
# Remove references to $srcdir
local tmppackage="$(mktemp)"
local pkgjson="$pkgdir/usr/lib/node_modules/$pkgname/package.json"
@@ -26,8 +30,10 @@ package() {
mv "$tmppackage" "$pkgjson"
chmod 644 "$pkgjson"
+ # install the license, as it is recommended for BSD
install -Dm644 "$srcdir/package/LICENSE.md" "$pkgdir/usr/share/licenses/$pkgname/LICENSE.md"
+ # link the fyrc binary to amke it accessible
mkdir -p "${pkgdir}/usr/bin/"
ln -s "/usr/lib/node_modules/$pkgname/bin/fyrc" "${pkgdir}/usr/bin/fyrc"
}