audacity: update to 3.2.2, initialize XDG dirs (#7535)

This commit is contained in:
davidkaroly
2022-12-09 17:45:20 +01:00
committed by GitHub
parent 846bc3a22e
commit 0112c0d98a
2 changed files with 86 additions and 17 deletions

View File

@@ -8,7 +8,7 @@ COPYRIGHT="1999-2022 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="cbded508d26dba809bbacc5d16da35f89a8ee32ba8622c0555e0577130eac609"
CHECKSUM_SHA256="290bd3023380ec3c737c3653e55f8afb2ad8f208a4a4d30bcb7662f0e5f4824b"
SOURCE_DIR="audacity-Audacity-$portVersion"
PATCHES="audacity-$portVersion.patchset"
ADDITIONAL_FILES="audacity.rdef.in"

View File

@@ -1,4 +1,4 @@
From 0db8a9d4ddd5a7c0caecf3171e0fadc7664991a7 Mon Sep 17 00:00:00 2001
From 5d09d9fad180b6aef338446569597ff8b85b6e0c 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
@@ -34,7 +34,7 @@ index 3134849..8fd29ea 100644
2.37.3
From d0766df944233131ddbd22e9756ecde3214efd88 Mon Sep 17 00:00:00 2001
From f56cbda6c6cf70e332f8677220432f46604958bc 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
@@ -93,7 +93,7 @@ index 978f27b..eb44dce 100644
2.37.3
From 39ee375d523daf5da8c168136034d5bb7c856f10 Mon Sep 17 00:00:00 2001
From 50f69ab7a493573559ef2947c60ebf5ac3188e7a 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
@@ -116,7 +116,7 @@ index 620bb85..e1ee067 100644
2.37.3
From 0d08d82f4f6bb4b5a035b75dd616296bf09be87c Mon Sep 17 00:00:00 2001
From 74b5477f96732953c7b6b91fe802d9ad41cbbb93 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
@@ -140,17 +140,17 @@ index 4b35e89..e5a909c 100644
2.37.3
From b52f860b324dd5f22c51e33a761ecf1e06930440 Mon Sep 17 00:00:00 2001
From 04c9e81eab1cf6c88ba05fe33dd94728733876f2 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/CMakeLists.txt b/CMakeLists.txt
index 3aa5ef8..c547b68 100644
index 9c1c7ba..032419e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -397,7 +397,7 @@ set( _EXEDIR "${_DEST}" )
@@ -411,7 +411,7 @@ set( _EXEDIR "${_DEST}" )
# Setup RPATH handling
set( CMAKE_BUILD_RPATH "${_DEST}/${_PKGLIB}" )
set( CMAKE_BUILD_WITH_INSTALL_RPATH FALSE )
@@ -160,19 +160,19 @@ index 3aa5ef8..c547b68 100644
# Adjust them for the Mac
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 7b90c1b..91ca320 100644
index 154da2d..903a2d1 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1429,6 +1429,8 @@ elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
${CMAKE_COMMAND} -E copy $<TARGET_FILE:Wrapper> "${_EXEDIR}/Wrapper"
POST_BUILD
)
@@ -1445,6 +1445,8 @@ elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
POST_BUILD
)
endif()
+elseif( CMAKE_SYSTEM_NAME MATCHES "Haiku" )
+ set_target_property_all( ${TARGET} RUNTIME_OUTPUT_DIRECTORY "${_DEST}" )
else()
set_target_properties(
${TARGET}
@@ -1632,8 +1634,10 @@ else()
@@ -1648,8 +1650,10 @@ else()
install( CODE "set( _LIBDIR \"${_LIBDIR}\")" )
install( SCRIPT "${CMAKE_SOURCE_DIR}/scripts/build/linux/fix_rpath.cmake" )
@@ -189,7 +189,7 @@ index 7b90c1b..91ca320 100644
2.37.3
From f5406cb928e6407544462556acbaa6dd7c451f3e Mon Sep 17 00:00:00 2001
From e71fab12e0dd15af8dee21efd78ec37bad769883 Mon Sep 17 00:00:00 2001
From: David Karoly <david.karoly@outlook.com>
Date: Thu, 17 Nov 2022 20:54:07 +0100
Subject: Adapt shm to Haiku
@@ -197,10 +197,10 @@ 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 58a5a16..4cf8f32 100644
index 98c4a4d..0e879bd 100644
--- a/src/AudacityApp.cpp
+++ b/src/AudacityApp.cpp
@@ -1900,7 +1900,69 @@ bool AudacityApp::CreateSingleInstanceChecker(const wxString &dir)
@@ -1932,7 +1932,69 @@ bool AudacityApp::CreateSingleInstanceChecker(const wxString &dir)
#include <sys/ipc.h>
#include <sys/sem.h>
@@ -273,3 +273,72 @@ index 58a5a16..4cf8f32 100644
--
2.37.3
From ca400c00f31ed04070a0dfb5f490ce27264e1082 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
diff --git a/src/AudacityApp.cpp b/src/AudacityApp.cpp
index 0e879bd..842ea72 100644
--- a/src/AudacityApp.cpp
+++ b/src/AudacityApp.cpp
@@ -58,6 +58,12 @@ It handles initialization and termination by subclassing wxApp.
#endif
#endif
+#ifdef __HAIKU__
+#include <FindDirectory.h>
+#include <fs_info.h>
+#include <glib.h>
+#endif
+
// chmod, lstat, geteuid
#ifdef __UNIX__
#include <sys/types.h>
@@ -825,6 +831,30 @@ int main(int argc, char *argv[])
IMPLEMENT_APP_NO_MAIN(AudacityApp)
IMPLEMENT_WX_THEME_SUPPORT
+#ifdef __HAIKU__
+void initialize_xdg_paths(void)
+{
+ char dir[B_PATH_NAME_LENGTH + B_FILE_NAME_LENGTH];
+ char dirs[B_PATH_NAME_LENGTH + B_FILE_NAME_LENGTH];
+ dev_t volume = dev_for_path("/boot");
+
+ if (find_directory(B_SYSTEM_SETTINGS_DIRECTORY, volume, false, dir, sizeof(dir)) == B_OK)
+ g_setenv ("XDG_CONFIG_DIRS", dir, FALSE);
+ if (find_directory(B_USER_NONPACKAGED_DATA_DIRECTORY, volume, false, dir, sizeof(dir)) == B_OK)
+ g_setenv ("XDG_DATA_HOME", dir, FALSE);
+ if (find_directory(B_USER_SETTINGS_DIRECTORY, volume, false, dir, sizeof(dir)) == B_OK)
+ g_setenv ("XDG_CONFIG_HOME", dir, FALSE);
+ if (find_directory(B_USER_CACHE_DIRECTORY, volume, false, dir, sizeof(dir)) == B_OK)
+ g_setenv ("XDG_CACHE_HOME", dir, FALSE);
+ if (find_directory(B_SYSTEM_DATA_DIRECTORY, volume, false, dir, sizeof(dir)) == B_OK &&
+ find_directory(B_SYSTEM_NONPACKAGED_DATA_DIRECTORY, volume, false, dirs, sizeof(dirs)) == B_OK) {
+ strcat(dirs, ":");
+ strcat(dirs, dir);
+ g_setenv ("XDG_DATA_DIRS", dirs, FALSE);
+ }
+}
+#endif
+
int main(int argc, char *argv[])
{
wxDISABLE_DEBUG_SUPPORT();
@@ -837,6 +867,10 @@ int main(int argc, char *argv[])
stdout = freopen("/dev/null", "w", stdout);
stderr = freopen("/dev/null", "w", stderr);
+#ifdef __HAIKU__
+ initialize_xdg_paths();
+#endif
+
return wxEntry(argc, argv);
}
--
2.37.3