summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 01b659f7796c3311017a398ba5b5fe24d3a42b57 (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
62
63
64
65
66
67
68
69
70
# Maintainer: Christian Krause ("wookietreiber") <christian.krause@mailbox.org>
# shellcheck disable=2034
# shellcheck disable=2148

pkgname=psfu
pkgver=0.4.7
pkgrel=1
pkgdesc="process fu"
arch=('x86_64' 'i686')
url="https://github.com/idiv-biodiversity/$pkgname"
license=('GPL-3.0-or-later')
depends=('gcc-libs' 'glibc')
makedepends=('cargo')
source=("$pkgname-$pkgver.tar.gz::https://github.com/idiv-biodiversity/$pkgname/archive/v$pkgver.tar.gz")
md5sums=('2ae607b5c33ec3c4f132ca2c15f0489f')

prepare() {
  # shellcheck disable=2154
  cd "$srcdir"/$pkgname-$pkgver || exit 1

  export RUSTUP_TOOLCHAIN=stable

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

build() {
  cd "$srcdir"/$pkgname-$pkgver || exit 1

  export RUSTUP_TOOLCHAIN=stable
  export CARGO_TARGET_DIR=target

  cargo build --frozen --release --all-features
}

check() {
  cd "$srcdir"/$pkgname-$pkgver || exit 1

  export RUSTUP_TOOLCHAIN=stable

  cargo test --frozen --all-features
}

package() {
  cd "$srcdir"/$pkgname-$pkgver || exit 1

  # shellcheck disable=2154
  install -Dm755 "target/release/$pkgname" "$pkgdir/usr/bin/$pkgname"

  find target -name '*.bash$'

  install \
    -Dm644 \
    "$(find target -name $pkgname.bash)" \
    "$pkgdir/usr/share/bash-completion/completions/$pkgname"

  install \
    -Dm644 \
    "$(find target -name $pkgname.elv)" \
    "$pkgdir/usr/share/elvish/lib/$pkgname.elv"

  install \
    -Dm644 \
    "$(find target -name $pkgname.fish)" \
    "$pkgdir/usr/share/fish/vendor_completions.d/$pkgname.fish"

  install \
    -Dm644 \
    "$(find target -name _$pkgname)" \
    "$pkgdir/usr/share/zsh/site-functions/_$pkgname"
}