diff options
author | David Robillard <d@drobilla.net> | 2011-10-10 01:37:22 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-10-10 01:37:22 +0000 |
commit | 94f4cc1038ce747ae5deb4a25542bfe72335f197 (patch) | |
tree | ef57a1c7b8d4045c0387449fec6b0d13a79820c3 /wscript.template | |
parent | 6b9edd25849f0022c09014fb4cca49e29df74020 (diff) | |
download | lv2-94f4cc1038ce747ae5deb4a25542bfe72335f197.tar.xz |
Remove lv2config
Diffstat (limited to 'wscript.template')
-rw-r--r-- | wscript.template | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/wscript.template b/wscript.template index b2e5912..eba53b0 100644 --- a/wscript.template +++ b/wscript.template @@ -1,10 +1,12 @@ #!/usr/bin/env python +import os from waflib.extras import autowaf as autowaf import waflib.Logs as Logs +import waflib.Options as Options # Variables for 'waf dist' APPNAME = 'lv2-@NAME@' -VERSION = '@MINOR@.@MICRO@' +VERSION = '1.2' # Mandatory variables top = '.' @@ -12,22 +14,31 @@ out = 'build' def options(opt): autowaf.set_options(opt) + opt.add_option('--copy-headers', action='store_true', default=False, + dest='copy_headers', + help='Copy headers instead of linking to bundle') def configure(conf): autowaf.configure(conf) + conf.env['COPY_HEADERS'] = Options.options.copy_headers autowaf.display_msg(conf, "LV2 bundle directory", conf.env['LV2DIR']) print('') def build(bld): - bld.install_files('${LV2DIR}/@NAME@.lv2', - bld.path.ant_glob('*.*')) + uri = '@URI@' + include_base = os.path.dirname(uri[uri.find('://') + 3:]) + bundle_dir = os.path.join(bld.env['LV2DIR'], '@NAME@.lv2') + include_dir = os.path.join(bld.env['INCLUDEDIR'], 'lv2', include_base) - bld.add_post_fun(warn_lv2config) + # Install bundle + bld.install_files(bundle_dir, + bld.path.ant_glob('?*.*')) -def warn_lv2config(ctx): - if ctx.cmd == 'install': - Logs.warn(''' -* LV2 Extension Installed -* You need to run lv2config to update extension headers -''') + # Install URI-like includes + if bld.env['COPY_HEADERS']: + bld.install_files(os.path.join(include_dir, '@NAME@'), + bld.path.ant_glob('*.h')) + else: + bld.symlink_as(os.path.join(include_dir, '@NAME@'), + os.path.relpath(bundle_dir, include_dir)) |