blob: 0aad6883a02f6d15b98aabdb54fbbd41ecb3c488 (
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
38
39
40
41
42
43
44
45
46
47
48
49
|
# Maintainer: Caleb Maclennan <caleb@alerque.com>
pkgname=nodejs-addon-api
_npmname=${pkgname/js}
pkgver=8.3.0
pkgrel=1
pkgdesc='Node.js API (N-API)'
arch=(any)
url="https://github.com/nodejs/$_npmname"
license=(MIT)
depends=('nodejs>=14')
makedepends=(jq
moreutils
npm)
_archive="$_npmname-$pkgver"
source=("$url/archive/v$pkgver/$_archive.tar.gz")
sha256sums=('a5ddbbe7c4a04aa4d438205e2f90bfc476042951e8ebddac6883f123a7e88cae')
prepare() {
cd "$_archive"
# Suppress install or link against this package triggering a build!
jq 'del(.scripts[])' package.json | sponge package.json
}
build() {
cd "$_archive"
npm pack
}
package() {
cd "$_archive"
npm install \
--production \
--global \
--no-update-notifier \
--no-audit \
--no-fund \
--cache "$srcdir/npm-cache" \
--prefix "$pkgdir/usr" \
$_archive.tgz
# Non-deterministic race in npm gives 777 permissions to random directories.
# See https://github.com/npm/npm/issues/9359 for details.
chmod -R u=rwX,go=rX "$pkgdir"
# npm installs package.json owned by build user
# https://bugs.archlinux.org/task/63396
chown -R root:root "$pkgdir"
}
|