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 May 25, 2024
1 parent c5b6daa commit f679dd2
Showing 1 changed file with 15 additions and 24 deletions.
39 changes: 15 additions & 24 deletions pkgs/development/python-modules/binwalk/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,46 +9,37 @@
, 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 = [ zlib xz gzip bzip2 gnutar p7zip cabextract squashfsTools xz pycrypto ]
dependencies = [ zlib xz gzip bzip2 gnutar p7zip capstone cabextract squashfsTools xz pycrypto ]
++ lib.optionals visualizationSupport [ matplotlib pyqtgraph ]
++ lib.optionals (!stdenv.isDarwin) [ cramfsprogs cramfsswap 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 @@ -59,15 +50,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 = "A 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 f679dd2

Please sign in to comment.