Date: Sunday, February 20, 2022 @ 20:48:40 Author: felixonmars Revision: 1135392
archrelease: copy trunk to community-any Added: npm/repos/community-any/PKGBUILD (from rev 1135391, npm/trunk/PKGBUILD) Deleted: npm/repos/community-any/PKGBUILD ----------+ PKGBUILD | 128 ++++++++++++++++++++++++++++++------------------------------- 1 file changed, 64 insertions(+), 64 deletions(-) Deleted: PKGBUILD =================================================================== --- PKGBUILD 2022-02-20 20:48:32 UTC (rev 1135391) +++ PKGBUILD 2022-02-20 20:48:40 UTC (rev 1135392) @@ -1,64 +0,0 @@ -# Maintainer: Felix Yan <felixonm...@archlinux.org> - -pkgname=npm -pkgver=8.5.0 -pkgrel=1 -pkgdesc='A package manager for javascript' -arch=('any') -url='https://www.npmjs.com/' -license=('custom:Artistic') -depends=('nodejs' 'node-gyp' 'nodejs-nopt' '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=('7106df611b8b9db6d3a8aa8328e9fe4195188b4987e1244b7b35f840466831374c7d6a01a2d7a83f73834f51eaaf2270fe385d9666c33d8fb5ce56bc166104d2') - -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 - node bin/npm-cli.js install -g -f --prefix="$pkgdir/usr" $(node bin/npm-cli.js pack | tail -1) - - # 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 - rm -r "$_npmdir"/node_modules/{,.bin/}nopt - sed -i 's|../../node_modules/node-gyp/bin/node-gyp.js|../../../node-gyp/bin/node-gyp.js|' \ - "$_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 - - mv "$pkgdir"/usr/lib/node_modules/npm/man "$pkgdir"/usr/share/ - - install -Dm644 "$srcdir"/cli-$pkgver/LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE -} Copied: npm/repos/community-any/PKGBUILD (from rev 1135391, npm/trunk/PKGBUILD) =================================================================== --- PKGBUILD (rev 0) +++ PKGBUILD 2022-02-20 20:48:40 UTC (rev 1135392) @@ -0,0 +1,64 @@ +# Maintainer: Felix Yan <felixonm...@archlinux.org> + +pkgname=npm +pkgver=8.5.1 +pkgrel=1 +pkgdesc='A package manager for javascript' +arch=('any') +url='https://www.npmjs.com/' +license=('custom:Artistic') +depends=('nodejs' 'node-gyp' 'nodejs-nopt' '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=('c4fa90ca1f244c1b0096c2a2127e8c88ce92f9a0a0d57bfe18fa41941f201566281ee19055f69e900ba06b677a04146332eda85932c82c4f43a4aba386f3c1ad') + +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 + node bin/npm-cli.js install -g -f --prefix="$pkgdir/usr" $(node bin/npm-cli.js pack | tail -1) + + # 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 + rm -r "$_npmdir"/node_modules/{,.bin/}nopt + sed -i 's|../../node_modules/node-gyp/bin/node-gyp.js|../../../node-gyp/bin/node-gyp.js|' \ + "$_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 + + mv "$pkgdir"/usr/lib/node_modules/npm/man "$pkgdir"/usr/share/ + + install -Dm644 "$srcdir"/cli-$pkgver/LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE +}