@@ -1,26 +1,34 @@
1−{ stdenv, fetchurl, dpdk, libpcap, utillinux }:
1+{ stdenv, fetchurl, dpdk, libpcap, utillinux
2+, pkgconfig
3+, gtk, withGtk ? false
4+}:
25
36stdenv.mkDerivation rec {
47 name = "pktgen-${version}";
5− version = "3.0.00";
8+ version = "3.0.04";
69
710 src = fetchurl {
811 url = "http://dpdk.org/browse/apps/pktgen-dpdk/snapshot/pktgen-${version}.tar.gz";
9− sha256 = "703f8bd615aa4ae3a3085055483f9889dda09d082abb58afd33c1ba7c766ea65";
12+ sha256 = "0vrmbpl8zaal5zjwyzlx0y3d6jydfxdmf0psdj7ic37h5yh2iv2q";
1013 };
1114
12− buildInputs = [ dpdk libpcap ];
15+ nativeBuildInputs = stdenv.lib.optionals withGtk [ pkgconfig ];
16+
17+ buildInputs =
18+ [ dpdk libpcap ]
19+ ++ stdenv.lib.optionals withGtk [gtk];
1320
1421 RTE_SDK = "${dpdk}";
1522 RTE_TARGET = "x86_64-native-linuxapp-gcc";
23+ GUI = stdenv.lib.optionalString withGtk "true";
1624
1725 enableParallelBuilding = true;
1826
1927 NIX_CFLAGS_COMPILE = [ "-march=core2" ];
2028
21− patchPhase = ''
22− sed -i -e s:/usr/local:$out:g lib/lua/src/luaconf.h
23− sed -i -e s:/usr/bin/lscpu:${utillinux}/bin/lscpu:g lib/common/wr_lscpu.h
29+ postPatch = ''
30+ substituteInPlace lib/lua/src/luaconf.h --replace /usr/local $out
31+ substituteInPlace lib/common/wr_lscpu.h --replace /usr/bin/lscpu ${utillinux}/bin/lscpu
2432 '';
2533
2634 installPhase = ''