Compiling Audacity 3.2 on Ubuntu 22.04

I’m trying to compile Audacity 3.2 from git on Ubuntu 22.04 without using conan and instead using dev packages of wxWidgets 3.1.7 from https://repos.codelite.org/wx3.1.7/ubuntu/, but it fails:

/home/mfraser/git/audacity/src/effects/VST3/internal/x11/SocketWindow.cpp: In static member function ‘static void internal::x11::SocketWindow::OnMap(GtkWidget*, gpointer)’:
/home/mfraser/git/audacity/src/effects/VST3/internal/x11/SocketWindow.cpp:34:35: error: ‘GTK_SOCKET’ was not declared in this scope; did you mean ‘ATK_SOCKET’?
   34 |          (void*)gtk_socket_get_id(GTK_SOCKET(widget)),
      |                                   ^~~~~~~~~~
      |                                   ATK_SOCKET
In file included from /home/mfraser/git/audacity/src/effects/lv2/LV2Effect.h:36,
                 from /home/mfraser/git/audacity/src/effects/lv2/LoadLV2.cpp:41:
/home/mfraser/git/audacity/src/effects/lv2/LV2FeaturesList.h:103:45: warning: ‘LV2_URI_Map_Callback_Data’ is deprecated [-Wdeprecated-declarations]
  103 |                              const char *uri);
      |                                             ^
In file included from /home/mfraser/git/audacity/src/effects/lv2/LV2FeaturesList.h:21,
                 from /home/mfraser/git/audacity/src/effects/lv2/LV2Effect.h:36,
                 from /home/mfraser/git/audacity/src/effects/lv2/LoadLV2.cpp:41:
/usr/include/lv2/uri-map/uri-map.h:60:15: note: declared here
   60 | typedef void* LV2_URI_Map_Callback_Data;
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/mfraser/git/audacity/src/effects/lv2/LV2Effect.h:36,
                 from /home/mfraser/git/audacity/src/effects/lv2/LoadLV2.cpp:41:
/home/mfraser/git/audacity/src/effects/lv2/LV2FeaturesList.h:116:40: warning: ‘LV2_URI_Map_Feature’ is deprecated [-Wdeprecated-declarations]
  116 |       this, LV2FeaturesList::uri_to_id }; // Features we support
      |                                        ^
In file included from /home/mfraser/git/audacity/src/effects/lv2/LV2FeaturesList.h:21,
                 from /home/mfraser/git/audacity/src/effects/lv2/LV2Effect.h:36,
                 from /home/mfraser/git/audacity/src/effects/lv2/LoadLV2.cpp:41:
/usr/include/lv2/uri-map/uri-map.h:109:3: note: declared here
  109 | } LV2_URI_Map_Feature;
      |   ^~~~~~~~~~~~~~~~~~~
/home/mfraser/git/audacity/src/effects/VST3/internal/x11/SocketWindow.cpp:34:17: error: ‘gtk_socket_get_id’ was not declared in this scope; did you mean ‘g_socket_get_fd’?
   34 |          (void*)gtk_socket_get_id(GTK_SOCKET(widget)),
      |                 ^~~~~~~~~~~~~~~~~
      |                 g_socket_get_fd
/home/mfraser/git/audacity/src/effects/VST3/internal/x11/SocketWindow.cpp: In constructor ‘internal::x11::SocketWindow::SocketWindow(wxWindow*, wxWindowID, Steinberg::IPlugView*)’:
/home/mfraser/git/audacity/src/effects/VST3/internal/x11/SocketWindow.cpp:41:36: error: ‘gtk_socket_new’ was not declared in this scope; did you mean ‘atk_socket_new’?
   41 |    : wxNativeWindow(parent, winid, gtk_socket_new()), mPlugView(plugView)
      |                                    ^~~~~~~~~~~~~~
      |                                    atk_socket_new
[ 79%] Building CXX object src/CMakeFiles/Audacity.dir/effects/vamp/VampEffect.cpp.o
[ 79%] Building CXX object src/CMakeFiles/Audacity.dir/export/Export.cpp.o
/home/mfraser/git/audacity/src/effects/VST3/internal/x11/SocketWindow.cpp:43:23: error: ‘GTK_OBJECT’ was not declared in this scope; did you mean ‘ATK_OBJECT’?
   43 |    gtk_signal_connect(GTK_OBJECT(GetHandle()), "map", G_CALLBACK(&SocketWindow::OnMap), this);
      |                       ^~~~~~~~~~
      |                       ATK_OBJECT
In file included from /home/mfraser/git/audacity/src/effects/lv2/LV2Effect.h:40,
                 from /home/mfraser/git/audacity/src/effects/lv2/LoadLV2.cpp:41:
/home/mfraser/git/audacity/src/effects/lv2/NativeWindow.h: In member function ‘bool NativeWindow::Create(wxWindow*, WXWidget)’:
/home/mfraser/git/audacity/src/effects/lv2/NativeWindow.h:112:30: warning: ‘void gtk_widget_size_request(GtkWidget*, GtkRequisition*)’ is deprecated: Use 'gtk_widget_get_preferred_size' instead [-Wdeprecated-declarations]
  112 |       gtk_widget_size_request(widget, &req);
      |       ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
In file included from /usr/include/gtk-3.0/gtk/gtkapplication.h:27,
                 from /usr/include/gtk-3.0/gtk/gtkwindow.h:33,
                 from /usr/include/gtk-3.0/gtk/gtkdialog.h:32,
                 from /usr/include/gtk-3.0/gtk/gtkaboutdialog.h:30,
                 from /usr/include/gtk-3.0/gtk/gtk.h:31,
                 from /home/mfraser/git/audacity/src/effects/lv2/NativeWindow.h:23,
                 from /home/mfraser/git/audacity/src/effects/lv2/LV2Effect.h:40,
                 from /home/mfraser/git/audacity/src/effects/lv2/LoadLV2.cpp:41:
/usr/include/gtk-3.0/gtk/gtkwidget.h:672:12: note: declared here
  672 | void       gtk_widget_size_request        (GtkWidget           *widget,
      |            ^~~~~~~~~~~~~~~~~~~~~~~
/home/mfraser/git/audacity/src/effects/VST3/internal/x11/SocketWindow.cpp:43:4: error: ‘gtk_signal_connect’ was not declared in this scope; did you mean ‘g_signal_connect’?
   43 |    gtk_signal_connect(GTK_OBJECT(GetHandle()), "map", G_CALLBACK(&SocketWindow::OnMap), this);
      |    ^~~~~~~~~~~~~~~~~~
      |    g_signal_connect
[ 79%] Building CXX object src/CMakeFiles/Audacity.dir/export/ExportCL.cpp.o
[ 79%] Building CXX object src/CMakeFiles/Audacity.dir/export/ExportMP3.cpp.o
[ 79%] Building CXX object src/CMakeFiles/Audacity.dir/export/ExportMultiple.cpp.o
[ 80%] Building CXX object src/CMakeFiles/Audacity.dir/export/ExportPCM.cpp.o
[ 80%] Building CXX object src/CMakeFiles/Audacity.dir/export/ExportFFmpeg.cpp.o
make[2]: *** [src/CMakeFiles/Audacity.dir/build.make:3565: src/CMakeFiles/Audacity.dir/effects/VST3/internal/x11/SocketWindow.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/mfraser/git/audacity/src/export/ExportCL.cpp: In member function ‘virtual bool ExportCL::CheckFileName(wxFileName&, int)’:
/home/mfraser/git/audacity/src/export/ExportCL.cpp:753:18: warning: ‘wxPATH_NORM_ALL’ is deprecated: specify the wanted flags explicitly to avoid surprises [-Wdeprecated-declarations]
  753 |    cmd.Normalize(wxPATH_NORM_ALL & ~wxPATH_NORM_ABSOLUTE);
      |                  ^~~~~~~~~~~~~~~
In file included from /home/mfraser/git/audacity/src/AudacityHeaders.h:37,
                 from /home/mfraser/git/audacity/build/src/CMakeFiles/Audacity.dir/cmake_pch.hxx:6,
                 from <command-line>:
/usr/include/wx-3.1-unofficial/wx/filename.h:83:5: note: declared here
   83 |     wxPATH_NORM_ALL
      |     ^~~~~~~~~~~~~~~
make[1]: *** [CMakeFiles/Makefile2:1889: src/CMakeFiles/Audacity.dir/all] Error 2
make: *** [Makefile:166: all] Error 2

The obvious solution is to build Audacity according to the build instructions (using conan). If you don’t want a system install of conan, you could use a virtual environment (I use Pipenv with Xubuntu 20.04.4 LTS).