Skip to content

Commit

Permalink
python312Packages.binwalk: 2.3.4 -> 2.4.1
Browse files Browse the repository at this point in the history
Updates to the community supported fork of binwalk, and modernizes the
code to modern Nix Python packaging standards.
  • Loading branch information
pyrox0 committed Jul 9, 2024
1 parent b9690cf commit af4bae4
Showing 1 changed file with 14 additions and 22 deletions.
36 changes: 14 additions & 22 deletions pkgs/development/python-modules/binwalk/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,27 @@
sasquatch,
squashfsTools,
matplotlib,
nose,
pytestCheckHook,
pycrypto,
pyqtgraph,
pyqt5,
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
Expand All @@ -70,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 @@ -80,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 af4bae4

Please sign in to comment.