lib.packagesFromDirectoryRecursive: Improved documentation (#359898)
[NixPkgs.git] / pkgs / by-name / nm / nmapsi4 / package.nix
blob37287dcef021801824110c8642c71b828f0150f6
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   cmake,
6   pkg-config,
7   dnsutils,
8   nmap,
9   libsForQt5,
12 stdenv.mkDerivation rec {
13   pname = "nmapsi4";
14   version = "0.5-alpha2";
16   src = fetchFromGitHub {
17     owner = "nmapsi4";
18     repo = "nmapsi4";
19     rev = "v${version}";
20     hash = "sha256-q3XfwJ4TGK4E58haN0Q0xRH4GDpKD8VZzyxHe/VwBqY=";
21   };
23   nativeBuildInputs = [
24     cmake
25     pkg-config
26     libsForQt5.wrapQtAppsHook
27   ];
29   buildInputs = with libsForQt5; [
30     qtbase
31     qtscript
32     qtwebengine
33   ];
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
44       substituteInPlace $f \
45         --replace '"nmap"'  '"${nmap}/bin/nmap"'
46     done
47   '';
49   postInstall = ''
50     mv $out/share/applications/kde4/*.desktop $out/share/applications
51     rmdir $out/share/applications/kde4
53     for f in $out/share/applications/* ; do
54       substituteInPlace $f \
55         --replace Qt4                   Qt5
56     done
57   '';
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   };