template 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. # Template file for 'pnpm'
  2. pkgname=pnpm
  3. version=5.9.3
  4. revision=1
  5. # We won't use wrksrc, but it's needed to silence "cannot access wrksrc directory" error
  6. create_wrksrc=yes
  7. build_style=meta
  8. hostmakedepends="nodejs jq"
  9. depends="nodejs>=10.14"
  10. short_desc="Fast, disk space efficient package manager"
  11. maintainer="reback00 <reback00@protonmail.com>"
  12. license="MIT"
  13. homepage="https://pnpm.js.org/"
  14. distfiles="https://registry.npmjs.org/${pkgname}/-/${pkgname}-${version}.tgz"
  15. checksum=1bf71590e5408dea53ef21861d22b8e69e6da3b5b0340c340994b846328bb603
  16. skip_extraction="${pkgname}-${version}.tgz"
  17. python_version=3
  18. do_install() {
  19. npm install -g --user root --prefix "${DESTDIR}/usr" "${XBPS_SRCDISTDIR}/${pkgname}-${version}/${pkgname}-${version}.tgz"
  20. local _npmdir="${DESTDIR}/usr/lib/node_modules/${pkgname}"
  21. # Sort and cleanup package.json
  22. local tmppackage="$(mktemp)"
  23. jq '.|=with_entries(select(.key|test("_.+")|not))' "$_npmdir/package.json" > "$tmppackage"
  24. mv "$tmppackage" "$_npmdir/package.json"
  25. chmod 644 "$_npmdir/package.json"
  26. # Delete JS SourceMaps
  27. find "${DESTDIR}/usr/lib" -depth -name '*.map' -delete
  28. vlicense "$_npmdir/LICENSE"
  29. vdoc "$_npmdir/README.md"
  30. rm -rf "${DESTDIR}/usr/etc" "$_npmdir/LICENSE" "$_npmdir/README.md"
  31. }