summary refs log tree commit diff
path: root/pkgs/os-specific/linux
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2021-07-23 09:44:22 +0100
committerGitHub <noreply@github.com>2021-07-23 09:44:22 +0100
commita6d966aeacd10a0e2a887e218f9b0c7df6356cae (patch)
tree616629e1e79ab83af06acfad2114301fdd0ae780 /pkgs/os-specific/linux
parent4345ca3e0211833024cb22a16371449379a6e9c8 (diff)
parent7f2e069592a3818a5a7c04732fc324a99f7b86af (diff)
downloadnixpkgs-a6d966aeacd10a0e2a887e218f9b0c7df6356cae.tar
nixpkgs-a6d966aeacd10a0e2a887e218f9b0c7df6356cae.tar.gz
nixpkgs-a6d966aeacd10a0e2a887e218f9b0c7df6356cae.tar.bz2
nixpkgs-a6d966aeacd10a0e2a887e218f9b0c7df6356cae.tar.lz
nixpkgs-a6d966aeacd10a0e2a887e218f9b0c7df6356cae.tar.xz
nixpkgs-a6d966aeacd10a0e2a887e218f9b0c7df6356cae.tar.zst
nixpkgs-a6d966aeacd10a0e2a887e218f9b0c7df6356cae.zip
Merge pull request #131180 from zhaofengli/dpdk-examples
dpdk: Support building example programs
Diffstat (limited to 'pkgs/os-specific/linux')
-rw-r--r--pkgs/os-specific/linux/dpdk/default.nix10
1 files changed, 8 insertions, 2 deletions
diff --git a/pkgs/os-specific/linux/dpdk/default.nix b/pkgs/os-specific/linux/dpdk/default.nix
index a4bad12b716..ca8905e6240 100644
--- a/pkgs/os-specific/linux/dpdk/default.nix
+++ b/pkgs/os-specific/linux/dpdk/default.nix
@@ -4,6 +4,7 @@
 , pkg-config, meson, ninja
 , libbsd, numactl, libbpf, zlib, libelf, jansson, openssl, libpcap
 , doxygen, python3
+, withExamples ? []
 , shared ? false }:
 
 let
@@ -51,7 +52,8 @@ in stdenv.mkDerivation rec {
   ++ lib.optional (mod && kernel.kernelOlder "5.11") "-Ddisable_drivers=kni"
   ++ lib.optional (!shared) "-Ddefault_library=static"
   ++ lib.optional stdenv.isx86_64 "-Dmachine=nehalem"
-  ++ lib.optional mod "-Dkernel_dir=${placeholder "kmod"}/lib/modules/${kernel.modDirVersion}";
+  ++ lib.optional mod "-Dkernel_dir=${placeholder "kmod"}/lib/modules/${kernel.modDirVersion}"
+  ++ 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.
@@ -65,6 +67,10 @@ in stdenv.mkDerivation rec {
     rm -f $kmod/lib/modules/${kernel.modDirVersion}/build
   '';
 
+  postInstall = lib.optionalString (withExamples != []) ''
+    find examples -type f -executable -exec install {} $out/bin \;
+  '';
+
   outputs = [ "out" ] ++ lib.optional mod "kmod";
 
   meta = with lib; {
@@ -72,6 +78,6 @@ in stdenv.mkDerivation rec {
     homepage = "http://dpdk.org/";
     license = with licenses; [ lgpl21 gpl2 bsd2 ];
     platforms =  platforms.linux;
-    maintainers = with maintainers; [ magenbluten orivej mic92 ];
+    maintainers = with maintainers; [ magenbluten orivej mic92 zhaofengli ];
   };
 }