Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 20.09-beta 55 lines 1.3 kB view raw
1{ stdenv 2, buildPythonPackage 3, fetchFromGitHub 4, zlib 5, xz 6, ncompress 7, gzip 8, bzip2 9, gnutar 10, p7zip 11, cabextract 12, cramfsprogs 13, cramfsswap 14, lzma 15, matplotlib 16, nose 17, pycrypto 18, pyqtgraph ? null }: 19 20let 21 visualizationSupport = (pyqtgraph != null) && (matplotlib != null); 22 version = "2.2.0"; 23in 24buildPythonPackage { 25 pname = "binwalk"; 26 inherit version; 27 28 src = fetchFromGitHub { 29 owner = "devttys0"; 30 repo = "binwalk"; 31 rev = "be738a52e09b0da2a6e21470e0dbcd5beb42ed1b"; 32 sha256 = "1bxgj569fzwv6jhcbl864nmlsi9x1k1r20aywjxc8b9b1zgqrlvc"; 33 }; 34 35 propagatedBuildInputs = [ zlib xz ncompress gzip bzip2 gnutar p7zip cabextract cramfsswap cramfsprogs lzma pycrypto ] 36 ++ stdenv.lib.optionals visualizationSupport [ matplotlib pyqtgraph ]; 37 38 # setup.py only installs version.py during install, not test 39 postPatch = '' 40 echo '__version__ = "${version}"' > src/binwalk/core/version.py 41 ''; 42 43 # binwalk wants to access ~/.config/binwalk/magic 44 preCheck = '' 45 HOME=$(mktemp -d) 46 ''; 47 48 checkInputs = [ nose ]; 49 50 meta = with stdenv.lib; { 51 homepage = "https://github.com/ReFirmLabs/binwalk"; 52 description = "A tool for searching a given binary image for embedded files"; 53 maintainers = [ maintainers.koral ]; 54 }; 55}