summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--meson.build36
-rw-r--r--meson_options.txt3
-rw-r--r--src/lilv_config.h2
4 files changed, 42 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index ef6ca2f..de7d9ec 100644
--- a/NEWS
+++ b/NEWS
@@ -1,8 +1,9 @@
lilv (0.24.17) unstable; urgency=medium
* Allow programs to be used from subproject
+ * Fix default LV2_PATH
- -- David Robillard <d@drobilla.net> Tue, 09 Aug 2022 13:44:56 +0000
+ -- David Robillard <d@drobilla.net> Tue, 09 Aug 2022 13:46:15 +0000
lilv (0.24.16) stable; urgency=medium
diff --git a/meson.build b/meson.build
index b4ee8fa..da65b9a 100644
--- a/meson.build
+++ b/meson.build
@@ -46,6 +46,41 @@ elif host_machine.system() in ['gnu', 'linux']
]
endif
+default_lv2_path = get_option('default_lv2_path')
+if default_lv2_path == ''
+ if host_machine.system() == 'darwin'
+ lv2_dirs = [
+ '~/.lv2',
+ '~/Library/Audio/Plug-Ins/LV2',
+ '/usr/local/lib/lv2',
+ '/usr/lib/lv2',
+ '/Library/Audio/Plug-Ins/LV2',
+ ]
+
+ default_lv2_path = ':'.join(lv2_dirs)
+
+ elif host_machine.system() == 'haiku'
+ default_lv2_path = ':'.join(['~/.lv2', '/boot/common/add-ons/lv2'])
+
+ elif host_machine.system() == 'windows'
+ lv2_dirs = ['%%APPDATA%%\\\\LV2', '%%COMMONPROGRAMFILES%%\\\\LV2']
+ default_lv2_path = ';'.join(lv2_dirs)
+
+ else
+ lv2_dirs = [
+ '~' / '.lv2',
+ '/usr/local' / get_option('libdir') / 'lv2',
+ '/usr' / get_option('libdir') / 'lv2',
+ ]
+
+ default_lv2_path = ':'.join(lv2_dirs)
+ endif
+endif
+
+platform_defines += [
+ '-DLILV_DEFAULT_LV2_PATH="@0@"'.format(default_lv2_path)
+]
+
add_project_arguments(platform_defines, language: ['c'])
################
@@ -190,6 +225,7 @@ if not meson.is_subproject()
summary('Tools', not get_option('tools').disabled(), bool_yn: true)
summary('Install prefix', get_option('prefix'))
+ summary('Default LV2_PATH', default_lv2_path)
summary('Headers', get_option('prefix') / get_option('includedir'))
summary('Libraries', get_option('prefix') / get_option('libdir'))
diff --git a/meson_options.txt b/meson_options.txt
index 03a5a82..5154f17 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -15,3 +15,6 @@ option('title', type: 'string', value: 'Lilv',
option('tools', type: 'feature', value: 'auto', yield: true,
description: 'Build command line utilities')
+
+option('default_lv2_path', type: 'string', value: '', yield: true,
+ description: 'Default LV2_PATH to use if it is unset')
diff --git a/src/lilv_config.h b/src/lilv_config.h
index 08a2080..2a166c8 100644
--- a/src/lilv_config.h
+++ b/src/lilv_config.h
@@ -121,7 +121,7 @@
# ifdef _WIN32
# define LILV_DEFAULT_LV2_PATH "%APPDATA%\\LV2;%COMMONPROGRAMFILES%\\LV2"
# else
-# define LILV_DEFAULT_LV2_PATH "~/.lv2:/usr/lib/lv2:/usr/local/lib/lv2"
+# define LILV_DEFAULT_LV2_PATH "~/.lv2:/usr/local/lib/lv2:/usr/lib/lv2"
# endif
#endif