aboutsummaryrefslogtreecommitdiffstats
path: root/community/delta/APKBUILD
blob: 34927145b98321a2b5b9a597d3f7bee1f20d37e0 (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
43
44
45
46
47
48
# Contributor: Aleks Bunin <alpinelinux@compuix.com>
# Maintainer: Aleks Bunin <alpinelinux@compuix.com>
pkgname=delta
pkgver=0.14.0
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
	oniguruma-dev
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/dandavison/delta/archive/refs/tags/$pkgver.tar.gz"

# secfixes:
#   0.13.0-r0:
#     - CVE-2022-24713

# Optimize binary for size (4.9 -> 3.7 MiB in v0.12.1).
export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1
export CARGO_PROFILE_RELEASE_LTO="true"
export CARGO_PROFILE_RELEASE_OPT_LEVEL="s"
export CARGO_PROFILE_RELEASE_PANIC="abort"
export RUSTONIG_SYSTEM_LIBONIG="true"

prepare() {
	default_prepare

	cargo fetch --locked
}

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

check() {
	cargo test --frozen
}

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

sha512sums="
5eba901e3b5d06543d30dad49e92ad8ca9ad02d9757d7cfb4edf8ce460c2549bca07dd073dd44443a3befebe32d7d854b19e72dabf4efdced2eac109eedc614e  delta-0.14.0.tar.gz
"