aboutsummaryrefslogtreecommitdiffstats
path: root/community/capstone/APKBUILD
blob: 03e59f01c5e794247e6cb4457ad074f67217ab8a (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
# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Maintainer: Valery Kartel <valery.kartel@gmail.com>
pkgname=capstone
pkgver=4.0.1
pkgrel=2
pkgdesc="The Ultimate Disassembler"
options="!check" # Testsuite fails
url="https://www.capstone-engine.org"
arch="all"
license="BSD-3-Clause-Clear"
depends_dev="$pkgname"
makedepends="bash py3-setuptools cython python3-dev"
subpackages="$pkgname-static $pkgname-dev py3-${pkgname}:_py3 cstool"
source="$pkgname-$pkgver.tar.gz::https://github.com/aquynh/capstone/archive/$pkgver.tar.gz
	py-path-fix.patch"

build() {
	CFLAGS="$CFLAGS -O2" make
}

check() {
	make check
}

package() {
	make PREFIX=/usr DESTDIR="$pkgdir" install
}

_py3() {
	pkgdesc="$pkgdesc (for python3)"
	install_if="$pkgname=$pkgver-r$pkgrel python3"

	cd "$builddir"/bindings/python
	python3 setup_cython.py install --prefix=/usr --root="$subpkgdir"

	rm -rf "$subpkgdir"/usr/lib/python3*/site-packages/capstone/lib
	rm -rf "$subpkgdir"/usr/lib/python3*/site-packages/capstone/include
}

cstool() {
	pkgdesc="cstool for capstone disassembler"

	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/cstool "$subpkgdir"/usr/bin
}

sha512sums="43c52024065b41b45eff9423341db3f3d5163fa7aa01b360faa30437786740c8f2c34c36faa04dced5308e09d8bd78df3bad0ab9c06f98612169edb176f83c36  capstone-4.0.1.tar.gz
e9a2d7cb391285890872123fb3e5ae8f8cde6e4f858c31f5c815c110f6c6d5ec86cef4920b277d5630745a34a268e52b402855429b072f0b5a722d6a610366a8  py-path-fix.patch"