depot/third_party/nixpkgs/pkgs/applications/video/obs-studio/Provide-runtime-plugin-destination-as-relative-path.patch

27 lines
1,013 B
Diff
Raw Normal View History

diff --git a/libobs/CMakeLists.txt b/libobs/CMakeLists.txt
index 790583cd5..763cf3548 100644
--- a/libobs/CMakeLists.txt
+++ b/libobs/CMakeLists.txt
@@ -455,6 +455,8 @@ elseif(OS_POSIX)
libobs PROPERTIES BUILD_RPATH "$<TARGET_FILE_DIR:OBS::libobs-opengl>")
endif()
+string(REGEX REPLACE "^${OBS_INSTALL_PREFIX}" "" OBS_PLUGIN_DESTINATION_RELATIVE ${OBS_PLUGIN_DESTINATION})
+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/obsconfig.h.in
${CMAKE_BINARY_DIR}/config/obsconfig.h)
diff --git a/libobs/obsconfig.h.in b/libobs/obsconfig.h.in
index 4a664285a..5cff2ca53 100644
--- a/libobs/obsconfig.h.in
+++ b/libobs/obsconfig.h.in
@@ -13,7 +13,7 @@
#define OBS_VERSION_CANONICAL "@OBS_VERSION_CANONICAL@"
#define OBS_DATA_PATH "@OBS_DATA_PATH@"
#define OBS_INSTALL_PREFIX "@OBS_INSTALL_PREFIX@"
-#define OBS_PLUGIN_DESTINATION "@OBS_PLUGIN_DESTINATION@"
+#define OBS_PLUGIN_DESTINATION "@OBS_PLUGIN_DESTINATION_RELATIVE@"
#define OBS_QT_VERSION @_QT_VERSION@
#cmakedefine LINUX_PORTABLE