1 diff -urNp Python-3.8.7.org/Lib/distutils/command/install.py Python-3.8.7/Lib/distutils/command/install.py
2 --- Python-3.8.7.org/Lib/distutils/command/install.py 2020-12-21 17:25:24.000000000 +0100
3 +++ Python-3.8.7/Lib/distutils/command/install.py 2021-02-06 00:56:02.718897271 +0100
4 @@ -31,14 +31,14 @@ WINDOWS_SCHEME = {
8 - 'purelib': '$base/lib/python$py_version_short/site-packages',
9 + 'purelib': '$base/$platlibdir/python$py_version_short/site-packages',
10 'platlib': '$platbase/$platlibdir/python$py_version_short/site-packages',
11 'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
12 'scripts': '$base/bin',
16 - 'purelib': '$base/lib/python',
17 + 'purelib': '$base/$platlibdir/python',
18 'platlib': '$base/$platlibdir/python',
19 'headers': '$base/include/python/$dist_name',
20 'scripts': '$base/bin',
21 diff -urNp Python-3.8.7.org/Lib/distutils/sysconfig.py Python-3.8.7/Lib/distutils/sysconfig.py
22 --- Python-3.8.7.org/Lib/distutils/sysconfig.py 2020-12-21 17:25:24.000000000 +0100
23 +++ Python-3.8.7/Lib/distutils/sysconfig.py 2021-02-06 00:56:02.718897271 +0100
24 @@ -145,13 +145,13 @@ def get_python_lib(plat_specific=0, stan
25 prefix = plat_specific and EXEC_PREFIX or PREFIX
27 if os.name == "posix":
28 - if plat_specific or standard_lib:
29 + if plat_specific or standard_lib or prefix != "/usr":
30 # Platform-specific modules (any module from a non-pure-Python
31 # module distribution) or standard Python library modules.
32 libdir = sys.platlibdir
37 libpython = os.path.join(prefix, libdir,
38 "python" + get_python_version())
40 diff -urNp Python-3.8.7.org/Lib/distutils/tests/test_install.py Python-3.8.7/Lib/distutils/tests/test_install.py
41 --- Python-3.8.7.org/Lib/distutils/tests/test_install.py 2020-12-21 17:25:24.000000000 +0100
42 +++ Python-3.8.7/Lib/distutils/tests/test_install.py 2021-02-06 00:56:02.722230710 +0100
43 @@ -56,7 +56,7 @@ class InstallTestCase(support.TempdirMan
44 expected = os.path.normpath(expected)
45 self.assertEqual(got, expected)
47 - libdir = os.path.join(destination, "lib", "python")
48 + libdir = os.path.join(destination, sys.platlibdir, "python")
49 check_path(cmd.install_lib, libdir)
50 check_path(cmd.install_platlib, libdir)
51 check_path(cmd.install_purelib, libdir)
52 diff -urNp Python-3.8.7.org/Lib/site.py Python-3.8.7/Lib/site.py
53 --- Python-3.8.7.org/Lib/site.py 2020-12-21 17:25:24.000000000 +0100
54 +++ Python-3.8.7/Lib/site.py 2021-02-06 00:56:02.722230710 +0100
55 @@ -344,6 +344,8 @@ def getsitepackages(prefixes=None):
56 "python%d.%d" % sys.version_info[:2],
58 sitepackages.append(path)
59 + sitepackages.append(os.path.join(prefix, sys.platlibdir, "site-python"))
60 + sitepackages.append(os.path.join(prefix, "share", "python" + sys.version[:3], "site-packages"))
62 sitepackages.append(prefix)
64 diff -urNp Python-3.8.7.org/Lib/sysconfig.py Python-3.8.7/Lib/sysconfig.py
65 --- Python-3.8.7.org/Lib/sysconfig.py 2020-12-21 17:25:24.000000000 +0100
66 +++ Python-3.8.7/Lib/sysconfig.py 2021-02-06 00:56:02.722230710 +0100
67 @@ -22,7 +22,7 @@ _INSTALL_SCHEMES = {
69 'stdlib': '{installed_base}/{platlibdir}/python{py_version_short}',
70 'platstdlib': '{platbase}/{platlibdir}/python{py_version_short}',
71 - 'purelib': '{base}/lib/python{py_version_short}/site-packages',
72 + 'purelib': '{base}/{platlibdir}/python{py_version_short}/site-packages',
73 'platlib': '{platbase}/{platlibdir}/python{py_version_short}/site-packages',
75 '{installed_base}/include/python{py_version_short}{abiflags}',
76 @@ -32,10 +32,10 @@ _INSTALL_SCHEMES = {
80 - 'stdlib': '{installed_base}/lib/python',
81 - 'platstdlib': '{base}/lib/python',
82 - 'purelib': '{base}/lib/python',
83 - 'platlib': '{base}/lib/python',
84 + 'stdlib': '{installed_base}/{platlibdir}/python',
85 + 'platstdlib': '{base}/{platlibdir}/python',
86 + 'purelib': '{base}/{platlibdir}/python',
87 + 'platlib': '{base}/{platlibdir}/python',
88 'include': '{installed_base}/include/python',
89 'platinclude': '{installed_base}/include/python',
90 'scripts': '{base}/bin',
91 @@ -64,7 +64,7 @@ _INSTALL_SCHEMES = {
93 'stdlib': '{userbase}/{platlibdir}/python{py_version_short}',
94 'platstdlib': '{userbase}/{platlibdir}/python{py_version_short}',
95 - 'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
96 + 'purelib': '{userbase}/{platlibdir}/python{py_version_short}/site-packages',
97 'platlib': '{userbase}/{platlibdir}/python{py_version_short}/site-packages',
98 'include': '{userbase}/include/python{py_version_short}',
99 'scripts': '{userbase}/bin',
100 @@ -480,7 +480,11 @@ def get_config_h_filename():
102 inc_dir = _sys_home or _PROJECT_BASE
104 - inc_dir = get_path('platinclude')
105 + if hasattr(sys, 'abiflags'):
106 + config_dir_name = 'config-%s%s' % (_PY_VERSION_SHORT, sys.abiflags)
108 + config_dir_name = 'config'
109 + inc_dir = os.path.join(get_path('stdlib'), config_dir_name)
110 return os.path.join(inc_dir, 'pyconfig.h')
113 diff -urNp Python-3.8.7.org/Makefile.pre.in Python-3.8.7/Makefile.pre.in
114 --- Python-3.8.7.org/Makefile.pre.in 2020-12-21 17:25:24.000000000 +0100
115 +++ Python-3.8.7/Makefile.pre.in 2021-02-06 00:56:02.722230710 +0100
116 @@ -1560,9 +1562,9 @@ libainstall: @DEF_MAKE_RULE@ python-conf
117 @if test -d $(LIBRARY); then :; else \
118 if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
119 if test "$(SHLIB_SUFFIX)" = .dll; then \
120 - $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
121 + $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBDIR) ; \
123 - $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
124 + $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBDIR)/$(LIBRARY) ; \
127 echo Skip install of $(LIBRARY) - use make frameworkinstall; \
128 diff -urNp Python-3.8.7.org/setup.py Python-3.8.7/setup.py
129 --- Python-3.8.7.org/setup.py 2020-12-21 17:25:24.000000000 +0100
130 +++ Python-3.8.7/setup.py 2021-02-06 00:56:02.728897587 +0100
131 @@ -670,7 +670,7 @@ class PyBuildExt(build_ext):
132 add_dir_to_list(self.compiler.include_dirs,
133 sysconfig.get_config_var("INCLUDEDIR"))
135 - system_lib_dirs = ['/lib64', '/usr/lib64', '/lib', '/usr/lib']
136 + system_lib_dirs = ['/' + sys.platlibdir, '/usr/' + sys.platlibdir]
137 system_include_dirs = ['/usr/include']
138 # lib_dirs and inc_dirs are used to search for files;
139 # if a file is found in one of those directories, it can
140 @@ -953,11 +953,11 @@ class PyBuildExt(build_ext):
142 readline_libs.append(curses_library)
143 elif self.compiler.find_library_file(self.lib_dirs +
144 - ['/usr/lib/termcap'],
145 + ['/usr/' + sys.platlibdir + '/termcap'],
147 readline_libs.append('termcap')
148 self.add(Extension('readline', ['readline.c'],
149 - library_dirs=['/usr/lib/termcap'],
150 + library_dirs=['/usr/' + sys.platlibdir + '/termcap'],
151 extra_link_args=readline_extra_link_args,
152 libraries=readline_libs))