{ stdenv , lib , kernel , xilinx-xrt }: with lib; # See: https://iotlab.sdsu.edu/index.php/flash-base-image-on-xilinx-alveo-u280/ stdenv.mkDerivation rec { pname = "xilinx-xocl"; version = "2.19.0"; src = "${xilinx-xrt}/src/xrt-${version}"; dontStrip = true; preBuild = '' cd driver/xocl ''; patches = [ ./xilinx-xocl-depmod.patch ]; buildFlags = [ "KERNEL_SRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" ]; installFlags = [ "KERNEL_SRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" "INSTALL_MOD_PATH=${placeholder "out"}" ]; postInstall = '' mkdir -p $out/etc/udev/rules.d install -m 644 userpf/99-xocl.rules $out/etc/udev/rules.d install -m 644 mgmtpf/99-xclmgmt.rules $out/etc/udev/rules.d ''; nativeBuildInputs = kernel.moduleBuildDependencies; hardeningDisable = [ "all" ]; }