1{ lib, stdenv, fetchzip, fetchpatch, kernel }:
2
3stdenv.mkDerivation rec {
4 pname = "dpdk-kmods";
5 version = "2022-08-29";
6
7 src = fetchzip {
8 url = "https://git.dpdk.org/dpdk-kmods/snapshot/dpdk-kmods-4a589f7bed00fc7009c93d430bd214ac7ad2bb6b.tar.xz";
9 sha256 = "sha256-l9asJuw2nl63I1BxK6udy2pNunRiMJxyoXeg9V5+WgI=";
10 };
11
12 patches = [
13 (fetchpatch {
14 url = "https://git.launchpad.net/ubuntu/+source/dpdk-kmods/plain/debian/patches/0001-support-linux-5.18.patch?id=9d628c02c169d8190bc2cb6afd81e4d364c382cd";
15 sha256 = "sha256-j4kpx1DOnmf5lFxOhaVFNT7prEy1jrJERX2NFaybTPU=";
16 })
17 ];
18
19 hardeningDisable = [ "pic" ];
20
21 makeFlags = kernel.makeFlags ++ [
22 "INSTALL_MOD_PATH=${placeholder "out"}"
23 ];
24 KSRC = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build";
25
26 nativeBuildInputs = kernel.moduleBuildDependencies;
27
28 preBuild = "cd linux/igb_uio";
29
30 installPhase = ''
31 make -C ${KSRC} M=$(pwd) modules_install $makeFlags
32 '';
33
34 enableParallelBuilding = true;
35
36 meta = with lib; {
37 description = "Kernel modules for DPDK";
38 homepage = "https://git.dpdk.org/dpdk-kmods/";
39 license = licenses.gpl2Only;
40 maintainers = [ maintainers.mic92 ];
41 platforms = platforms.linux;
42 };
43}