aboutsummaryrefslogtreecommitdiffstats
path: root/community/choose/APKBUILD
blob: ce5ad2b163e3b7d7bf2419390bc6f16b8dd12a48 (plain) (blame)
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
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=choose
pkgver=1.3.3
pkgrel=0
pkgdesc="A human-friendly and fast alternative to cut and (sometimes) awk"
url="https://github.com/theryangeary/choose"
arch="x86_64 armv7 armhf aarch64 x86 ppc64le"  # limited by rust/cargo
license="GPL-3.0-or-later"
makedepends="cargo"
source="https://github.com/theryangeary/choose/archive/v$pkgver/choose-$pkgver.tar.gz"

prepare() {
	default_prepare

	# Optimize binary for size.
	cat >> Cargo.toml <<-EOF

		[profile.release]
		codegen-units = 1
		lto = true
		opt-level = "z"
		panic = "abort"
	EOF
}

build() {
	cargo build --release --locked
}

check() {
	cargo test --release
}

package() {
	cargo install --locked --path . --root="$pkgdir/usr"
	rm "$pkgdir"/usr/.crates*
}

sha512sums="
81308ecad91aeec20fa3ef4b36f3d590019e261cc3fe6dd3104b22e8a0a7ec5a94edc9a74ef10f54c0572e0d47280bc507cb190da7d8bea0955eae0e60a66a4c  choose-1.3.3.tar.gz
"