termux-packages/packages/glib/fix-hardcoded-paths.patch
2018-10-07 20:44:57 +02:00

142 lines
5.0 KiB
Diff

diff -uNr glib-2.56.1/gio/gdbusaddress.c glib-2.56.1.mod/gio/gdbusaddress.c
--- glib-2.56.1/gio/gdbusaddress.c 2018-02-06 17:44:20.000000000 +0200
+++ glib-2.56.1.mod/gio/gdbusaddress.c 2018-06-19 14:33:32.367220998 +0300
@@ -1624,7 +1624,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.56.1/gio/gdbusprivate.c glib-2.56.1.mod/gio/gdbusprivate.c
--- glib-2.56.1/gio/gdbusprivate.c 2018-04-07 05:10:22.000000000 +0300
+++ glib-2.56.1.mod/gio/gdbusprivate.c 2018-06-19 14:38:52.253904135 +0300
@@ -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.56.1/gio/gnetworking.h.in glib-2.56.1.mod/gio/gnetworking.h.in
--- glib-2.56.1/gio/gnetworking.h.in 2017-07-14 02:03:38.000000000 +0300
+++ glib-2.56.1.mod/gio/gnetworking.h.in 2018-06-19 14:33:00.180552674 +0300
@@ -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.56.1/gio/gunixmounts.c glib-2.56.1.mod/gio/gunixmounts.c
--- glib-2.56.1/gio/gunixmounts.c 2018-04-07 05:10:22.000000000 +0300
+++ glib-2.56.1.mod/gio/gunixmounts.c 2018-06-19 14:42:12.380581105 +0300
@@ -522,7 +522,7 @@
return _PATH_MOUNTED;
# endif
#else
- return "/etc/mtab";
+ return "@TERMUX_PREFIX@/etc/mtab";
#endif
}
@@ -648,7 +648,7 @@
mountinfo_path = _PATH_MOUNTED;
# endif
#else
- mountinfo_path = "/etc/mtab";
+ mountinfo_path = "@TERMUX_PREFIX@/etc/mtab";
#endif
return mountinfo_path;
@@ -939,7 +939,7 @@
#elif defined(VFSTAB)
return VFSTAB;
#else
- return "/etc/fstab";
+ return "@TERMUX_PREFIX@/etc/fstab";
#endif
#endif
}
@@ -2894,7 +2894,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.56.1/gio/xdgmime/xdgmime.c glib-2.56.1.mod/gio/xdgmime/xdgmime.c
--- glib-2.56.1/gio/xdgmime/xdgmime.c 2018-03-12 18:23:37.000000000 +0200
+++ glib-2.56.1.mod/gio/xdgmime/xdgmime.c 2018-06-19 14:43:59.737253299 +0300
@@ -253,7 +253,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.56.1/glib/gcharset.c glib-2.56.1.mod/glib/gcharset.c
--- glib-2.56.1/glib/gcharset.c 2018-04-07 05:10:22.000000000 +0300
+++ glib-2.56.1.mod/glib/gcharset.c 2018-06-19 14:33:00.183886007 +0300
@@ -297,7 +297,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 -uNr glib-2.56.1/glib/gutils.c glib-2.56.1.mod/glib/gutils.c
--- glib-2.56.1/glib/gutils.c 2018-01-08 23:34:19.000000000 +0200
+++ glib-2.56.1.mod/glib/gutils.c 2018-06-19 14:35:11.100559415 +0300
@@ -378,7 +378,7 @@
* what to search if PATH is unset. POSIX may, dunno.
*/
- path = "/bin:/usr/bin:.";
+ path = "@TERMUX_PREFIX@/bin:@TERMUX_PREFIX@/bin/applets:.";
}
#else
n = GetModuleFileNameW (NULL, wfilename, MAXPATHLEN);
@@ -2028,7 +2028,7 @@
#ifndef G_OS_WIN32
if (!data_dirs || !data_dirs[0])
- data_dirs = "/usr/local/share/:/usr/share/";
+ data_dirs = "@TERMUX_PREFIX@/share/";
data_dir_vector = g_strsplit (data_dirs, G_SEARCHPATH_SEPARATOR_S, 0);
#else
@@ -2104,7 +2104,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