2020-10-07 20:21:31 +01:00
|
|
|
{ stdenv, fetchFromGitHub, bison, flex, cmake, libpcap }:
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "packetdrill";
|
2020-10-07 20:21:31 +01:00
|
|
|
version = "unstable-2020-08-22";
|
|
|
|
|
2017-03-09 22:54:04 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "google";
|
|
|
|
repo = "packetdrill";
|
2020-10-07 20:21:31 +01:00
|
|
|
rev = "68a34fa73cf221e5f52d6fa4f203bcd93062be1b";
|
|
|
|
sha256 = "0djkwb6l2959f44d98vwb092rghf0qmii8391vrpxqb99j6pv4h6";
|
2017-03-09 22:54:04 +00:00
|
|
|
};
|
|
|
|
setSourceRoot = ''
|
|
|
|
export sourceRoot=$(realpath */gtests/net/packetdrill)
|
|
|
|
'';
|
2020-10-07 20:21:31 +01:00
|
|
|
|
2019-11-03 12:44:26 +00:00
|
|
|
NIX_CFLAGS_COMPILE = [
|
|
|
|
"-Wno-error=unused-result"
|
|
|
|
"-Wno-error=stringop-truncation"
|
|
|
|
"-Wno-error=address-of-packed-member"
|
|
|
|
];
|
2020-10-07 20:21:31 +01:00
|
|
|
nativeBuildInputs = [ bison flex cmake libpcap ];
|
|
|
|
buildInputs = [ libpcap ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -m 0755 -t $out/bin -D \
|
|
|
|
packetdrill \
|
|
|
|
packet_parser_test \
|
|
|
|
packet_to_string_test \
|
|
|
|
checksum_test
|
|
|
|
mkdir -p $out/share
|
|
|
|
cp -r ../tests $out/share/packetdrill-tests
|
|
|
|
'';
|
|
|
|
|
2017-03-09 22:54:04 +00:00
|
|
|
meta = {
|
|
|
|
description = "Quick, precise tests for entire TCP/UDP/IPv4/IPv6 network stacks";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/google/packetdrill";
|
2017-03-09 22:54:04 +00:00
|
|
|
license = stdenv.lib.licenses.gpl2;
|
2017-09-22 19:03:17 +01:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
2017-03-09 22:54:04 +00:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ dmjio cleverca22 ];
|
|
|
|
};
|
|
|
|
}
|