aboutsummarylogtreecommitdiffstats
path: root/PKGBUILD
blob: de7d24af0ebc38cbdc1c3e8b0deebb1ab607485b (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
# Maintainer: tsp <patrictroy at gmail dot com>

#Configuration:
pkgname=rizin-git
pkgver=0.5.0
pkgrel=1
epoch=1
pkgdesc="Open-source tools to disasm, debug, analyze and manipulate binary files"
arch=('i686' 'x86_64')
url="https://rizin.re/"
license=('GPL3' 'LGPL3')
makedepends=('git' 'meson' 'ninja' 'python-pyaml')
depends=('capstone' 'lz4' 'file' 'libzip' 'xxhash' 'libuv' 'tree-sitter')
depends=('sh' 'capstone' 'libcapstone.so' 'openssl' 'libzip' 'zlib'
         'lz4' 'xxhash' 'libxxhash.so' 'file' 'libuv' 'tree-sitter'
         'libtree-sitter.so')
provides=("rizin=${pkgver%.r*}")
conflicts=('rizin')
source=("$pkgname::git+https://github.com/rizinorg/rizin.git")
md5sums=('SKIP')

pkgver () {
  cd ${pkgname}
  printf "%s.r%s.%s" "$(grep -oP "^  version: 'v\K[0-9.]*" meson.build)" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd ${pkgname}
  meson subprojects download
}

build() {
  # this is actually needed to prevent linking against old system-wide r2 libs
  # you can comment this out, if you build in a clean environment
  export PKG_CONFIG_PATH="${srcdir}/${pkgname}/pkgcfg:${PKG_CONFIG_PATH}"

  cd ${pkgname}
  arch-meson build                      \
    -D use_sys_capstone=enabled         \
    -D use_sys_magic=enabled            \
    -D use_sys_libzip=enabled           \
    -D use_sys_zlib=enabled             \
    -D use_sys_lz4=enabled              \
    -D use_sys_xxhash=enabled           \
    -D use_sys_openssl=enabled          \
    -D use_sys_tree_sitter=enabled      \
    -D packager="AUR"                   \
    -D packager_version="${pkgver}-git"
  ninja -C build
}

package() {
  cd ${pkgname}
  DESTDIR="${pkgdir}" ninja -C build install
  install -dm644 "${pkgdir}/usr/share/doc/rizin"
  cp -r doc/* "${pkgdir}/usr/share/doc/rizin"
}