aboutsummaryrefslogtreecommitdiffstats
path: root/testing/nushell/APKBUILD
blob: d65c18512e3fc7c0b618053a149770b4806440c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Contributor: nibon7 <nibon7@163.com>
# Maintainer: nibon7 <nibon7@163.com>
pkgname=nushell
pkgver=0.66.2
pkgrel=1
pkgdesc="A new type of shell"
url="https://www.nushell.sh"
# s390x/riscv64 rust/cargo
arch="x86_64 armv7 armhf aarch64 x86 ppc64le"
license="MIT"
makedepends="cargo openssl-dev>3 libx11-dev libxcb-dev libgit2-dev"
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
	0001-Make-path-canonicalize-canonicalize_dot-test-case-mo.patch
	0002-Prevent-mv-panic-again-6171.patch
	0003-Fix-touch-panics-when-using-invalid-timestamp-6181.patch
	"

# Reduce size of nu binary from 22.7 -> 13.8 MiB (on x86_64 with default feature).
export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1
export CARGO_PROFILE_RELEASE_LTO="fat"
export CARGO_PROFILE_RELEASE_OPT_LEVEL="s"
export CARGO_PROFILE_RELEASE_PANIC="abort"

prepare() {
	default_prepare
	cargo fetch --locked
}

build() {
	cargo build --workspace --release --frozen
}

check() {
	cargo test --workspace --frozen
}

package() {
	find target/release \
		-maxdepth 1 \
		-executable \
		-type f \
		-name "nu*" \
		-exec install -Dm755 '{}' -t "$pkgdir"/usr/bin/ \;
}

_plugins() {
	pkgdesc="Nushell plugins"
	depends="nushell"

	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/nu_plugin_* "$subpkgdir"/usr/bin/
}

sha512sums="
b12fa39338e974cd3f9806fdf4ce490ea60d5ee0c38393deba7e8c583d421baca8e90e515d7062bb45ae489851f430e1ad80ca5034e00a5732832713f4f30f48  nushell-0.66.2.tar.gz
d1b189ac1334a9e037721ca0a8e516ce53a00f1bc080676e55495fe48664d548bcab2a7e723c5c8dfe0df42d99897772871c5fc5422489c74c226a441120ae7a  0001-Make-path-canonicalize-canonicalize_dot-test-case-mo.patch
21b484baeaf4334a9d3e104ccf1117091c10afcec3f3ba0f2ed61924dd9a197d0b7479c5c9d936713cf12a5fab23e2fc20881c68f6af0393adf13bd227d5a281  0002-Prevent-mv-panic-again-6171.patch
c5846a7aad030a53da78c3ac0b5b5f23636f51865f824f65ffd3dfa23b245c9127e088f9dcc0e5293762caf6d093b05ea5f7d3d6f835eeef473fc31e7ea8cdfe  0003-Fix-touch-panics-when-using-invalid-timestamp-6181.patch
"