diff --git a/lib/maintainers.nix b/lib/maintainers.nix index 9b682da3e34..dd257a49502 100644 --- a/lib/maintainers.nix +++ b/lib/maintainers.nix @@ -133,6 +133,7 @@ dgonyeo = "Derek Gonyeo "; dipinhora = "Dipin Hora "; dmalikov = "Dmitry Malikov "; + dmjio = "David Johnson "; dochang = "Desmond O. Chang "; domenkozar = "Domen Kozar "; doublec = "Chris Double "; 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) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1de35f861f8..8fba9b8ef6b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3289,6 +3289,8 @@ with pkgs; nix = nixUnstable; }; + packetdrill = callPackage ../tools/networking/packetdrill { }; + pakcs = callPackage ../development/compilers/pakcs {}; pal = callPackage ../tools/misc/pal { };