diff options
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/tools/networking/packetdrill/default.nix | 28 | ||||
-rw-r--r-- | pkgs/tools/networking/packetdrill/nix.patch | 24 |
2 files changed, 20 insertions, 32 deletions
diff --git a/pkgs/tools/networking/packetdrill/default.nix b/pkgs/tools/networking/packetdrill/default.nix index e4322242e0b..2b1467cd348 100644 --- a/pkgs/tools/networking/packetdrill/default.nix +++ b/pkgs/tools/networking/packetdrill/default.nix @@ -1,24 +1,36 @@ -{ stdenv, fetchFromGitHub, bison, flex }: -stdenv.mkDerivation { - version = "1.0"; +{ stdenv, fetchFromGitHub, bison, flex, cmake, libpcap }: +stdenv.mkDerivation rec { pname = "packetdrill"; + version = "unstable-2020-08-22"; + src = fetchFromGitHub { owner = "google"; repo = "packetdrill"; - rev = "58a7865c47e3a71e92ca0e4cc478c320e1c35f82"; - sha256 = "09sqiakmn63idfjhy2ddf1456sfhi8yhsbp8lxvc1yfjikjxwwbc"; + rev = "68a34fa73cf221e5f52d6fa4f203bcd93062be1b"; + sha256 = "0djkwb6l2959f44d98vwb092rghf0qmii8391vrpxqb99j6pv4h6"; }; setSourceRoot = '' export sourceRoot=$(realpath */gtests/net/packetdrill) ''; + NIX_CFLAGS_COMPILE = [ "-Wno-error=unused-result" "-Wno-error=stringop-truncation" "-Wno-error=address-of-packed-member" ]; - nativeBuildInputs = [ bison flex ]; - patches = [ ./nix.patch ]; - enableParallelBuilding = true; + 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 + ''; + meta = { description = "Quick, precise tests for entire TCP/UDP/IPv4/IPv6 network stacks"; homepage = "https://github.com/google/packetdrill"; diff --git a/pkgs/tools/networking/packetdrill/nix.patch b/pkgs/tools/networking/packetdrill/nix.patch deleted file mode 100644 index 6bad14421b9..00000000000 --- a/pkgs/tools/networking/packetdrill/nix.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/gtests/net/packetdrill/Makefile.common b/gtests/net/packetdrill/Makefile.common -index 0ec741f..bf1cbb1 100644 ---- a/Makefile.common -+++ b/Makefile.common -@@ -33,7 +33,7 @@ packetdrill-lib := \ - packetdrill-objs := packetdrill.o $(packetdrill-lib) - - packetdrill: $(packetdrill-objs) -- $(CC) -o packetdrill -g -static $(packetdrill-objs) $(packetdrill-ext-libs) -+ $(CC) -o packetdrill -g $(packetdrill-objs) $(packetdrill-ext-libs) - - test-bins := checksum_test packet_parser_test packet_to_string_test - tests: $(test-bins) -@@ -43,6 +43,10 @@ tests: $(test-bins) - - binaries: packetdrill $(test-bins) - -+install: packetdrill $(test-bins) -+ mkdir -p ${out}/bin -+ cp -vi $^ ${out}/bin -+ - checksum_test-objs := $(packetdrill-lib) checksum_test.o - checksum_test: $(checksum_test-objs) - $(CC) -o checksum_test $(checksum_test-objs) $(packetdrill-ext-libs) |