summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 43ffa852697e4dee7ed7224aa4e49e31036e0b9b (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
# Maintainer: Dimitri Sabadie <hadronized@strongly-typed-thoughts.net>
pkgname=flirt
pkgver=0.2.1
pkgrel=6
epoch=
pkgdesc=" FiLe InteRacT, the file interaction tool for your command line "
arch=('x86_64')
url="https://sr.ht/~hadronized/flirt/"
license=('BSD-3-Clause')
groups=()
depends=()
makedepends=('rust')
checkdepends=()
optdepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=
changelog=
source=("$pkgname-$pkgver.tar.gz::https://static.crates.io/crates/$pkgname/$pkgname-$pkgver.crate")
noextract=()
sha256sums=('eb507db7a5d1a98390c797060cc97315d4f6b40fe86dde14c6069a53db1d4dc3')
validpgpkeys=('6C991AA06D7A7C28573799CEA94386A8A6252ECB')

prepare() {
  cd "$pkgname-$pkgver"

  export RUSTUP_TOOLCHAIN=stable
  cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}

build() {
  cd "$pkgname-$pkgver"

  export RUSTUP_TOOLCHAIN=stable
  export CARGO_TARGET_DIR=target
  cargo build --frozen --release
}

check() {
  cd "$pkgname-$pkgver"

  export RUSTUP_TOOLCHAIN=stable
  cargo test --frozen
}

package() {
  cd "$pkgname-$pkgver"

  # binary
  install -Dm755 "target/release/$pkgname" "$pkgdir/usr/bin/$pkgname"

  # docs / license
  install -Dm644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  install -Dm644 "README.md" "${pkgdir}/usr/share/doc/${pkgname}/README.md"
}