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