2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, kernel, kmod }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
stdenv.mkDerivation {
|
2021-06-28 23:13:55 +00:00
|
|
|
pname = "v4l2loopback";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "unstable-2023-11-23-${kernel.version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "umlaeute";
|
|
|
|
repo = "v4l2loopback";
|
2024-01-13 08:15:51 +00:00
|
|
|
rev = "850a2e36849f6ad3c9bf74f2ae3f603452bd8a71";
|
|
|
|
hash = "sha256-LqP5R3oKbjUQUfDZUWpkrmyopWhOt4wlgSgGywTPJXM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
hardeningDisable = [ "format" "pic" ];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
substituteInPlace Makefile --replace "modules_install" "INSTALL_MOD_PATH=$out modules_install"
|
|
|
|
sed -i '/depmod/d' Makefile
|
|
|
|
'';
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
nativeBuildInputs = [ kmod ] ++ kernel.moduleBuildDependencies;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-18 13:19:15 +00:00
|
|
|
postInstall = ''
|
|
|
|
make install-utils PREFIX=$bin
|
|
|
|
'';
|
|
|
|
|
|
|
|
outputs = [ "out" "bin" ];
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
makeFlags = kernel.makeFlags ++ [
|
2020-04-24 23:36:52 +00:00
|
|
|
"KERNELRELEASE=${kernel.modDirVersion}"
|
|
|
|
"KERNEL_DIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A kernel module to create V4L2 loopback devices";
|
|
|
|
homepage = "https://github.com/umlaeute/v4l2loopback";
|
2021-06-28 23:13:55 +00:00
|
|
|
license = licenses.gpl2Only;
|
2024-01-02 11:29:13 +00:00
|
|
|
maintainers = with maintainers; [ moni ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
2021-08-22 07:53:02 +00:00
|
|
|
outputsToInstall = [ "out" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|