2021-01-19 06:50:56 +00:00
|
|
|
{ lib, stdenv, fetchurl, autoreconfHook, pkg-config
|
2019-11-10 01:06:11 +00:00
|
|
|
, dpdk, libconfig, libpcap, numactl, openssl, zlib, libbsd, libelf, jansson
|
2019-08-07 06:05:34 +00:00
|
|
|
}: let
|
2019-11-10 01:06:11 +00:00
|
|
|
dpdk_18_11 = dpdk.overrideAttrs (old: rec {
|
|
|
|
version = "18.11.5";
|
2019-08-07 06:05:34 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://fast.dpdk.org/rel/dpdk-${version}.tar.xz";
|
2019-12-23 07:02:28 +00:00
|
|
|
sha256 = "1n6nfaj7703l19jcw540lm8avni48hj9q1rq4mfp8b8gd4zjprj0";
|
2019-08-07 06:05:34 +00:00
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "odp-dpdk";
|
2019-11-10 01:06:11 +00:00
|
|
|
version = "1.22.0.0_DPDK_18.11";
|
2016-06-10 02:45:46 +00:00
|
|
|
|
2018-05-19 13:44:15 +00:00
|
|
|
src = fetchurl {
|
2019-08-15 12:41:18 +00:00
|
|
|
url = "https://git.linaro.org/lng/odp-dpdk.git/snapshot/${pname}-${version}.tar.gz";
|
2019-11-10 01:06:11 +00:00
|
|
|
sha256 = "1m8xhmfjqlj2gkkigq5ka3yh0xgzrcpfpaxp1pnh8d1g99094vbx";
|
2016-06-10 02:45:46 +00:00
|
|
|
};
|
|
|
|
|
2019-11-10 01:06:11 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
autoreconfHook
|
2021-01-19 06:50:56 +00:00
|
|
|
pkg-config
|
2019-11-10 01:06:11 +00:00
|
|
|
];
|
|
|
|
buildInputs = [
|
|
|
|
dpdk_18_11
|
|
|
|
libconfig
|
|
|
|
libpcap
|
|
|
|
numactl
|
|
|
|
openssl
|
|
|
|
zlib
|
|
|
|
libbsd
|
|
|
|
libelf
|
|
|
|
jansson
|
|
|
|
];
|
2016-06-10 02:45:46 +00:00
|
|
|
|
2020-01-05 12:44:55 +00:00
|
|
|
NIX_CFLAGS_COMPILE = [ "-Wno-error=address-of-packed-member" ];
|
|
|
|
|
2019-11-10 01:06:11 +00:00
|
|
|
# for some reason, /build/odp-dpdk-1.22.0.0_DPDK_18.11/lib/.libs ends up in all binaries,
|
|
|
|
# while it should be $out/lib instead.
|
|
|
|
# prepend rpath with the proper location, the /build will get removed during rpath shrinking
|
|
|
|
preFixup = ''
|
|
|
|
for prog in $out/bin/*; do
|
|
|
|
patchelf --set-rpath $out/lib:`patchelf --print-rpath $prog` $prog
|
|
|
|
done
|
|
|
|
'';
|
2016-06-10 02:45:46 +00:00
|
|
|
|
2019-11-10 01:06:11 +00:00
|
|
|
# binaries will segfault otherwise
|
|
|
|
dontStrip = true;
|
2017-09-08 00:56:13 +00:00
|
|
|
|
2019-12-23 07:02:28 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-06-10 02:45:46 +00:00
|
|
|
description = "Open Data Plane optimized for DPDK";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://www.opendataplane.org";
|
2016-06-10 02:45:46 +00:00
|
|
|
license = licenses.bsd3;
|
2019-11-10 01:06:11 +00:00
|
|
|
platforms = platforms.linux;
|
2016-06-10 02:45:46 +00:00
|
|
|
maintainers = [ maintainers.abuibrahim ];
|
|
|
|
};
|
|
|
|
}
|