forked from pld-linux/python3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython3-multilib.patch
More file actions
162 lines (152 loc) · 8.52 KB
/
python3-multilib.patch
File metadata and controls
162 lines (152 loc) · 8.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
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):