summaryrefslogtreecommitdiffstats
path: root/build/features.py
diff options
context:
space:
mode:
authorUwe Klotz <uklotz@mixxx.org>2019-12-17 23:15:48 +0100
committerGitHub <noreply@github.com>2019-12-17 23:15:48 +0100
commit17b8e321a28dbb31e2dddfa2f04a0772266de4f5 (patch)
tree7b43e9bcc4628f357b939b1f5a59c895c1d79bbe /build/features.py
parentc6953e5f5ee79a1f10bbd49355709f593db4e3f2 (diff)
parent275cdf9b60ed21246a64885dfa63b53918ca5736 (diff)
Merge pull request #2040 from daschuer/libshout_intern
Libshout intern
Diffstat (limited to 'build/features.py')
-rw-r--r--build/features.py40
1 files changed, 39 insertions, 1 deletions
diff --git a/build/features.py b/build/features.py
index da5091ed4c..3a558e53c3 100644
--- a/build/features.py
+++ b/build/features.py
@@ -825,14 +825,32 @@ class LiveBroadcasting(Feature):
def add_options(self, build, vars):
vars.Add('shoutcast', 'Set to 1 to enable live broadcasting support', 1)
+ vars.Add('shoutcast_internal', 'Set to 1 to use internal libshout', 0)
def configure(self, build, conf):
if not self.enabled(build):
return
- libshout_found = conf.CheckLib(['libshout', 'shout'])
build.env.Append(CPPDEFINES='__BROADCAST__')
+ build.flags['shoutcast_internal'] = util.get_flags(build.env, 'shoutcast_internal', 0)
+ if build.platform_is_linux and not int(build.flags['shoutcast_internal']):
+ # Check if system lib is lower 2.4.2 or 2.4.3 and not suffering bug
+ # https://bugs.launchpad.net/mixxx/+bug/1833225
+ if not conf.CheckForPKG('shout', '2.4.3'):
+ if conf.CheckForPKG('shout', '2.4.2'):
+ print("System's libshout 2.4.2 suffers lp1833225, using internal shout_mixxx")
+ build.flags['shoutcast_internal'] = 1
+ else:
+ print("(no) here is fine here we just don't want 2.4.2")
+
+ if int(build.flags['shoutcast_internal']):
+ build.env.Append(CPPPATH='include')
+ build.env.Append(CPPPATH='src')
+ return
+
+ libshout_found = conf.CheckLib(['libshout', 'shout'])
+
if not libshout_found:
raise Exception('Could not find libshout or its development headers. Please install it or compile Mixxx without Shoutcast support using the shoutcast=0 flag.')
@@ -842,6 +860,26 @@ class LiveBroadcasting(Feature):
conf.CheckLib('gdi32')
def sources(self, build):
+ if int(build.flags['shoutcast_internal']):
+ # Clone our main environment so we don't change any settings in the
+ # Mixxx environment
+ libshout_env = build.env.Clone()
+
+ if build.toolchain_is_gnu:
+ libshout_env.Append(CCFLAGS='-pthread')
+ libshout_env.Append(LINKFLAGS='-pthread')
+
+ libshout_env.Append(CPPPATH="#lib/libshout")
+ libshout_dir = libshout_env.Dir("#lib/libshout")
+
+ env = libshout_env
+ SCons.Export('env')
+ SCons.Export('build')
+ env.SConscript(env.File('SConscript', libshout_dir))
+
+ build.env.Append(LIBPATH=libshout_dir)
+ build.env.Append(LIBS=['shout_mixxx', 'ogg', 'vorbis', 'theora', 'speex', 'ssl', 'crypto'])
+
depends.Qt.uic(build)('preferences/dialog/dlgprefbroadcastdlg.ui')
return ['preferences/dialog/dlgprefbroadcast.cpp',
'broadcast/broadcastmanager.cpp',