From ae7402386e5cba38e534c5ca3944a881f2ea8455 Mon Sep 17 00:00:00 2001 From: Vinfall Date: Wed, 3 Jul 2024 11:55:13 +0800 Subject: [PATCH] New package: fnm-1.37.1 --- srcpkgs/fnm/files/fnm.sh | 6 ++++++ srcpkgs/fnm/template | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 srcpkgs/fnm/files/fnm.sh create mode 100644 srcpkgs/fnm/template diff --git a/srcpkgs/fnm/files/fnm.sh b/srcpkgs/fnm/files/fnm.sh new file mode 100644 index 00000000000..82779d4d8f4 --- /dev/null +++ b/srcpkgs/fnm/files/fnm.sh @@ -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 diff --git a/srcpkgs/fnm/template b/srcpkgs/fnm/template new file mode 100644 index 00000000000..73ea6565e99 --- /dev/null +++ b/srcpkgs/fnm/template @@ -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 " +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 +}