From 47c2b205ae5e5b092b39671147dc39382ea4e0c0 Mon Sep 17 00:00:00 2001 From: koral Date: Mon, 22 Sep 2014 08:53:51 +0200 Subject: [PATCH 1/2] Added binwalk package, and its dependency pyqtgraph. --- pkgs/tools/misc/binwalk/default.nix | 32 +++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 14 +++++++++++++ pkgs/top-level/python-packages.nix | 20 ++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 pkgs/tools/misc/binwalk/default.nix diff --git a/pkgs/tools/misc/binwalk/default.nix b/pkgs/tools/misc/binwalk/default.nix new file mode 100644 index 000000000000..58b38a69425b --- /dev/null +++ b/pkgs/tools/misc/binwalk/default.nix @@ -0,0 +1,32 @@ +{ stdenv, fetchFromGitHub, python, wrapPython, curses +, pyqtgraph ? null +, visualizationSupport ? false }: + +assert visualizationSupport -> pyqtgraph != null; + +stdenv.mkDerivation rec { + version = "2.0.1"; + name = "binwalk-${version}"; + + src = fetchFromGitHub { + owner = "devttys0"; + repo = "binwalk"; + rev = "v${version}"; + sha256 = "1r5389lk3gk8y4ksrfljyb97l6pwnwvv8g1slbgr20avkzgw8zmn"; + }; + + pythonPath = with stdenv.lib; [ curses ] + ++ optional visualizationSupport [ pyqtgraph ]; + + propagatedBuildInputs = with stdenv.lib; [ python wrapPython curses ] + ++ optional visualizationSupport [ pyqtgraph ]; + + postInstall = "wrapPythonPrograms"; + + meta = with stdenv.lib; { + homepage = "http://binwalk.org"; + description = "A tool for searching a given binary image for embedded files"; + platforms = platforms.all; + maintainers = maintainers.koral; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 469e4eb23ccd..460a451568c8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -587,6 +587,20 @@ let bindfs = callPackage ../tools/filesystems/bindfs { }; + binwalk = callPackage ../tools/misc/binwalk { + python = pythonFull; + wrapPython = pythonPackages.wrapPython; + curses = pythonPackages.curses; + }; + + binwalk-full = callPackage ../tools/misc/binwalk { + python = pythonFull; + wrapPython = pythonPackages.wrapPython; + curses = pythonPackages.curses; + visualizationSupport = true; + pyqtgraph = pythonPackages.pyqtgraph; + }; + bitbucket-cli = pythonPackages.bitbucket-cli; blockdiag = pythonPackages.blockdiag; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index d0d7f60c909d..c6acb2750d9f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6607,6 +6607,26 @@ let }; }); + pyqtgraph = buildPythonPackage rec { + name = "pyqtgraph-${version}"; + version = "0.9.8"; + + src = fetchurl { + url = "https://pypi.python.org/packages/source/p/pyqtgraph/${name}.tar.gz"; + sha256 = "1fnhj26d9qrqqmjx092m1qspclh3mia3vag7rji5wciw0plpszi5"; + }; + + propagatedBuildInputs = [ scipy numpy pyqt4 pyopengl ]; + + meta = with stdenv.lib; { + description = "Scientific Graphics and GUI Library for Python"; + homepage = http://www.pyqtgraph.org/; + license = licenses.mit; + platforms = platforms.unix; + maintainers = [ maintainers.koral ]; + }; + }; + pyro3 = buildPythonPackage (rec { name = "Pyro-3.16"; disabled = isPy3k; From ec1712a6010037a1da9b665536ba8dd69f52f6a2 Mon Sep 17 00:00:00 2001 From: koral Date: Mon, 22 Sep 2014 20:37:39 +0200 Subject: [PATCH 2/2] Added runtime dependencies for binwalk. --- pkgs/tools/misc/binwalk/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/misc/binwalk/default.nix b/pkgs/tools/misc/binwalk/default.nix index 58b38a69425b..d3972dadd341 100644 --- a/pkgs/tools/misc/binwalk/default.nix +++ b/pkgs/tools/misc/binwalk/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, python, wrapPython, curses +{ stdenv, fetchFromGitHub, python, wrapPython, curses, mtdutils, zlib, xz, ncompress, gzip, bzip2, gnutar, p7zip, cabextract , pyqtgraph ? null , visualizationSupport ? false }: @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { pythonPath = with stdenv.lib; [ curses ] ++ optional visualizationSupport [ pyqtgraph ]; - propagatedBuildInputs = with stdenv.lib; [ python wrapPython curses ] + propagatedBuildInputs = with stdenv.lib; [ python wrapPython curses mtdutils zlib xz ncompress gzip bzip2 gnutar p7zip cabextract ] ++ optional visualizationSupport [ pyqtgraph ]; postInstall = "wrapPythonPrograms";