mirror of
https://gitdl.cn/https://github.com/chakralinux/desktop.git
synced 2025-01-24 10:32:13 +08:00
45 lines
1.4 KiB
Bash
45 lines
1.4 KiB
Bash
pkgname=npm
|
|
pkgver=6.1.0
|
|
pkgrel=1
|
|
pkgdesc='A package manager for javascript'
|
|
arch=('x86_64')
|
|
url='https://www.npmjs.com/'
|
|
license=('custom:Artistic')
|
|
depends=('nodejs' 'node-gyp' 'semver')
|
|
makedepends=('procps-ng' 'marked-man')
|
|
options=('!emptydirs')
|
|
source=("$pkgname-$pkgver::https://github.com/$pkgname/$pkgname/archive/v$pkgver.tar.gz")
|
|
sha256sums=('9d12500a4a1e0a112505b3766d98e0372ef546e05be52ab6bd4623051bf72e64')
|
|
|
|
prepare() {
|
|
cd $pkgname-$pkgver
|
|
ln -sf /usr/bin/marked{,-man} node_modules/.bin/
|
|
}
|
|
|
|
build() {
|
|
cd $pkgname-$pkgver
|
|
make
|
|
}
|
|
|
|
package() {
|
|
cd $pkgname-$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"
|
|
|
|
# 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"/npm-$pkgver/bin/npm-cli.js completion > "$pkgdir"/usr/share/bash-completion/completions/npm
|
|
|
|
install -Dm644 "$srcdir/${pkgname}-${pkgver}/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
|
|
}
|