2018-10-15 16:47:16 +01:00
|
|
|
{ stdenv
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, zlib
|
|
|
|
, xz
|
|
|
|
, ncompress
|
|
|
|
, gzip
|
|
|
|
, bzip2
|
|
|
|
, gnutar
|
2020-06-11 14:17:03 +01:00
|
|
|
, p7zip
|
2018-10-15 16:47:16 +01:00
|
|
|
, cabextract
|
2020-07-31 00:30:44 +01:00
|
|
|
, cramfsprogs
|
|
|
|
, cramfsswap
|
2018-10-15 16:47:16 +01:00
|
|
|
, lzma
|
2020-08-16 12:13:17 +01:00
|
|
|
, matplotlib
|
2020-01-17 21:57:00 +00:00
|
|
|
, nose
|
2018-10-15 16:47:16 +01:00
|
|
|
, pycrypto
|
|
|
|
, pyqtgraph ? null }:
|
|
|
|
|
2020-01-17 21:57:00 +00:00
|
|
|
let
|
2020-08-16 12:13:17 +01:00
|
|
|
visualizationSupport = (pyqtgraph != null) && (matplotlib != null);
|
2020-01-17 21:57:00 +00:00
|
|
|
version = "2.2.0";
|
2018-10-15 16:47:16 +01:00
|
|
|
in
|
2019-08-13 22:52:01 +01:00
|
|
|
buildPythonPackage {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "binwalk";
|
2020-01-17 21:57:00 +00:00
|
|
|
inherit version;
|
2018-10-15 16:47:16 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "devttys0";
|
|
|
|
repo = "binwalk";
|
2020-01-17 21:57:00 +00:00
|
|
|
rev = "be738a52e09b0da2a6e21470e0dbcd5beb42ed1b";
|
|
|
|
sha256 = "1bxgj569fzwv6jhcbl864nmlsi9x1k1r20aywjxc8b9b1zgqrlvc";
|
2018-10-15 16:47:16 +01:00
|
|
|
};
|
|
|
|
|
2020-07-31 00:30:44 +01:00
|
|
|
propagatedBuildInputs = [ zlib xz ncompress gzip bzip2 gnutar p7zip cabextract cramfsswap cramfsprogs lzma pycrypto ]
|
2020-08-16 12:13:17 +01:00
|
|
|
++ stdenv.lib.optionals visualizationSupport [ matplotlib pyqtgraph ];
|
2020-01-17 21:57:00 +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)
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkInputs = [ nose ];
|
2018-10-15 16:47:16 +01:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2019-12-08 16:50:31 +00:00
|
|
|
homepage = "https://github.com/ReFirmLabs/binwalk";
|
2018-10-15 16:47:16 +01:00
|
|
|
description = "A tool for searching a given binary image for embedded files";
|
|
|
|
maintainers = [ maintainers.koral ];
|
|
|
|
};
|
|
|
|
}
|