Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / tools / analysis / rizin / rz-ghidra.nix
blobd349a33af8147b0a8c466d36724af0ec9e8649f8
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , fetchpatch
5 , cmake
6 # buildInputs
7 , rizin
8 , openssl
9 , pugixml
10 # optional buildInputs
11 , enableCutterPlugin ? true
12 , cutter
13 , qtbase
14 , qtsvg
17 stdenv.mkDerivation rec {
18   pname = "rz-ghidra";
19   version = "0.6.0";
21   src = fetchFromGitHub {
22     owner = "rizinorg";
23     repo = "rz-ghidra";
24     rev = "v${version}";
25     hash = "sha256-tQAurouRr6fP1tbIkfd0a9UfeYcwiU1BpjOTcooXkT0=";
26     fetchSubmodules = true;
27   };
29   patches = [
30     (fetchpatch {
31       url = "https://github.com/rizinorg/rz-ghidra/pull/327/commits/eba20e2c743ed3dfc5d1be090a5018f7267baa49.patch";
32       hash = "sha256-aoXFClXZBcOnHl+6lLYrnui7sRb3cRJQhQfNDLxHtcs=";
33     })
34   ];
36   nativeBuildInputs = [ cmake ];
37   buildInputs = [
38     openssl
39     pugixml
40     rizin
41   ] ++ lib.optionals enableCutterPlugin [
42     cutter
43     qtbase
44     qtsvg
45   ];
47   dontWrapQtApps = true;
49   cmakeFlags = [
50     "-DUSE_SYSTEM_PUGIXML=ON"
51   ] ++ lib.optionals enableCutterPlugin [
52     "-DBUILD_CUTTER_PLUGIN=ON"
53     "-DCUTTER_INSTALL_PLUGDIR=share/rizin/cutter/plugins/native"
54   ];
56   meta = with lib; {
57     description = "Deep ghidra decompiler and sleigh disassembler integration for rizin";
58     homepage = src.meta.homepage;
59     license = licenses.lgpl3;
60     maintainers = with maintainers; [ chayleaf ];
61   };