File: wscript

package info (click to toggle)
mda-lv2 1.2.2~dfsg0-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 7,164 kB
  • ctags: 3,466
  • sloc: cpp: 92,961; python: 12,668; sh: 196; makefile: 17
file content (107 lines) | stat: -rw-r--r-- 3,148 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/usr/bin/env python
import os
import re
import shutil
import waflib.extras.autowaf as autowaf

MDA_VERSION = '1.2.2'

# Mandatory waf variables
APPNAME = 'mda-lv2'    # Package name for waf dist
VERSION = MDA_VERSION  # Package version for waf dist
top     = '.'          # Source directory
out     = 'build'      # Build directory

def options(opt):
    opt.load('compiler_cxx')
    autowaf.set_options(opt)

def configure(conf):
    conf.line_just = 23
    conf.load('compiler_cxx')
    autowaf.configure(conf)
    autowaf.display_header('MDA.lv2 Configuration')

    autowaf.check_pkg(conf, 'lv2', atleast_version='1.2.0', uselib_store='LV2')

    autowaf.display_msg(conf, "LV2 bundle directory",
                        conf.env.LV2DIR)
    print('')

def build(bld):
    bundle = 'mda.lv2'

    for i in bld.path.ant_glob('mda.lv2/[A-Z]*.ttl'):
        bld(features     = 'subst',
            is_copy      = True,
            source       = i,
            target       = bld.path.get_bld().make_node('mda.lv2/%s' % i),
            install_path = '${LV2DIR}/mda.lv2')

    # Make a pattern for shared objects without the 'lib' prefix
    module_pat = re.sub('^lib', '', bld.env.cxxshlib_PATTERN)
    module_ext = module_pat[module_pat.rfind('.'):]

    # Build manifest by substitution
    bld(features     = 'subst',
        source       = 'mda.lv2/manifest.ttl.in',
        target       = bld.path.get_bld().make_node('mda.lv2/manifest.ttl'),
        LIB_EXT      = module_ext,
        install_path = '${LV2DIR}/mda.lv2')

    plugins = '''
            Ambience
            Bandisto
            BeatBox
            Combo
            DX10
            DeEss
            Degrade
            Delay
            Detune
            Dither
            DubDelay
            Dynamics
            EPiano
            Image
            JX10
            Leslie
            Limiter
            Loudness
            MultiBand
            Overdrive
            Piano
            RePsycho
            RezFilter
            RingMod
            RoundPan
            Shepard
            Splitter
            Stereo
            SubSynth
            TalkBox
            TestTone
            ThruZero
            Tracker
            Transient
            VocInput
            Vocoder
    '''.split()

    for p in plugins:
        # Build plugin library
        obj = bld(features     = 'cxx cxxshlib',
                  source       = ['src/mda%s.cpp' % p, 'lvz/wrapper.cpp'],
                  includes     = ['.', './lvz', './src'],
                  name         = p,
                  target       = os.path.join(bundle, p),
                  install_path = '${LV2DIR}/' + bundle,
                  uselib       = ['LV2'],
                  defines      = ['PLUGIN_CLASS=mda%s' % p,
                                  'URI_PREFIX="http://drobilla.net/plugins/mda/"',
                                  'PLUGIN_URI_SUFFIX="%s"' % p,
                                  'PLUGIN_HEADER="src/mda%s.h"' % p])
        obj.env.cxxshlib_PATTERN = module_pat

        # Install data file
        bld.install_files('${LV2DIR}/' + bundle, os.path.join(bundle, p + '.ttl'))