-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
depends.py
1534 lines (1333 loc) · 69.5 KB
/
depends.py
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
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# -*- coding: utf-8 -*-
import os
from . import util
from .mixxx import Dependence, Feature
import SCons.Script as SCons
class PortAudio(Dependence):
def configure(self, build, conf):
if not conf.CheckLib('portaudio'):
raise Exception(
'Did not find libportaudio.a, portaudio.lib, or the PortAudio-v19 development header files.')
elif build.platform_is_linux:
build.env.ParseConfig('pkg-config portaudio-2.0 --silence-errors --cflags --libs')
if build.platform_is_windows and build.static_dependencies:
conf.CheckLib('advapi32')
def sources(self, build):
return ['src/soundio/sounddeviceportaudio.cpp']
class PortMIDI(Dependence):
def configure(self, build, conf):
# Check for PortTime
libs = ['porttime', 'libporttime']
headers = ['porttime.h']
# Depending on the library configuration PortTime might be statically
# linked with PortMidi. We treat either presence of the lib or the
# header as success.
if not conf.CheckLib(libs) and not conf.CheckHeader(headers):
raise Exception("Did not find PortTime or its development headers.")
# Check for PortMidi
libs = ['portmidi', 'libportmidi']
headers = ['portmidi.h']
if build.platform_is_windows and build.static_dependencies:
conf.CheckLib('advapi32')
if build.platform_is_windows:
# We have this special branch here because on Windows we might want
# to link PortMidi statically which we don't want to do on other
# platforms.
# TODO(rryan): Remove this? Don't want to break anyone but the
# static/dynamic choice should be made by the whether the .a is an
# import library for a shared library or a static library.
libs.append('portmidi_s')
if not conf.CheckLib(libs) or not conf.CheckHeader(headers):
raise Exception("Did not find PortMidi or its development headers.")
def sources(self, build):
return ['src/controllers/midi/portmidienumerator.cpp',
'src/controllers/midi/portmidicontroller.cpp']
class OpenGL(Dependence):
def configure(self, build, conf):
if build.platform_is_osx:
build.env.AppendUnique(FRAMEWORKS='OpenGL')
# Check for OpenGL (it's messy to do it for all three platforms).
if (not conf.CheckLib('GL') and
not conf.CheckLib('opengl32') and
not conf.CheckCHeader('OpenGL/gl.h') and
not conf.CheckCHeader('GL/gl.h')):
raise Exception('Did not find OpenGL development files')
if (not conf.CheckLib('GLU') and
not conf.CheckLib('glu32') and
not conf.CheckCHeader('OpenGL/glu.h')):
raise Exception('Did not find GLU development files')
class SecurityFramework(Dependence):
"""The iOS/OS X security framework is used to implement sandboxing."""
def configure(self, build, conf):
if not build.platform_is_osx:
return
build.env.Append(CPPPATH='/System/Library/Frameworks/Security.framework/Headers/')
build.env.Append(LINKFLAGS='-framework Security')
class CoreServices(Dependence):
def configure(self, build, conf):
if not build.platform_is_osx:
return
build.env.Append(CPPPATH='/System/Library/Frameworks/CoreServices.framework/Headers/')
build.env.Append(LINKFLAGS='-framework CoreServices')
class IOKit(Dependence):
"""Used for battery measurements and controlling the screensaver on OS X and iOS."""
def configure(self, build, conf):
if not build.platform_is_osx:
return
build.env.Append(
CPPPATH='/System/Library/Frameworks/IOKit.framework/Headers/')
build.env.Append(LINKFLAGS='-framework IOKit')
class UPower(Dependence):
"""UPower is used to get battery measurements on Linux."""
def configure(self, build, conf):
if not build.platform_is_linux:
return
build.env.ParseConfig(
'pkg-config upower-glib --silence-errors --cflags --libs')
class OggVorbis(Dependence):
def configure(self, build, conf):
libs = ['libvorbisfile', 'vorbisfile']
if not conf.CheckLib(libs):
Exception('Did not find libvorbisfile.a, libvorbisfile.lib, '
'or the libvorbisfile development headers.')
libs = ['libvorbis', 'vorbis']
if not conf.CheckLib(libs):
raise Exception(
'Did not find libvorbis.a, libvorbis.lib, or the libvorbis development headers.')
libs = ['libogg', 'ogg']
if not conf.CheckLib(libs):
raise Exception(
'Did not find libogg.a, libogg.lib, or the libogg development headers')
# libvorbisenc only exists on Linux, OSX and mingw32 on Windows. On
# Windows with MSVS it is included in vorbisfile.dll. libvorbis and
# libogg are included from build.py so don't add here.
if not build.platform_is_windows or build.toolchain_is_gnu:
vorbisenc_found = conf.CheckLib(['libvorbisenc', 'vorbisenc'])
if not vorbisenc_found:
raise Exception(
'Did not find libvorbisenc.a, libvorbisenc.lib, or the libvorbisenc development headers.')
def sources(self, build):
return ['src/sources/soundsourceoggvorbis.cpp']
class SndFile(Dependence):
def configure(self, build, conf):
if not conf.CheckLib(['sndfile', 'libsndfile', 'libsndfile-1']):
raise Exception(
"Did not find libsndfile or it\'s development headers")
build.env.Append(CPPDEFINES='__SNDFILE__')
if conf.CheckDeclaration('SFC_SET_COMPRESSION_LEVEL', '#include "sndfile.h"'):
build.env.Append(CPPDEFINES='SFC_SUPPORTS_SET_COMPRESSION_LEVEL')
if build.platform_is_windows and build.static_dependencies:
build.env.Append(CPPDEFINES='FLAC__NO_DLL')
conf.CheckLib('g72x')
def sources(self, build):
return ['src/sources/soundsourcesndfile.cpp']
class FLAC(Dependence):
def configure(self, build, conf):
if not conf.CheckHeader('FLAC/stream_decoder.h'):
raise Exception('Did not find libFLAC development headers')
libs = ['libFLAC', 'FLAC']
if not conf.CheckLib(libs):
raise Exception('Did not find libFLAC development libraries')
if build.platform_is_windows and build.static_dependencies:
build.env.Append(CPPDEFINES='FLAC__NO_DLL')
def sources(self, build):
return ['src/sources/soundsourceflac.cpp',]
class Qt(Dependence):
DEFAULT_QT5DIRS64 = {'linux': '/usr/lib/x86_64-linux-gnu/qt5',
'osx': '/Library/Frameworks',
'windows': 'C:\\qt\\5.11.1'}
DEFAULT_QT5DIRS32 = {'linux': '/usr/lib/i386-linux-gnu/qt5',
'osx': '/Library/Frameworks',
'windows': 'C:\\qt\\5.11.1'}
@staticmethod
def uic(build):
return build.env.Uic5
@staticmethod
def find_framework_libdir(qtdir):
# Try pkg-config on Linux
import sys
if sys.platform.startswith('linux'):
if any(os.access(os.path.join(path, 'pkg-config'), os.X_OK) for path in os.environ["PATH"].split(os.pathsep)):
import subprocess
try:
core = subprocess.Popen(["pkg-config", "--variable=libdir", "Qt5Core"], stdout = subprocess.PIPE).communicate()[0].rstrip().decode()
finally:
if os.path.isdir(core):
return core
for d in (os.path.join(qtdir, x) for x in ['', 'Frameworks', 'lib']):
core = os.path.join(d, 'QtCore.framework')
if os.path.isdir(core):
return d
return None
@staticmethod
def enabled_modules(build):
qt_modules = [
# Keep alphabetized.
'QtConcurrent',
'QtCore',
'QtGui',
'QtNetwork',
'QtOpenGL',
'QtScript',
'QtScriptTools',
'QtSql',
'QtSvg',
'QtTest',
'QtWidgets',
'QtXml',
]
if build.platform_is_windows:
qt_modules.extend([
# Keep alphabetized.
'QtAccessibilitySupport',
'QtEventDispatcherSupport',
'QtFontDatabaseSupport',
'QtThemeSupport',
'QtWindowsUIAutomationSupport',
])
return qt_modules
@staticmethod
def enabled_imageformats(build):
qt_imageformats = [
# Keep alphabetized.
'qdds',
'qgif',
'qicns',
'qico',
'qjp2',
'qjpeg',
'qmng',
'qsvg',
'qtga',
'qtiff',
'qwbmp',
'qwebp',
]
return qt_imageformats
def satisfy(self):
pass
def configure(self, build, conf):
qt_modules = Qt.enabled_modules(build)
# Emit various Qt defines
build.env.Append(CPPDEFINES=['QT_TABLET_SUPPORT'])
if build.static_qt:
build.env.Append(CPPDEFINES='QT_NODLL')
else:
build.env.Append(CPPDEFINES='QT_SHARED')
# Set qt_sqlite_plugin flag if we should package the Qt SQLite plugin.
build.flags['qt_sqlite_plugin'] = util.get_flags(
build.env, 'qt_sqlite_plugin', 0)
# Link in SQLite library if Qt is compiled statically
if build.platform_is_windows and build.static_dependencies \
and build.flags['qt_sqlite_plugin'] == 0 :
conf.CheckLib('sqlite3');
# Enable Qt include paths
if build.platform_is_linux:
if not conf.CheckForPKG('Qt5Core', '5.0'):
raise Exception('Qt >= 5.0 not found')
if not conf.CheckLib('Qt5X11Extras'):
raise Exception('Could not find Qt5X11Extras or its development headers')
qt_modules.extend(['QtDBus'])
# This automatically converts QtXXX to Qt5XXX where appropriate.
build.env.EnableQt5Modules(qt_modules, debug=False)
if build.architecture_is_x86:
# Note that -reduce-relocations is enabled by default in Qt5.
# So we must build the Mixxx *executable* with position
# independent code. -pie / -fPIE must not be used, and Clang
# -flto must not be used when producing ELFs (i.e. on Linux).
# http://lists.qt-project.org/pipermail/development/2012-January/001418.html
# https://github.com/qt/qtbase/blob/c5307203f5c0b0e588cc93e70764c090dd4c2ce0/dist/changes-5.4.2#L37-L45
# https://codereview.qt-project.org/#/c/111787/
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65886#c30
build.env.Append(CCFLAGS='-fPIC')
elif build.platform_is_bsd:
build.env.Append(LIBS=qt_modules)
include_paths = ['$QTDIR/include/%s' % module
for module in qt_modules]
build.env.Append(CPPPATH=include_paths)
elif build.platform_is_osx:
qtdir = build.env['QTDIR']
build.env.Append(
LINKFLAGS=' '.join('-framework %s' % m for m in qt_modules)
)
framework_path = Qt.find_framework_libdir(qtdir)
if not framework_path:
raise Exception(
'Could not find frameworks in Qt directory: %s' % qtdir)
# Necessary for raw includes of headers like #include <qobject.h>
build.env.Append(CPPPATH=[os.path.join(framework_path, '%s.framework' % m, 'Headers')
for m in qt_modules])
# Framework path needs to be altered for CCFLAGS as well since a
# header include of QtCore/QObject.h looks for a QtCore.framework on
# the search path and a QObject.h in QtCore.framework/Headers.
build.env.Append(CCFLAGS=['-F%s' % os.path.join(framework_path)])
build.env.Append(LINKFLAGS=['-F%s' % os.path.join(framework_path)])
# Copied verbatim from qt5.py.
# TODO(rryan): Get our fixes merged upstream so we can use qt5.py for OS X.
module_defines = {
'QtScript' : ['QT_SCRIPT_LIB'],
'QtSvg' : ['QT_SVG_LIB'],
'QtSql' : ['QT_SQL_LIB'],
'QtXml' : ['QT_XML_LIB'],
'QtOpenGL' : ['QT_OPENGL_LIB'],
'QtGui' : ['QT_GUI_LIB'],
'QtNetwork' : ['QT_NETWORK_LIB'],
'QtCore' : ['QT_CORE_LIB'],
'QtWidgets' : ['QT_WIDGETS_LIB'],
}
for module in qt_modules:
build.env.AppendUnique(CPPDEFINES=module_defines.get(module, []))
build.env["QT5_MOCCPPPATH"] = build.env["CPPPATH"]
elif build.platform_is_windows:
# This automatically converts QtCore to QtCore[45][d] where
# appropriate.
build.env.EnableQt5Modules(qt_modules,
staticdeps=build.static_qt,
debug=build.build_is_debug)
if build.static_qt:
# Pulled from qt-4.8.2-source\mkspecs\win32-msvc2010\qmake.conf
# QtCore
build.env.Append(LIBS = 'kernel32')
build.env.Append(LIBS = 'user32') # QtGui, QtOpenGL, libHSS1394
build.env.Append(LIBS = 'shell32')
build.env.Append(LIBS = 'uuid')
build.env.Append(LIBS = 'ole32') # QtGui,
build.env.Append(LIBS = 'advapi32') # QtGui, portaudio, portmidi
build.env.Append(LIBS = 'ws2_32') # QtGui, QtNetwork, libshout
# QtGui
build.env.Append(LIBS = 'gdi32') #QtOpenGL, libshout
build.env.Append(LIBS = 'comdlg32')
build.env.Append(LIBS = 'oleaut32')
build.env.Append(LIBS = 'imm32')
build.env.Append(LIBS = 'winmm')
build.env.Append(LIBS = 'winspool')
# QtOpenGL
build.env.Append(LIBS = 'glu32')
build.env.Append(LIBS = 'opengl32')
# QtNetwork openssl-linked
build.env.Append(LIBS = 'crypt32')
# New libraries required by Qt5.
build.env.Append(LIBS = 'dwmapi') # qtwindows
build.env.Append(LIBS = 'iphlpapi') # qt5network
build.env.Append(LIBS = 'libEGL') # qt5opengl
build.env.Append(LIBS = 'libGLESv2') # qt5opengl
build.env.Append(LIBS = 'mpr') # qt5core
build.env.Append(LIBS = 'netapi32') # qt5core
build.env.Append(LIBS = 'userenv') # qt5core
build.env.Append(LIBS = 'uxtheme') # ?
build.env.Append(LIBS = 'version') # ?
build.env.Append(LIBS = 'wtsapi32') # ?
build.env.Append(LIBS = 'qtfreetype')
build.env.Append(LIBS = 'qtharfbuzz')
build.env.Append(LIBS = 'qtlibpng')
build.env.Append(LIBS = 'qtpcre2')
# NOTE(rryan): If you are adding a plugin here, you must also
# update src/mixxxapplication.cpp to define a Q_IMPORT_PLUGIN
# for it. Not all imageformats plugins are built as .libs when
# building Qt statically on Windows. Check the build environment
# to see exactly what's available as a standalone .lib vs linked
# into Qt .libs by default.
# iconengines plugins
build.env.Append(LIBPATH=[
os.path.join(build.env['QTDIR'],'plugins/iconengines')])
build.env.Append(LIBS = 'qsvgicon')
# imageformats plugins
build.env.Append(LIBPATH=[
os.path.join(build.env['QTDIR'],'plugins/imageformats')])
build.env.Append(LIBS = 'qico')
build.env.Append(LIBS = 'qsvg')
build.env.Append(LIBS = 'qtga')
build.env.Append(LIBS = 'qgif')
build.env.Append(LIBS = 'qjpeg')
# platform plugins (new in Qt5 for Windows)
build.env.Append(LIBPATH=[
os.path.join(build.env['QTDIR'],'plugins/platforms')])
build.env.Append(LIBS = 'qwindows')
# styles (new in Qt5 for Windows)
build.env.Append(LIBPATH=[
os.path.join(build.env['QTDIR'],'plugins/styles')])
build.env.Append(LIBS = 'qwindowsvistastyle')
# sqldrivers (new in Qt5? or did we just start enabling them)
build.env.Append(LIBPATH=[
os.path.join(build.env['QTDIR'],'plugins/sqldrivers')])
build.env.Append(LIBS = 'qsqlite')
# Set the rpath for linux/bsd/macOS.
if not build.platform_is_windows:
qtdir = build.env['QTDIR']
libdir_path = Qt.find_framework_libdir(qtdir)
if os.path.isdir(libdir_path):
build.env.Append(LINKFLAGS=['-Wl,-rpath,%s' % libdir_path])
build.env.Append(LINKFLAGS="-L" + libdir_path)
# Mixxx requires C++11 support. Windows enables C++11 features by
# default but Clang/GCC require a flag.
if not build.platform_is_windows:
build.env.Append(CXXFLAGS='-std=c++11')
class TestHeaders(Dependence):
def configure(self, build, conf):
build.env.Append(CPPPATH="#lib/gtest-1.7.0/include")
class FidLib(Dependence):
def sources(self, build):
symbol = None
if build.platform_is_windows:
if build.toolchain_is_msvs:
symbol = 'T_MSVC'
elif build.crosscompile:
# Not sure why, but fidlib won't build with mingw32msvc and
# T_MINGW
symbol = 'T_LINUX'
elif build.toolchain_is_gnu:
symbol = 'T_MINGW'
else:
symbol = 'T_LINUX'
return [build.env.StaticObject('lib/fidlib/fidlib.c',
CPPDEFINES=symbol)]
def configure(self, build, conf):
build.env.Append(CPPPATH='#lib/fidlib/')
class ReplayGain(Dependence):
def sources(self, build):
return ["lib/replaygain/replaygain.cpp"]
def configure(self, build, conf):
build.env.Append(CPPPATH="#lib/replaygain")
class Ebur128Mit(Dependence):
INTERNAL_PATH = 'lib/libebur128'
INTERNAL_LINK = False
def sources(self, build):
if self.INTERNAL_LINK:
return ['%s/ebur128/ebur128.c' % self.INTERNAL_PATH]
def configure(self, build, conf, env=None):
if env is None:
env = build.env
if not conf.CheckLib(['ebur128', 'libebur128']):
self.INTERNAL_LINK = True;
env.Append(CPPPATH=['#%s/ebur128' % self.INTERNAL_PATH])
if not conf.CheckHeader('sys/queue.h'):
env.Append(CPPPATH=['#%s/ebur128/queue' % self.INTERNAL_PATH])
class SoundTouch(Dependence):
SOUNDTOUCH_INTERNAL_PATH = 'lib/soundtouch'
INTERNAL_LINK = True
def sources(self, build):
if self.INTERNAL_LINK:
env = build.env.Clone()
soundtouch_dir = env.Dir(self.SOUNDTOUCH_INTERNAL_PATH)
SCons.Export('env')
SCons.Export('build')
env.SConscript(env.File('SConscript', soundtouch_dir))
build.env.Append(LIBPATH=self.SOUNDTOUCH_INTERNAL_PATH)
build.env.Append(LIBS=['soundtouch'])
return ['src/engine/bufferscalers/enginebufferscalest.cpp']
def configure(self, build, conf, env=None):
if env is None:
env = build.env
if build.platform_is_linux:
# Try using system lib
if conf.CheckForPKG('soundtouch', '2.0.0'):
# System Lib found
if not conf.CheckLib(['SoundTouch']):
raise Exception(
"Could not find libSoundTouch or its development headers.")
build.env.ParseConfig('pkg-config soundtouch --silence-errors --cflags --libs')
self.INTERNAL_LINK = False
if self.INTERNAL_LINK:
env.Append(CPPPATH=['#' + self.SOUNDTOUCH_INTERNAL_PATH])
# Prevents circular import.
from .features import Optimize
# If we do not want optimizations then disable them.
optimize = (build.flags['optimize'] if 'optimize' in build.flags
else Optimize.get_optimization_level(build))
if optimize == Optimize.LEVEL_OFF:
env.Append(CPPDEFINES='SOUNDTOUCH_DISABLE_X86_OPTIMIZATIONS')
class RubberBand(Dependence):
def sources(self, build):
sources = ['src/engine/bufferscalers/enginebufferscalerubberband.cpp', ]
return sources
def configure(self, build, conf, env=None):
if env is None:
env = build.env
if not conf.CheckLib(['rubberband', 'librubberband']):
raise Exception(
"Could not find librubberband or its development headers.")
class QueenMaryDsp(Dependence):
def sources(self, build):
return [
#"#lib/qm-dsp/base/KaiserWindow.cpp",
"#lib/qm-dsp/base/Pitch.cpp",
#"#lib/qm-dsp/base/SincWindow.cpp",
"#lib/qm-dsp/dsp/chromagram/CQprecalc.cpp",
"#lib/qm-dsp/dsp/chromagram/Chromagram.cpp",
"#lib/qm-dsp/dsp/chromagram/ConstantQ.cpp",
"#lib/qm-dsp/dsp/keydetection/GetKeyMode.cpp",
#"#lib/qm-dsp/dsp/mfcc/MFCC.cpp",
"#lib/qm-dsp/dsp/onsets/DetectionFunction.cpp",
"#lib/qm-dsp/dsp/onsets/PeakPicking.cpp",
"#lib/qm-dsp/dsp/phasevocoder/PhaseVocoder.cpp",
"#lib/qm-dsp/dsp/rateconversion/Decimator.cpp",
#"#lib/qm-dsp/dsp/rateconversion/DecimatorB.cpp",
#"#lib/qm-dsp/dsp/rateconversion/Resampler.cpp",
#"#lib/qm-dsp/dsp/rhythm/BeatSpectrum.cpp",
#"#lib/qm-dsp/dsp/segmentation/ClusterMeltSegmenter.cpp",
#"#lib/qm-dsp/dsp/segmentation/Segmenter.cpp",
#"#lib/qm-dsp/dsp/segmentation/cluster_melt.c",
#"#lib/qm-dsp/dsp/segmentation/cluster_segmenter.c",
"#lib/qm-dsp/dsp/signalconditioning/DFProcess.cpp",
"#lib/qm-dsp/dsp/signalconditioning/FiltFilt.cpp",
"#lib/qm-dsp/dsp/signalconditioning/Filter.cpp",
"#lib/qm-dsp/dsp/signalconditioning/Framer.cpp",
"#lib/qm-dsp/dsp/tempotracking/DownBeat.cpp",
"#lib/qm-dsp/dsp/tempotracking/TempoTrack.cpp",
"#lib/qm-dsp/dsp/tempotracking/TempoTrackV2.cpp",
"#lib/qm-dsp/dsp/tonal/ChangeDetectionFunction.cpp",
"#lib/qm-dsp/dsp/tonal/TCSgram.cpp",
"#lib/qm-dsp/dsp/tonal/TonalEstimator.cpp",
"#lib/qm-dsp/dsp/transforms/FFT.cpp",
#"#lib/qm-dsp/dsp/wavelet/Wavelet.cpp",
"#lib/qm-dsp/ext/kissfft/kiss_fft.c",
"#lib/qm-dsp/ext/kissfft/kiss_fftr.c",
#"#lib/qm-dsp/hmm/hmm.c",
"#lib/qm-dsp/maths/Correlation.cpp",
#"#lib/qm-dsp/maths/CosineDistance.cpp",
"#lib/qm-dsp/maths/KLDivergence.cpp",
"#lib/qm-dsp/maths/MathUtilities.cpp",
#"#lib/qm-dsp/maths/pca/pca.c",
#"#lib/qm-dsp/thread/Thread.cpp"
]
def configure(self, build, conf):
build.env.Append(CPPPATH="#lib/qm-dsp")
build.env.Append(CPPPATH="#lib/qm-dsp/include")
build.env.Append(CPPDEFINES='kiss_fft_scalar=double')
if not build.platform_is_windows:
build.env.Append(CPPDEFINES='USE_PTHREADS')
class TagLib(Dependence):
def configure(self, build, conf):
libs = ['tag']
if not conf.CheckLib(libs):
raise Exception(
"Could not find libtag or its development headers.")
# Karmic seems to have an issue with mp4tag.h where they don't include
# the files correctly. Adding this folder to the include path should fix
# it, though might cause issues. This is safe to remove once we
# deprecate Karmic support. rryan 2/2011
build.env.Append(CPPPATH='/usr/include/taglib/')
if build.platform_is_windows and build.static_dependencies:
build.env.Append(CPPDEFINES='TAGLIB_STATIC')
class Chromaprint(Dependence):
def configure(self, build, conf):
if not conf.CheckLib(['chromaprint', 'libchromaprint', 'chromaprint_p', 'libchromaprint_p']):
raise Exception(
"Could not find libchromaprint or its development headers.")
if build.platform_is_windows and build.static_dependencies:
build.env.Append(CPPDEFINES='CHROMAPRINT_NODLL')
# On Windows, we link chromaprint with FFTW3.
if not conf.CheckLib(['fftw', 'libfftw', 'fftw3', 'libfftw3', 'libfftw-3.3']):
raise Exception(
"Could not find fftw3 or its development headers.")
class ProtoBuf(Dependence):
def configure(self, build, conf):
libs = ['libprotobuf-lite', 'protobuf-lite', 'libprotobuf', 'protobuf']
if build.platform_is_windows:
if not build.static_dependencies:
build.env.Append(CPPDEFINES='PROTOBUF_USE_DLLS')
# SCons is supposed to check this for us by calling 'exists' in build/protoc.py.
protoc_binary = build.env['PROTOC']
if build.env.WhereIs(protoc_binary) is None:
raise Exception("Can't locate '%s' the protobuf compiler." % protoc_binary)
if not conf.CheckLib(libs):
raise Exception(
"Could not find libprotobuf or its development headers.")
class FpClassify(Dependence):
def enabled(self, build):
return build.toolchain_is_gnu
# This is a wrapper around the fpclassify function that prevents inlining
# It is compiled without optimization and allows to use these function
# from -ffast-math optimized objects
def sources(self, build):
# add this file without fast-math flag
env = build.env.Clone()
if '-ffast-math' in env['CCFLAGS']:
env['CCFLAGS'].remove('-ffast-math')
return env.Object('src/util/fpclassify.cpp')
class QtScriptByteArray(Dependence):
def configure(self, build, conf):
build.env.Append(CPPPATH='#lib/qtscript-bytearray')
def sources(self, build):
return ['lib/qtscript-bytearray/bytearrayclass.cpp',
'lib/qtscript-bytearray/bytearrayprototype.cpp']
class PortAudioRingBuffer(Dependence):
def configure(self, build, conf):
build.env.Append(CPPPATH='#lib/portaudio')
def sources(self, build):
return ['lib/portaudio/pa_ringbuffer.c']
class Reverb(Dependence):
def configure(self, build, conf):
build.env.Append(CPPPATH='#lib/reverb')
def sources(self, build):
return ['lib/reverb/Reverb.cc']
class LAME(Dependence):
def configure(self, build, conf):
if not conf.CheckLib(['libmp3lame', 'libmp3lame-static']):
raise Exception("Could not find libmp3lame.")
class MixxxCore(Feature):
def description(self):
return "Mixxx Core Features"
def enabled(self, build):
return True
def sources(self, build):
sources = ["src/control/control.cpp",
"src/control/controlaudiotaperpot.cpp",
"src/control/controlbehavior.cpp",
"src/control/controleffectknob.cpp",
"src/control/controlindicator.cpp",
"src/control/controllinpotmeter.cpp",
"src/control/controllogpotmeter.cpp",
"src/control/controlmodel.cpp",
"src/control/controlobject.cpp",
"src/control/controlobjectscript.cpp",
"src/control/controlpotmeter.cpp",
"src/control/controlproxy.cpp",
"src/control/controlpushbutton.cpp",
"src/control/controlttrotary.cpp",
"src/control/controlencoder.cpp",
"src/controllers/dlgcontrollerlearning.cpp",
"src/controllers/dlgprefcontroller.cpp",
"src/controllers/dlgprefcontrollers.cpp",
"src/dialog/dlgabout.cpp",
"src/dialog/dlgdevelopertools.cpp",
"src/preferences/configobject.cpp",
"src/preferences/dialog/dlgprefautodj.cpp",
"src/preferences/dialog/dlgprefdeck.cpp",
"src/preferences/dialog/dlgprefcrossfader.cpp",
"src/preferences/dialog/dlgprefeffects.cpp",
"src/preferences/dialog/dlgprefeq.cpp",
"src/preferences/dialog/dlgpreferences.cpp",
"src/preferences/dialog/dlgprefinterface.cpp",
"src/preferences/dialog/dlgpreflibrary.cpp",
"src/preferences/dialog/dlgprefnovinyl.cpp",
"src/preferences/dialog/dlgprefrecord.cpp",
"src/preferences/dialog/dlgprefreplaygain.cpp",
"src/preferences/dialog/dlgprefsound.cpp",
"src/preferences/dialog/dlgprefsounditem.cpp",
"src/preferences/dialog/dlgprefwaveform.cpp",
"src/preferences/dialog/dlgprefbeats.cpp",
"src/preferences/dialog/dlgprefkey.cpp",
"src/preferences/settingsmanager.cpp",
"src/preferences/replaygainsettings.cpp",
"src/preferences/broadcastsettings.cpp",
"src/preferences/broadcastsettings_legacy.cpp",
"src/preferences/broadcastsettingsmodel.cpp",
"src/preferences/effectsettingsmodel.cpp",
"src/preferences/broadcastprofile.cpp",
"src/preferences/upgrade.cpp",
"src/preferences/dlgpreferencepage.cpp",
"src/effects/effectmanifest.cpp",
"src/effects/effectmanifestparameter.cpp",
"src/effects/effectchain.cpp",
"src/effects/effect.cpp",
"src/effects/effectparameter.cpp",
"src/effects/effectrack.cpp",
"src/effects/effectchainslot.cpp",
"src/effects/effectslot.cpp",
"src/effects/effectparameterslotbase.cpp",
"src/effects/effectparameterslot.cpp",
"src/effects/effectbuttonparameterslot.cpp",
"src/effects/effectsmanager.cpp",
"src/effects/effectchainmanager.cpp",
"src/effects/effectsbackend.cpp",
"src/effects/builtin/builtinbackend.cpp",
"src/effects/builtin/bitcrushereffect.cpp",
"src/effects/builtin/balanceeffect.cpp",
"src/effects/builtin/linkwitzriley8eqeffect.cpp",
"src/effects/builtin/bessel4lvmixeqeffect.cpp",
"src/effects/builtin/bessel8lvmixeqeffect.cpp",
"src/effects/builtin/threebandbiquadeqeffect.cpp",
"src/effects/builtin/biquadfullkilleqeffect.cpp",
"src/effects/builtin/loudnesscontoureffect.cpp",
"src/effects/builtin/graphiceqeffect.cpp",
"src/effects/builtin/parametriceqeffect.cpp",
"src/effects/builtin/flangereffect.cpp",
"src/effects/builtin/filtereffect.cpp",
"src/effects/builtin/moogladder4filtereffect.cpp",
"src/effects/builtin/reverbeffect.cpp",
"src/effects/builtin/echoeffect.cpp",
"src/effects/builtin/autopaneffect.cpp",
"src/effects/builtin/phasereffect.cpp",
"src/effects/builtin/metronomeeffect.cpp",
"src/effects/builtin/tremoloeffect.cpp",
"src/engine/effects/engineeffectsmanager.cpp",
"src/engine/effects/engineeffectrack.cpp",
"src/engine/effects/engineeffectchain.cpp",
"src/engine/effects/engineeffect.cpp",
"src/engine/sync/basesyncablelistener.cpp",
"src/engine/sync/enginesync.cpp",
"src/engine/sync/synccontrol.cpp",
"src/engine/sync/internalclock.cpp",
"src/engine/engineworker.cpp",
"src/engine/engineworkerscheduler.cpp",
"src/engine/enginebuffer.cpp",
"src/engine/bufferscalers/enginebufferscale.cpp",
"src/engine/bufferscalers/enginebufferscalelinear.cpp",
"src/engine/channels/engineaux.cpp",
"src/engine/channels/enginechannel.cpp",
"src/engine/channels/enginedeck.cpp",
"src/engine/channels/enginemicrophone.cpp",
"src/engine/filters/enginefilterbiquad1.cpp",
"src/engine/filters/enginefiltermoogladder4.cpp",
"src/engine/filters/enginefilterbessel4.cpp",
"src/engine/filters/enginefilterbessel8.cpp",
"src/engine/filters/enginefilterbutterworth4.cpp",
"src/engine/filters/enginefilterbutterworth8.cpp",
"src/engine/filters/enginefilterlinkwitzriley2.cpp",
"src/engine/filters/enginefilterlinkwitzriley4.cpp",
"src/engine/filters/enginefilterlinkwitzriley8.cpp",
"src/engine/filters/enginefilter.cpp",
"src/engine/engineobject.cpp",
"src/engine/enginepregain.cpp",
"src/engine/enginemaster.cpp",
"src/engine/enginedelay.cpp",
"src/engine/enginevumeter.cpp",
"src/engine/enginesidechaincompressor.cpp",
"src/engine/sidechain/enginesidechain.cpp",
"src/engine/sidechain/networkoutputstreamworker.cpp",
"src/engine/sidechain/networkinputstreamworker.cpp",
"src/engine/enginexfader.cpp",
"src/engine/channelmixer_autogen.cpp",
"src/engine/positionscratchcontroller.cpp",
"src/engine/controls/bpmcontrol.cpp",
"src/engine/controls/clockcontrol.cpp",
"src/engine/controls/cuecontrol.cpp",
"src/engine/controls/enginecontrol.cpp",
"src/engine/controls/keycontrol.cpp",
"src/engine/controls/loopingcontrol.cpp",
"src/engine/controls/quantizecontrol.cpp",
"src/engine/controls/ratecontrol.cpp",
"src/engine/readaheadmanager.cpp",
"src/engine/enginetalkoverducking.cpp",
"src/engine/cachingreader/cachingreader.cpp",
"src/engine/cachingreader/cachingreaderchunk.cpp",
"src/engine/cachingreader/cachingreaderworker.cpp",
"src/analyzer/trackanalysisscheduler.cpp",
"src/analyzer/analyzerthread.cpp",
"src/analyzer/analyzerwaveform.cpp",
"src/analyzer/analyzergain.cpp",
"src/analyzer/analyzerbeats.cpp",
"src/analyzer/analyzerkey.cpp",
"src/analyzer/analyzerebur128.cpp",
"src/analyzer/plugins/analyzersoundtouchbeats.cpp",
"src/analyzer/plugins/analyzerqueenmarybeats.cpp",
"src/analyzer/plugins/analyzerqueenmarykey.cpp",
"src/controllers/controller.cpp",
"src/controllers/controllerdebug.cpp",
"src/controllers/controllerengine.cpp",
"src/controllers/controllerenumerator.cpp",
"src/controllers/controllerlearningeventfilter.cpp",
"src/controllers/controllermanager.cpp",
"src/controllers/controllerpresetfilehandler.cpp",
"src/controllers/controllerpresetinfo.cpp",
"src/controllers/controllerpresetinfoenumerator.cpp",
"src/controllers/controlpickermenu.cpp",
"src/controllers/controllermappingtablemodel.cpp",
"src/controllers/controllerinputmappingtablemodel.cpp",
"src/controllers/controlleroutputmappingtablemodel.cpp",
"src/controllers/delegates/controldelegate.cpp",
"src/controllers/delegates/midichanneldelegate.cpp",
"src/controllers/delegates/midiopcodedelegate.cpp",
"src/controllers/delegates/midibytedelegate.cpp",
"src/controllers/delegates/midioptionsdelegate.cpp",
"src/controllers/learningutils.cpp",
"src/controllers/midi/midimessage.cpp",
"src/controllers/midi/midiutils.cpp",
"src/controllers/midi/midicontroller.cpp",
"src/controllers/midi/midicontrollerpresetfilehandler.cpp",
"src/controllers/midi/midienumerator.cpp",
"src/controllers/midi/midioutputhandler.cpp",
"src/controllers/softtakeover.cpp",
"src/controllers/keyboard/keyboardeventfilter.cpp",
"src/controllers/colorjsproxy.cpp",
"src/main.cpp",
"src/mixxx.cpp",
"src/mixxxapplication.cpp",
"src/errordialoghandler.cpp",
"src/sources/audiosource.cpp",
"src/sources/audiosourcestereoproxy.cpp",
"src/sources/metadatasourcetaglib.cpp",
"src/sources/soundsource.cpp",
"src/sources/soundsourceproviderregistry.cpp",
"src/sources/soundsourceproxy.cpp",
"src/widget/controlwidgetconnection.cpp",
"src/widget/wbasewidget.cpp",
"src/widget/wwidget.cpp",
"src/widget/wwidgetgroup.cpp",
"src/widget/wwidgetstack.cpp",
"src/widget/wsizeawarestack.cpp",
"src/widget/wlabel.cpp",
"src/widget/wtracktext.cpp",
"src/widget/wnumber.cpp",
"src/widget/wbeatspinbox.cpp",
"src/widget/wnumberdb.cpp",
"src/widget/wnumberpos.cpp",
"src/widget/wnumberrate.cpp",
"src/widget/wknob.cpp",
"src/widget/wknobcomposed.cpp",
"src/widget/wdisplay.cpp",
"src/widget/wvumeter.cpp",
"src/widget/wpushbutton.cpp",
"src/widget/weffectpushbutton.cpp",
"src/widget/wslidercomposed.cpp",
"src/widget/wstatuslight.cpp",
"src/widget/woverview.cpp",
"src/widget/woverviewlmh.cpp",
"src/widget/woverviewhsv.cpp",
"src/widget/woverviewrgb.cpp",
"src/widget/wspinny.cpp",
"src/widget/wskincolor.cpp",
"src/widget/wsearchlineedit.cpp",
"src/widget/wpixmapstore.cpp",
"src/widget/paintable.cpp",
"src/widget/wimagestore.cpp",
"src/widget/hexspinbox.cpp",
"src/widget/wtrackproperty.cpp",
"src/widget/wstarrating.cpp",
"src/widget/weffectchain.cpp",
"src/widget/weffect.cpp",
"src/widget/weffectselector.cpp",
"src/widget/weffectparameter.cpp",
"src/widget/weffectparameterknob.cpp",
"src/widget/weffectparameterknobcomposed.cpp",
"src/widget/weffectbuttonparameter.cpp",
"src/widget/weffectparameterbase.cpp",
"src/widget/wtime.cpp",
"src/widget/wrecordingduration.cpp",
"src/widget/wkey.cpp",
"src/widget/wbattery.cpp",
"src/widget/wcombobox.cpp",
"src/widget/wsplitter.cpp",
"src/widget/wcoverart.cpp",
"src/widget/wcoverartlabel.cpp",
"src/widget/wcoverartmenu.cpp",
"src/widget/wsingletoncontainer.cpp",
"src/widget/wmainmenubar.cpp",
"src/musicbrainz/network.cpp",
"src/musicbrainz/tagfetcher.cpp",
"src/musicbrainz/gzip.cpp",
"src/musicbrainz/crc.c",
"src/musicbrainz/acoustidclient.cpp",
"src/musicbrainz/chromaprinter.cpp",
"src/musicbrainz/musicbrainzclient.cpp",
"src/widget/wtracktableview.cpp",
"src/widget/wtracktableviewheader.cpp",
"src/widget/wlibrarysidebar.cpp",
"src/widget/wlibrary.cpp",
"src/widget/wlibrarytableview.cpp",
"src/widget/wanalysislibrarytableview.cpp",
"src/widget/wlibrarytextbrowser.cpp",
"src/database/mixxxdb.cpp",
"src/database/schemamanager.cpp",
"src/library/trackcollection.cpp",
"src/library/basesqltablemodel.cpp",
"src/library/basetrackcache.cpp",
"src/library/columncache.cpp",
"src/library/librarytablemodel.cpp",
"src/library/searchquery.cpp",
"src/library/searchqueryparser.cpp",
"src/library/analysislibrarytablemodel.cpp",
"src/library/missingtablemodel.cpp",
"src/library/hiddentablemodel.cpp",
"src/library/proxytrackmodel.cpp",
"src/library/coverart.cpp",
"src/library/coverartcache.cpp",
"src/library/coverartutils.cpp",
"src/library/crate/cratestorage.cpp",
"src/library/crate/cratefeature.cpp",
"src/library/crate/cratefeaturehelper.cpp",
"src/library/crate/cratetablemodel.cpp",
"src/library/playlisttablemodel.cpp",
"src/library/libraryfeature.cpp",
"src/library/analysisfeature.cpp",
"src/library/autodj/autodjfeature.cpp",
"src/library/autodj/autodjprocessor.cpp",
"src/library/dao/directorydao.cpp",
"src/library/mixxxlibraryfeature.cpp",
"src/library/baseplaylistfeature.cpp",
"src/library/playlistfeature.cpp",
"src/library/setlogfeature.cpp",
"src/library/autodj/dlgautodj.cpp",
"src/library/dlganalysis.cpp",
"src/library/dlgcoverartfullsize.cpp",
"src/library/dlghidden.cpp",
"src/library/dlgmissing.cpp",
"src/library/dlgtagfetcher.cpp",
"src/library/dlgtrackinfo.cpp",
"src/library/dlgtrackmetadataexport.cpp",
"src/library/browse/browsetablemodel.cpp",