summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorlilac2018-09-20 02:28:13 +0800
committerlilac2018-09-20 02:28:13 +0800
commitf45c49c83724b2ef0c2371db10f4809809004f42 (patch)
tree195c2977569fd950bcc6e8fcd1381a0e9567c130 /PKGBUILD
parentae489c9fa596440f213758376814d4cc295b8c63 (diff)
downloadaur-f45c49c83724b2ef0c2371db10f4809809004f42.tar.gz
update by lilac
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD39
1 files changed, 32 insertions, 7 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 4737ad6bf3b8..4f249e6d59c6 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,32 +3,57 @@
_npmname=web-ext
pkgname=nodejs-$_npmname
pkgver=2.9.1
-pkgrel=3
+pkgrel=5
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=('yarn' 'node-gyp' 'python2')
+makedepends=('yarn' 'node-gyp' 'python2' 'git')
# to speed up the build
options=('!strip')
-source=(https://registry.npmjs.org/$_npmname/-/$_npmname-$pkgver.tgz)
-sha256sums=('c9a0502df328f40a26457c31b59c3986497bec18d5f99c4272f7e2d6aa100ba8')
+# unit tests expect a git repo
+source=("git+https://github.com/mozilla/web-ext.git#tag=$pkgver"
+ exclude-scoped-modules.diff)
+sha256sums=('SKIP'
+ 'badc28aad41212d3b08255298b48e43022f918a73e030a7f0245047cb9e33228')
+
+prepare() {
+ cd "$srcdir/$_npmname"
+ patch -Np1 -i ../exclude-scoped-modules.diff
+
+ cd "$srcdir"
+ # -build for running webpack and tests, and the original for actual packaging
+ cp -r $_npmname{,-build}
+}
build() {
- cd package
+ cd "$srcdir/$_npmname-build"
+
+ PYTHON=python2 yarn install
+ NODE_ENV=production yarn run build
+ cp -r dist "$srcdir/$_npmname"
+ cd "$srcdir/$_npmname"
PYTHON=python2 yarn install --production
}
+check() {
+ cd "$srcdir/$_npmname-build"
+
+ yarn test
+}
+
package() {
local _npmdir="$pkgdir/usr/lib/node_modules/"
install -Ddm755 "$_npmdir"
- cp -r --no-preserve=ownership package "$_npmdir/$_npmname"
+ cp -r --no-preserve=ownership $_npmname "$_npmdir/$_npmname"
# remove references to $pkgdir
- rm -r "$pkgdir"/usr/lib/node_modules/web-ext/node_modules/dtrace-provider/build/
+ rm -r "$_npmdir"/web-ext/node_modules/dtrace-provider/build/
+
+ rm -r "$_npmdir"/web-ext/.git
install -Ddm755 "$pkgdir/usr/bin"
ln -s "/usr/lib/node_modules/$_npmname/bin/$_npmname" "$pkgdir/usr/bin/$_npmname"