1{
2 lib,
3 stdenv,
4 cmake,
5 fetchFromGitHub,
6 fixDarwinDylibNames,
7}:
8
9stdenv.mkDerivation rec {
10 pname = "capstone";
11 version = "5.0.6";
12
13 src = fetchFromGitHub {
14 owner = "capstone-engine";
15 repo = "capstone";
16 rev = version;
17 hash = "sha256-ovIvsxVq+/q5UUMzP4WpxzaE0898uayNc1g2Coignnc=";
18 };
19
20 cmakeFlags =
21 [
22 (lib.cmakeBool "BUILD_SHARED_LIBS" true)
23 ]
24 ++ lib.optionals stdenv.hostPlatform.isDarwin [ (lib.cmakeBool "CAPSTONE_BUILD_MACOS_THIN" true) ];
25
26 nativeBuildInputs =
27 [
28 cmake
29 ]
30 ++ lib.optionals stdenv.hostPlatform.isDarwin [
31 fixDarwinDylibNames
32 ];
33
34 doCheck = true;
35
36 meta = {
37 description = "Advanced disassembly library";
38 homepage = "http://www.capstone-engine.org";
39 license = lib.licenses.bsd3;
40 maintainers = with lib.maintainers; [
41 thoughtpolice
42 ris
43 ];
44 mainProgram = "cstool";
45 platforms = lib.platforms.unix;
46 };
47}