diff -urNp -x '*.orig' Python-3.9.2.org/Lib/distutils/sysconfig.py Python-3.9.2/Lib/distutils/sysconfig.py --- Python-3.9.2.org/Lib/distutils/sysconfig.py 2021-02-19 13:31:44.000000000 +0100 +++ Python-3.9.2/Lib/distutils/sysconfig.py 2021-02-25 18:40:00.705652346 +0100 @@ -145,13 +145,13 @@ def get_python_lib(plat_specific=0, stan prefix = plat_specific and EXEC_PREFIX or PREFIX if os.name == "posix": - if plat_specific or standard_lib: + if plat_specific or standard_lib or prefix != "/usr": # Platform-specific modules (any module from a non-pure-Python # module distribution) or standard Python library modules. libdir = sys.platlibdir else: # Pure Python - libdir = "lib" + libdir = "share" libpython = os.path.join(prefix, libdir, "python" + get_python_version()) if standard_lib: diff -urNp -x '*.orig' Python-3.9.2.org/Lib/distutils/tests/test_install.py Python-3.9.2/Lib/distutils/tests/test_install.py --- Python-3.9.2.org/Lib/distutils/tests/test_install.py 2021-02-19 13:31:44.000000000 +0100 +++ Python-3.9.2/Lib/distutils/tests/test_install.py 2021-02-25 18:40:00.705652346 +0100 @@ -56,7 +56,7 @@ class InstallTestCase(support.TempdirMan expected = os.path.normpath(expected) self.assertEqual(got, expected) - libdir = os.path.join(destination, "lib", "python") + libdir = os.path.join(destination, sys.platlibdir, "python") check_path(cmd.install_lib, libdir) platlibdir = os.path.join(destination, sys.platlibdir, "python") check_path(cmd.install_platlib, platlibdir) diff -urNp -x '*.orig' Python-3.9.2.org/Lib/site.py Python-3.9.2/Lib/site.py --- Python-3.9.2.org/Lib/site.py 2021-02-19 13:31:44.000000000 +0100 +++ Python-3.9.2/Lib/site.py 2021-02-25 18:40:00.705652346 +0100 @@ -295,7 +295,7 @@ if sys.platform == 'darwin' and sys._framework: return f'{userbase}/lib/python/site-packages' - return f'{userbase}/lib/python{version[0]}.{version[1]}/site-packages' + return f'{userbase}/{sys.platlibdir}/python{version[0]}.{version[1]}/site-packages' def getuserbase(): @@ -344,6 +344,8 @@ def getsitepackages(prefixes=None): "python%d.%d" % sys.version_info[:2], "site-packages") sitepackages.append(path) + sitepackages.append(os.path.join(prefix, sys.platlibdir, "site-python")) + sitepackages.append(os.path.join(prefix, "share", "python%d.%d" % sys.version_info[:2], "site-packages")) else: sitepackages.append(prefix) diff -urNp -x '*.orig' Python-3.9.2.org/Lib/sysconfig.py Python-3.9.2/Lib/sysconfig.py --- Python-3.9.2.org/Lib/sysconfig.py 2021-02-19 13:31:44.000000000 +0100 +++ Python-3.9.2/Lib/sysconfig.py 2021-02-25 18:40:00.705652346 +0100 @@ -27,7 +27,7 @@ 'posix_prefix': { 'stdlib': '{installed_base}/{platlibdir}/python{py_version_short}', 'platstdlib': '{platbase}/{platlibdir}/python{py_version_short}', - 'purelib': '{base}/lib/python{py_version_short}/site-packages', + 'purelib': '{base}/share/python{py_version_short}/site-packages', 'platlib': '{platbase}/{platlibdir}/python{py_version_short}/site-packages', 'include': '{installed_base}/include/python{py_version_short}{abiflags}', @@ -37,10 +37,10 @@ _INSTALL_SCHEMES = { 'data': '{base}', }, 'posix_home': { - 'stdlib': '{installed_base}/lib/python', - 'platstdlib': '{base}/lib/python', - 'purelib': '{base}/lib/python', - 'platlib': '{base}/lib/python', + 'stdlib': '{installed_base}/{platlibdir}/python', + 'platstdlib': '{base}/{platlibdir}/python', + 'purelib': '{base}/share/python', + 'platlib': '{base}/{platlibdir}/python', 'include': '{installed_base}/include/python', 'platinclude': '{installed_base}/include/python', 'scripts': '{base}/bin', @@ -100,8 +100,8 @@ if _HAS_USER_BASE: 'posix_user': { 'stdlib': '{userbase}/{platlibdir}/python{py_version_short}', 'platstdlib': '{userbase}/{platlibdir}/python{py_version_short}', - 'purelib': '{userbase}/lib/python{py_version_short}/site-packages', - 'platlib': '{userbase}/lib/python{py_version_short}/site-packages', + 'purelib': '{userbase}/share/python{py_version_short}/site-packages', + 'platlib': '{userbase}/{platlibdir}/python{py_version_short}/site-packages', 'include': '{userbase}/include/python{py_version_short}', 'scripts': '{userbase}/bin', 'data': '{userbase}', @@ -490,7 +490,11 @@ def get_config_h_filename(): else: inc_dir = _sys_home or _PROJECT_BASE else: - inc_dir = get_path('platinclude') + if hasattr(sys, 'abiflags'): + config_dir_name = 'config-%s%s' % (_PY_VERSION_SHORT, sys.abiflags) + else: + config_dir_name = 'config' + inc_dir = os.path.join(get_path('stdlib'), config_dir_name) return os.path.join(inc_dir, 'pyconfig.h') --- Python-3.10.0/Makefile.pre.in~ 2021-10-04 19:40:46.000000000 +0200 +++ Python-3.10.0/Makefile.pre.in 2021-10-20 22:21:30.573156183 +0200 @@ -1707,9 +1707,9 @@ libainstall: @DEF_MAKE_RULE@ python-conf if test -d $(LIBRARY); then :; else \ if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \ if test "$(SHLIB_SUFFIX)" = .dll; then \ - $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \ + $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBDIR) ; \ else \ - $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \ + $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBDIR)/$(LIBRARY) ; \ fi; \ else \ echo Skip install of $(LIBRARY) - use make frameworkinstall; \ diff -urNp -x '*.orig' Python-3.9.2.org/setup.py Python-3.9.2/setup.py --- Python-3.9.2.org/setup.py 2021-02-19 13:31:44.000000000 +0100 +++ Python-3.9.2/setup.py 2021-02-25 18:40:00.708985783 +0100 @@ -750,7 +750,7 @@ class PyBuildExt(build_ext): add_dir_to_list(self.compiler.include_dirs, sysconfig.get_config_var("INCLUDEDIR")) - system_lib_dirs = ['/lib64', '/usr/lib64', '/lib', '/usr/lib'] + system_lib_dirs = ['/' + sys.platlibdir, '/usr/' + sys.platlibdir] system_include_dirs = ['/usr/include'] # lib_dirs and inc_dirs are used to search for files; # if a file is found in one of those directories, it can @@ -1039,11 +1039,11 @@ class PyBuildExt(build_ext): elif curses_library: readline_libs.append(curses_library) elif self.compiler.find_library_file(self.lib_dirs + - ['/usr/lib/termcap'], + ['/usr/' + sys.platlibdir + '/termcap'], 'termcap'): readline_libs.append('termcap') self.add(Extension('readline', ['readline.c'], - library_dirs=['/usr/lib/termcap'], + library_dirs=['/usr/' + sys.platlibdir + '/termcap'], extra_link_args=readline_extra_link_args, libraries=readline_libs)) else: --- Python-3.10.6/Lib/test/test_sysconfig.py.orig 2022-08-22 06:15:16.895139554 +0200 +++ Python-3.10.6/Lib/test/test_sysconfig.py 2022-08-22 06:18:57.331178879 +0200 @@ -299,13 +299,13 @@ class TestSysConfig(unittest.TestCase): expected = os.path.normpath(global_path.replace(base, user, 1)) # bpo-44860: platlib of posix_user doesn't use sys.platlibdir, # whereas posix_prefix does. - if name == 'platlib': + if name != 'platlib': # Replace "/lib64/python3.11/site-packages" suffix # with "/lib/python3.11/site-packages". py_version_short = sysconfig.get_python_version() suffix = f'python{py_version_short}/site-packages' - expected = expected.replace(f'/{sys.platlibdir}/{suffix}', - f'/lib/{suffix}') + expected = expected.replace(f'/lib/{suffix}', + f'/{sys.platlibdir}/{suffix}') self.assertEqual(user_path, expected) def test_main(self): --- Python-3.10.13/Lib/venv/__init__.py.orig 2023-08-24 14:46:25.000000000 +0200 +++ Python-3.10.13/Lib/venv/__init__.py 2023-09-23 12:30:09.948046280 +0200 @@ -137,10 +137,9 @@ class EnvBuilder: context.inc_path = path = os.path.join(env_dir, incpath) create_if_needed(path) create_if_needed(libpath) - # Issue 21197: create lib64 as a symlink to lib on 64-bit non-OS X POSIX - if ((sys.maxsize > 2**32) and (os.name == 'posix') and - (sys.platform != 'darwin')): - link_path = os.path.join(env_dir, 'lib64') + # Issue 21197: create lib as a symlink to lib on 64-bit non-OS X POSIX + if sys.platlibdir != 'lib': + link_path = os.path.join(env_dir, sys.platlibdir) if not os.path.exists(link_path): # Issue #21643 os.symlink('lib', link_path) context.bin_path = binpath = os.path.join(env_dir, binname)