2023-10-22 21:58:37 +00:00

77 lines
1.7 KiB
Plaintext

# Contributor: nibon7 <nibon7@163.com>
# Maintainer: nibon7 <nibon7@163.com>
pkgname=nushell
pkgver=0.86.0
pkgrel=0
pkgdesc="A new type of shell"
url="https://www.nushell.sh"
# s390x: nix crate
arch="all !s390x"
license="MIT"
makedepends="
cargo
cargo-auditable
libgit2-dev
openssl-dev
sqlite-dev
"
checkdepends="bash"
subpackages="$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
"
case "$CARCH" in
# ooms when building
armhf|armv7|ppc64le|riscv64|x86) _exclude_opts="--exclude nu-cmd-dataframe" ;;
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"] }
rusqlite = { rustc-link-lib = ["sqlite3"] }
EOF
cargo fetch --target="$CTARGET" --locked
}
build() {
cargo auditable build --workspace --release --frozen $_exclude_opts
}
check() {
cargo test --workspace --frozen $_exclude_opts
}
package() {
find target/release \
-maxdepth 1 \
-executable \
-type f \
-name "nu*" \
-exec install -Dm755 '{}' -t "$pkgdir"/usr/bin/ \;
}
_plugins() {
pkgdesc="Nushell plugins"
depends="nushell=$pkgver-r$pkgrel"
amove usr/bin/nu_plugin_*
}
sha512sums="
9c59223c579f89ea01e2d6ded25706caa5a5975ee6b850294ab1ebad83779a9d19d1d1d2c13c519405c0cd2cfad3d6284390e5b32d3b527aaf92940c8d6a8715 nushell-0.86.0.tar.gz
9b63938805f4625e21d3531d5d8c3296a9365a0a9d8a0dfba583b738ef0d2e472cb1f4bf0b9d60df61dba4518ea29cda3d8b9601fe22433ccf13edf18c5087c8 system-deps.patch
"