]> git.pld-linux.org Git - packages/python3.git/blame - python3-multilib.patch
- purelib: directory for non-platform-specific files, rel 5
[packages/python3.git] / python3-multilib.patch
CommitLineData
b10abc3a
AM
1diff -urNp -x '*.orig' Python-3.9.2.org/Lib/distutils/sysconfig.py Python-3.9.2/Lib/distutils/sysconfig.py
2--- Python-3.9.2.org/Lib/distutils/sysconfig.py 2021-02-19 13:31:44.000000000 +0100
3+++ Python-3.9.2/Lib/distutils/sysconfig.py 2021-02-25 18:40:00.705652346 +0100
520f15b4 4@@ -145,13 +145,13 @@ def get_python_lib(plat_specific=0, stan
ea93f05f 5 prefix = plat_specific and EXEC_PREFIX or PREFIX
e684db95
AM
6
7 if os.name == "posix":
520f15b4 8- if plat_specific or standard_lib:
49e8feb6 9+ if plat_specific or standard_lib or prefix != "/usr":
520f15b4
AM
10 # Platform-specific modules (any module from a non-pure-Python
11 # module distribution) or standard Python library modules.
12 libdir = sys.platlibdir
e684db95 13 else:
520f15b4
AM
14 # Pure Python
15- libdir = "lib"
16+ libdir = "share"
17 libpython = os.path.join(prefix, libdir,
18 "python" + get_python_version())
19 if standard_lib:
b10abc3a
AM
20diff -urNp -x '*.orig' Python-3.9.2.org/Lib/distutils/tests/test_install.py Python-3.9.2/Lib/distutils/tests/test_install.py
21--- Python-3.9.2.org/Lib/distutils/tests/test_install.py 2021-02-19 13:31:44.000000000 +0100
22+++ Python-3.9.2/Lib/distutils/tests/test_install.py 2021-02-25 18:40:00.705652346 +0100
520f15b4 23@@ -56,7 +56,7 @@ class InstallTestCase(support.TempdirMan
ea93f05f 24 expected = os.path.normpath(expected)
e684db95
AM
25 self.assertEqual(got, expected)
26
ea93f05f 27- libdir = os.path.join(destination, "lib", "python")
520f15b4 28+ libdir = os.path.join(destination, sys.platlibdir, "python")
e684db95 29 check_path(cmd.install_lib, libdir)
b10abc3a
AM
30 platlibdir = os.path.join(destination, sys.platlibdir, "python")
31 check_path(cmd.install_platlib, platlibdir)
32diff -urNp -x '*.orig' Python-3.9.2.org/Lib/site.py Python-3.9.2/Lib/site.py
33--- Python-3.9.2.org/Lib/site.py 2021-02-19 13:31:44.000000000 +0100
34+++ Python-3.9.2/Lib/site.py 2021-02-25 18:40:00.705652346 +0100
91530447
JR
35@@ -295,7 +295,7 @@
36 if sys.platform == 'darwin' and sys._framework:
37 return f'{userbase}/lib/python/site-packages'
38
39- return f'{userbase}/lib/python{version[0]}.{version[1]}/site-packages'
40+ return f'{userbase}/{sys.platlibdir}/python{version[0]}.{version[1]}/site-packages'
41
42
43 def getuserbase():
520f15b4
AM
44@@ -344,6 +344,8 @@ def getsitepackages(prefixes=None):
45 "python%d.%d" % sys.version_info[:2],
46 "site-packages")
47 sitepackages.append(path)
48+ sitepackages.append(os.path.join(prefix, sys.platlibdir, "site-python"))
96303402 49+ sitepackages.append(os.path.join(prefix, "share", "python%d.%d" % sys.version_info[:2], "site-packages"))
04df829f 50 else:
e3852288 51 sitepackages.append(prefix)
75257062 52
b10abc3a
AM
53diff -urNp -x '*.orig' Python-3.9.2.org/Lib/sysconfig.py Python-3.9.2/Lib/sysconfig.py
54--- Python-3.9.2.org/Lib/sysconfig.py 2021-02-19 13:31:44.000000000 +0100
55+++ Python-3.9.2/Lib/sysconfig.py 2021-02-25 18:40:00.705652346 +0100
4b802a49
JR
56@@ -27,7 +27,7 @@
57 'posix_prefix': {
58 'stdlib': '{installed_base}/{platlibdir}/python{py_version_short}',
59 'platstdlib': '{platbase}/{platlibdir}/python{py_version_short}',
60- 'purelib': '{base}/lib/python{py_version_short}/site-packages',
b852622f 61+ 'purelib': '{base}/share/python{py_version_short}/site-packages',
4b802a49
JR
62 'platlib': '{platbase}/{platlibdir}/python{py_version_short}/site-packages',
63 'include':
64 '{installed_base}/include/python{py_version_short}{abiflags}',
b10abc3a 65@@ -37,10 +37,10 @@ _INSTALL_SCHEMES = {
75257062 66 'data': '{base}',
67 },
68 'posix_home': {
b88f500a 69- 'stdlib': '{installed_base}/lib/python',
75257062 70- 'platstdlib': '{base}/lib/python',
ea93f05f
JK
71- 'purelib': '{base}/lib/python',
72- 'platlib': '{base}/lib/python',
520f15b4
AM
73+ 'stdlib': '{installed_base}/{platlibdir}/python',
74+ 'platstdlib': '{base}/{platlibdir}/python',
b852622f 75+ 'purelib': '{base}/share/python',
520f15b4 76+ 'platlib': '{base}/{platlibdir}/python',
b88f500a
AM
77 'include': '{installed_base}/include/python',
78 'platinclude': '{installed_base}/include/python',
75257062 79 'scripts': '{base}/bin',
8d01f992
AM
80@@ -100,8 +100,8 @@ if _HAS_USER_BASE:
81 'posix_user': {
82 'stdlib': '{userbase}/{platlibdir}/python{py_version_short}',
83 'platstdlib': '{userbase}/{platlibdir}/python{py_version_short}',
84- 'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
85- 'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
b852622f 86+ 'purelib': '{userbase}/share/python{py_version_short}/site-packages',
8d01f992
AM
87+ 'platlib': '{userbase}/{platlibdir}/python{py_version_short}/site-packages',
88 'include': '{userbase}/include/python{py_version_short}',
89 'scripts': '{userbase}/bin',
90 'data': '{userbase}',
b10abc3a 91@@ -490,7 +490,11 @@ def get_config_h_filename():
a033b415
JK
92 else:
93 inc_dir = _sys_home or _PROJECT_BASE
94 else:
95- inc_dir = get_path('platinclude')
96+ if hasattr(sys, 'abiflags'):
97+ config_dir_name = 'config-%s%s' % (_PY_VERSION_SHORT, sys.abiflags)
98+ else:
99+ config_dir_name = 'config'
100+ inc_dir = os.path.join(get_path('stdlib'), config_dir_name)
101 return os.path.join(inc_dir, 'pyconfig.h')
102
8d01f992
AM
103
104--- Python-3.10.0/Makefile.pre.in~ 2021-10-04 19:40:46.000000000 +0200
105+++ Python-3.10.0/Makefile.pre.in 2021-10-20 22:21:30.573156183 +0200
106@@ -1707,9 +1707,9 @@ libainstall: @DEF_MAKE_RULE@ python-conf
107 if test -d $(LIBRARY); then :; else \
108 if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
109 if test "$(SHLIB_SUFFIX)" = .dll; then \
110- $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
111+ $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBDIR) ; \
112 else \
113- $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
114+ $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBDIR)/$(LIBRARY) ; \
115 fi; \
ea93f05f 116 else \
8d01f992 117 echo Skip install of $(LIBRARY) - use make frameworkinstall; \
b10abc3a
AM
118diff -urNp -x '*.orig' Python-3.9.2.org/setup.py Python-3.9.2/setup.py
119--- Python-3.9.2.org/setup.py 2021-02-19 13:31:44.000000000 +0100
120+++ Python-3.9.2/setup.py 2021-02-25 18:40:00.708985783 +0100
121@@ -750,7 +750,7 @@ class PyBuildExt(build_ext):
380ee8da
AM
122 add_dir_to_list(self.compiler.include_dirs,
123 sysconfig.get_config_var("INCLUDEDIR"))
124
125- system_lib_dirs = ['/lib64', '/usr/lib64', '/lib', '/usr/lib']
520f15b4 126+ system_lib_dirs = ['/' + sys.platlibdir, '/usr/' + sys.platlibdir]
380ee8da
AM
127 system_include_dirs = ['/usr/include']
128 # lib_dirs and inc_dirs are used to search for files;
129 # if a file is found in one of those directories, it can
b10abc3a 130@@ -1039,11 +1039,11 @@ class PyBuildExt(build_ext):
e3852288
JB
131 elif curses_library:
132 readline_libs.append(curses_library)
3e35963a 133 elif self.compiler.find_library_file(self.lib_dirs +
e3852288 134- ['/usr/lib/termcap'],
520f15b4 135+ ['/usr/' + sys.platlibdir + '/termcap'],
e3852288 136 'termcap'):
e684db95 137 readline_libs.append('termcap')
3e35963a
AM
138 self.add(Extension('readline', ['readline.c'],
139- library_dirs=['/usr/lib/termcap'],
520f15b4 140+ library_dirs=['/usr/' + sys.platlibdir + '/termcap'],
3e35963a
AM
141 extra_link_args=readline_extra_link_args,
142 libraries=readline_libs))
e3852288 143 else:
91530447
JR
144--- Python-3.10.3/Lib/test/test_sysconfig.py~ 2022-03-16 12:27:11.000000000 +0100
145+++ Python-3.10.3/Lib/test/test_sysconfig.py 2022-03-22 23:11:16.335919644 +0100
146@@ -299,13 +299,13 @@
147 expected = global_path.replace(base, user, 1)
148 # bpo-44860: platlib of posix_user doesn't use sys.platlibdir,
149 # whereas posix_prefix does.
150- if name == 'platlib':
151+ if name != 'platlib':
152 # Replace "/lib64/python3.11/site-packages" suffix
153 # with "/lib/python3.11/site-packages".
154 py_version_short = sysconfig.get_python_version()
155 suffix = f'python{py_version_short}/site-packages'
156- expected = expected.replace(f'/{sys.platlibdir}/{suffix}',
157- f'/lib/{suffix}')
158+ expected = expected.replace(f'/lib/{suffix}',
159+ f'/{sys.platlibdir}/{suffix}')
160 self.assertEqual(user_path, expected)
161
162 def test_main(self):
This page took 0.109824 seconds and 4 git commands to generate.