forked from kushview/element
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwscript
More file actions
225 lines (187 loc) · 7.9 KB
/
wscript
File metadata and controls
225 lines (187 loc) · 7.9 KB
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
#!/usr/bin/env python
from subprocess import call, Popen, PIPE
import os, sys
import string
sys.path.append (os.getcwd() + "/tools/waf")
import cross, element, juce
APPNAME='element'
VERSION='0.44.0'
VST3_PATH='libs/JUCE/modules/juce_audio_processors/format_types/VST3_SDK'
def options (opt):
opt.load ("compiler_c compiler_cxx cross juce")
opt.add_option ('--disable-ladspa', default=False, action='store_true', dest='no_ladspa', \
help="Disable LADSPA plugin hosting")
opt.add_option ('--disable-lv2', default=False, action='store_true', dest='no_lv2', \
help="Disable LV2 plugin hosting")
opt.add_option ('--enable-docking', default=False, action='store_true', dest='enable_docking', \
help="Build with docking window support")
opt.add_option ('--without-alsa', default=False, action='store_true', dest='no_alsa', \
help="Build without ALSA support")
opt.add_option ('--without-jack', default=False, action='store_true', dest='no_jack', \
help="Build without JACK support")
opt.add_option ('--without-lua', default=False, action='store_true', dest='no_lua', \
help="Build without LUA scripting")
opt.add_option ('--test', default=False, action='store_true', dest='test', \
help="Build the test suite")
opt.add_option ('--with-vst-sdk', default='', type='string', dest='vst_sdk', \
help="Specify the VST2 SDK path")
opt.add_option('--ziptype', default='gz', dest='ziptype', type='string',
help='Zip type for waf dist (gz/bz2/zip) [ Default: gz ]')
def silence_warnings (conf):
'''TODO: resolve these'''
conf.env.append_unique ('CFLAGS', ['-Wno-deprecated-declarations'])
conf.env.append_unique ('CXXFLAGS', ['-Wno-deprecated-declarations'])
if 'clang' in conf.env.CXX[0]:
conf.env.append_unique ('CFLAGS', ['-Wno-deprecated-register'])
conf.env.append_unique ('CXXFLAGS', ['-Wno-deprecated-register'])
conf.env.append_unique ('CFLAGS', ['-Wno-dynamic-class-memaccess'])
conf.env.append_unique ('CXXFLAGS', ['-Wno-dynamic-class-memaccess'])
def configure_product (conf):
conf.define ('EL_PRO', 1)
conf.env.EL_SOLO = False
conf.env.EL_FREE = False
conf.env.EL_PRO = True
def configure_git_version (ctx):
if os.path.exists('.git'):
call(["python", "tools/gitversion.py"], stdout=PIPE)
def configure (conf):
configure_git_version (conf)
conf.env.DATADIR = os.path.join (conf.env.PREFIX, 'share/element')
conf.check_ccache()
cross.setup_compiler (conf)
if len(conf.options.cross) <= 0:
conf.prefer_clang()
conf.load ("compiler_c compiler_cxx ar cross juce")
conf.check_cxx_version()
silence_warnings (conf)
conf.check_common()
if cross.is_mingw(conf): conf.check_mingw()
elif juce.is_mac(): conf.check_mac()
else: conf.check_linux()
conf.env.TEST = bool(conf.options.test)
conf.env.DEBUG = conf.options.debug
conf.env.EL_VERSION_STRING = VERSION
conf.define ('EL_USE_JACK', 0)
conf.define ('EL_VERSION_STRING', conf.env.EL_VERSION_STRING)
conf.define ('EL_DOCKING', 1 if conf.options.enable_docking else 0)
conf.define ('KV_DOCKING_WINDOWS', 1)
conf.env.append_unique ("MODULE_PATH", [conf.env.MODULEDIR])
print
juce.display_header ("Element")
juce.display_msg (conf, "ALSA", conf.env.ALSA)
juce.display_msg (conf, "JACK", conf.env.JACK)
juce.display_msg (conf, "AU", juce.is_mac())
juce.display_msg (conf, "VST2", bool(conf.env.HAVE_VST))
juce.display_msg (conf, "VST3", True)
juce.display_msg (conf, "LADSPA", bool(conf.env.LADSPA))
juce.display_msg (conf, "LV2", bool(conf.env.LV2))
juce.display_msg (conf, "Lua Scripting", bool(conf.env.LUA))
juce.display_msg (conf, "Workspaces", conf.options.enable_docking)
juce.display_msg (conf, "Debug", conf.options.debug)
print
juce.display_msg (conf, "PREFIX", conf.env.PREFIX)
juce.display_msg (conf, "DATADIR", conf.env.DATADIR)
juce.display_msg (conf, "CFLAGS", conf.env.CFLAGS)
juce.display_msg (conf, "CXXFLAGS", conf.env.CXXFLAGS)
juce.display_msg (conf, "LINKFLAGS", conf.env.LINKFLAGS)
def common_includes():
return [ 'libs/JUCE/modules', \
'libs/kv/modules', \
'libs/jlv2/modules', \
'libs/compat', \
'libs/lua', \
'libs/lua/src', \
'libs/lua-kv/src', \
'build/include', \
VST3_PATH, \
'src' ]
def build_desktop (bld, slug='element'):
if not juce.is_linux():
return
src = "data/net.kushview.%s.desktop.in" % (slug)
tgt = "net.kushview.%s.desktop" % (slug)
element_data = '%s' % (bld.env.DATADIR)
element_bin = '%s/bin' % (bld.env.PREFIX)
if os.path.exists (src):
bld (features = "subst",
source = src,
target = tgt,
name = tgt,
ELEMENT_BINDIR = element_bin,
ELEMENT_DATA = element_data,
install_path = bld.env.PREFIX + "/share/applications"
)
bld.install_files (element_data, 'data/ElementIcon.png')
def compile (bld):
libEnv = bld.env.derive()
for k in 'CFLAGS CXXFLAGS LINKFLAGS'.split():
libEnv.append_unique (k, [ '-fPIC' ])
library = bld (
features = 'cxx cxxshlib',
source = element.get_juce_library_code ("libs/compat") +
bld.path.ant_glob ('libs/compat/BinaryData*.cpp') +
bld.path.ant_glob ('src/**/*.cpp') +
bld.path.ant_glob ('libs/lua-kv/src/*.c'),
includes = common_includes(),
target = 'lib/element-0',
name = 'ELEMENT',
env = libEnv,
use = [ 'BOOST_SIGNALS' ]
)
bld.add_group()
appEnv = bld.env.derive()
app = bld.program (
source = [ 'src/Main.cc' ],
includes = common_includes(),
target = 'bin/element',
name = 'ElementApp',
env = appEnv,
use = [ 'ELEMENT' ],
linkflags = []
)
if bld.env.LV2: library.use += [ 'SUIL', 'LILV', 'LV2' ]
if bld.env.JACK: library.use += [ 'JACK' ]
if juce.is_linux():
build_desktop(bld)
library.use += [ 'FREETYPE2', 'X11', 'DL', 'PTHREAD', 'ALSA', 'XEXT', 'CURL', 'GTK' ]
elif juce.is_mac():
library.use += [ 'ACCELERATE', 'AUDIO_TOOLBOX', 'AUDIO_UNIT', 'CORE_AUDIO',
'CORE_AUDIO_KIT', 'COCOA', 'CORE_MIDI', 'IO_KIT', 'QUARTZ_CORE' ]
app.target = 'Applications/Element'
app.mac_app = True
app.mac_plist = 'data/Info.plist'
app.mac_files = [ 'data/Icon.icns' ]
else:
pass
def build (bld):
bld.add_pre_fun (configure_git_version)
compile (bld)
# for testing purposes right now. doesn't get installed
if bld.env.LUA and bool(bld.env.HAVE_READLINE):
bld.program(
source = [ 'tools/lua-el/lua.cpp' ],
name = 'lua-el',
target = 'bin/lua-el',
includes = common_includes(),
use = [ 'ELEMENT', 'READLINE' ],
install_path = None
)
if bld.env.TEST: bld.recurse ('tests')
def check (ctx):
if not os.path.exists('build/bin/test-element'):
ctx.fatal("Tests not compiled")
return
if 0 != call (["build/bin/test-element"]):
ctx.fatal("Tests failed")
def dist(ctx):
z = ctx.options.ziptype
if 'zip' in z:
ziptype = z
else:
ziptype = "tar." + z
ctx.base_name = '%s-%s' % (APPNAME, VERSION)
ctx.algo = ziptype
ctx.excl = ' **/.waf-1* **/.waf-2* **/.waf3-* **/*~ **/*.pyc **/*.swp **/.lock-w*'
ctx.excl += ' **/.gitignore **/.gitmodules **/.git dist deploy pro **/Builds **/build'
ctx.excl += ' **/.DS_Store **/.vscode **/.travis.yml *.bz2 *.zip *.gz'
ctx.excl += ' tools/jucer/**/JuceLibraryCode'