File: wscript

package info (click to toggle)
fomp 1.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 2,084 kB
  • sloc: python: 27,994; cpp: 3,759; makefile: 20
file content (124 lines) | stat: -rw-r--r-- 4,107 bytes parent folder | download
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/usr/bin/env python

import os
import re
import shutil

from waflib import Options
from waflib.extras import autowaf

# Version of this package (even if built as a child)
FOMP_VERSION = '1.2.2'

# Mandatory waf variables
APPNAME = 'fomp'        # Package name for waf dist
VERSION = FOMP_VERSION  # Package version for waf dist
top     = '.'           # Source directory
out     = 'build'       # Build directory

# Release variables
title        = 'Fomp.lv2'
uri          = 'http://drobilla.net/sw/fomp.lv2'
dist_pattern = 'http://download.drobilla.net/fomp-lv2-%d.%d.%d.tar.bz2'
post_tags    = ['LV2', 'Fomp.lv2']

def options(opt):
    opt.load('compiler_cxx')
    opt.load('lv2')

def configure(conf):
    conf.load('compiler_cxx', cache=True)
    conf.load('lv2', cache=True)
    conf.load('autowaf', cache=True)
    autowaf.set_cxx_lang(conf, 'c++11')

    if Options.options.ultra_strict:
        autowaf.add_compiler_flags(conf.env, 'cxx', {
            'clang': [
                '-Wno-double-promotion',
                '-Wno-enum-float-conversion',
                '-Wno-float-conversion',
                '-Wno-float-equal',
                '-Wno-global-constructors',
                '-Wno-implicit-float-conversion',
                '-Wno-old-style-cast',
                '-Wno-padded',
                '-Wno-reserved-id-macro',
                '-Wno-shadow-field',
                '-Wno-shorten-64-to-32',
                '-Wno-sign-conversion',
                '-Wno-suggest-override',
                '-Wno-suggest-destructor-override',
                '-Wno-unused-macros',
                '-Wno-unused-parameter',
                '-Wno-weak-vtables',
                '-Wno-zero-as-null-pointer-constant',
            ],
            'gcc': [
                '-Wno-conversion',
                '-Wno-double-promotion',
                '-Wno-effc++',
                '-Wno-float-conversion',
                '-Wno-float-equal',
                '-Wno-old-style-cast',
                '-Wno-padded',
                '-Wno-suggest-attribute=const',
                '-Wno-suggest-override',
                '-Wno-unused-macros',
                '-Wno-unused-parameter',
                '-Wno-zero-as-null-pointer-constant',
            ]
        })

    conf.check_pkg('lv2 >= 1.16.0', uselib_store='LV2')

    conf.run_env.append_unique('LV2_PATH', [conf.build_path('lv2')])
    autowaf.display_summary(conf, {'LV2 bundle directory': conf.env.LV2DIR})

def build_plugin(bld, lang, bundle, name, source, defines=None):
    obj = bld(features     = '%s %sshlib lv2lib' % (lang,lang),
              source       = source,
              name         = name,
              target       = os.path.join('lv2', bundle, name),
              uselib       = ['LV2'],
              install_path = '${LV2DIR}/' + bundle)

    if defines != None:
        obj.defines = defines

def build(bld):
    # Copy data files to build bundle (build/fomp.lv2)
    def do_copy(task):
        src = task.inputs[0].abspath()
        tgt = task.outputs[0].abspath()
        return shutil.copy(src, tgt)

    for i in bld.path.ant_glob('fomp.lv2/*.ttl'):
        bld(features     = 'subst',
            is_copy      = True,
            source       = i,
            target       = 'lv2/fomp.lv2/%s' % i.name,
            install_path = '${LV2DIR}/fomp.lv2')

    bld(features     = 'subst',
        source       = 'fomp.lv2/manifest.ttl.in',
        target       = 'lv2/fomp.lv2/manifest.ttl',
        LIB_EXT      = bld.env.LV2_LIB_EXT,
        install_path = '${LV2DIR}/fomp.lv2')

    plugins = ['autowah',
               'blvco',
               'cs_chorus',
               'cs_phaser',
               'filters',
               'mvchpf24',
               'mvclpf24']
    for i in plugins:
        build_plugin(bld, 'cxx', 'fomp.lv2', i,
                     ['src/%s.cc' % i,
                      'src/%s_lv2.cc' % i])
    build_plugin(bld, 'cxx', 'fomp.lv2', 'reverbs',
                 ['src/reverbs.cc',
                  'src/pareq.cc',
                  'src/zreverb.cc',
                  'src/reverbs_lv2.cc'])