summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 80ec7b1890e55146e91a006da58d900976398ea6 (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
# Maintainer: Maxime Vincent (maximevince) <maxime [dot] vince [at] gmail [dot] com>

pkgname=radare2-cutter-ghidra
pkgver=1.10.0.r14.gc645cbee
pkgrel=1
pkgdesc='A Qt and C++ GUI for radare2 reverse engineering framework with Python and Ghidra support'
url='https://github.com/radareorg/cutter'
arch=('i686' 'x86_64')
license=('GPL')
depends=('python' 'radare2-git' 'capstone' 'qt5-base' 'qt5-svg' 'qt5-webengine' 'icu' 'pyside2' 'shiboken2')
makedepends=('git' 'cmake')
optdepends=()
provides=('radare2-cutter')
backup=()
source=("${pkgname}::git+https://github.com/radareorg/cutter.git")
md5sums=('SKIP')

pkgver() {
  cd ${pkgname}
  # Remove 'v' prefix on tags; prefix revision with 'r'; replace all '-' with '.'
  git describe --long --tags 2>/dev/null | sed 's/[^[:digit:]]*\(.\+\)-\([[:digit:]]\+\)-g\([[:xdigit:]]\{7\}\)/\1.r\2.g\3/;t;q1'
}

prepare() {
  sed -e 's|PKGCONFIG += python3|PKGCONFIG += python3-embed|' -i $pkgname/src/Cutter.pro # Fix linking to python 3.8

  cd ${pkgname}
  git submodule update --init --recursive


  mkdir -p build
  cd build
  git clone --depth 1 --recurse-submodules https://github.com/radareorg/r2ghidra-dec.git
  qmake-qt5 ../src/Cutter.pro CUTTER_ENABLE_PYTHON=true CUTTER_ENABLE_PYTHON_BINDINGS=true CUTTER_R2GHIDRA_STATIC=true R2GHIDRA_SOURCE=`pwd`/r2ghidra-dec
}

build() {
  cd "${pkgname}/build"
  make 
}

package() {
  cd ${pkgname}

  install -DTm755 build/Cutter "${pkgdir}/usr/bin/Cutter"
  install -DTm644 src/org.radare.Cutter.desktop "${pkgdir}/usr/share/applications/org.radare.Cutter.desktop"
  install -DTm644 src/img/cutter.svg "${pkgdir}/usr/share/icons/hicolor/scalable/apps/cutter.svg"
  install -DTm644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  install -dm755 docs/ "${pkgdir}/usr/share/doc/${pkgname}/"
  cp -a docs/* "${pkgdir}/usr/share/doc/${pkgname}/"
}