2016-06-29 09:34:17 +01:00
|
|
|
{ stdenv, fetchurl, dpdk, libpcap, utillinux
|
|
|
|
, pkgconfig
|
2016-09-11 22:24:51 +01:00
|
|
|
, gtk2, withGtk ? false
|
2016-06-29 09:34:17 +01:00
|
|
|
}:
|
2016-06-02 00:41:25 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "pktgen-${version}";
|
2016-09-10 11:06:13 +01:00
|
|
|
version = "3.0.13";
|
2016-06-02 00:41:25 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://dpdk.org/browse/apps/pktgen-dpdk/snapshot/pktgen-${version}.tar.gz";
|
2016-09-10 11:06:13 +01:00
|
|
|
sha256 = "64629b454ed8dc036d5e9bb30b3ae84a0bab0142b651c72da85ab1454e9ae0d6";
|
2016-06-02 00:41:25 +01:00
|
|
|
};
|
|
|
|
|
2016-06-29 09:34:17 +01:00
|
|
|
nativeBuildInputs = stdenv.lib.optionals withGtk [ pkgconfig ];
|
|
|
|
|
|
|
|
buildInputs =
|
|
|
|
[ dpdk libpcap ]
|
2016-09-11 22:24:51 +01:00
|
|
|
++ stdenv.lib.optionals withGtk [gtk2];
|
2016-06-02 00:41:25 +01:00
|
|
|
|
|
|
|
RTE_SDK = "${dpdk}";
|
|
|
|
RTE_TARGET = "x86_64-native-linuxapp-gcc";
|
2016-06-29 09:34:17 +01:00
|
|
|
GUI = stdenv.lib.optionalString withGtk "true";
|
2016-06-02 00:41:25 +01:00
|
|
|
|
2016-06-03 18:57:40 +01:00
|
|
|
NIX_CFLAGS_COMPILE = [ "-march=core2" ];
|
|
|
|
|
2016-06-29 09:34:17 +01:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace lib/lua/src/luaconf.h --replace /usr/local $out
|
|
|
|
substituteInPlace lib/common/wr_lscpu.h --replace /usr/bin/lscpu ${utillinux}/bin/lscpu
|
2016-06-02 00:41:25 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -d $out/bin
|
|
|
|
install -m 0755 app/app/${RTE_TARGET}/app/pktgen $out/bin
|
|
|
|
install -d $out/lib/lua/5.3
|
|
|
|
install -m 0644 Pktgen.lua $out/lib/lua/5.3
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Traffic generator powered by DPDK";
|
|
|
|
homepage = http://dpdk.org/;
|
|
|
|
license = licenses.bsdOriginal;
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
maintainers = [ maintainers.abuibrahim ];
|
|
|
|
};
|
|
|
|
}
|