1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-23 19:25:25 +03:00
aports/community/nushell/APKBUILD
2025-02-27 06:18:30 +00:00

96 lines
2.5 KiB
Text

# Contributor: nibon7 <nibon7@163.com>
# Maintainer: nibon7 <nibon7@163.com>
pkgname=nushell
pkgver=0.102.0
pkgrel=0
pkgdesc="A new type of shell"
url="https://www.nushell.sh"
# s390x: nix crate
# riscv64: segfault when compiling syn
# loongarch64: mysterious SIGSEGV in a test
arch="all !s390x !riscv64 !loongarch64"
license="MIT"
makedepends="
cargo
cargo-auditable
libgit2-dev
libssh2-dev
mimalloc2-dev
openssl-dev
sqlite-dev
"
options="net"
subpackages="$pkgname-doc $pkgname-plugins:_plugins"
install="$pkgname.post-install $pkgname.post-upgrade $pkgname.pre-deinstall"
source="$pkgname-$pkgver.tar.gz::https://github.com/nushell/nushell/archive/$pkgver.tar.gz
system-deps.patch
0001-Fix-an-integer-overflow-bug-in-into-duration-15031.patch
"
export LIBSSH2_SYS_USE_PKG_CONFIG=1 # use system libssh2
# the polars plugin takes too much memory to build on some platforms
case "$CARCH" in
aarch64|armhf|armv7|ppc64le|riscv64|x86) _exclude_opts="--exclude nu_plugin_polars" ;;
esac
prepare() {
default_prepare
# Rust target triple.
local target=$(rustc -vV | sed -n 's/host: //p')
# Build against system-provided libs
mkdir -p .cargo
cat >> .cargo/config.toml <<-EOF
[target.$target]
git2 = { rustc-link-lib = ["git2"] }
mimalloc = { rustc-link-lib = ["mimalloc"] }
rusqlite = { rustc-link-lib = ["sqlite3"] }
EOF
cargo fetch --target="$CTARGET" --locked
}
build() {
cargo auditable build --workspace --release --frozen $_exclude_opts
}
check() {
case "$CARCH" in
a*)
cargo test --workspace --frozen $_exclude_opts -- \
--skip plugin_persistence::plugin_process_exits_when_nushell_exits \
--skip plugins::stream::echo_interactivity_on_slow_pipelines
;;
*)
cargo test --workspace --frozen $_exclude_opts
;;
esac
}
package() {
find target/release \
-maxdepth 1 \
-executable \
-type f \
-name "nu*" \
-exec install -Dm755 '{}' -t "$pkgdir"/usr/bin/ \;
install -Dm644 LICENSE \
-t "$pkgdir"/usr/share/licenses/$pkgname/
}
_plugins() {
pkgdesc="Nushell plugins"
depends="nushell=$pkgver-r$pkgrel"
amove usr/bin/nu_plugin_*
}
sha512sums="
ebe8c120686f2b5c89ac93d4cf26b1c4efa635e34b3dd06b05d3167ee02086fd4b0aa14b234575cdf83f91515b99dbfec05addeaa9c7428045322ca0eea139a4 nushell-0.102.0.tar.gz
521cf5b08fd216ead215955f414340537cdb07b60fd4c55a7d5c210a8f5826fdd7e6550d6ca287d5c9e30fb24eeeaaca462e7e7514003bdc5ef48fcf2954c0c9 system-deps.patch
020590cf8617bce7783bbd2bcf451a3d1f735efe61d5d1c732f3e75e60304b7addbb5c34532f204e84959f309455a2f4161762ac90b796307bfc5325075acbc8 0001-Fix-an-integer-overflow-bug-in-into-duration-15031.patch
"