obs-studio-plugins.obs-ndi: Fix build (#281763)

* Update patch

* remove postInstall and add build flags
This commit is contained in:
Pablo Ovelleiro Corral 2024-01-18 15:31:00 +01:00 committed by GitHub
parent 8eb78b1787
commit 2e7515d1d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 19 additions and 27 deletions

View File

@ -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;

View File

@ -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));