| From 72c374b1c78cdd68765b68d5501f6c8d7d0c5907 Mon Sep 17 00:00:00 2001 |
| From: Christoph Reiter <reiter.christoph@gmail.com> |
| Date: Sun, 21 Feb 2021 09:45:13 +0100 |
| Subject: [PATCH] meson: Don't harcode path to site-packages |
| |
| Ask sysconfig instead for the right path. This fixes the default |
| value under MSYS2. |
| --- |
| meson.build | 11 ++--------- |
| 1 file changed, 2 insertions(+), 9 deletions(-) |
| |
| diff --git a/meson.build b/meson.build |
| index e6a79d09..b0c1fb99 100644 |
| --- a/meson.build |
| +++ b/meson.build |
| @@ -258,10 +258,10 @@ subdir('docs') |
| |
| override_detector = ''' |
| import sys |
| +import sysconfig |
| import os |
| |
| prefix = sys.argv[1] |
| -version = sys.version_info |
| |
| # If we are installing in the same prefix as PyGobject |
| # make sure to install in the right place. |
| @@ -274,14 +274,7 @@ if os.path.commonprefix([overrides_path, prefix]) == prefix: |
| |
| # Otherwise follow python's way of install site packages inside |
| # the provided prefix |
| -if os.name == 'posix': |
| - print(os.path.join( |
| - prefix, 'lib', 'python%d.%d' % (version.major, version.minor), |
| - 'site-packages', 'gi', 'overrides')) |
| -else: |
| - print(os.path.join( |
| - prefix, 'Lib', 'Python%d%d' % (version.major, version.minor), |
| - 'site-packages', 'gi', 'overrides')) |
| +print(os.path.join(sysconfig.get_path('purelib', vars={'base': prefix}), 'gi', 'overrides')) |
| ''' |
| pygi_override_dir = get_option('pygi-overrides-dir') |
| if pygi_override_dir == '' |
| -- |
| 2.30.1 |
| |