1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 autoreconfHook,
6 libpcap,
7 lua5_1,
8 json_c,
9 testers,
10 tracebox,
11}:
12stdenv.mkDerivation rec {
13 pname = "tracebox";
14 version = "0.4.4";
15
16 src = fetchFromGitHub {
17 owner = "tracebox";
18 repo = "tracebox";
19 rev = "v${version}";
20 hash = "sha256-1KBJ4uXa1XpzEw23IjndZg+aGJXk3PVw8LYKAvxbxCA=";
21 fetchSubmodules = true;
22 };
23
24 nativeBuildInputs = [ autoreconfHook ];
25 buildInputs = [
26 libpcap
27 lua5_1
28 json_c
29 ];
30
31 postPatch = ''
32 sed -i configure.ac \
33 -e 's,$(git describe .*),${version},'
34 '';
35
36 configureFlags = [
37 "--with-lua=yes"
38 "--with-libpcap=yes"
39 ];
40
41 env = {
42 CXXFLAGS = "-std=c++14";
43 LUA_LIB = "-llua";
44 PCAPLIB = "-lpcap";
45 };
46
47 enableParallelBuilding = true;
48
49 passthru.tests.version = testers.testVersion {
50 package = tracebox;
51 command = "tracebox -V";
52 };
53
54 meta = with lib; {
55 homepage = "http://www.tracebox.org/";
56 description = "Middlebox detection tool";
57 license = licenses.gpl2Only;
58 maintainers = with maintainers; [ ck3d ];
59 platforms = platforms.linux;
60 };
61}