1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 obs-studio,
6 cmake,
7 qtbase,
8 ndi-6,
9 curl,
10}:
11
12stdenv.mkDerivation rec {
13 pname = "distroav";
14 version = "6.1.1";
15
16 nativeBuildInputs = [
17 cmake
18 qtbase
19 ];
20
21 buildInputs = [
22 obs-studio
23 qtbase
24 ndi-6
25 curl
26 ];
27
28 src = fetchFromGitHub {
29 owner = "DistroAV";
30 repo = "DistroAV";
31 tag = version;
32 hash = "sha256-nbXh6bjpiKbvuntZSnuTWWpmhfAcep7Krjjq8FvbENk=";
33 };
34
35 # Modify plugin-main.cpp file to fix ndi libs path
36 patches = [ ./hardcode-ndi-path.patch ];
37
38 postPatch = ''
39 # Add path (variable added in hardcode-ndi-path.patch
40 substituteInPlace src/plugin-main.cpp --replace-fail "@NDI@" "${ndi-6}"
41
42 # Replace bundled NDI SDK with the upstream version
43 # (This fixes soname issues)
44 rm -rf lib/ndi
45 ln -s ${ndi-6}/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 = {
55 description = "Network A/V plugin for OBS Studio (formerly obs-ndi)";
56 homepage = "https://github.com/DistroAV/DistroAV";
57 license = with lib.licenses; [ gpl2 ];
58 maintainers = with lib.maintainers; [ globule655 ];
59 platforms = lib.platforms.linux;
60 };
61}