glib2: fix build on _x86.

This commit is contained in:
Jerome Duval
2019-11-23 20:47:22 +01:00
parent 734bf6a70a
commit 4044fdb630
2 changed files with 70 additions and 11 deletions

View File

@@ -20,7 +20,7 @@ COPYRIGHT="1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
2008-2010 Collabora Ltd.
1995-2010 Several others"
LICENSE="GNU LGPL v2"
REVISION="2"
REVISION="3"
SOURCE_URI="https://gitlab.gnome.org/GNOME/glib/-/archive/$portVersion/glib-$portVersion.tar.gz"
CHECKSUM_SHA256="226f44a6fe121d4367d5c2458a363054d6076a9e70cf2ec5b948b6c028a08688"
SOURCE_DIR="glib-$portVersion"
@@ -129,7 +129,8 @@ BUILD()
CFLAGS="-D_BSD_SOURCE" \
LDFLAGS="-lbsd -lgnu -lnetwork" meson build \
-Diconv=external --prefix=$prefix --includedir=$includeDir \
--libdir=$libDir --datadir=$dataDir --localedir=$dataDir/locale
--libdir=$libDir --datadir=$dataDir --bindir=$binDir \
--localedir=$dataDir/locale
ninja $jobArgs -C build
}
@@ -164,5 +165,5 @@ INSTALL()
TEST()
{
make check
meson test -C build
}

View File

@@ -1,4 +1,4 @@
From 674ac20a9e38beda443915dc8e73ce5d531b2869 Mon Sep 17 00:00:00 2001
From 8953ca94d555aeadcc1e2b1bd4219b50af6f7aef 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
@@ -53,10 +53,10 @@ index 852a704..968d33f 100644
(guint64) statbuf.st_size);
g_string_append_printf (fs, "%s" "atime=%" G_GUINT64_FORMAT, fs->len > 0 ? "," : "",
--
2.21.0
2.23.0
From fcc27d431d95826490c07e6c6597791beee69757 Mon Sep 17 00:00:00 2001
From bee7a2522d34ee9e10e7e40d3e5987386c6fbb61 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Sat, 29 Jul 2017 12:19:31 +0200
Subject: gunixmounts.c: on Haiku
@@ -99,10 +99,10 @@ index cf73fe5..88795f4 100644
_g_get_unix_mount_points (void)
{
--
2.21.0
2.23.0
From f1c7e224be1390bbea0d493f549ebea504a0ea87 Mon Sep 17 00:00:00 2001
From f64e4c89849681b3807501b504cbd02963af9f18 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()
@@ -161,10 +161,10 @@ index 988d0a5..7248ead 100644
static void
--
2.21.0
2.23.0
From 2431fde66f036947ac492eacea2a06d4d305c0fb Mon Sep 17 00:00:00 2001
From d7c2d78ee7c9447765ec07e802ab0b2856e352a6 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Sat, 7 Sep 2019 15:24:28 +0200
Subject: _SC_HOST_NAME_MAX is not defined on H1B1
@@ -187,5 +187,63 @@ index 7248ead..a27c429 100644
size = (gsize) max + 1;
else
--
2.21.0
2.23.0
From 69f610c998a72ed4ed06b26e632f4269d9bab8cc 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/meson.build b/meson.build
index 717d1bc..5b25886 100644
--- a/meson.build
+++ b/meson.build
@@ -1324,14 +1324,14 @@ if sizet_size == short_size
glibconfig_conf.set_quoted('gsize_format', 'hu')
glibconfig_conf.set_quoted('gssize_format', 'hi')
glibconfig_conf.set('glib_msize_type', 'SHRT')
-elif sizet_size == int_size
+elif sizet_size == int_size and host_system != 'haiku'
glibconfig_conf.set('glib_size_type_define', 'int')
glibconfig_conf.set_quoted('gsize_modifier', '')
glibconfig_conf.set_quoted('gssize_modifier', '')
glibconfig_conf.set_quoted('gsize_format', 'u')
glibconfig_conf.set_quoted('gssize_format', 'i')
glibconfig_conf.set('glib_msize_type', 'INT')
-elif sizet_size == long_size
+elif sizet_size == long_size or host_system == 'haiku'
glibconfig_conf.set('glib_size_type_define', 'long')
glibconfig_conf.set_quoted('gsize_modifier', 'l')
glibconfig_conf.set_quoted('gssize_modifier', 'l')
diff --git a/tests/mapping-test.c b/tests/mapping-test.c
index ad776fa..49d2ea4 100644
--- a/tests/mapping-test.c
+++ b/tests/mapping-test.c
@@ -182,6 +182,10 @@ test_private (void)
g_message ("test_private: ok");
}
+#ifdef __HAIKU__
+#include <SupportDefs.h>
+#endif
+
static void
test_child_private (gchar *argv0)
{
@@ -208,7 +212,11 @@ test_child_private (gchar *argv0)
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] = argv0;
child_argv[1] = "mapchild";
child_argv[2] = pid;
--
2.23.0