[arch-commits] Commit in web-ext/repos (2 files)

Chih-Hsuan Yen yan12125 at archlinux.org
Thu Mar 11 15:55:29 UTC 2021


    Date: Thursday, March 11, 2021 @ 15:55:29
  Author: yan12125
Revision: 887547

archrelease: copy trunk to community-testing-any

Added:
  web-ext/repos/community-testing-any/
  web-ext/repos/community-testing-any/PKGBUILD
    (from rev 887546, web-ext/trunk/PKGBUILD)

----------+
 PKGBUILD |   61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

Copied: web-ext/repos/community-testing-any/PKGBUILD (from rev 887546, web-ext/trunk/PKGBUILD)
===================================================================
--- community-testing-any/PKGBUILD	                        (rev 0)
+++ community-testing-any/PKGBUILD	2021-03-11 15:55:29 UTC (rev 887547)
@@ -0,0 +1,61 @@
+# Maintainer: Chih-Hsuan Yen <yan12125 at archlinux.org>
+
+pkgname=web-ext
+pkgver=6.0.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')
+# See upstream package.json
+depends=('nodejs>=12.0.0')
+makedepends=('npm' 'node-gyp')
+replaces=('nodejs-web-ext')
+provides=('nodejs-web-ext')
+conflicts=('nodejs-web-ext')
+# to speed up the build
+options=('!strip')
+# tarball on npmjs lacks scripts for building from sources
+source=("https://github.com/mozilla/web-ext/archive/$pkgver/web-ext-$pkgver.tar.gz")
+sha256sums=('432bf216035360b957fc06daba8588678a03e8b85d6a0b7c2304e3ca7ffc3490')
+
+prepare() {
+  cd "$srcdir"
+
+  # -build for running webpack and tests, and the original for actual packaging
+  cp -r $pkgname-$pkgver{,-build}
+}
+
+build() {
+  cd "$srcdir/$pkgname-$pkgver-build"
+
+  npm install
+  NODE_ENV=production npm run build
+  cp -r dist "$srcdir/$pkgname-$pkgver"
+
+  cd "$srcdir/$pkgname-$pkgver"
+  npm install --production
+}
+
+check() {
+  cd "$srcdir/$pkgname-$pkgver-build"
+
+  npm test
+}
+
+package() {
+  local _npmdir="$pkgdir/usr/lib/node_modules/"
+
+  install -Ddm755 "$_npmdir"
+  cp -r --no-preserve=ownership $pkgname-$pkgver "$_npmdir/$pkgname"
+
+  # dtrace-provider (brought in by bunyan) is not used on Linux, and its build artifacts makes this package unreproducible
+  rm -r "$_npmdir"/web-ext/node_modules/dtrace-provider/build/
+
+  # Non-deterministic race in npm gives 777 permissions to random directories.
+  # See https://github.com/npm/cli/issues/1103 for details.
+  find "${pkgdir}/usr" -type d -exec chmod 755 {} +
+
+  install -Ddm755 "$pkgdir/usr/bin"
+  ln -s "/usr/lib/node_modules/$pkgname/bin/$pkgname" "$pkgdir/usr/bin/$pkgname"
+}



More information about the arch-commits mailing list