1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/development/python-modules/binwalk/default.nix

53 lines
1.1 KiB
Nix
Raw Normal View History

{ stdenv
, buildPythonPackage
, fetchFromGitHub
, zlib
, xz
, ncompress
, gzip
, bzip2
, gnutar
, p7zip
, cabextract
, lzma
2020-01-17 21:57:00 +00:00
, nose
, pycrypto
, pyqtgraph ? null }:
2020-01-17 21:57:00 +00:00
let
visualizationSupport = (pyqtgraph != null);
version = "2.2.0";
in
2019-08-13 22:52:01 +01:00
buildPythonPackage {
pname = "binwalk";
2020-01-17 21:57:00 +00:00
inherit version;
src = fetchFromGitHub {
owner = "devttys0";
repo = "binwalk";
2020-01-17 21:57:00 +00:00
rev = "be738a52e09b0da2a6e21470e0dbcd5beb42ed1b";
sha256 = "1bxgj569fzwv6jhcbl864nmlsi9x1k1r20aywjxc8b9b1zgqrlvc";
};
propagatedBuildInputs = [ zlib xz ncompress gzip bzip2 gnutar p7zip cabextract lzma pycrypto ]
2020-01-17 21:57:00 +00:00
++ stdenv.lib.optional visualizationSupport pyqtgraph;
# 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 ];
meta = with stdenv.lib; {
homepage = "https://github.com/ReFirmLabs/binwalk";
description = "A tool for searching a given binary image for embedded files";
maintainers = [ maintainers.koral ];
};
}