瀏覽代碼

libobs/nix: List Flatpak search paths

The proposed way to handle plugin distribution
through Flatpak depends on these directories to
be read. It goes as follows:

 1. Flatpak's extension point merges the 'lib'
    and 'share' directories at /app/plugin

 2. Plugins prefix their install paths in the
    Flatpak manifest to /app/plugins/<plugin name>

 3. OBS Studio lists /app/plugin as one of the
    search paths in OBS Studio code

This commit implements the third step of this
process, which is the only one that actually
involves OBS Studio itself.

With that, it is possible to distribute plugins
as Flatpak extensions, which in turn allows them
to be listed at app stores such as GNOME Software,
elementary's app store, and KDE's Discover.

Related: https://github.com/flathub/com.obsproject.Studio/issues/135
Georges Basile Stavracas Neto 4 年之前
父節點
當前提交
712478f48c
共有 1 個文件被更改,包括 8 次插入3 次删除
  1. 8 3
      libobs/obs-nix.c

+ 8 - 3
libobs/obs-nix.c

@@ -51,13 +51,18 @@ const char *get_module_extension(void)
 #define BIT_STRING "32bit"
 #endif
 
-static const char *module_bin[] = {"../../obs-plugins/" BIT_STRING,
-				   OBS_INSTALL_PREFIX
-				   "/" OBS_PLUGIN_DESTINATION};
+#define FLATPAK_PLUGIN_PATH "/app/plugins"
+
+static const char *module_bin[] = {
+	"../../obs-plugins/" BIT_STRING,
+	OBS_INSTALL_PREFIX "/" OBS_PLUGIN_DESTINATION,
+	FLATPAK_PLUGIN_PATH "/" OBS_PLUGIN_DESTINATION,
+};
 
 static const char *module_data[] = {
 	OBS_DATA_PATH "/obs-plugins/%module%",
 	OBS_INSTALL_DATA_PATH "/obs-plugins/%module%",
+	FLATPAK_PLUGIN_PATH "/share/obs/obs-plugins/%module%",
 };
 
 static const int module_patterns_size =