glib2: bump version

This commit is contained in:
Gerasim Troeglazov
2022-08-14 22:04:27 +10:00
parent cda76a6271
commit dcac2ca8a8
2 changed files with 139 additions and 134 deletions

View File

@@ -20,16 +20,20 @@ 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="1"
SOURCE_URI="https://gitlab.gnome.org/GNOME/glib/-/archive/$portVersion/glib-$portVersion.tar.gz"
CHECKSUM_SHA256="7277475bebbecd3369b793c7b628d78290e016f7d6bcb463173c17e90f3bb96d"
CHECKSUM_SHA256="56ad77af16e444f444e1a54f5f8a959212f078b332120a44728b17943fc4c2c0"
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 ?x86"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
libVersion="0.6800.4"
libVersion="0.7303.0"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
PROVIDES="
@@ -56,7 +60,7 @@ REQUIRES="
lib:libffi$secondaryArchSuffix
lib:libiconv$secondaryArchSuffix
lib:libintl$secondaryArchSuffix
lib:libpcre$secondaryArchSuffix >= 1
lib:libpcre2_8$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
@@ -82,12 +86,12 @@ REQUIRES_devel="
devel:libffi$secondaryArchSuffix
devel:libiconv$secondaryArchSuffix
devel:libintl$secondaryArchSuffix
devel:libpcre$secondaryArchSuffix
devel:libpcre2_8$secondaryArchSuffix
devel:libz$secondaryArchSuffix
lib:libffi$secondaryArchSuffix
lib:libiconv$secondaryArchSuffix
lib:libintl$secondaryArchSuffix
lib:libpcre$secondaryArchSuffix
lib:libpcre2_8$secondaryArchSuffix
"
BUILD_REQUIRES="
@@ -97,10 +101,11 @@ BUILD_REQUIRES="
devel:libffi$secondaryArchSuffix
devel:libiconv$secondaryArchSuffix
devel:libintl$secondaryArchSuffix
devel:libpcre$secondaryArchSuffix >= 1
devel:libpcre2_8$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:make
@@ -126,6 +131,9 @@ defineDebugInfoPackage glib2$secondaryArchSuffix \
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 \

View File

@@ -1,4 +1,4 @@
From 693313229d9b7f224b83706141b1de26cdd86515 Mon Sep 17 00:00:00 2001
From e19bb27d45911e0354d21124e4276bbc868236d5 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,10 +6,10 @@ 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 bc9386e..c71c8aa 100644
index 7aebdeb..5dad399 100644
--- a/gio/gdbusmessage.c
+++ b/gio/gdbusmessage.c
@@ -35,8 +35,12 @@
@@ -37,8 +37,12 @@
#elif MAJOR_IN_TYPES
#include <sys/types.h>
#else
@@ -22,7 +22,7 @@ index bc9386e..c71c8aa 100644
#include "gdbusutils.h"
#include "gdbusmessage.h"
@@ -3571,8 +3575,14 @@ g_dbus_message_print (GDBusMessage *message,
@@ -3672,8 +3676,14 @@ g_dbus_message_print (GDBusMessage *message,
if (fstat (fds[n], &statbuf) == 0)
{
#ifndef MAJOR_MINOR_NOT_FOUND
@@ -37,7 +37,7 @@ index bc9386e..c71c8aa 100644
#endif
g_string_append_printf (fs, "%s" "mode=0%o", fs->len > 0 ? "," : "",
(guint) statbuf.st_mode);
@@ -3583,9 +3593,14 @@ g_dbus_message_print (GDBusMessage *message,
@@ -3684,9 +3694,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,20 +53,20 @@ index bc9386e..c71c8aa 100644
(guint64) statbuf.st_size);
g_string_append_printf (fs, "%s" "atime=%" G_GUINT64_FORMAT, fs->len > 0 ? "," : "",
--
2.30.2
2.36.1
From 118dcaca817c9c6f017402280c05498dbb7d38e4 Mon Sep 17 00:00:00 2001
From 38b33411c3f91cee2ffd91d1302d41d9ae917690 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 32b9362..206f856 100644
index 962b964..447d4b6 100644
--- a/gio/gunixmounts.c
+++ b/gio/gunixmounts.c
@@ -58,6 +58,9 @@
@@ -60,6 +60,9 @@
#endif
#include <sys/mount.h>
#endif
@@ -76,7 +76,7 @@ index 32b9362..206f856 100644
#ifndef O_BINARY
#define O_BINARY 0
@@ -956,6 +959,49 @@ _g_get_unix_mounts (void)
@@ -958,6 +961,49 @@ _g_get_unix_mounts (void)
return return_list;
}
@@ -126,8 +126,8 @@ index 32b9362..206f856 100644
/* QNX {{{2 */
#elif defined (HAVE_QNX)
@@ -1488,16 +1534,8 @@ _g_get_unix_mount_points (void)
@@ -1491,16 +1537,8 @@ _g_get_unix_mount_points (void)
return g_list_reverse (return_list);
}
-/* Interix {{{2 */
@@ -146,10 +146,10 @@ index 32b9362..206f856 100644
_g_get_unix_mount_points (void)
{
--
2.30.2
2.36.1
From fbb32f7234f051b16c0fe3cbbbafaf5782bb5669 Mon Sep 17 00:00:00 2001
From 738132e93099b8313670757f54d5b1b0c9ca38e6 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,10 +157,10 @@ 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 dad1625..8f1f29d 100644
index 78ccd61..3f2ea32 100644
--- a/glib/gutils.c
+++ b/glib/gutils.c
@@ -75,6 +75,10 @@
@@ -78,6 +78,10 @@
#include "gwin32.h"
#endif
@@ -171,7 +171,49 @@ index dad1625..8f1f29d 100644
/**
* SECTION:misc_utils
@@ -1960,6 +1964,35 @@ load_user_special_dirs (void)
@@ -1763,6 +1767,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])
{
@@ -1827,6 +1838,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])
{
@@ -1890,6 +1908,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])
{
@@ -2091,6 +2116,35 @@ load_user_special_dirs (void)
load_user_special_dirs_macos (g_user_special_dirs);
}
@@ -207,22 +249,60 @@ index dad1625..8f1f29d 100644
#elif defined(G_OS_WIN32)
static void
@@ -2586,7 +2640,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
@@ -2681,6 +2744,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.30.2
2.36.1
From 2b1f8901948b1d1378c795cb3b7a8f332e17c32b Mon Sep 17 00:00:00 2001
From b0c7d261949f247cf4984b1a57c3fc3bb65db242 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/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");
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__
@@ -230,9 +310,9 @@ index ad776fa..49d2ea4 100644
+#endif
+
static void
test_child_private (gchar *argv0)
test_child_private (void)
{
@@ -208,7 +212,11 @@ test_child_private (gchar *argv0)
@@ -225,7 +229,12 @@ test_child_private (void)
signal (SIGUSR1, handle_usr1);
#endif
@@ -241,24 +321,25 @@ index ad776fa..49d2ea4 100644
+#else
g_snprintf (pid, sizeof(pid), "%d", getpid ());
+#endif
child_argv[0] = argv0;
+
child_argv[0] = local_argv[0];
child_argv[1] = "mapchild";
child_argv[2] = pid;
--
2.30.2
2.36.1
From 42a4988965cf166fdd07f66d6c87953df834a257 Mon Sep 17 00:00:00 2001
From 3c23e1c48a8dc1346f26da7a091bb32cfc677125 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 49a37a7..8d77588 100644
index 69bb060..c664c88 100644
--- a/gio/meson.build
+++ b/gio/meson.build
@@ -21,6 +21,7 @@ if host_system not in ['windows', 'android']
@@ -22,6 +22,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>
@@ -266,7 +347,7 @@ index 49a37a7..8d77588 100644
#include <arpa/nameser.h>
#include <arpa/nameser_compat.h>
int qclass = C_IN;''',
@@ -41,6 +42,7 @@ if host_system != 'windows'
@@ -42,6 +43,7 @@ if host_system != 'windows'
return res_query("test", 0, 0, (void *)0, 0);
}'''
res_query_test_full = '''#include <sys/types.h>
@@ -274,7 +355,7 @@ index 49a37a7..8d77588 100644
#include <netinet/in.h>
#include <arpa/nameser.h>
''' + res_query_test
@@ -54,6 +56,9 @@ if host_system != 'windows'
@@ -55,6 +57,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' ]
@@ -285,22 +366,22 @@ index 49a37a7..8d77588 100644
error('Could not find res_query()')
endif
--
2.30.2
2.36.1
From 2a0d2857003ef35879dd05228219fde9cefe47f3 Mon Sep 17 00:00:00 2001
From f4dca81a0efe06b15c4b4f1cff114d437ade5b6e Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Fri, 28 Jan 2022 10:49:17 +1000
Subject: Use find_directory if XDG vars not found
diff --git a/gio/xdgmime/xdgmime.c b/gio/xdgmime/xdgmime.c
index 9bb93f7..31bae11 100644
index c3c1162..602175d 100644
--- a/gio/xdgmime/xdgmime.c
+++ b/gio/xdgmime/xdgmime.c
@@ -41,6 +41,11 @@
#include <unistd.h>
#include <assert.h>
@@ -49,6 +49,11 @@
#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
#endif
+#if defined(__HAIKU__)
+#include <FindDirectory.h>
@@ -310,7 +391,7 @@ index 9bb93f7..31bae11 100644
typedef struct XdgDirTimeList XdgDirTimeList;
typedef struct XdgCallbackList XdgCallbackList;
@@ -234,6 +239,25 @@ xdg_init_dirs (void)
@@ -243,6 +248,25 @@ xdg_init_dirs (void)
home = getenv ("HOME");
xdg_data_dirs = getenv ("XDG_DATA_DIRS");
@@ -336,90 +417,6 @@ index 9bb93f7..31bae11 100644
if (xdg_data_dirs == NULL)
xdg_data_dirs = "/usr/local/share/:/usr/share/";
diff --git a/glib/gutils.c b/glib/gutils.c
index 8f1f29d..b609825 100644
--- a/glib/gutils.c
+++ b/glib/gutils.c
@@ -1709,6 +1709,13 @@ g_build_user_data_dir (void)
#ifdef G_OS_WIN32
else
data_dir = get_special_folder (CSIDL_LOCAL_APPDATA);
+#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])
{
@@ -1773,6 +1780,13 @@ g_build_user_config_dir (void)
#ifdef G_OS_WIN32
else
config_dir = get_special_folder (CSIDL_LOCAL_APPDATA);
+#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])
{
@@ -1836,6 +1850,13 @@ g_build_user_cache_dir (void)
#ifdef G_OS_WIN32
else
cache_dir = get_special_folder (CSIDL_INTERNET_CACHE);
+#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])
{
@@ -2535,7 +2556,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
@@ -2630,6 +2660,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.30.2
2.36.1