2021-12-04 20:17:00 +01:00
|
|
|
{ stdenv, lib, fetchFromGitHub, python3, kernel, kmod }:
|
2021-03-12 20:54:40 +01:00
|
|
|
let
|
2021-10-01 18:32:01 +02:00
|
|
|
py = python3.withPackages (p: [ p.ConfigArgParse p.pyroute2 p.dbus-python ]);
|
2021-03-12 20:54:40 +01:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "xmm7360-pci-${version}-${kernel.version}";
|
|
|
|
version = "1.0";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "xmm7360";
|
|
|
|
repo = "xmm7360-pci";
|
2021-10-01 18:32:01 +02:00
|
|
|
rev = "b28714b6fb73887ecd5c0c25ffc0613d6eab6533";
|
|
|
|
sha256 = "1f1r3cnnjaxdxig56a9v4wfjq1r2z1wg8lq59klxxnybydk91m60";
|
2021-03-12 20:54:40 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#sourceRoot = "source/linux/v4l2loopback";
|
|
|
|
|
|
|
|
buildTargets = "default";
|
|
|
|
hardeningDisable = [ "pic" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = kernel.moduleBuildDependencies;
|
|
|
|
buildInputs = [ kmod ];
|
|
|
|
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"KVERSION=${kernel.modDirVersion}"
|
|
|
|
"KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
|
|
|
"INSTALL_MOD_PATH=$(out)"
|
|
|
|
];
|
2021-10-01 18:32:01 +02:00
|
|
|
installFlags = [ "DEPMOD=true" ];
|
2021-03-12 20:54:40 +01:00
|
|
|
postInstall = ''
|
|
|
|
install -d $out/lib/xmm7360/
|
|
|
|
cp -r rpc/ $out/lib/xmm7360/
|
|
|
|
cat > open_xdatachannel <<EOF
|
|
|
|
cd $out/lib/xmm7360
|
2021-10-01 18:32:01 +02:00
|
|
|
exec ${py}/bin/python3 rpc/open_xdatachannel.py "\$@"
|
2021-03-12 20:54:40 +01:00
|
|
|
EOF
|
|
|
|
install -D open_xdatachannel $out/bin/open_xdatachannel
|
|
|
|
'';
|
|
|
|
|
2021-12-04 20:17:00 +01:00
|
|
|
meta = with lib; {
|
2021-03-12 20:54:40 +01:00
|
|
|
description = "A kernel module to create V4L2 loopback devices";
|
|
|
|
homepage = "https://github.com/aramg/droidcam";
|
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = [ maintainers.makefu ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|