audacity: bump version

This commit is contained in:
Gerasim Troeglazov
2025-03-04 15:54:32 +10:00
parent da064e5d22
commit fa365acd45
2 changed files with 144 additions and 205 deletions

View File

@@ -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-2023 by Audacity Team"
COPYRIGHT="1999-2024 by Audacity Team"
LICENSE="GNU GPL v2"
REVISION="3"
REVISION="1"
SOURCE_URI="https://github.com/audacity/audacity/archive/refs/tags/Audacity-$portVersion.tar.gz"
CHECKSUM_SHA256="752cbe51fea0c143085d453eecbf024f5225891fd0118f1866d5964d892f1c25"
CHECKSUM_SHA256="02457fe0ae1dab3a9a50ce54836cdd78a2d3ab51650d42696cab417210f03906"
SOURCE_DIR="audacity-Audacity-$portVersion"
PATCHES="audacity-$portVersion.patchset"
ADDITIONAL_FILES="audacity.rdef.in"
@@ -102,7 +102,7 @@ BUILD()
mkdir -p build/src/private
cmake -S . -B build -G Ninja \
$cmakeDirArgs \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-Daudacity_conan_enabled=Off \
-Daudacity_has_networking=Off \
-Daudacity_has_vst3=Off \

View File

@@ -1,11 +1,11 @@
From b31a6262a4ecad15fdd5730bb3986c324148ad2b Mon Sep 17 00:00:00 2001
From 1c926264b0662cf5e561bbc5f6076aee1c32757c Mon Sep 17 00:00:00 2001
From: David Karoly <david.karoly@outlook.com>
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 3134849..8fd29ea 100644
index 3b03c09..deba6b2 100644
--- a/lib-src/libnyquist/nyquist/xlisp/xlisp.h
+++ b/lib-src/libnyquist/nyquist/xlisp/xlisp.h
@@ -27,6 +27,10 @@ extern "C" {
@@ -31,10 +31,10 @@ index 3134849..8fd29ea 100644
#ifndef NNODES
#define NNODES 1000
--
2.37.3
2.48.1
From f3cd87c3cb743973c93fdc5fc3f7124cd469e6df Mon Sep 17 00:00:00 2001
From f006adfeaf130488be0ed95f4255bffbe349c011 Mon Sep 17 00:00:00 2001
From: David Karoly <david.karoly@outlook.com>
Date: Mon, 7 Nov 2022 14:17:48 +0100
Subject: portmixer: fix build on Haiku
@@ -90,43 +90,20 @@ index 978f27b..eb44dce 100644
#elif defined(HAVE_LINUX_SOUNDCARD_H)
# include <linux/soundcard.h>
--
2.37.3
2.48.1
From 8192a1db2463995de46393e9eef2503a5602d7b4 Mon Sep 17 00:00:00 2001
From: David Karoly <david.karoly@outlook.com>
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 620bb85..e1ee067 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 504245ef18918b857e8c224cbaf6132cca772292 Mon Sep 17 00:00:00 2001
From 725f411f5a7e7ba0226581166cbce7beef598ce9 Mon Sep 17 00:00:00 2001
From: David Karoly <david.karoly@outlook.com>
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 df79c6a..dffd951 100644
index fa13a81..d48ac85 100644
--- a/cmake-proxies/cmake-modules/dependencies/wxwidgets.cmake
+++ b/cmake-proxies/cmake-modules/dependencies/wxwidgets.cmake
@@ -159,5 +159,9 @@ if( NOT CMAKE_SYSTEM_NAME MATCHES "Windows|Darwin" )
@@ -183,5 +183,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} )
@@ -137,20 +114,20 @@ index df79c6a..dffd951 100644
endif()
--
2.37.3
2.48.1
From 44731a66c04c4ab8e06024288160c5963affcb6a Mon Sep 17 00:00:00 2001
From c81aef12ce154c0e6610fbe10838c4c9e9adac32 Mon Sep 17 00:00:00 2001
From: David Karoly <david.karoly@outlook.com>
Date: Mon, 7 Nov 2022 14:33:10 +0100
Subject: Adjust install rules for Haiku
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 08f3717..792f925 100644
index 91bc0a0..022f696 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1352,6 +1352,8 @@ elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
@@ -1174,6 +1174,8 @@ elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
POST_BUILD
)
endif()
@@ -159,7 +136,7 @@ index 08f3717..792f925 100644
else()
set_target_properties(
${TARGET}
@@ -1562,8 +1564,10 @@ else()
@@ -1416,8 +1418,10 @@ else()
USE_SOURCE_PERMISSIONS
FILES_MATCHING PATTERN "*.so*" )
@@ -169,122 +146,24 @@ index 08f3717..792f925 100644
+ install( FILES "${_INTDIR}/audacity.desktop"
+ DESTINATION "${_DATADIR}/applications" )
+ endif()
install( FILES "${topdir}/LICENSE.txt" "${topdir}/README.md"
DESTINATION "${_DATADIR}/doc/${AUDACITY_NAME}" )
install( FILES "${_SRCDIR}/audacity.xml"
if(${_OPT}has_url_schemes_support)
install( FILES "${_INTDIR}/audacity-url-handler.desktop"
--
2.37.3
2.48.1
From 3a3dc550928a746c746dc9357273a2c8a2462008 Mon Sep 17 00:00:00 2001
From 08f7ce7e27055c64ec16860a2b39529751c66849 Mon Sep 17 00:00:00 2001
From: David Karoly <david.karoly@outlook.com>
Date: Thu, 17 Nov 2022 20:54:07 +0100
Subject: Use POSIX shared memory
Patch inspired by Tenacity, original author: Avery King <avery98@pm.me>
diff --git a/src/AudacityApp.cpp b/src/AudacityApp.cpp
index edce76f..ca44936 100644
--- a/src/AudacityApp.cpp
+++ b/src/AudacityApp.cpp
@@ -60,6 +60,7 @@ It handles initialization and termination by subclassing wxApp.
#include <sys/file.h>
#include <sys/stat.h>
#include <stdio.h>
+#include <sys/mman.h>
#endif
#if defined(__WXMSW__)
@@ -1243,6 +1244,7 @@ bool AudacityApp::OSXIsGUIApplication()
AudacityApp::~AudacityApp()
{
+ shm_unlink("/AudacityShm");
}
// Some of the many initialization steps
@@ -2018,7 +2020,6 @@ bool AudacityApp::CreateSingleInstanceChecker(const wxString &dir)
#include <sys/ipc.h>
#include <sys/sem.h>
-#include <sys/shm.h>
// Return true if there are no other instances of Audacity running,
// false otherwise.
@@ -2041,8 +2042,8 @@ bool AudacityApp::CreateSingleInstanceChecker(const wxString &dir)
// Create and map the shared memory segment where the port number
// will be stored.
- int memid = shmget(memkey, sizeof(int), IPC_CREAT | S_IRUSR | S_IWUSR);
- if (memid == -1)
+ int memfd = shm_open("/AudacityShm", O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
+ if (memfd == -1)
{
AudacityMessageBox(
XO("Unable to create shared memory segment.\n\n"
@@ -2053,7 +2054,28 @@ bool AudacityApp::CreateSingleInstanceChecker(const wxString &dir)
return false;
}
- int *portnum = (int *) shmat(memid, nullptr, 0);
+ if (ftruncate(memfd, sizeof(int)) != 0)
+ {
+ AudacityMessageBox(
+ XO("Unable to initialize shared memory segment.\n\n"
+ "error code=%d : \"%s\".").Format(errno, strerror(errno)),
+ XO("Audacity Startup Failure"),
+ wxOK | wxICON_ERROR);
+
+ return false;
+ }
+
+ int *portnum = (int *) mmap(nullptr, sizeof(int), PROT_READ | PROT_WRITE, MAP_SHARED, memfd, 0);
+ if (portnum == MAP_FAILED)
+ {
+ AudacityMessageBox(
+ XO("Unable to map shared memory segment.\n\n"
+ "error code=%d : \"%s\".").Format(errno, strerror(errno)),
+ XO("Audacity Startup Failure"),
+ wxOK | wxICON_ERROR);
+
+ return false;
+ }
// Create (or return) the SERVER semaphore ID
int servid = semget(servkey, 1, IPC_CREAT | S_IRUSR | S_IWUSR);
@@ -2196,6 +2218,8 @@ bool AudacityApp::CreateSingleInstanceChecker(const wxString &dir)
return false;
}
+ munmap(portnum, sizeof(int));
+
// We've successfully created the socket server and the app
// should continue to initialize.
return true;
@@ -2293,6 +2317,8 @@ bool AudacityApp::CreateSingleInstanceChecker(const wxString &dir)
// Send an empty string to force existing Audacity to front
sock->WriteMsg(wxEmptyString, sizeof(wxChar));
+ munmap(portnum, sizeof(int));
+
// We've forwarded all of the filenames, so let the caller know
// to terminate.
return false;
--
2.37.3
From 082285212f8511b147833ef72ba8f8359ddb34e1 Mon Sep 17 00:00:00 2001
From: David Karoly <david.karoly@outlook.com>
Date: Fri, 9 Dec 2022 16:36:39 +0100
Subject: Haiku: initialize XDG vars
Subject: Use POSIX shared memory and initialize XDG vars
diff --git a/src/AudacityApp.cpp b/src/AudacityApp.cpp
index ca44936..9256072 100644
index ad21187..36822c9 100644
--- a/src/AudacityApp.cpp
+++ b/src/AudacityApp.cpp
@@ -54,6 +54,12 @@ It handles initialization and termination by subclassing wxApp.
@@ -50,12 +50,19 @@ It handles initialization and termination by subclassing wxApp.
#endif
#endif
@@ -297,7 +176,14 @@ index ca44936..9256072 100644
// chmod, lstat, geteuid
#ifdef __UNIX__
#include <sys/types.h>
@@ -842,6 +848,30 @@ public:
#include <sys/file.h>
#include <sys/stat.h>
#include <stdio.h>
+#include <sys/mman.h>
#endif
#if defined(__WXMSW__)
@@ -861,6 +868,30 @@ public:
};
};
@@ -328,43 +214,126 @@ index ca44936..9256072 100644
#if defined(__WXMAC__)
IMPLEMENT_APP_NO_MAIN(AudacityApp)
@@ -893,6 +923,10 @@ int main(int argc, char *argv[])
@@ -912,7 +943,13 @@ int main(int argc, char *argv[])
freopen("/dev/null", "w", stdout);
freopen("/dev/null", "w", stderr);
- return wxEntry(argc, argv);
+#ifdef __HAIKU__
+ initialize_xdg_paths();
+#endif
+
return wxEntry(argc, argv);
+ int res = wxEntry(argc, argv);
+ Languages::UnsetLocale();
+ return res;
}
@@ -908,6 +942,10 @@ int main(int argc, char *argv[])
#elif defined(__WXGTK__)
@@ -927,7 +964,13 @@ int main(int argc, char *argv[])
wxDISABLE_DEBUG_SUPPORT();
- return wxEntry(argc, argv);
+#ifdef __HAIKU__
+ initialize_xdg_paths();
+#endif
+
return wxEntry(argc, argv);
+ int res = wxEntry(argc, argv);
+ Languages::UnsetLocale();
+ return res;
}
wxIMPLEMENT_APP_NO_MAIN(AudacityApp);
@@ -1272,6 +1315,7 @@ bool AudacityApp::OSXIsGUIApplication()
AudacityApp::~AudacityApp()
{
+ shm_unlink("/AudacityShm");
}
void AudacityApp::ShowSplashScreen() {
@@ -2108,7 +2152,6 @@ bool AudacityApp::CreateSingleInstanceChecker(const wxString &dir)
#include <sys/ipc.h>
#include <sys/sem.h>
-#include <sys/shm.h>
// Return true if there are no other instances of Audacity running,
// false otherwise.
@@ -2131,8 +2174,8 @@ bool AudacityApp::CreateSingleInstanceChecker(const wxString &dir)
// Create and map the shared memory segment where the port number
// will be stored.
- int memid = shmget(memkey, sizeof(int), IPC_CREAT | S_IRUSR | S_IWUSR);
- if (memid == -1)
+ int memfd = shm_open("/AudacityShm", O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
+ if (memfd == -1)
{
AudacityMessageBox(
XO("Unable to create shared memory segment.\n\n"
@@ -2143,7 +2186,28 @@ bool AudacityApp::CreateSingleInstanceChecker(const wxString &dir)
return false;
}
- int *portnum = (int *) shmat(memid, nullptr, 0);
+ if (ftruncate(memfd, sizeof(int)) != 0)
+ {
+ AudacityMessageBox(
+ XO("Unable to initialize shared memory segment.\n\n"
+ "error code=%d : \"%s\".").Format(errno, strerror(errno)),
+ XO("Audacity Startup Failure"),
+ wxOK | wxICON_ERROR);
+
+ return false;
+ }
+
+ int *portnum = (int *) mmap(nullptr, sizeof(int), PROT_READ | PROT_WRITE, MAP_SHARED, memfd, 0);
+ if (portnum == MAP_FAILED)
+ {
+ AudacityMessageBox(
+ XO("Unable to map shared memory segment.\n\n"
+ "error code=%d : \"%s\".").Format(errno, strerror(errno)),
+ XO("Audacity Startup Failure"),
+ wxOK | wxICON_ERROR);
+
+ return false;
+ }
// Create (or return) the SERVER semaphore ID
int servid = semget(servkey, 1, IPC_CREAT | S_IRUSR | S_IWUSR);
@@ -2286,6 +2350,8 @@ bool AudacityApp::CreateSingleInstanceChecker(const wxString &dir)
return false;
}
+ munmap(portnum, sizeof(int));
+
// We've successfully created the socket server and the app
// should continue to initialize.
return true;
@@ -2383,6 +2449,8 @@ bool AudacityApp::CreateSingleInstanceChecker(const wxString &dir)
// Send an empty string to force existing Audacity to front
sock->WriteMsg(wxEmptyString, sizeof(wxChar));
+ munmap(portnum, sizeof(int));
+
// We've forwarded all of the filenames, so let the caller know
// to terminate.
return false;
--
2.37.3
2.48.1
From d12f70cb8abea40088d635c780a744b6a093dec2 Mon Sep 17 00:00:00 2001
From 4a8a8a092c1851d9928d23bbbd3e3ac9d82df5b8 Mon Sep 17 00:00:00 2001
From: David Karoly <david.karoly@outlook.com>
Date: Sat, 17 Dec 2022 23:26:49 +0100
Subject: adjust paths for Haiku
diff --git a/libraries/lib-files/PathList.cpp b/libraries/lib-files/PathList.cpp
index 622a9eb..907dd59 100644
index df04dec..904d2a9 100644
--- a/libraries/lib-files/PathList.cpp
+++ b/libraries/lib-files/PathList.cpp
@@ -29,7 +29,7 @@ void FileNames::InitializePathList()
@@ -49,7 +49,7 @@ void FileNames::InitializePathList()
const auto portablePrefix = wxPathOnly(wxPathOnly(programPath));
// Make sure install prefix is set so wxStandardPath resolves paths properly
@@ -373,7 +342,7 @@ index 622a9eb..907dd59 100644
// use prefix relative to executable location to make Audacity portable
standardPaths.SetInstallPrefix(portablePrefix);
} else {
@@ -95,9 +95,9 @@ void FileNames::InitializePathList()
@@ -117,9 +117,9 @@ void FileNames::InitializePathList()
audacityPathList);
FileNames::AddUniquePathToPathList(FileNames::ModulesDir(),
audacityPathList);
@@ -385,7 +354,7 @@ index 622a9eb..907dd59 100644
audacityPathList);
#else //AUDACITY_NAME
FileNames::AddUniquePathToPathList(wxString::Format(wxT("%s/.audacity-files"),
@@ -105,13 +105,13 @@ void FileNames::InitializePathList()
@@ -127,13 +127,13 @@ void FileNames::InitializePathList()
audacityPathList);
FileNames::AddUniquePathToPathList(FileNames::ModulesDir(),
audacityPathList);
@@ -402,8 +371,18 @@ index 622a9eb..907dd59 100644
audacityPathList);
FileNames::AddUniquePathToPathList(wxString::Format(wxT("./locale")),
--
2.48.1
From fbb8252e467f7fd65254b324e33d98060c00fc3a Mon Sep 17 00:00:00 2001
From: David Karoly <david.karoly@outlook.com>
Date: Sun, 18 Dec 2022 22:39:34 +0100
Subject: shutdown hook for locales. fix crash on exit
diff --git a/libraries/lib-strings/Languages.cpp b/libraries/lib-strings/Languages.cpp
index 6cd5775..9078693 100644
index 6cd5775..9249c66 100644
--- a/libraries/lib-strings/Languages.cpp
+++ b/libraries/lib-strings/Languages.cpp
@@ -220,7 +220,7 @@ void GetLanguages( FilePaths pathList,
@@ -415,20 +394,6 @@ index 6cd5775..9078693 100644
pathNorm.Normalize();
const wxString newPath{ pathNorm.GetFullPath() };
if (pathList.end() ==
--
2.37.3
From 80808ac4f1af4a720380a9ced73e2538dab6dbfb Mon Sep 17 00:00:00 2001
From: David Karoly <david.karoly@outlook.com>
Date: Sun, 18 Dec 2022 22:39:34 +0100
Subject: shutdown hook for locales. fix crash on exit
diff --git a/libraries/lib-strings/Languages.cpp b/libraries/lib-strings/Languages.cpp
index 9078693..9249c66 100644
--- a/libraries/lib-strings/Languages.cpp
+++ b/libraries/lib-strings/Languages.cpp
@@ -321,6 +321,11 @@ void GetLanguages( FilePaths pathList,
static std::unique_ptr<wxLocale> sLocale;
static wxString sLocaleName;
@@ -455,55 +420,29 @@ index c6707ee..f545484 100644
/*! @return the last language code that was set */
STRINGS_API
wxString GetLang();
diff --git a/src/AudacityApp.cpp b/src/AudacityApp.cpp
index 9256072..ade1668 100644
--- a/src/AudacityApp.cpp
+++ b/src/AudacityApp.cpp
@@ -927,7 +927,9 @@ int main(int argc, char *argv[])
initialize_xdg_paths();
#endif
- return wxEntry(argc, argv);
+ int res = wxEntry(argc, argv);
+ Languages::UnsetLocale();
+ return res;
}
#elif defined(__WXGTK__)
@@ -946,7 +948,9 @@ int main(int argc, char *argv[])
initialize_xdg_paths();
#endif
- return wxEntry(argc, argv);
+ int res = wxEntry(argc, argv);
+ Languages::UnsetLocale();
+ return res;
}
wxIMPLEMENT_APP_NO_MAIN(AudacityApp);
--
2.37.3
2.48.1
From 75c0f654e8d820058e2d5864326e66ff8131b5fc Mon Sep 17 00:00:00 2001
From f9dbbaa8580b24affcfeb7ee37ef17317845b9e4 Mon Sep 17 00:00:00 2001
From: David Karoly <david.karoly@outlook.com>
Date: Tue, 2 May 2023 19:53:40 +0200
Subject: Haiku: Build GTK FileDialog
diff --git a/libraries/lib-wx-wrappers/CMakeLists.txt b/libraries/lib-wx-wrappers/CMakeLists.txt
index 3399210..2762940 100644
index 4ddb487..442b656 100644
--- a/libraries/lib-wx-wrappers/CMakeLists.txt
+++ b/libraries/lib-wx-wrappers/CMakeLists.txt
@@ -21,7 +21,7 @@ set( SOURCES
@@ -25,7 +25,7 @@ set( SOURCES
FileDialog/mac/FileDialogPrivate.mm
FileDialog/mac/FileDialogPrivate.h
>
- $<$<PLATFORM_ID:Linux,FreeBSD,CYGWIN>:
+ $<$<PLATFORM_ID:Linux,FreeBSD,CYGWIN,Haiku>:
- $<$<PLATFORM_ID:Linux,FreeBSD,OpenBSD,CYGWIN>:
+ $<$<PLATFORM_ID:Linux,FreeBSD,OpenBSD,CYGWIN,Haiku>:
FileDialog/gtk/FileDialogPrivate.cpp
FileDialog/gtk/FileDialogPrivate.h
>
--
2.37.3
2.48.1