2021-01-10 23:54:33 -08:00
|
|
|
{ lib, stdenv, fetchFromGitHub, kernel, kmod }:
|
2014-03-31 11:02:25 -07:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-06-05 21:59:18 -07:00
|
|
|
pname = "v4l2loopback";
|
|
|
|
version = "unstable-2020-04-22-${kernel.version}";
|
2014-03-31 11:02:25 -07:00
|
|
|
|
2018-03-28 13:12:32 -07:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "umlaeute";
|
|
|
|
repo = "v4l2loopback";
|
2021-06-05 21:59:18 -07:00
|
|
|
rev = "d26e624b4ead762d34152f9f825b3a51fb92fb9c";
|
|
|
|
sha256 = "sha256-OA45vmuVieoL7J83D3TD5qi3SBsiqi0kiQn4i1K6dVE=";
|
2014-03-31 11:02:25 -07:00
|
|
|
};
|
2016-02-07 14:43:01 -08:00
|
|
|
|
2016-02-26 09:38:15 -08:00
|
|
|
hardeningDisable = [ "format" "pic" ];
|
2016-02-07 14:43:01 -08:00
|
|
|
|
2014-03-31 11:02:25 -07:00
|
|
|
preBuild = ''
|
|
|
|
substituteInPlace Makefile --replace "modules_install" "INSTALL_MOD_PATH=$out modules_install"
|
|
|
|
sed -i '/depmod/d' Makefile
|
|
|
|
export PATH=${kmod}/sbin:$PATH
|
|
|
|
'';
|
2014-12-10 03:23:11 -08:00
|
|
|
|
2018-01-19 05:30:10 -08:00
|
|
|
nativeBuildInputs = kernel.moduleBuildDependencies;
|
2021-06-05 21:59:18 -07:00
|
|
|
|
2014-03-31 11:02:25 -07:00
|
|
|
buildInputs = [ kmod ];
|
2016-02-07 14:43:01 -08:00
|
|
|
|
2014-03-31 11:02:25 -07:00
|
|
|
makeFlags = [
|
|
|
|
"KERNELRELEASE=${kernel.modDirVersion}"
|
|
|
|
"KERNEL_DIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
|
|
|
];
|
|
|
|
|
2021-01-10 23:54:33 -08:00
|
|
|
meta = with lib; {
|
2014-04-02 03:40:52 -07:00
|
|
|
description = "A kernel module to create V4L2 loopback devices";
|
2020-03-31 18:11:51 -07:00
|
|
|
homepage = "https://github.com/umlaeute/v4l2loopback";
|
2021-06-05 21:59:18 -07:00
|
|
|
license = licenses.gpl2Only;
|
|
|
|
maintainers = with maintainers; [ fortuneteller2k ];
|
2014-03-31 11:02:25 -07:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|