diff options
author | Caleb Maclennan | 2020-03-05 08:52:50 +0300 |
---|---|---|
committer | Caleb Maclennan | 2020-03-05 08:52:50 +0300 |
commit | a57aab8875c3b217e4726b1d314042b546ff2a19 (patch) | |
tree | 4f1f4d8892ea4a9b7db059137ee2574d0baae744 /PKGBUILD | |
download | aur-a57aab8875c3b217e4726b1d314042b546ff2a19.tar.gz |
Initial packaging
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..57587cd28314 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,23 @@ +# Maintainer: Caleb Maclennan <caleb@alerque.com> + +_npmname=node-addon-api +pkgname="${_npmname/-/js-}" +pkgver=2.0.0 +pkgrel=1 +pkgdesc='Node.js API (N-API)' +arch=('any') +url="https://github.com/nodejs/$_npmname" +license=('MIT') +depends=('nodejs') +makedepends=('npm' 'jq' 'moreutils') +source=("https://registry.npmjs.org/$_npmname/-/$_npmname-$pkgver.tgz") +sha256sums=('1a84bbf44b12660d2a241ee30338de6fd8be41992efa4bc8ceef42c763ce6088') +noextract=("${source[@]##*/}") + +package() { + npm install -g --user root --cache "$srcdir/npm-cache" --prefix "$pkgdir/usr" "${source[@]##*/}" + find "$pkgdir"/usr -type d -exec chmod 755 {} + + find "$pkgdir" -type f -name package.json \ + -execdir sh -c "jq '. |= with_entries(select(.key | test(\"_.+\") | not))' {} | sponge {}" \; + chown -R root:root "$pkgdir" +} |