linuxPackages.pktgen: 3.4.0 -> 3.5.0

This commit is contained in:
Orivej Desh
2018-05-19 14:07:32 +00:00
parent 52ad7f7390
commit d307113708
2 changed files with 28 additions and 46 deletions
+28 -12
View File
@@ -1,34 +1,48 @@
{ stdenv, fetchurl, dpdk, libpcap, utillinux
, pkgconfig
{ stdenv, lib, fetchurl, pkgconfig
, dpdk, libpcap, numactl, utillinux
, gtk2, withGtk ? false
}:
stdenv.mkDerivation rec {
let
# pktgen needs a specific version of lua to apply its patch (see lib/lua/Makefile).
lua = rec {
name = "lua-5.3.4";
basename = name + ".tar.gz";
src = fetchurl {
url = "https://www.lua.org/ftp/${basename}";
sha256 = "0320a8dg3aci4hxla380dx1ifkw8gj4gbw5c4dz41g1kh98sm0gn";
};
};
in stdenv.mkDerivation rec {
name = "pktgen-${version}";
version = "3.4.0";
version = "3.5.0";
src = fetchurl {
url = "http://dpdk.org/browse/apps/pktgen-dpdk/snapshot/pktgen-${version}.tar.gz";
sha256 = "0fcyb56d4mkvchi5i8s3m210f5c3xa8zbjb08ranpa1a2k1kzfg5";
url = "http://dpdk.org/browse/apps/pktgen-dpdk/snapshot/pktgen-${version}.tar.xz";
sha256 = "1gy99jr9dbwzi9pd3w5k673h3pfnbkz6rbzmrkwcyis72pnphy5z";
};
nativeBuildInputs = stdenv.lib.optionals withGtk [ pkgconfig ];
buildInputs =
[ dpdk libpcap ]
[ dpdk libpcap numactl ]
++ stdenv.lib.optionals withGtk [gtk2];
RTE_SDK = "${dpdk}";
RTE_TARGET = "x86_64-native-linuxapp-gcc";
GUI = stdenv.lib.optionalString withGtk "true";
NIX_CFLAGS_COMPILE = [ "-march=core2" ];
NIX_CFLAGS_COMPILE = [ "-msse3" ];
patches = [ ./Makefile.patch ];
postPatch = ''
substituteInPlace lib/lua/src/luaconf.h --replace /usr/local $out
postPatch = let dpdkMajor = lib.versions.major dpdk.version; in ''
substituteInPlace app/Makefile --replace 'yy :=' 'yy := ${dpdkMajor} #'
substituteInPlace lib/common/lscpu.h --replace /usr/bin/lscpu ${utillinux}/bin/lscpu
ln -s ${lua.src} lib/lua/${lua.basename}
make -C lib/lua get_tarball # unpack and patch
substituteInPlace lib/lua/${lua.name}/src/luaconf.h --replace /usr/local $out
'';
installPhase = ''
@@ -38,6 +52,8 @@ stdenv.mkDerivation rec {
install -m 0644 Pktgen.lua $out/lib/lua/5.3
'';
enableParallelBuilding = true;
meta = with stdenv.lib; {
description = "Traffic generator powered by DPDK";
homepage = http://dpdk.org/;