summaryrefslogtreecommitdiffstats
path: root/meta/recipes-gnome/gobject-introspection
diff options
context:
space:
mode:
authorSascha Silbe <x-yo17@se-silbe.de>2018-06-08 18:18:41 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-06-18 11:07:58 +0100
commit9a855aa403164998129aad50dbef35ab26b78084 (patch)
tree9433cb682d107133997017c1749efc8e20242149 /meta/recipes-gnome/gobject-introspection
parent261ee1896804e6261443d1dfe7dedb6546644d3a (diff)
downloadpoky-9a855aa403164998129aad50dbef35ab26b78084.tar.gz
gobject-introspection: relocate typelib repository for native builds
gobject-introspection hard-codes the install path in the search path for the typelib repository, pretty much the same way glib behaves for the gio modules directory. Like for glib, this causes problems when gobject-introspection-native is restored from sstate with a different build directory. Based on the glib fix by Ross Burton <ross.burton@intel.com>. (From OE-Core rev: e4cee788056133ce0a49bc96e54399bdd7825aa3) Signed-off-by: Sascha Silbe <x-yo17@se-silbe.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-gnome/gobject-introspection')
-rw-r--r--meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-Relocate-the-repository-directory-for-native-builds.patch64
-rw-r--r--meta/recipes-gnome/gobject-introspection/gobject-introspection_1.56.1.bb2
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 @@
1From 31ef4cce83c1770ea1e816d91b7e258fbf170035 Mon Sep 17 00:00:00 2001
2From: Sascha Silbe <x-yo17@se-silbe.de>
3Date: Fri, 8 Jun 2018 13:55:10 +0200
4Subject: [PATCH] Relocate the repository directory for native builds
5
6Instead of hard-coding GOBJECT_INTROSPECTION_LIBDIR when
7gobject-introspection is built, use dladdr() to determine where
8GOBJECT_INTROSPECTION_LIBDIR is and use that path to calculate the
9repository directory.
10
11This fixes gobject-introspection-native accessing paths across build
12directories (e.g. if the build directories use the same shared state
13cache or sstate mirror).
14
15Upstream-Status: Inappropriate
16Signed-off-by: Sascha Silbe <x-yo17@se-silbe.de>
17---
18 girepository/girepository.c | 15 +++++++++++++--
19 1 file changed, 13 insertions(+), 2 deletions(-)
20
21diff --git a/girepository/girepository.c b/girepository/girepository.c
22index 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--
632.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}-$
20SRC_URI[md5sum] = "62e5f5685b8d9752fdeaf17c057d53d1" 20SRC_URI[md5sum] = "62e5f5685b8d9752fdeaf17c057d53d1"
21SRC_URI[sha256sum] = "5b2875ccff99ff7baab63a34b67f8c920def240e178ff50add809e267d9ea24b" 21SRC_URI[sha256sum] = "5b2875ccff99ff7baab63a34b67f8c920def240e178ff50add809e267d9ea24b"
22 22
23SRC_URI_append_class-native = " file://0001-Relocate-the-repository-directory-for-native-builds.patch "
24
23inherit autotools pkgconfig gtk-doc python3native qemu gobject-introspection-data upstream-version-is-even 25inherit autotools pkgconfig gtk-doc python3native qemu gobject-introspection-data upstream-version-is-even
24BBCLASSEXTEND = "native" 26BBCLASSEXTEND = "native"
25 27