1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/tools/security/nmap/qt.nix
volth 46420bbaa3 treewide: name -> pname (easy cases) (#66585)
treewide replacement of

stdenv.mkDerivation rec {
  name = "*-${version}";
  version = "*";

to pname
2019-08-15 13:41:18 +01:00

55 lines
1.5 KiB
Nix

{ stdenv, fetchFromGitHub, cmake, pkgconfig, makeWrapper
, dnsutils, nmap
, qtbase, qtscript, qtwebengine }:
stdenv.mkDerivation rec {
pname = "nmapsi4";
version = "0.4.80-20180430";
src = fetchFromGitHub {
owner = "nmapsi4";
repo = "nmapsi4";
rev = "d7f18e4c1e38dcf9c29cb4496fe14f9ff172861a";
sha256 = "10wqyrjzmad1g7lqa65rymbkna028xbp4xcpj442skw8gyrs3994";
};
nativeBuildInputs = [ cmake makeWrapper pkgconfig ];
buildInputs = [ qtbase qtscript qtwebengine ];
enableParallelBuilding = true;
postPatch = ''
substituteInPlace src/platform/digmanager.cpp \
--replace '"dig"' '"${dnsutils}/bin/dig"'
substituteInPlace src/platform/discover.cpp \
--replace '"nping"' '"${nmap}/bin/nping"'
for f in \
src/platform/monitor/monitor.cpp \
src/platform/nsemanager.cpp ; do
substituteInPlace $f \
--replace '"nmap"' '"${nmap}/bin/nmap"'
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";
license = licenses.gpl2;
maintainers = with maintainers; [ peterhoeg ];
inherit (src.meta) homepage;
};
}