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 (lib.cmakeBool "BUILD_SHARED_LIBS" true)
22 ]
23 ++ lib.optionals stdenv.hostPlatform.isDarwin [ (lib.cmakeBool "CAPSTONE_BUILD_MACOS_THIN" true) ];
24
25 nativeBuildInputs = [
26 cmake
27 ]
28 ++ lib.optionals stdenv.hostPlatform.isDarwin [
29 fixDarwinDylibNames
30 ];
31
32 doCheck = true;
33
34 meta = {
35 description = "Advanced disassembly library";
36 homepage = "http://www.capstone-engine.org";
37 license = lib.licenses.bsd3;
38 maintainers = with lib.maintainers; [
39 thoughtpolice
40 ris
41 ];
42 mainProgram = "cstool";
43 platforms = lib.platforms.unix;
44 };
45}