# Maintainer: Chih-Hsuan Yen _npmname=web-ext pkgname=nodejs-$_npmname # All lowercase pkgver=2.7.0 pkgrel=1 pkgdesc='A command line tool to help build, run, and test web extensions' arch=(any) url='https://developer.mozilla.org/en-US/Add-ons/WebExtensions' license=('MPL2') depends=('nodejs') makedepends=('npm' 'python2') source=(https://registry.npmjs.org/$_npmname/-/$_npmname-$pkgver.tgz) sha256sums=('6a0ed5c63d733210c530a2bb79a36d860a67021232f257158af8540910712de7') package() { local _npmdir="$pkgdir/usr/lib/node_modules/" cd "$srcdir" mkdir -p $_npmdir cp -r --no-preserve=ownership package "$_npmdir/$_npmname" cd "$_npmdir/$_npmname" PYTHON=python2 npm install --production mkdir -p "$pkgdir/usr/bin" ln -s "/usr/lib/node_modules/$_npmname/bin/$_npmname" "$pkgdir/usr/bin/$_npmname" # Ref: https://wiki.archlinux.org/index.php/Node.js_package_guidelines # 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 {} + } # vim:set ts=2 sw=2 et: