depot/third_party/nixpkgs/pkgs/os-specific/linux/v4l2loopback/default.nix
Default email b6f2ab0a42 Project import generated by Copybara.
GitOrigin-RevId: 253aecf69ed7595aaefabde779aa6449195bebb7
2021-08-18 15:19:15 +02:00

44 lines
1.2 KiB
Nix

{ lib, stdenv, fetchFromGitHub, kernel, kmod }:
stdenv.mkDerivation rec {
pname = "v4l2loopback";
version = "unstable-2021-07-13-${kernel.version}";
src = fetchFromGitHub {
owner = "umlaeute";
repo = "v4l2loopback";
rev = "baf9de279afc7a7c7513e9c40a0c9ff88f456af4";
sha256 = "sha256-uglYTeqz81fgkKYYU9Cw8x9+S088jGxDEGkb3rmkhrw==";
};
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;
buildInputs = [ kmod ];
postInstall = ''
make install-utils PREFIX=$bin
'';
outputs = [ "out" "bin" ];
makeFlags = [
"KERNELRELEASE=${kernel.modDirVersion}"
"KERNEL_DIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
];
meta = with lib; {
description = "A kernel module to create V4L2 loopback devices";
homepage = "https://github.com/umlaeute/v4l2loopback";
license = licenses.gpl2Only;
maintainers = with maintainers; [ fortuneteller2k ];
platforms = platforms.linux;
};
}