aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/tools/security/nmap
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/security/nmap')
-rw-r--r--nixpkgs/pkgs/tools/security/nmap/default.nix43
-rw-r--r--nixpkgs/pkgs/tools/security/nmap/qt.nix4
2 files changed, 20 insertions, 27 deletions
diff --git a/nixpkgs/pkgs/tools/security/nmap/default.nix b/nixpkgs/pkgs/tools/security/nmap/default.nix
index 1b66dab35c8..f88c533d71d 100644
--- a/nixpkgs/pkgs/tools/security/nmap/default.nix
+++ b/nixpkgs/pkgs/tools/security/nmap/default.nix
@@ -1,24 +1,16 @@
{ stdenv, fetchurl, fetchpatch, libpcap, pkgconfig, openssl, lua5_3
+, pcre, liblinear, libssh2
, graphicalSupport ? false
, libX11 ? null
, gtk2 ? null
-, withPython ? false # required for the `ndiff` binary
-, python2Packages ? null
+, python2 ? null
, makeWrapper ? null
, withLua ? true
}:
-assert withPython -> python2Packages != null;
-
with stdenv.lib;
-let
-
- # Zenmap (the graphical program) also requires Python,
- # so automatically enable pythonSupport if graphicalSupport is requested.
- pythonSupport = withPython || graphicalSupport;
-
-in stdenv.mkDerivation rec {
+stdenv.mkDerivation rec {
name = "nmap${optionalString graphicalSupport "-graphical"}-${version}";
version = "7.80";
@@ -48,10 +40,7 @@ in stdenv.mkDerivation rec {
configureFlags = [
(if withLua then "--with-liblua=${lua5_3}" else "--without-liblua")
- ]
- ++ optional (!pythonSupport) "--without-ndiff"
- ++ optional (!graphicalSupport) "--without-zenmap"
- ;
+ ] ++ optionals (!graphicalSupport) [ "--without-ndiff" "--without-zenmap" ];
makeFlags = optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
"AR=${stdenv.cc.bintools.targetPrefix}ar"
@@ -59,18 +48,22 @@ in stdenv.mkDerivation rec {
"CC=${stdenv.cc.targetPrefix}gcc"
];
- postInstall = optionalString pythonSupport ''
- wrapProgram $out/bin/ndiff --prefix PYTHONPATH : "$(toPythonPath $out)" --prefix PYTHONPATH : "$PYTHONPATH"
- '' + optionalString graphicalSupport ''
- wrapProgram $out/bin/zenmap --prefix PYTHONPATH : "$(toPythonPath $out)" --prefix PYTHONPATH : "$PYTHONPATH" --prefix PYTHONPATH : $(toPythonPath $pygtk)/gtk-2.0 --prefix PYTHONPATH : $(toPythonPath $pygobject)/gtk-2.0 --prefix PYTHONPATH : $(toPythonPath $pycairo)/gtk-2.0
+ pythonPath = with python2.pkgs; optionals graphicalSupport [
+ pygtk pysqlite pygobject2 pycairo
+ ];
+
+ nativeBuildInputs = [ pkgconfig ] ++ optionals graphicalSupport [ python2.pkgs.wrapPython ];
+ buildInputs = [ pcre liblinear libssh2 libpcap openssl ] ++ optionals graphicalSupport (with python2.pkgs; [
+ python2 libX11 gtk2
+ ]);
+
+ postInstall = optionalString graphicalSupport ''
+ buildPythonPath "$out $pythonPath"
+ patchPythonScript $out/bin/ndiff
+ patchPythonScript $out/bin/zenmap
'';
- nativeBuildInputs = [ pkgconfig ];
- buildInputs = with python2Packages; [ libpcap openssl ]
- ++ optionals pythonSupport [ makeWrapper python ]
- ++ optionals graphicalSupport [
- libX11 gtk2 pygtk pysqlite pygobject2 pycairo
- ];
+ enableParallelBuilding = true;
doCheck = false; # fails 3 tests, probably needs the net
diff --git a/nixpkgs/pkgs/tools/security/nmap/qt.nix b/nixpkgs/pkgs/tools/security/nmap/qt.nix
index f873c475bbf..2dcd7fed0c4 100644
--- a/nixpkgs/pkgs/tools/security/nmap/qt.nix
+++ b/nixpkgs/pkgs/tools/security/nmap/qt.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, pkgconfig, makeWrapper
+{ stdenv, fetchFromGitHub, cmake, pkgconfig, wrapQtAppsHook
, dnsutils, nmap
, qtbase, qtscript, qtwebengine }:
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
sha256 = "10wqyrjzmad1g7lqa65rymbkna028xbp4xcpj442skw8gyrs3994";
};
- nativeBuildInputs = [ cmake makeWrapper pkgconfig ];
+ nativeBuildInputs = [ cmake pkgconfig wrapQtAppsHook ];
buildInputs = [ qtbase qtscript qtwebengine ];