summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2018-08-17 21:29:18 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2018-08-30 05:01:11 +0530
commit80afcf895c3dd2f726bea6fea58305f81f89d8c5 (patch)
tree8f5186244d2f2219196e6930f637c67e28907265
parente995ea7454fb839d13d01c8ddb1eab5108a7a288 (diff)
gobject-introspection.recipe: Fix GIRs on macOS with meson
https://gitlab.gnome.org/GNOME/gobject-introspection/issues/222
-rw-r--r--recipes/gobject-introspection.recipe1
-rw-r--r--recipes/gobject-introspection/0001-giscanner-Fix-shared-library-name-with-Meson-on-macO.patch52
2 files changed, 53 insertions, 0 deletions
diff --git a/recipes/gobject-introspection.recipe b/recipes/gobject-introspection.recipe
index f76fc44c..a6f5dacc 100644
--- a/recipes/gobject-introspection.recipe
+++ b/recipes/gobject-introspection.recipe
@@ -14,6 +14,7 @@ class Recipe(recipe.Recipe):
autoreconf_sh = 'gtkdocize && autoreconf -vfi'
configure_options = '--with-python=python3'
deps = ['glib']
+ patches = [name + '/0001-giscanner-Fix-shared-library-name-with-Meson-on-macO.patch']
files_bins = ['g-ir-annotation-tool', 'g-ir-compiler', 'g-ir-doc-tool', 'g-ir-generate', 'g-ir-scanner']
files_libs = ['libgirepository-1.0']
diff --git a/recipes/gobject-introspection/0001-giscanner-Fix-shared-library-name-with-Meson-on-macO.patch b/recipes/gobject-introspection/0001-giscanner-Fix-shared-library-name-with-Meson-on-macO.patch
new file mode 100644
index 00000000..51ba11f6
--- /dev/null
+++ b/recipes/gobject-introspection/0001-giscanner-Fix-shared-library-name-with-Meson-on-macO.patch
@@ -0,0 +1,52 @@
+From e900cab3d70924044c05f00d6da3870d0535c5b5 Mon Sep 17 00:00:00 2001
+From: Nirbheek Chauhan <nirbheek@centricular.com>
+Date: Fri, 17 Aug 2018 21:13:15 +0530
+Subject: [PATCH] giscanner: Fix shared-library name with Meson on macOS
+
+Also handle some other install_name cases which are not currently used
+by Meson, but may be in the future.
+
+Closes https://gitlab.gnome.org/GNOME/gobject-introspection/issues/222
+---
+ giscanner/shlibs.py | 18 +++++++++++++++++-
+ 1 file changed, 17 insertions(+), 1 deletion(-)
+
+diff --git a/giscanner/shlibs.py b/giscanner/shlibs.py
+index c93d20c..4d4915d 100644
+--- a/giscanner/shlibs.py
++++ b/giscanner/shlibs.py
+@@ -43,6 +43,22 @@ def _resolve_libtool(options, binary, libraries):
+
+ return shlibs
+
++def _sanitize_install_name(install_name):
++ '''
++ On macOS, the dylib can be built with install_name as @rpath/libfoo.so
++ instead of the absolute path to the library, so handle that. The name
++ can also be @loader_path or @executable_path.
++ '''
++ if not install_name.startswith('@'):
++ return install_name
++ if install_name.startswith('@rpath/'):
++ return install_name[7:]
++ if install_name.startswith('@loader_path/'):
++ return install_name[13:]
++ if install_name.startswith('@executable_path/'):
++ return install_name[17:]
++ raise RuntimeError('Unknown install_name {!r}'.format(install_name))
++
+
+ # Assume ldd output is something vaguely like
+ #
+@@ -121,7 +137,7 @@ def _resolve_non_libtool(options, binary, libraries):
+ m = pattern.search(line)
+ if m:
+ del patterns[library]
+- shlibs.append(m.group(1))
++ shlibs.append(_sanitize_install_name(m.group(1)))
+ break
+
+ if len(patterns) > 0:
+--
+2.15.2 (Apple Git-101.1)
+