1{ stdenv, lib, kernel, fetchurl, pkgconfig, libvirt }:
2
3assert lib.versionAtLeast kernel.version "3.18";
4
5stdenv.mkDerivation rec {
6 name = "dpdk-${version}-${kernel.version}";
7 version = "17.05.1";
8
9 src = fetchurl {
10 url = "http://fast.dpdk.org/rel/dpdk-${version}.tar.xz";
11 sha256 = "1w3nx5cqf8z600bdlbwz7brmdb5yn233qrqvv24kbmmxhbwp7qld";
12 };
13
14 nativeBuildInputs = [ pkgconfig ] ++ kernel.moduleBuildDependencies;
15 buildInputs = [ libvirt ];
16
17 RTE_KERNELDIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build";
18 RTE_TARGET = "x86_64-native-linuxapp-gcc";
19
20 # we need sse3 instructions to build
21 NIX_CFLAGS_COMPILE = [ "-march=core2" ];
22
23 enableParallelBuilding = true;
24 outputs = [ "out" "kmod" ];
25
26 hardeningDisable = [ "pic" ];
27
28 configurePhase = ''
29 make T=${RTE_TARGET} config
30 '';
31
32 installPhase = ''
33 make install-runtime DESTDIR=$out prefix= includedir=/include datadir=/
34 make install-sdk DESTDIR=$out prefix= includedir=/include datadir=/
35 make install-kmod DESTDIR=$kmod
36 '';
37
38 meta = with stdenv.lib; {
39 description = "Set of libraries and drivers for fast packet processing";
40 homepage = http://dpdk.org/;
41 license = with licenses; [ lgpl21 gpl2 bsd2 ];
42 platforms = [ "x86_64-linux" ];
43 maintainers = [ maintainers.domenkozar ];
44 };
45}