Skip to content

Commit

Permalink
python3Packages.binwalk: 2.3.4 -> 2.4.1
Browse files Browse the repository at this point in the history
Updates to the newly maintained fork at OSPG/binwalk, which migrates
from nose to pytest. Also re-enables using capstone for disassembly as
this PR also fixes the capstone build on python 3.12.
  • Loading branch information
pyrox0 committed Jun 17, 2024
1 parent bd3985b commit d706084
Showing 1 changed file with 16 additions and 22 deletions.
38 changes: 16 additions & 22 deletions pkgs/development/python-modules/binwalk/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,49 +10,41 @@
bzip2,
gnutar,
p7zip,
capstone,
cabextract,
cramfsprogs,
cramfsswap,
sasquatch,
squashfsTools,
matplotlib,
nose,
pytestCheckHook,
pycrypto,
pyqtgraph,
setuptools,
visualizationSupport ? false,
}:

buildPythonPackage rec {
pname = "binwalk${lib.optionalString visualizationSupport "-full"}";
version = "2.3.4";
format = "setuptools";
version = "2.4.1";
pyproject = true;

src = fetchFromGitHub {
owner = "ReFirmLabs";
owner = "OSPG";
repo = "binwalk";
rev = "v${version}";
hash = "sha256-hlPbzqGRSXcIqlI+SNKq37CnnHd1IoMBNSjhyeAM1TE=";
hash = "sha256-VApqQrVBV7w15Bpwc6Fd/cA1Ikqu7Ds8qu0TH68YVog=";
};

patches = [
# test_firmware_zip fails with 2.3.3 upgrade
# https://github.com/ReFirmLabs/binwalk/issues/566
(fetchpatch {
url = "https://github.com/ReFirmLabs/binwalk/commit/dd4f2efd275c9dd1001130e82e0f985110cd2754.patch";
sha256 = "1707n4nf1d1ay1yn4i8qlrvj2c1120g88hjwyklpsc2s2dcnqj9r";
includes = [ "testing/tests/test_firmware_zip.py" ];
revert = true;
})
];

propagatedBuildInputs =
dependencies =
[
zlib
xz
gzip
bzip2
gnutar
p7zip
capstone
cabextract
squashfsTools
xz
Expand All @@ -68,6 +60,8 @@ buildPythonPackage rec {
sasquatch
];

build-system = [ setuptools ];

# setup.py only installs version.py during install, not test
postPatch = ''
echo '__version__ = "${version}"' > src/binwalk/core/version.py
Expand All @@ -78,15 +72,15 @@ buildPythonPackage rec {
HOME=$(mktemp -d)
'';

nativeCheckInputs = [ nose ];
nativeCheckInputs = [ pytestCheckHook ];

pythonImportsCheck = [ "binwalk" ];

meta = with lib; {
homepage = "https://github.com/ReFirmLabs/binwalk";
meta = {
homepage = "https://github.com/OSPG/binwalk";
description = "Tool for searching a given binary image for embedded files";
mainProgram = "binwalk";
maintainers = [ maintainers.koral ];
license = licenses.mit;
maintainers = with lib.maintainers; [ koral ];
license = lib.licenses.mit;
};
}

0 comments on commit d706084

Please sign in to comment.