2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
stdenv,
|
|
|
|
zlib,
|
|
|
|
xz,
|
|
|
|
gzip,
|
|
|
|
bzip2,
|
|
|
|
gnutar,
|
|
|
|
p7zip,
|
|
|
|
cabextract,
|
|
|
|
cramfsprogs,
|
|
|
|
cramfsswap,
|
|
|
|
sasquatch,
|
2024-07-27 06:49:29 +00:00
|
|
|
setuptools,
|
2024-06-05 15:53:02 +00:00
|
|
|
squashfsTools,
|
|
|
|
matplotlib,
|
|
|
|
pycrypto,
|
|
|
|
pyqtgraph,
|
2024-07-01 15:47:52 +00:00
|
|
|
pyqt5,
|
2024-07-27 06:49:29 +00:00
|
|
|
pytestCheckHook,
|
2024-06-05 15:53:02 +00:00
|
|
|
visualizationSupport ? false,
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
buildPythonPackage rec {
|
2022-03-05 16:20:37 +00:00
|
|
|
pname = "binwalk${lib.optionalString visualizationSupport "-full"}";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "2.4.2";
|
2024-07-27 06:49:29 +00:00
|
|
|
pyproject = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2024-07-27 06:49:29 +00:00
|
|
|
owner = "OSPG";
|
2020-04-24 23:36:52 +00:00
|
|
|
repo = "binwalk";
|
2024-09-19 14:19:46 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-IFq/XotW3bbf3obWXRK6Nw1KQDqyFHb4tcA09Twg8SQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
build-system = [ setuptools ];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs =
|
|
|
|
[
|
|
|
|
zlib
|
|
|
|
xz
|
|
|
|
gzip
|
|
|
|
bzip2
|
|
|
|
gnutar
|
|
|
|
p7zip
|
|
|
|
cabextract
|
|
|
|
squashfsTools
|
|
|
|
xz
|
|
|
|
pycrypto
|
|
|
|
]
|
|
|
|
++ lib.optionals visualizationSupport [
|
|
|
|
matplotlib
|
|
|
|
pyqtgraph
|
2024-07-01 15:47:52 +00:00
|
|
|
pyqt5
|
2024-06-05 15:53:02 +00:00
|
|
|
]
|
|
|
|
++ lib.optionals (!stdenv.isDarwin) [
|
|
|
|
cramfsprogs
|
|
|
|
cramfsswap
|
|
|
|
sasquatch
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# setup.py only installs version.py during install, not test
|
|
|
|
postPatch = ''
|
|
|
|
echo '__version__ = "${version}"' > src/binwalk/core/version.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
# binwalk wants to access ~/.config/binwalk/magic
|
|
|
|
preCheck = ''
|
|
|
|
HOME=$(mktemp -d)
|
|
|
|
'';
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
pythonImportsCheck = [ "binwalk" ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2024-07-27 06:49:29 +00:00
|
|
|
homepage = "https://github.com/OSPG/binwalk";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Tool for searching a given binary image for embedded files";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "binwalk";
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = [ maintainers.koral ];
|
2021-04-25 03:57:28 +00:00
|
|
|
license = licenses.mit;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|