diff options
author | David Robillard <d@drobilla.net> | 2010-10-04 18:21:08 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-10-04 18:21:08 +0000 |
commit | cef9811dac46a9d54dab0f0d82ce5c3ae032fc7c (patch) | |
tree | 632b911da25fc24b6b3d331d7ceffc22606b8e5b /wscript | |
parent | 61842745ab15454ee66be54a6f3bcc148a75406f (diff) | |
download | lv2-cef9811dac46a9d54dab0f0d82ce5c3ae032fc7c.tar.xz |
Initial import of lv2plug.in universe.
Diffstat (limited to 'wscript')
-rw-r--r-- | wscript | 93 |
1 files changed, 93 insertions, 0 deletions
@@ -0,0 +1,93 @@ +#!/usr/bin/env python +import autowaf + +# Version of this package (even if built as a child) +LV2EXT_VERSION = '0.0.0' + +# Variables for 'waf dist' +APPNAME = 'lv2ext' +VERSION = LV2EXT_VERSION + +# Mandatory variables +srcdir = '.' +blddir = 'build' + +def set_options(opt): + autowaf.set_options(opt) + opt.tool_options('compiler_cc') + opt.tool_options('compiler_cxx') + +def configure(conf): + autowaf.configure(conf) + conf.check_tool('compiler_cc') + conf.check_tool('compiler_cxx') + conf.env.append_value('CCFLAGS', '-std=c99') + pat = conf.env['shlib_PATTERN'] + ext = pat[pat.rfind('.'):] + conf.env.append_value('shlib_EXTENSION', ext) + +def build_plugin(bld, lang, name): + ext = bld.env['shlib_EXTENSION'][0] + + penv = bld.env.copy() + penv['shlib_PATTERN'] = '%s' + ext + + # Library + ext = 'c' + if lang != 'cc': + ext = 'cpp' + + obj = bld.new_task_gen(lang, 'shlib') + obj.env = penv + obj.source = [ 'plugins/%s.lv2/%s.%s' % (name, name, ext) ] + obj.includes = ['.', './ext'] + obj.name = name + obj.target = name + obj.install_path = '${LV2DIR}/' + name + '.lv2' + + if lang == 'cxx': + obj.source += [ 'ext/lv2plugin.cpp' ] + + # Data + data_file = 'plugins/%s.lv2/%s.ttl' % (name, name) + manifest_file = 'plugins/%s.lv2/manifest.ttl' % (name) + bld.install_files('${LV2DIR}/' + name + '.lv2', data_file) + bld.install_files('${LV2DIR}/' + name + '.lv2', manifest_file) + +def build_extension(bld, name, dir): + data_file = '%s/%s.lv2/%s.ttl' % (dir, name, name) + manifest_file = '%s/%s.lv2/manifest.ttl' % (dir, name) + bld.install_files('${LV2DIR}/' + name + '.lv2', data_file) + bld.install_files('${LV2DIR}/' + name + '.lv2', manifest_file) + +def build(bld): + ext = ''' + atom + atom-port + command + contexts + data-access + dyn-manifest + event + host-info + instance-access + midi + osc + parameter + polymorphic-port + port-groups + presets + string-port + uri-map + variables + ''' + for e in ext.split(): + build_extension(bld, e, './ext') + + extensions = ''' + ui + units + ''' + for e in extensions.split(): + build_extension(bld, e, './extensions') + |