diff options
author | Cristián Maureira-Fredes <[email protected]> | 2022-08-02 23:57:09 +0200 |
---|---|---|
committer | Cristian Maureira-Fredes <[email protected]> | 2024-12-03 20:10:46 +0000 |
commit | 92ee56f805e79d1889aa1f5be158ce062ed4aa7d (patch) | |
tree | b2cdc3497f132f708687d1cafe007cae5f98abb7 | |
parent | 94c66538eaf58d8b5bdb9a03eb11dd6bad83d466 (diff) |
build: use posix_prefix to get installation path
On Debian, Python 3.10 introduced some changes to the scheme
in the system, defaulting to 'posix_local' instead of the 'posix_user'
which was previously used, and is currently used in other Linux
distributions.
For example, these values got changed from (posix_user):
data = '/usr'
platlib = '/usr/lib/python3.10/site-packages'
purelib = '/usr/lib/python3.10/site-packages'
to (posix_local):
data = '/usr/local'
platlib = '/usr/lib/python3.10/dist-packages'
purelib = '/usr/lib/python3.10/dist-packages'
This change forces the usage of the 'posix_user' scheme.
Fixes: PYSIDE-2003
Pick-to: 6.8
Change-Id: Ice0ca9adc37c2652f5ef6ce9e0aec0f2f324206b
Reviewed-by: Shyamnath Premnadh <[email protected]>
Reviewed-by: Friedemann Kleint <[email protected]>
-rw-r--r-- | examples/utils/pyside_config.py | 5 | ||||
-rw-r--r-- | sources/shiboken6/cmake/ShibokenHelpers.cmake | 11 |
2 files changed, 13 insertions, 3 deletions
diff --git a/examples/utils/pyside_config.py b/examples/utils/pyside_config.py index 40885dfdb..c4bb873ee 100644 --- a/examples/utils/pyside_config.py +++ b/examples/utils/pyside_config.py @@ -203,7 +203,10 @@ def python_version(): def get_python_include_path(): - return sysconfig.get_path('include') + if sys.platform == 'win32': + return sysconfig.get_path('include') + else: + return sysconfig.get_path('include', scheme="posix_prefix") def python_link_flags_qmake(): diff --git a/sources/shiboken6/cmake/ShibokenHelpers.cmake b/sources/shiboken6/cmake/ShibokenHelpers.cmake index 092afc787..5a807ccca 100644 --- a/sources/shiboken6/cmake/ShibokenHelpers.cmake +++ b/sources/shiboken6/cmake/ShibokenHelpers.cmake @@ -117,14 +117,21 @@ macro(shiboken_internal_set_python_site_packages) else() execute_process( COMMAND ${Python_EXECUTABLE} -c "if True: + import sys import sysconfig from os.path import sep # /home/qt/dev/env/lib/python3.9/site-packages - lib_path = sysconfig.get_path('purelib') + if sys.platform == 'win32': + lib_path = sysconfig.get_path('purelib') + else: + lib_path = sysconfig.get_path('purelib', scheme='posix_prefix') # /home/qt/dev/env - data_path = sysconfig.get_path('data') + if sys.platform == 'win32': + data_path = sysconfig.get_path('data') + else: + data_path = sysconfig.get_path('data', scheme='posix_prefix') # /lib/python3.9/site-packages rel_path = lib_path.replace(data_path, '') |