bundle a-comp
[ardour.git] / libs / plugins / a-comp.lv2 / wscript
1 #!/usr/bin/env python
2 import os
3 import re
4 import shutil
5 import waflib.extras.autowaf as autowaf
6 import waflib.Options as Options, waflib.Utils as Utils
7
8 # Mandatory variables
9 top = '.'
10 out = 'build'
11
12 def options(opt):
13     autowaf.set_options(opt)
14
15 def configure(conf):
16     conf.load('compiler_c')
17     autowaf.configure(conf)
18     if Options.options.lv2:
19         autowaf.check_pkg(conf, 'lv2', atleast_version='1.0.0',
20                 uselib_store='LV2_1_0_0')
21
22 def build(bld):
23     bundle = 'a-comp.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', 'a-comp.ttl', 'presets.ttl']:
30             bld(features     = 'subst',
31                 source       = i + '.in',
32                 target       = '../../LV2/%s/%s' % (bundle, i),
33                 install_path = '${LV2DIR}/%s' % bundle,
34                 chmod        = Utils.O644,
35                 LIB_EXT      = module_ext)
36
37         # Build plugin library
38         obj = bld(features     = 'c cshlib',
39                   source       = 'a-comp.c',
40                   name         = 'a-comp',
41                   cflags       = [ '-fPIC' ],
42                   target       = '../../LV2/%s/a-comp' % bundle,
43                   install_path = '${LV2DIR}/%s' % bundle,
44                   use          = 'LV2_1_0_0'
45                   )
46         obj.env.cshlib_PATTERN = module_pat
47
48         # Build plugin GUI
49         obj = bld(features     = 'cxx cxxshlib',
50                   source       = 'ui.cc',
51                   name         = 'a-comp-ui',
52                   cxxflags     = [ '-fPIC' ],
53                   target       = '../../LV2/%s/a-comp-ui' % bundle,
54                   install_path = '${LV2DIR}/%s' % bundle,
55                   uselib       = 'GTKMM GTK',
56                   use          = 'LV2_1_0_0'
57                   )
58         obj.env.cxxshlib_PATTERN = module_pat
59
60 # vi:set ts=4 sw=4 et: