From bee1b8006c443d903bb7883c1538aa44fda8abc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Sat, 25 Apr 2020 23:06:48 +0200 Subject: [PATCH 1/5] Add the fallback to the internal libShout to cmake as well This fixes lp1833225 also for cmake builds --- CMakeLists.txt | 19 ++++++++++++++---- lib/libshout/CMakeLists.txt | 40 +++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 lib/libshout/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index d40beda92a77..fd1024bcb760 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1867,11 +1867,22 @@ if(LILV) endif() # Live Broadcasting (Shoutcast) -find_package(Shout) -cmake_dependent_option(BROADCAST "Live Broadcasting (Shoutcast) support" ON "Shout_FOUND" OFF) +option(BROADCAST "Live Broadcasting (Shoutcast) support" ON) if(BROADCAST) - if(NOT Shout_FOUND) - message(FATAL_ERROR "Live Broadcasting support requires the libshout and its development headers.") + if(UNIX AND NOT APPLE) + # Check if system lib is at least 2.4.4 and not suffering bug + # https://bugs.launchpad.net/mixxx/+bug/1833225 + find_package(Shout 2.4.4) + if(NOT Shout_FOUND OR Shout_VERSION VERSION_LESS 2.4.4) + # Fall back to internal libraray in the lib tree + message(STATUS "Preparing internal Shout") + add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/lib/libshout") + endif() + else() + find_package(Shout) + if(NOT Shout_FOUND) + message(FATAL_ERROR "Live Broadcasting support requires the libshout and its development headers.") + endif() endif() target_sources(mixxx-lib PRIVATE src/preferences/dialog/dlgprefbroadcastdlg.ui diff --git a/lib/libshout/CMakeLists.txt b/lib/libshout/CMakeLists.txt new file mode 100644 index 000000000000..423da3a316a3 --- /dev/null +++ b/lib/libshout/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 3.0) +project(shout_mixxx C) + +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DHAVE_CONFIG_H -Wall -ffast-math -pthread -g -O2") + +include_directories( + . + src + include + src/common +) + +add_library(shout_mixxx STATIC + src/common/avl/avl.c + src/common/net/sock.c + src/common/net/resolver.c + src/common/timing/timing.c + src/common/httpp/httpp.c + src/common/httpp/encoding.c + src/common/thread/thread.c + src/shout.c + src/util.c + src/queue.c + src/proto_http.c + src/proto_xaudiocast.c + src/proto_icy.c + src/proto_roaraudio.c + src/format_ogg.c + src/format_webm.c + src/format_mp3.c + src/codec_vorbis.c + src/codec_opus.c + src/codec_theora.c + src/codec_speex.c + src/tls.c +) + +target_link_libraries(shout_mixxx ogg vorbis theora speex ssl crypto) + + From bb1baff347609c4b2b13060b8260dbb256330d32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Tue, 28 Apr 2020 08:58:15 +0200 Subject: [PATCH 2/5] Add aditional status message in case system installed libshout is not usefull --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index fd1024bcb760..ef7c66876422 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1873,6 +1873,9 @@ if(BROADCAST) # Check if system lib is at least 2.4.4 and not suffering bug # https://bugs.launchpad.net/mixxx/+bug/1833225 find_package(Shout 2.4.4) + if(Shout_FOUND AND Shout_VERSION VERSION_LESS 2.4.4) + message(STATUS "System installed version is suffering bug lp1833225") + endif() if(NOT Shout_FOUND OR Shout_VERSION VERSION_LESS 2.4.4) # Fall back to internal libraray in the lib tree message(STATUS "Preparing internal Shout") From a322841793cb0eb5efa29b12b0444001c1dca519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Tue, 28 Apr 2020 13:49:11 +0200 Subject: [PATCH 3/5] use a common find_package(Shout) and put target_link_libraries to the else branch --- CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ef7c66876422..1d798451158c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1869,10 +1869,10 @@ endif() # Live Broadcasting (Shoutcast) option(BROADCAST "Live Broadcasting (Shoutcast) support" ON) if(BROADCAST) + find_package(Shout) if(UNIX AND NOT APPLE) # Check if system lib is at least 2.4.4 and not suffering bug # https://bugs.launchpad.net/mixxx/+bug/1833225 - find_package(Shout 2.4.4) if(Shout_FOUND AND Shout_VERSION VERSION_LESS 2.4.4) message(STATUS "System installed version is suffering bug lp1833225") endif() @@ -1882,10 +1882,10 @@ if(BROADCAST) add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/lib/libshout") endif() else() - find_package(Shout) if(NOT Shout_FOUND) message(FATAL_ERROR "Live Broadcasting support requires the libshout and its development headers.") endif() + target_link_libraries(mixxx-lib PUBLIC Shout::Shout) endif() target_sources(mixxx-lib PRIVATE src/preferences/dialog/dlgprefbroadcastdlg.ui @@ -1894,7 +1894,6 @@ if(BROADCAST) src/engine/sidechain/shoutconnection.cpp ) target_compile_definitions(mixxx-lib PUBLIC __BROADCAST__) - target_link_libraries(mixxx-lib PUBLIC Shout::Shout) endif() # Locale Aware Compare for SQLite From ebce93ede0ceeaab682fd403e372ac0d6bf9d384 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Tue, 28 Apr 2020 16:27:33 +0200 Subject: [PATCH 4/5] actually link against internal shout_mixxx --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d798451158c..1f1d2567dbab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1880,10 +1880,14 @@ if(BROADCAST) # Fall back to internal libraray in the lib tree message(STATUS "Preparing internal Shout") add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/lib/libshout") + target_include_directories(mixxx-lib PUBLIC lib/libshout/include) + target_link_libraries(mixxx-lib PUBLIC shout_mixxx) + else() + target_link_libraries(mixxx-lib PUBLIC Shout::Shout) endif() else() if(NOT Shout_FOUND) - message(FATAL_ERROR "Live Broadcasting support requires the libshout and its development headers.") + message(FATAL_ERROR "Live Broadcasting support requires the libshout and its development headers.") endif() target_link_libraries(mixxx-lib PUBLIC Shout::Shout) endif() From f7b1ae2bd8dc289bce60c9637e0e924ee1c96407 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Sun, 3 May 2020 20:15:28 +0200 Subject: [PATCH 5/5] Improve logging in case of internal libshout is used --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f1d2567dbab..f2156016d4b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1874,11 +1874,11 @@ if(BROADCAST) # Check if system lib is at least 2.4.4 and not suffering bug # https://bugs.launchpad.net/mixxx/+bug/1833225 if(Shout_FOUND AND Shout_VERSION VERSION_LESS 2.4.4) - message(STATUS "System installed version is suffering bug lp1833225") + message(STATUS "Installed libshout version is suffering from bug lp1833225") endif() if(NOT Shout_FOUND OR Shout_VERSION VERSION_LESS 2.4.4) # Fall back to internal libraray in the lib tree - message(STATUS "Preparing internal Shout") + message(STATUS "Using internal libshout") add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/lib/libshout") target_include_directories(mixxx-lib PUBLIC lib/libshout/include) target_link_libraries(mixxx-lib PUBLIC shout_mixxx)