New package: fnm-1.37.1

This commit is contained in:
Vinfall 2024-07-03 11:55:13 +08:00
parent a968f07ed6
commit ae7402386e
2 changed files with 42 additions and 0 deletions

6
srcpkgs/fnm/files/fnm.sh Normal file
View file

@ -0,0 +1,6 @@
#!/bin/sh
if [ "$(xbps-uhelper arch)" = "x86_64-musl" ]; then
export FNM_NODE_DIST_MIRROR=https://unofficial-builds.nodejs.org/download/release
export FNM_ARCH=x64-musl
fi

36
srcpkgs/fnm/template Normal file
View file

@ -0,0 +1,36 @@
# Template file for 'fnm'
pkgname=fnm
version=1.37.1
revision=1
# Upstream only supports these architectures
archs="x86_64* aarch64 armv7l"
build_style=cargo
build_helper=qemu
hostmakedepends="pkg-config"
makedepends="libzstd-devel"
short_desc="Fast and simple Node.js version manager, built in Rust"
maintainer="Vinfall <neptuniahuai0tc@riseup.net>"
license="GPL-3.0-only"
homepage="https://github.com/Schniz/fnm"
changelog="https://raw.githubusercontent.com/Schniz/fnm/master/CHANGELOG.md"
distfiles="https://github.com/Schniz/fnm/archive/refs/tags/v${version}.tar.gz"
checksum=56a170304ab281439a71e541c4db878848c3a891078ae3c2dcc84017cd0306b4
do_check() {
# NOTE: downloader::tests are ignored as musl requires env to work
cargo test --target ${RUST_TARGET} --workspace --locked -- \
--skip shell::infer::unix::tests::test_get_process_info \
--skip downloader::tests::test_installing_node_12 \
--skip downloader::tests::test_installing_npm
}
post_install() {
# only needed on musl
if [ "$XBPS_TARGET_MACHINE" = "x86_64-musl" ]; then
vinstall ${FILESDIR}/fnm.sh 644 etc/profile.d
fi
for shell in bash fish zsh; do
vtargetrun ${DESTDIR}/usr/bin/fnm completions --shell ${shell} > fnm.${shell}
vcompletion fnm.${shell} ${shell}
done
}