2 , pkgs # for passthru.plugins
28 let rizin = stdenv.mkDerivation rec {
33 url = "https://github.com/rizinorg/rizin/releases/download/v${version}/rizin-src-v${version}.tar.xz";
34 hash = "sha256-4O0lraa+QgmNONqczvS++9VJ5HfoD43/pcobj/n72nQ=";
38 "-Duse_sys_capstone=enabled"
39 "-Duse_sys_magic=enabled"
40 "-Duse_sys_libzip=enabled"
41 "-Duse_sys_zlib=enabled"
42 "-Duse_sys_lz4=enabled"
43 "-Duse_sys_libzstd=enabled"
44 "-Duse_sys_lzma=enabled"
45 "-Duse_sys_xxhash=enabled"
46 "-Duse_sys_openssl=enabled"
47 "-Duse_sys_libmspack=enabled"
48 "-Duse_sys_tree_sitter=enabled"
49 "-Duse_sys_pcre2=enabled"
50 # this is needed for wrapping (adding plugins) to work
55 # Normally, Rizin only looks for files in the install prefix. With
56 # portable=true, it instead looks for files in relation to the parent
57 # of the directory of the binary file specified in /proc/self/exe,
58 # caching it. This patch replaces the entire logic to only look at
59 # the env var NIX_RZ_PREFIX
60 ./librz-wrapper-support.patch
62 ./0001-fix-compilation-with-clang.patch
69 (python3.withPackages (pp: with pp; [
76 # meson's find_library seems to not use our compiler wrapper if static parameter
77 # is either true/false... We work around by also providing LIBRARY_PATH
80 for b in ${toString (map lib.getLib buildInputs)}; do
81 if [[ -d "$b/lib" ]]; then
82 LIBRARY_PATH="$b/lib''${LIBRARY_PATH:+:}$LIBRARY_PATH"
86 '' + lib.optionalString stdenv.isDarwin ''
87 substituteInPlace binrz/rizin/macos_sign.sh \
88 --replace 'codesign' '# codesign'
111 # find_installation without arguments uses Meson’s Python interpreter,
112 # which does not have any extra modules.
113 # https://github.com/mesonbuild/meson/pull/9904
114 substituteInPlace meson.build \
115 --replace "import('python').find_installation()" "find_program('python3')"
120 jsdec = pkgs.callPackage ./jsdec.nix {
121 inherit rizin openssl;
123 rz-ghidra = pkgs.qt6.callPackage ./rz-ghidra.nix {
124 inherit rizin openssl;
125 enableCutterPlugin = false;
127 # sigdb isn't a real plugin, but it's separated from the main rizin
128 # derivation so that only those who need it will download it
129 sigdb = pkgs.callPackage ./sigdb.nix { };
131 withPlugins = filter: pkgs.callPackage ./wrapper.nix {
133 plugins = filter plugins;
138 description = "UNIX-like reverse engineering framework and command-line toolset.";
139 homepage = "https://rizin.re/";
140 license = lib.licenses.gpl3Plus;
141 mainProgram = "rizin";
142 maintainers = with lib.maintainers; [ raskin makefu mic92 ];
143 platforms = with lib.platforms; unix;