1{ stdenv
2, buildPythonPackage
3, fetchPypi
4, fetchpatch
5, setuptools
6}:
7
8buildPythonPackage rec {
9 pname = "capstone";
10 version = "3.0.5.post1";
11
12 setupPyBuildFlags = [
13 "--plat-name x86_64-linux"
14 ];
15
16 src = fetchPypi {
17 inherit pname version;
18 sha256 = "3c0f73db9f8392f7048c8a244809f154d7c39f354e2167f6c477630aa517ed04";
19 };
20
21 propagatedBuildInputs = [ setuptools ];
22
23 patches = [
24 (fetchpatch {
25 stripLen = 2;
26 url = "https://patch-diff.githubusercontent.com/raw/aquynh/capstone/pull/783/commits/23fe9f36622573c747e2bab6119ff245437bf276.patch";
27 sha256 = "0yizqrdlxqxn16873593kdx2vrr7gvvilhgcf9xy6hr0603d3m5r";
28 })
29 ];
30
31 postPatch = ''
32 patchShebangs src/make.sh
33 '';
34
35 preCheck = ''
36 mv src/libcapstone.so capstone
37 '';
38
39 meta = with stdenv.lib; {
40 homepage = "http://www.capstone-engine.org/";
41 license = licenses.bsdOriginal;
42 description = "Capstone disassembly engine";
43 maintainers = with maintainers; [ bennofs ];
44 };
45}