summaryrefslogtreecommitdiff
path: root/testing/xh/APKBUILD
blob: c3028958f55bc4a73fb439e9bfa1a72286615c64 (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: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
#
# TODO: Link with system-provided openssl library.
pkgname=xh
pkgver=0.16.1
pkgrel=0
pkgdesc="Yet another HTTPie clone"
url="https://github.com/ducaale/xh"
# ppc64le fails to build
# others are blocked by rust/cargo
arch="aarch64 armhf armv7 x86 x86_64"
license="MIT"
checkdepends="curl-dev openssl-dev"
makedepends="cargo oniguruma-dev zlib-dev"
subpackages="
	$pkgname-doc
	$pkgname-bash-completion
	$pkgname-fish-completion
	$pkgname-zsh-completion
	"
source="https://github.com/ducaale/xh/archive/v$pkgver/xh-$pkgver.tar.gz"

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"

# Link with system-provided oniguruma library (instead building from source
# and bundling).
export RUSTONIG_DYNAMIC_LIBONIG=1

prepare() {
	default_prepare

	cargo fetch --locked
}

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

check() {
	cargo test --frozen
}

package() {
	install -D -m755 target/release/$pkgname -t "$pkgdir"/usr/bin/

	ln -s xh "$pkgdir"/usr/bin/xhs

	install -Dm 644 doc/xh.1 "$pkgdir"/usr/share/man/man1/xh.1

	install -Dm 644 completions/xh.bash "$pkgdir"/usr/share/bash-completion/completions/xh
	install -Dm 644 completions/xh.fish "$pkgdir"/usr/share/fish/completions/xh.fish
	install -Dm 644 completions/_xh "$pkgdir"/usr/share/zsh/site-functions/_xh
}

sha512sums="
d3514f2436d0371a19a9db8225ed49524b5642a9cd4c643b682b431c1a87a7c1d0413b342e5f242e24638d8ef8694bee3fa1d04d2674ba5ac37b4498b790ff31  xh-0.16.1.tar.gz
"