ma pkgs.droidcam: init software + kernel module
This commit is contained in:
parent
a1ab1cde34
commit
c743b9e53c
7
makefu/2configs/hw/droidcam.nix
Normal file
7
makefu/2configs/hw/droidcam.nix
Normal file
@ -0,0 +1,7 @@
|
||||
{ pkgs, config, ... }:
|
||||
{
|
||||
boot.extraModprobeConfig = "options v4l2loopback_dc width=640 height=480";
|
||||
boot.extraModulePackages = [
|
||||
(pkgs.callPackage ../../5pkgs/v4l2loopback-dc { kernel = config.boot.kernelPackages.kernel; })
|
||||
];
|
||||
}
|
55
makefu/5pkgs/droidcam/default.nix
Normal file
55
makefu/5pkgs/droidcam/default.nix
Normal file
@ -0,0 +1,55 @@
|
||||
{ stdenv, fetchFromGitHub
|
||||
, pkg-config
|
||||
, alsaLib
|
||||
, libjpeg_turbo
|
||||
, ffmpeg
|
||||
, libusbmuxd
|
||||
, speex
|
||||
, gtk3
|
||||
, libappindicator-gtk3
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "droidcam";
|
||||
version = "1.6";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "aramg";
|
||||
repo = "droidcam";
|
||||
rev = "v${version}";
|
||||
sha256 = "1d9qpnmqa3pfwsrpjnxdz76ipk4w37bbxyrazchh4vslnfc886fx";
|
||||
};
|
||||
|
||||
sourceRoot = "source/linux";
|
||||
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
buildInputs = [
|
||||
alsaLib
|
||||
libjpeg_turbo
|
||||
ffmpeg
|
||||
libusbmuxd
|
||||
speex
|
||||
gtk3
|
||||
libappindicator-gtk3
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
make JPEG_DIR="" JPEG_INCLUDE="" JPEG_LIB="" JPEG="$(pkg-config --libs --cflags libturbojpeg)"
|
||||
'';
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
install -Dm755 "droidcam" "$out/bin/droidcam"
|
||||
install -Dm755 "droidcam-cli" "$out/bin/droidcam-cli"
|
||||
install -Dm644 icon2.png "$out/share/pixmaps/droidcam.png"
|
||||
install -Dm644 README.md "$out/share/licenses/droidcam/LICENSE"
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "A kernel module to create V4L2 loopback devices";
|
||||
homepage = "https://github.com/aramg/droidcam";
|
||||
license = licenses.gpl2;
|
||||
maintainers = [ maintainers.makefu ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
36
makefu/5pkgs/v4l2loopback-dc/default.nix
Normal file
36
makefu/5pkgs/v4l2loopback-dc/default.nix
Normal file
@ -0,0 +1,36 @@
|
||||
{ stdenv, fetchFromGitHub, kernel, kmod }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "v4l2loopback-dc-${version}-${kernel.version}";
|
||||
version = "1.6";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "aramg";
|
||||
repo = "droidcam";
|
||||
rev = "v${version}";
|
||||
sha256 = "1d9qpnmqa3pfwsrpjnxdz76ipk4w37bbxyrazchh4vslnfc886fx";
|
||||
};
|
||||
|
||||
sourceRoot = "source/linux/v4l2loopback";
|
||||
|
||||
buildTargets = "v4l2loopback-dc";
|
||||
hardeningDisable = [ "pic" ];
|
||||
|
||||
nativeBuildInputs = kernel.moduleBuildDependencies;
|
||||
buildInputs = [ kmod ];
|
||||
|
||||
|
||||
makeFlags = [
|
||||
"KERNELRELEASE=${kernel.modDirVersion}"
|
||||
"KERNEL_DIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
||||
"INSTALL_MOD_PATH=$(out)"
|
||||
];
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "A kernel module to create V4L2 loopback devices";
|
||||
homepage = "https://github.com/aramg/droidcam";
|
||||
license = licenses.gpl2;
|
||||
maintainers = [ maintainers.makefu ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user