diff options
author | Pablo Ovelleiro Corral <mail@pablo.tools> | 2024-01-18 15:31:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-18 15:31:00 +0100 |
commit | 2e7515d1d58c85ec2fde37d7d0650e8844ba0816 (patch) | |
tree | db0644e5b3fe53fd2210a918600867d2347deba3 /pkgs/applications/video | |
parent | 8eb78b17874fc9b75cb448fb53b2cb3205ad7426 (diff) |
obs-studio-plugins.obs-ndi: Fix build (#281763)
* Update patch * remove postInstall and add build flags
Diffstat (limited to 'pkgs/applications/video')
-rw-r--r-- | pkgs/applications/video/obs-studio/plugins/obs-ndi/default.nix | 15 | ||||
-rw-r--r-- | pkgs/applications/video/obs-studio/plugins/obs-ndi/hardcode-ndi-path.patch | 31 |
2 files changed, 19 insertions, 27 deletions
diff --git a/pkgs/applications/video/obs-studio/plugins/obs-ndi/default.nix b/pkgs/applications/video/obs-studio/plugins/obs-ndi/default.nix index 2b1349aad0c3c..037eda100611f 100644 --- a/pkgs/applications/video/obs-studio/plugins/obs-ndi/default.nix +++ b/pkgs/applications/video/obs-studio/plugins/obs-ndi/default.nix @@ -4,13 +4,13 @@ stdenv.mkDerivation rec { pname = "obs-ndi"; version = "4.13.0"; - nativeBuildInputs = [ cmake ]; + nativeBuildInputs = [ cmake qtbase ]; buildInputs = [ obs-studio qtbase ndi ]; src = fetchFromGitHub { owner = "Palakis"; repo = "obs-ndi"; - rev = "dummy-tag-${version}"; + rev = version; sha256 = "sha256-ugAMSTXbbIZ61oWvoggVJ5kZEgp/waEcWt89AISrSdE="; }; @@ -19,8 +19,8 @@ stdenv.mkDerivation rec { ]; postPatch = '' - # Add path (variable added in hardcode-ndi-path.patch) - sed -i -e s,@NDI@,${ndi},g src/obs-ndi.cpp + # Add path (variable added in hardcode-ndi-path.patch + sed -i -e s,@NDI@,${ndi},g src/plugin-main.cpp # Replace bundled NDI SDK with the upstream version # (This fixes soname issues) @@ -28,12 +28,7 @@ stdenv.mkDerivation rec { ln -s ${ndi}/include lib/ndi ''; - postInstall = '' - mkdir $out/lib $out/share - mv $out/obs-plugins/64bit $out/lib/obs-plugins - rm -rf $out/obs-plugins - mv $out/data $out/share/obs - ''; + cmakeFlags = [ "-DENABLE_QT=ON" ]; dontWrapQtApps = true; diff --git a/pkgs/applications/video/obs-studio/plugins/obs-ndi/hardcode-ndi-path.patch b/pkgs/applications/video/obs-studio/plugins/obs-ndi/hardcode-ndi-path.patch index 03b54473bb8ba..b675c10a03466 100644 --- a/pkgs/applications/video/obs-studio/plugins/obs-ndi/hardcode-ndi-path.patch +++ b/pkgs/applications/video/obs-studio/plugins/obs-ndi/hardcode-ndi-path.patch @@ -1,19 +1,16 @@ -diff --git a/src/obs-ndi.cpp b/src/obs-ndi.cpp -index 1a8aeb3..9a36ea9 100644 ---- a/src/obs-ndi.cpp -+++ b/src/obs-ndi.cpp -@@ -132,13 +132,7 @@ const NDIlib_v5 *load_ndilib() - const char *redistFolder = std::getenv(NDILIB_REDIST_FOLDER); - if (redistFolder) - libraryLocations.push_back(redistFolder); +diff --git a/src/plugin-main.cpp b/src/plugin-main.cpp +index 0d94add..617af73 100644 +--- a/src/plugin-main.cpp ++++ b/src/plugin-main.cpp +@@ -244,10 +244,7 @@ const NDIlib_v4 *load_ndilib() + if (!path.isEmpty()) { + locations << path; + } -#if defined(__linux__) || defined(__APPLE__) -- libraryLocations.push_back("/usr/lib"); -- libraryLocations.push_back("/usr/lib64"); -- libraryLocations.push_back("/usr/lib/x86_64-linux-gnu"); -- libraryLocations.push_back("/usr/local/lib"); -- libraryLocations.push_back("/usr/local/lib64"); +- locations << "/usr/lib"; +- locations << "/usr/local/lib"; -#endif -+ libraryLocations.push_back("@NDI@/lib"); - - for (std::string path : libraryLocations) { - blog(LOG_DEBUG, "[load_ndilib] Trying library path: '%s'", path.c_str()); ++ locations << "@NDI@/lib"; + for (QString location : locations) { + path = QDir::cleanPath( + QDir(location).absoluteFilePath(NDILIB_LIBRARY_NAME)); |