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";
|
2022-11-02 22:02:43 +00:00
|
|
|
version = "unstable-2022-08-05-${kernel.version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "umlaeute";
|
|
|
|
repo = "v4l2loopback";
|
2022-11-02 22:02:43 +00:00
|
|
|
rev = "76434ab6f71d5ecbff8a218ff6bed91ea2bf73b8";
|
|
|
|
sha256 = "sha256-TdZacRkFAO2HAEbljzXeJ241VcDqSwBECq3bnn7yvBY=";
|
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;
|
|
|
|
maintainers = with maintainers; [ fortuneteller2k ];
|
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
|
|
|
};
|
|
|
|
}
|