diff -urNp -x '*.orig' Python-3.9.2.org/Lib/distutils/command/install.py Python-3.9.2/Lib/distutils/command/install.py --- Python-3.9.2.org/Lib/distutils/command/install.py 2021-02-19 13:31:44.000000000 +0100 +++ Python-3.9.2/Lib/distutils/command/install.py 2021-02-25 18:40:00.705652346 +0100 @@ -29,14 +29,14 @@ WINDOWS_SCHEME = { INSTALL_SCHEMES = { 'unix_prefix': { - 'purelib': '$base/lib/python$py_version_short/site-packages', + 'purelib': '$base/$platlibdir/python$py_version_short/site-packages', 'platlib': '$platbase/$platlibdir/python$py_version_short/site-packages', 'headers': '$base/include/python$py_version_short$abiflags/$dist_name', 'scripts': '$base/bin', 'data' : '$base', }, 'unix_home': { - 'purelib': '$base/lib/python', + 'purelib': '$base/$platlibdir/python', 'platlib': '$base/$platlibdir/python', 'headers': '$base/include/python/$dist_name', 'scripts': '$base/bin', 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 @@ -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" + sys.version[:3], "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 @@ _INSTALL_SCHEMES = { '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}/{platlibdir}/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}/{platlibdir}/python', + 'platlib': '{base}/{platlibdir}/python', 'include': '{installed_base}/include/python', 'platinclude': '{installed_base}/include/python', 'scripts': '{base}/bin', @@ -69,7 +69,7 @@ _INSTALL_SCHEMES = { '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', + 'purelib': '{userbase}/{platlibdir}/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', @@ -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') diff -urNp -x '*.orig' Python-3.9.2.org/Makefile.pre.in Python-3.9.2/Makefile.pre.in --- Python-3.9.2.org/Makefile.pre.in 2021-02-19 13:31:44.000000000 +0100 +++ Python-3.9.2/Makefile.pre.in 2021-02-25 18:40:00.705652346 +0100 @@ -1634,9 +1634,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: