2016-06-02 01:30:25 +02:00
|
|
|
{ stdenv, lib, kernel, fetchurl, pkgconfig, libvirt }:
|
2016-04-20 17:11:34 +02:00
|
|
|
|
|
|
|
assert lib.versionAtLeast kernel.version "3.18";
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "dpdk-${version}-${kernel.version}";
|
2016-09-03 17:40:27 +02:00
|
|
|
version = "16.07";
|
2016-04-20 17:11:34 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://dpdk.org/browse/dpdk/snapshot/dpdk-${version}.tar.gz";
|
2016-09-03 17:40:27 +02:00
|
|
|
sha256 = "1sgh55w3xpc0lb70s74cbyryxdjijk1fbv9b25jy8ms3lxaj966c";
|
2016-04-20 17:11:34 +02:00
|
|
|
};
|
|
|
|
|
2016-06-02 01:30:25 +02:00
|
|
|
buildInputs = [ pkgconfig libvirt ];
|
|
|
|
|
2016-04-20 17:11:34 +02:00
|
|
|
RTE_KERNELDIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build";
|
|
|
|
RTE_TARGET = "x86_64-native-linuxapp-gcc";
|
|
|
|
|
2016-06-29 10:34:17 +02:00
|
|
|
# we need sse3 instructions to build
|
2016-05-19 12:52:52 +02:00
|
|
|
NIX_CFLAGS_COMPILE = [ "-march=core2" ];
|
2016-05-18 17:25:57 +02:00
|
|
|
|
2016-04-20 17:11:34 +02:00
|
|
|
enableParallelBuilding = true;
|
2016-06-02 01:35:35 +02:00
|
|
|
outputs = [ "out" "kmod" "examples" ];
|
2016-04-20 17:11:34 +02:00
|
|
|
|
2016-05-31 14:35:54 +02:00
|
|
|
hardeningDisable = [ "pic" ];
|
|
|
|
|
2016-06-29 10:34:17 +02:00
|
|
|
configurePhase = ''
|
2016-04-20 17:11:34 +02:00
|
|
|
make T=x86_64-native-linuxapp-gcc config
|
2016-06-29 10:34:17 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
2016-04-20 17:11:34 +02:00
|
|
|
make T=x86_64-native-linuxapp-gcc install
|
|
|
|
make T=x86_64-native-linuxapp-gcc examples
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2016-06-01 07:39:40 +02:00
|
|
|
install -m 0755 -d $out/lib
|
|
|
|
install -m 0644 ${RTE_TARGET}/lib/*.a $out/lib
|
|
|
|
|
|
|
|
install -m 0755 -d $out/include
|
|
|
|
install -m 0644 ${RTE_TARGET}/include/*.h $out/include
|
|
|
|
|
|
|
|
install -m 0755 -d $out/include/generic
|
|
|
|
install -m 0644 ${RTE_TARGET}/include/generic/*.h $out/include/generic
|
|
|
|
|
|
|
|
install -m 0755 -d $out/include/exec-env
|
|
|
|
install -m 0644 ${RTE_TARGET}/include/exec-env/*.h $out/include/exec-env
|
|
|
|
|
|
|
|
install -m 0755 -d $out/${RTE_TARGET}
|
|
|
|
install -m 0644 ${RTE_TARGET}/.config $out/${RTE_TARGET}
|
|
|
|
|
|
|
|
install -m 0755 -d $out/${RTE_TARGET}/include
|
|
|
|
install -m 0644 ${RTE_TARGET}/include/rte_config.h $out/${RTE_TARGET}/include
|
|
|
|
|
|
|
|
cp -pr mk scripts $out/
|
2016-06-02 01:35:35 +02:00
|
|
|
|
|
|
|
mkdir -p $kmod/lib/modules/${kernel.modDirVersion}/kernel/drivers/net
|
|
|
|
cp ${RTE_TARGET}/kmod/*.ko $kmod/lib/modules/${kernel.modDirVersion}/kernel/drivers/net
|
2016-04-20 17:11:34 +02:00
|
|
|
|
2016-06-01 07:11:06 +02:00
|
|
|
mkdir -p $examples/bin
|
2016-06-01 07:27:36 +02:00
|
|
|
find examples ${RTE_TARGET}/app -type f -executable -exec cp {} $examples/bin \;
|
2016-04-20 17:11:34 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Set of libraries and drivers for fast packet processing";
|
|
|
|
homepage = http://dpdk.org/;
|
|
|
|
license = with licenses; [ lgpl21 gpl2 bsd2 ];
|
2016-04-21 00:38:52 +02:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2016-05-17 13:57:28 +02:00
|
|
|
maintainers = [ maintainers.domenkozar ];
|
2016-04-20 17:11:34 +02:00
|
|
|
};
|
|
|
|
}
|