aboutsummaryrefslogtreecommitdiff
path: root/pkgs/tools/networking/packetdrill
diff options
context:
space:
mode:
authorDavid Johnson <djohnson.m@gmail.com>2017-03-09 14:54:04 -0800
committerJoachim Fasting <joachifm@fastmail.fm>2017-03-10 23:35:26 +0100
commit2151e3b8ebfeee97655704e140ecb7a5dee8ec9c (patch)
treeb0f0a7c7f8f07ebbf67848200b51ea0087569dff /pkgs/tools/networking/packetdrill
parent798623fd2b0bb85c355f7d40c57a4fc10b2c36a0 (diff)
packetdrill: init at 1.0
Closes https://github.com/NixOS/nixpkgs/pull/23679
Diffstat (limited to 'pkgs/tools/networking/packetdrill')
-rw-r--r--pkgs/tools/networking/packetdrill/default.nix25
-rw-r--r--pkgs/tools/networking/packetdrill/nix.patch24
2 files changed, 49 insertions, 0 deletions
diff --git a/pkgs/tools/networking/packetdrill/default.nix b/pkgs/tools/networking/packetdrill/default.nix
new file mode 100644
index 00000000000..f7690e44746
--- /dev/null
+++ b/pkgs/tools/networking/packetdrill/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchFromGitHub, bison, flex }:
+stdenv.mkDerivation rec {
+ version = "1.0";
+ name = "packetdrill-${version}";
+ src = fetchFromGitHub {
+ owner = "google";
+ repo = "packetdrill";
+ rev = "58a7865c47e3a71e92ca0e4cc478c320e1c35f82";
+ sha256 = "09sqiakmn63idfjhy2ddf1456sfhi8yhsbp8lxvc1yfjikjxwwbc";
+ };
+ setSourceRoot = ''
+ export sourceRoot=$(realpath */gtests/net/packetdrill)
+ '';
+ hardeningDisable = [ "all" ];
+ buildInputs = [ bison flex ];
+ patches = [ ./nix.patch ];
+ enableParallelBuilding = true;
+ meta = {
+ description = "Quick, precise tests for entire TCP/UDP/IPv4/IPv6 network stacks";
+ homepage = https://github.com/google/packetdrill;
+ license = stdenv.lib.licenses.gpl2;
+ platforms = stdenv.lib.platforms.unix;
+ maintainers = with stdenv.lib.maintainers; [ dmjio cleverca22 ];
+ };
+}
diff --git a/pkgs/tools/networking/packetdrill/nix.patch b/pkgs/tools/networking/packetdrill/nix.patch
new file mode 100644
index 00000000000..6bad14421b9
--- /dev/null
+++ b/pkgs/tools/networking/packetdrill/nix.patch
@@ -0,0 +1,24 @@
+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)