2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, kernel, kmod }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-06-28 23:13:55 +00:00
|
|
|
pname = "v4l2loopback";
|
|
|
|
version = "unstable-2020-04-22-${kernel.version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "umlaeute";
|
|
|
|
repo = "v4l2loopback";
|
2021-06-28 23:13:55 +00:00
|
|
|
rev = "d26e624b4ead762d34152f9f825b3a51fb92fb9c";
|
|
|
|
sha256 = "sha256-OA45vmuVieoL7J83D3TD5qi3SBsiqi0kiQn4i1K6dVE=";
|
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
|
|
|
|
export PATH=${kmod}/sbin:$PATH
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = kernel.moduleBuildDependencies;
|
2021-06-28 23:13:55 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ kmod ];
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"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;
|
|
|
|
maintainers = with maintainers; [ fortuneteller2k ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|