2019-11-10 01:46:26 +01:00
|
|
|
{ stdenv, lib
|
|
|
|
, kernel
|
|
|
|
, fetchurl
|
|
|
|
, pkgconfig, meson, ninja
|
|
|
|
, libbsd, numactl, libbpf, zlib, libelf, jansson, openssl, libpcap
|
|
|
|
, doxygen, python3
|
|
|
|
, shared ? false }:
|
2016-04-20 17:11:34 +02:00
|
|
|
|
2018-05-21 00:43:35 +02:00
|
|
|
let
|
|
|
|
kver = kernel.modDirVersion or null;
|
|
|
|
mod = kernel != null;
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
name = "dpdk-${version}" + lib.optionalString mod "-${kernel.version}";
|
2019-12-23 07:51:14 +01:00
|
|
|
version = "19.11";
|
2016-04-20 17:11:34 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2018-06-28 20:43:35 +02:00
|
|
|
url = "https://fast.dpdk.org/rel/dpdk-${version}.tar.xz";
|
2019-12-23 07:51:14 +01:00
|
|
|
sha256 = "1aqjn6bm9miv3v2rbqi1rh1c19wa8nip9fvnqaqpnrs3i2b36wa6";
|
2016-04-20 17:11:34 +02:00
|
|
|
};
|
|
|
|
|
2019-11-10 01:46:26 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
doxygen
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkgconfig
|
|
|
|
python3
|
|
|
|
python3.pkgs.sphinx
|
|
|
|
];
|
|
|
|
buildInputs = [
|
|
|
|
jansson
|
|
|
|
libbpf
|
|
|
|
libbsd
|
|
|
|
libelf
|
|
|
|
libpcap
|
|
|
|
numactl
|
|
|
|
openssl.dev
|
|
|
|
zlib
|
|
|
|
] ++ lib.optionals mod kernel.moduleBuildDependencies;
|
2016-05-31 14:35:54 +02:00
|
|
|
|
2018-05-21 04:32:18 +02:00
|
|
|
postPatch = ''
|
2019-11-10 01:46:26 +01:00
|
|
|
patchShebangs config/arm
|
2018-05-21 00:43:35 +02:00
|
|
|
'';
|
|
|
|
|
2019-11-10 01:46:26 +01:00
|
|
|
mesonFlags = [
|
|
|
|
"-Denable_docs=true"
|
|
|
|
"-Denable_kmods=${if kernel != null then "true" else "false"}"
|
|
|
|
]
|
|
|
|
++ lib.optionals (shared == false) [
|
|
|
|
"-Ddefault_library=static"
|
|
|
|
]
|
|
|
|
++ lib.optional stdenv.isx86_64 "-Dmachine=nehalem"
|
|
|
|
++ lib.optional (kernel != null) "-Dkernel_dir=${kernel.dev}/lib/modules/${kernel.modDirVersion}";
|
2018-05-21 00:43:35 +02:00
|
|
|
|
|
|
|
outputs = [ "out" ] ++ lib.optional mod "kmod";
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
2016-04-20 17:11:34 +02:00
|
|
|
|
2018-05-21 00:43:35 +02:00
|
|
|
meta = with lib; {
|
2016-04-20 17:11:34 +02:00
|
|
|
description = "Set of libraries and drivers for fast packet processing";
|
|
|
|
homepage = http://dpdk.org/;
|
|
|
|
license = with licenses; [ lgpl21 gpl2 bsd2 ];
|
2019-11-10 01:46:26 +01:00
|
|
|
platforms = platforms.linux;
|
2019-08-01 11:07:50 +02:00
|
|
|
maintainers = with maintainers; [ domenkozar magenbluten orivej ];
|
2016-04-20 17:11:34 +02:00
|
|
|
};
|
|
|
|
}
|