aboutsummaryrefslogtreecommitdiffstats
path: root/wscript
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-10-03 05:22:14 +0000
committerDavid Robillard <d@drobilla.net>2011-10-03 05:22:14 +0000
commite550736dbb862d8333a4d7f2ede9804a3d48326c (patch)
tree185b6f0483cbfe2fae87bb61b0e123fb2353b5d5 /wscript
downloadblop.lv2-e550736dbb862d8333a4d7f2ede9804a3d48326c.tar.gz
blop.lv2-e550736dbb862d8333a4d7f2ede9804a3d48326c.tar.bz2
blop.lv2-e550736dbb862d8333a4d7f2ede9804a3d48326c.zip
Add 'blip', an LV2 port of the LADSPA 'blop' collection.
git-svn-id: http://svn.drobilla.net/lad/trunk/plugins/blip.lv2@3525 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'wscript')
-rw-r--r--wscript126
1 files changed, 126 insertions, 0 deletions
diff --git a/wscript b/wscript
new file mode 100644
index 0000000..e76ff78
--- /dev/null
+++ b/wscript
@@ -0,0 +1,126 @@
+#!/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)
+BLIP_VERSION = '0.0.0'
+
+# Variables for 'waf dist'
+APPNAME = 'blip.lv2'
+VERSION = BLIP_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.display_header('Blip Configuration')
+
+ autowaf.check_header(conf, 'c', 'lv2/lv2plug.in/ns/lv2core/lv2.h')
+
+ conf.check(function_name = 'sinf',
+ header_name = 'math.h',
+ linkflags = '-lm',
+ define_name = 'HAVE_SINF',
+ mandatory = False)
+
+ conf.env.append_unique('CFLAGS', '-std=c99')
+ conf.env.append_unique('CFLAGS', '-D_XOPEN_SOURCE')
+
+ conf.write_config_header('config.h', remove=False)
+
+ # 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, cflags=[], libs=[]):
+ # Build plugin library
+ penv = bld.env.derive()
+ penv['cshlib_PATTERN'] = bld.env['pluginlib_PATTERN']
+ obj = bld(features = '%s %sshlib' % (lang,lang))
+ obj.env = penv
+ obj.source = source
+ obj.includes = [ '.', './src/include' ]
+ obj.name = name
+ obj.target = os.path.join(bundle, name)
+ obj.linkflags = [ '-nostartfiles' ]
+ if cflags != []:
+ obj.cflags = cflags
+ if libs != []:
+ autowaf.use_lib(bld, obj, libs)
+ obj.install_path = '${LV2DIR}/' + bundle
+
+ # 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/blip.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('blip.lv2/*.ttl'):
+ bld(rule = do_copy,
+ source = i,
+ target = bld.path.get_bld().make_node('blip.lv2/%s' % i),
+ install_path = '${LV2DIR}/blip.lv2')
+
+ bld(features = 'subst',
+ source = 'blip.lv2/manifest.ttl.in',
+ target = bld.path.get_bld().make_node('blip.lv2/manifest.ttl'),
+ LIB_EXT = bld.env['pluginlib_EXT'],
+ install_path = '${LV2DIR}/blip.lv2')
+
+ plugins = '''
+ adsr
+ adsr_gt
+ amp
+ branch
+ dahdsr
+ difference
+ fmod
+ interpolator
+ product
+ random
+ ratio
+ sum
+ sync_pulse
+ sync_square
+ tracker
+ '''.split()
+# quantiser.so
+# sequencer.so
+
+ # Simple (single source file) plugins
+ for i in plugins:
+ build_plugin(bld, 'c', 'blip.lv2', i,
+ ['src/%s.c' % i])
+
+ # Low pass filter
+ build_plugin(bld, 'c', 'blip.lv2', 'lp4pole',
+ ['src/lp4pole.c', 'src/lp4pole_filter.c'])
+
+ # Oscillators
+ for i in ['pulse', 'sawtooth', 'square', 'triangle']:
+ build_plugin(bld, 'c', 'blip.lv2', i,
+ ['src/%s.c' % i, 'src/wavedata.c'])
+
+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)