[arch-commits] Commit in (npm6 npm6/repos npm6/trunk npm6/trunk/PKGBUILD)
Kpcyrd
kpcyrd at archlinux.org
Tue Apr 13 01:59:16 UTC 2021
Date: Tuesday, April 13, 2021 @ 01:59:15
Author: kpcyrd
Revision: 916119
addpkg: npm6 6.14.13-1
Added:
npm6/
npm6/repos/
npm6/trunk/
npm6/trunk/PKGBUILD
----------+
PKGBUILD | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 66 insertions(+)
Added: npm6/trunk/PKGBUILD
===================================================================
--- npm6/trunk/PKGBUILD (rev 0)
+++ npm6/trunk/PKGBUILD 2021-04-13 01:59:15 UTC (rev 916119)
@@ -0,0 +1,66 @@
+# Maintainer: kpcyrd <kpcyrd[at]archlinux[dot]org>
+# Contributor: Felix Yan <felixonmars at archlinux.org>
+
+pkgname=npm6
+_pkgname=npm
+pkgver=6.14.13
+pkgrel=1
+pkgdesc='A package manager for javascript'
+arch=('any')
+url='https://www.npmjs.com/'
+license=('custom:Artistic')
+provides=('npm')
+conflicts=('npm')
+depends=('nodejs' 'node-gyp' 'semver')
+# libgl: TODO
+# libvips: for sharp (doc build) (disabled as current version of gatsby imports a broken sharp)
+# libxi: for cwebp (doc build)
+makedepends=('libgl' '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=('8a623054ec2fd4423b841ab6e4e4ea48cb4b1a8e1a52f32faef19464dc50b391066c568aa910852304278319a061a5cc0aa2565eda1640171d4231f2ce2f77a3')
+
+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
+}
+
+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