-
Notifications
You must be signed in to change notification settings - Fork 52
/
python3-multilib.patch
121 lines (115 loc) · 6.86 KB
/
python3-multilib.patch
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
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/{implementation_lower}/site-packages'
- return f'{userbase}/lib/python{version[0]}.{version[1]}{abi_thread}/site-packages'
+ return f'{userbase}/{sys.platlibdir}/python{version[0]}.{version[1]}{abi_thread}/site-packages'
def getuserbase():
@@ -408,6 +408,8 @@ def getsitepackages(prefixes=None):
f"{implementation}{ver[0]}.{ver[1]}{abi_thread}",
"site-packages")
sitepackages.append(path)
+ sitepackages.append(os.path.join(prefix, sys.platlibdir, "site-python"))
+ sitepackages.append(os.path.join(prefix, "share", f"{implementation}{ver[0]}.{ver[1]}{abi_thread}", "site-packages"))
else:
sitepackages.append(prefix)
sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
diff -urNp -x '*.orig' Python-3.9.2.org/Lib/sysconfig/__init__.py Python-3.9.2/Lib/sysconfig/__init__.py
--- Python-3.9.2.org/Lib/sysconfig/__init__.py 2021-02-19 13:31:44.000000000 +0100
+++ Python-3.9.2/Lib/sysconfig/__init__.py 2021-02-25 18:40:00.705652346 +0100
@@ -29,7 +29,7 @@ _INSTALL_SCHEMES = {
'posix_prefix': {
'stdlib': '{installed_base}/{platlibdir}/{implementation_lower}{py_version_short}{abi_thread}',
'platstdlib': '{platbase}/{platlibdir}/{implementation_lower}{py_version_short}{abi_thread}',
- 'purelib': '{base}/lib/{implementation_lower}{py_version_short}{abi_thread}/site-packages',
+ 'purelib': '{base}/share/{implementation_lower}{py_version_short}{abi_thread}/site-packages',
'platlib': '{platbase}/{platlibdir}/{implementation_lower}{py_version_short}{abi_thread}/site-packages',
'include':
'{installed_base}/include/{implementation_lower}{py_version_short}{abiflags}',
@@ -39,10 +39,10 @@ _INSTALL_SCHEMES = {
'data': '{base}',
},
'posix_home': {
- 'stdlib': '{installed_base}/lib/{implementation_lower}',
- 'platstdlib': '{base}/lib/{implementation_lower}',
- 'purelib': '{base}/lib/{implementation_lower}',
- 'platlib': '{base}/lib/{implementation_lower}',
+ 'stdlib': '{installed_base}/{platlibdir}/{implementation_lower}',
+ 'platstdlib': '{base}/{platlibdir}/{implementation_lower}',
+ 'purelib': '{base}/share/{implementation_lower}',
+ 'platlib': '{base}/{platlibdir}/{implementation_lower}',
'include': '{installed_base}/include/{implementation_lower}',
'platinclude': '{installed_base}/include/{implementation_lower}',
'scripts': '{base}/bin',
@@ -150,8 +150,8 @@ if _HAS_USER_BASE:
'posix_user': {
'stdlib': '{userbase}/{platlibdir}/{implementation_lower}{py_version_short}{abi_thread}',
'platstdlib': '{userbase}/{platlibdir}/{implementation_lower}{py_version_short}{abi_thread}',
- 'purelib': '{userbase}/lib/{implementation_lower}{py_version_short}{abi_thread}/site-packages',
- 'platlib': '{userbase}/lib/{implementation_lower}{py_version_short}{abi_thread}/site-packages',
+ 'purelib': '{userbase}/share/{implementation_lower}{py_version_short}{abi_thread}/site-packages',
+ 'platlib': '{userbase}/{platlibdir}/{implementation_lower}{py_version_short}{abi_thread}/site-packages',
'include': '{userbase}/include/{implementation_lower}{py_version_short}{abi_thread}',
'scripts': '{userbase}/bin',
'data': '{userbase}',
@@ -490,7 +490,11 @@ def get_config_h_filename():
else:
inc_dir = _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; \
--- 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
@@ -414,13 +414,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_abi = sysconfig._get_python_version_abi()
suffix = f'python{py_version_abi}/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
@@ -145,10 +145,9 @@ class EnvBuilder:
create_if_needed(incpath)
context.lib_path = libpath
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<qual> 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