[oe-commits] [openembedded-core] 49/60: gobject-introspection: relocate typelib repository for native builds

git at git.openembedded.org git at git.openembedded.org
Mon Jun 18 10:11:49 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

commit e4cee788056133ce0a49bc96e54399bdd7825aa3
Author: Sascha Silbe <x-yo17 at se-silbe.de>
AuthorDate: Fri Jun 8 18:18:41 2018 +0200

    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 at intel.com>.
    
    Signed-off-by: Sascha Silbe <x-yo17 at se-silbe.de>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 ...he-repository-directory-for-native-builds.patch | 64 ++++++++++++++++++++++
 .../gobject-introspection_1.56.1.bb                |  2 +
 2 files changed, 66 insertions(+)

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 0000000..644cab9
--- /dev/null
+++ b/meta/recipes-gnome/gobject-introspection/gobject-introspection/0001-Relocate-the-repository-directory-for-native-builds.patch
@@ -0,0 +1,64 @@
+From 31ef4cce83c1770ea1e816d91b7e258fbf170035 Mon Sep 17 00:00:00 2001
+From: Sascha Silbe <x-yo17 at se-silbe.de>
+Date: Fri, 8 Jun 2018 13:55:10 +0200
+Subject: [PATCH] Relocate the repository directory for native builds
+
+Instead of hard-coding GOBJECT_INTROSPECTION_LIBDIR when
+gobject-introspection is built, use dladdr() to determine where
+GOBJECT_INTROSPECTION_LIBDIR is and use that path to calculate the
+repository directory.
+
+This fixes gobject-introspection-native accessing paths across build
+directories (e.g. if the build directories use the same shared state
+cache or sstate mirror).
+
+Upstream-Status: Inappropriate
+Signed-off-by: Sascha Silbe <x-yo17 at se-silbe.de>
+---
+ girepository/girepository.c | 15 +++++++++++++--
+ 1 file changed, 13 insertions(+), 2 deletions(-)
+
+diff --git a/girepository/girepository.c b/girepository/girepository.c
+index 10282c72..60c45104 100644
+--- a/girepository/girepository.c
++++ b/girepository/girepository.c
+@@ -21,6 +21,8 @@
+  * Boston, MA 02111-1307, USA.
+  */
+ 
++#define _GNU_SOURCE
++
+ #include "config.h"
+ 
+ #include <stdio.h>
+@@ -34,6 +36,8 @@
+ #include "gitypelib-internal.h"
+ #include "girepository-private.h"
+ 
++#include <dlfcn.h>
++
+ /**
+  * SECTION:girepository
+  * @short_description: GObject Introspection repository manager
+@@ -191,9 +195,16 @@ init_globals (void)
+           g_free (custom_dirs);
+         }
+ 
+-      libdir = GOBJECT_INTROSPECTION_LIBDIR;
++      Dl_info gi_lib_info;
+ 
+-      typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
++      if (dladdr (g_irepository_get_default, &gi_lib_info)) {
++        char *libdir = g_path_get_dirname (gi_lib_info.dli_fname);
++        typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
++        g_free (libdir);
++      } else {
++        libdir = GOBJECT_INTROSPECTION_LIBDIR;
++        typelib_dir = g_build_filename (libdir, "girepository-1.0", NULL);
++      }
+ 
+       search_path = g_slist_prepend (search_path, typelib_dir);
+ 
+-- 
+2.11.0
+
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 8d05566..ddec110 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}-$
 SRC_URI[md5sum] = "62e5f5685b8d9752fdeaf17c057d53d1"
 SRC_URI[sha256sum] = "5b2875ccff99ff7baab63a34b67f8c920def240e178ff50add809e267d9ea24b"
 
+SRC_URI_append_class-native = " file://0001-Relocate-the-repository-directory-for-native-builds.patch "
+
 inherit autotools pkgconfig gtk-doc python3native qemu gobject-introspection-data upstream-version-is-even
 BBCLASSEXTEND = "native"
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list