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

Felix Yan felixonmars at archlinux.org
Mon Dec 23 22:42:42 UTC 2019


    Date: Monday, December 23, 2019 @ 22:42:41
  Author: felixonmars
Revision: 539640

archrelease: copy trunk to community-testing-any

Added:
  npm/repos/community-testing-any/
  npm/repos/community-testing-any/PKGBUILD
    (from rev 539639, npm/trunk/PKGBUILD)

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

Copied: npm/repos/community-testing-any/PKGBUILD (from rev 539639, npm/trunk/PKGBUILD)
===================================================================
--- community-testing-any/PKGBUILD	                        (rev 0)
+++ community-testing-any/PKGBUILD	2019-12-23 22:42:41 UTC (rev 539640)
@@ -0,0 +1,66 @@
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+
+pkgname=npm
+pkgver=6.13.4
+pkgrel=1
+pkgdesc='A package manager for javascript'
+arch=('any')
+url='https://www.npmjs.com/'
+license=('custom:Artistic')
+depends=('nodejs' 'node-gyp' 'semver')
+# libgl: TODO
+# libvips: for sharp (doc build)
+# libxi: for cwebp (doc build)
+makedepends=('libgl' 'libvips' 'libxi' 'marked' 'marked-man' 'procps-ng' 'python')
+options=('!emptydirs')
+source=("$pkgname-$pkgver.tar.gz::https://github.com/npm/cli/archive/v$pkgver.tar.gz")
+sha512sums=('0b7b591bb73ea0ca25a5675e6c01c6289bdc85fd22cea399d0b7a0e428bda838d1f4ac279ee674de6ed7fcd1f3d2e91a3c8bd023ea8eaef211b8f4cee7ec718a')
+
+prepare() {
+  cd cli-$pkgver
+  mkdir -p node_modules/.bin
+  ln -sf /usr/bin/marked{,-man} node_modules/.bin/
+
+  # Use local marked/marked-man
+  sed -i 's|node bin/npm-cli.js install marked|true |' Makefile
+
+  # Don't build twice
+  sed -i 's/install: all/install:/' Makefile
+
+  mkdir -p man/man1
+
+  # Fix nodejs 13 compatibility
+  sed -i '/gatsby/ s/\^/>=/' docs/package.json
+  rm docs/package-lock.json
+}
+
+build() {
+  cd cli-$pkgver
+  NODE_PATH=/usr/lib/node_modules make
+}
+
+package() {
+  cd cli-$pkgver
+  make NPMOPTS="--prefix=\"$pkgdir/usr\"" install
+
+  # 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"
+
+  # Experimental dedup
+  _npmdir="$pkgdir"/usr/lib/node_modules/$pkgname
+  rm -r "$_npmdir"/node_modules/{,.bin/}semver
+  rm -r "$_npmdir"/node_modules/{,.bin/}node-gyp
+  sed -i '/node-gyp.js/c\  exec /usr/bin/node-gyp "$@"' \
+    "$_npmdir"/node_modules/npm-lifecycle/node-gyp-bin/node-gyp \
+    "$_npmdir"/bin/node-gyp-bin/node-gyp
+
+  install -dm755 "$pkgdir"/usr/share/bash-completion/completions
+  node "$srcdir"/cli-$pkgver/bin/npm-cli.js completion > "$pkgdir"/usr/share/bash-completion/completions/npm
+
+  install -Dm644 "$srcdir"/cli-$pkgver/LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
+}



More information about the arch-commits mailing list