aboutsummaryrefslogtreecommitdiffstats
path: root/community/yj/APKBUILD
blob: b6c8d2cd479390ba43249db6b3693e0319fefcc2 (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
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=yj
pkgver=1.1.32
pkgrel=0
pkgdesc="Command line tool that converts YAML to JSON"
url="https://github.com/bruceadams/yj"
arch="x86_64 armv7 armhf aarch64 x86 ppc64le"  # limited by rust/cargo
license="Apache-2.0"
makedepends="cargo"
source="https://github.com/bruceadams/yj/archive/$pkgver/yj-$pkgver.tar.gz"
builddir="$srcdir/yj-$pkgver"

prepare() {
	default_prepare

	# Decrease binary size from 1.2 MiB to 0.7 MiB.
	cat >> Cargo.toml <<-EOF

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

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

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

sha512sums="846bf9403c53695b9054164fdbd544da8d8d7dc0a5e3e70fedb0a3983133c982b4ce7ef73c863d37e3bd94b6d3e6bda973d8fa7736e57a3201385a2a152d6cd1  yj-1.1.32.tar.gz"