[arch-commits] Commit in npm/repos (2 files)
Felix Yan
felixonmars at archlinux.org
Thu Sep 21 15:07:07 UTC 2017
Date: Thursday, September 21, 2017 @ 15:07:06
Author: felixonmars
Revision: 259193
archrelease: copy trunk to community-testing-any
Added:
npm/repos/community-testing-any/
npm/repos/community-testing-any/PKGBUILD
(from rev 259192, npm/trunk/PKGBUILD)
----------+
PKGBUILD | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
Copied: npm/repos/community-testing-any/PKGBUILD (from rev 259192, npm/trunk/PKGBUILD)
===================================================================
--- community-testing-any/PKGBUILD (rev 0)
+++ community-testing-any/PKGBUILD 2017-09-21 15:07:06 UTC (rev 259193)
@@ -0,0 +1,50 @@
+# $Id$
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+
+pkgname=npm
+pkgver=5.4.2
+pkgrel=1
+pkgdesc='A package manager for javascript'
+arch=('any')
+url='https://www.npmjs.com/'
+license=('custom:Artistic')
+depends=('nodejs' 'semver')
+provides=('nodejs-node-gyp')
+makedepends=('procps-ng' 'marked-man')
+optdepends=('python2: for node-gyp')
+options=('!emptydirs')
+source=("$pkgname-$pkgver.tar.gz::https://github.com/npm/npm/archive/v$pkgver.tar.gz")
+sha512sums=('c664550567d6f60f2c807355a890e58bbac9b82eb3730f77937b91fbf7f0e354b62533253fef829b3c4f9fd41bae8b46b24a7f286ec80f26a5948a0b79ffe637')
+
+prepare() {
+ cd npm-$pkgver
+ ln -sf /usr/bin/marked{,-man} node_modules/.bin/
+}
+
+build() {
+ cd npm-$pkgver
+ make
+}
+
+package() {
+ cd npm-$pkgver
+ make NPMOPTS="--prefix=\"$pkgdir/usr\"" install
+
+ # Provide node-gyp executable
+ cp "$pkgdir"/usr/lib/node_modules/npm/bin/node-gyp-bin/node-gyp "$pkgdir"/usr/bin/node-gyp
+ sed -i 's|"`dirname "$0"`/../../|"`dirname "$0"`/../lib/node_modules/npm/|' "$pkgdir"/usr/bin/node-gyp
+
+ # Why 777? :/
+ chmod -R u=rwX,go=rX "$pkgdir"
+
+ # Experimental dedup
+ for _d in "$pkgdir"/usr/lib/node_modules/$pkgname/node_modules \
+ "$pkgdir"/usr/lib/node_modules/$pkgname/node_modules/node-gyp/node_modules; do
+ cd "$_d"
+ for dep in semver; do
+ rm -r $dep;
+ done
+ done
+
+ install -Dm644 "$srcdir"/npm-$pkgver/LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
+}
More information about the arch-commits
mailing list