diff options
author | David Robillard <d@drobilla.net> | 2012-08-19 19:24:44 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-08-19 19:24:44 +0000 |
commit | 6a651aca0de7262e805ff8edb12cdc4692009997 (patch) | |
tree | f14451d008ea578c162df85d2e2605a227bf4bf6 /wscript | |
parent | 5de48cab1d561e6b37502fe823922b94d1489eda (diff) |
Move omins to plugins directory.
git-svn-id: http://svn.drobilla.net/lad/trunk/plugins/omins.lv2@4725 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'wscript')
-rw-r--r-- | wscript | 104 |
1 files changed, 104 insertions, 0 deletions
@@ -0,0 +1,104 @@ +#!/usr/bin/env python +import os +import shutil +import subprocess +from waflib.extras import autowaf as autowaf + +# Version of this package (even if built as a child) +OMINS_VERSION = '0.0.0' + +# Variables for 'waf dist' +APPNAME = 'omins.lv2' +VERSION = OMINS_VERSION + +# Mandatory variables +top = '.' +out = 'build' + +def options(opt): + opt.load('compiler_c') + autowaf.set_options(opt) + +def configure(conf): + conf.load('compiler_c') + autowaf.configure(conf) + autowaf.set_c99_mode(conf) + autowaf.display_header('Omins.LV2 Configuration') + + autowaf.check_pkg(conf, 'lv2', atleast_version='1.0.0', uselib_store='LV2') + + # Set env.pluginlib_PATTERN + pat = conf.env.cshlib_PATTERN + if pat[0:3] == 'lib': + pat = pat[3:] + conf.env.pluginlib_PATTERN = pat + conf.env.pluginlib_EXT = pat[pat.rfind('.'):] + + autowaf.display_msg(conf, "LV2 bundle directory", + conf.env.LV2DIR) + print('') + +def build_plugin(bld, lang, bundle, name, source, defines=None): + # Build plugin library + penv = bld.env.derive() + penv.cshlib_PATTERN = bld.env.pluginlib_PATTERN + obj = bld(features = '%s %sshlib' % (lang,lang), + env = penv, + source = source, + includes = ['.', 'src/include'], + name = name, + target = os.path.join(bundle, name), + uselib = ['LV2'], + install_path = '${LV2DIR}/' + bundle) + if defines != None: + obj.defines = defines + + # Install data file + data_file = '%s.ttl' % name + bld.install_files('${LV2DIR}/' + bundle, os.path.join(bundle, data_file)) + +def build(bld): + # Copy data files to build bundle (build/omins.lv2) + def do_copy(task): + src = task.inputs[0].abspath() + tgt = task.outputs[0].abspath() + return shutil.copy(src, tgt) + + for i in bld.path.ant_glob('omins.lv2/*.ttl'): + bld(features = 'subst', + is_copy = True, + source = i, + target = bld.path.get_bld().make_node('omins.lv2/%s' % i), + install_path = '${LV2DIR}/omins.lv2') + + bld(features = 'subst', + source = 'omins.lv2/manifest.ttl.in', + target = bld.path.get_bld().make_node('omins.lv2/manifest.ttl'), + LIB_EXT = bld.env.pluginlib_EXT, + install_path = '${LV2DIR}/omins.lv2') + + plugins = ['adenv', + 'adenv_lvl', + 'comparison', + 'dahdsr_fexp', + 'dahdsr_hexp', + 'fast_crossfade', + 'formant_filter', + 'hz_voct', + 'masher', + 'multiplexer', + 'prob_switch', + 'range_trans', + 'sample_and_hold', + 'signal_abs', + 'slew_limiter', + 'slide', + 'waveguide_mesh'] + + for i in plugins: + build_plugin(bld, 'c', 'omins.lv2', i, + ['src/%s.c' % i]) + +def lint(ctx): + subprocess.call('cpplint.py --filter=+whitespace/comments,-whitespace/tab,-whitespace/braces,-whitespace/labels,-build/header_guard,-readability/casting,-readability/todo,-build/include src/* serd/*', shell=True) + |