summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2e3436d5544300adc9af7c7b210989d1dcd07f70 (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
# Maintainer: Luke Street <luke@street.dev>

_pkgname=Ghidra-Switch-Loader
pkgname=ghidra-extension-switch-loader-git
pkgver=1.5.0.r2.g5afeb1d
pkgrel=1
pkgdesc="A Nintendo Switch binary loader for Ghidra"
arch=('any')
url=https://github.com/Adubbz/${_pkgname}
license=('Apache 2.0')
provides=()
conflicts=()
depends=('ghidra')
makedepends=('git' 'unzip')
optdepends=()
source=("$_pkgname::git+${url}#branch=master")
sha512sums=('SKIP')

pkgver() {
  cd $srcdir/${_pkgname}
  git describe --tags --long | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd $srcdir/${_pkgname}
  rm -rf dist
  chmod +x gradlew
  ./gradlew -PGHIDRA_INSTALL_DIR=/opt/ghidra
}

package() {
  cd $srcdir/${_pkgname}
  install -d $pkgdir/opt/ghidra/Ghidra/Extensions
  # Extract built archive into destination folder
  unzip -u dist/*.zip -d $pkgdir/opt/ghidra/Ghidra/Extensions/
  install -Dm 644 LICENSE.txt -t $pkgdir/usr/share/licenses/$pkgname
}