summary refs log tree commit diff
path: root/pkgs/development/python-modules/capstone/default.nix
blob: 91e00ed7e43cfed072ae2056e14a42ab77521087 (plain) (blame)
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
{ stdenv
, buildPythonPackage
, fetchPypi
, fetchpatch
}:

buildPythonPackage rec {
  pname = "capstone";
  version = "3.0.4";

  src = fetchPypi {
    inherit pname version;
    sha256 = "945d3b8c3646a1c3914824c416439e2cf2df8969dd722c8979cdcc23b40ad225";
  };

  patches = [
    (fetchpatch {
      stripLen = 2;
      url = "https://patch-diff.githubusercontent.com/raw/aquynh/capstone/pull/783/commits/23fe9f36622573c747e2bab6119ff245437bf276.patch";
      sha256 = "0yizqrdlxqxn16873593kdx2vrr7gvvilhgcf9xy6hr0603d3m5r";
    })
  ];

  postPatch = ''
    patchShebangs src/make.sh
  '';

  preCheck = ''
    mv src/libcapstone.so capstone
  '';

  meta = with stdenv.lib; {
    homepage = "http://www.capstone-engine.org/";
    license = licenses.bsdOriginal;
    description = "Capstone disassembly engine";
    maintainers = with maintainers; [ bennofs ];
  };
}