diff --git a/ndk-patches/mntent.h.patch b/ndk-patches/mntent.h.patch
new file mode 100644
index 000000000..b40f7f1f8
--- /dev/null
+++ b/ndk-patches/mntent.h.patch
@@ -0,0 +1,15 @@
+--- ./usr/include/mntent.h.orig 2021-12-10 16:17:07.041722648 +0530
++++ ./usr/include/mntent.h 2021-12-10 16:17:41.171722635 +0530
+@@ -70,9 +70,9 @@
+ #endif /* __ANDROID_API__ >= 21 */
+
+
+-#if __ANDROID_API__ >= 26
+-char* hasmntopt(const struct mntent* __entry, const char* __option) __INTRODUCED_IN(26);
+-#endif /* __ANDROID_API__ >= 26 */
++#if __ANDROID_API__ >= 21
++char* hasmntopt(const struct mntent* __entry, const char* __option) __INTRODUCED_IN(21);
++#endif /* __ANDROID_API__ >= 21 */
+
+
+ __END_DECLS
diff --git a/packages/glib/build.sh b/packages/glib/build.sh
index cb79a3be9..18e70134b 100644
--- a/packages/glib/build.sh
+++ b/packages/glib/build.sh
@@ -2,10 +2,9 @@ TERMUX_PKG_HOMEPAGE=https://developer.gnome.org/glib/
TERMUX_PKG_DESCRIPTION="Library providing core building blocks for libraries and applications written in C"
TERMUX_PKG_LICENSE="LGPL-2.1"
TERMUX_PKG_MAINTAINER="@termux"
-TERMUX_PKG_VERSION=2.66.1
-TERMUX_PKG_REVISION=1
+TERMUX_PKG_VERSION=2.70.1
TERMUX_PKG_SRCURL=https://ftp.gnome.org/pub/gnome/sources/glib/${TERMUX_PKG_VERSION:0:4}/glib-${TERMUX_PKG_VERSION}.tar.xz
-TERMUX_PKG_SHA256=a269ffe69fbcc3a21ff1acb1b6146b2a5723499d6e2de33ae16ccb6d2438ef60
+TERMUX_PKG_SHA256=f9b7bce7f51753a1f43853bbcaca8bf09e15e994268e29cfd7a76f65636263c0
TERMUX_PKG_DEPENDS="libffi, libiconv, pcre, libandroid-support, zlib"
TERMUX_PKG_BREAKS="glib-dev"
TERMUX_PKG_REPLACES="glib-dev"
diff --git a/packages/glib/fix-hardcoded-paths.patch b/packages/glib/fix-hardcoded-paths.patch
deleted file mode 100644
index fbed53098..000000000
--- a/packages/glib/fix-hardcoded-paths.patch
+++ /dev/null
@@ -1,343 +0,0 @@
-diff -uNr glib-2.58.3/gio/gdbusaddress.c glib-2.58.3.mod/gio/gdbusaddress.c
---- glib-2.58.3/gio/gdbusaddress.c 2019-01-21 15:38:50.000000000 +0200
-+++ glib-2.58.3.mod/gio/gdbusaddress.c 2019-03-02 02:08:55.324976201 +0200
-@@ -1628,7 +1628,7 @@
- ret = g_strdup (g_getenv ("DBUS_SYSTEM_BUS_ADDRESS"));
- if (ret == NULL)
- {
-- ret = g_strdup ("unix:path=/var/run/dbus/system_bus_socket");
-+ ret = g_strdup ("unix:path=@TERMUX_PREFIX@/var/run/dbus/system_bus_socket");
- }
- break;
-
-diff -uNr glib-2.58.3/gio/gdbusprivate.c glib-2.58.3.mod/gio/gdbusprivate.c
---- glib-2.58.3/gio/gdbusprivate.c 2019-01-21 15:38:50.000000000 +0200
-+++ glib-2.58.3.mod/gio/gdbusprivate.c 2019-03-02 02:08:55.328309547 +0200
-@@ -2098,17 +2098,17 @@
- /* TODO: use PACKAGE_LOCALSTATEDIR ? */
- ret = NULL;
- first_error = NULL;
-- if (!g_file_get_contents ("/var/lib/dbus/machine-id",
-+ if (!g_file_get_contents ("@TERMUX_PREFIX@/var/lib/dbus/machine-id",
- &ret,
- NULL,
- &first_error) &&
-- !g_file_get_contents ("/etc/machine-id",
-+ !g_file_get_contents ("@TERMUX_PREFIX@/etc/machine-id",
- &ret,
- NULL,
- NULL))
- {
- g_propagate_prefixed_error (error, first_error,
-- _("Unable to load /var/lib/dbus/machine-id or /etc/machine-id: "));
-+ _("Unable to load @TERMUX_PREFIX@/var/lib/dbus/machine-id or @TERMUX_PREFIX@/etc/machine-id: "));
- }
- else
- {
-diff -uNr glib-2.58.3/gio/gnetworking.h.in glib-2.58.3.mod/gio/gnetworking.h.in
---- glib-2.58.3/gio/gnetworking.h.in 2019-01-21 15:38:50.000000000 +0200
-+++ glib-2.58.3.mod/gio/gnetworking.h.in 2019-03-02 02:08:55.331642893 +0200
-@@ -55,7 +55,7 @@
- #endif
-
- #ifndef _PATH_RESCONF
--#define _PATH_RESCONF "/etc/resolv.conf"
-+#define _PATH_RESCONF "@TERMUX_PREFIX@/etc/resolv.conf"
- #endif
-
- #ifndef CMSG_LEN
-diff -uNr glib-2.58.3/gio/gunixmounts.c glib-2.58.3.mod/gio/gunixmounts.c
---- glib-2.58.3/gio/gunixmounts.c 2019-01-21 15:38:50.000000000 +0200
-+++ glib-2.58.3.mod/gio/gunixmounts.c 2019-03-02 02:08:55.331642893 +0200
-@@ -539,7 +539,7 @@
- return _PATH_MOUNTED;
- # endif
- #else
-- return "/etc/mtab";
-+ return "@TERMUX_PREFIX@/etc/mtab";
- #endif
- }
-
-@@ -666,7 +666,7 @@
- mountinfo_path = _PATH_MOUNTED;
- # endif
- #else
-- mountinfo_path = "/etc/mtab";
-+ mountinfo_path = "@TERMUX_PREFIX@/etc/mtab";
- #endif
-
- return mountinfo_path;
-@@ -960,7 +960,7 @@
- #elif defined(VFSTAB)
- return VFSTAB;
- #else
-- return "/etc/fstab";
-+ return "@TERMUX_PREFIX@/etc/fstab";
- #endif
- #endif
- }
-@@ -2955,7 +2955,7 @@
- /* see if device with similar major:minor as /dev/root is mention
- * in /etc/mtab (it usually is)
- */
-- f = fopen ("/etc/mtab", "r");
-+ f = fopen ("@TERMUX_PREFIX@/etc/mtab", "r");
- if (f != NULL)
- {
- struct mntent *entp;
-diff -uNr glib-2.58.3/gio/tests/org.gtk.test.gschema.override.orig glib-2.58.3.mod/gio/tests/org.gtk.test.gschema.override.orig
---- glib-2.58.3/gio/tests/org.gtk.test.gschema.override.orig 2019-01-21 15:38:50.000000000 +0200
-+++ glib-2.58.3.mod/gio/tests/org.gtk.test.gschema.override.orig 1970-01-01 03:00:00.000000000 +0300
-@@ -1,2 +0,0 @@
--[org.gtk.test.per-desktop:GNOME-Classic]
--desktop = "GNOME Classic"
-diff -uNr glib-2.58.3/gio/tests/org.gtk.test.gschema.xml.orig glib-2.58.3.mod/gio/tests/org.gtk.test.gschema.xml.orig
---- glib-2.58.3/gio/tests/org.gtk.test.gschema.xml.orig 2019-01-21 15:38:50.000000000 +0200
-+++ glib-2.58.3.mod/gio/tests/org.gtk.test.gschema.xml.orig 1970-01-01 03:00:00.000000000 +0300
-@@ -1,222 +0,0 @@
--
--
--
--
-- "Hello, earthlings"
-- A greeting
--
-- Greeting of the invading martians
--
--
--
-- "So long"
--
--
--
--
--
--
--
--
--
-- true
--
--
--
--
--
-- true
--
--
-- 25
--
--
-- -1234
--
--
-- 1234
--
--
-- -123456
--
--
-- 123456
--
--
-- -123456789
--
--
-- 123456789
--
--
-- 123.456
--
--
-- "a string, it seems"
--
--
-- "/a/object/path"
--
--
--
--
--
-- ("one",(2,3))
--
--
-- [0,1,2,3,4,5]
--
--
--
-- {
-- "AC": [0,0, 0,0,0,0,0,0],
-- "IV": [0,0, 0,0,0,0,0,0]
-- }
--
--
--
--
--
--
-- "Unnamed"
--
--
-- "BackSpace"
--
--
--
--
--
-- false
--
--
-- false
--
--
-- 0
--
--
-- 0
--
--
-- 0
--
--
-- 0
--
--
-- 0
--
--
-- 0
--
--
-- 0
--
--
-- 0
--
--
-- ""
--
--
-- [48, 49]
--
--
-- []
--
--
-- 'foo'
--
--
-- ['mourning', 'laughing']
--
--
-- 33
--
--
--
--
--
--
-- 'bar'
--
--
--
--
--
-- []
--
--
--
--
--
--
--
--
-- []
--
--
-- 'bar'
--
--
--
--
--
-- 33
--
--
--
--
--
--
-- 33
--
--
--
--
--
-- 0
--
--
--
--
--
--
-- a paragraph.
--
-- with some whitespace.
--
-- because not everyone has a great editor.
--
--
--
--
-- lots of space is as one.
--
-- 0
--
--
--
--
--
-- 0
--
--
-- ''
--
--
--
-- 42
--
-- 0
--
--
--
--
--
-- "GNOME"
--
--
--
--
-diff -uNr glib-2.58.3/gio/xdgmime/xdgmime.c glib-2.58.3.mod/gio/xdgmime/xdgmime.c
---- glib-2.58.3/gio/xdgmime/xdgmime.c 2019-01-21 15:38:50.000000000 +0200
-+++ glib-2.58.3.mod/gio/xdgmime/xdgmime.c 2019-03-02 02:08:55.334976238 +0200
-@@ -255,7 +255,7 @@
-
- xdg_data_dirs = getenv ("XDG_DATA_DIRS");
- if (xdg_data_dirs == NULL)
-- xdg_data_dirs = "/usr/local/share/:/usr/share/";
-+ xdg_data_dirs = "@TERMUX_PREFIX@/local/share/:@TERMUX_PREFIX@/share/";
-
- ptr = xdg_data_dirs;
-
-diff -uNr glib-2.58.3/glib/gcharset.c glib-2.58.3.mod/glib/gcharset.c
---- glib-2.58.3/glib/gcharset.c 2019-01-21 15:38:50.000000000 +0200
-+++ glib-2.58.3.mod/glib/gcharset.c 2019-03-02 02:08:55.334976238 +0200
-@@ -298,7 +298,7 @@
- if (g_once_init_enter (&alias_table))
- {
- GHashTable *table = g_hash_table_new (g_str_hash, g_str_equal);
-- read_aliases ("/usr/share/locale/locale.alias", table);
-+ read_aliases ("@TERMUX_PREFIX@/share/locale/locale.alias", table);
- g_once_init_leave (&alias_table, table);
- }
-
diff --git a/packages/glib/gio-gdbusaddress.c.patch b/packages/glib/gio-gdbusaddress.c.patch
new file mode 100644
index 000000000..97c3a601c
--- /dev/null
+++ b/packages/glib/gio-gdbusaddress.c.patch
@@ -0,0 +1,11 @@
+--- ./gio/gdbusaddress.c.orig 2021-12-10 17:23:55.601721119 +0530
++++ ./gio/gdbusaddress.c 2021-12-10 17:21:46.541721169 +0530
+@@ -1337,7 +1337,7 @@
+
+ if (ret == NULL)
+ {
+- ret = g_strdup ("unix:path=/var/run/dbus/system_bus_socket");
++ ret = g_strdup ("unix:path=@TERMUX_PREFIX@/var/run/dbus/system_bus_socket");
+ }
+ break;
+
diff --git a/packages/glib/gio-gdbusdaemon.c.patch b/packages/glib/gio-gdbusdaemon.c.patch
new file mode 100644
index 000000000..3c6e29ed3
--- /dev/null
+++ b/packages/glib/gio-gdbusdaemon.c.patch
@@ -0,0 +1,11 @@
+--- ./gio/gdbusdaemon.c.orig 2021-12-10 17:26:47.111721054 +0530
++++ ./gio/gdbusdaemon.c 2021-12-10 17:27:49.911721030 +0530
+@@ -1594,7 +1594,7 @@
+ {
+ #ifdef G_OS_UNIX
+ if (g_unix_socket_address_abstract_names_supported ())
+- daemon->address = g_strdup ("unix:tmpdir=/tmp/gdbus-daemon");
++ daemon->address = g_strdup ("unix:tmpdir=@TERMUX_PREFIX@/tmp/gdbus-daemon");
+ else
+ {
+ daemon->tmpdir = g_dir_make_tmp ("gdbus-daemon-XXXXXX", NULL);
diff --git a/packages/glib/gio-gdbusprivate.c.patch b/packages/glib/gio-gdbusprivate.c.patch
new file mode 100644
index 000000000..a937a16b6
--- /dev/null
+++ b/packages/glib/gio-gdbusprivate.c.patch
@@ -0,0 +1,13 @@
+--- ./gio/gdbusprivate.c.orig 2021-12-10 17:28:44.551721009 +0530
++++ ./gio/gdbusprivate.c 2021-12-10 19:24:17.521718364 +0530
+@@ -2477,8 +2477,8 @@
+
+ /* Copy what dbus.git does: allow the /var/lib path to be configurable at
+ * build time, but hard-code the system-wide machine ID path in /etc. */
+- const gchar *var_lib_path = LOCALSTATEDIR "/lib/dbus/machine-id";
+- const gchar *etc_path = "/etc/machine-id";
++ const gchar *var_lib_path = LOCALSTATEDIR "@TERMUX_PREFIX@/lib/dbus/machine-id";
++ const gchar *etc_path = "@TERMUX_PREFIX@/etc/machine-id";
+
+ if (!g_file_get_contents (var_lib_path,
+ &ret,
diff --git a/packages/glib/gio-gkeyfilesettingsbackend.c.patch b/packages/glib/gio-gkeyfilesettingsbackend.c.patch
new file mode 100644
index 000000000..9de2bf083
--- /dev/null
+++ b/packages/glib/gio-gkeyfilesettingsbackend.c.patch
@@ -0,0 +1,11 @@
+--- ./gio/gkeyfilesettingsbackend.c.orig 2021-12-10 19:39:09.321718024 +0530
++++ ./gio/gkeyfilesettingsbackend.c 2021-12-10 19:39:26.371718018 +0530
+@@ -662,7 +662,7 @@
+ load_system_settings (GKeyfileSettingsBackend *kfsb)
+ {
+ GError *error = NULL;
+- const char *dir = "/etc/glib-2.0/settings";
++ const char *dir = "@TERMUX_PREFIX@/etc/glib-2.0/settings";
+ char *path;
+ char *contents;
+
diff --git a/packages/glib/gio-gnetworking.h.in.patch b/packages/glib/gio-gnetworking.h.in.patch
new file mode 100644
index 000000000..bcbca915f
--- /dev/null
+++ b/packages/glib/gio-gnetworking.h.in.patch
@@ -0,0 +1,11 @@
+--- ./gio/gnetworking.h.in.orig 2021-12-10 19:44:29.271717902 +0530
++++ ./gio/gnetworking.h.in 2021-12-10 19:45:00.881717890 +0530
+@@ -51,7 +51,7 @@
+ #endif
+
+ #ifndef _PATH_RESCONF
+-#define _PATH_RESCONF "/etc/resolv.conf"
++#define _PATH_RESCONF "@TERMUX_PREFIX@/etc/resolv.conf"
+ #endif
+
+ #ifndef CMSG_LEN
diff --git a/packages/glib/gio-gunixmounts.c.patch b/packages/glib/gio-gunixmounts.c.patch
new file mode 100644
index 000000000..06256ec72
--- /dev/null
+++ b/packages/glib/gio-gunixmounts.c.patch
@@ -0,0 +1,11 @@
+--- ./gio/gunixmounts.c.orig 2021-12-10 16:01:41.791723001 +0530
++++ ./gio/gunixmounts.c 2021-12-10 16:03:20.861722964 +0530
+@@ -20,6 +20,8 @@
+ * Author: Alexander Larsson
+ */
+
++#include
++
+ /* Prologue {{{1 */
+
+ #include "config.h"
diff --git a/packages/glib/gio-xdgmime-xdgmime.c.patch b/packages/glib/gio-xdgmime-xdgmime.c.patch
new file mode 100644
index 000000000..ecaf6ddf2
--- /dev/null
+++ b/packages/glib/gio-xdgmime-xdgmime.c.patch
@@ -0,0 +1,11 @@
+--- ./gio/xdgmime/xdgmime.c.orig 2021-12-10 20:05:07.591717430 +0530
++++ ./gio/xdgmime/xdgmime.c 2021-12-10 20:05:11.861717428 +0530
+@@ -235,7 +235,7 @@
+ xdg_data_dirs = getenv ("XDG_DATA_DIRS");
+
+ if (xdg_data_dirs == NULL)
+- xdg_data_dirs = "/usr/local/share/:/usr/share/";
++ xdg_data_dirs = "@TERMUX_PREFIX@/local/share/:@TERMUX_PREFIX@/share/";
+
+ /* Work out how many dirs we’re dealing with. */
+ if (xdg_data_home != NULL || home != NULL)
diff --git a/packages/glib/glib-gcharset.c.patch b/packages/glib/glib-gcharset.c.patch
new file mode 100644
index 000000000..872126068
--- /dev/null
+++ b/packages/glib/glib-gcharset.c.patch
@@ -0,0 +1,11 @@
+--- ./glib/gcharset.c.orig 2021-12-10 21:38:06.571715302 +0530
++++ ./glib/gcharset.c 2021-12-10 21:38:11.361715300 +0530
+@@ -494,7 +494,7 @@
+ if (g_once_init_enter (&alias_table))
+ {
+ GHashTable *table = g_hash_table_new (g_str_hash, g_str_equal);
+- read_aliases ("/usr/share/locale/locale.alias", table);
++ read_aliases ("@TERMUX_PREFIX@/share/locale/locale.alias", table);
+ g_once_init_leave (&alias_table, table);
+ }
+
diff --git a/packages/glib/glib-gspawn.c.patch b/packages/glib/glib-gspawn.c.patch
index 9b7c3025f..cb49e6447 100644
--- a/packages/glib/glib-gspawn.c.patch
+++ b/packages/glib/glib-gspawn.c.patch
@@ -1,15 +1,15 @@
---- ./glib/gspawn.c.orig 2020-07-20 22:15:45.985010959 +0200
-+++ ./glib/gspawn.c 2020-07-20 22:18:29.707654650 +0200
-@@ -1825,7 +1825,7 @@
+--- ./glib/gspawn.c.orig 2021-12-10 22:01:14.151714772 +0530
++++ ./glib/gspawn.c 2021-12-10 22:01:19.781714770 +0530
+@@ -2200,7 +2200,7 @@
* * what to search if PATH is unset. POSIX may, dunno.
* */
- chosen_search_path = "/bin:/usr/bin:.";
-+ chosen_search_path = "@TERMUX_PREFIX@/bin:.";
++ chosen_search_path = "@TERMUX_PREFIX/bin:.";
}
- /* Allocate a buffer which the fork()ed child can use to assemble potential
-@@ -2246,7 +2246,7 @@
+ if (search_path || search_path_from_envp)
+@@ -2593,7 +2593,7 @@
if (argc + 2 > argv_buffer_len)
return FALSE;
diff --git a/packages/glib/glib-gtimezone.c.patch b/packages/glib/glib-gtimezone.patch
similarity index 85%
rename from packages/glib/glib-gtimezone.c.patch
rename to packages/glib/glib-gtimezone.patch
index ed6f6f7d9..fc2675246 100644
--- a/packages/glib/glib-gtimezone.c.patch
+++ b/packages/glib/glib-gtimezone.patch
@@ -1,8 +1,7 @@
-diff -u -r ../glib-2.58.1/glib/gtimezone.c ./glib/gtimezone.c
---- ../glib-2.58.1/glib/gtimezone.c 2018-09-21 14:23:53.000000000 +0000
-+++ ./glib/gtimezone.c 2018-10-07 18:37:37.275489744 +0000
-@@ -43,6 +43,10 @@
- #include
+--- ./glib/gtimezone.c.orig 2021-12-11 16:52:41.154480293 +0530
++++ ./glib/gtimezone.c 2021-12-11 16:53:59.829643030 +0530
+@@ -46,6 +46,10 @@
+ #include
#endif
+#ifdef __ANDROID__
@@ -12,12 +11,10 @@ diff -u -r ../glib-2.58.1/glib/gtimezone.c ./glib/gtimezone.c
/**
* SECTION:timezone
* @title: GTimeZone
-@@ -399,7 +403,136 @@
- gtz->transitions = NULL;
+@@ -509,6 +513,135 @@
+ return resolved_identifier;
}
--#ifdef G_OS_UNIX
-+#ifdef __ANDROID__
+/* Android uses a 'persist.sys.timezone' system property for the
+ * current timezone instead of a /etc/localtime file:
+ * https://android.googlesource.com/platform/ndk/+/android-2.2_r1/docs/system/libc/OVERVIEW.TXT#67
@@ -145,31 +142,17 @@ diff -u -r ../glib-2.58.1/glib/gtimezone.c ./glib/gtimezone.c
+ return NULL;
+}
+
-+#elif defined(G_OS_UNIX)
++
+
static GBytes*
- zone_info_unix (const gchar *identifier,
- gchar **out_identifier)
-@@ -506,6 +641,10 @@
- return zoneinfo;
- }
-
-+#endif
-+
-+#ifdef G_OS_UNIX
-+
- static void
- init_zone_from_iana_info (GTimeZone *gtz,
- GBytes *zoneinfo,
-@@ -1483,7 +1622,11 @@
+ zone_info_unix (const gchar *identifier,
+ const gchar *resolved_identifier)
+@@ -1773,7 +1906,7 @@
if (tz->t_info == NULL)
{
#ifdef G_OS_UNIX
-+# ifdef __ANDROID__
-+ GBytes *zoneinfo = zone_info_android (identifier, &resolved_identifier);
-+# else
- GBytes *zoneinfo = zone_info_unix (identifier, &resolved_identifier);
-+# endif
+- GBytes *zoneinfo = zone_info_unix (identifier, resolved_identifier);
++ GBytes *zoneinfo = zone_info_android(identifier, resolved_identifier);
if (zoneinfo != NULL)
{
init_zone_from_iana_info (tz, zoneinfo, g_steal_pointer (&resolved_identifier));
diff --git a/packages/glib/glib-gutils.c.patch b/packages/glib/glib-gutils.c.patch
index 8f74920c3..8d649cd6f 100644
--- a/packages/glib/glib-gutils.c.patch
+++ b/packages/glib/glib-gutils.c.patch
@@ -1,7 +1,6 @@
-diff -u -r ../glib-2.60.2/glib/gutils.c ./glib/gutils.c
---- ../glib-2.60.2/glib/gutils.c 2019-05-03 13:43:28.000000000 +0000
-+++ ./glib/gutils.c 2019-05-11 19:59:12.830415366 +0000
-@@ -378,7 +378,7 @@
+--- ./glib/gutils.c.orig 2021-12-11 13:35:15.354088542 +0530
++++ ./glib/gutils.c 2021-12-11 13:36:59.724088502 +0530
+@@ -369,7 +369,7 @@
* what to search if PATH is unset. POSIX may, dunno.
*/
@@ -10,7 +9,7 @@ diff -u -r ../glib-2.60.2/glib/gutils.c ./glib/gutils.c
}
#else
n = GetModuleFileNameW (NULL, wfilename, MAXPATHLEN);
-@@ -958,7 +958,7 @@
+@@ -949,7 +949,7 @@
if (tmp == NULL || *tmp == '\0')
{
g_free (tmp);
@@ -19,21 +18,21 @@ diff -u -r ../glib-2.60.2/glib/gutils.c ./glib/gutils.c
}
#endif /* !G_OS_WIN32 */
-@@ -2080,7 +2080,7 @@
+@@ -1526,7 +1526,7 @@
+ else
+ return NULL;
+ #elif defined (G_OS_UNIX)
+- const gchar * const os_release_files[] = { "/etc/os-release", "/usr/lib/os-release" };
++ const gchar * const os_release_files[] = { "@TERMUX_PREFIX@/etc/os-release", "@TERMUX_PREFIX@/lib/os-release" };
+ gsize i;
+ gchar *buffer = NULL;
+ gchar *result = NULL;
+@@ -2465,7 +2465,7 @@
*/
#ifndef G_OS_WIN32
if (!data_dirs || !data_dirs[0])
- data_dirs = "/usr/local/share/:/usr/share/";
-+ data_dirs = "@TERMUX_PREFIX@/share/";
++ data_dirs = "@TERMUX_PREFIX@/local/share/:@TERMUX_PREFIX@/share/";
data_dir_vector = g_strsplit (data_dirs, G_SEARCHPATH_SEPARATOR_S, 0);
#else
-@@ -2174,7 +2174,7 @@
- }
- #else
- if (!conf_dirs || !conf_dirs[0])
-- conf_dirs = "/etc/xdg";
-+ conf_dirs = "@TERMUX_PREFIX@/etc/xdg";
-
- conf_dir_vector = g_strsplit (conf_dirs, G_SEARCHPATH_SEPARATOR_S, 0);
- #endif
diff --git a/packages/glib/glib-tests-meson.build.patch b/packages/glib/glib-tests-meson.build.patch
new file mode 100644
index 000000000..7c3fc0f71
--- /dev/null
+++ b/packages/glib/glib-tests-meson.build.patch
@@ -0,0 +1,30 @@
+--- ./glib/tests/meson.build.orig 2021-12-10 15:51:33.481723233 +0530
++++ ./glib/tests/meson.build 2021-12-10 15:52:09.931723220 +0530
+@@ -158,27 +158,6 @@
+ 'include' : {},
+ 'unix' : {},
+ }
+- if have_rtld_next
+- glib_tests += {
+- 'gutils-user-database' : {
+- 'depends' : [
+- shared_library('getpwuid-preload',
+- 'getpwuid-preload.c',
+- name_prefix : '',
+- dependencies: libdl_dep,
+- install_dir : installed_tests_execdir,
+- install: installed_tests_enabled,
+- ),
+- ],
+- 'env' : {
+- 'LD_PRELOAD': '@0@/getpwuid-preload.so'.format(meson.current_build_dir()),
+- },
+- 'installed_tests_env' : {
+- 'LD_PRELOAD': '@0@/getpwuid-preload.so'.format(installed_tests_execdir),
+- },
+- },
+- }
+- endif
+ endif
+
+ if installed_tests_enabled
diff --git a/packages/glib/meson.build.patch b/packages/glib/meson.build.patch
index 4a07cb51a..4e38342c7 100644
--- a/packages/glib/meson.build.patch
+++ b/packages/glib/meson.build.patch
@@ -1,21 +1,18 @@
-diff -u -r ../glib-2.60.2/meson.build ./meson.build
---- ../glib-2.60.2/meson.build 2019-05-03 13:43:28.000000000 +0000
-+++ ./meson.build 2019-05-11 20:10:26.054269305 +0000
-@@ -360,7 +360,6 @@
- # https://wiki.gnome.org/Projects/GLib/CompilerRequirements#Function_pointer_conversions.
- '-Wno-pedantic',
+--- ./meson.build.orig 2021-12-10 06:56:41.609999906 +0530
++++ ./meson.build 2021-12-11 17:23:07.992103796 +0530
+@@ -443,7 +443,6 @@
+ # A zero-length format string shouldn't be considered an issue.
+ '-Wno-format-zero-length',
'-Werror=declaration-after-statement',
- '-Werror=format=2',
'-Werror=implicit-function-declaration',
'-Werror=init-self',
'-Werror=missing-include-dirs',
---- ./meson.build.orig 2019-06-11 00:18:20.480045589 +0000
-+++ ./meson.build 2019-06-11 00:19:34.408583457 +0000
-@@ -1780,9 +1780,8 @@
+@@ -2047,9 +2046,8 @@
# FIXME: glib-gettext.m4 has much more checks to detect broken/uncompatible
# implementations. This could be extended if issues are found in some platforms.
libintl_deps = []
--if cc.has_function('ngettext')
+-if cc.has_function('ngettext', args : osx_ldflags)
- have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset')
-else
+have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset')