1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6 pkg-config,
7 dnsutils,
8 nmap,
9 libsForQt5,
10}:
11
12stdenv.mkDerivation rec {
13 pname = "nmapsi4";
14 version = "0.5-alpha2";
15
16 src = fetchFromGitHub {
17 owner = "nmapsi4";
18 repo = "nmapsi4";
19 rev = "v${version}";
20 hash = "sha256-q3XfwJ4TGK4E58haN0Q0xRH4GDpKD8VZzyxHe/VwBqY=";
21 };
22
23 nativeBuildInputs = [
24 cmake
25 pkg-config
26 libsForQt5.wrapQtAppsHook
27 ];
28
29 buildInputs = with libsForQt5; [
30 qtbase
31 qtscript
32 qtwebengine
33 ];
34
35 postPatch = ''
36 substituteInPlace src/platform/digmanager.cpp \
37 --replace '"dig"' '"${dnsutils}/bin/dig"'
38 substituteInPlace src/platform/discover.cpp \
39 --replace '"nping"' '"${nmap}/bin/nping"'
40 for f in \
41 src/platform/monitor/monitor.cpp \
42 src/platform/nsemanager.cpp ; do
43
44 substituteInPlace $f \
45 --replace '"nmap"' '"${nmap}/bin/nmap"'
46 done
47 '';
48
49 postInstall = ''
50 mv $out/share/applications/kde4/*.desktop $out/share/applications
51 rmdir $out/share/applications/kde4
52
53 for f in $out/share/applications/* ; do
54 substituteInPlace $f \
55 --replace Qt4 Qt5
56 done
57 '';
58
59 meta = {
60 description = "Qt frontend for nmap";
61 mainProgram = "nmapsi4";
62 changelog = "https://github.com/nmapsi4/nmapsi4/releases/tag/${src.rev}";
63 license = lib.licenses.gpl2Plus;
64 maintainers = with lib.maintainers; [ peterhoeg ];
65 inherit (src.meta) homepage;
66 };
67}