summaryrefslogtreecommitdiff
path: root/community/capstone/APKBUILD
blob: 1fe7cb938969769586d3fe8ccd45248df6ffe1ea (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
# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Maintainer: Valery Kartel <valery.kartel@gmail.com>
pkgname=capstone
pkgver=4.0.2
pkgrel=5
pkgdesc="The Ultimate Disassembler"
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
	fix_version.patch
	"
options="!check" # Testsuite fails

build() {
	CFLAGS="$CFLAGS -O2 -flto=auto -ffat-lto-objects" make
}

check() {
	make check
}

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

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

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

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

	amove usr/lib/python*
}

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

	amove usr/bin/cstool
}

sha512sums="
7f93534517307b737422a8825b66b2a1f3e1cca2049465d60ab12595940154aaf843ba40ed348fce58de58b990c19a0caef289060eb72898cb008a88c470970e  capstone-4.0.2.tar.gz
e9a2d7cb391285890872123fb3e5ae8f8cde6e4f858c31f5c815c110f6c6d5ec86cef4920b277d5630745a34a268e52b402855429b072f0b5a722d6a610366a8  py-path-fix.patch
332c2043b8fc0d86d747546fc7eb89f5b6ed9e8f11645b96b571c896027e90f2265e9a1aafe904131d8a05813296a91577d09a91046516909034d991e5b288e0  fix_version.patch
"