diff options
2 files changed, 66 insertions, 0 deletions
diff --git a/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-Relocate-the-repository-directory-for-native-builds.patch b/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-Relocate-the-repository-directory-for-native-builds.patch new file mode 100644 index 0000000000..644cab929d --- /dev/null +++ b/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-Relocate-the-repository-directory-for-native-builds.patch | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | From 31ef4cce83c1770ea1e816d91b7e258fbf170035 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Sascha Silbe <x-yo17@se-silbe.de> | ||
| 3 | Date: Fri, 8 Jun 2018 13:55:10 +0200 | ||
| 4 | Subject: [PATCH] Relocate the repository directory for native builds | ||
| 5 | |||
| 6 | Instead of hard-coding GOBJECT_INTROSPECTION_LIBDIR when | ||
| 7 | gobject-introspection is built, use dladdr() to determine where | ||
| 8 | GOBJECT_INTROSPECTION_LIBDIR is and use that path to calculate the | ||
| 9 | repository directory. | ||
| 10 | |||
| 11 | This fixes gobject-introspection-native accessing paths across build | ||
| 12 | directories (e.g. if the build directories use the same shared state | ||
| 13 | cache or sstate mirror). | ||
| 14 | |||
| 15 | Upstream-Status: Inappropriate | ||
| 16 | Signed-off-by: Sascha Silbe <x-yo17@se-silbe.de> | ||
| 17 | --- | ||
| 18 | girepository/girepository.c | 15 +++++++++++++-- | ||
| 19 | 1 file changed, 13 insertions(+), 2 deletions(-) | ||
| 20 | |||
| 21 | diff --git a/girepository/girepository.c b/girepository/girepository.c | ||
| 22 | index 10282c72..60c45104 100644 | ||
| 23 | --- a/girepository/girepository.c | ||
| 24 | +++ b/girepository/girepository.c | ||
| 25 | @@ -21,6 +21,8 @@ | ||
| 26 | * Boston, MA 02111-1307, USA. | ||
| 27 | */ | ||
| 28 | |||
| 29 | +#define _GNU_SOURCE | ||
| 30 | + | ||
| 31 | #include "config.h" | ||
| 32 | |||
| 33 | #include <stdio.h> | ||
| 34 | @@ -34,6 +36,8 @@ | ||
| 35 | #include "gitypelib-internal.h" | ||
| 36 | #include "girepository-private.h" | ||
| 37 | |||
| 38 | +#include <dlfcn.h> | ||
| 39 | + | ||
| 40 | /** | ||
| 41 | * SECTION:girepository | ||
| 42 | * @short_description: GObject Introspection repository manager | ||
| 43 | @@ -191,9 +195,16 @@ init_globals (void) | ||
| 44 | g_free (custom_dirs); | ||
| 45 | } | ||
| 46 | |||
| 47 | - libdir = GOBJECT_INTROSPECTION_LIBDIR; | ||
| 48 | + Dl_info gi_lib_info; | ||
| 49 | |||
| 50 | - typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL); | ||
| 51 | + if (dladdr (g_irepository_get_default, &gi_lib_info)) { | ||
| 52 | + char *libdir = g_path_get_dirname (gi_lib_info.dli_fname); | ||
| 53 | + typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL); | ||
| 54 | + g_free (libdir); | ||
| 55 | + } else { | ||
| 56 | + libdir = GOBJECT_INTROSPECTION_LIBDIR; | ||
| 57 | + typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL); | ||
| 58 | + } | ||
| 59 | |||
| 60 | search_path = g_slist_prepend (search_path, typelib_dir); | ||
| 61 | |||
| 62 | -- | ||
| 63 | 2.11.0 | ||
| 64 | |||
diff --git a/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.56.1.bb b/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.56.1.bb index 8d05566949..ddec11067b 100644 --- a/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.56.1.bb +++ b/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.56.1.bb | |||
| @@ -20,6 +20,8 @@ SRC_URI = "${GNOME_MIRROR}/${BPN}/${@oe.utils.trim_version("${PV}", 2)}/${BPN}-$ | |||
| 20 | SRC_URI[md5sum] = "62e5f5685b8d9752fdeaf17c057d53d1" | 20 | SRC_URI[md5sum] = "62e5f5685b8d9752fdeaf17c057d53d1" |
| 21 | SRC_URI[sha256sum] = "5b2875ccff99ff7baab63a34b67f8c920def240e178ff50add809e267d9ea24b" | 21 | SRC_URI[sha256sum] = "5b2875ccff99ff7baab63a34b67f8c920def240e178ff50add809e267d9ea24b" |
| 22 | 22 | ||
| 23 | SRC_URI_append_class-native = " file://0001-Relocate-the-repository-directory-for-native-builds.patch " | ||
| 24 | |||
| 23 | inherit autotools pkgconfig gtk-doc python3native qemu gobject-introspection-data upstream-version-is-even | 25 | inherit autotools pkgconfig gtk-doc python3native qemu gobject-introspection-data upstream-version-is-even |
| 24 | BBCLASSEXTEND = "native" | 26 | BBCLASSEXTEND = "native" |
| 25 | 27 | ||
