1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 obs-studio,
6 cmake,
7 qtbase,
8 ndi,
9 curl,
10}:
11
12stdenv.mkDerivation rec {
13 pname = "obs-ndi";
14 version = "4.14.1";
15
16 nativeBuildInputs = [
17 cmake
18 qtbase
19 ];
20 buildInputs = [
21 obs-studio
22 qtbase
23 ndi
24 curl
25 ];
26
27 src = fetchFromGitHub {
28 owner = "Palakis";
29 repo = "obs-ndi";
30 rev = version;
31 sha256 = "sha256-ex/fZmZpFM6GTKNBQClzSf6Ns0Yts5+0PAmf5mIQCwc=";
32 };
33
34 patches = [
35 ./hardcode-ndi-path.patch
36 ];
37
38 postPatch = ''
39 # Add path (variable added in hardcode-ndi-path.patch
40 sed -i -e s,@NDI@,${ndi},g src/plugin-main.cpp
41
42 # Replace bundled NDI SDK with the upstream version
43 # (This fixes soname issues)
44 rm -rf lib/ndi
45 ln -s ${ndi}/include lib/ndi
46 '';
47
48 cmakeFlags = [ "-DENABLE_QT=ON" ];
49
50 env.NIX_CFLAGS_COMPILE = "-Wno-deprecated-declarations";
51
52 dontWrapQtApps = true;
53
54 meta = with lib; {
55 description = "Network A/V plugin for OBS Studio";
56 homepage = "https://github.com/Palakis/obs-ndi";
57 license = licenses.gpl2;
58 maintainers = with maintainers; [ jshcmpbll ];
59 platforms = platforms.linux;
60 hydraPlatforms = ndi.meta.hydraPlatforms;
61 };
62}