1#!/usr/bin/env python
2import os
3import re
4import shutil
5import waflib.extras.autowaf as autowaf
6import waflib.Options as Options, waflib.Utils as Utils
7
8# Mandatory variables
9top = '.'
10out = 'build'
11
12def options(opt):
13    autowaf.set_options(opt)
14
15def configure(conf):
16    conf.load('compiler_c')
17    autowaf.configure(conf)
18    autowaf.check_pkg(conf, 'lv2', atleast_version='1.0.0',
19                      uselib_store='LV2_1_0_0')
20    autowaf.check_pkg(conf, 'cairo', uselib_store='CAIRO', atleast_version='1.12.0')
21
22def build(bld):
23    bundle = 'a-exp.lv2'
24    module_pat = re.sub('^lib', '', bld.env.cshlib_PATTERN)
25    module_ext = module_pat[module_pat.rfind('.'):]
26
27    # Build RDF files
28    for i in ['manifest.ttl', 'a-exp.ttl', 'a-exp#stereo.ttl']:
29        obj = bld(features='subst')
30        obj.source = i + '.in'
31        obj.target = '../../LV2/%s/%s' % (bundle, i)
32        obj.install_path = '${LV2DIR}/%s' % bundle
33        obj.chmod = Utils.O644
34        obj.LIB_EXT = module_ext
35
36    # Build plugin library
37    obj = bld(features     = 'c cshlib',
38              source       = 'a-exp.c',
39              name         = 'a-exp',
40              cflags       = [ bld.env['compiler_flags_dict']['pic'],  bld.env['compiler_flags_dict']['c99'] ],
41              includes     = [ '../../ardour', '../shared' ],
42              target       = '../../LV2/%s/a-exp' % bundle,
43              install_path = '${LV2DIR}/%s' % bundle,
44              uselib       = 'CAIRO',
45              use          = 'LV2_1_0_0'
46              )
47    obj.env.cshlib_PATTERN = module_pat
48
49# vi:set ts=4 sw=4 et:
50