aboutsummaryrefslogtreecommitdiffstats
path: root/waflib/extras/lv2.py
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-03-17 17:31:04 +0100
committerDavid Robillard <d@drobilla.net>2019-03-17 18:14:27 +0100
commit8c3d48d190cb73d73891ed704c84707d16c27272 (patch)
tree89b5dd3652f1f77dbfd6819023ee3843fcea8283 /waflib/extras/lv2.py
parent914c4143592af494d70549ee614b578ab681450c (diff)
parent1c6fb2b3543d1229eadaa2af007383fbcf82289d (diff)
downloadserd-8c3d48d190cb73d73891ed704c84707d16c27272.tar.gz
serd-8c3d48d190cb73d73891ed704c84707d16c27272.tar.bz2
serd-8c3d48d190cb73d73891ed704c84707d16c27272.zip
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 815987fc..ffcb2e77 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)