[libsoup/pgriffis/pygobject-overridedir] Fix pygobject override dir on multiarch




commit 87f8dc81a203dcf1c0d175694474b557c1ebb767
Author: Patrick Griffis <pgriffis igalia com>
Date:   Thu Sep 23 14:58:36 2021 -0500

    Fix pygobject override dir on multiarch

 libsoup/meson.build | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)
---
diff --git a/libsoup/meson.build b/libsoup/meson.build
index a05f5752..01c5acbb 100644
--- a/libsoup/meson.build
+++ b/libsoup/meson.build
@@ -297,17 +297,23 @@ python3 = pymod.find_installation('python3')
 get_overridedir = '''
 import os
 import sysconfig
-libdir = sysconfig.get_config_var('LIBDIR')
-if not libdir:
-  libdir = '/usr/lib'
+
 try:
   import gi
   overridedir = gi._overridesdir
 except ImportError:
   purelibdir = sysconfig.get_path('purelib')
   overridedir = os.path.join(purelibdir, 'gi', 'overrides')
-if overridedir.startswith(libdir): # Should always be True..
-  overridedir = overridedir[len(libdir) + 1:]
+
+# We need to strip the libdir from the path so files we install
+# are in our own prefixed libdir.
+libdir = sysconfig.get_config_var('LIBDIR').removesuffix(sysconfig.get_config_var('MULTIARCH'))
+if not libdir:
+  libdir = '/usr/lib/'
+
+if overridedir.startswith(libdir):
+    overridedir = overridedir[len(libdir) + 1:]
+
 print(overridedir)
 '''
 
@@ -318,4 +324,6 @@ else
   pygobject_override_dir = join_paths(get_option('libdir'), ret.stdout().strip())
 endif
 
+message('Found pygobject overridedir: @0@'.format(pygobject_override_dir))
+
 install_data('Soup.py', install_dir: pygobject_override_dir)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]