packetdrill: init at 1.0

Closes https://github.com/NixOS/nixpkgs/pull/23679

authored by David Johnson and committed by Joachim Fasting 2151e3b8 798623fd

+52
+1
lib/maintainers.nix
··· 133 dgonyeo = "Derek Gonyeo <derek@gonyeo.com>"; 134 dipinhora = "Dipin Hora <dipinhora+github@gmail.com>"; 135 dmalikov = "Dmitry Malikov <malikov.d.y@gmail.com>"; 136 dochang = "Desmond O. Chang <dochang@gmail.com>"; 137 domenkozar = "Domen Kozar <domen@dev.si>"; 138 doublec = "Chris Double <chris.double@double.co.nz>";
··· 133 dgonyeo = "Derek Gonyeo <derek@gonyeo.com>"; 134 dipinhora = "Dipin Hora <dipinhora+github@gmail.com>"; 135 dmalikov = "Dmitry Malikov <malikov.d.y@gmail.com>"; 136 + dmjio = "David Johnson <djohnson.m@gmail.com>"; 137 dochang = "Desmond O. Chang <dochang@gmail.com>"; 138 domenkozar = "Domen Kozar <domen@dev.si>"; 139 doublec = "Chris Double <chris.double@double.co.nz>";
+25
pkgs/tools/networking/packetdrill/default.nix
···
··· 1 + { stdenv, fetchFromGitHub, bison, flex }: 2 + stdenv.mkDerivation rec { 3 + version = "1.0"; 4 + name = "packetdrill-${version}"; 5 + src = fetchFromGitHub { 6 + owner = "google"; 7 + repo = "packetdrill"; 8 + rev = "58a7865c47e3a71e92ca0e4cc478c320e1c35f82"; 9 + sha256 = "09sqiakmn63idfjhy2ddf1456sfhi8yhsbp8lxvc1yfjikjxwwbc"; 10 + }; 11 + setSourceRoot = '' 12 + export sourceRoot=$(realpath */gtests/net/packetdrill) 13 + ''; 14 + hardeningDisable = [ "all" ]; 15 + buildInputs = [ bison flex ]; 16 + patches = [ ./nix.patch ]; 17 + enableParallelBuilding = true; 18 + meta = { 19 + description = "Quick, precise tests for entire TCP/UDP/IPv4/IPv6 network stacks"; 20 + homepage = https://github.com/google/packetdrill; 21 + license = stdenv.lib.licenses.gpl2; 22 + platforms = stdenv.lib.platforms.unix; 23 + maintainers = with stdenv.lib.maintainers; [ dmjio cleverca22 ]; 24 + }; 25 + }
+24
pkgs/tools/networking/packetdrill/nix.patch
···
··· 1 + diff --git a/gtests/net/packetdrill/Makefile.common b/gtests/net/packetdrill/Makefile.common 2 + index 0ec741f..bf1cbb1 100644 3 + --- a/Makefile.common 4 + +++ b/Makefile.common 5 + @@ -33,7 +33,7 @@ packetdrill-lib := \ 6 + packetdrill-objs := packetdrill.o $(packetdrill-lib) 7 + 8 + packetdrill: $(packetdrill-objs) 9 + - $(CC) -o packetdrill -g -static $(packetdrill-objs) $(packetdrill-ext-libs) 10 + + $(CC) -o packetdrill -g $(packetdrill-objs) $(packetdrill-ext-libs) 11 + 12 + test-bins := checksum_test packet_parser_test packet_to_string_test 13 + tests: $(test-bins) 14 + @@ -43,6 +43,10 @@ tests: $(test-bins) 15 + 16 + binaries: packetdrill $(test-bins) 17 + 18 + +install: packetdrill $(test-bins) 19 + + mkdir -p ${out}/bin 20 + + cp -vi $^ ${out}/bin 21 + + 22 + checksum_test-objs := $(packetdrill-lib) checksum_test.o 23 + checksum_test: $(checksum_test-objs) 24 + $(CC) -o checksum_test $(checksum_test-objs) $(packetdrill-ext-libs)
+2
pkgs/top-level/all-packages.nix
··· 3289 nix = nixUnstable; 3290 }; 3291 3292 pakcs = callPackage ../development/compilers/pakcs {}; 3293 3294 pal = callPackage ../tools/misc/pal { };
··· 3289 nix = nixUnstable; 3290 }; 3291 3292 + packetdrill = callPackage ../tools/networking/packetdrill { }; 3293 + 3294 pakcs = callPackage ../development/compilers/pakcs {}; 3295 3296 pal = callPackage ../tools/misc/pal { };