12 buildPythonPackage rec {
15 format = "setuptools";
17 disabled = pythonOlder "3.7";
21 r2lib = "${lib.getOutput "lib" radare2}/lib";
22 libr_core = "${r2lib}/libr_core${stdenv.hostPlatform.extensions.sharedLibrary}";
25 # Fix find_library, can be removed after
26 # https://github.com/NixOS/nixpkgs/issues/7307 is resolved.
27 substituteInPlace r2pipe/native.py --replace 'find_library("r_core")' "'${libr_core}'"
29 # Fix the default r2 executable
30 substituteInPlace r2pipe/open_sync.py --replace 'r2e = "radare2"' "r2e = '${radare2}/bin/radare2'"
31 substituteInPlace r2pipe/open_base.py --replace 'which("radare2")' "'${radare2}/bin/radare2'"
35 inherit pname version;
36 hash = "sha256-Ah3kb+Hk1pMlQ8D1SMPAISbL2n6TDG0Ih9ezmW7oIRk=";
39 # Tiny sanity check to make sure r2pipe finds radare2 (since r2pipe doesn't
40 # provide its own tests):
41 # Analyze ls with the fastest analysis and do nothing with the result.
43 ${python.interpreter} <<EOF
45 r2 = r2pipe.open('${coreutils}/bin/ls')
51 description = "Interact with radare2";
52 homepage = "https://github.com/radare/radare2-r2pipe";
53 license = licenses.mit;
54 maintainers = with maintainers; [ timokau ];