nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 mkDerivation,
4 fetchFromGitHub,
5 fetchurl,
6 qmake,
7 makeDesktopItem,
8 qtbase,
9 qtscript,
10 protobuf,
11 libpcap,
12 wireshark,
13 gzip,
14 diffutils,
15 gawk,
16 libnl,
17 copyDesktopItems,
18}:
19
20mkDerivation rec {
21 pname = "ostinato";
22 version = "1.3.0";
23
24 src = fetchFromGitHub {
25 owner = "pstavirs";
26 repo = "ostinato";
27 rev = "v${version}";
28 sha256 = "sha256-/fPUxGeh5Cc3rb+1mR0chkiFPw5m+O6KtWDvzLn0iYo=";
29 };
30
31 ostinatoIcon = fetchurl {
32 url = "https://ostinato.org/images/site-logo.png";
33 sha256 = "f5c067823f2934e4d358d76f65a343efd69ad783a7aeabd7ab4ce3cd03490d70";
34 };
35
36 buildInputs = [
37 qtbase
38 protobuf
39 libpcap
40 qtscript
41 libnl
42 ];
43
44 nativeBuildInputs = [
45 copyDesktopItems
46 qmake
47 ];
48
49 patches = [ ./drone_ini.patch ];
50 prePatch = ''
51 sed -i 's|/usr/include/libnl3|${libnl.dev}/include/libnl3|' server/drone.pro
52 '';
53
54 desktopItems = lib.singleton (makeDesktopItem {
55 name = "ostinato";
56 desktopName = "Ostinato";
57 genericName = "Packet/Traffic Generator and Analyzer";
58 comment = "Network packet and traffic generator and analyzer with a friendly GUI";
59 categories = [ "Network" ];
60 startupNotify = true;
61 exec = "@out@/bin/ostinato";
62 icon = ostinatoIcon;
63 extraConfig = {
64 "GenericName[it]" = "Generatore ed Analizzatore di pacchetti di rete";
65 "Comment[it]" = "Generatore ed Analizzatore di pacchetti di rete con interfaccia amichevole";
66 };
67 });
68
69 preFixup = ''
70 substituteInPlace $out/share/applications/ostinato.desktop \
71 --subst-var out
72
73 cat > $out/bin/ostinato.ini <<EOF
74 WiresharkPath=${wireshark}/bin/wireshark
75 TsharkPath=${wireshark}/bin/tshark
76 GzipPath=${gzip}/bin/gzip
77 DiffPath=${diffutils}/bin/diff
78 AwkPath=${gawk}/bin/awk
79 EOF
80 '';
81
82 # `cd common; qmake ostproto.pro; make pdmlreader.o`:
83 # pdmlprotocol.h:23:25: fatal error: protocol.pb.h: No such file or directory
84 enableParallelBuilding = false;
85
86 meta = with lib; {
87 description = "Packet traffic generator and analyzer";
88 homepage = "https://ostinato.org/";
89 license = licenses.gpl3Plus;
90 maintainers = with maintainers; [ rick68 ];
91 platforms = with platforms; linux ++ darwin ++ cygwin;
92 };
93}