From fbd9a62504d67f190bf90c4850fde5771fe2d3b9 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Mon, 18 Dec 2017 14:42:21 -0500 Subject: [PATCH] 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 --- ext/lv2/gstlv2.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/ext/lv2/gstlv2.c b/ext/lv2/gstlv2.c index 181f3ca5f6..705c4d404a 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 */