Building against the conan wxWidgets build

Hi,

I’m working on updating the MacPorts port for Audacity, using master/HEAD. So far I’ve managed to build on OS X 10.9.5 using clang-9 and against a system wxWidgets 3.1.4-pre (3.1.3.1373, the latest commit to run on my OS version). I want to provide a port variant that uses Audacity’s own wxWidgets version, and am running into a few issues that suggest that either I’m doing something wrong, or something hasn’t been tested exhaustively:

  1. missing headerfile search directives so the wx headers aren’t found
  2. osx_cocoa-unicode-3.1/wx/setup.h isn’t copied into the appropriate //package install directory
  3. WXOSX_COCOA is not defined
  4. the wx libraries aren’t linked in (at least for the image-compiler target).

So far I have worked around the 1st three issues but I do not yet see how I could handle the last.

Does this ring any bells?

What version of conan are you using? conan unexpectedly released a 2.0 version a few days ago, Audacity still requires 1.x (I think 1.59.0 is the last version)

I noticed, pulled and got the fix (conan isn’t in MacPorts so I’m using whatever Audacity’s buildsystem decides in this matter). That was necessary for my “system wx” build too.

FWIW, I can’t say I like the move to conan over the previous implementation where the configure step was a configure step that didn’t build half the code already, pulling in things like ninja which I already have, and not giving me full control over how dependencies are built.

I got caught by that recently. My workaround was to create a Python virtual environment in the Audacity/ source tree (using pipenv Pipenv: Python Dev Workflow for Humans — pipenv 2023.11.16.dev0 documentation), then specified version “<2” when installing Conan into the virtual environment. I then activated the virtual environment before running the “cmake” configuration.

Dmitri (one of the developers) said that he’s aware of the problem and was working on a fix but that it was more complicated than he expected (that was a week ago). 2 days ago he added a warning in the source code to say:

At this time, Audacity > does not support Conan 2.0> . If you have Conan 2.0 installed, you will need to downgrade to Conan 1.59.0.

The current build system will do a localised install (= under your build dir) of a supported version of conan (1.59 IIRC). So that’s not my problem.

If it helps, here’s the output from my cmake invocation:

:debug:configure Executing org.macports.configure (audacity-devel)
:debug:configure Environment:
:debug:configure AR='/opt/local/bin/llvm-ar-mp-9.0'
:debug:configure CC='/opt/local/bin/clang-mp-9.0'
:debug:configure CCACHE_SLOPPINESS='pch_defines,time_macros'
:debug:configure CFLAGS='-Ofast -march=native -g -mdynamic-no-pic -fno-limit-debug-info -fstandalone-debug -DNDEBUG -isystem/opt/local/include -I/Volumes/VMs/MPbuild/_Volumes_Debian_MP9_site-ports_audio_audacity-devel/audacity-devel/work/build/.wxincludes/wx-3.1 -I/Volumes/VMs/MPbuild/_Volumes_Debian_MP9_site-ports_audio_audacity-devel/audacity-devel/work/build/.wxincludes/osx_cocoa-unicode-3.1 -D__WXOSX_COCOA__ -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk'
:debug:configure CPATH='/opt/local/include'
:debug:configure CPPFLAGS='-isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk'
:debug:configure CXX='/opt/local/bin/clang++-mp-9.0'
:debug:configure CXXFLAGS='-Ofast -march=native -g -mdynamic-no-pic -fno-limit-debug-info -fstandalone-debug -Wno-inconsistent-missing-override -Wno-overloaded-virtual -DNDEBUG -isystem/opt/local/include -I/Volumes/VMs/MPbuild/_Volumes_Debian_MP9_site-ports_audio_audacity-devel/audacity-devel/work/build/.wxincludes/wx-3.1 -I/Volumes/VMs/MPbuild/_Volumes_Debian_MP9_site-ports_audio_audacity-devel/audacity-devel/work/build/.wxincludes/osx_cocoa-unicode-3.1 -D__WXOSX_COCOA__ -stdlib=libc++ -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk'
:debug:configure DEVELOPER_DIR='/Library/Developer/CommandLineTools'
:debug:configure F90FLAGS='-Ofast -march=native -g -mdynamic-no-pic -fno-limit-debug-info -fstandalone-debug -m64'
:debug:configure FCFLAGS='-Ofast -march=native -g -mdynamic-no-pic -fno-limit-debug-info -fstandalone-debug -m64'
:debug:configure FFLAGS='-Ofast -march=native -g -mdynamic-no-pic -fno-limit-debug-info -fstandalone-debug -m64'
:debug:configure INSTALL='/usr/bin/install -c'
:debug:configure LDFLAGS='-L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-rpath,/opt/local/lib/audacity -Wl,-rpath,/Applications/MacPorts/Audacity.app/Contents/Frameworks -stdlib=libc++ -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk'
:debug:configure LIBRARY_PATH='/opt/local/lib'
:debug:configure MACOSX_DEPLOYMENT_TARGET='10.9'
:debug:configure NM='/opt/local/bin/llvm-nm-mp-9.0'
:debug:configure OBJC='/opt/local/bin/clang-mp-9.0'
:debug:configure OBJCFLAGS='-Ofast -march=native -g -mdynamic-no-pic -fno-limit-debug-info -fstandalone-debug -isystem/opt/local/include -I/Volumes/VMs/MPbuild/_Volumes_Debian_MP9_site-ports_audio_audacity-devel/audacity-devel/work/build/.wxincludes/wx-3.1 -I/Volumes/VMs/MPbuild/_Volumes_Debian_MP9_site-ports_audio_audacity-devel/audacity-devel/work/build/.wxincludes/osx_cocoa-unicode-3.1 -D__WXOSX_COCOA__ -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk'
:debug:configure OBJCXX='/opt/local/bin/clang++-mp-9.0'
:debug:configure OBJCXXFLAGS='-Ofast -march=native -g -mdynamic-no-pic -fno-limit-debug-info -fstandalone-debug -Wno-inconsistent-missing-override -Wno-overloaded-virtual -DNDEBUG -isystem/opt/local/include -isystem/opt/local/include -I/Volumes/VMs/MPbuild/_Volumes_Debian_MP9_site-ports_audio_audacity-devel/audacity-devel/work/build/.wxincludes/wx-3.1 -I/Volumes/VMs/MPbuild/_Volumes_Debian_MP9_site-ports_audio_audacity-devel/audacity-devel/work/build/.wxincludes/osx_cocoa-unicode-3.1 -D__WXOSX_COCOA__ -stdlib=libc++ -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk'
:debug:configure PATH='/opt/local/libexec/qt5/bin:/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin'
:debug:configure RANLIB='/bin/echo'
:debug:configure SDKROOT='/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk'
:debug:configure Executing:  cd "/Volumes/VMs/MPbuild/_Volumes_Debian_MP9_site-ports_audio_audacity-devel/audacity-devel/work/build" && /opt/local/bin/cmake  -G "Ninja" -DCMAKE_BUILD_TYPE=MacPorts -DCMAKE_INSTALL_PREFIX="/Applications/MacPorts" -DCMAKE_INSTALL_NAME_DIR="/Applications/MacPorts/Audacity.app/Contents/Frameworks" -DCMAKE_SYSTEM_PREFIX_PATH="/opt/local;/Applications/MacPorts;/usr" -DCMAKE_C_COMPILER_LAUNCHER=/opt/local/bin/ccache -DCMAKE_CXX_COMPILER_LAUNCHER=/opt/local/bin/ccache -DCMAKE_Fortran_COMPILER_LAUNCHER=/opt/local/bin/ccache -DCMAKE_OBJC_COMPILER_LAUNCHER=/opt/local/bin/ccache -DCMAKE_OBJCXX_COMPILER_LAUNCHER=/opt/local/bin/ccache -DCMAKE_ISPC_COMPILER_LAUNCHER=/opt/local/bin/ccache -DCMAKE_C_COMPILER="$CC" -DCMAKE_CXX_COMPILER="$CXX" -DCMAKE_OBJC_COMPILER="$CC" -DCMAKE_OBJCXX_COMPILER="$CXX" -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_POLICY_DEFAULT_CMP0060=NEW -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_COLOR_MAKEFILE=ON -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_MAKE_PROGRAM=ninja -DCMAKE_MODULE_PATH="/opt/local/share/cmake/Modules" -DCMAKE_PREFIX_PATH="/opt/local/share/cmake/Modules" -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON -DCMAKE_INSTALL_RPATH="/opt/local/lib;/opt/local/lib/audacity;/Applications/MacPorts/Audacity.app/Contents/Frameworks;/Applications/MacPorts/lib" -Wno-dev -DCMAKE_MACOSX_RPATH=ON -Daudacity_lib_preference=system -Daudacity_has_tests=off -Daudacity_has_sentry_reporting=off -Daudacity_has_crashreports=off -Daudacity_has_updates_check=off -Daudacity_conan_allow_prebuilt_binaries=off -Daudacity_use_audio_units=on -Daudacity_use_ffmpeg=loaded -Daudacity_use_soxr=system -Daudacity_use_vamp=local -Daudacity_use_lv2=local -Daudacity_use_suil_qt5=ON -Daudacity_use_sbsms=local -Daudacity_use_soundtouch=system -Daudacity_use_twolame=system -Daudacity_use_midi=system -Daudacity_has_vst3=off -Daudacity_use_pch=on -DCMAKE_DISABLE_FIND_PACKAGE_JACK=On -Daudacity_use_sqlite=system -Daudacity_use_wxwidgets=local -DCMAKE_AR="/opt/local/bin/llvm-ar-mp-9.0" -DCMAKE_NM="/opt/local/bin/llvm-nm-mp-9.0" -DCMAKE_RANLIB="/bin/echo" -DCMAKE_MKSPEC=macx-clang -DQMAKE_EXECUTABLE=/opt/local/libexec/qt5/bin/qmake -DCMAKE_CXX_STANDARD=14 -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.9" -DCMAKE_OSX_SYSROOT="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk" /Volumes/VMs/MPbuild/_Volumes_Debian_MP9_site-ports_audio_audacity-devel/audacity-devel/work/audacity-git

[/size]
macports.audacity-devel.configure-x86_64.log (393 KB)

Don’t bother, I caved and decided to build audacity-wxWidgets as a system-level build dependency, and to tweak the fix_bundle.py script so it embeds the used libwx libraries into the bundle.

Glad to hear that you found a way.

For future reference, the Audacity developer’s discord channel may be better than this forum for build related issues (this forum is a community forum where users help users). The dev’s discord channel is here: https://discord.gg/N3XKxzTrq3