mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-03-14 08:26:37 +01:00
There is no need to disable Python packages for Python versions that are
no longer in Nixpkgs.
This change was generated using the following script:
pattern='^\s*disabled\s*=\s*pythonOlder\s*"3\.\([0-9]\|10\)"\s*;\s*$'
for f in $(find -name '*.nix'); do
grep -q "$pattern" "$f" || continue
sed -i "/$pattern/d" "$f"
if [ $(grep -c pythonOlder "$f") == 1 ]; then
sed -i '/^\s*pythonOlder,\s*$/d' "$f"
fi
nixfmt "$f"
done
53 lines
1.4 KiB
Nix
53 lines
1.4 KiB
Nix
{
|
|
stdenv,
|
|
lib,
|
|
python,
|
|
buildPythonPackage,
|
|
fetchPypi,
|
|
radare2,
|
|
coreutils,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "r2pipe";
|
|
version = "1.9.6";
|
|
format = "setuptools";
|
|
|
|
postPatch =
|
|
let
|
|
r2lib = "${lib.getOutput "lib" radare2}/lib";
|
|
libr_core = "${r2lib}/libr_core${stdenv.hostPlatform.extensions.sharedLibrary}";
|
|
in
|
|
''
|
|
# Fix find_library, can be removed after
|
|
# https://github.com/NixOS/nixpkgs/issues/7307 is resolved.
|
|
substituteInPlace r2pipe/native.py --replace 'find_library("r_core")' "'${libr_core}'"
|
|
|
|
# Fix the default r2 executable
|
|
substituteInPlace r2pipe/open_sync.py --replace 'r2e = "radare2"' "r2e = '${radare2}/bin/radare2'"
|
|
substituteInPlace r2pipe/open_base.py --replace 'which("radare2")' "'${radare2}/bin/radare2'"
|
|
'';
|
|
|
|
src = fetchPypi {
|
|
inherit pname version;
|
|
hash = "sha256-OAS3Yr1CmMMuhEP/tRO9YAdYZ3emib0huXl3/rjLLJk=";
|
|
};
|
|
|
|
# Tiny sanity check to make sure r2pipe finds radare2 (since r2pipe doesn't
|
|
# provide its own tests):
|
|
# Analyze ls with the fastest analysis and do nothing with the result.
|
|
postCheck = ''
|
|
${python.interpreter} <<EOF
|
|
import r2pipe
|
|
r2 = r2pipe.open('${coreutils}/bin/ls')
|
|
r2.cmd('a')
|
|
EOF
|
|
'';
|
|
|
|
meta = {
|
|
description = "Interact with radare2";
|
|
homepage = "https://github.com/radare/radare2-r2pipe";
|
|
license = lib.licenses.mit;
|
|
maintainers = with lib.maintainers; [ timokau ];
|
|
};
|
|
}
|