1
0
mirror of https://github.com/bertptrs/aur.git synced 2025-12-27 05:20:32 +01:00
Files
aur/PKGBUILD
Bert Peters 819f9771ff Update to v0.13.0.
This commit has not been published to Github, hence the original version
posted earlier today and hence the switch to using npm's archive.
2019-04-30 11:34:19 +02:00

33 lines
1.1 KiB
Bash

# Maintainer: Bert Peters <bert@bertptrs.nl>
_npmname=node-pre-gyp
pkgname=nodejs-node-pre-gyp
pkgver=0.13.0
pkgrel=1
pkgdesc="Node.js tool for easy binary deployment of C++ addons "
arch=('any')
url="https://github.com/mapbox/node-pre-gyp"
license=('BSD')
depends=('nodejs')
makedepends=('npm' 'jq')
source=("https://registry.npmjs.org/$_npmname/-/$_npmname-$pkgver.tgz")
noextract=("$_npmname-$pkgver.tgz")
sha1sums=('df9ab7b68dd6498137717838e4f92a33fc9daa42')
package() {
npm install -g --user root --prefix "$pkgdir/usr" "$_npmname-$pkgver.tgz"
# Remove references to $pkgdir
find "$pkgdir" -type f -name package.json -print0 | xargs -0 sed -i "/_where/d"
# Remove references to $srcdir
local tmppackage="$(mktemp)"
local pkgjson="$pkgdir/usr/lib/node_modules/$_npmname/package.json"
jq '.|=with_entries(select(.key|test("_.+")|not))' "$pkgjson" > "$tmppackage"
mv "$tmppackage" "$pkgjson"
chmod 644 "$pkgjson"
# Install LICENSE in a more findable spot.
install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname" \
"$pkgdir/usr/lib/node_modules/$_npmname/LICENSE"
}