summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/glib-2.0/glib-2.0/relocate-modules.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/glib-2.0/glib-2.0/relocate-modules.patch')
-rw-r--r--meta/recipes-core/glib-2.0/glib-2.0/relocate-modules.patch46
1 files changed, 20 insertions, 26 deletions
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/relocate-modules.patch b/meta/recipes-core/glib-2.0/glib-2.0/relocate-modules.patch
index 4cbcc29a50..3e79bbf679 100644
--- a/meta/recipes-core/glib-2.0/glib-2.0/relocate-modules.patch
+++ b/meta/recipes-core/glib-2.0/glib-2.0/relocate-modules.patch
@@ -1,4 +1,4 @@
1From 011c9f024b6475d31e7d5432a38d00fb67eaea40 Mon Sep 17 00:00:00 2001 1From f40e89b3852df37959606ee13b1a14ade81fa886 Mon Sep 17 00:00:00 2001
2From: Ross Burton <ross.burton@intel.com> 2From: Ross Burton <ross.burton@intel.com>
3Date: Fri, 11 Mar 2016 15:35:55 +0000 3Date: Fri, 11 Mar 2016 15:35:55 +0000
4Subject: [PATCH] glib-2.0: relocate the GIO module directory for native builds 4Subject: [PATCH] glib-2.0: relocate the GIO module directory for native builds
@@ -13,38 +13,32 @@ Signed-off-by: Ross Burton <ross.burton@intel.com>
13 13
14Port patch to 2.48 14Port patch to 2.48
15Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> 15Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
16
17--- 16---
18 gio/giomodule.c | 12 +++++++++++- 17 gio/giomodule.c | 7 -------
19 1 file changed, 11 insertions(+), 1 deletion(-) 18 1 file changed, 7 deletions(-)
20 19
21diff --git a/gio/giomodule.c b/gio/giomodule.c 20diff --git a/gio/giomodule.c b/gio/giomodule.c
22index dc4d6d3..da46906 100644 21index 17fabe6..8021208 100644
23--- a/gio/giomodule.c 22--- a/gio/giomodule.c
24+++ b/gio/giomodule.c 23+++ b/gio/giomodule.c
25@@ -49,6 +49,8 @@ 24@@ -1271,11 +1271,6 @@ get_gio_module_dir (void)
26 #include "gmemorymonitordbus.h"
27 #ifdef G_OS_WIN32
28 #include "gregistrysettingsbackend.h"
29+#else
30+#include <dlfcn.h>
31 #endif
32 #include <glib/gstdio.h>
33
34@@ -1163,7 +1165,15 @@ get_gio_module_dir (void)
35 NULL);
36 g_free (install_dir); 25 g_free (install_dir);
37 #else 26 #else
38- module_dir = g_strdup (GIO_MODULE_DIR); 27 module_dir = g_strdup (GIO_MODULE_DIR);
39+ Dl_info info; 28-#ifdef __APPLE__
40+ 29-#include "TargetConditionals.h"
41+ if (dladdr (g_io_module_new, &info)) { 30-/* Only auto-relocate on macOS, not watchOS etc; older macOS SDKs only define TARGET_OS_MAC */
42+ char *libdir = g_path_get_dirname (info.dli_fname); 31-#if (defined (TARGET_OS_OSX) && TARGET_OS_OSX) || \
43+ module_dir = g_build_filename (libdir, "gio", "modules", NULL); 32- (!defined (TARGET_OS_OSX) && defined (TARGET_OS_MAC) && TARGET_OS_MAC)
44+ g_free (libdir); 33 #include <dlfcn.h>
45+ } else { 34 {
46+ module_dir = g_strdup (GIO_MODULE_DIR); 35 g_autofree gchar *path = NULL;
47+ } 36@@ -1294,8 +1289,6 @@ get_gio_module_dir (void)
37 }
38 }
39 }
40-#endif
41-#endif
48 #endif 42 #endif
49 } 43 }
50 44