bundled LV2 plugin build and deployment
[ardour.git] / libs / plugins / reasonablesynth.lv2 / wscript
1 #!/usr/bin/env python
2 import os
3 import re
4 import shutil
5 import waflib.extras.autowaf as autowaf
6
7 # Mandatory variables
8 top = '.'
9 out = 'build'
10
11 def options(opt):
12     autowaf.set_options(opt)
13
14 def configure(conf):
15     conf.load('compiler_c')
16     autowaf.configure(conf)
17     autowaf.set_c99_mode(conf)
18     if Options.options.lv2:
19         autowaf.check_pkg(conf, 'lv2', atleast_version='1.4.0',
20                 uselib_store='LV2_1_4_0')
21
22 def build(bld):
23     bundle = 'reasonablesynth.lv2'
24     module_pat = re.sub('^lib', '', bld.env.cshlib_PATTERN)
25     module_ext = module_pat[module_pat.rfind('.'):]
26
27     if bld.is_defined ('HAVE_LV2'):
28         # Build RDF files
29         for i in ['manifest.ttl', 'reasonablesynth.ttl']:
30             bld(features     = 'subst',
31                 source       = i + '.in',
32                 target       = '../../LV2/%s/%s' % (bundle, i),
33                 install_path = '${LV2DIR}/%s' % bundle,
34                 LIB_EXT      = module_ext)
35
36         # Build plugin library
37         obj = bld(features     = 'c cshlib',
38                   source       = 'lv2.c',
39                   dep_files    = 'rsynth.c',
40                   name         = 'reasonablesynth',
41                   target       = '../../LV2/%s/reasonablesynth' % bundle,
42                   install_path = '${LV2DIR}/%s' % bundle,
43                   use          = 'LV2_1_4_0'
44                   )
45         obj.env.cshlib_PATTERN = module_pat
46
47 # vi:set ts=4 sw=4 et: