summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: cb25ca459d2135d23a0425fe42b89322845264b6 (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
71
72
73
74
75
76
77
78
79
# Maintainer: dan361 <daniel@m8t.io>
pkgname=drg_mod_integration-git
pkgver=0.2.10.r154.g57aa964
pkgrel=2
pkgdesc="Deep Rock Galactic mod loader and integration tool"
arch=('x86_64')
url="https://github.com/trumank/mint"
license=('MIT')
depends=(
  'gcc-libs'
  'glibc'
  'libxkbcommon'
  'wayland'
  'libx11'
  'libxcursor'
  'libxi'
  'libxrandr'
  'libgl'
  'fontconfig'
  'freetype2'
)
makedepends=(
  'git'
  'cargo'
  'rustup'
  'pkg-config'
  'mingw-w64-gcc'
)
provides=('drg_mod_integration-git' 'drg-mod-integration-bin')
conflicts=('drg_mod_integration-git' 'drg-mod-integration-bin')
source=(
  "${pkgname}::git+https://github.com/trumank/mint.git"
  "drg_mod_integration.desktop"
)
sha256sums=(
  'SKIP'
  'SKIP'
)

pkgver() {
  cd "$pkgname"
  git describe --long --tags --abbrev=7 2>/dev/null | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}

prepare() {
  cd "$pkgname"
  rm -f rust-toolchain.toml
  export RUSTUP_TOOLCHAIN=nightly
  rustup target add x86_64-pc-windows-gnu --toolchain nightly
  cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}

build() {
  cd "$pkgname"
  export RUSTUP_TOOLCHAIN=nightly
  export CARGO_TARGET_DIR=target
  cargo build --frozen --release --features hook
}

check() {
  cd "$pkgname"
  export RUSTUP_TOOLCHAIN=nightly
  cargo test --frozen --release --features hook
}

package() {
  cd "$pkgname"
  install -Dm755 "target/release/mint" "$pkgdir/usr/bin/drg_mod_integration"

  # Desktop file
  install -Dm644 "$srcdir/drg_mod_integration.desktop" "$pkgdir/usr/share/applications/drg_mod_integration.desktop"

  # License
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  # Documentation
  install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
}