aports/community/pnpm/APKBUILD
2025-06-05 17:40:20 +00:00

73 lines
2.2 KiB
Text

# Contributor: Hygna <hygna@proton.me>
# Contributor: Fabricio Silva <hi@fabricio.dev>
maintainer="Fabricio Silva <hi@fabricio.dev>"
pkgname=pnpm
pkgver=10.11.1
pkgrel=0
pkgdesc="Fast, disk space efficient package manager"
url="https://pnpm.io"
arch="noarch"
license="MIT"
depends="nodejs"
subpackages="
$pkgname-doc
$pkgname-bash-completion
$pkgname-zsh-completion
$pkgname-fish-completion
"
source="https://registry.npmjs.org/pnpm/-/pnpm-$pkgver.tgz
0001-no-check-for-updates.patch
0002-no-self-update.patch
"
builddir="$srcdir/package"
prepare() {
default_prepare
# remove node-gyp
rm -rf dist/node-gyp-bin dist/node_modules/node-gyp
# remove windows files
rm -rf dist/vendor/*.exe
# remove other unnecessary files
find . -type f \( \
-name '.*' -o \
-name '*.cmd' -o \
-name '*.bat' -o \
-name '*.map' -o \
-name '*.md' -o \
-name '*.darwin*' -o \
-name '*.win*' -o \
-iname 'README*' \) -delete
}
check() {
./bin/pnpm.cjs --help
}
package() {
local destdir="$pkgdir"/usr/share/node_modules/$pkgname
install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
install -Dm644 dist/templates/completion.bash \
"$pkgdir"/usr/share/bash-completion/completions/$pkgname
install -Dm644 dist/templates/completion.zsh \
"$pkgdir"/usr/share/zsh/site-functions/_$pkgname
install -Dm644 dist/templates/completion.fish \
"$pkgdir"/usr/share/fish/vendor_completions.d/$pkgname.fish
install -Dm644 package.json -t "$destdir"
install -Dm755 bin/pnpm.cjs bin/pnpx.cjs -t "$destdir"/bin
cp -r dist "$destdir"/dist
mkdir -p "$pkgdir"/usr/bin
ln -sf ../share/node_modules/pnpm/bin/pnpm.cjs "$pkgdir"/usr/bin/pnpm
ln -sf ../share/node_modules/pnpm/bin/pnpx.cjs "$pkgdir"/usr/bin/pnpx
}
sha512sums="
e519b9f7639869dc8d5c3c5dfef73b3f091094b0a006d7317353c72b124e80e1afd429732e28705ad6bfa1ee879c1fce46c128ccebd3192101f43dd67c667912 pnpm-10.11.1.tgz
f53903c506a676393dd8b31e1194b92612bfa877a8e17edc530e308921caf454248e181a3e620a17a941eba126349128963b2b0b1e48f8d927307c9cf335290e 0001-no-check-for-updates.patch
5582d11fcd1782f40a4f9269b477af25057e3a3d60cddef8b64a8592fafdc7a572822c8267a7abf9e8bfa4b726dcb291885642070a838e360fc542cee10c9569 0002-no-self-update.patch
"