2018-03-16 18:47:05 +00:00
|
|
|
{ boost, cmake, fetchFromGitHub, gtest, libpcap, openssl, stdenv }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-05-26 16:10:17 +01:00
|
|
|
pname = "libtins";
|
|
|
|
version = "4.2";
|
|
|
|
|
2018-03-16 18:47:05 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mfontanini";
|
2019-05-26 16:10:17 +01:00
|
|
|
repo = pname;
|
2018-03-16 18:47:05 +00:00
|
|
|
rev = "v${version}";
|
2019-05-26 16:10:17 +01:00
|
|
|
sha256 = "0gv661gdf018zk1sr6fnvcmd5akqjihs4h6zzxv6881v6yhhglrz";
|
2018-03-16 18:47:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
rm -rf googletest
|
|
|
|
cp -r ${gtest.src}/googletest googletest
|
|
|
|
chmod -R a+w googletest
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake gtest ];
|
|
|
|
buildInputs = [
|
|
|
|
openssl
|
|
|
|
libpcap
|
|
|
|
boost
|
|
|
|
];
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--with-boost-libdir=${boost.out}/lib"
|
|
|
|
"--with-boost=${boost.dev}"
|
|
|
|
];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
doCheck = true;
|
2019-04-23 04:43:00 +01:00
|
|
|
preCheck = ''
|
2020-01-02 00:29:34 +00:00
|
|
|
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD${placeholder "out"}/lib
|
|
|
|
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}$PWD${placeholder "out"}/lib
|
2019-04-23 04:43:00 +01:00
|
|
|
'';
|
|
|
|
checkTarget = "tests test";
|
2018-03-16 18:47:05 +00:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "High-level, multiplatform C++ network packet sniffing and crafting library";
|
2019-05-26 16:10:17 +01:00
|
|
|
homepage = "https://libtins.github.io/";
|
|
|
|
changelog = "https://raw.githubusercontent.com/mfontanini/${pname}/v${version}/CHANGES.md";
|
2018-03-16 18:47:05 +00:00
|
|
|
license = stdenv.lib.licenses.bsd2;
|
|
|
|
maintainers = with maintainers; [ fdns ];
|
|
|
|
platforms = stdenv.lib.platforms.unix;
|
|
|
|
};
|
|
|
|
}
|