# Contributor: Valery Kartel # Maintainer: Valery Kartel pkgname=capstone pkgver=4.0.1 pkgrel=1 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 cython3 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"