pktgen: 3.7.2 -> 19.12.0, build with meson, fix build
Building with make requires share/dpdk/mk/ from the make build of dpdk, which is not installed by the meson build of dpdk.
This commit is contained in:
parent
fdb16f3a77
commit
140ab69ae6
17
pkgs/os-specific/linux/pktgen/configure.patch
Normal file
17
pkgs/os-specific/linux/pktgen/configure.patch
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
1. librte_process_info does not exist.
|
||||||
|
2. lua5.3 library is liblua.
|
||||||
|
3. app/meson.build uses undeclared drivers_install_subdir.
|
||||||
|
--- a/lib/common/meson.build
|
||||||
|
+++ b/lib/common/meson.build
|
||||||
|
@@ -34,1 +34,1 @@
|
||||||
|
-libs = ['eal', 'kvargs', 'cmdline', 'process_info']
|
||||||
|
+libs = ['eal', 'kvargs', 'cmdline']
|
||||||
|
--- a/lib/lua/meson.build
|
||||||
|
+++ b/lib/lua/meson.build
|
||||||
|
@@ -31 +31 @@ endforeach
|
||||||
|
-ext_deps += cc.find_library('lua5.3', required: true)
|
||||||
|
+ext_deps += cc.find_library('lua', required: true)
|
||||||
|
--- a/meson_options.txt
|
||||||
|
+++ b/meson_options.txt
|
||||||
|
@@ -0,0 +1,1 @@
|
||||||
|
+option('drivers_install_subdir', type: 'string', value: '')
|
@ -1,41 +1,40 @@
|
|||||||
{ stdenv, lib, fetchurl, pkgconfig
|
{ stdenv, lib, fetchurl, meson, ninja, pkgconfig
|
||||||
, dpdk, libpcap, lua5_3, numactl, utillinux
|
, dpdk, libbsd, libpcap, lua5_3, numactl, utillinux
|
||||||
, gtk2, which, withGtk ? false
|
, gtk2, which, withGtk ? false
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "pktgen";
|
pname = "pktgen";
|
||||||
version = "3.7.2";
|
version = "19.12.0";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "http://dpdk.org/browse/apps/pktgen-dpdk/snapshot/${pname}-${version}.tar.xz";
|
url = "http://dpdk.org/browse/apps/pktgen-dpdk/snapshot/${pname}-${version}.tar.xz";
|
||||||
sha256 = "03k7h4j2lsrh6b7477hgn87ljrjh2673ncffx9v261bx1ns54y7w";
|
sha256 = "1clfviz1qa4hysslcg6i29vsxwl9f6j1y7zf9wwx9br3yq08x956";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgconfig ];
|
nativeBuildInputs = [ meson ninja pkgconfig ];
|
||||||
|
|
||||||
buildInputs =
|
buildInputs =
|
||||||
[ dpdk libpcap lua5_3 numactl which ]
|
[ dpdk libbsd libpcap lua5_3 numactl which ]
|
||||||
++ stdenv.lib.optionals withGtk [gtk2];
|
++ stdenv.lib.optionals withGtk [gtk2];
|
||||||
|
|
||||||
RTE_SDK = "${dpdk}/share/dpdk";
|
RTE_SDK = dpdk;
|
||||||
RTE_TARGET = "x86_64-native-linuxapp-gcc";
|
|
||||||
GUI = stdenv.lib.optionalString withGtk "true";
|
GUI = stdenv.lib.optionalString withGtk "true";
|
||||||
|
|
||||||
NIX_CFLAGS_COMPILE = [ "-msse3" ];
|
NIX_CFLAGS_COMPILE = [ "-msse3" ];
|
||||||
|
|
||||||
postPatch = let dpdkMajor = lib.versions.major dpdk.version; in ''
|
patches = [ ./configure.patch ];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
substituteInPlace lib/common/lscpu.h --replace /usr/bin/lscpu ${utillinux}/bin/lscpu
|
substituteInPlace lib/common/lscpu.h --replace /usr/bin/lscpu ${utillinux}/bin/lscpu
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
postInstall = ''
|
||||||
install -d $out/bin
|
# meson installs unneeded files with conflicting generic names, such as
|
||||||
install -m 0755 app/${RTE_TARGET}/pktgen $out/bin
|
# include/cli.h and lib/liblua.so.
|
||||||
install -m 0644 Pktgen.lua $out/bin
|
rm -rf $out/include $out/lib
|
||||||
'';
|
'';
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "Traffic generator powered by DPDK";
|
description = "Traffic generator powered by DPDK";
|
||||||
homepage = http://dpdk.org/;
|
homepage = http://dpdk.org/;
|
||||||
|
Loading…
Reference in New Issue
Block a user