glib2, bump to 2.81.0, bootstrap gobject-introspection (#12957)

* glib2, bump to 2.81.0, bootstrap gobject-introspection

* Update dev-libs/glib/patches/glib2-2.81.0.patchset

Co-authored-by: Máximo Castañeda <antiswen@yahoo.es>

---------

Co-authored-by: Máximo Castañeda <antiswen@yahoo.es>
This commit is contained in:
Schrijvers Luc
2025-10-20 08:15:28 +02:00
committed by GitHub
parent 1f9b2c3236
commit a7759a8f2e
7 changed files with 297 additions and 894 deletions

View File

@@ -1,180 +0,0 @@
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="3"
SOURCE_URI="https://gitlab.gnome.org/GNOME/glib/-/archive/$portVersion/glib-$portVersion.tar.gz"
CHECKSUM_SHA256="e1e8e200cbae77d79551d758b79e816e60feaf238f2199aec58691f5bdb6c7b4"
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"
SECONDARY_ARCHITECTURES="x86"
commandSuffix=$secondaryArchSuffix
commandBinDir=$binDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
commandSuffix=
commandBinDir=$prefix/bin
fi
libVersion="0.7800.0"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
PROVIDES="
glib2$secondaryArchSuffix = $portVersion
cmd:gapplication$commandSuffix
cmd:gdbus$commandSuffix
cmd:gdbus_codegen$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: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: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="
cmd:cmake
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:make
cmd:meson
cmd:python3
cmd:pkg_config$secondaryArchSuffix
"
defineDebugInfoPackage glib2$secondaryArchSuffix \
$commandBinDir/gapplication \
$commandBinDir/gdbus \
$commandBinDir/gio \
$commandBinDir/gio-querymodules \
$commandBinDir/glib-compile-resources \
$commandBinDir/glib-compile-schemas \
$commandBinDir/gresource \
$commandBinDir/gsettings \
$libDir/libgio-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 \
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()
{
meson test -C build
}

View File

@@ -22,16 +22,21 @@ COPYRIGHT="1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
LICENSE="GNU LGPL v2"
REVISION="1"
SOURCE_URI="https://gitlab.gnome.org/GNOME/glib/-/archive/$portVersion/glib-$portVersion.tar.gz"
CHECKSUM_SHA256="491b3b37b50cea4cb62fd5f4e3e3889273d57a8eaad80f3d4974291a681e48ff"
CHECKSUM_SHA256="e9c311a25abb5717fb83f0f3a36daddc039e61fe37cea61cad4d0e455a6cdca0"
SOURCE_DIR="glib-$portVersion"
PATCHES="glib2-$portVersion.patchset"
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"
giVer="1.81.2"
SOURCE_URI_3="http://ftp.gnome.org/pub/GNOME/sources/gobject-introspection/${giVer%.*}/gobject-introspection-$giVer.tar.xz"
CHECKSUM_SHA256_3="ec973bf5c2c2e69d14642df38e508c24ae91a254b6c38d2828022c71f2a144e0"
SOURCE_DIR_3="gobject-introspection-$giVer"
PATCHES_3="glib2-$portVersion-source3.patchset"
ARCHITECTURES="?all !x86_gcc2 ?riscv64"
SECONDARY_ARCHITECTURES="?x86"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
commandSuffix=$secondaryArchSuffix
commandBinDir=$binDir
@@ -40,49 +45,60 @@ if [ "$targetArchitecture" = x86_gcc2 ]; then
commandBinDir=$prefix/bin
fi
libVersion="0.8000.0"
libVersion="0.8100.0"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
libGiVersion="1.0.0"
libGiVersionCompat="$libGiVersion compat >= ${libGiVersion%%.*}"
pythonVersion=3.10
pythonPackage=python${pythonVersion//.}
pythonModuleDir="python$pythonVersion/vendor-packages"
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:glib_gettextize$commandSuffix
cmd:gsettings$commandSuffix
lib:libgio_2.0$secondaryArchSuffix = $libVersionCompat
lib:libgirepository_1.0$secondaryArchSuffix = $libGiVersionCompat
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
"
REPLACES="
gobject_introspection$secondaryArchSuffix
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libffi$secondaryArchSuffix
lib:libiconv$secondaryArchSuffix
lib:libintl$secondaryArchSuffix
lib:libpcre2_8$secondaryArchSuffix
lib:libxml2$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
PROVIDES_devel="
glib2${secondaryArchSuffix}_devel = $portVersion compat >= 0
cmd:gdbus_codegen$commandSuffix
cmd:glib_genmarshal$commandSuffix
cmd:glib_gettextize$commandSuffix
cmd:glib_mkenums$commandSuffix
cmd:gobject_query$commandSuffix
cmd:gresource$commandSuffix
cmd:gtester$commandSuffix
cmd:gtester_report$commandSuffix
devel:libgio_2.0$secondaryArchSuffix = $libVersionCompat
devel:libgirepository_1.0$secondaryArchSuffix = $libGiVersionCompat
devel:libgirepository_2.0$secondaryArchSuffix = $libVersionCompat
devel:libglib_2.0$secondaryArchSuffix = $libVersionCompat
devel:libgmodule_2.0$secondaryArchSuffix = $libVersionCompat
@@ -91,35 +107,62 @@ PROVIDES_devel="
"
REQUIRES_devel="
glib2$secondaryArchSuffix == $portVersion base
glib2${secondaryArchSuffix}_gir_tools == $giVer
haiku$secondaryArchSuffix
cmd:perl
cmd:python3
cmd:python$pythonVersion
devel:libffi$secondaryArchSuffix
devel:libiconv$secondaryArchSuffix
devel:libintl$secondaryArchSuffix
devel:libpcre2_8$secondaryArchSuffix
devel:libz$secondaryArchSuffix
lib:libintl$secondaryArchSuffix
"
SUMMARY_gir_tools="The gobject-introspections tools and python module"
DESCRIPTION_gir_tools="GObject introspection is a middleware layer between C libraries \
(using GObject) and language bindings. The C library can be scanned at \
compile time and generate a metadata file, in addition to the actual native \
C library. Then at runtime, language bindings can read this metadata and \
automatically provide bindings to call into the C library."
PROVIDES_gir_tools="
glib2${secondaryArchSuffix}_gir_tools = $giVer
cmd:g_ir_annotation_tool$commandSuffix = $giVer
cmd:g_ir_compiler$commandSuffix = $giVer
cmd:g_ir_generate$commandSuffix = $giVer
cmd:g_ir_inspect$commandSuffix = $giVer
cmd:g_ir_scanner$commandSuffix = $giVer
"
REQUIRES_gir_tools="
glib2$secondaryArchSuffix == $portVersion base
haiku$secondaryArchSuffix
cmd:python$pythonVersion
lib:libffi$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:libxml2$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
packaging_python310
cmd:cmake
packaging_$pythonPackage
cmd:aclocal
cmd:autoconf
cmd:bison
cmd:flex
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:make
cmd:libtoolize$secondaryArchSuffix
cmd:meson
cmd:ninja
cmd:pkg_config$secondaryArchSuffix
cmd:python3
cmd:python$pythonVersion
cmd:which
"
defineDebugInfoPackage glib2$secondaryArchSuffix \
@@ -132,35 +175,98 @@ defineDebugInfoPackage glib2$secondaryArchSuffix \
$commandBinDir/gio-querymodules \
$commandBinDir/glib-compile-resources \
$commandBinDir/glib-compile-schemas \
$commandBinDir/gresource \
$commandBinDir/gsettings \
$(getPackagePrefix devel)/bin/gobject-query \
$(getPackagePrefix devel)/bin/gresource \
$(getPackagePrefix devel)/bin/gtester \
$(getPackagePrefix gir_tools)/bin/g-ir-compiler \
$(getPackagePrefix gir_tools)/bin/g-ir-generate \
$(getPackagePrefix gir_tools)/bin/g-ir-inspect \
$libDir/libgio-2.0.so.$libVersion \
$libDir/libgirepository-1.0.so.$libGiVersion \
$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
PATCH()
{
cd $sourceDir3
sed -i -e "s|'gobject-introspection'|\'$pythonModuleDir\'|" \
tools/g-ir-tool-template.in
}
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
export CFLAGS="-D_BSD_SOURCE"
export LDFLAGS="-lbsd -lgnu -lnetwork"
export PATH=$PATH:$commandBinDir
export LIBRARY_PATH=$LIBRARY_PATH:$libDir
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$libDir/pkgconfig
ninja $jobArgs -C build
meson setup \
--buildtype=debugoptimized \
--prefix=$prefix \
--bindir=$commandBinDir \
--datadir=$dataDir \
--includedir=$includeDir \
--libdir=$libDir \
--localedir=$dataDir/locale \
-D tests=false \
-D glib_debug=disabled \
-D introspection=disabled \
build
meson compile -C build
meson install --no-rebuild -C build
cd $sourceDir3
meson setup \
--buildtype=debugoptimized \
--prefix=$prefix \
--bindir=$commandBinDir \
--datadir=$dataDir \
--includedir=$includeDir \
--libdir=$libDir \
-D python.bytecompile=1 \
-D python.install_env="prefix" \
-D python.platlibdir=$prefix/lib/$pythonModuleDir \
-D gir_dir_prefix=$dataDir \
build
meson compile -C build
meson install --no-rebuild -C build
cd $sourceDir
meson setup \
--reconfigure \
--buildtype=debugoptimized \
--prefix=$prefix \
--bindir=$commandBinDir \
--datadir=$dataDir \
--includedir=$includeDir \
--libdir=$libDir \
--localedir=$dataDir/locale \
-D gir_dir_prefix=$dataDir \
-D tests=false \
-D glib_debug=disabled \
-D introspection=enabled \
build
PATH="$prefix/bin:$PATH" LD_LIBRARY_PATH="$prefix/lib:$LD_LIBRARY_PATH" \
meson compile -C build
}
INSTALL()
{
ninja -C build install
meson install --no-rebuild -C build
# we are not linux
rm -f $libDir/gio-launch-desktop
prepareInstalledDevelLibs libgio-2.0 \
libgirepository-1.0 \
libgirepository-2.0 \
libglib-2.0 \
libgmodule-2.0 \
@@ -175,22 +281,32 @@ INSTALL()
# devel package
packageEntries devel \
$developDir \
$commandBinDir/gdbus-codegen \
$commandBinDir/glib-genmarshal \
$commandBinDir/glib-gettextize \
$commandBinDir/glib-mkenums \
$commandBinDir/gobject-query \
$commandBinDir/gresource \
$commandBinDir/gtester \
$commandBinDir/gtester-report
$commandBinDir/gtester-report \
$dataDir/aclocal
rm -rf $prefix/libexec
# gir_tools package
packageEntries gir_tools \
$commandBinDir/g-ir-annotation-tool \
$commandBinDir/g-ir-compiler \
$commandBinDir/g-ir-generate \
$commandBinDir/g-ir-inspect \
$commandBinDir/g-ir-scanner \
$manDir \
$prefix/lib/python$pythonVersion
}
TEST()
{
# Ok: 305
# Ok: 316
# Fail: 31
# Skipped: 6
# Timeout: 2
meson test -C build
meson test --no-rebuild -C build
}

View File

@@ -1,489 +0,0 @@
From 28e826ce18531fa9a97e69702706d2b93c06ed3c 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 adddb31..c257eba 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"
@@ -3707,8 +3711,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);
@@ -3719,9 +3729,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.37.3
From b0c2d3ef2fcf06c75e200b280f8977918af427f0 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 1cfd25d..cb820e9 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
@@ -969,6 +972,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)
@@ -1502,16 +1548,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.37.3
From 5b2ea998682fd35351b4b0fcf51658133320f654 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 362c55a..c951c7a 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
/**
* SECTION:misc_utils
@@ -1872,6 +1876,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])
{
@@ -1999,6 +2017,13 @@ g_build_user_cache_dir (void)
#ifdef G_OS_WIN32
else
cache_dir = get_special_folder (&FOLDERID_InternetCache);
+#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_CACHE_DIRECTORY, volume, false, path, sizeof(path)) == B_OK)
+ cache_dir = g_strdup(path);
+ }
#endif
if (!cache_dir || !cache_dir[0])
{
@@ -2200,6 +2225,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 +2749,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 +2853,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.37.3
From 613744f2353cd7f08c1c61bc2051561fb2b0584b 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 ea3495c..94bdaf1 100644
--- a/glib/tests/mapping.c
+++ b/glib/tests/mapping.c
@@ -193,6 +193,10 @@ test_private (void)
g_test_message ("test_private: ok");
}
+#ifdef __HAIKU__
+#include <SupportDefs.h>
+#endif
+
static void
test_child_private (void)
{
@@ -225,7 +229,12 @@ 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.37.3
From 842c55aafe88ffff563a1ebe8dafc6fada11e596 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 9239e3c..7b837c4 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.37.3
From 1d5dfbaf3b4fcba12c43f63895f90f8f4688d701 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 c3c1162..c48d390 100644
--- a/gio/xdgmime/xdgmime.c
+++ b/gio/xdgmime/xdgmime.c
@@ -45,6 +45,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
@@ -239,6 +244,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");
@@ -311,7 +333,7 @@ xdg_init_dirs (void)
ptr = end_ptr;
}
-
+#endif
/* NULL terminator */
xdg_dirs[current_dir] = NULL;
--
2.37.3
From d8408d9bc8aee8ba6a7b8f0e8ca673c1ec54eae1 Mon Sep 17 00:00:00 2001
From: Begasus <begasus@gmail.com>
Date: Mon, 9 Oct 2023 11:43:56 +0200
Subject: Haiku doesn't have sys/ptrace.h
diff --git a/gio/tests/gsubprocess-testprog.c b/gio/tests/gsubprocess-testprog.c
index 610b8f3..84edc59 100644
--- a/gio/tests/gsubprocess-testprog.c
+++ b/gio/tests/gsubprocess-testprog.c
@@ -5,6 +5,7 @@
#include <errno.h>
#ifdef G_OS_UNIX
#include <unistd.h>
+#elif !defined(__HAIKU__)
#include <sys/ptrace.h>
#else
#include <io.h>
--
2.37.3
From c98d7296bd231032787162eea3325adddd484180 Mon Sep 17 00:00:00 2001
From: Alexander von Gluck <alex@terarocket.io>
Date: Tue, 26 Aug 2025 10:38:29 -0500
Subject: [PATCH] glib: Disable kqueue on Haiku
---
meson.build | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 25ae10f..269ef71 100644
--- a/meson.build
+++ b/meson.build
@@ -642,7 +642,6 @@ functions = [
'inotify_init1',
'issetugid',
'kevent',
- 'kqueue',
'lchmod',
'lchown',
'link',
@@ -687,6 +686,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

View File

@@ -0,0 +1,45 @@
From 87de2396f92b5cf6a4e73260b70b9edf19417ec7 Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Wed, 18 Dec 2019 15:22:46 +0000
Subject: Use objdump -x instead of ldd
diff --git a/giscanner/shlibs.py b/giscanner/shlibs.py
index 9f8ab5d..c2c7987 100644
--- a/giscanner/shlibs.py
+++ b/giscanner/shlibs.py
@@ -101,6 +101,8 @@ def _resolve_non_libtool(options, binary, libraries):
args.extend([options.ldd_wrapper, binary.args[0]])
elif platform_system == 'Darwin':
args.extend(['otool', '-L', binary.args[0]])
+ elif platform_system == 'Haiku':
+ args.extend(['objdump', '-x', binary.args[0]])
else:
args.extend(['ldd', binary.args[0]])
output = subprocess.check_output(args)
--
2.51.0
From 0397a6a3ab2571cea213ccb581a829e6defbb014 Mon Sep 17 00:00:00 2001
From: Luc Schrijvers <begasus@gmail.com>
Date: Tue, 14 Oct 2025 16:41:32 +0200
Subject: Set python module path for system python
diff --git a/giscanner/meson.build b/giscanner/meson.build
index ae370ce..ee1d597 100644
--- a/giscanner/meson.build
+++ b/giscanner/meson.build
@@ -29,7 +29,7 @@ giscanner_files = [
]
pkglibdir = join_paths(get_option('libdir'), meson.project_name())
-giscannerdir = join_paths(pkglibdir, 'giscanner')
+giscannerdir = join_paths(get_option('python.platlibdir'), 'giscanner')
giscanner_built_files = []
giscanner_conf_data = configuration_data()
--
2.51.0

View File

@@ -1,4 +1,4 @@
From 9cfb52636492ce5a2172459880eceee4b93dfc0b Mon Sep 17 00:00:00 2001
From 1e0575efd53fe256b99407dc2cc73f218f2745af 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
@@ -6,7 +6,7 @@ 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
index c88268b..e43c8bf 100644
--- a/gio/gdbusmessage.c
+++ b/gio/gdbusmessage.c
@@ -37,8 +37,12 @@
@@ -22,7 +22,7 @@ index 5a5fec8..37ca7fd 100644
#include "gdbusutils.h"
#include "gdbusmessage.h"
@@ -3866,8 +3870,14 @@ g_dbus_message_print (GDBusMessage *message,
@@ -3873,8 +3877,14 @@ g_dbus_message_print (GDBusMessage *message,
if (fstat (fds[n], &statbuf) == 0)
{
#ifndef MAJOR_MINOR_NOT_FOUND
@@ -37,7 +37,7 @@ index 5a5fec8..37ca7fd 100644
#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,
@@ -3885,9 +3895,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
@@ -53,17 +53,17 @@ index 5a5fec8..37ca7fd 100644
(guint64) statbuf.st_size);
g_string_append_printf (fs, "%s" "atime=%" G_GUINT64_FORMAT, fs->len > 0 ? "," : "",
--
2.50.1
2.51.0
From 9dbb855be16d55eddce163b12b168a7bc713fea6 Mon Sep 17 00:00:00 2001
From 4366eba592928ebee8c038e80d94016206c627f4 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
index 27185c8..a038cb0 100644
--- a/gio/gunixmounts.c
+++ b/gio/gunixmounts.c
@@ -69,6 +69,9 @@ extern char* hasmntopt(const struct mntent* mnt, const char* opt);
@@ -146,10 +146,10 @@ index a7a9363..0ecdbd4 100644
_g_get_unix_mount_points (void)
{
--
2.50.1
2.51.0
From aadf4e5534897f767880f08a66d6c5f995b855a7 Mon Sep 17 00:00:00 2001
From 7fe453f3c7029e271da45200dfdf2e1e9b2f6fcc 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()
@@ -157,7 +157,7 @@ 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
index 057e2bc..61345be 100644
--- a/glib/gutils.c
+++ b/glib/gutils.c
@@ -78,6 +78,10 @@
@@ -274,20 +274,20 @@ index bb88c76..38dace0 100644
if (!conf_dirs || !conf_dirs[0])
conf_dirs = "/etc/xdg";
--
2.50.1
2.51.0
From ea8148cabd49a9da76ccb980418a3c81e06a8aa8 Mon Sep 17 00:00:00 2001
From 504a8d87c2e0fb573b41227bab27725c3afccead 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
index bbd4de8..5b89b65 100644
--- a/glib/tests/mapping.c
+++ b/glib/tests/mapping.c
@@ -191,6 +191,10 @@ test_private (void)
@@ -193,6 +193,10 @@ test_private (void)
g_remove ("maptest");
}
@@ -298,8 +298,8 @@ index 99cb8ee..8d56df0 100644
static void
test_child_private (void)
{
@@ -223,7 +227,11 @@ test_child_private (void)
signal (SIGUSR1, handle_usr1);
@@ -228,7 +232,11 @@ test_child_private (void)
spawn_flags |= G_SPAWN_DO_NOT_REAP_CHILD;
#endif
+#ifdef __HAIKU__
@@ -311,10 +311,10 @@ index 99cb8ee..8d56df0 100644
child_argv[1] = "mapchild";
child_argv[2] = pid;
--
2.50.1
2.51.0
From 55dde56d3c849ef3e32ea5cb8b3e982bcc366127 Mon Sep 17 00:00:00 2001
From 427acb7475389c6a5fba201d08ac68f1967df78b 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
@@ -351,10 +351,10 @@ index 59c2b0f..ebd5b1f 100644
error('Could not find res_query()')
endif
--
2.50.1
2.51.0
From 618f2698c70d7224e63816cc45c81d98e3ad4a5e Mon Sep 17 00:00:00 2001
From 2eea7cde0ad7113b888cf69b7a894cb839aeb240 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
@@ -410,20 +410,20 @@ index 0909581..338c49c 100644
xdg_dirs[current_dir] = NULL;
--
2.50.1
2.51.0
From 017e09abf4d237406315a3bb7c72061a555f5e06 Mon Sep 17 00:00:00 2001
From 050067d49363fdfcc8901c1dd8725cc0f724a114 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
index de82c00..78206f7 100644
--- a/meson.build
+++ b/meson.build
@@ -683,7 +683,6 @@ functions = [
@@ -699,7 +699,6 @@ functions = [
'inotify_init1',
'issetugid',
'kevent',
@@ -431,7 +431,7 @@ index 7534542..3b70972 100644
'lchmod',
'lchown',
'link',
@@ -728,6 +727,13 @@ if host_system == 'darwin'
@@ -744,6 +743,13 @@ if host_system == 'darwin'
functions += ['_NSGetEnviron']
endif
@@ -446,50 +446,106 @@ index 7534542..3b70972 100644
functions += ['statvfs']
else
--
2.50.1
2.51.0
From 3ba408a5fdaccf149e10e8067ab39892cd31f958 Mon Sep 17 00:00:00 2001
From d967388bc5e06cd3c6746e1c15faa9327742a038 Mon Sep 17 00:00:00 2001
From: Luc Schrijvers <begasus@gmail.com>
Date: Wed, 27 Aug 2025 13:05:59 +0200
Date: Mon, 13 Oct 2025 21:40:42 +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
index a264353..923d529 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);
@@ -66,6 +66,10 @@
#include "glib_trace.h"
#include "gtrace-private.h"
+#ifdef __HAIKU__
+#define cpu_set_t cpuset_t
+#define CPU_ZERO CPUSET_ZERO
+#define CPU_ISSET CPUSET_ISSET
+#include "haiku_sched.h"
+#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);
/* G_LOCK Documentation {{{1 ---------------------------------------------- */
/**
diff --git a/glib/haiku_sched.h b/glib/haiku_sched.h
new file mode 100644
index 0000000..79c2192
--- /dev/null
+++ b/glib/haiku_sched.h
@@ -0,0 +1,55 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#ifdef __HAIKU__
+#ifndef CPU_COUNT
+#define cpu_set_t cpuset_t
+#define CPU_ZERO CPUSET_ZERO
+#define CPU_ISSET CPUSET_ISSET
+#define CPU_SET CPUSET_SET
+static inline unsigned int
+__cpu_count(cpuset_t *set)
+{
+ unsigned int count = 0;
+ unsigned int i;
+ for (i = 0; i < _howmany(CPU_SETSIZE, NCPUSETBITS); i++) {
+ cpuset_mask mask = set->bits[i];
+#if __GNUC__ > 2
+ count += __builtin_popcount(mask);
+#else
+ while (mask > 0) {
+ if ((mask & 1) == 1)
+ count++;
+ mask >>= 1;
+ }
+#endif
+ }
+ return count;
+}
+
+#define CPU_COUNT(set) __cpu_count(set)
+#endif
+#endif
diff --git a/glib/tests/thread.c b/glib/tests/thread.c
index 6e87796..2483e2b 100644
--- a/glib/tests/thread.c
+++ b/glib/tests/thread.c
@@ -37,6 +37,10 @@
#include "glib/glib-private.h"
+#ifdef __HAIKU__
+#include "glib/haiku_sched.h"
+#endif
+
cpu_set_t old_mask, new_mask;
err = pthread_getaffinity_np (pthread_self (), sizeof (old_mask), &old_mask);
#ifdef G_OS_UNIX
#include <unistd.h>
#include <sys/resource.h>
--
2.50.1
2.51.0

View File

@@ -1,123 +0,0 @@
SUMMARY="Introspection system for GObject-based libraries"
DESCRIPTION="GObject introspection is a middleware layer between C libraries \
(using GObject) and language bindings. The C library can be scanned at \
compile time and generate a metadata file, in addition to the actual native \
C library. Then at runtime, language bindings can read this metadata and \
automatically provide bindings to call into the C library."
HOMEPAGE="https://wiki.gnome.org/Projects/GObjectIntrospection"
COPYRIGHT="Colin Walters
Johan Dahlin
Matthias Clasen (girepository)
Jürg Billeter (scanner)"
LICENSE="GNU LGPL v2
GNU GPL v2
MIT"
REVISION="3"
SOURCE_URI="http://ftp.gnome.org/pub/GNOME/sources/gobject-introspection/${portVersion%.*}/gobject-introspection-$portVersion.tar.xz"
CHECKSUM_SHA256="bd7babd99af7258e76819e45ba4a6bc399608fe762d83fde3cac033c50841bb4"
SOURCE_DIR="gobject-introspection-$portVersion"
PATCHES="gobject_introspection-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
# On x86_gcc2 we don't want to install the commands in bin/<arch>/, but in bin/.
commandSuffix=$secondaryArchSuffix
commandBinDir=$binDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
commandSuffix=
commandBinDir=$prefix/bin
fi
libVersion="1.0.0"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
PROVIDES="
gobject_introspection$secondaryArchSuffix = $portVersion
cmd:g_ir_annotation_tool$commandSuffix
cmd:g_ir_compiler$commandSuffix
cmd:g_ir_generate$commandSuffix
cmd:g_ir_inspect$commandSuffix
cmd:g_ir_scanner$commandSuffix
lib:libgirepository_1.0$secondaryArchSuffix = $libVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libffi$secondaryArchSuffix
lib:libgio_2.0$secondaryArchSuffix
lib:libglib_2.0$secondaryArchSuffix
lib:libgmodule_2.0$secondaryArchSuffix
lib:libgobject_2.0$secondaryArchSuffix
lib:libintl$secondaryArchSuffix
lib:libxml2$secondaryArchSuffix
"
PROVIDES_devel="
gobject_introspection${secondaryArchSuffix}_devel = $portVersion
devel:libgirepository_1.0$secondaryArchSuffix = $libVersionCompat
"
REQUIRES_devel="
gobject_introspection$secondaryArchSuffix == $portVersion base
devel:libffi$secondaryArchSuffix
devel:libglib_2.0$secondaryArchSuffix
devel:libpcre$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libffi$secondaryArchSuffix
devel:libgio_2.0$secondaryArchSuffix
devel:libglib_2.0$secondaryArchSuffix
devel:libgmodule_2.0$secondaryArchSuffix
devel:libgobject_2.0$secondaryArchSuffix
devel:libxml2$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:aclocal
cmd:autoconf
cmd:bison
cmd:flex
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:libtoolize$secondaryArchSuffix
cmd:make
cmd:meson
cmd:ninja
cmd:pkg_config$secondaryArchSuffix
cmd:python3
cmd:which
"
defineDebugInfoPackage gobject_introspection$secondaryArchSuffix \
"$libDir"/libgirepository-1.0.so.$libVersion
BUILD()
{
meson build --buildtype=debugoptimized \
--prefix=$prefix \
--includedir=$includeDir \
--datadir=$dataDir \
--libdir=$libDir \
--mandir=$manDir
ninja -C build $jobArgs
}
INSTALL()
{
ninja -C build install
prepareInstalledDevelLib libgirepository-1.0
fixPkgconfig
# devel package
packageEntries devel \
"$developDir"
}
TEST()
{
# tests fails on Regress-1.0.gir, but as it looks
# it is known to fail there (doesn't break the tests)
ninja -C build test
}

View File

@@ -1,22 +0,0 @@
From 3e04269367381663b6d751a77f144e2ef69210ae Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Wed, 18 Dec 2019 15:22:46 +0000
Subject: Use objdump -x instead of ldd
diff --git a/giscanner/shlibs.py b/giscanner/shlibs.py
index 9f8ab5d..c2c7987 100644
--- a/giscanner/shlibs.py
+++ b/giscanner/shlibs.py
@@ -101,6 +101,8 @@ def _resolve_non_libtool(options, binary, libraries):
args.extend([options.ldd_wrapper, binary.args[0]])
elif platform_system == 'Darwin':
args.extend(['otool', '-L', binary.args[0]])
+ elif platform_system == 'Haiku':
+ args.extend(['objdump', '-x', binary.args[0]])
else:
args.extend(['ldd', binary.args[0]])
output = subprocess.check_output(args)
--
2.37.3