From 63caf60a1de90abfc375c30534a86b0639237a5b Mon Sep 17 00:00:00 2001 From: davidkaroly <92124087+davidkaroly@users.noreply.github.com> Date: Wed, 22 Feb 2023 08:00:37 +0100 Subject: [PATCH] audacity: update to 3.2.4 (#7873) --- ...ity-3.2.3.recipe => audacity-3.2.4.recipe} | 4 +- ...3.2.3.patchset => audacity-3.2.4.patchset} | 177 ++++++++++-------- 2 files changed, 97 insertions(+), 84 deletions(-) rename media-sound/audacity/{audacity-3.2.3.recipe => audacity-3.2.4.recipe} (97%) rename media-sound/audacity/patches/{audacity-3.2.3.patchset => audacity-3.2.4.patchset} (78%) diff --git a/media-sound/audacity/audacity-3.2.3.recipe b/media-sound/audacity/audacity-3.2.4.recipe similarity index 97% rename from media-sound/audacity/audacity-3.2.3.recipe rename to media-sound/audacity/audacity-3.2.4.recipe index 5ab917035..917c32646 100644 --- a/media-sound/audacity/audacity-3.2.3.recipe +++ b/media-sound/audacity/audacity-3.2.4.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-2022 by Audacity Team" +COPYRIGHT="1999-2023 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="79d441a6ff0d6084449d56b4883febe70c7d0d265e9c7fb9b1173b707b382ae5" +CHECKSUM_SHA256="9a85b5db02e25e46672c489ffa96d2f5115ee58650bfd57c5b8a07259f4f550f" SOURCE_DIR="audacity-Audacity-$portVersion" PATCHES="audacity-$portVersion.patchset" ADDITIONAL_FILES="audacity.rdef.in" diff --git a/media-sound/audacity/patches/audacity-3.2.3.patchset b/media-sound/audacity/patches/audacity-3.2.4.patchset similarity index 78% rename from media-sound/audacity/patches/audacity-3.2.3.patchset rename to media-sound/audacity/patches/audacity-3.2.4.patchset index 14c54839d..86f39f75c 100644 --- a/media-sound/audacity/patches/audacity-3.2.3.patchset +++ b/media-sound/audacity/patches/audacity-3.2.4.patchset @@ -1,4 +1,4 @@ -From 0c200809386739d974dbc6cd827c48008098046e Mon Sep 17 00:00:00 2001 +From 96eb16309eed86d5db6f6e7dfcdfaa3fa292ea8d 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 @@ -34,7 +34,7 @@ index 3134849..8fd29ea 100644 2.37.3 -From 60c1ebe5032aaa78d27376499a2f12b2a1c9618c Mon Sep 17 00:00:00 2001 +From ecb2791d4cc1c29af8c85e2394a24d9954dcf9f9 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 @@ -93,7 +93,7 @@ index 978f27b..eb44dce 100644 2.37.3 -From 4a66dc43c8969cb10d548356e5574c95c7b8b923 Mon Sep 17 00:00:00 2001 +From 91cd8ecd507b087d19799ad3c8dac608847407e9 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 @@ -116,7 +116,7 @@ index 620bb85..e1ee067 100644 2.37.3 -From 25288800bf158b58cbae5ec0b33bf4366ccc783c Mon Sep 17 00:00:00 2001 +From 599e51581eba796e3c6c0795f227e50d5bded308 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 @@ -140,14 +140,14 @@ index 4b35e89..e5a909c 100644 2.37.3 -From 8dd717ad0ff233057c907e411c15ab1c4511bd15 Mon Sep 17 00:00:00 2001 +From 7e99e0da1c25707bf73c44d37836af654a145861 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 74db77d..326cd79 100644 +index faef964..55d5a3d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -400,7 +400,11 @@ endif() @@ -193,99 +193,112 @@ index a71cacd..129c33e 100644 2.37.3 -From 5662e1fc869c2cb3214aac4a956f869834636621 Mon Sep 17 00:00:00 2001 +From e58525b35e7960cbc9fe6abac5d2a02a7130207c Mon Sep 17 00:00:00 2001 From: David Karoly Date: Thu, 17 Nov 2022 20:54:07 +0100 -Subject: Adapt shm to Haiku +Subject: Use POSIX shared memory -This implementation is based on the haikuports patch for postgresql and qt5/qt6 +Patch inspired by Tenacity, original author: Avery King diff --git a/src/AudacityApp.cpp b/src/AudacityApp.cpp -index 4472ca0..b7fda96 100644 +index 4472ca0..c2133f8 100644 --- a/src/AudacityApp.cpp +++ b/src/AudacityApp.cpp -@@ -1939,7 +1939,69 @@ bool AudacityApp::CreateSingleInstanceChecker(const wxString &dir) +@@ -64,6 +64,7 @@ It handles initialization and termination by subclassing wxApp. + #include + #include + #include ++#include + #endif + + #if defined(__WXMSW__) +@@ -1172,6 +1173,7 @@ bool AudacityApp::OSXIsGUIApplication() + + AudacityApp::~AudacityApp() + { ++ shm_unlink("/AudacityShm"); + } + + // Some of the many initialization steps +@@ -1939,7 +1941,6 @@ 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 +-#include // Return true if there are no other instances of Audacity running, // false otherwise. +@@ -1962,8 +1963,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" +@@ -1974,7 +1975,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); +@@ -2117,6 +2139,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; +@@ -2214,6 +2238,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 baffd3260661dd5ad9868f5bba2b7abc404ae8a2 Mon Sep 17 00:00:00 2001 +From c1ba7fc10deefd8ac290a94dbcbf59f9b1c9e4f8 Mon Sep 17 00:00:00 2001 From: David Karoly Date: Fri, 9 Dec 2022 16:36:39 +0100 Subject: Haiku: initialize XDG vars diff --git a/src/AudacityApp.cpp b/src/AudacityApp.cpp -index b7fda96..aee17cd 100644 +index c2133f8..77eff52 100644 --- a/src/AudacityApp.cpp +++ b/src/AudacityApp.cpp @@ -58,6 +58,12 @@ It handles initialization and termination by subclassing wxApp. @@ -301,7 +314,7 @@ index b7fda96..aee17cd 100644 // chmod, lstat, geteuid #ifdef __UNIX__ #include -@@ -832,6 +838,30 @@ int main(int argc, char *argv[]) +@@ -833,6 +839,30 @@ int main(int argc, char *argv[]) IMPLEMENT_APP_NO_MAIN(AudacityApp) IMPLEMENT_WX_THEME_SUPPORT @@ -332,7 +345,7 @@ index b7fda96..aee17cd 100644 int main(int argc, char *argv[]) { wxDISABLE_DEBUG_SUPPORT(); -@@ -844,6 +874,10 @@ int main(int argc, char *argv[]) +@@ -845,6 +875,10 @@ int main(int argc, char *argv[]) stdout = freopen("/dev/null", "w", stdout); stderr = freopen("/dev/null", "w", stderr); @@ -347,7 +360,7 @@ index b7fda96..aee17cd 100644 2.37.3 -From efcc756cdf3df7001c2f7ec93b182838837610dd Mon Sep 17 00:00:00 2001 +From 4e510ab731c0fa2575668d8f664b377fd39a9462 Mon Sep 17 00:00:00 2001 From: David Karoly Date: Sat, 17 Dec 2022 23:26:49 +0100 Subject: adjust paths for Haiku @@ -412,7 +425,7 @@ index 6cd5775..9078693 100644 2.37.3 -From c08959b0c803ef2c9129064c7dbec88a16932525 Mon Sep 17 00:00:00 2001 +From c4b3ce7f97ab1422c99c32ee626c50bbbb5a485a Mon Sep 17 00:00:00 2001 From: David Karoly Date: Sun, 18 Dec 2022 22:39:34 +0100 Subject: shutdown hook for locales. fix crash on exit @@ -449,10 +462,10 @@ index c6707ee..f545484 100644 STRINGS_API wxString GetLang(); diff --git a/src/AudacityApp.cpp b/src/AudacityApp.cpp -index aee17cd..0c5c4d8 100644 +index 77eff52..fdd1988 100644 --- a/src/AudacityApp.cpp +++ b/src/AudacityApp.cpp -@@ -878,7 +878,9 @@ int main(int argc, char *argv[]) +@@ -879,7 +879,9 @@ int main(int argc, char *argv[]) initialize_xdg_paths(); #endif