mirror of
https://github.com/yann64/haikuports.git
synced 2026-05-05 22:48:55 +02:00
221 lines
8.8 KiB
Plaintext
221 lines
8.8 KiB
Plaintext
From 142a6537629901ba3dddafdc53cf4b5cf128ca2b Mon Sep 17 00:00:00 2001
|
|
From: Luc Schrijvers <begasus@gmail.com>
|
|
Date: Fri, 9 May 2025 09:19:52 +0200
|
|
Subject: Haiku build fixes
|
|
|
|
Co-authored-by: TURX <turx2003@gmail.com>
|
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
index 8aa40a0..c7a239c 100644
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -293,7 +293,7 @@ if(MOD_MOVIT)
|
|
pkg_check_modules(movit IMPORTED_TARGET movit)
|
|
find_package(OpenGL)
|
|
if(TARGET PkgConfig::movit AND TARGET OpenGL::GL)
|
|
- if(UNIX AND NOT APPLE)
|
|
+ if(UNIX AND NOT APPLE AND NOT HAIKU)
|
|
find_package(X11 REQUIRED)
|
|
endif()
|
|
list(APPEND MLT_SUPPORTED_COMPONENTS movit)
|
|
diff --git a/src/modules/plusgpl/CMakeLists.txt b/src/modules/plusgpl/CMakeLists.txt
|
|
index bc677af..c9753d2 100644
|
|
--- a/src/modules/plusgpl/CMakeLists.txt
|
|
+++ b/src/modules/plusgpl/CMakeLists.txt
|
|
@@ -21,7 +21,7 @@ target_link_libraries(mltplusgpl PRIVATE mlt m Threads::Threads)
|
|
|
|
if(WIN32)
|
|
target_link_libraries(mltplusgpl PRIVATE ws2_32)
|
|
-elseif(UNIX AND NOT APPLE AND NOT ANDROID AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
|
|
+elseif(UNIX AND NOT APPLE AND NOT ANDROID AND NOT HAIKU AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
|
|
target_link_libraries(mltplusgpl PRIVATE rt)
|
|
endif()
|
|
|
|
diff --git a/src/modules/qt/common.cpp b/src/modules/qt/common.cpp
|
|
index 59cb304..e858caa 100644
|
|
--- a/src/modules/qt/common.cpp
|
|
+++ b/src/modules/qt/common.cpp
|
|
@@ -21,7 +21,7 @@
|
|
#include <QImageReader>
|
|
#include <QLocale>
|
|
|
|
-#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_ANDROID)
|
|
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_ANDROID) && !defined(Q_OS_HAIKU)
|
|
#include <X11/Xlib.h>
|
|
#include <cstdlib>
|
|
#endif
|
|
@@ -35,7 +35,7 @@ bool createQApplicationIfNeeded(mlt_service service)
|
|
QCoreApplication::addLibraryPath(QString(mlt_environment("MLT_APPDIR"))
|
|
+ QStringLiteral("/plugins"));
|
|
#endif
|
|
-#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_ANDROID)
|
|
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_ANDROID) && !defined(Q_OS_HAIKU)
|
|
if (getenv("DISPLAY") == 0 && getenv("WAYLAND_DISPLAY") == 0) {
|
|
const char *qt_qpa = getenv("QT_QPA_PLATFORM");
|
|
if (!qt_qpa || strcmp(qt_qpa, "offscreen")) {
|
|
diff --git a/src/modules/sdl/CMakeLists.txt b/src/modules/sdl/CMakeLists.txt
|
|
index 6128184..769591b 100644
|
|
--- a/src/modules/sdl/CMakeLists.txt
|
|
+++ b/src/modules/sdl/CMakeLists.txt
|
|
@@ -17,7 +17,7 @@ target_link_libraries(mltsdl PRIVATE mlt m Threads::Threads PkgConfig::sdl)
|
|
|
|
if(APPLE)
|
|
target_link_libraries(mltsdl PRIVATE objc "-framework Foundation")
|
|
-elseif(UNIX)
|
|
+elseif(UNIX AND NOT HAIKU)
|
|
target_link_libraries(mltsdl PRIVATE X11)
|
|
endif()
|
|
|
|
diff --git a/src/modules/sdl/consumer_sdl.c b/src/modules/sdl/consumer_sdl.c
|
|
index 98abfaa..7f1492a 100644
|
|
--- a/src/modules/sdl/consumer_sdl.c
|
|
+++ b/src/modules/sdl/consumer_sdl.c
|
|
@@ -876,7 +876,7 @@ static int consumer_get_dimensions(int *width, int *height)
|
|
#ifndef __APPLE__
|
|
// Get the wm structure
|
|
if (SDL_GetWMInfo(&wm) == 1) {
|
|
-#ifndef _WIN32
|
|
+#if !defined(_WIN32) && !defined(__HAIKU__)
|
|
// Check that we have the X11 wm
|
|
if (wm.subsystem == SDL_SYSWM_X11) {
|
|
// Get the SDL window
|
|
diff --git a/src/modules/sdl/consumer_sdl_still.c b/src/modules/sdl/consumer_sdl_still.c
|
|
index 629c75b..0414b18 100644
|
|
--- a/src/modules/sdl/consumer_sdl_still.c
|
|
+++ b/src/modules/sdl/consumer_sdl_still.c
|
|
@@ -579,7 +579,7 @@ static int consumer_get_dimensions(int *width, int *height)
|
|
#ifndef __APPLE__
|
|
// Get the wm structure
|
|
if (SDL_GetWMInfo(&wm) == 1) {
|
|
-#ifndef _WIN32
|
|
+#if !defined(_WIN32) && !defined(__HAIKU__)
|
|
// Check that we have the X11 wm
|
|
if (wm.subsystem == SDL_SYSWM_X11) {
|
|
// Get the SDL window
|
|
--
|
|
2.48.1
|
|
|
|
|
|
From 88a896b40960d5f5709f47d5a2306584b6b70257 Mon Sep 17 00:00:00 2001
|
|
From: Luc Schrijvers <begasus@gmail.com>
|
|
Date: Fri, 9 May 2025 09:34:15 +0200
|
|
Subject: Haiku doesn't have pthread_attr_setinheritsched
|
|
|
|
Co-authored-by: TURX <turx2003@gmail.com>
|
|
|
|
diff --git a/src/framework/mlt_consumer.c b/src/framework/mlt_consumer.c
|
|
index a65d7c8..cca843d 100644
|
|
--- a/src/framework/mlt_consumer.c
|
|
+++ b/src/framework/mlt_consumer.c
|
|
@@ -1174,9 +1174,11 @@ static void consumer_work_start(mlt_consumer self)
|
|
|
|
priority.sched_priority = mlt_properties_get_int(MLT_CONSUMER_PROPERTIES(self), "priority");
|
|
pthread_attr_init(&thread_attributes);
|
|
+#ifndef __HAIKU__
|
|
pthread_attr_setschedpolicy(&thread_attributes, SCHED_OTHER);
|
|
+#endif
|
|
pthread_attr_setschedparam(&thread_attributes, &priority);
|
|
-#if !defined(__ANDROID__) || (defined(__ANDROID__) && __ANDROID_API__ >= 28)
|
|
+#if !defined(__HAIKU__) && !defined(__ANDROID__) || (defined(__ANDROID__) && __ANDROID_API__ >= 28)
|
|
pthread_attr_setinheritsched(&thread_attributes, PTHREAD_EXPLICIT_SCHED);
|
|
#endif
|
|
pthread_attr_setscope(&thread_attributes, PTHREAD_SCOPE_SYSTEM);
|
|
@@ -1754,9 +1756,11 @@ static void mlt_thread_create(mlt_consumer self, mlt_thread_function_t function)
|
|
< 1) {
|
|
pthread_attr_t thread_attributes;
|
|
pthread_attr_init(&thread_attributes);
|
|
+#ifndef __HAIKU__
|
|
pthread_attr_setschedpolicy(&thread_attributes, SCHED_OTHER);
|
|
+#endif
|
|
pthread_attr_setschedparam(&thread_attributes, &priority);
|
|
-#if !defined(__ANDROID__) \
|
|
+#if !defined(__HAIKU__) && !defined(__ANDROID__) \
|
|
|| (defined(__ANDROID__) \
|
|
&& __ANDROID_API__ \
|
|
>= 28) // pthread_attr_setinheritsched is not available until API level 28
|
|
diff --git a/src/framework/mlt_slices.c b/src/framework/mlt_slices.c
|
|
index 3f5b321..b036d71 100644
|
|
--- a/src/framework/mlt_slices.c
|
|
+++ b/src/framework/mlt_slices.c
|
|
@@ -199,7 +199,9 @@ static mlt_slices mlt_slices_init(int threads, int policy, int priority)
|
|
policy = SCHED_OTHER;
|
|
if (priority < 0)
|
|
priority = sched_get_priority_max(policy);
|
|
+#ifndef __HAIKU__
|
|
pthread_attr_setschedpolicy(&tattr, policy);
|
|
+#endif
|
|
param.sched_priority = priority;
|
|
pthread_attr_setschedparam(&tattr, ¶m);
|
|
|
|
diff --git a/src/modules/decklink/consumer_decklink.cpp b/src/modules/decklink/consumer_decklink.cpp
|
|
index f8f1f6a..fd8a490 100644
|
|
--- a/src/modules/decklink/consumer_decklink.cpp
|
|
+++ b/src/modules/decklink/consumer_decklink.cpp
|
|
@@ -748,7 +748,9 @@ protected:
|
|
return;
|
|
|
|
pthread_attr_init(&tattr);
|
|
+#ifndef __HAIKU__
|
|
pthread_attr_setschedpolicy(&tattr, SCHED_FIFO);
|
|
+#endif
|
|
|
|
if (!strcmp("max", mlt_properties_get(properties, "priority")))
|
|
param.sched_priority = sched_get_priority_max(SCHED_FIFO) - 1;
|
|
diff --git a/src/modules/decklink/producer_decklink.cpp b/src/modules/decklink/producer_decklink.cpp
|
|
index 14a92dc..cd04a2d 100644
|
|
--- a/src/modules/decklink/producer_decklink.cpp
|
|
+++ b/src/modules/decklink/producer_decklink.cpp
|
|
@@ -471,7 +471,9 @@ public:
|
|
struct sched_param param;
|
|
|
|
pthread_attr_init(&tattr);
|
|
+#ifndef __HAIKU__
|
|
pthread_attr_setschedpolicy(&tattr, SCHED_FIFO);
|
|
+#endif
|
|
|
|
if (!strcmp("max", mlt_properties_get(properties, "priority")))
|
|
param.sched_priority = sched_get_priority_max(SCHED_FIFO) - 1;
|
|
diff --git a/src/modules/plusgpl/consumer_cbrts.c b/src/modules/plusgpl/consumer_cbrts.c
|
|
index 7cc8b88..0dc6787 100644
|
|
--- a/src/modules/plusgpl/consumer_cbrts.c
|
|
+++ b/src/modules/plusgpl/consumer_cbrts.c
|
|
@@ -913,9 +913,11 @@ static void start_output_thread(consumer_cbrts self)
|
|
pthread_attr_t thread_attributes;
|
|
pthread_attr_init(&thread_attributes);
|
|
priority.sched_priority = rtprio;
|
|
+#ifndef __HAIKU__
|
|
pthread_attr_setschedpolicy(&thread_attributes, SCHED_FIFO);
|
|
+#endif
|
|
pthread_attr_setschedparam(&thread_attributes, &priority);
|
|
-#if !defined(__ANDROID__) || (defined(__ANDROID__) && __ANDROID_API__ >= 28)
|
|
+#if !defined(__HAIKU__) && !defined(__ANDROID__) || (defined(__ANDROID__) && __ANDROID_API__ >= 28)
|
|
pthread_attr_setinheritsched(&thread_attributes, PTHREAD_EXPLICIT_SCHED);
|
|
#endif
|
|
pthread_attr_setscope(&thread_attributes, PTHREAD_SCOPE_SYSTEM);
|
|
--
|
|
2.48.1
|
|
|
|
|
|
From 3323e91a66c0af346c2d8ae04fb2d44b34540a7a Mon Sep 17 00:00:00 2001
|
|
From: Luc Schrijvers <begasus@gmail.com>
|
|
Date: Fri, 9 May 2025 10:34:36 +0200
|
|
Subject: Set clang-format version to 20
|
|
|
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
index c7a239c..861c2e1 100644
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -526,7 +526,7 @@ if(CLANG_FORMAT)
|
|
# Formatting may change with different versions of clang-format.
|
|
# Test new versions before changing the allowed version here to avoid
|
|
# accidental broad changes to formatting.
|
|
- find_package(ClangFormat 14 EXACT)
|
|
+ find_package(ClangFormat 20 EXACT)
|
|
if(CLANGFORMAT_FOUND)
|
|
file(GLOB_RECURSE FORMAT_FILES "src/*.h" "src/*.c" "src/*.cpp")
|
|
# exclude 3rd party source from format checking
|
|
--
|
|
2.48.1
|
|
|