From 01eaa618e1c3bd724154e6b1d837b03c43f037a2 Mon Sep 17 00:00:00 2001 From: falkTX Date: Tue, 11 May 2021 20:49:13 +0100 Subject: [PATCH] Add tweaks for qt build, off by default Signed-off-by: falkTX --- bootstrap-audacity.sh | 10 ++++ build-audacity.sh | 7 +++ patches/audacity/04_build-fix-pt4.patch.qt | 64 ++++++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 patches/audacity/04_build-fix-pt4.patch.qt diff --git a/bootstrap-audacity.sh b/bootstrap-audacity.sh index ea8559f..6f23027 100755 --- a/bootstrap-audacity.sh +++ b/bootstrap-audacity.sh @@ -15,12 +15,18 @@ if [ -z "${target}" ]; then exit 1 fi +using_qt=0 + # --------------------------------------------------------------------------------------------------------------------- # run bootstrap dependencies ./bootstrap-common.sh "${target}" # ./bootstrap-plugins.sh "${target}" +if [ ${using_qt} -eq 1 ]; then + ./bootstrap-qt.sh "${target}" +fi + # --------------------------------------------------------------------------------------------------------------------- # source setup code @@ -47,6 +53,10 @@ wxwidgets_args+=" -DwxUSE_LIBTIFF=builtin" wxwidgets_args+=" -DwxUSE_REGEX=builtin" wxwidgets_args+=" -DwxUSE_ZLIB=builtin" +if [ ${using_qt} -eq 1 ]; then + wxwidgets_args+=" -DwxBUILD_TOOLKIT=qt" +fi + # these match upstream cmake setup if [ "${MACOS}" -eq 1 ]; then wxwidgets_args+=" -DwxUSE_ACCESSIBILITY=YES" diff --git a/build-audacity.sh b/build-audacity.sh index 5fb8c4c..26e0e45 100755 --- a/build-audacity.sh +++ b/build-audacity.sh @@ -14,6 +14,8 @@ if [ -z "${target}" ]; then exit 1 fi +using_qt=0 + # --------------------------------------------------------------------------------------------------------------------- # run bootstrap dependency @@ -74,6 +76,11 @@ if [ "${WIN32}" -eq 1 ]; then export EXTRA_LDFLAGS="-lpthread -lz" # FIXME not working! fi +if [ ${using_qt} -eq 1 ]; then + audacity_args+=" -DwxWidgets_CONFIGURATION=qtu" + export EXTRA_CXXFLAGS+=" -I${PAWPAW_PREFIX}/include/qt5" +fi + # TODO # 1. linker flags end up with -lLIB_m-NOTFOUND # 2. win32 build requires copying std mingw mutex workarounds diff --git a/patches/audacity/04_build-fix-pt4.patch.qt b/patches/audacity/04_build-fix-pt4.patch.qt new file mode 100644 index 0000000..83d0f22 --- /dev/null +++ b/patches/audacity/04_build-fix-pt4.patch.qt @@ -0,0 +1,64 @@ +diff --git a/cmake-proxies/cmake-modules/CopyLibs.cmake b/cmake-proxies/cmake-modules/CopyLibs.cmake +index ddb5d9a..eb00020 100644 +--- a/cmake-proxies/cmake-modules/CopyLibs.cmake ++++ b/cmake-proxies/cmake-modules/CopyLibs.cmake +@@ -95,7 +95,8 @@ function( gather_libs src ) + set( postcmds ${postcmds} PARENT_SCOPE ) + endfunction() + +-gather_libs( "${SRC}" ) ++set( libs "${WXWIN}/wxqt313u_gcc_x64_custom.dll" ) ++set( postcmds "" ) + + list( REMOVE_DUPLICATES libs ) + +diff --git a/cmake-proxies/cmake-modules/FindwxWidgets.cmake b/cmake-proxies/cmake-modules/FindwxWidgets.cmake +index cb2f6f6..b5c88a6 100644 +--- a/cmake-proxies/cmake-modules/FindwxWidgets.cmake ++++ b/cmake-proxies/cmake-modules/FindwxWidgets.cmake +@@ -217,15 +217,7 @@ endif() + if(wxWidgets_FIND_STYLE STREQUAL "win32") + # Useful common wx libs needed by almost all components. + set(wxWidgets_COMMON_LIBRARIES png tiff jpeg zlib regex expat) +- +- # DEPRECATED: Use find_package(wxWidgets COMPONENTS mono) instead. +- if(NOT wxWidgets_FIND_COMPONENTS) +- if(wxWidgets_USE_MONOLITHIC) +- set(wxWidgets_FIND_COMPONENTS mono) +- else() +- set(wxWidgets_FIND_COMPONENTS core base) # this is default +- endif() +- endif() ++ set(wxWidgets_FIND_COMPONENTS mono) + + # Add the common (usually required libs) unless + # wxWidgets_EXCLUDE_COMMON_LIBRARIES has been set. +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 79e8f3c..e4c0f62 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -1120,14 +1120,16 @@ if( CMAKE_SYSTEM_NAME MATCHES "Windows" ) + POST_BUILD + ) + +- # Copy the VC runtime libraries as well +- add_custom_command( +- TARGET +- ${TARGET} +- COMMAND +- ${CMAKE_COMMAND} -E copy ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${_DEST} +- POST_BUILD +- ) ++ if(MSVC) ++ # Copy the VC runtime libraries as well ++ add_custom_command( ++ TARGET ++ ${TARGET} ++ COMMAND ++ ${CMAKE_COMMAND} -E copy ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${_DEST} ++ POST_BUILD ++ ) ++ endif(MSVC) + elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) + # Bug 2400 workaround + #