git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #73186 from flokli/bump-dpdk

dpdk: build with meson, odp-dpdk: -> 1.22.0.0

commit1ced1425aaedf03752240917c2831367969e6d67 authorFlorian Klink <flokli@flokli.de> dateSun 24 Nov 2019, 17:14 (7 years ago) parent5682fe18f97966
2 files changed+68−52
pkgs/os-specific/linux/dpdk/default.nix+36−34 pkgs/os-specific/linux/odp-dpdk/default.nix+32−18
pkgs/os-specific/linux/dpdk/default.nix+36−34
@@ -1,9 +1,13 @@
1−{ stdenv, lib, kernel, fetchurl, pkgconfig, numactl, shared ? false }:
1+{ stdenv, lib
2+, kernel
3+, fetchurl
4+, pkgconfig, meson, ninja
5+, libbsd, numactl, libbpf, zlib, libelf, jansson, openssl, libpcap
6+, doxygen, python3
7+, shared ? false }:
28
39let
4−
510 kver = kernel.modDirVersion or null;
6−
711 mod = kernel != null;
812
913in stdenv.mkDerivation rec {
@@ -15,40 +19,38 @@ in stdenv.mkDerivation rec {
1519 sha256 = "141bqqy4w6nzs9z70x7yv94a4gmxjfal46pxry9bwdh3zi1jwnyd";
1620 };
1721
18− nativeBuildInputs = [ pkgconfig ];
19− buildInputs = [ numactl ] ++ lib.optional mod kernel.moduleBuildDependencies;
20−
21− RTE_KERNELDIR = if mod then "${kernel.dev}/lib/modules/${kver}/build" else "/var/empty";
22− RTE_TARGET = "x86_64-native-linuxapp-gcc";
23−
24− # we need sse3 instructions to build
25− NIX_CFLAGS_COMPILE = [ "-msse3" ];
26− hardeningDisable = [ "pic" ];
22+ nativeBuildInputs = [
23+ doxygen
24+ meson
25+ ninja
26+ pkgconfig
27+ python3
28+ python3.pkgs.sphinx
29+ ];
30+ buildInputs = [
31+ jansson
32+ libbpf
33+ libbsd
34+ libelf
35+ libpcap
36+ numactl
37+ openssl.dev
38+ zlib
39+ ] ++ lib.optionals mod kernel.moduleBuildDependencies;
2740
2841 postPatch = ''
29− cat >>config/defconfig_$RTE_TARGET <<EOF
30−# Build static or shared libraries.
31−CONFIG_RTE_BUILD_SHARED_LIB=${if shared then "y" else "n"}
32−EOF
33− '' + lib.optionalString (!mod) ''
34− cat >>config/defconfig_$RTE_TARGET <<EOF
35−# Do not build kernel modules.
36−CONFIG_RTE_EAL_IGB_UIO=n
37−CONFIG_RTE_KNI_KMOD=n
38−EOF
42+ patchShebangs config/arm
3943 '';
4044
41− configurePhase = ''
42− make T=${RTE_TARGET} config
43− '';
44−
45− installTargets = [ "install-runtime" "install-sdk" "install-kmod" ]; # skip install-doc
46−
47− installFlags = [
48− "prefix=$(out)"
49− ] ++ lib.optionals mod [
50− "kerneldir=$(kmod)/lib/modules/${kver}"
51− ];
45+ mesonFlags = [
46+ "-Denable_docs=true"
47+ "-Denable_kmods=${if kernel != null then "true" else "false"}"
48+ ]
49+ ++ lib.optionals (shared == false) [
50+ "-Ddefault_library=static"
51+ ]
52+ ++ lib.optional stdenv.isx86_64 "-Dmachine=nehalem"
53+ ++ lib.optional (kernel != null) "-Dkernel_dir=${kernel.dev}/lib/modules/${kernel.modDirVersion}";
5254
5355 outputs = [ "out" ] ++ lib.optional mod "kmod";
5456
@@ -58,7 +60,7 @@ EOF
5860 description = "Set of libraries and drivers for fast packet processing";
5961 homepage = http://dpdk.org/;
6062 license = with licenses; [ lgpl21 gpl2 bsd2 ];
61− platforms = [ "x86_64-linux" ];
63+ platforms = platforms.linux;
6264 maintainers = with maintainers; [ domenkozar magenbluten orivej ];
6365 };
6466}
pkgs/os-specific/linux/odp-dpdk/default.nix+32−18
@@ -1,42 +1,56 @@
11{ stdenv, fetchurl, autoreconfHook, pkgconfig
2−, dpdk, libconfig, libpcap, numactl, openssl
2+, dpdk, libconfig, libpcap, numactl, openssl, zlib, libbsd, libelf, jansson
33}: let
4−
5− dpdk_17_11 = dpdk.overrideAttrs (old: rec {
6− version = "17.11.9";
4+ dpdk_18_11 = dpdk.overrideAttrs (old: rec {
5+ version = "18.11.5";
76 src = fetchurl {
87 url = "https://fast.dpdk.org/rel/dpdk-${version}.tar.xz";
9− sha256 = "0vrcc9mdjs5fk69lh7bigsk9208dfmjsz3jxaddkjlvk2hds1id6";
8+ sha256 = "0000000000000000000000000000000000000000000000000000";
109 };
1110 });
1211
1312in stdenv.mkDerivation rec {
1413 pname = "odp-dpdk";
15− version = "1.19.0.0_DPDK_17.11";
14+ version = "1.22.0.0_DPDK_18.11";
1615
1716 src = fetchurl {
1817 url = "https://git.linaro.org/lng/odp-dpdk.git/snapshot/${pname}-${version}.tar.gz";
19− sha256 = "05bwjaxl9hqc6fbkp95nniq11g3kvzmlxw0bq55i7p2v35nv38px";
18+ sha256 = "1m8xhmfjqlj2gkkigq5ka3yh0xgzrcpfpaxp1pnh8d1g99094vbx";
2019 };
2120
22− nativeBuildInputs = [ autoreconfHook pkgconfig ];
23− buildInputs = [ dpdk_17_11 libconfig libpcap numactl openssl ];
24−
25− RTE_SDK = "${dpdk_17_11}/share/dpdk";
26− RTE_TARGET = "x86_64-native-linuxapp-gcc";
21+ nativeBuildInputs = [
22+ autoreconfHook
23+ pkgconfig
24+ ];
25+ buildInputs = [
26+ dpdk_18_11
27+ libconfig
28+ libpcap
29+ numactl
30+ openssl
31+ zlib
32+ libbsd
33+ libelf
34+ jansson
35+ ];
2736
28− dontDisableStatic = true;
37+ # for some reason, /build/odp-dpdk-1.22.0.0_DPDK_18.11/lib/.libs ends up in all binaries,
38+ # while it should be $out/lib instead.
39+ # prepend rpath with the proper location, the /build will get removed during rpath shrinking
40+ preFixup = ''
41+ for prog in $out/bin/*; do
42+ patchelf --set-rpath $out/lib:`patchelf --print-rpath $prog` $prog
43+ done
44+ '';
2945
30− configureFlags = [
31− "--disable-shared"
32− "--with-dpdk-path=${dpdk_17_11}"
33− ];
46+ # binaries will segfault otherwise
47+ dontStrip = true;
3448
3549 meta = with stdenv.lib; {
3650 description = "Open Data Plane optimized for DPDK";
3751 homepage = https://www.opendataplane.org;
3852 license = licenses.bsd3;
39− platforms = [ "x86_64-linux" ];
53+ platforms = platforms.linux;
4054 maintainers = [ maintainers.abuibrahim ];
4155 };
4256}