summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a654fccf8afb6bfa4806f9a85a0aee18ed624a6a (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
# Maintainer: Mark Wagie <mark dot wagie at tutanota dot com>
pkgname=universal-android-debloater
pkgver=0.3
pkgrel=1
pkgdesc="Cross-platform GUI written in Rust using ADB to debloat non-rooted Android devices"
arch=('x86_64')
url="https://github.com/0x192/universal-android-debloater"
license=('GPL3')
depends=('android-tools' 'expat' 'freetype2')
makedepends=('cargo-nightly' 'cmake' 'libxkbcommon' 'lld')
source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/$pkgver.tar.gz"
        'uad_gui.desktop'
        'uad_gui-opengl.desktop')
sha256sums=('96c6738560a9e602d1a0451fb4ec485acd3407a43da411387150f7edb4d65264'
            'e55f259fab5e09d6e91412dbfa74859f609615606422b0e3c937cc774eaedbf3'
            '80227d6e877e25f650d470c0301c93fe28d1ca25d85a3dbf0c050698f84200e5')

prepare() {
  cd "$pkgname-$pkgver"
  export RUSTUP_TOOLCHAIN=nightly
  cargo fetch --target "$CARCH-unknown-linux-gnu"
}

build() {
  cd "$pkgname-$pkgver"
  export RUSTFLAGS="-C link-arg=-fuse-ld=lld"
  export RUSTUP_TOOLCHAIN=nightly
  export CARGO_TARGET_DIR=target

  # OpenGL
  cargo build --release --features glow
  mv target/release/uad_gui target/release/uad_gui-opengl

  # Vulkan
  cargo build --release --features wgpu
}

check() {
  cd "$pkgname-$pkgver"
  export RUSTFLAGS="-C link-arg=-fuse-ld=lld"
  export RUSTUP_TOOLCHAIN=nightly
  cargo test --features glow
  cargo test --features wgpu
}

package() {
  cd "$pkgname-$pkgver"
  install -Dm755 target/release/uad_gui{,-opengl} -t "$pkgdir/usr/bin"
  install -Dm644 $srcdir/uad_gui{,-opengl}.desktop -t "$pkgdir/usr/share/applications"
}