1{ boost, cmake, fetchFromGitHub, gtest, libpcap, openssl, lib, stdenv }:
2
3stdenv.mkDerivation rec {
4 pname = "libtins";
5 version = "4.5";
6
7 src = fetchFromGitHub {
8 owner = "mfontanini";
9 repo = pname;
10 rev = "v${version}";
11 sha256 = "sha256-zL4C2Cgs9Y3NebL8MPQBO5j8Bm6xhl8ZggQBPJLRn0o=";
12 };
13
14 patches = [
15 # Required for gtest 1.13+, see also upstream report at:
16 # https://github.com/mfontanini/libtins/issues/529
17 ./0001-force-cpp-14.patch
18 ];
19
20 postPatch = ''
21 rm -rf googletest
22 cp -r ${gtest.src} googletest
23 chmod -R a+w googletest
24 '';
25
26 nativeBuildInputs = [ cmake gtest ];
27 buildInputs = [
28 openssl
29 libpcap
30 boost
31 ];
32
33 configureFlags = [
34 "--with-boost-libdir=${boost.out}/lib"
35 "--with-boost=${boost.dev}"
36 ];
37
38 doCheck = true;
39 checkTarget = "tests test";
40
41 meta = with lib; {
42 description = "High-level, multiplatform C++ network packet sniffing and crafting library";
43 homepage = "https://libtins.github.io/";
44 changelog = "https://raw.githubusercontent.com/mfontanini/${pname}/v${version}/CHANGES.md";
45 license = lib.licenses.bsd2;
46 maintainers = with maintainers; [ fdns ];
47 platforms = lib.platforms.unix;
48 };
49}