2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv
|
2020-10-29 13:10:12 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
2021-01-17 03:51:22 +00:00
|
|
|
, pkg-config
|
2020-10-29 13:10:12 +00:00
|
|
|
, wrapQtAppsHook
|
|
|
|
, dnsutils
|
|
|
|
, nmap
|
|
|
|
, qtbase
|
|
|
|
, qtscript
|
|
|
|
, qtwebengine
|
|
|
|
}:
|
2018-02-05 11:16:08 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "nmapsi4";
|
2020-10-29 13:10:12 +00:00
|
|
|
version = "0.5-alpha2";
|
2018-02-05 11:16:08 +00:00
|
|
|
|
2019-04-10 14:21:53 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nmapsi4";
|
|
|
|
repo = "nmapsi4";
|
2020-10-29 13:10:12 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-q3XfwJ4TGK4E58haN0Q0xRH4GDpKD8VZzyxHe/VwBqY=";
|
2018-02-05 11:16:08 +00:00
|
|
|
};
|
|
|
|
|
2021-01-17 03:51:22 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config wrapQtAppsHook ];
|
2018-02-05 11:16:08 +00:00
|
|
|
|
2019-04-10 14:21:53 +01:00
|
|
|
buildInputs = [ qtbase qtscript qtwebengine ];
|
2018-02-05 11:16:08 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
2019-04-10 14:21:53 +01:00
|
|
|
substituteInPlace src/platform/digmanager.cpp \
|
|
|
|
--replace '"dig"' '"${dnsutils}/bin/dig"'
|
|
|
|
substituteInPlace src/platform/discover.cpp \
|
|
|
|
--replace '"nping"' '"${nmap}/bin/nping"'
|
2018-02-05 11:16:08 +00:00
|
|
|
for f in \
|
|
|
|
src/platform/monitor/monitor.cpp \
|
|
|
|
src/platform/nsemanager.cpp ; do
|
|
|
|
|
|
|
|
substituteInPlace $f \
|
2019-04-10 14:21:53 +01:00
|
|
|
--replace '"nmap"' '"${nmap}/bin/nmap"'
|
2018-02-05 11:16:08 +00:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-02-05 11:16:08 +00:00
|
|
|
description = "Qt frontend for nmap";
|
2020-10-29 13:10:12 +00:00
|
|
|
license = licenses.gpl2;
|
2018-02-05 11:16:08 +00:00
|
|
|
maintainers = with maintainers; [ peterhoeg ];
|
2019-04-10 14:21:53 +01:00
|
|
|
inherit (src.meta) homepage;
|
2018-02-05 11:16:08 +00:00
|
|
|
};
|
|
|
|
}
|