summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c899b4d32816d2b7364fb788810ed9e01eb60a0d (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
# Maintainer: Tony Lambiris <tony@criticalstack.com>
pkgname=hexyl-git
pkgdesc="A command-line hex viewer"
pkgrel=1
pkgver=0.5.1.92
arch=('i686' 'x86_64')
conflicts=("hexyl")
provides=("hexyl")
url="https://github.com/sharkdp/hexyl"
license=('Apache' 'MIT')
depends=('rust' 'cargo')
makedepends=('rust' 'cargo')
optdepends=('rust-src: rust std source code')
source=("${pkgname}::git+https://github.com/sharkdp/hexyl")
sha256sums=('SKIP')

pkgver() {
	cd "${srcdir}/${pkgname}"

	printf "%s.%s" "$(grep -m1 '^version =' Cargo.toml | cut -d\" -f2)" "$(git rev-list --count HEAD)"
}

build() {
	cd "${srcdir}/${pkgname}"

	env CARGO_INCREMENTAL=0 CARGO_TARGET_DIR= \
		cargo build --release
}

package() {
	cd "${srcdir}/${pkgname}"

	install -Dm755 "${srcdir}/${pkgname}/release/hexyl" "${pkgdir}/usr/bin/hexyl"
	install -Dm644 LICENSE-MIT "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
	install -Dm644 LICENSE-APACHE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}