summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ab105ab6f61c619a6fc08be22e69f09e4f489d89 (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
# Maintainer: Aaron McDaniel (mcd1992) <'aur' at the domain 'fgthou.se'>

((DISABLE_BUNDLED_RADARE)) && {
	depends+=('radare2>=5.1.0')
	_CMAKE_FLAGS+=(-DCUTTER_USE_BUNDLED_RADARE2=OFF)
} || {
	source+=("radare2::git+https://github.com/radareorg/radare2")
	md5sums+=('SKIP')
	_CMAKE_FLAGS+=(-DCUTTER_USE_BUNDLED_RADARE2=ON)
}


pkgname=radare2-cutter-git
epoch=1
pkgver=0.1.0.r2.gbaf2c363
pkgrel=1
pkgdesc='Qt and C++ GUI for radare2 reverse engineering framework (originally named Iaito)'
url='https://github.com/radareorg/cutter'
arch=('x86_64')
license=('GPL3')
depends+=('python' 'capstone' 'qt5-base' 'qt5-svg' 'qt5-webengine' 'icu' 'python-shiboken2' 'pyside2' 'graphviz' 'qt5-tools' 'syntax-highlighting')
makedepends=('git' 'cmake' 'shiboken2' 'meson' 'ninja')
optdepends=()
provides=('radare2-cutter')
backup=()
source+=("${pkgname}::git+https://github.com/radareorg/r2cutter.git${_fragment}"
	"cutter-translations::git+https://github.com/radareorg/cutter-translations")
md5sums+=('SKIP'
         'SKIP')

pkgver() {
  cd ${pkgname}
  # Remove 'v' prefix on tags; prefix revision with 'r'; replace all '-' with '.'
  git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd ${pkgname}
  git config submodule.src/translations.url "${srcdir}"/cutter-translations
  ((DISABLE_BUNDLED_RADARE)) && {
    git submodule update --init --recursive "${submodules[@]}" src/translations
  } || {
    git config submodule.radare2.url "${srcdir}"/radare2
    git submodule update --init --recursive "${submodules[@]}"
  }
}

build() {
  _CMAKE_FLAGS+=(
    -DCMAKE_INSTALL_PREFIX=/usr
    -DCMAKE_BUILD_TYPE=None
    -DCUTTER_ENABLE_PYTHON=ON
    -DCUTTER_ENABLE_PYTHON_BINDINGS=ON
    -DCUTTER_USE_ADDITIONAL_RADARE2_PATHS=OFF
    -DCUTTER_ENABLE_CRASH_REPORTS=OFF
    -DCUTTER_ENABLE_GRAPHVIZ=ON
)
  cmake -B build -S "${srcdir}/${pkgname}/src" "${_CMAKE_FLAGS[@]}"
  make -C build
}

package() {
  make -C build DESTDIR="$pkgdir" install
  install -dm755 "${pkgdir}/usr/share/doc/${pkgname}/"
  cp -a ${pkgname}/docs/* "${pkgdir}/usr/share/doc/${pkgname}/"
}