From c0ca2c2f9e4c32b3b221e3bd0412d4eb3f1cbc6d Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 9 Jan 2025 09:38:09 -0700 Subject: [PATCH] Fix build of openal --- recipes/wip/libs/audio/openal/recipe.toml | 62 +++++++++++++++++++---- recipes/wip/libs/audio/openal/redox.patch | 47 +++++++++++++++++ 2 files changed, 98 insertions(+), 11 deletions(-) create mode 100644 recipes/wip/libs/audio/openal/redox.patch diff --git a/recipes/wip/libs/audio/openal/recipe.toml b/recipes/wip/libs/audio/openal/recipe.toml index b3aa3ee4..6e8c4464 100644 --- a/recipes/wip/libs/audio/openal/recipe.toml +++ b/recipes/wip/libs/audio/openal/recipe.toml @@ -1,20 +1,60 @@ #TODO probably wrong script, see https://openal-soft.org/#installing [source] -tar = "https://openal-soft.org/openal-releases/openal-soft-1.23.1.tar.bz2" +tar = "https://openal-soft.org/openal-releases/openal-soft-1.24.1.tar.bz2" +blake3 = "8aeaa8307d3e14331ad20761c537ffebe70975cb7c3343e8d5c0c0ed7bc16eab" +patch = [ + "redox.patch" +] + [build] template = "custom" +dependencies = [ + "liborbital", + "libsndfile", + "llvm18", + "mesa", + "sdl2", + "zlib", +] script = """ - COOKBOOK_CONFIGURE="cmake" - COOKBOOK_CONFIGURE_FLAGS=( +export CFLAGS="${CFLAGS} -I${COOKBOOK_SYSROOT}/include -I${COOKBOOK_SYSROOT}/include/SDL2" +export CXXFLAGS="${CXXFLAGS} -I${COOKBOOK_SYSROOT}/include -I${COOKBOOK_SYSROOT}/include/SDL2" +cat > redox.cmake <(u0-u1)) return diff; + ++ch0; ++ch1; + } +diff -ruwN openal-soft-1.24.1/common/althreads.h source/common/althreads.h +--- openal-soft-1.24.1/common/althreads.h 2024-11-27 20:21:16.000000000 -0700 ++++ source/common/althreads.h 2025-01-09 09:31:58.064326293 -0700 +@@ -9,7 +9,7 @@ + #define WIN32_LEAN_AND_MEAN + #include + +-#elif defined(__APPLE__) ++#elif defined(__APPLE__) || defined(__redox__) + + #include + +@@ -79,7 +79,7 @@ + [[nodiscard]] + auto get() const noexcept -> T { return from_ptr(TlsGetValue(mTss)); } + +-#elif defined(__APPLE__) ++#elif defined(__APPLE__) || defined(__redox__) + + pthread_key_t mTss{}; + +diff -ruwN openal-soft-1.24.1/core/helpers.cpp source/core/helpers.cpp +--- openal-soft-1.24.1/core/helpers.cpp 2024-11-27 20:21:16.000000000 -0700 ++++ source/core/helpers.cpp 2025-01-09 09:36:47.992595649 -0700 +@@ -372,7 +372,7 @@ + bool SetRTPriorityPthread(int prio [[maybe_unused]]) + { + int err{ENOTSUP}; +-#if defined(HAVE_PTHREAD_SETSCHEDPARAM) && !defined(__OpenBSD__) ++#if defined(HAVE_PTHREAD_SETSCHEDPARAM) && !defined(__OpenBSD__) && !defined(__redox__) + /* Get the min and max priority for SCHED_RR. Limit the max priority to + * half, for now, to ensure the thread can't take the highest priority and + * go rogue.