2022-09-22 12:36:57 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, autoreconfHook
|
|
|
|
, libpcap
|
|
|
|
, lua5_1
|
|
|
|
, json_c
|
|
|
|
, testers
|
|
|
|
, tracebox
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "tracebox";
|
2022-09-22 12:36:57 +00:00
|
|
|
version = "0.4.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-09-23 15:35:13 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tracebox";
|
|
|
|
repo = "tracebox";
|
|
|
|
rev = "v${version}";
|
2022-09-22 12:36:57 +00:00
|
|
|
hash = "sha256-1KBJ4uXa1XpzEw23IjndZg+aGJXk3PVw8LYKAvxbxCA=";
|
|
|
|
fetchSubmodules = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ autoreconfHook ];
|
2022-09-22 12:36:57 +00:00
|
|
|
buildInputs = [
|
|
|
|
libpcap
|
|
|
|
lua5_1
|
|
|
|
json_c
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-22 12:36:57 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i configure.ac \
|
|
|
|
-e 's,$(git describe .*),${version},'
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-22 12:36:57 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--with-lua=yes"
|
|
|
|
"--with-libpcap=yes"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
env = {
|
|
|
|
CXXFLAGS = "-std=c++14";
|
|
|
|
LUA_LIB = "-llua";
|
|
|
|
PCAPLIB = "-lpcap";
|
|
|
|
};
|
2022-09-22 12:36:57 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = tracebox;
|
|
|
|
command = "tracebox -V";
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "http://www.tracebox.org/";
|
|
|
|
description = "A middlebox detection tool";
|
2022-09-22 12:36:57 +00:00
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = with maintainers; [ ck3d ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|