1 { lib, stdenv, fetchFromGitHub, fetchpatch, bison, flex, cmake, libpcap }:
2 stdenv.mkDerivation rec {
4 version = "unstable-2020-08-22";
6 src = fetchFromGitHub {
9 rev = "68a34fa73cf221e5f52d6fa4f203bcd93062be1b";
10 sha256 = "0djkwb6l2959f44d98vwb092rghf0qmii8391vrpxqb99j6pv4h6";
13 # Upstream fix for -fno-common toolchains
15 name = "fno-common.patch";
16 url = "https://github.com/google/packetdrill/commit/c08292838de81a71ee477d5bf9d95b1130a1292b.patch";
17 sha256 = "1irbar1zkydmgqb12r3xd80dwj2jfxnxayxpb4nmbma8xm7knb10";
23 export sourceRoot=$(realpath */gtests/net/packetdrill)
26 env.NIX_CFLAGS_COMPILE = toString [
27 "-Wno-error=unused-result"
28 "-Wno-error=stringop-truncation"
29 "-Wno-error=address-of-packed-member"
31 nativeBuildInputs = [ bison flex cmake libpcap ];
32 buildInputs = [ libpcap ];
35 install -m 0755 -t $out/bin -D \
38 packet_to_string_test \
41 cp -r ../tests $out/share/packetdrill-tests
45 description = "Quick, precise tests for entire TCP/UDP/IPv4/IPv6 network stacks";
46 homepage = "https://github.com/google/packetdrill";
47 license = lib.licenses.gpl2Plus;
48 platforms = lib.platforms.linux;
49 maintainers = with lib.maintainers; [ dmjio cleverca22 ];