diff options
author | David Robillard <d@drobilla.net> | 2019-03-17 18:19:41 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-03-17 18:22:35 +0100 |
commit | e552da4b126600039339751343e9da6349972c1d (patch) | |
tree | 9945784581c196c6d95fd059a0df44dddf630649 /waflib/extras/lv2.py | |
parent | ebd7013d42a1deec8f4cd10cae94e38d8e7cd424 (diff) | |
parent | e8b536a79e87e46ac662230ff7370d2162c837ae (diff) | |
download | drobillad-e552da4b126600039339751343e9da6349972c1d.tar.gz drobillad-e552da4b126600039339751343e9da6349972c1d.tar.bz2 drobillad-e552da4b126600039339751343e9da6349972c1d.zip |
Update autowaf and adapt to new API
Diffstat (limited to 'waflib/extras/lv2.py')
-rw-r--r-- | waflib/extras/lv2.py | 32 |
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) |