aboutsummaryrefslogtreecommitdiffstats
path: root/waflib/extras/lv2.py
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-03-17 18:43:09 +0100
committerDavid Robillard <d@drobilla.net>2019-03-17 19:02:31 +0100
commitca9f746af500be98f7c65b7f1bd0f50ad936a8b6 (patch)
tree789465df66ea327e642c3e80d690ed7e4a38b1a6 /waflib/extras/lv2.py
parenta7860f7e495583f536480a7cce2b6e0c55926f3a (diff)
parentb2ca9626b290e8ab5bfa6269dfc7afe64a012ce1 (diff)
downloadlv2-ca9f746af500be98f7c65b7f1bd0f50ad936a8b6.tar.xz
Update autowaf and adapt to new API
Diffstat (limited to 'waflib/extras/lv2.py')
-rw-r--r--waflib/extras/lv2.py32
1 files changed, 30 insertions, 2 deletions
diff --git a/waflib/extras/lv2.py b/waflib/extras/lv2.py
index 815987f..ffcb2e7 100644
--- a/waflib/extras/lv2.py
+++ b/waflib/extras/lv2.py
@@ -10,6 +10,33 @@ def options(opt):
help='install LV2 bundles to user location')
conf_opts.add_option('--lv2dir', type='string',
help='LV2 bundles [Default: LIBDIR/lv2]')
+
+def register_lv2_path(conf, path):
+ """Return the default LV2_PATH to use for this system"""
+ if 'LV2_PATH' not in conf.run_env and 'LV2_PATH' not in os.environ:
+ conf.run_env['LV2_PATH'] = [conf.env['LV2DIR']]
+
+ conf.run_env.append_unique('LV2_PATH', path)
+
+def default_lv2_path(conf):
+ """Return the default LV2_PATH for the build target as a list"""
+ if conf.env.DEST_OS == 'darwin':
+ return ['~/Library/Audio/Plug-Ins/LV2',
+ '~/.lv2',
+ '/usr/local/lib/lv2',
+ '/usr/lib/lv2',
+ '/Library/Audio/Plug-Ins/LV2']
+ elif conf.env.DEST_OS == 'haiku':
+ return ['~/.lv2',
+ '/boot/common/add-ons/lv2']
+ elif conf.env.DEST_OS == 'win32':
+ return ['%APPDATA%\\\\LV2',
+ '%COMMONPROGRAMFILES%\\\\LV2']
+ else:
+ libdirname = os.path.basename(conf.env.LIBDIR)
+ return ['~/.lv2',
+ '/usr/%s/lv2' % libdirname,
+ '/usr/local/%s/lv2' % libdirname]
def configure(conf):
def env_path(parent_dir_var, name):
@@ -43,5 +70,6 @@ def configure(conf):
else:
conf.env['LV2DIR'] = os.path.join(conf.env['LIBDIR'], 'lv2')
- conf.env['LV2DIR'] = normpath(conf.env['LV2DIR'])
-
+ # Add default LV2_PATH to runtime environment for tests that use plugins
+ if 'LV2_PATH' not in os.environ:
+ conf.run_env['LV2_PATH'] = default_lv2_path(conf)