packetdrill: 1.0 -> unstable-2020-08-22, fix build
also switch to cmake build
This commit is contained in:
parent
c2ebb8becb
commit
87fad4d39e
@ -1,24 +1,36 @@
|
|||||||
{ stdenv, fetchFromGitHub, bison, flex }:
|
{ stdenv, fetchFromGitHub, bison, flex, cmake, libpcap }:
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation rec {
|
||||||
version = "1.0";
|
|
||||||
pname = "packetdrill";
|
pname = "packetdrill";
|
||||||
|
version = "unstable-2020-08-22";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "google";
|
owner = "google";
|
||||||
repo = "packetdrill";
|
repo = "packetdrill";
|
||||||
rev = "58a7865c47e3a71e92ca0e4cc478c320e1c35f82";
|
rev = "68a34fa73cf221e5f52d6fa4f203bcd93062be1b";
|
||||||
sha256 = "09sqiakmn63idfjhy2ddf1456sfhi8yhsbp8lxvc1yfjikjxwwbc";
|
sha256 = "0djkwb6l2959f44d98vwb092rghf0qmii8391vrpxqb99j6pv4h6";
|
||||||
};
|
};
|
||||||
setSourceRoot = ''
|
setSourceRoot = ''
|
||||||
export sourceRoot=$(realpath */gtests/net/packetdrill)
|
export sourceRoot=$(realpath */gtests/net/packetdrill)
|
||||||
'';
|
'';
|
||||||
|
|
||||||
NIX_CFLAGS_COMPILE = [
|
NIX_CFLAGS_COMPILE = [
|
||||||
"-Wno-error=unused-result"
|
"-Wno-error=unused-result"
|
||||||
"-Wno-error=stringop-truncation"
|
"-Wno-error=stringop-truncation"
|
||||||
"-Wno-error=address-of-packed-member"
|
"-Wno-error=address-of-packed-member"
|
||||||
];
|
];
|
||||||
nativeBuildInputs = [ bison flex ];
|
nativeBuildInputs = [ bison flex cmake libpcap ];
|
||||||
patches = [ ./nix.patch ];
|
buildInputs = [ libpcap ];
|
||||||
enableParallelBuilding = true;
|
|
||||||
|
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 = {
|
meta = {
|
||||||
description = "Quick, precise tests for entire TCP/UDP/IPv4/IPv6 network stacks";
|
description = "Quick, precise tests for entire TCP/UDP/IPv4/IPv6 network stacks";
|
||||||
homepage = "https://github.com/google/packetdrill";
|
homepage = "https://github.com/google/packetdrill";
|
||||||
|
@ -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)
|
|
Loading…
Reference in New Issue
Block a user