summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 30f1c0d787e7abae54ed953e0376b1ad4f088d0a (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
# Maintainer: Felix Pehla <s6fepehl@uni-bonn.de>

pkgname=alpha_tui
pkgver=1.8.0
pkgrel=1
pkgdesc="A TUI for interpreting and debugging programs written in alpha-notation"
arch=('x86_64')
url="https://github.com/LMH01/alpha_tui"
license=('GPL-3.0-only')
depends=(
  'gcc-libs'
  'glibc'
)
makedepends=(
  'cargo'
)
checkdepends=(
  'cargo'
)
source=($pkgname-$pkgver.tar.gz::https://github.com/LMH01/$pkgname/archive/v$pkgver.tar.gz)
sha256sums=('5c95865f419266bbd9182ea26d74a592fbdd043a22b93bc02f4124c4f6f0337c')

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 --all-features
}

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

  install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/$pkgname"

  install -Dm0644 -t "$pkgdir/usr/share/$pkgname" {CONTRIBUTING,README}.md
  install -Dm0644 -t "$pkgdir/usr/share/$pkgname/examples" examples/*.json
  install -Dm0644 -t "$pkgdir/usr/share/$pkgname/examples/programs" examples/programs/*.alpha
  install -Dm0644 -t "$pkgdir/usr/share/$pkgname/themes" themes/*.{md,json}
  install -Dm0644 -t "$pkgdir/usr/share/$pkgname/themes/llm-generated" themes/llm-generated/*.json
  install -Dm0644 -t "$pkgdir/usr/share/doc/$pkgname" docs/*.md
  install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}

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

  export RUSTUP_TOOLCHAIN=stable
  cargo test --frozen --release --all-features
}