Skip to content

Commit

Permalink
packetdrill: init at 1.0
Browse files Browse the repository at this point in the history
Closes #23679
  • Loading branch information
dmjio authored and joachifm committed Mar 10, 2017
1 parent 798623f commit 2151e3b
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/maintainers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@
dgonyeo = "Derek Gonyeo <derek@gonyeo.com>";
dipinhora = "Dipin Hora <dipinhora+github@gmail.com>";
dmalikov = "Dmitry Malikov <malikov.d.y@gmail.com>";
dmjio = "David Johnson <djohnson.m@gmail.com>";
dochang = "Desmond O. Chang <dochang@gmail.com>";
domenkozar = "Domen Kozar <domen@dev.si>";
doublec = "Chris Double <chris.double@double.co.nz>";
Expand Down
25 changes: 25 additions & 0 deletions pkgs/tools/networking/packetdrill/default.nix
Original file line number Diff line number Diff line change
@@ -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 ];
};
}
24 changes: 24 additions & 0 deletions pkgs/tools/networking/packetdrill/nix.patch
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3289,6 +3289,8 @@ with pkgs;
nix = nixUnstable;
};

packetdrill = callPackage ../tools/networking/packetdrill { };

pakcs = callPackage ../development/compilers/pakcs {};

pal = callPackage ../tools/misc/pal { };
Expand Down

0 comments on commit 2151e3b

Please sign in to comment.