summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 844298d843f39183cfe7c344df58675fb5b62619 (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
# Maintainer: willemw <willemw12@gmail.com>
# Contributor: orhun <orhunparmaksiz@gmail.com>
# Contributor: Tony Lambiris <tony@libpcap.net>

pkgname=hex-hx-git
pkgver=0.6.0.r1.ga708256
pkgrel=1
pkgdesc='Futuristic take on hexdump'
arch=(x86_64)
url=https://github.com/sitkevij/hex
license=(MIT)
makedepends=(cargo git)
provides=("${pkgname%-git}" hex)
conflicts=("${pkgname%-git}" hex)
#options=(!lto)
source=("$pkgname::git+$url.git")
sha256sums=('SKIP')

pkgver() {
  git -C $pkgname describe --long --tags --abbrev=7 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  RUSTUP_TOOLCHAIN=stable cargo fetch --locked --manifest-path=$pkgname/Cargo.toml --target="$CARCH-unknown-linux-gnu"
}

build() {
  RUSTUP_TOOLCHAIN=stable cargo build --release --manifest-path=$pkgname/Cargo.toml --target-dir=$pkgname/target --all-features
}

check() {
  RUSTUP_TOOLCHAIN=stable cargo test --release --manifest-path=$pkgname/Cargo.toml --target-dir=$pkgname/target
}

package() {
  install -Dm755 $pkgname/target/release/hx -t "$pkgdir/usr/bin"
  install -Dm644 $pkgname/LICENSE -t "$pkgdir/usr/share/licenses/${pkgname%-git}"
}