ci: Update pinned Nixpkgs (#376039)
[NixPkgs.git] / pkgs / applications / video / obs-studio / plugins / droidcam-obs / default.nix
blobc6f704d08d766ff7e3a694ce0ebaaf4eed0dcd51
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   obs-studio,
6   ffmpeg,
7   libjpeg,
8   libimobiledevice,
9   libusbmuxd,
10   libplist,
13 stdenv.mkDerivation rec {
14   pname = "droidcam-obs";
15   version = "2.0.2";
17   src = fetchFromGitHub {
18     owner = "dev47apps";
19     repo = "droidcam-obs-plugin";
20     rev = version;
21     sha256 = "sha256-YtfWwgBhyQYx6QfrKld7p6qUf8BEV/kkQX4QcdHuaYU=";
22   };
24   postPatch = ''
25     substituteInPlace ./linux/linux.mk \
26       --replace "-limobiledevice" "-limobiledevice-1.0" \
27       --replace "-I/usr/include/obs" "-I${obs-studio}/include/obs" \
28       --replace "-I/usr/include/ffmpeg" "-I${ffmpeg}/include"
29   '';
31   preBuild = ''
32     mkdir ./build
33   '';
35   buildInputs = [
36     libjpeg
37     libimobiledevice
38     libusbmuxd
39     libplist
40     obs-studio
41     ffmpeg
42   ];
44   makeFlags = [
45     "ALLOW_STATIC=no"
46     "JPEG_DIR=${lib.getDev libjpeg}"
47     "JPEG_LIB=${lib.getLib libjpeg}/lib"
48     "IMOBILEDEV_DIR=${libimobiledevice}"
49   ];
51   installPhase = ''
52     runHook preInstall
54     mkdir -p $out/share/obs/obs-plugins/droidcam-obs
55     mkdir -p $out/lib/obs-plugins
56     cp build/droidcam-obs.so $out/lib/obs-plugins
57     cp -R ./data/locale $out/share/obs/obs-plugins/droidcam-obs/locale
59     runHook postInstall
60   '';
62   doCheck = false;
64   meta = with lib; {
65     description = "DroidCam OBS";
66     homepage = "https://github.com/dev47apps/droidcam-obs-plugin";
67     license = licenses.gpl2Plus;
68     maintainers = with maintainers; [ ulrikstrid ];
69     platforms = platforms.linux;
70   };