diff --git a/pkgs/tools/security/nmap/qt.nix b/pkgs/tools/security/nmap/qt.nix new file mode 100644 index 000000000000..c15d9bf25283 --- /dev/null +++ b/pkgs/tools/security/nmap/qt.nix @@ -0,0 +1,53 @@ +{ stdenv, fetchurl, cmake, pkgconfig, makeWrapper +, dnsutils, nmap +, qtbase, qtscript, qtwebkit }: + +stdenv.mkDerivation rec { + name = "nmapsi4-${version}"; + version = "0.5-alpha1"; + + src = fetchurl { + url = "mirror://sourceforge/nmapsi/${name}.tar.xz"; + sha256 = "18v9a3l2nmij3gb4flscigxr5c44nphkjfmk07qpyy73fy61mzrs"; + }; + + nativeBuildInputs = [ cmake makeWrapper pkgconfig ]; + + buildInputs = [ qtbase qtscript qtwebkit ]; + + enableParallelBuilding = true; + + postPatch = '' + for f in \ + src/platform/digmanager.cpp \ + src/platform/discover.cpp \ + src/platform/monitor/monitor.cpp \ + src/platform/nsemanager.cpp ; do + + substituteInPlace $f \ + --replace '"dig"' '"${dnsutils}/bin/dig"'\ + --replace '"nmap"' '"${nmap}/bin/nmap"' \ + --replace '"nping"' '"${nmap}/bin/nping"' + done + ''; + + postInstall = '' + mv $out/share/applications/kde4/*.desktop $out/share/applications + rmdir $out/share/applications/kde4 + + for f in $out/share/applications/* ; do + substituteInPlace $f \ + --replace Qt4 Qt5 \ + --replace Exec=nmapsi4 Exec=$out/bin/nmapsi4 \ + --replace "Exec=kdesu nmapsi4" "Exec=kdesu $out/bin/nmapsi4" + done + ''; + + meta = with stdenv.lib; { + description = "Qt frontend for nmap"; + homepage = https://www.nmapsi4.org/; + license = licenses.gpl2; + platforms = platforms.all; + maintainers = with maintainers; [ peterhoeg ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 18717a3780ad..908d1a8f7bbd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3773,6 +3773,8 @@ with pkgs; graphicalSupport = true; }; + nmapsi4 = libsForQt5.callPackage ../tools/security/nmap/qt.nix { }; + nnn = callPackage ../applications/misc/nnn { }; notary = callPackage ../tools/security/notary { };