summaryrefslogtreecommitdiff
path: root/gtk2_ardour/SConscript
blob: 0346c75765265564afb3a183d3c10a6701383311 (plain)
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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
# -*- python -*-

import os
import os.path
import glob

Import('env install_prefix final_prefix config_prefix libraries i18n ardour_version')

gtkardour = env.Copy()
gtkmmtests = env.Copy()

#
# this defines the version number of the GTK interface to ardour
#

domain = 'gtk_ardour'

gtkardour.Append(DOMAIN=domain, MAJOR=1,MINOR=0,MICRO=2)
gtkardour.Append(CCFLAGS="-DPACKAGE=\\\"" + domain + "\\\"")
gtkardour.Append(CXXFLAGS="-DPACKAGE=\\\"" + domain + "\\\"")
gtkardour.Append(CXXFLAGS="-DLIBSIGC_DISABLE_DEPRECATED")
gtkardour.Append(CPPPATH="#/")  # for top level svn_revision.h
#gtkardour.Append(CXXFLAGS="-DFLOWCANVAS_AA")
gtkardour.Append(PACKAGE=domain)
gtkardour.Append(POTFILE=domain + '.pot')

gtkardour.Merge ([
    libraries['ardour'],
    libraries['ardour_cp'],
    libraries['gtkmm2ext'],
    libraries['midi++2'],
    libraries['pbd'],
    libraries['gtkmm2'],
    libraries['glib2'],
    libraries['libgnomecanvas2'],
    libraries['libgnomecanvasmm'],
    libraries['sysmidi'],
    libraries['sndfile-ardour'],
    libraries['flac'],
    libraries['lrdf'],
    libraries['glibmm2'],
    libraries['pangomm'],
    libraries['atkmm'],
    libraries['gdkmm2'],
    libraries['sigc2'],
    libraries['gtk2'],
    libraries['xml'],
    libraries['xslt'],
    libraries['soundtouch'],
    libraries['samplerate'],
    libraries['jack']
])

gtkmmtests.Append(CXXFLAGS="-DLIBSIGC_DISABLE_DEPRECATED")

gtkmmtests.Merge ([
    libraries['gtkmm2'],
    libraries['glib2'],
    libraries['glibmm2'],
    libraries['pangomm'],
    libraries['atkmm'],
    libraries['gdkmm2'],
    libraries['sigc2'],
    libraries['gtk2']
])

if gtkardour['DMALLOC']:
	gtkardour.Merge([libraries['dmalloc']])
	gtkardour.Append(CCFLAGS='-DUSE_DMALLOC')

if gtkardour['FFT_ANALYSIS']:
	gtkardour.Merge ([libraries['fftw3f']])
	gtkardour.Append(CCFLAGS='-DFFT_ANALYSIS')

skipped_files=Split("""
connection_editor.cc
""")

audiounit_files=Split("""
au_pluginui.cc
""")

gtkardour_files=Split("""
about.cc
actions.cc
add_route_dialog.cc
ardour_dialog.cc
ardour_ui.cc
ardour_ui2.cc
ardour_ui_dependents.cc
ardour_ui_dialogs.cc
ardour_ui_ed.cc
ardour_ui_mixer.cc
ardour_ui_options.cc
audio_clock.cc
route_time_axis.cc
audio_time_axis.cc
automation_gain_line.cc
automation_line.cc
automation_pan_line.cc
automation_time_axis.cc
axis_view.cc
canvas-imageframe.c
canvas-simpleline.c
simpleline.cc
canvas-simplerect.c
simplerect.cc
canvas-waveview.c
crossfade_edit.cc
crossfade_view.cc
curvetest.cc
enums.cc
editing.cc
editor.cc
editor_actions.cc
editor_audio_import.cc
editor_audiotrack.cc
editor_canvas.cc
editor_canvas_events.cc
editor_cursors.cc
editor_edit_groups.cc
editor_export_audio.cc
editor_hscroller.cc
editor_imageframe.cc
editor_keyboard.cc
editor_keys.cc
editor_markers.cc
editor_mixer.cc
editor_mouse.cc
editor_nudge.cc
editor_ops.cc
editor_region_list.cc
editor_route_list.cc
editor_rulers.cc
editor_scrub.cc
editor_selection.cc
editor_selection_list.cc
editor_tempodisplay.cc
editor_timefx.cc
engine_dialog.cc
export_dialog.cc
export_session_dialog.cc
export_region_dialog.cc
export_range_markers_dialog.cc
gain_automation_time_axis.cc
gain_meter.cc
ghostregion.cc
gtk-custom-hruler.c
gtk-custom-ruler.c
imageframe.cc
imageframe_socket_handler.cc
imageframe_time_axis.cc
imageframe_time_axis_group.cc
imageframe_time_axis_view.cc
imageframe_view.cc
io_selector.cc
keyboard.cc
ladspa_pluginui.cc
location_ui.cc
main.cc
marker.cc
marker_time_axis.cc
marker_time_axis_view.cc
marker_view.cc
midi_port_dialog.cc
mixer_strip.cc
mixer_ui.cc
new_session_dialog.cc
option_editor.cc
opts.cc
pan_automation_time_axis.cc
panner.cc
panner2d.cc
panner_ui.cc
playlist_selector.cc
plugin_selector.cc
plugin_ui.cc
prompter.cc
public_editor.cc
redirect_automation_line.cc
redirect_automation_time_axis.cc
redirect_box.cc
audio_region_editor.cc
region_gain_line.cc
region_selection.cc
region_view.cc
audio_region_view.cc
route_params_ui.cc
route_redirect_selection.cc
route_ui.cc
selection.cc
sfdb_ui.cc
send_ui.cc
streamview.cc
audio_streamview.cc
tape_region_view.cc
tempo_dialog.cc
theme_manager.cc
time_axis_view.cc
time_axis_view_item.cc
time_selection.cc
ui_config.cc
utils.cc
version.cc
visual_time_axis.cc
waveview.cc
""")

fft_analysis_files=Split("""
analysis_window.cc
fft_graph.cc
fft_result.cc
""")

pixmap_files = glob.glob('pixmaps/*.xpm')
icon_files = glob.glob ('icons/*.png')

intl_files = gtkardour_files + glob.glob('*.h')

mtest_files=Split("""
mtest.cc
""")


rcu_files=Split("""
rcu.cc
""")

itest_files=Split("""
itest.cc
""")

stest_files=Split("""
stest.cc
""")

tt_files=Split ("""
tt.cc
""")

extra_sources = []

vst_files = [ 'vst_pluginui.cc' ]

if env['VST']:
	extra_sources += vst_files
	gtkardour.Append (CCFLAGS="-DVST_SUPPORT", CPPPATH="#libs/fst")

if gtkardour['AUDIOUNITS']:
    extra_sources += audiounit_files
    gtkardour.Append(CCFLAGS='-DHAVE_AUDIOUNITS')
    gtkardour.Append(LINKFLAGS='-framework Carbon')
    gtkardour.Merge([libraries['appleutility']])
 
if env['FFT_ANALYSIS']:
	extra_sources += fft_analysis_files

intl_files += extra_sources

gtkardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE")
gtkardour.Append(CXXFLAGS="-DLOCALEDIR=\\\""+final_prefix+"/share/locale\\\"")

versionflag = '-DVERSIONSTRING=\\\"' + env['VERSION'] + '\\\"'

gtkardour.Append(CXXFLAGS=versionflag)

executable = 'ardour-' + ardour_version

ardour = gtkardour.Program(target = executable, source = gtkardour_files + extra_sources)
ardourlib = gtkardour.SharedLibrary(target = 'ardourgtk', source = gtkardour_files + extra_sources)

mtest = gtkardour.Program(target = 'mtest', source = mtest_files)
itest = gtkardour.Program(target = 'itest', source = itest_files)
rcu = gtkardour.Program(target = 'rcu', source = rcu_files)
tt = gtkmmtests.Program(target = 'tt', source = tt_files)

my_font_dict = { }

if gtkardour['DIST_TARGET'] == 'panther' or gtkardour['DIST_TARGET'] == 'tiger':
	#
	# OS X font rendering is different even with X11
	#
	my_font_dict['%FONT_TINY%'] = 'sans 7'
	my_font_dict['%FONT_SMALLERER%'] = 'sans 8'
	my_font_dict['%FONT_SMALLER%'] = 'sans 9'
	my_font_dict['%FONT_SMALL%'] = 'sans 10'
	my_font_dict['%FONT_NORMAL%'] = 'sans 11'
	my_font_dict['%FONT_BIG%'] = 'sans 12'
	my_font_dict['%FONT_BIGGER%'] = 'sans 14'
	my_font_dict['%FONT_LARGE%'] = 'sans 18'
	my_font_dict['%FONT_LARGER%'] = 'sans 28'
	my_font_dict['%FONT_HUGER%'] = 'sans 36'
	my_font_dict['%FONT_MASSIVE%'] = 'sans 60'
	my_font_dict['%FONT_BOLD_TINY%'] = 'sans bold 7'
	my_font_dict['%FONT_BOLD_SMALLER%'] = 'sans bold 9'
	my_font_dict['%FONT_BOLD_SMALL%'] = 'sans bold 10'
	my_font_dict['%FONT_BOLD_NORMAL%'] = 'sans bold 11'
	my_font_dict['%FONT_BOLD_BIG%'] = 'sans bold 13'
	my_font_dict['%FONT_BOLD_BIGGER%'] = 'sans bold 14'
	my_font_dict['%FONT_BOLD_LARGE%'] = 'sans bold 20'
	my_font_dict['%FONT_BOLD_LARGER%'] = 'sans bold 25'
	my_font_dict['%FONT_BOLD_HUGER%'] = 'sans bold 36'
	my_font_dict['%FONT_BOLD_MASSIVE%'] = 'sans bold 60'
	my_font_dict['%FONT_ITALIC_TINY%'] = 'sans italic 7'
	my_font_dict['%FONT_ITALIC_SMALLER%'] = 'sans italic 9'
	my_font_dict['%FONT_ITALIC_SMALL%'] = 'sans italic 10'
	my_font_dict['%FONT_ITALIC_NORMAL%'] = 'sans italic 11'
	my_font_dict['%FONT_ITALIC_BIG%'] = 'sans italic 15'
	my_font_dict['%FONT_ITALIC_BIGGER%'] = 'sans italic 16'
	my_font_dict['%FONT_ITALIC_LARGE%'] = 'sans italic 20'
	my_font_dict['%FONT_ITALIC_LARGER%'] = 'sans italic 28'
	my_font_dict['%FONT_ITALIC_HUGER%'] = 'sans italic 36'
	my_font_dict['%FONT_ITALIC_MASSIVE%'] = 'sans italic 60'
else:
	#
	# Linux/X11 font rendering
	#
	my_font_dict['%FONT_TINY%'] = 'sans 4'
	my_font_dict['%FONT_SMALLERER%'] = 'sans 6'
	my_font_dict['%FONT_SMALLER%'] = 'sans 6'
	my_font_dict['%FONT_SMALL%'] = 'sans 7'
	my_font_dict['%FONT_NORMAL%'] = 'sans 8'
	my_font_dict['%FONT_BIG%'] = 'sans 12'
	my_font_dict['%FONT_BIGGER%'] = 'sans 14'
	my_font_dict['%FONT_LARGE%'] = 'sans 18'
	my_font_dict['%FONT_LARGER%'] = 'sans 24'
	my_font_dict['%FONT_HUGER%'] = 'sans 34'
	my_font_dict['%FONT_MASSIVE%'] = 'sans 60'
	my_font_dict['%FONT_BOLD_TINY%'] = 'sans bold 4'
	my_font_dict['%FONT_BOLD_SMALLER%'] = 'sans bold 6'
	my_font_dict['%FONT_BOLD_SMALL%'] = 'sans bold 7'
	my_font_dict['%FONT_BOLD_NORMAL%'] = 'sans bold 8'
	my_font_dict['%FONT_BOLD_BIG%'] = 'sans bold 12'
	my_font_dict['%FONT_BOLD_BIGGER%'] = 'sans bold 14'
	my_font_dict['%FONT_BOLD_LARGE%'] = 'sans bold 18'
	my_font_dict['%FONT_BOLD_LARGER%'] = 'sans bold 24'
	my_font_dict['%FONT_BOLD_HUGE%'] = 'sans bold 25'
	my_font_dict['%FONT_BOLD_HUGER%'] = 'sans bold 34'
	my_font_dict['%FONT_BOLD_MASSIVE%'] = 'sans bold 60'
	my_font_dict['%FONT_ITALIC_TINY%'] = 'sans italic 4'
	my_font_dict['%FONT_ITALIC_SMALLER%'] = 'sans italic 6'
	my_font_dict['%FONT_ITALIC_SMALL%'] = 'sans italic 7'
	my_font_dict['%FONT_ITALIC_NORMAL%'] = 'sans italic 8'
	my_font_dict['%FONT_ITALIC_BIG%'] = 'sans italic 12'
	my_font_dict['%FONT_ITALIC_BIGGER%'] = 'sans italic 14'
	my_font_dict['%FONT_ITALIC_LARGE%'] = 'sans italic 18'
	my_font_dict['%FONT_ITALIC_LARGER%'] = 'sans italic 24'
	my_font_dict['%FONT_ITALIC_HUGE%'] = 'sans italic 25'
	my_font_dict['%FONT_ITALIC_HUGER%'] = 'sans italic 34'
	my_font_dict['%FONT_ITALIC_MASSIVE%'] = 'sans italic 60'

ardour_dark_theme = env.SubstInFile ('ardour2_ui_dark.rc', 'ardour2_ui_dark.rc.in', SUBST_DICT = my_font_dict)
ardour_light_theme = env.SubstInFile ('ardour2_ui_light.rc', 'ardour2_ui_light.rc.in', SUBST_DICT = my_font_dict)

my_subst_dict = { }

#
# null substitution just to avoid ardour.bindings being in svn
#

ardourbindings = env.SubstInFile ('ardour.bindings', 'ardour.bindings.in', SUBST_DICT = my_subst_dict);

my_subst_dict['%INSTALL_PREFIX%'] = final_prefix
my_subst_dict['%LIBDIR%'] = env['LIBDIR']
my_subst_dict['%VERSION%'] = ardour_version

ardoursh = env.SubstInFile ('ardour.sh','ardour.sh.in', SUBST_DICT = my_subst_dict);
env.AddPostAction (ardoursh, Chmod ('$TARGET', 0755))

ardourdev = env.SubstInFile ('ardev_common.sh','ardev_common.sh.in', SUBST_DICT = my_subst_dict);
env.AddPostAction (ardourdev, Chmod ('$TARGET', 0755))

Default(ardourbindings)
Default(ardourdev)
Default(ardoursh)
Default(ardour_dark_theme)
Default(ardour_light_theme)

if env['VST']:
	Default(ardourlib)
	# the library - into the library dir
	env.Alias('install', env.Install(os.path.join(install_prefix, env['LIBDIR'], 'ardour2'), ardourlib))
else:

	if env['VERSIONED']:
		Default (env.VersionedExecutable ('tagged_executable', ardour))
	else:
		Default(ardour)

        #install

	# the executable - into the library dir
	env.Alias('install', env.Install(os.path.join(install_prefix, env['LIBDIR'], 'ardour2'), ardour))
	# the script - into the bin dir
	env.Alias('install', env.InstallAs(os.path.join(install_prefix, 'bin')+'/ardour2', ardoursh))

if env['NLS']:
	i18n (gtkardour, gtkardour_files+skipped_files+fft_analysis_files, env)
    
# configuration files
env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), ardour_dark_theme))
env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), ardour_light_theme))
env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour2_ui_default.conf'))
env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour.menus'))
env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour.bindings'))
# data files
env.Alias('install', env.Install(os.path.join(install_prefix, 'share', 'ardour2'), 'splash.png'))
env.Alias('install', env.Install(os.path.join(install_prefix, 'share', 'ardour2', 'pixmaps'), pixmap_files))
env.Alias('install', env.Install(os.path.join(install_prefix, 'share', 'ardour2', 'icons'), icon_files))

env.Alias ('version', gtkardour.VersionBuild(['version.cc','version.h'], []))
		
#dist
env.Alias ('tarball', env.Distribute (env['DISTTREE'],
                                      [ 'SConscript',
                                        'i18n.h', 'gettext.h',
					'ardour.sh.in',
					'ardev_common.sh.in',
					'ardev', 'ardbg',
                                        'ardour2_ui_dark.rc', 'ardour2_ui_light.rc', 'splash.png',
                                        'ardour.menus', 'ardour.bindings.in', 'ardour2_ui_default.conf',
					'editor_xpms'
                                        ] +
                                      gtkardour_files +
				      vst_files +
				      pixmap_files +
				      icon_files +
				      skipped_files +
				      audiounit_files + 
				      fft_analysis_files +
				      glob.glob('po/*.po') + glob.glob('*.h')))

# generate a prototype full-featured ardour_ui.rc file

env.Alias ('protorc', env.Command ('proto.rc', gtkardour_files, """
     grep set_name $SOURCES | \
sed 's/.*("\([a-zA-Z_][a-zA-Z_]*\)").*/\\1/' | \
grep -v '\\.' | sort | uniq | \
awk '/\\./ {} { printf ("style \\"%s\\"\\n{\\n\
  fg[NORMAL] =   { 0, 0, 0 }\\n\
  fg[ACTIVE] =   { 0, 0, 0 }\\n\
  fg[SELECTED] = { 0, 0, 0 }\\n\
  bg[NORMAL] =   { 0, 0, 0 }\\n\
  bg[ACTIVE] =   { 0, 0, 0 }\\n\
  bg[SELECTED] = { 0, 0, 0 }\\n\
}\\nwidget \\"*%s\\" style \\"%s\\"\\nwidget \\"*%s*\\" style \\"%s\\"\\n\\n", \
  $$0, $$0, $$0, $$0, $$0) }' > $TARGET && \
     grep 'color_map\[[a-zA-Z_][a-zA-Z]*\]' $SOURCES | \
 sed 's/.*\[\([a-zA-Z_][a-zA-Z_]*\)].*/\\1/'| \
 sort | uniq | \
 awk '{ printf ("style \\"%s\\"\\n{\\n\
  fg[NORMAL] =   { 0, 0, 0 }\\n\
  fg[ACTIVE] =   { 0, 0, 0 }\\n\
}\\nwidget \\"*%s\\" style \\"%s\\"\\n \\n\\n", $$0, $$0, $$0) }' >> $TARGET ;
"""
))