Skip to content

Commit

Permalink
nmap: remove graphical support
Browse files Browse the repository at this point in the history
  • Loading branch information
armeenm committed Apr 26, 2022
1 parent 6e4f70e commit 67b8871
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 23 deletions.
24 changes: 6 additions & 18 deletions pkgs/tools/security/nmap/default.nix
@@ -1,17 +1,15 @@
{ lib, stdenv, fetchurl, fetchpatch, libpcap, pkg-config, openssl, lua5_3
, pcre, libssh2
, graphicalSupport ? false
, libX11 ? null
, gtk2 ? null
, python2 ? null
, makeWrapper ? null
, withLua ? true
}:

with lib;

stdenv.mkDerivation rec {
pname = "nmap${optionalString graphicalSupport "-graphical"}";
pname = "nmap";
version = "7.92";

src = fetchurl {
Expand Down Expand Up @@ -41,28 +39,18 @@ stdenv.mkDerivation rec {
configureFlags = [
(if withLua then "--with-liblua=${lua5_3}" else "--without-liblua")
"--with-liblinear=included"
] ++ optionals (!graphicalSupport) [ "--without-ndiff" "--without-zenmap" ];
"--without-ndiff"
"--without-zenmap"
];

makeFlags = optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
"AR=${stdenv.cc.bintools.targetPrefix}ar"
"RANLIB=${stdenv.cc.bintools.targetPrefix}ranlib"
"CC=${stdenv.cc.targetPrefix}gcc"
];

pythonPath = with python2.pkgs; optionals graphicalSupport [
pygtk pysqlite pygobject2 pycairo
];

nativeBuildInputs = [ pkg-config ] ++ optionals graphicalSupport [ python2.pkgs.wrapPython ];
buildInputs = [ pcre 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 = [ pkg-config ];
buildInputs = [ pcre libssh2 libpcap openssl ];

enableParallelBuilding = true;

Expand Down
3 changes: 2 additions & 1 deletion pkgs/top-level/aliases.nix
Expand Up @@ -867,7 +867,8 @@ mapAliases ({
nix_2_6 = nixVersions.nix_2_6;
nixopsUnstable = nixops_unstable; # Added 2022-03-03
nmap-unfree = nmap; # Added 2021-04-06
nmap_graphical = throw "'nmap_graphical' has been renamed to/replaced by 'nmap-graphical'"; # Converted to throw 2022-02-22
nmap-graphical = throw "nmap graphical support has been removed due to its python2 dependency"; # Added 2022-04-26
nmap_graphical = throw "nmap graphical support has been removed due to its python2 dependency"; # Modified 2022-04-26
nologin = throw "'nologin' has been renamed to/replaced by 'shadow'"; # Converted to throw 2022-02-22
nordic-polar = throw "nordic-polar was removed on 2021-05-27, now integrated in nordic"; # Added 2021-05-27
noto-fonts-cjk = noto-fonts-cjk-sans; # Added 2021-12-16
Expand Down
4 changes: 0 additions & 4 deletions pkgs/top-level/all-packages.nix
Expand Up @@ -8675,10 +8675,6 @@ with pkgs;

nmap = callPackage ../tools/security/nmap { };

nmap-graphical = nmap.override {
graphicalSupport = true;
};

nmap-formatter = callPackage ../tools/security/nmap-formatter { };

nmapsi4 = libsForQt5.callPackage ../tools/security/nmap/qt.nix { };
Expand Down

0 comments on commit 67b8871

Please sign in to comment.