about summary refs log tree commit diff
path: root/pkgs/os-specific
diff options
context:
space:
mode:
authorJonathan Ringer <jonringer117@gmail.com>2019-12-30 10:14:18 -0800
committerJonathan Ringer <jonringer117@gmail.com>2019-12-30 10:14:18 -0800
commit446fec8c2dda7ab24783713f16092803b7b1e464 (patch)
treebda175eabb91dd480448aa3c24875de73640e8a4 /pkgs/os-specific
parent99de1a8ebb9df72642c259de63c4f0d2d1c770e7 (diff)
parent97da2d22fed6b55d331c565a5817e97d74063397 (diff)
Merge branch 'master' of github.com:NixOS/nixpkgs into staging-next
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r--pkgs/os-specific/linux/dpdk/default.nix25
-rw-r--r--pkgs/os-specific/linux/odp-dpdk/default.nix4
-rw-r--r--pkgs/os-specific/linux/pktgen/configure.patch17
-rw-r--r--pkgs/os-specific/linux/pktgen/default.nix29
4 files changed, 51 insertions, 24 deletions
diff --git a/pkgs/os-specific/linux/dpdk/default.nix b/pkgs/os-specific/linux/dpdk/default.nix
index 104fccd6955bc..414f276a21093 100644
--- a/pkgs/os-specific/linux/dpdk/default.nix
+++ b/pkgs/os-specific/linux/dpdk/default.nix
@@ -7,16 +7,15 @@
 , shared ? false }:
 
 let
-  kver = kernel.modDirVersion or null;
   mod = kernel != null;
 
 in stdenv.mkDerivation rec {
   name = "dpdk-${version}" + lib.optionalString mod "-${kernel.version}";
-  version = "19.08.2";
+  version = "19.11";
 
   src = fetchurl {
     url = "https://fast.dpdk.org/rel/dpdk-${version}.tar.xz";
-    sha256 = "141bqqy4w6nzs9z70x7yv94a4gmxjfal46pxry9bwdh3zi1jwnyd";
+    sha256 = "1aqjn6bm9miv3v2rbqi1rh1c19wa8nip9fvnqaqpnrs3i2b36wa6";
   };
 
   nativeBuildInputs = [
@@ -44,13 +43,23 @@ in stdenv.mkDerivation rec {
 
   mesonFlags = [
     "-Denable_docs=true"
-    "-Denable_kmods=${if kernel != null then "true" else "false"}"
-  ]
-  ++ lib.optionals (shared == false) [
-    "-Ddefault_library=static"
+    "-Denable_kmods=${if mod then "true" else "false"}"
   ]
+  ++ lib.optional (!shared) "-Ddefault_library=static"
   ++ lib.optional stdenv.isx86_64 "-Dmachine=nehalem"
-  ++ lib.optional (kernel != null) "-Dkernel_dir=${kernel.dev}/lib/modules/${kernel.modDirVersion}";
+  ++ lib.optional mod "-Dkernel_dir=${placeholder "kmod"}/lib/modules/${kernel.modDirVersion}";
+
+  # dpdk meson script does not support separate kernel source and installion
+  # dirs (except via destdir), so we temporarily link the former into the latter.
+  preConfigure = lib.optionalString mod ''
+    mkdir -p $kmod/lib/modules/${kernel.modDirVersion}
+    ln -sf ${kernel.dev}/lib/modules/${kernel.modDirVersion}/build \
+      $kmod/lib/modules/${kernel.modDirVersion}
+  '';
+
+  postBuild = lib.optionalString mod ''
+    rm -f $kmod/lib/modules/${kernel.modDirVersion}/build
+  '';
 
   outputs = [ "out" ] ++ lib.optional mod "kmod";
 
diff --git a/pkgs/os-specific/linux/odp-dpdk/default.nix b/pkgs/os-specific/linux/odp-dpdk/default.nix
index 0bdc22da918d8..66185de03a16b 100644
--- a/pkgs/os-specific/linux/odp-dpdk/default.nix
+++ b/pkgs/os-specific/linux/odp-dpdk/default.nix
@@ -5,7 +5,7 @@
     version = "18.11.5";
     src = fetchurl {
       url = "https://fast.dpdk.org/rel/dpdk-${version}.tar.xz";
-      sha256 = "0000000000000000000000000000000000000000000000000000";
+      sha256 = "1n6nfaj7703l19jcw540lm8avni48hj9q1rq4mfp8b8gd4zjprj0";
     };
   });
 
@@ -46,6 +46,8 @@ in stdenv.mkDerivation rec {
   # binaries will segfault otherwise
   dontStrip = true;
 
+  enableParallelBuilding = true;
+
   meta = with stdenv.lib; {
     description = "Open Data Plane optimized for DPDK";
     homepage = https://www.opendataplane.org;
diff --git a/pkgs/os-specific/linux/pktgen/configure.patch b/pkgs/os-specific/linux/pktgen/configure.patch
new file mode 100644
index 0000000000000..b4933313a51a3
--- /dev/null
+++ b/pkgs/os-specific/linux/pktgen/configure.patch
@@ -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: '')
diff --git a/pkgs/os-specific/linux/pktgen/default.nix b/pkgs/os-specific/linux/pktgen/default.nix
index fd57fa6e37ce4..171e5d3b43ae8 100644
--- a/pkgs/os-specific/linux/pktgen/default.nix
+++ b/pkgs/os-specific/linux/pktgen/default.nix
@@ -1,41 +1,40 @@
-{ stdenv, lib, fetchurl, pkgconfig
-, dpdk, libpcap, lua5_3, numactl, utillinux
+{ stdenv, lib, fetchurl, meson, ninja, pkgconfig
+, dpdk, libbsd, libpcap, lua5_3, numactl, utillinux
 , gtk2, which, withGtk ? false
 }:
 
 stdenv.mkDerivation rec {
   pname = "pktgen";
-  version = "3.7.2";
+  version = "19.12.0";
 
   src = fetchurl {
     url = "http://dpdk.org/browse/apps/pktgen-dpdk/snapshot/${pname}-${version}.tar.xz";
-    sha256 = "03k7h4j2lsrh6b7477hgn87ljrjh2673ncffx9v261bx1ns54y7w";
+    sha256 = "1clfviz1qa4hysslcg6i29vsxwl9f6j1y7zf9wwx9br3yq08x956";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ meson ninja pkgconfig ];
 
   buildInputs =
-    [ dpdk libpcap lua5_3 numactl which ]
+    [ dpdk libbsd libpcap lua5_3 numactl which ]
     ++ stdenv.lib.optionals withGtk [gtk2];
 
-  RTE_SDK = "${dpdk}/share/dpdk";
-  RTE_TARGET = "x86_64-native-linuxapp-gcc";
+  RTE_SDK = dpdk;
   GUI = stdenv.lib.optionalString withGtk "true";
 
   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
   '';
 
-  installPhase = ''
-    install -d $out/bin
-    install -m 0755 app/${RTE_TARGET}/pktgen $out/bin
-    install -m 0644 Pktgen.lua $out/bin
+  postInstall = ''
+    # meson installs unneeded files with conflicting generic names, such as
+    # include/cli.h and lib/liblua.so.
+    rm -rf $out/include $out/lib
   '';
 
-  enableParallelBuilding = true;
-
   meta = with stdenv.lib; {
     description = "Traffic generator powered by DPDK";
     homepage = http://dpdk.org/;