diff options
author | Britney Fransen <brfransen@gmail.com> | 2016-05-16 16:24:28 (GMT) |
---|---|---|
committer | Britney Fransen <brfransen@gmail.com> | 2016-05-16 16:24:28 (GMT) |
commit | fff4c50d3a1d94c807604d6c21355993dfb95c85 (patch) | |
tree | 390f0eb0781b2599449edbdafbeb6aaba34200dc /abs/extra/npm/PKGBUILD | |
parent | 8de064f6e96f960cdbfe6868d9957a4613f704df (diff) | |
parent | 6f7a84649ef75069cc4fa06fabeb63e762e049d1 (diff) | |
download | linhes_pkgbuild-fff4c50d3a1d94c807604d6c21355993dfb95c85.zip linhes_pkgbuild-fff4c50d3a1d94c807604d6c21355993dfb95c85.tar.gz linhes_pkgbuild-fff4c50d3a1d94c807604d6c21355993dfb95c85.tar.bz2 |
Merge branch 'testing'
Diffstat (limited to 'abs/extra/npm/PKGBUILD')
-rw-r--r-- | abs/extra/npm/PKGBUILD | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/abs/extra/npm/PKGBUILD b/abs/extra/npm/PKGBUILD new file mode 100644 index 0000000..283ac6d --- /dev/null +++ b/abs/extra/npm/PKGBUILD @@ -0,0 +1,55 @@ +# $Id$ +# Maintainer: Felix Yan <felixonmars@archlinux.org> + +pkgname=npm +pkgver=3.8.7 +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=('git' 'procps-ng') +optdepends=('python2: for node-gyp') +options=('!emptydirs') +source=("git+https://github.com/npm/npm.git#tag=v$pkgver") +md5sums=('SKIP') + +build() { + cd npm + make +} + +package() { + cd npm + make NPMOPTS="--prefix=\"$pkgdir/usr\"" install + + # Why 777? :/ + chmod -R u=rwX,go=rX "$pkgdir" + + # Fix files owned by nobody: + chown -R root "$pkgdir/usr/lib/node_modules" + + # Fix wrong symlinks + for _dir in man1 man5 man7; do + rm -f "$pkgdir"/usr/share/man/$_dir/* + cd "$pkgdir"/usr/lib/node_modules/npm/man/$_dir + for _file in *; do + ln -s /usr/lib/node_modules/npm/man/$_dir/$_file "$pkgdir"/usr/share/man/$_dir/ + done + done + + # 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 + + # Experimental dedup + cd "$pkgdir"/usr/lib/node_modules/$pkgname/node_modules + for dep in semver; do + rm -r $dep; + node "$srcdir"/npm/cli.js link $dep; + done + + install -Dm644 "$srcdir/npm/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" +} |