glib2, add 2.80.0 (#12827)

This commit is contained in:
Schrijvers Luc
2025-08-30 16:39:40 +02:00
committed by GitHub
parent bfa71d2672
commit 09d428a479
2 changed files with 691 additions and 0 deletions

View File

@@ -0,0 +1,196 @@
SUMMARY="GLib is a cross-platform software utility library"
DESCRIPTION="GLib is a cross-platform software utility library that began as \
part of the GTK+ project. However, before releasing version 2 of GTK+, the \
project's developers decided to separate non-GUI-specific code from the GTK+ \
platform, thus creating GLib as a separate product. GLib was released as a \
separate library so other developers, those who did not make use of the \
GUI-related portions of GTK+, could make use of the non-GUI portions of the \
library without the overhead of depending on the entire GUI library.
Since GLib is a cross-platform library, applications using it to interface \
with the operating system are usually portable across different operating \
systems without major changes."
HOMEPAGE="https://www.gtk.org/"
COPYRIGHT="1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
1991-2003 Free Software Foundation, Inc.
1997-2006 University of Cambridge.
1998-2001, 2003-2010 Red Hat, Inc.
2007-2009 Nokia Corporation
2008, 2010 Oracle and/or its affiliates, Inc. All rights
2008-2010 Codethink Limited
2008-2010 Collabora Ltd.
1995-2010 Several others"
LICENSE="GNU LGPL v2"
REVISION="1"
SOURCE_URI="https://gitlab.gnome.org/GNOME/glib/-/archive/$portVersion/glib-$portVersion.tar.gz"
CHECKSUM_SHA256="491b3b37b50cea4cb62fd5f4e3e3889273d57a8eaad80f3d4974291a681e48ff"
SOURCE_DIR="glib-$portVersion"
srvGitRev2="0854af0fdb6d527a8d1999835ac2c5059976c210"
SOURCE_URI_2="https://gitlab.gnome.org/GNOME/gvdb/-/archive/0854af0fdb6d527a8d1999835ac2c5059976c210/gvdb-$srvGitRev2.tar.gz"
CHECKSUM_SHA256_2="08352e54e8216d9001820c627c62858585465b51dc557cc22f0f4770ed182ebd"
SOURCE_DIR_2="gvdb-$srvGitRev2"
PATCHES="glib2-$portVersion.patchset"
ARCHITECTURES="?all !x86_gcc2 ?riscv64"
SECONDARY_ARCHITECTURES="?x86"
commandSuffix=$secondaryArchSuffix
commandBinDir=$binDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
commandSuffix=
commandBinDir=$prefix/bin
fi
libVersion="0.8000.0"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
PROVIDES="
glib2$secondaryArchSuffix = $portVersion
cmd:gapplication$commandSuffix
cmd:gdbus$commandSuffix
cmd:gdbus_codegen$commandSuffix
cmd:gi_compile_repository$commandSuffix
cmd:gi_decompile_typelib$commandSuffix
cmd:gi_inspect_typelib$commandSuffix
cmd:gio$commandSuffix
cmd:gio_launch_desktop$commandSuffix
cmd:gio_querymodules$commandSuffix
cmd:glib_compile_resources$commandSuffix
cmd:glib_compile_schemas$commandSuffix
cmd:gresource$commandSuffix
cmd:gsettings$commandSuffix
lib:libgio_2.0$secondaryArchSuffix = $libVersionCompat
lib:libgirepository_2.0$secondaryArchSuffix = $libVersionCompat
lib:libglib_2.0$secondaryArchSuffix = $libVersionCompat
lib:libgmodule_2.0$secondaryArchSuffix = $libVersionCompat
lib:libgobject_2.0$secondaryArchSuffix = $libVersionCompat
lib:libgthread_2.0$secondaryArchSuffix = $libVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libffi$secondaryArchSuffix
lib:libiconv$secondaryArchSuffix
lib:libintl$secondaryArchSuffix
lib:libpcre2_8$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
PROVIDES_devel="
glib2${secondaryArchSuffix}_devel = $portVersion compat >= 0
cmd:glib_genmarshal$commandSuffix
cmd:glib_gettextize$commandSuffix
cmd:glib_mkenums$commandSuffix
cmd:gobject_query$commandSuffix
cmd:gtester$commandSuffix
cmd:gtester_report$commandSuffix
devel:libgio_2.0$secondaryArchSuffix = $libVersionCompat
devel:libgirepository_2.0$secondaryArchSuffix = $libVersionCompat
devel:libglib_2.0$secondaryArchSuffix = $libVersionCompat
devel:libgmodule_2.0$secondaryArchSuffix = $libVersionCompat
devel:libgobject_2.0$secondaryArchSuffix = $libVersionCompat
devel:libgthread_2.0$secondaryArchSuffix = $libVersionCompat
"
REQUIRES_devel="
glib2$secondaryArchSuffix == $portVersion base
haiku$secondaryArchSuffix
cmd:perl
cmd:python3
devel:libffi$secondaryArchSuffix
devel:libiconv$secondaryArchSuffix
devel:libintl$secondaryArchSuffix
devel:libpcre2_8$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
# devel:libdbus_1$secondaryArchSuffix
# devel:libelf$secondaryArchSuffix
devel:libffi$secondaryArchSuffix
devel:libiconv$secondaryArchSuffix
devel:libintl$secondaryArchSuffix
devel:libpcre2_8$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
packaging_python310
cmd:cmake
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:make
cmd:meson
cmd:pkg_config$secondaryArchSuffix
cmd:python3
"
defineDebugInfoPackage glib2$secondaryArchSuffix \
$commandBinDir/gapplication \
$commandBinDir/gdbus \
$commandBinDir/gi-compile-repository \
$commandBinDir/gi-decompile-typelib \
$commandBinDir/gi-inspect-typelib \
$commandBinDir/gio \
$commandBinDir/gio-querymodules \
$commandBinDir/glib-compile-resources \
$commandBinDir/glib-compile-schemas \
$commandBinDir/gresource \
$commandBinDir/gsettings \
$libDir/libgio-2.0.so.$libVersion \
$libDir/libgirepository-2.0.so.$libVersion \
$libDir/libglib-2.0.so.$libVersion \
$libDir/libgmodule-2.0.so.$libVersion \
$libDir/libgobject-2.0.so.$libVersion \
$libDir/libgthread-2.0.so.$libVersion
BUILD()
{
rm -rf subprojects/gvdb
ln -s $sourceDir2 subprojects/gvdb
CFLAGS="-D_BSD_SOURCE" \
LDFLAGS="-lbsd -lgnu -lnetwork" meson build \
-D glib_debug=disabled --buildtype=debugoptimized \
--prefix=$prefix --includedir=$includeDir \
--libdir=$libDir --datadir=$dataDir --bindir=$commandBinDir \
--localedir=$dataDir/locale
ninja $jobArgs -C build
}
INSTALL()
{
ninja -C build install
prepareInstalledDevelLibs libgio-2.0 \
libgirepository-2.0 \
libglib-2.0 \
libgmodule-2.0 \
libgobject-2.0 \
libgthread-2.0
# move the glibconfig header into devel as well
mv $libDir/glib-2.0 $developLibDir
fixPkgconfig
# devel package
packageEntries devel \
$developDir \
$commandBinDir/glib-genmarshal \
$commandBinDir/glib-gettextize \
$commandBinDir/glib-mkenums \
$commandBinDir/gobject-query \
$commandBinDir/gtester \
$commandBinDir/gtester-report
rm -rf $prefix/libexec
}
TEST()
{
# Ok: 305
# Fail: 31
# Skipped: 6
# Timeout: 2
meson test -C build
}

View File

@@ -0,0 +1,495 @@
From 9cfb52636492ce5a2172459880eceee4b93dfc0b Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Sat, 29 Jul 2017 12:13:00 +0200
Subject: g_dbus_message_print: use B_PRIiDEV on Haiku
because Haiku doesn't define major() and minor()
diff --git a/gio/gdbusmessage.c b/gio/gdbusmessage.c
index 5a5fec8..37ca7fd 100644
--- a/gio/gdbusmessage.c
+++ b/gio/gdbusmessage.c
@@ -37,8 +37,12 @@
#elif MAJOR_IN_TYPES
#include <sys/types.h>
#else
+#ifdef __HAIKU__
+#include <SupportDefs.h>
+#else
#define MAJOR_MINOR_NOT_FOUND 1
#endif
+#endif
#include "gdbusutils.h"
#include "gdbusmessage.h"
@@ -3866,8 +3870,14 @@ g_dbus_message_print (GDBusMessage *message,
if (fstat (fds[n], &statbuf) == 0)
{
#ifndef MAJOR_MINOR_NOT_FOUND
+#ifdef __HAIKU__
+ g_string_append_printf (fs, "%s" "dev=%" B_PRIiDEV, fs->len > 0 ? "," : "",
+ statbuf.st_dev);
+#else
+
g_string_append_printf (fs, "%s" "dev=%d:%d", fs->len > 0 ? "," : "",
(gint) major (statbuf.st_dev), (gint) minor (statbuf.st_dev));
+#endif
#endif
g_string_append_printf (fs, "%s" "mode=0%o", fs->len > 0 ? "," : "",
(guint) statbuf.st_mode);
@@ -3878,9 +3888,14 @@ g_dbus_message_print (GDBusMessage *message,
g_string_append_printf (fs, "%s" "gid=%u", fs->len > 0 ? "," : "",
(guint) statbuf.st_gid);
#ifndef MAJOR_MINOR_NOT_FOUND
+#ifdef __HAIKU__
+ g_string_append_printf (fs, "%s" "rdev=%" B_PRIiDEV, fs->len > 0 ? "," : "",
+ statbuf.st_rdev);
+#else
g_string_append_printf (fs, "%s" "rdev=%d:%d", fs->len > 0 ? "," : "",
(gint) major (statbuf.st_rdev), (gint) minor (statbuf.st_rdev));
#endif
+#endif
g_string_append_printf (fs, "%s" "size=%" G_GUINT64_FORMAT, fs->len > 0 ? "," : "",
(guint64) statbuf.st_size);
g_string_append_printf (fs, "%s" "atime=%" G_GUINT64_FORMAT, fs->len > 0 ? "," : "",
--
2.50.1
From 9dbb855be16d55eddce163b12b168a7bc713fea6 Mon Sep 17 00:00:00 2001
From: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Date: Mon, 23 Aug 2021 19:31:38 +0000
Subject: gunixmounts.c: Add Haiku support
diff --git a/gio/gunixmounts.c b/gio/gunixmounts.c
index a7a9363..0ecdbd4 100644
--- a/gio/gunixmounts.c
+++ b/gio/gunixmounts.c
@@ -69,6 +69,9 @@ extern char* hasmntopt(const struct mntent* mnt, const char* opt);
#endif
#include <sys/mount.h>
#endif
+#ifdef __HAIKU__
+#include <kernel/fs_info.h>
+#endif
#ifndef O_BINARY
#define O_BINARY 0
@@ -962,6 +965,49 @@ _g_get_unix_mounts (void)
return return_list;
}
+/* Haiku {{{2 */
+#elif defined(__HAIKU__)
+
+static const char *
+get_mtab_monitor_file (void)
+{
+ return NULL;
+}
+
+static GList *
+_g_get_unix_mounts (void)
+{
+ int32 pos = 0;
+ GList* return_list = NULL;
+ struct fs_info info;
+ GUnixMountEntry* mount_entry;
+
+ while (1)
+ {
+ dev_t dev = next_dev (&pos);
+ if (dev < 0)
+ break;
+
+ if (fs_stat_dev (dev, &info) < 0)
+ continue;
+
+ mount_entry = g_new0 (GUnixMountEntry, 1);
+
+ mount_entry->mount_path = g_strdup (info.volume_name);
+ mount_entry->device_path = g_strdup (info.device_name);
+ mount_entry->filesystem_type = g_strdup (info.fsh_name);
+
+ mount_entry->is_read_only = (info.flags & B_FS_IS_READONLY) ? TRUE : FALSE;
+ mount_entry->is_system_internal = (info.flags & B_FS_IS_REMOVABLE) ? FALSE : TRUE;
+
+ return_list = g_list_prepend (return_list, mount_entry);
+ }
+
+ return_list = g_list_reverse (return_list);
+
+ return return_list;
+}
+
/* QNX {{{2 */
#elif defined (HAVE_QNX)
@@ -1495,16 +1541,8 @@ _g_get_unix_mount_points (void)
return g_list_reverse (return_list);
}
-/* Interix {{{2 */
-#elif defined(__INTERIX)
-static GList *
-_g_get_unix_mount_points (void)
-{
- return _g_get_unix_mounts ();
-}
-
-/* QNX {{{2 */
-#elif defined (HAVE_QNX)
+/* Interix, QNX, Haiku {{{2 */
+#elif defined (__INTERIX) || defined (HAVE_QNX) || defined (__HAIKU__)
static GList *
_g_get_unix_mount_points (void)
{
--
2.50.1
From aadf4e5534897f767880f08a66d6c5f995b855a7 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Sat, 29 Jul 2017 12:32:14 +0200
Subject: glib/gutils.c: on Haiku define load_user_special_dirs()
use find_directory() from SupportDefs.h
diff --git a/glib/gutils.c b/glib/gutils.c
index bb88c76..38dace0 100644
--- a/glib/gutils.c
+++ b/glib/gutils.c
@@ -78,6 +78,10 @@
#include "gwin32.h"
#endif
+#if defined(__HAIKU__)
+#include <FindDirectory.h>
+#include <fs_info.h>
+#endif
#ifdef G_PLATFORM_WIN32
# include <windows.h>
@@ -1871,6 +1875,13 @@ g_build_user_data_dir (void)
#ifdef G_OS_WIN32
else
data_dir = get_special_folder (&FOLDERID_LocalAppData);
+#elif defined(__HAIKU__)
+ else {
+ char path[B_PATH_NAME_LENGTH + B_FILE_NAME_LENGTH];
+ dev_t volume = dev_for_path("/boot");
+ if (find_directory(B_USER_NONPACKAGED_DATA_DIRECTORY, volume, false, path, sizeof(path)) == B_OK)
+ data_dir = g_strdup(path);
+ }
#endif
if (!data_dir || !data_dir[0])
{
@@ -1936,6 +1947,13 @@ g_build_user_config_dir (void)
#ifdef G_OS_WIN32
else
config_dir = get_special_folder (&FOLDERID_LocalAppData);
+#elif defined(__HAIKU__)
+ else {
+ char path[B_PATH_NAME_LENGTH + B_FILE_NAME_LENGTH];
+ dev_t volume = dev_for_path("/boot");
+ if (find_directory(B_USER_SETTINGS_DIRECTORY, volume, false, path, sizeof(path)) == B_OK)
+ config_dir = g_strdup(path);
+ }
#endif
if (!config_dir || !config_dir[0])
{
@@ -2200,6 +2218,35 @@ load_user_special_dirs (void)
load_user_special_dirs_macos (g_user_special_dirs);
}
+#elif defined(__HAIKU__)
+static void
+load_user_special_dirs (void)
+{
+ char path[B_PATH_NAME_LENGTH + B_FILE_NAME_LENGTH];
+
+ dev_t volume = dev_for_path("/boot");
+ if (find_directory(B_DESKTOP_DIRECTORY, volume, false, path, sizeof(path))
+ == B_OK) {
+ g_user_special_dirs[G_USER_DIRECTORY_DESKTOP] = g_strdup(path);
+ g_user_special_dirs[G_USER_DIRECTORY_DOWNLOAD] = g_strdup(path);
+ } else {
+ g_user_special_dirs[G_USER_DIRECTORY_DOCUMENTS] = NULL;
+ g_user_special_dirs[G_USER_DIRECTORY_DESKTOP] = NULL;
+ }
+
+ if (find_directory(B_USER_DIRECTORY, volume, false, path, sizeof(path))
+ == B_OK) {
+ g_user_special_dirs[G_USER_DIRECTORY_DOCUMENTS] = g_strdup(path);
+ } else
+ g_user_special_dirs[G_USER_DIRECTORY_DOWNLOAD] = NULL;
+
+ g_user_special_dirs[G_USER_DIRECTORY_MUSIC] = NULL;
+ g_user_special_dirs[G_USER_DIRECTORY_PICTURES] = NULL;
+ g_user_special_dirs[G_USER_DIRECTORY_PUBLIC_SHARE] = NULL;
+ g_user_special_dirs[G_USER_DIRECTORY_TEMPLATES] = NULL;
+ g_user_special_dirs[G_USER_DIRECTORY_VIDEOS] = NULL;
+}
+
#elif defined(G_OS_WIN32)
static void
@@ -2695,7 +2742,16 @@ g_build_system_data_dirs (void)
*/
#ifndef G_OS_WIN32
if (!data_dirs || !data_dirs[0])
+#if defined(__HAIKU__)
+ {
+ char path[B_PATH_NAME_LENGTH + B_FILE_NAME_LENGTH];
+ dev_t volume = dev_for_path("/boot");
+ if (find_directory(B_SYSTEM_DATA_DIRECTORY, volume, false, path, sizeof(path)) == B_OK)
+ data_dirs = g_strdup(path);
+ }
+#else
data_dirs = "/usr/local/share/:/usr/share/";
+#endif
data_dir_vector = g_strsplit (data_dirs, G_SEARCHPATH_SEPARATOR_S, 0);
#else
@@ -2790,6 +2846,20 @@ g_build_system_config_dirs (void)
g_free (special_conf_dirs);
}
+#elif defined(__HAIKU__)
+ if (conf_dirs)
+ {
+ conf_dir_vector = g_strsplit (conf_dirs, G_SEARCHPATH_SEPARATOR_S, 0);
+ }
+ else
+ {
+ char path[B_PATH_NAME_LENGTH + B_FILE_NAME_LENGTH];
+ dev_t volume = dev_for_path("/boot");
+ if (find_directory(B_SYSTEM_SETTINGS_DIRECTORY, volume, false, path, sizeof(path)) == B_OK)
+ conf_dir_vector = g_strsplit (path, G_SEARCHPATH_SEPARATOR_S, 0);
+ else
+ conf_dir_vector = g_strsplit ("", G_SEARCHPATH_SEPARATOR_S, 0);
+ }
#else
if (!conf_dirs || !conf_dirs[0])
conf_dirs = "/etc/xdg";
--
2.50.1
From ea8148cabd49a9da76ccb980418a3c81e06a8aa8 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Sat, 23 Nov 2019 20:10:10 +0100
Subject: Haiku patch for x86
diff --git a/glib/tests/mapping.c b/glib/tests/mapping.c
index 99cb8ee..8d56df0 100644
--- a/glib/tests/mapping.c
+++ b/glib/tests/mapping.c
@@ -191,6 +191,10 @@ test_private (void)
g_remove ("maptest");
}
+#ifdef __HAIKU__
+#include <SupportDefs.h>
+#endif
+
static void
test_child_private (void)
{
@@ -223,7 +227,11 @@ test_child_private (void)
signal (SIGUSR1, handle_usr1);
#endif
+#ifdef __HAIKU__
+ g_snprintf (pid, sizeof(pid), B_PRId32, getpid ());
+#else
g_snprintf (pid, sizeof(pid), "%d", getpid ());
+#endif
child_argv[0] = local_argv[0];
child_argv[1] = "mapchild";
child_argv[2] = pid;
--
2.50.1
From 55dde56d3c849ef3e32ea5cb8b3e982bcc366127 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Tue, 17 Aug 2021 08:29:48 +0000
Subject: Fix network detection
diff --git a/gio/meson.build b/gio/meson.build
index 59c2b0f..ebd5b1f 100644
--- a/gio/meson.build
+++ b/gio/meson.build
@@ -26,6 +26,7 @@ if host_system not in ['windows', 'android']
int qclass = C_IN;''',
name : 'C_IN in public headers (no arpa/nameser_compat.h needed)')
if cc.compiles('''#include <sys/types.h>
+ #include <stdint.h>
#include <arpa/nameser.h>
#include <arpa/nameser_compat.h>
int qclass = C_IN;''',
@@ -46,6 +47,7 @@ if host_system != 'windows'
return res_query("test", 0, 0, (void *)0, 0);
}'''
res_query_test_full = '''#include <sys/types.h>
+ #include <stdint.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
''' + res_query_test
@@ -59,6 +61,9 @@ if host_system != 'windows'
elif cc.links(res_query_test, args : '-lsocket', name : 'res_query() in -lsocket')
network_libs += [ cc.find_library('socket') ]
network_args += [ '-lsocket' ]
+ elif cc.links(res_query_test, args : '-lnetwork', name : 'res_query() in -lnetwork')
+ network_libs += [ cc.find_library('network') ]
+ network_args += [ '-lnetwork' ]
else
error('Could not find res_query()')
endif
--
2.50.1
From 618f2698c70d7224e63816cc45c81d98e3ad4a5e Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Thu, 5 Jan 2023 18:31:01 +1000
Subject: Use find_directory for xdgmime
diff --git a/gio/xdgmime/xdgmime.c b/gio/xdgmime/xdgmime.c
index 0909581..338c49c 100644
--- a/gio/xdgmime/xdgmime.c
+++ b/gio/xdgmime/xdgmime.c
@@ -29,6 +29,11 @@
#include <unistd.h>
#include <assert.h>
+#if defined(__HAIKU__)
+#include <FindDirectory.h>
+#include <fs_info.h>
+#endif
+
#ifndef S_ISREG
#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
#endif
@@ -223,6 +228,23 @@ xdg_init_dirs (void)
assert (xdg_dirs == NULL);
+#ifdef __HAIKU__
+ current_dir = 0;
+ xdg_dirs = calloc (2, sizeof (char *));
+
+ char path[B_PATH_NAME_LENGTH + B_FILE_NAME_LENGTH];
+ dev_t volume = dev_for_path("/boot");
+ if (find_directory(B_SYSTEM_DATA_DIRECTORY, volume, false, path, sizeof(path)) == B_OK)
+ {
+ xdg_data_dirs = strdup(path);
+ strcat (xdg_data_dirs, "/mime/");
+ }
+ else
+ {
+ xdg_data_dirs = strdup("/system/data/mime/");
+ }
+ xdg_dirs[current_dir++] = xdg_data_dirs;
+#else
xdg_data_home = getenv ("XDG_DATA_HOME");
home = getenv ("HOME");
xdg_data_dirs = getenv ("XDG_DATA_DIRS");
@@ -295,7 +317,7 @@ xdg_init_dirs (void)
ptr = end_ptr;
}
-
+#endif
/* NULL terminator */
xdg_dirs[current_dir] = NULL;
--
2.50.1
From 017e09abf4d237406315a3bb7c72061a555f5e06 Mon Sep 17 00:00:00 2001
From: Alexander von Gluck <alex@terarocket.io>
Date: Tue, 26 Aug 2025 10:38:29 -0500
Subject: glib: Disable kqueue on Haiku
diff --git a/meson.build b/meson.build
index 7534542..3b70972 100644
--- a/meson.build
+++ b/meson.build
@@ -683,7 +683,6 @@ functions = [
'inotify_init1',
'issetugid',
'kevent',
- 'kqueue',
'lchmod',
'lchown',
'link',
@@ -728,6 +727,13 @@ if host_system == 'darwin'
functions += ['_NSGetEnviron']
endif
+# Haiku's kqueue implementation is not yet compatible
+if host_system != 'haiku'
+ functions += ['kqueue']
+else
+ have_func_kqueue = false
+endif
+
if glib_conf.has('HAVE_SYS_STATVFS_H')
functions += ['statvfs']
else
--
2.50.1
From 3ba408a5fdaccf149e10e8067ab39892cd31f958 Mon Sep 17 00:00:00 2001
From: Luc Schrijvers <begasus@gmail.com>
Date: Wed, 27 Aug 2025 13:05:59 +0200
Subject: Fixes for mismatching CPU_ZERO, CPU_ISSET and CPU_SET
diff --git a/glib/gthread.c b/glib/gthread.c
index b39acc4..25d23df 100644
--- a/glib/gthread.c
+++ b/glib/gthread.c
@@ -1094,6 +1094,12 @@ g_get_num_processors (void)
{
int idx;
int ncores = MIN (sysconf (_SC_NPROCESSORS_ONLN), CPU_SETSIZE);
+#ifdef __HAIKU__
+#define cpu_set_t cpuset_t
+#define CPU_ZERO CPUSET_ZERO
+#define CPU_ISSET CPUSET_ISSET
+#endif
+
cpu_set_t cpu_mask;
CPU_ZERO (&cpu_mask);
diff --git a/glib/tests/thread.c b/glib/tests/thread.c
index 6e87796..cb99db6 100644
--- a/glib/tests/thread.c
+++ b/glib/tests/thread.c
@@ -219,6 +219,13 @@ thread7_func (gpointer data)
int idx = 0, err;
int ncores = sysconf (_SC_NPROCESSORS_ONLN);
+#ifdef __HAIKU__
+#define cpu_set_t cpuset_t
+#define CPU_ZERO CPUSET_ZERO
+#define CPU_ISSET CPUSET_ISSET
+#define CPU_SET CPUSET_SET
+#endif
+
cpu_set_t old_mask, new_mask;
err = pthread_getaffinity_np (pthread_self (), sizeof (old_mask), &old_mask);
--
2.50.1