3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #201295 from ulrikstrid/ulrikstrid--obs-droidcam-init

This commit is contained in:
Sandro 2023-01-05 11:51:37 +01:00 committed by GitHub
commit 76e9319d82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 72 additions and 0 deletions

View file

@ -6,6 +6,8 @@
# - Add plugin to it's own directory (because of future patches).
{
droidcam-obs = callPackage ./droidcam-obs { };
input-overlay = qt6Packages.callPackage ./input-overlay.nix { };
looking-glass-obs = callPackage ./looking-glass-obs.nix { };

View file

@ -0,0 +1,70 @@
{ lib
, stdenv
, fetchFromGitHub
, obs-studio
, ffmpeg
, libjpeg
, libimobiledevice
, libusbmuxd
, libplist
}:
stdenv.mkDerivation rec {
pname = "droidcam-obs";
version = "2.0.1";
src = fetchFromGitHub {
owner = "dev47apps";
repo = "droidcam-obs-plugin";
rev = version;
sha256 = "sha256-oaw/mq4WCQMlf3sv9WtNlv9J9rm79xnqDwKzHtyFW50=";
};
postPatch = ''
substituteInPlace ./linux/linux.mk \
--replace "-limobiledevice" "-limobiledevice-1.0" \
--replace "-I/usr/include/obs" "-I${obs-studio}/include/obs" \
--replace "-I/usr/include/ffmpeg" "-I${ffmpeg}/include"
'';
preBuild = ''
mkdir ./build
'';
buildInputs = [
libjpeg
libimobiledevice
libusbmuxd
libplist
obs-studio
ffmpeg
];
makeFlags = [
"ALLOW_STATIC=no"
"JPEG_DIR=${lib.getDev libjpeg}"
"JPEG_LIB=${lib.getLib libjpeg}/lib"
"IMOBILEDEV_DIR=${libimobiledevice}"
];
installPhase = ''
runHook preInstall
mkdir -p $out/share/obs/obs-plugins/droidcam-obs
mkdir -p $out/lib/obs-plugins
cp build/droidcam-obs.so $out/lib/obs-plugins
cp -R ./data/locale $out/share/obs/obs-plugins/droidcam-obs/locale
runHook postInstall
'';
doCheck = false;
meta = with lib; {
description = "DroidCam OBS";
homepage = "https://github.com/dev47apps/droidcam-obs-plugin";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ ulrikstrid ];
platforms = platforms.linux;
};
}