summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8e939b7461f1e5e032f5aabfce3f2668ba4aa1fe (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
# Maintainer: Ilya Zlobintsev <ilya.zl@protonmail.com>
pkgname=('lact' 'lact-libadwaita')
pkgbase=lact
pkgver=0.5.5
pkgrel=1
pkgdesc="AMDGPU Controller application"
arch=('x86_64' 'aarch64')
url="https://github.com/ilya-zlobintsev/LACT"
license=('MIT')
depends=('hwdata' 'gtk4')
makedepends=('blueprint-compiler' 'cargo' 'clang' 'libadwaita' 'git')
install="$pkgbase.install"
source=("git+https://github.com/ilya-zlobintsev/LACT.git#tag=v$pkgver")
# Since the source is a git repository tag and not an archive, there's no single file with a checksum to check
sha256sums=('e7e6eba1f830651677ab36318621a8c11718d0364841bc249b4f0d1ac57e2bb6')

prepare() {
  cd "LACT"
  export CARGO_HOME="$srcdir/cargo-home"
  export RUSTUP_TOOLCHAIN=stable
  cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

build() {
  cd "LACT"
  export CARGO_HOME="$srcdir/cargo-home"
  export RUSTUP_TOOLCHAIN=stable
  export CARGO_TARGET_DIR=target

  # Libadwaita
  cargo build -p "$pkgbase" --frozen --release --features=adw
  mv "target/release/$pkgbase" "target/release/$pkgbase-adw"

  # Gtk 4
  cargo build -p "$pkgbase" --frozen --release
}

check() {
  cd "LACT"
  export CARGO_HOME="$srcdir/cargo-home"
  export RUSTUP_TOOLCHAIN=stable
  cargo test --frozen --no-default-features -p lact
}

package_lact() {
  cd "LACT"
  make PREFIX=/usr DESTDIR="$pkgdir/" install

  install -Dvm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgbase/"
}

package_lact-libadwaita() {
  pkgdesc+=" (libadwaita edition)"
  provides=("$pkgbase")
  conflicts=("$pkgbase")
  depends+=('libadwaita')

  cd "LACT"
  make PREFIX=/usr DESTDIR="$pkgdir/" install

  install -Dvm755 "target/release/$pkgbase-adw" "$pkgdir/usr/bin/$pkgbase"
  install -Dvm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgbase/"
}