Merge pull request #131180 from zhaofengli/dpdk-examples

dpdk: Support building example programs

authored by Jörg Thalheim and committed by GitHub a6d966ae 4345ca3e

+8 -2
+8 -2
pkgs/os-specific/linux/dpdk/default.nix
··· 4 , pkg-config, meson, ninja 5 , libbsd, numactl, libbpf, zlib, libelf, jansson, openssl, libpcap 6 , doxygen, python3 7 , shared ? false }: 8 9 let ··· 51 ++ lib.optional (mod && kernel.kernelOlder "5.11") "-Ddisable_drivers=kni" 52 ++ lib.optional (!shared) "-Ddefault_library=static" 53 ++ lib.optional stdenv.isx86_64 "-Dmachine=nehalem" 54 - ++ lib.optional mod "-Dkernel_dir=${placeholder "kmod"}/lib/modules/${kernel.modDirVersion}"; 55 56 # dpdk meson script does not support separate kernel source and installion 57 # dirs (except via destdir), so we temporarily link the former into the latter. ··· 65 rm -f $kmod/lib/modules/${kernel.modDirVersion}/build 66 ''; 67 68 outputs = [ "out" ] ++ lib.optional mod "kmod"; 69 70 meta = with lib; { ··· 72 homepage = "http://dpdk.org/"; 73 license = with licenses; [ lgpl21 gpl2 bsd2 ]; 74 platforms = platforms.linux; 75 - maintainers = with maintainers; [ magenbluten orivej mic92 ]; 76 }; 77 }
··· 4 , pkg-config, meson, ninja 5 , libbsd, numactl, libbpf, zlib, libelf, jansson, openssl, libpcap 6 , doxygen, python3 7 + , withExamples ? [] 8 , shared ? false }: 9 10 let ··· 52 ++ lib.optional (mod && kernel.kernelOlder "5.11") "-Ddisable_drivers=kni" 53 ++ lib.optional (!shared) "-Ddefault_library=static" 54 ++ lib.optional stdenv.isx86_64 "-Dmachine=nehalem" 55 + ++ lib.optional mod "-Dkernel_dir=${placeholder "kmod"}/lib/modules/${kernel.modDirVersion}" 56 + ++ lib.optional (withExamples != []) "-Dexamples=${builtins.concatStringsSep "," withExamples}"; 57 58 # dpdk meson script does not support separate kernel source and installion 59 # dirs (except via destdir), so we temporarily link the former into the latter. ··· 67 rm -f $kmod/lib/modules/${kernel.modDirVersion}/build 68 ''; 69 70 + postInstall = lib.optionalString (withExamples != []) '' 71 + find examples -type f -executable -exec install {} $out/bin \; 72 + ''; 73 + 74 outputs = [ "out" ] ++ lib.optional mod "kmod"; 75 76 meta = with lib; { ··· 78 homepage = "http://dpdk.org/"; 79 license = with licenses; [ lgpl21 gpl2 bsd2 ]; 80 platforms = platforms.linux; 81 + maintainers = with maintainers; [ magenbluten orivej mic92 zhaofengli ]; 82 }; 83 }