From 17ac36f767247abef92c13353e6aec96a749da17 Mon Sep 17 00:00:00 2001 From: davidkaroly <92124087+davidkaroly@users.noreply.github.com> Date: Thu, 17 Nov 2022 21:42:57 +0100 Subject: [PATCH] audacity: update to 3.1.3 (#7428) --- ...ity-2.4.2.recipe => audacity-3.1.3.recipe} | 36 +- .../audacity/patches/audacity-2.4.2.patchset | 300 --------------- .../audacity/patches/audacity-3.1.3.patchset | 352 ++++++++++++++++++ 3 files changed, 378 insertions(+), 310 deletions(-) rename media-sound/audacity/{audacity-2.4.2.recipe => audacity-3.1.3.recipe} (71%) delete mode 100644 media-sound/audacity/patches/audacity-2.4.2.patchset create mode 100644 media-sound/audacity/patches/audacity-3.1.3.patchset diff --git a/media-sound/audacity/audacity-2.4.2.recipe b/media-sound/audacity/audacity-3.1.3.recipe similarity index 71% rename from media-sound/audacity/audacity-2.4.2.recipe rename to media-sound/audacity/audacity-3.1.3.recipe index 9be417183..c5b2ec889 100644 --- a/media-sound/audacity/audacity-2.4.2.recipe +++ b/media-sound/audacity/audacity-3.1.3.recipe @@ -4,11 +4,11 @@ recording tasks such as making ringtones, mixing stero tracks, transferring \ tapes and records to computer or CD, splitting recordings into separate \ tracks and more." HOMEPAGE="https://www.audacityteam.org" -COPYRIGHT="1999-2020 by Audacity Team" +COPYRIGHT="1999-2021 by Audacity Team" LICENSE="GNU GPL v2" REVISION="1" SOURCE_URI="https://github.com/audacity/audacity/archive/refs/tags/Audacity-$portVersion.tar.gz" -CHECKSUM_SHA256="cdb4800c8e9d1d4ca19964caf8d24000f80286ebd8a4db566c2622449744c099" +CHECKSUM_SHA256="07aed333a20b8df381d5c0a167840883fff8ef65f5e5f71e654c0925d6c60de8" SOURCE_DIR="audacity-Audacity-$portVersion" PATCHES="audacity-$portVersion.patchset" @@ -36,12 +36,17 @@ REQUIRES=" lib:libgtk_3$secondaryArchSuffix lib:libharfbuzz$secondaryArchSuffix lib:libiconv$secondaryArchSuffix -# lib:libid3tag$secondaryArchSuffix -- missing pkgconfig + lib:libid3tag$secondaryArchSuffix lib:libintl$secondaryArchSuffix -# lib:libmad$secondaryArchSuffix -- missing pkgconfig + lib:libmad$secondaryArchSuffix + lib:libmp3lame$secondaryArchSuffix lib:libogg$secondaryArchSuffix + lib:libopus$secondaryArchSuffix lib:libpango_1.0$secondaryArchSuffix + lib:libportaudio$secondaryArchSuffix + lib:libportmidi$secondaryArchSuffix lib:libsndfile$secondaryArchSuffix + lib:libuuid$secondaryArchSuffix lib:libvorbis$secondaryArchSuffix lib:libX11$secondaryArchSuffix lib:libz$secondaryArchSuffix @@ -58,10 +63,18 @@ BUILD_REQUIRES=" devel:libglib_2.0$secondaryArchSuffix devel:libgtk_3$secondaryArchSuffix devel:libiconv$secondaryArchSuffix -# devel:libid3tag$secondaryArchSuffix + devel:libid3tag$secondaryArchSuffix devel:libintl$secondaryArchSuffix -# devel:libmad$secondaryArchSuffix + devel:libmad$secondaryArchSuffix + devel:libmp3lame$secondaryArchSuffix + devel:libogg$secondaryArchSuffix + devel:libopus$secondaryArchSuffix + devel:libportaudio$secondaryArchSuffix + devel:libportmidi$secondaryArchSuffix devel:libsndfile$secondaryArchSuffix + devel:libuuid$secondaryArchSuffix + devel:libvorbis$secondaryArchSuffix + devel:libz$secondaryArchSuffix " BUILD_PREREQUIRES=" cmd:awk @@ -77,18 +90,21 @@ BUILD_PREREQUIRES=" cmd:wx_config$secondaryArchSuffix " +defineDebugInfoPackage audacity$secondaryArchSuffix \ + $binDir/audacity$secondaryArchSuffix + BUILD() { + mkdir -p build/src/private cmake -S . -B build -G Ninja \ $cmakeDirArgs \ -DCMAKE_BUILD_TYPE=Release \ - -DUSE_MIDI=OFF \ - -Daudacity_use_pa_oss=NO -Daudacity_use_pa_jack=off \ - -Daudacity_use_ffmpeg=off -Daudacity_use_midi=off -Daudacity_use_pch=no + -Daudacity_conan_enabled=Off \ + -Daudacity_use_pch=no cmake --build build $jobArgs } INSTALL() { - cmake --install build $jobArgs + cmake --install build } diff --git a/media-sound/audacity/patches/audacity-2.4.2.patchset b/media-sound/audacity/patches/audacity-2.4.2.patchset deleted file mode 100644 index cf4cd0247..000000000 --- a/media-sound/audacity/patches/audacity-2.4.2.patchset +++ /dev/null @@ -1,300 +0,0 @@ -From 3cd38dec6acc320d47361f78f9ec7ffa759689a9 Mon Sep 17 00:00:00 2001 -From: Ken Mays -Date: Sat, 25 Dec 2021 06:19:07 +0200 -Subject: Fix OSS detect for Haiku - - -diff --git a/lib-src/portaudio-v19/configure b/lib-src/portaudio-v19/configure -index 9d32fcc..8a2b037 100755 ---- a/lib-src/portaudio-v19/configure -+++ b/lib-src/portaudio-v19/configure -@@ -15373,7 +15373,7 @@ fi - have_libossaudio=no - have_oss=no - if test "x$with_oss" != "xno"; then -- for ac_header in sys/soundcard.h linux/soundcard.h machine/soundcard.h -+ for ac_header in private/audio/soundcard.h sys/soundcard.h linux/soundcard.h machine/soundcard.h - do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` - ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -diff --git a/lib-src/portaudio-v19/configure.in b/lib-src/portaudio-v19/configure.in -index a3628bd..e15a8c5 100644 ---- a/lib-src/portaudio-v19/configure.in -+++ b/lib-src/portaudio-v19/configure.in -@@ -127,7 +127,7 @@ fi - have_libossaudio=no - have_oss=no - if test "x$with_oss" != "xno"; then -- AC_CHECK_HEADERS([sys/soundcard.h linux/soundcard.h machine/soundcard.h], [have_oss=yes]) -+ AC_CHECK_HEADERS([private/audio/soundcard.h sys/soundcard.h linux/soundcard.h machine/soundcard.h], [have_oss=yes]) - if test "x$have_oss" = "xyes"; then - AC_CHECK_LIB(ossaudio, _oss_ioctl, have_libossaudio=yes, have_libossaudio=no) - fi --- -2.37.3 - - -From 9c3fa9c8469622f831072843499c49dccc0969fe Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= -Date: Wed, 30 Jul 2014 01:38:19 +0200 -Subject: Add a case for Haiku in configure.in - - -diff --git a/lib-src/portaudio-v19/configure b/lib-src/portaudio-v19/configure -index 8a2b037..5853485 100755 ---- a/lib-src/portaudio-v19/configure -+++ b/lib-src/portaudio-v19/configure -@@ -16144,6 +16144,21 @@ fi - SHARED_FLAGS="" - ;; - -+ haiku* ) -+ -+ printf "%s\n" "#define PA_USE_SKELETON 1" >>confdefs.h -+ -+ -+ CFLAGS="$CFLAGS -I\$(top_srcdir)/src/os/unix" -+ # -Werror -+ LIBS="-lmedia" -+ -+ SHARED_FLAGS="$LIBS -shared" -+ #CFLAGS="$CFLAGS" -+ OTHER_OBJS="src/os/unix/pa_unix_hostapis.o src/os/unix/pa_unix_util.o" -+ PADLL="libportaudio.so" -+ ;; -+ - *) - - CFLAGS="$CFLAGS -I\$(top_srcdir)/src/os/unix" -diff --git a/lib-src/portaudio-v19/configure.in b/lib-src/portaudio-v19/configure.in -index e15a8c5..ceff5b2 100644 ---- a/lib-src/portaudio-v19/configure.in -+++ b/lib-src/portaudio-v19/configure.in -@@ -393,6 +393,22 @@ case "${host_os}" in - SHARED_FLAGS="" - ;; - -+ haiku* ) -+ dnl Haiku configuration -+ -+ dnl AC_DEFINE(PA_USE_HAIKU,1) -+ AC_DEFINE(PA_USE_SKELETON,1) -+ -+ CFLAGS="$CFLAGS -I\$(top_srcdir)/src/os/unix" -+ # -Werror -+ LIBS="-lmedia" -+ -+ SHARED_FLAGS="$LIBS -shared" -+ #CFLAGS="$CFLAGS" -+ OTHER_OBJS="src/os/unix/pa_unix_hostapis.o src/os/unix/pa_unix_util.o" -+ PADLL="libportaudio.so" -+ ;; -+ - *) - dnl Unix configuration - --- -2.37.3 - - -From 2c8cae10a82d44f5dcc5c0ca21d91d310bac66b6 Mon Sep 17 00:00:00 2001 -From: Ian McInerney -Date: Fri, 8 Apr 2022 01:08:12 +0100 -Subject: Remove custom languages in wx 3.1.6 and above - -Basque was added as a language with identifier "eu" into wx 3.1.6, so -there is no more need to provide custom languages. Additionally, this -struct changed formatting in 3.1.6, meaning it threw a compile error -when included (so it would have to be fixed if still needed). - -diff --git a/src/AudacityApp.cpp b/src/AudacityApp.cpp -index 661ab7e..c5738eb 100644 ---- a/src/AudacityApp.cpp -+++ b/src/AudacityApp.cpp -@@ -964,12 +964,10 @@ locations of the missing files.").Format( missingFileName ) ; - #define WL(lang,sublang) - #endif - --#if wxCHECK_VERSION(3, 0, 1) -+#if wxCHECK_VERSION(3, 0, 1) && !wxCHECK_VERSION(3, 1, 6) - wxLanguageInfo userLangs[] = - { -- // Bosnian is defined in wxWidgets already --// { wxLANGUAGE_USER_DEFINED, wxT("bs"), WL(0, SUBLANG_DEFAULT) wxT("Bosnian"), wxLayout_LeftToRight }, -- -+ // Included upstream in version 3.1.6 - { wxLANGUAGE_USER_DEFINED, wxT("eu"), WL(0, SUBLANG_DEFAULT) wxT("Basque"), wxLayout_LeftToRight }, - }; - #endif -@@ -1270,7 +1268,7 @@ bool AudacityApp::OnInit() - // - // TODO: The whole Language initialization really need to be reworked. - // It's all over the place. --#if wxCHECK_VERSION(3, 0, 1) -+#if wxCHECK_VERSION(3, 0, 1) && !wxCHECK_VERSION(3, 1, 6) - for (size_t i = 0, cnt = WXSIZEOF(userLangs); i < cnt; i++) - { - wxLocale::AddLanguage(userLangs[i]); --- -2.37.3 - - -From f645a5ac4bc6a95d8c3bff9441c0a4dc9f9fc04a Mon Sep 17 00:00:00 2001 -From: Ian McInerney -Date: Fri, 8 Apr 2022 01:27:52 +0100 -Subject: Call the proper wxBitmap constructor for XPM data - -wxBitmap back to at least 3.0.0 did not have a constructor for an XPM -image that took a size parameter, it would only take the XPM data -itself. - -I don't know how this compiled until now, but it doesn't anymore when -the size is included and built against wx 3.1.6 in Fedora. - -diff --git a/src/MixerBoard.cpp b/src/MixerBoard.cpp -index be46e63..c6d0296 100644 ---- a/src/MixerBoard.cpp -+++ b/src/MixerBoard.cpp -@@ -1304,7 +1304,7 @@ void MixerBoard::LoadMusicalInstruments() - wxMemoryDC dc; - - for (const auto &data : table) { -- auto bmp = std::make_unique(data.bitmap,24); -+ auto bmp = std::make_unique(data.bitmap); - dc.SelectObject(*bmp); - AColor::Bevel(dc, false, bev); - mMusicalInstruments.push_back(std::make_unique( --- -2.37.3 - - -From 691abd21f920d776dd75048aeb893517635863af Mon Sep 17 00:00:00 2001 -From: Paul Licameli -Date: Fri, 14 May 2021 16:22:28 -0400 -Subject: Add #include needed to build on Fedora 34, recommended by Be-ing - - -diff --git a/include/audacity/Types.h b/include/audacity/Types.h -index e137ea9..647c829 100644 ---- a/include/audacity/Types.h -+++ b/include/audacity/Types.h -@@ -44,6 +44,7 @@ - - #include - #include -+#include - #include - #include - #include // for wxASSERT --- -2.37.3 - - -From bf63b0cd604d836c09ec0202205c07a0a0c5f487 Mon Sep 17 00:00:00 2001 -From: David Karoly -Date: Sun, 6 Nov 2022 18:02:52 +0100 -Subject: portaudio: fix build on Haiku - - -diff --git a/cmake-proxies/portaudio-v19/CMakeLists.txt b/cmake-proxies/portaudio-v19/CMakeLists.txt -index d46ae06..5f1aa7a 100644 ---- a/cmake-proxies/portaudio-v19/CMakeLists.txt -+++ b/cmake-proxies/portaudio-v19/CMakeLists.txt -@@ -118,7 +118,7 @@ list( APPEND SOURCES - ${TARGET_ROOT}/src/hostapi/coreaudio/pa_mac_core_utilities.c - > - -- $<$: -+ $<$: - ${TARGET_ROOT}/src/os/unix/pa_unix_hostapis.c - ${TARGET_ROOT}/src/os/unix/pa_unix_util.c - > --- -2.37.3 - - -From a8d2d4ad48cf78315dddc618d69f657ea926450e Mon Sep 17 00:00:00 2001 -From: David Karoly -Date: Sun, 6 Nov 2022 18:02:52 +0100 -Subject: nyquist: fix build on Haiku - - -diff --git a/lib-src/libnyquist/nyquist/xlisp/xlisp.h b/lib-src/libnyquist/nyquist/xlisp/xlisp.h -index 6bbf324..1daa2c6 100644 ---- a/lib-src/libnyquist/nyquist/xlisp/xlisp.h -+++ b/lib-src/libnyquist/nyquist/xlisp/xlisp.h -@@ -177,6 +177,10 @@ extern long ptrtoabs(); - #endif - #endif - -+#ifdef __HAIKU__ -+#define XL_LITTLE_ENDIAN -+#endif -+ - /* default important definitions */ - #ifndef NNODES - #define NNODES 1000 --- -2.37.3 - - -From 8117f0a0e28851e4a25f31f125d39391015c3e65 Mon Sep 17 00:00:00 2001 -From: David Karoly -Date: Sun, 6 Nov 2022 18:02:52 +0100 -Subject: fix GTK include paths and libs - - -diff --git a/cmake-proxies/wxWidgets/CMakeLists.txt b/cmake-proxies/wxWidgets/CMakeLists.txt -index 94d19dd..6dcffc8 100644 ---- a/cmake-proxies/wxWidgets/CMakeLists.txt -+++ b/cmake-proxies/wxWidgets/CMakeLists.txt -@@ -205,6 +205,10 @@ endif() - if( "${wxTOOLKIT}" MATCHES "GTK." ) - pkg_check_modules( GTK REQUIRED IMPORTED_TARGET GLOBAL ${gtk} ) - pkg_check_modules( GLIB REQUIRED IMPORTED_TARGET GLOBAL ${glib} ) -+ -+ list( APPEND INCLUDES ${GTK_INCLUDE_DIRS} ) -+ list( APPEND LINKDIRS ${GTK_LIB_DIR} ) -+ list( APPEND LIBRARIES ${GTK_LIBRARIES} ) - endif() - - target_include_directories( ${TARGET} INTERFACE ${INCLUDES} ) --- -2.37.3 - - -From d31d3b29e8a77b1b703cc58ee867caf6e1b37651 Mon Sep 17 00:00:00 2001 -From: David Karoly -Date: Sun, 6 Nov 2022 18:02:52 +0100 -Subject: fix build for AudioIO.cpp - - -diff --git a/src/AudioIO.cpp b/src/AudioIO.cpp -index 0187e39..feb62bf 100644 ---- a/src/AudioIO.cpp -+++ b/src/AudioIO.cpp -@@ -821,7 +821,7 @@ static double SystemTime(bool usingAlsa) - if (usingAlsa) { - struct timespec now; - // CLOCK_MONOTONIC_RAW is unaffected by NTP or adj-time -- clock_gettime(CLOCK_MONOTONIC_RAW, &now); -+ clock_gettime(CLOCK_MONOTONIC, &now); - //return now.tv_sec + now.tv_nsec * 0.000000001; - return (now.tv_sec + now.tv_nsec * 0.000000001) - streamStartTime; - } --- -2.37.3 - - -From cffae938201f9bf330e38eba571e7207b4c35bbe Mon Sep 17 00:00:00 2001 -From: David Karoly -Date: Sun, 6 Nov 2022 18:02:52 +0100 -Subject: add dummy RevisionIdent.h - - -diff --git a/include/RevisionIdent.h b/include/RevisionIdent.h -new file mode 100644 -index 0000000..e69de29 --- -2.37.3 - diff --git a/media-sound/audacity/patches/audacity-3.1.3.patchset b/media-sound/audacity/patches/audacity-3.1.3.patchset new file mode 100644 index 000000000..9df2a06db --- /dev/null +++ b/media-sound/audacity/patches/audacity-3.1.3.patchset @@ -0,0 +1,352 @@ +From 4260b97c697d780999812ae4fb19f2c6e51fe0b7 Mon Sep 17 00:00:00 2001 +From: Ian McInerney +Date: Fri, 8 Apr 2022 01:08:12 +0100 +Subject: Remove custom languages in wx 3.1.6 and above + +Basque was added as a language with identifier "eu" into wx 3.1.6, so +there is no more need to provide custom languages. Additionally, this +struct changed formatting in 3.1.6, meaning it threw a compile error +when included (so it would have to be fixed if still needed). + +diff --git a/src/AudacityApp.cpp b/src/AudacityApp.cpp +index 13b50e8..7d45fd2 100644 +--- a/src/AudacityApp.cpp ++++ b/src/AudacityApp.cpp +@@ -991,12 +991,10 @@ void AudacityApp::OnTimer(wxTimerEvent& WXUNUSED(event)) + #define WL(lang,sublang) + #endif + +-#if wxCHECK_VERSION(3, 0, 1) ++#if wxCHECK_VERSION(3, 0, 1) && !wxCHECK_VERSION(3, 1, 6) + wxLanguageInfo userLangs[] = + { +- // Bosnian is defined in wxWidgets already +-// { wxLANGUAGE_USER_DEFINED, wxT("bs"), WL(0, SUBLANG_DEFAULT) wxT("Bosnian"), wxLayout_LeftToRight }, +- ++ // Included upstream in version 3.1.6 + { wxLANGUAGE_USER_DEFINED, wxT("eu"), WL(0, SUBLANG_DEFAULT) wxT("Basque"), wxLayout_LeftToRight }, + }; + #endif +@@ -1317,7 +1315,7 @@ bool AudacityApp::OnInit() + // + // TODO: The whole Language initialization really need to be reworked. + // It's all over the place. +-#if wxCHECK_VERSION(3, 0, 1) ++#if wxCHECK_VERSION(3, 0, 1) && !wxCHECK_VERSION(3, 1, 6) + for (size_t i = 0, cnt = WXSIZEOF(userLangs); i < cnt; i++) + { + wxLocale::AddLanguage(userLangs[i]); +-- +2.37.3 + + +From 1ba608cd73bc261de59e3d61fee64cdd8f7b0a0a Mon Sep 17 00:00:00 2001 +From: Ian McInerney +Date: Fri, 8 Apr 2022 01:27:52 +0100 +Subject: Call the proper wxBitmap constructor for XPM data + +wxBitmap back to at least 3.0.0 did not have a constructor for an XPM +image that took a size parameter, it would only take the XPM data +itself. + +I don't know how this compiled until now, but it doesn't anymore when +the size is included and built against wx 3.1.6 in Fedora. + +diff --git a/src/MixerBoard.cpp b/src/MixerBoard.cpp +index 0f3c67b..b5b9e6b 100644 +--- a/src/MixerBoard.cpp ++++ b/src/MixerBoard.cpp +@@ -1314,7 +1314,7 @@ void MixerBoard::LoadMusicalInstruments() + wxMemoryDC dc; + + for (const auto &data : table) { +- auto bmp = std::make_unique(data.bitmap,24); ++ auto bmp = std::make_unique(data.bitmap); + dc.SelectObject(*bmp); + AColor::Bevel(dc, false, bev); + mMusicalInstruments.push_back(std::make_unique( +-- +2.37.3 + + +From 5b158a877e36331823d11ee6306b14f1ce8c2554 Mon Sep 17 00:00:00 2001 +From: David Karoly +Date: Mon, 7 Nov 2022 14:27:23 +0100 +Subject: nyquist: fix build on Haiku + + +diff --git a/lib-src/libnyquist/nyquist/xlisp/xlisp.h b/lib-src/libnyquist/nyquist/xlisp/xlisp.h +index 44d52c3..e43f2ce 100644 +--- a/lib-src/libnyquist/nyquist/xlisp/xlisp.h ++++ b/lib-src/libnyquist/nyquist/xlisp/xlisp.h +@@ -27,6 +27,10 @@ extern "C" { + #include + #include + ++#ifdef __HAIKU__ ++#include ++#endif ++ + /* NNODES number of nodes to allocate in each request (1000) */ + /* EDEPTH evaluation stack depth (2000) */ + /* ADEPTH argument stack depth (1000) */ +@@ -188,6 +192,10 @@ extern long ptrtoabs(); + #endif + #endif + ++#ifdef __HAIKU__ ++#define XL_LITTLE_ENDIAN ++#endif ++ + /* default important definitions */ + #ifndef NNODES + #define NNODES 1000 +-- +2.37.3 + + +From e6836c68bfa510ed9ec077b7672ffbd8a4b6729b Mon Sep 17 00:00:00 2001 +From: David Karoly +Date: Mon, 7 Nov 2022 14:17:48 +0100 +Subject: portmixer: fix build on Haiku + + +diff --git a/cmake-proxies/cmake-modules/FindOSS.cmake b/cmake-proxies/cmake-modules/FindOSS.cmake +index b6e061a..9c747d0 100644 +--- a/cmake-proxies/cmake-modules/FindOSS.cmake ++++ b/cmake-proxies/cmake-modules/FindOSS.cmake +@@ -3,6 +3,10 @@ A module to look for OSS + ]] + + if( NOT OSS_FOUND ) ++ find_path(HAIKU_OSS_INCLUDE_DIR "private/audio/soundcard.h" ++ HINTS "/system/develop/headers" ++ ) ++ + find_path(LINUX_OSS_INCLUDE_DIR "linux/soundcard.h" + HINTS "/usr/include" "/usr/local/include" + ) +@@ -15,11 +19,17 @@ if( NOT OSS_FOUND ) + HINTS "/usr/include" "/usr/local/include" + ) + ++ set( HAVE_HAIKU_SOUNDCARD_H No CACHE BOOL "private/audio/soundcard.h is available" FORCE ) + set( HAVE_SYS_SOUNDCARD_H No CACHE BOOL "sys/soundcard.h is available" FORCE ) + set( HAVE_LINUX_SOUNDCARD_H No CACHE BOOL "linux/soundcard.h is available" FORCE ) + set( HAVE_MACHINE_SOUNDCARD_H No CACHE BOOL "machine/soundcard.h is available" FORCE ) + +- if( LINUX_OSS_INCLUDE_DIR ) ++ if( HAIKU_OSS_INCLUDE_DIR ) ++ set( OSS_FOUND True ) ++ set( OSS_INCLUDE_DIR ${HAIKU_OSS_INCLUDE_DIR} ) ++ set( HAVE_HAIKU_SOUNDCARD_H Yes CACHE BOOL "private/audio/soundcard.h is available" FORCE ) ++ list( APPEND OSS_DEFINITIONS HAVE_HAIKU_SOUNDCARD_H=1 ) ++ elseif( LINUX_OSS_INCLUDE_DIR ) + set( OSS_FOUND True ) + set( OSS_INCLUDE_DIR ${LINUX_OSS_INCLUDE_DIR} ) + set( HAVE_LINUX_SOUNDCARD_H Yes CACHE BOOL "sys/soundcard.h is available" FORCE ) +diff --git a/lib-src/portmixer/src/px_unix_oss.c b/lib-src/portmixer/src/px_unix_oss.c +index 978f27b..eb44dce 100644 +--- a/lib-src/portmixer/src/px_unix_oss.c ++++ b/lib-src/portmixer/src/px_unix_oss.c +@@ -46,7 +46,9 @@ + #include + #include + +-#if defined(HAVE_SYS_SOUNDCARD_H) ++#if defined(HAVE_HAIKU_SOUNDCARD_H) ++# include ++#elif defined(HAVE_SYS_SOUNDCARD_H) + # include + #elif defined(HAVE_LINUX_SOUNDCARD_H) + # include +-- +2.37.3 + + +From 495fe0214fe2a8f1595b197f990068092e5f45b0 Mon Sep 17 00:00:00 2001 +From: David Karoly +Date: Mon, 7 Nov 2022 15:09:44 +0100 +Subject: MIDIPlay: fix build on Haiku + + +diff --git a/src/MIDIPlay.cpp b/src/MIDIPlay.cpp +index 788e431..aba6288 100644 +--- a/src/MIDIPlay.cpp ++++ b/src/MIDIPlay.cpp +@@ -486,7 +486,7 @@ static double streamStartTime = 0; // bias system time to small number + + static double SystemTime(bool usingAlsa) + { +-#ifdef __WXGTK__ ++#if defined(__WXGTK__) && !defined(__HAIKU__) + if (usingAlsa) { + struct timespec now; + // CLOCK_MONOTONIC_RAW is unaffected by NTP or adj-time +-- +2.37.3 + + +From 5d6f5d180b7883738fcd29d5ec2cda46fa5cbab6 Mon Sep 17 00:00:00 2001 +From: David Karoly +Date: Mon, 7 Nov 2022 15:06:14 +0100 +Subject: fix GTK include paths and libs + + +diff --git a/cmake-proxies/cmake-modules/dependencies/wxwidgets.cmake b/cmake-proxies/cmake-modules/dependencies/wxwidgets.cmake +index 4b35e89..e5a909c 100644 +--- a/cmake-proxies/cmake-modules/dependencies/wxwidgets.cmake ++++ b/cmake-proxies/cmake-modules/dependencies/wxwidgets.cmake +@@ -106,5 +106,9 @@ if( NOT CMAKE_SYSTEM_NAME MATCHES "Windows|Darwin" ) + + pkg_check_modules( GTK REQUIRED IMPORTED_TARGET GLOBAL ${gtk} ) + pkg_check_modules( GLIB REQUIRED IMPORTED_TARGET GLOBAL ${glib} ) ++ ++ target_include_directories( wxwidgets::wxwidgets INTERFACE ${GTK_INCLUDE_DIRS} ) ++ target_link_directories( wxwidgets::wxwidgets INTERFACE ${GTK_LIB_DIR} ) ++ target_link_libraries( wxwidgets::wxwidgets INTERFACE ${GTK_LIBRARIES} ) + endif() + +-- +2.37.3 + + +From 0ba846266c5b827e648860e6e886507c4b35bf8c Mon Sep 17 00:00:00 2001 +From: David Karoly +Date: Mon, 7 Nov 2022 14:33:10 +0100 +Subject: adjust install rules for Haiku + + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 430ec6e..01b978c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -344,7 +344,7 @@ set( _EXEDIR "${_DEST}" ) + # Setup RPATH handling + set( CMAKE_BUILD_RPATH "${_DEST}/${_PKGLIB}" ) + set( CMAKE_BUILD_WITH_INSTALL_RPATH FALSE ) +-set( CMAKE_INSTALL_RPATH "$ORIGIN/../${_PKGLIB}" ) ++set( CMAKE_INSTALL_RPATH "${_PKGLIB}" ) + set( CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE ) + + # Adjust them for the Mac +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index f6468cd..7378eb3 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -1229,6 +1229,8 @@ elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) + set_target_property_all( "Wrapper" RUNTIME_OUTPUT_DIRECTORY "${_EXEDIR}" ) + organize_source( "${WRAPPER_ROOT}" "mac" "${WRAPPER_SOURCES}" ) + ++elseif( CMAKE_SYSTEM_NAME MATCHES "Haiku" ) ++ set_target_property_all( ${TARGET} RUNTIME_OUTPUT_DIRECTORY "${_DEST}" ) + else() + set_target_property_all( ${TARGET} RUNTIME_OUTPUT_DIRECTORY "${_DEST}" ) + +@@ -1368,6 +1370,18 @@ else() + install( TARGETS ${TARGET} + DESTINATION "." + RESOURCE DESTINATION "${_APPDIR}/Resources" ) ++ elseif( CMAKE_SYSTEM_NAME MATCHES "Haiku" ) ++ install( TARGETS ${TARGET} RUNTIME ) ++ install( DIRECTORY "${_DEST}/${_LIBDIR}/" ++ DESTINATION "${_LIBDIR}" ++ USE_SOURCE_PERMISSIONS ++ FILES_MATCHING PATTERN "*.so*" ) ++ install( FILES "${topdir}/LICENSE.txt" "${topdir}/README.txt" ++ DESTINATION "${_DATADIR}/doc/${AUDACITY_NAME}" ) ++ install( FILES "${_SRCDIR}/audacity.xml" ++ DESTINATION "${_DATADIR}/mime/packages" ) ++ install( FILES "${topdir}/presets/EQDefaultCurves.xml" ++ DESTINATION "${_PKGDATA}" ) + else() + install( TARGETS ${TARGET} RUNTIME ) + install( DIRECTORY "${_DEST}/${_LIBDIR}/" +-- +2.37.3 + + +From 34335b8df5ee17ceb58267e6e10aadc932624012 Mon Sep 17 00:00:00 2001 +From: David Karoly +Date: Thu, 17 Nov 2022 20:54:07 +0100 +Subject: Adapt shm to Haiku + +This implementation is based on the haikuports patch for postgresql and qt5/qt6 + +diff --git a/src/AudacityApp.cpp b/src/AudacityApp.cpp +index 7d45fd2..c8f1c02 100644 +--- a/src/AudacityApp.cpp ++++ b/src/AudacityApp.cpp +@@ -1923,7 +1923,69 @@ bool AudacityApp::CreateSingleInstanceChecker(const wxString &dir) + + #include + #include ++ ++#ifdef __HAIKU__ ++#include ++ ++/* ++ * The following code is adapted from: ++ * Haiku System V Shared Memory Emulation ++ * ++ * Copyright (C) 1999-2001, Cyril Velter ++ */ ++ ++int shmget(key_t key, size_t size, int flags) ++{ ++ char areaName[64]; ++ sprintf(areaName, "sysv_ipc_shm[%d]", (int)key); ++ ++ area_id areaId = find_area(areaName); ++ ++ if (areaId != B_NAME_NOT_FOUND) { ++ return areaId; ++ } ++ ++ if (flags==0) { ++ return -1; ++ } ++ ++ void *address = NULL; ++ areaId = create_area(areaName, &address, B_ANY_ADDRESS, ++ ((size / 4096) + 1) * 4096, B_NO_LOCK, ++ B_READ_AREA | B_WRITE_AREA | B_CLONEABLE_AREA); ++ ++ return areaId; ++} ++ ++void *shmat(int shmid, const void *shmaddr, int flags) ++{ ++ thread_info threadInfo; ++ get_thread_info(find_thread(NULL), &threadInfo); ++ ++ team_info teamInfo; ++ get_team_info(threadInfo.team, &teamInfo); ++ ++ area_info areaInfo; ++ if (get_area_info(shmid, &areaInfo) != B_OK) { ++ return NULL; ++ } ++ ++ void *res; ++ ++ if (areaInfo.team == teamInfo.team) { ++ return (void *)areaInfo.address; ++ } ++ ++ void *address = areaInfo.address; ++ area_id areaId = clone_area(areaInfo.name, &address, B_ANY_ADDRESS, ++ B_READ_AREA | B_WRITE_AREA, shmid); ++ get_area_info(areaId, &areaInfo); ++ ++ return (void *)areaInfo.address; ++} ++#else + #include ++#endif + + // Return true if there are no other instances of Audacity running, + // false otherwise. +-- +2.37.3 +