1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
2 # Maintainer: Caleb Maclennan <caleb@alerque.com>
7 pkgdesc='Node.js native addon build tool'
9 url='https://github.com/nodejs/node-gyp'
11 depends=('nodejs' 'nodejs-nopt' 'python' 'semver')
13 source=(https://registry.npmjs.org/$pkgname/-/$pkgname-$pkgver.tgz)
14 noextract=($pkgname-$pkgver.tgz)
15 sha512sums=('e10d7a642aaade0f1ac24e94a654fb02ec50df95cde11ff27fffb0480c1c05402383b979f114da72d59a3fc7c80d38b417323b61c54bba3c04c5a91995f5a45e')
18 npm install -g --prefix "$pkgdir"/usr "$srcdir"/$pkgname-$pkgver.tgz
20 # Non-deterministic race in npm gives 777 permissions to random directories.
21 # See https://github.com/npm/npm/issues/9359 for details.
22 chmod -R u=rwX,go=rX "$pkgdir"
24 # npm installs package.json owned by build user
25 # https://bugs.archlinux.org/task/63396
26 chown -R root:root "$pkgdir"
29 rm -r "$pkgdir"/usr/lib/node_modules/$pkgname/node_modules/{,.bin/}nopt
30 rm -r "$pkgdir"/usr/lib/node_modules/$pkgname/node_modules/{,.bin/}semver
32 install -d "$pkgdir"/usr/share/licenses/$pkgname
33 ln -s ../../../lib/node_modules/$pkgname/LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE