nixpkgs/pkgs/applications/networking/ostinato/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

75 lines
2.2 KiB
Nix
Raw Normal View History

{ lib, mkDerivation, fetchFromGitHub, fetchurl, qmake, makeDesktopItem
, qtbase, qtscript, protobuf, libpcap, wireshark, gzip, diffutils, gawk
, libnl
2022-05-25 20:32:28 +00:00
, copyDesktopItems
}:
mkDerivation rec {
pname = "ostinato";
version = "1.1";
2017-03-09 13:46:33 +00:00
src = fetchFromGitHub {
owner = "pstavirs";
repo = "ostinato";
rev = "v${version}";
sha256 = "0B3jOj5rA3/rD2gXS2praZImeP34zN06fOPy/IswXOg=";
};
2017-03-09 13:46:33 +00:00
ostinatoIcon = fetchurl {
url = "https://ostinato.org/images/site-logo.png";
sha256 = "f5c067823f2934e4d358d76f65a343efd69ad783a7aeabd7ab4ce3cd03490d70";
};
buildInputs = [ qtbase protobuf libpcap qtscript libnl ];
2022-05-25 20:32:28 +00:00
nativeBuildInputs = [
copyDesktopItems
qmake
];
2016-04-16 23:38:45 +00:00
patches = [ ./drone_ini.patch ];
prePatch = ''
sed -i 's|/usr/include/libnl3|${libnl.dev}/include/libnl3|' server/drone.pro
'';
2022-05-25 20:32:28 +00:00
desktopItems = lib.singleton (makeDesktopItem {
2017-03-09 13:46:33 +00:00
name = "ostinato";
desktopName = "Ostinato";
genericName = "Packet/Traffic Generator and Analyzer";
comment = "Network packet and traffic generator and analyzer with a friendly GUI";
categories = [ "Network" ];
startupNotify = true;
2022-05-25 20:32:28 +00:00
exec = "@out@/bin/ostinato";
2017-03-09 13:46:33 +00:00
icon = ostinatoIcon;
extraConfig = {
"GenericName[it]" = "Generatore ed Analizzatore di pacchetti di rete";
"Comment[it]" = "Generatore ed Analizzatore di pacchetti di rete con interfaccia amichevole";
};
2022-05-25 20:32:28 +00:00
});
2017-03-09 13:46:33 +00:00
2022-05-25 20:32:28 +00:00
preFixup = ''
substituteInPlace $out/share/applications/ostinato.desktop \
--subst-var out
2017-03-09 13:46:33 +00:00
cat > $out/bin/ostinato.ini <<EOF
WiresharkPath=${wireshark}/bin/wireshark
TsharkPath=${wireshark}/bin/tshark
GzipPath=${gzip}/bin/gzip
DiffPath=${diffutils}/bin/diff
AwkPath=${gawk}/bin/awk
EOF
'';
2017-12-05 15:29:29 +00:00
# `cd common; qmake ostproto.pro; make pdmlreader.o`:
# pdmlprotocol.h:23:25: fatal error: protocol.pb.h: No such file or directory
enableParallelBuilding = false;
meta = with lib; {
description = "A packet traffic generator and analyzer";
2022-05-25 20:32:28 +00:00
homepage = "https://ostinato.org/";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ rick68 ];
2017-03-09 13:46:33 +00:00
platforms = with platforms; linux ++ darwin ++ cygwin;
};
}