summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2017-12-18 14:42:21 -0500
committerNicolas Dufresne <nicolas.dufresne@collabora.com>2017-12-18 14:51:12 -0500
commitfbd9a62504d67f190bf90c4850fde5771fe2d3b9 (patch)
tree5b8a35e0c05e1654e3938138abbff6125c0d6128
parent8c850b34659b759af43131ffe5979a89dd5e8647 (diff)
lv2: Try and reflect better lilv default path
While keeping it simple, this patch tries and mimic lilv default path. It does not matter if some path are duplicated due to symlink because in the end it's lilv that will walk these paths. The worst case is that we update our cache more often then strictly needed. https://bugzilla.gnome.org/show_bug.cgi?id=791717
-rw-r--r--ext/lv2/gstlv2.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/ext/lv2/gstlv2.c b/ext/lv2/gstlv2.c
index 181f3ca5f..705c4d404 100644
--- a/ext/lv2/gstlv2.c
+++ b/ext/lv2/gstlv2.c
@@ -50,10 +50,24 @@
GST_DEBUG_CATEGORY (lv2_debug);
#define GST_CAT_DEFAULT lv2_debug
+#if defined (G_OS_WIN32)
+#define GST_LV2_ENVVARS "APPDATA/LV2:COMMONPROGRAMFILES/LV2"
+#define GST_LV2_DEFAULT_PATH NULL
+#elif defined (HAVE_OSX)
+#define GST_LV2_ENVVARS "HOME/Library/Audio/Plug-Ins/LV2:HOME/.lv2"
#define GST_LV2_DEFAULT_PATH \
- "/usr/lib/lv2" G_SEARCHPATH_SEPARATOR_S \
- "/usr/local/lib/lv2" G_SEARCHPATH_SEPARATOR_S \
+ "/usr/local/lib/lv2:/usr/lib/lv2:/Library/Audio/Plug-Ins/LV2"
+#elif defined (G_OS_UNIX)
+#define GST_LV2_ENVVARS "HOME/.lv2"
+#define GST_LV2_DEFAULT_PATH \
+ "/usr/lib/lv2:" \
+ "/usr/lib64/lv2:" \
+ "/usr/local/lib/lv2:" \
+ "/usr/local/lib64/lv2:" \
LIBDIR "/lv2"
+#else
+#error "Unsupported OS"
+#endif
GstStructure *lv2_meta_all = NULL;
@@ -255,7 +269,7 @@ plugin_init (GstPlugin * plugin)
side_right_role = lilv_new_uri (world, LV2_PORT_GROUPS__sideRight);
gst_plugin_add_dependency_simple (plugin,
- "LV2_PATH", GST_LV2_DEFAULT_PATH, NULL,
+ "LV2_PATH:" GST_LV2_ENVVARS, GST_LV2_DEFAULT_PATH, NULL,
GST_PLUGIN_DEPENDENCY_FLAG_RECURSE);
/* ensure GstAudioChannelPosition type is registered */