2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, kernel, kmod }:
|
2014-03-31 18:02:25 +00:00
|
|
|
|
2023-12-07 11:44:50 +00:00
|
|
|
stdenv.mkDerivation {
|
2021-06-06 04:59:18 +00:00
|
|
|
pname = "v4l2loopback";
|
2023-12-07 11:44:50 +00:00
|
|
|
version = "unstable-2023-11-23-${kernel.version}";
|
2014-03-31 18:02:25 +00:00
|
|
|
|
2018-03-28 20:12:32 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "umlaeute";
|
|
|
|
repo = "v4l2loopback";
|
2023-12-07 11:44:50 +00:00
|
|
|
rev = "850a2e36849f6ad3c9bf74f2ae3f603452bd8a71";
|
|
|
|
hash = "sha256-LqP5R3oKbjUQUfDZUWpkrmyopWhOt4wlgSgGywTPJXM=";
|
2014-03-31 18:02:25 +00:00
|
|
|
};
|
2016-02-07 22:43:01 +00:00
|
|
|
|
2016-02-26 17:38:15 +00:00
|
|
|
hardeningDisable = [ "format" "pic" ];
|
2016-02-07 22:43:01 +00:00
|
|
|
|
2014-03-31 18:02:25 +00:00
|
|
|
preBuild = ''
|
|
|
|
substituteInPlace Makefile --replace "modules_install" "INSTALL_MOD_PATH=$out modules_install"
|
|
|
|
sed -i '/depmod/d' Makefile
|
|
|
|
'';
|
2014-12-10 11:23:11 +00:00
|
|
|
|
2022-02-10 02:46:46 +00:00
|
|
|
nativeBuildInputs = [ kmod ] ++ kernel.moduleBuildDependencies;
|
2016-02-07 22:43:01 +00:00
|
|
|
|
2021-08-16 11:33:38 +00:00
|
|
|
postInstall = ''
|
|
|
|
make install-utils PREFIX=$bin
|
|
|
|
'';
|
|
|
|
|
|
|
|
outputs = [ "out" "bin" ];
|
|
|
|
|
2022-02-10 02:46:46 +00:00
|
|
|
makeFlags = kernel.makeFlags ++ [
|
2014-03-31 18:02:25 +00:00
|
|
|
"KERNELRELEASE=${kernel.modDirVersion}"
|
|
|
|
"KERNEL_DIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
|
|
|
];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2014-04-02 10:40:52 +00:00
|
|
|
description = "A kernel module to create V4L2 loopback devices";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/umlaeute/v4l2loopback";
|
2021-06-06 04:59:18 +00:00
|
|
|
license = licenses.gpl2Only;
|
2023-11-17 10:03:27 +00:00
|
|
|
maintainers = with maintainers; [ moni ];
|
2014-03-31 18:02:25 +00:00
|
|
|
platforms = platforms.linux;
|
2021-08-19 15:23:39 +00:00
|
|
|
outputsToInstall = [ "out" ];
|
2014-03-31 18:02:25 +00:00
|
|
|
};
|
|
|
|
}
|