aboutsummaryrefslogtreecommitdiffstats
path: root/community/delta/APKBUILD
blob: 66b7e0b39b210d2cf15316064777a207ce6a68e8 (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
# Contributor: Aleks Bunin <alpinelinux@compuix.com>
# Maintainer: Aleks Bunin <alpinelinux@compuix.com>
pkgname=delta
pkgver=0.12.1
pkgrel=1
pkgdesc="Syntax-highlighting pager for git and diff output"
url="https://github.com/dandavison/delta"
license="MIT"
arch="all !s390x !riscv64" # limited by rust/cargo
makedepends="
	cargo
	libgit2-dev
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/dandavison/delta/archive/refs/tags/$pkgver.tar.gz"

prepare() {
	default_prepare

	# Optimize binary for size (4.9 -> 3.7 MiB in v0.12.1).
	cat >> Cargo.toml <<-EOF

		[profile.release]
		codegen-units = 1
		lto = true
		opt-level = "s"
		panic = "abort"
	EOF
	cargo fetch --locked
}

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

check() {
	cargo test --frozen
}

package() {
	install -Dm755 target/release/delta "$pkgdir"/usr/bin/delta
}

sha512sums="
70796f2008fbf085c6caae67165f7273a3026269851609d1b9e613aa04017715fb73bc0b5116c501acae623a32d348948f3d3afc1c99b343b623347526667471  delta-0.12.1.tar.gz
"