From ee23b4c78cf95dd4f37b5301cdbbf50dca30f3c3 Mon Sep 17 00:00:00 2001 From: Mooneer Salem Date: Mon, 14 Nov 2022 19:16:51 -0800 Subject: [PATCH] Build PortAudio statically and use internal curl/zlib for wxWidgets. --- build_osx.sh | 6 ++-- cmake/BuildWxWidgets.cmake | 4 +-- cmake/Buildportaudio-2.0.cmake | 1 - portaudio-macos.patch | 64 ---------------------------------- 4 files changed, 5 insertions(+), 70 deletions(-) delete mode 100644 portaudio-macos.patch diff --git a/build_osx.sh b/build_osx.sh index 2b160eca..5a32b55c 100755 --- a/build_osx.sh +++ b/build_osx.sh @@ -8,7 +8,7 @@ export FREEDVGUIDIR=${PWD} export CODEC2DIR=$FREEDVGUIDIR/codec2 export LPCNETDIR=$FREEDVGUIDIR/LPCNet export HAMLIBDIR=$FREEDVGUIDIR/hamlib -export CODEC2_BRANCH=master +export CODEC2_BRANCH=ms-macos-older-releases export LPCNET_BRANCH=master export UT_ENABLE=${UT_ENABLE:-0} @@ -62,10 +62,10 @@ if [ -d .git ]; then git pull fi mkdir -p build_osx && cd build_osx && rm -Rf * -cmake -DBUILD_OSX_UNIVERSAL=1 -DCMAKE_BUILD_TYPE=Debug -DBOOTSTRAP_WXWIDGETS=1 -DUSE_STATIC_SPEEXDSP=1 -DHAMLIB_INCLUDE_DIR=${HAMLIBDIR}/include -DHAMLIB_LIBRARY=${HAMLIBDIR}/lib/libhamlib.a -DCODEC2_BUILD_DIR=$CODEC2DIR/build_osx -DLPCNET_BUILD_DIR=$LPCNETDIR/build_osx .. +cmake -DBUILD_OSX_UNIVERSAL=1 -DCMAKE_BUILD_TYPE=Debug -DBOOTSTRAP_WXWIDGETS=1 -DUSE_STATIC_SPEEXDSP=1 -DUSE_STATIC_PORTAUDIO=1 -DHAMLIB_INCLUDE_DIR=${HAMLIBDIR}/include -DHAMLIB_LIBRARY=${HAMLIBDIR}/lib/libhamlib.a -DCODEC2_BUILD_DIR=$CODEC2DIR/build_osx -DLPCNET_BUILD_DIR=$LPCNETDIR/build_osx .. make VERBOSE=1 # Rebuild now that wxWidgets is bootstrapped -cmake -DBUILD_OSX_UNIVERSAL=1 -DCMAKE_BUILD_TYPE=Debug -DBOOTSTRAP_WXWIDGETS=1 -DUSE_STATIC_SPEEXDSP=1 -DUSE_STATIC_SAMPLERATE=1 -DUSE_STATIC_SNDFILE=1 -DUNITTEST=$UT_ENABLE -DHAMLIB_INCLUDE_DIR=${HAMLIBDIR}/include -DHAMLIB_LIBRARY=${HAMLIBDIR}/lib/libhamlib.a -DCODEC2_BUILD_DIR=$CODEC2DIR/build_osx -DLPCNET_BUILD_DIR=$LPCNETDIR/build_osx .. +cmake -DBUILD_OSX_UNIVERSAL=1 -DCMAKE_BUILD_TYPE=Debug -DBOOTSTRAP_WXWIDGETS=1 -DUSE_STATIC_SPEEXDSP=1 -DUSE_STATIC_PORTAUDIO=1 -DUSE_STATIC_SAMPLERATE=1 -DUSE_STATIC_SNDFILE=1 -DUNITTEST=$UT_ENABLE -DHAMLIB_INCLUDE_DIR=${HAMLIBDIR}/include -DHAMLIB_LIBRARY=${HAMLIBDIR}/lib/libhamlib.a -DCODEC2_BUILD_DIR=$CODEC2DIR/build_osx -DLPCNET_BUILD_DIR=$LPCNETDIR/build_osx .. make VERBOSE=1 diff --git a/cmake/BuildWxWidgets.cmake b/cmake/BuildWxWidgets.cmake index 2dc2fb64..e2699045 100644 --- a/cmake/BuildWxWidgets.cmake +++ b/cmake/BuildWxWidgets.cmake @@ -16,9 +16,9 @@ if(MINGW AND CMAKE_CROSSCOMPILING) elseif(APPLE) if(BUILD_OSX_UNIVERSAL) - set(CONFIGURE_COMMAND ./configure --disable-shared --with-osx_cocoa --enable-universal_binary=x86_64,arm64 --with-macosx-version-min=10.11 --prefix=${CMAKE_BINARY_DIR}/external/dist --with-libjpeg=builtin --with-libpng=builtin --with-regex=builtin --with-libtiff=builtin --with-expat=builtin CXXFLAGS=-stdlib=libc++\ -std=c++11\ -DWX_PRECOMP\ -O2\ -fno-strict-aliasing\ -fno-common) + set(CONFIGURE_COMMAND ./configure --disable-shared --with-osx_cocoa --enable-universal_binary=x86_64,arm64 --with-macosx-version-min=10.11 --prefix=${CMAKE_BINARY_DIR}/external/dist --with-libjpeg=builtin --with-libpng=builtin --with-regex=builtin --with-libtiff=builtin --with-expat=builtin --with-libcurl=builtin --with-zlib=builtin CXXFLAGS=-stdlib=libc++\ -std=c++11\ -DWX_PRECOMP\ -O2\ -fno-strict-aliasing\ -fno-common) else() - set(CONFIGURE_COMMAND ./configure --disable-shared --with-macosx-version-min=10.10 --prefix=${CMAKE_BINARY_DIR}/external/dist --with-libjpeg=builtin --with-libpng=builtin --with-regex=builtin --with-libtiff=builtin --with-expat=builtin CXXFLAGS=-stdlib=libc++\ -std=c++11\ -DWX_PRECOMP\ -O2\ -fno-strict-aliasing\ -fno-common) + set(CONFIGURE_COMMAND ./configure --disable-shared --with-macosx-version-min=10.10 --prefix=${CMAKE_BINARY_DIR}/external/dist --with-libjpeg=builtin --with-libpng=builtin --with-regex=builtin --with-libtiff=builtin --with-libcurl=builtin --with-zlib=builtin --with-expat=builtin CXXFLAGS=-stdlib=libc++\ -std=c++11\ -DWX_PRECOMP\ -O2\ -fno-strict-aliasing\ -fno-common) endif(BUILD_OSX_UNIVERSAL) else() diff --git a/cmake/Buildportaudio-2.0.cmake b/cmake/Buildportaudio-2.0.cmake index 7b1dd552..cd4fe53d 100644 --- a/cmake/Buildportaudio-2.0.cmake +++ b/cmake/Buildportaudio-2.0.cmake @@ -35,7 +35,6 @@ ExternalProject_Add(portaudio CONFIGURE_COMMAND ${CONFIGURE_COMMAND} BUILD_COMMAND $(MAKE) INSTALL_COMMAND $(MAKE) install - PATCH_COMMAND patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/portaudio-macos.patch && autoconf && cd bindings/cpp && autoconf ) else() ExternalProject_Add(portaudio diff --git a/portaudio-macos.patch b/portaudio-macos.patch deleted file mode 100644 index 0b809323..00000000 --- a/portaudio-macos.patch +++ /dev/null @@ -1,64 +0,0 @@ -diff -ur portaudio.orig/configure portaudio/configure ---- portaudio.orig/configure 2020-11-19 17:23:04.000000000 -0800 -+++ portaudio/configure 2021-05-25 22:24:37.000000000 -0700 -@@ -15884,13 +15884,25 @@ - elif xcodebuild -version -sdk macosx10.15 Path >/dev/null 2>&1 ; then - mac_version_min="-mmacosx-version-min=10.4" - mac_sysroot="-isysroot `xcodebuild -version -sdk macosx10.15 Path`" -+ elif xcodebuild -version -sdk macosx11.0 Path >/dev/null 2>&1 ; then -+ mac_version_min="-mmacosx-version-min=10.9" -+ mac_sysroot="-isysroot `xcodebuild -version -sdk macosx11.0 Path`" -+ elif xcodebuild -version -sdk macosx11.1 Path >/dev/null 2>&1 ; then -+ mac_version_min="-mmacosx-version-min=10.9" -+ mac_sysroot="-isysroot `xcodebuild -version -sdk macosx11.1 Path`" -+ elif xcodebuild -version -sdk macosx11.2 Path >/dev/null 2>&1 ; then -+ mac_version_min="-mmacosx-version-min=10.9" -+ mac_sysroot="-isysroot `xcodebuild -version -sdk macosx11.2 Path`" -+ elif xcodebuild -version -sdk macosx11.3 Path >/dev/null 2>&1 ; then -+ mac_version_min="-mmacosx-version-min=10.9" -+ mac_sysroot="-isysroot `xcodebuild -version -sdk macosx11.3 Path`" - else -- as_fn_error $? "Could not find 10.5 to 10.13 SDK." "$LINENO" 5 -+ as_fn_error $? "Could not find 10.5 to 11.3 SDK." "$LINENO" 5 - fi - esac - - mac_arches="" -- for arch in x86_64 -+ for arch in x86_64 arm64 - do - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -arch $arch" -diff -ur portaudio.orig/configure.in portaudio/configure.in ---- portaudio.orig/configure.in 2020-11-19 17:23:04.000000000 -0800 -+++ portaudio/configure.in 2021-05-25 22:25:12.000000000 -0700 -@@ -267,15 +267,27 @@ - elif xcodebuild -version -sdk macosx10.15 Path >/dev/null 2>&1 ; then - mac_version_min="-mmacosx-version-min=10.4" - mac_sysroot="-isysroot `xcodebuild -version -sdk macosx10.15 Path`" -+ elif xcodebuild -version -sdk macosx11.0 Path >/dev/null 2>&1 ; then -+ mac_version_min="-mmacosx-version-min=10.9" -+ mac_sysroot="-isysroot `xcodebuild -version -sdk macosx11.0 Path`" -+ elif xcodebuild -version -sdk macosx11.1 Path >/dev/null 2>&1 ; then -+ mac_version_min="-mmacosx-version-min=10.9" -+ mac_sysroot="-isysroot `xcodebuild -version -sdk macosx11.1 Path`" -+ elif xcodebuild -version -sdk macosx11.2 Path >/dev/null 2>&1 ; then -+ mac_version_min="-mmacosx-version-min=10.9" -+ mac_sysroot="-isysroot `xcodebuild -version -sdk macosx11.2 Path`" -+ elif xcodebuild -version -sdk macosx11.3 Path >/dev/null 2>&1 ; then -+ mac_version_min="-mmacosx-version-min=10.9" -+ mac_sysroot="-isysroot `xcodebuild -version -sdk macosx11.3 Path`" - else -- AC_MSG_ERROR([Could not find 10.5 to 10.13 SDK.]) -+ AC_MSG_ERROR([Could not find 10.5 to 11.3 SDK.]) - fi - esac - - dnl Pick which architectures to build for based on what - dnl the compiler supports. - mac_arches="" -- for arch in x86_64 -+ for arch in x86_64 arm64 - do - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -arch $arch"