nixpkgs/pkgs/development/libraries/libtins/default.nix

48 lines
1.2 KiB
Nix
Raw Normal View History

{ boost, cmake, fetchFromGitHub, gtest, libpcap, openssl, lib, stdenv }:
2018-03-16 19:47:05 +01:00
stdenv.mkDerivation rec {
2019-05-26 17:10:17 +02:00
pname = "libtins";
2020-11-03 05:24:59 +01:00
version = "4.3";
2019-05-26 17:10:17 +02:00
2018-03-16 19:47:05 +01:00
src = fetchFromGitHub {
owner = "mfontanini";
2019-05-26 17:10:17 +02:00
repo = pname;
2018-03-16 19:47:05 +01:00
rev = "v${version}";
2020-11-03 05:24:59 +01:00
sha256 = "09ah1a7ska7xiki7625mn1d8i96il3hxbkc39ba8fn1a5383kmqa";
2018-03-16 19:47:05 +01: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}"
];
doCheck = true;
2019-04-23 05:43:00 +02:00
preCheck = ''
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 05:43:00 +02:00
'';
checkTarget = "tests test";
2018-03-16 19:47:05 +01:00
meta = with lib; {
2018-03-16 19:47:05 +01:00
description = "High-level, multiplatform C++ network packet sniffing and crafting library";
2019-05-26 17:10:17 +02:00
homepage = "https://libtins.github.io/";
changelog = "https://raw.githubusercontent.com/mfontanini/${pname}/v${version}/CHANGES.md";
license = lib.licenses.bsd2;
2018-03-16 19:47:05 +01:00
maintainers = with maintainers; [ fdns ];
platforms = lib.platforms.unix;
2018-03-16 19:47:05 +01:00
};
}