summary refs log tree commit diff
path: root/pkgs/os-specific/linux/dpdk
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2022-01-26 00:17:18 +0900
committerNikolay Amiantov <ab@fmap.me>2022-01-28 11:17:52 +0300
commit2c0b4b8510da45085a9f6b332208a3fc0f66e001 (patch)
tree44b0274473d40e720f1e94a253f9b200f27331a5 /pkgs/os-specific/linux/dpdk
parentd15130584f974f9d8a7680f4da713d0889599040 (diff)
downloadnixpkgs-2c0b4b8510da45085a9f6b332208a3fc0f66e001.tar
nixpkgs-2c0b4b8510da45085a9f6b332208a3fc0f66e001.tar.gz
nixpkgs-2c0b4b8510da45085a9f6b332208a3fc0f66e001.tar.bz2
nixpkgs-2c0b4b8510da45085a9f6b332208a3fc0f66e001.tar.lz
nixpkgs-2c0b4b8510da45085a9f6b332208a3fc0f66e001.tar.xz
nixpkgs-2c0b4b8510da45085a9f6b332208a3fc0f66e001.tar.zst
nixpkgs-2c0b4b8510da45085a9f6b332208a3fc0f66e001.zip
dpdk: restore rte_kni module build
As a bonus, split doc output.
Diffstat (limited to 'pkgs/os-specific/linux/dpdk')
-rw-r--r--pkgs/os-specific/linux/dpdk/default.nix19
1 files changed, 5 insertions, 14 deletions
diff --git a/pkgs/os-specific/linux/dpdk/default.nix b/pkgs/os-specific/linux/dpdk/default.nix
index 86049eca01d..0c44945620c 100644
--- a/pkgs/os-specific/linux/dpdk/default.nix
+++ b/pkgs/os-specific/linux/dpdk/default.nix
@@ -49,6 +49,9 @@ in stdenv.mkDerivation rec {
 
   postPatch = ''
     patchShebangs config/arm buildtools
+  '' + lib.optionalString mod ''
+    # kernel_install_dir is hardcoded to `/lib/modules`; patch that.
+    sed -i "s,kernel_install_dir *= *['\"].*,kernel_install_dir = '$kmod/lib/modules/${kernel.modDirVersion}'," kernel/linux/meson.build
   '';
 
   mesonFlags = [
@@ -61,21 +64,9 @@ in stdenv.mkDerivation rec {
   ++ lib.optional (!shared) "-Ddefault_library=static"
   ++ lib.optional stdenv.isx86_64 "-Dmachine=nehalem"
   ++ lib.optional stdenv.isAarch64 "-Dmachine=generic"
-  ++ lib.optional mod "-Dkernel_dir=${placeholder "kmod"}/lib/modules/${kernel.modDirVersion}"
+  ++ lib.optional mod "-Dkernel_dir=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
   ++ lib.optional (withExamples != []) "-Dexamples=${builtins.concatStringsSep "," withExamples}";
 
-  # 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
-  '';
-
   postInstall = ''
     # Remove Sphinx cache files. Not only are they not useful, but they also
     # contain store paths causing spurious dependencies.
@@ -84,7 +75,7 @@ in stdenv.mkDerivation rec {
     find examples -type f -executable -exec install {} $out/bin \;
   '';
 
-  outputs = [ "out" ] ++ lib.optional mod "kmod";
+  outputs = [ "out" "doc" ] ++ lib.optional mod "kmod";
 
   meta = with lib; {
     description = "Set of libraries and drivers for fast packet processing";