add required check for cairo in 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         autowaf.check_pkg(conf, 'cairo', uselib_store='CAIRO', atleast_version='1.12.0') 
22
23 def build(bld):
24     bundle = 'a-comp.lv2'
25     module_pat = re.sub('^lib', '', bld.env.cshlib_PATTERN)
26     module_ext = module_pat[module_pat.rfind('.'):]
27
28     if bld.is_defined ('HAVE_LV2'):
29         # Build RDF files
30         for i in ['manifest.ttl', 'a-comp.ttl', 'a-comp#stereo.ttl', 'presets.ttl']:
31             bld(features     = 'subst',
32                 source       = i + '.in',
33                 target       = '../../LV2/%s/%s' % (bundle, i),
34                 install_path = '${LV2DIR}/%s' % bundle,
35                 chmod        = Utils.O644,
36                 LIB_EXT      = module_ext)
37
38         # Build plugin library
39         obj = bld(features     = 'c cshlib',
40                   source       = 'a-comp.c',
41                   name         = 'a-comp',
42                   cflags       = [ '-fPIC',  bld.env['compiler_flags_dict']['c99'] ],
43                   includes     = [ '../../ardour' ],
44                   target       = '../../LV2/%s/a-comp' % bundle,
45                   install_path = '${LV2DIR}/%s' % bundle,
46                   uselib       = 'CAIRO',
47                   use          = 'LV2_1_0_0'
48                   )
49         obj.env.cshlib_PATTERN = module_pat
50
51         # Build plugin GUI
52         obj = bld(features     = 'cxx cxxshlib',
53                   source       = 'ui.cc',
54                   name         = 'a-comp-ui',
55                   cxxflags     = [ '-fPIC' ],
56                   target       = '../../LV2/%s/a-comp-ui' % bundle,
57                   install_path = '${LV2DIR}/%s' % bundle,
58                   uselib       = 'GTKMM GTK',
59                   use          = 'LV2_1_0_0'
60                   )
61         obj.env.cxxshlib_PATTERN = module_pat
62
63 # vi:set ts=4 sw=4 et: