]> git.pld-linux.org Git - packages/python3.git/blame - python3-multilib.patch
- update to 3.8.0
[packages/python3.git] / python3-multilib.patch
CommitLineData
c7fcbc4e 1diff -dur Python-3.5.0.orig/Include/pylifecycle.h Python-3.5.0/Include/pylifecycle.h
ea93f05f 2--- Python-3.5.0.orig/Include/pylifecycle.h 2015-09-13 13:41:20.000000000 +0200
c7fcbc4e 3+++ Python-3.5.0/Include/pylifecycle.h 2015-12-03 17:31:03.874280444 +0100
ea93f05f 4@@ -65,6 +65,8 @@
e684db95
AM
5 /* In their own files */
6 PyAPI_FUNC(const char *) Py_GetVersion(void);
7 PyAPI_FUNC(const char *) Py_GetPlatform(void);
8+PyAPI_FUNC(const char *) Py_GetArch(void);
9+PyAPI_FUNC(const char *) Py_GetLib(void);
10 PyAPI_FUNC(const char *) Py_GetCopyright(void);
11 PyAPI_FUNC(const char *) Py_GetCompiler(void);
12 PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
c7fcbc4e 13diff -dur Python-3.5.0.orig/Lib/distutils/command/install.py Python-3.5.0/Lib/distutils/command/install.py
ea93f05f 14--- Python-3.5.0.orig/Lib/distutils/command/install.py 2015-09-13 13:41:20.000000000 +0200
c7fcbc4e 15+++ Python-3.5.0/Lib/distutils/command/install.py 2015-12-03 17:31:03.874280444 +0100
ea93f05f 16@@ -19,6 +19,8 @@
38874ce8
AM
17 from site import USER_SITE
18 HAS_USER_SITE = True
e684db95
AM
19
20+libname = sys.lib
21+
38874ce8
AM
22 WINDOWS_SCHEME = {
23 'purelib': '$base/Lib/site-packages',
24 'platlib': '$base/Lib/site-packages',
ea93f05f
JK
25@@ -29,15 +31,15 @@
26
e684db95
AM
27 INSTALL_SCHEMES = {
28 'unix_prefix': {
ea93f05f 29- 'purelib': '$base/lib/python$py_version_short/site-packages',
e684db95 30- 'platlib': '$platbase/lib/python$py_version_short/site-packages',
ea93f05f 31+ 'purelib': '$base/'+libname+'/python$py_version_short/site-packages',
e684db95 32+ 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages',
e3852288 33 'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
e684db95
AM
34 'scripts': '$base/bin',
35 'data' : '$base',
36 },
37 'unix_home': {
ea93f05f 38- 'purelib': '$base/lib/python',
e684db95 39- 'platlib': '$base/lib/python',
ea93f05f 40+ 'purelib': '$base/'+libname+'/python',
e684db95
AM
41+ 'platlib': '$base/'+libname+'/python',
42 'headers': '$base/include/python/$dist_name',
43 'scripts': '$base/bin',
44 'data' : '$base',
c7fcbc4e 45diff -dur Python-3.5.0.orig/Lib/distutils/sysconfig.py Python-3.5.0/Lib/distutils/sysconfig.py
ea93f05f 46--- Python-3.5.0.orig/Lib/distutils/sysconfig.py 2015-09-13 13:41:21.000000000 +0200
c7fcbc4e 47+++ Python-3.5.0/Lib/distutils/sysconfig.py 2015-12-03 17:31:03.874280444 +0100
ea93f05f
JK
48@@ -132,8 +132,12 @@
49 prefix = plat_specific and EXEC_PREFIX or PREFIX
e684db95
AM
50
51 if os.name == "posix":
52+ if plat_specific:
53+ lib = sys.lib
54+ else:
f69d2153 55+ lib = 'share'
e684db95
AM
56 libpython = os.path.join(prefix,
57- "lib", "python" + get_python_version())
58+ lib, "python" + get_python_version())
59 if standard_lib:
60 return libpython
61 else:
c7fcbc4e 62diff -dur Python-3.5.0.orig/Lib/distutils/tests/test_install.py Python-3.5.0/Lib/distutils/tests/test_install.py
ea93f05f 63--- Python-3.5.0.orig/Lib/distutils/tests/test_install.py 2015-09-13 13:41:21.000000000 +0200
c7fcbc4e 64+++ Python-3.5.0/Lib/distutils/tests/test_install.py 2015-12-03 17:31:03.874280444 +0100
ea93f05f
JK
65@@ -55,7 +55,7 @@
66 expected = os.path.normpath(expected)
e684db95
AM
67 self.assertEqual(got, expected)
68
ea93f05f
JK
69- libdir = os.path.join(destination, "lib", "python")
70+ libdir = os.path.join(destination, sys.lib, "python")
e684db95 71 check_path(cmd.install_lib, libdir)
ea93f05f 72 check_path(cmd.install_platlib, libdir)
e684db95 73 check_path(cmd.install_purelib, libdir)
c7fcbc4e 74diff -dur Python-3.5.0.orig/Lib/site.py Python-3.5.0/Lib/site.py
ea93f05f 75--- Python-3.5.0.orig/Lib/site.py 2015-09-13 13:41:21.000000000 +0200
c7fcbc4e 76+++ Python-3.5.0/Lib/site.py 2015-12-03 17:31:03.874280444 +0100
514c1496 77@@ -334,12 +334,14 @@ def getsitepackages(prefixes=None):
38874ce8
AM
78 seen.add(prefix)
79
80 if os.sep == '/':
e3852288
JB
81- sitepackages.append(os.path.join(prefix, "lib",
82+ sitepackages.append(os.path.join(prefix, sys.lib,
80febf2a 83 "python%d.%d" % sys.version_info[:2],
04df829f 84 "site-packages"))
e3852288 85+ sitepackages.append(os.path.join(prefix, sys.lib, "site-python"))
ea93f05f 86+ sitepackages.append(os.path.join(prefix, "share", "python" + sys.version[:3], "site-packages"))
04df829f 87 else:
e3852288
JB
88 sitepackages.append(prefix)
89- sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
90+ sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
514c1496
AM
91 return sitepackages
92
93 def addsitepackages(known_paths, prefixes=None):
c7fcbc4e 94diff -dur Python-3.5.0.orig/Lib/sysconfig.py Python-3.5.0/Lib/sysconfig.py
ea93f05f 95--- Python-3.5.0.orig/Lib/sysconfig.py 2015-09-13 13:41:21.000000000 +0200
c7fcbc4e 96+++ Python-3.5.0/Lib/sysconfig.py 2015-12-03 17:31:51.974741432 +0100
ea93f05f 97@@ -20,10 +20,10 @@
75257062 98
99 _INSTALL_SCHEMES = {
100 'posix_prefix': {
b88f500a 101- 'stdlib': '{installed_base}/lib/python{py_version_short}',
75257062 102- 'platstdlib': '{platbase}/lib/python{py_version_short}',
ea93f05f
JK
103- 'purelib': '{base}/lib/python{py_version_short}/site-packages',
104- 'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
b88f500a 105+ 'stdlib': '{installed_base}/' + sys.lib + '/python{py_version_short}',
75257062 106+ 'platstdlib': '{platbase}/' + sys.lib + '/python{py_version_short}',
ea93f05f 107+ 'purelib': '{base}/' + sys.lib + '/python{py_version_short}/site-packages',
75257062 108+ 'platlib': '{platbase}/' + sys.lib + '/python{py_version_short}/site-packages',
109 'include':
b88f500a 110 '{installed_base}/include/python{py_version_short}{abiflags}',
75257062 111 'platinclude':
ea93f05f 112@@ -32,10 +32,10 @@
75257062 113 'data': '{base}',
114 },
115 'posix_home': {
b88f500a 116- 'stdlib': '{installed_base}/lib/python',
75257062 117- 'platstdlib': '{base}/lib/python',
ea93f05f
JK
118- 'purelib': '{base}/lib/python',
119- 'platlib': '{base}/lib/python',
b88f500a 120+ 'stdlib': '{installed_base}/' + sys.lib + '/python',
b9c7955e 121+ 'platstdlib': '{base}/' + sys.lib + '/python',
ea93f05f 122+ 'purelib': '{base}/' + sys.lib + '/python',
75257062 123+ 'platlib': '{base}/' + sys.lib + '/python',
b88f500a
AM
124 'include': '{installed_base}/include/python',
125 'platinclude': '{installed_base}/include/python',
75257062 126 'scripts': '{base}/bin',
c7fcbc4e
JK
127@@ -61,10 +61,10 @@
128 'data': '{userbase}',
129 },
130 'posix_user': {
131- 'stdlib': '{userbase}/lib/python{py_version_short}',
132- 'platstdlib': '{userbase}/lib/python{py_version_short}',
133- 'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
134- 'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
135+ 'stdlib': '{userbase}/' + sys.lib + '/python{py_version_short}',
136+ 'platstdlib': '{userbase}/' + sys.lib + '/python{py_version_short}',
137+ 'purelib': '{userbase}/' + sys.lib + '/python{py_version_short}/site-packages',
138+ 'platlib': '{userbase}/' + sys.lib + '/python{py_version_short}/site-packages',
139 'include': '{userbase}/include/python{py_version_short}',
140 'scripts': '{userbase}/bin',
141 'data': '{userbase}',
a033b415
JK
142@@ -459,7 +459,11 @@
143 else:
144 inc_dir = _sys_home or _PROJECT_BASE
145 else:
146- inc_dir = get_path('platinclude')
147+ if hasattr(sys, 'abiflags'):
148+ config_dir_name = 'config-%s%s' % (_PY_VERSION_SHORT, sys.abiflags)
149+ else:
150+ config_dir_name = 'config'
151+ inc_dir = os.path.join(get_path('stdlib'), config_dir_name)
152 return os.path.join(inc_dir, 'pyconfig.h')
153
154
c7fcbc4e 155diff -dur Python-3.5.0.orig/Makefile.pre.in Python-3.5.0/Makefile.pre.in
ea93f05f 156--- Python-3.5.0.orig/Makefile.pre.in 2015-09-13 13:41:23.000000000 +0200
c7fcbc4e 157+++ Python-3.5.0/Makefile.pre.in 2015-12-03 17:31:03.874280444 +0100
ea93f05f 158@@ -101,6 +101,8 @@
e684db95
AM
159
160 # Machine-dependent subdirectories
161 MACHDEP= @MACHDEP@
162+LIB= @LIB@
163+ARCH= @ARCH@
164
ea93f05f
JK
165 # Multiarch directory (may be empty)
166 MULTIARCH= @MULTIARCH@
167@@ -120,7 +122,7 @@
e684db95
AM
168 MANDIR= @mandir@
169 INCLUDEDIR= @includedir@
170 CONFINCLUDEDIR= $(exec_prefix)/include
171-SCRIPTDIR= $(prefix)/lib
172+SCRIPTDIR= $(prefix)/$(LIB)
e3852288 173 ABIFLAGS= @ABIFLAGS@
e684db95
AM
174
175 # Detailed destination directories
ea93f05f 176@@ -796,7 +798,7 @@
e3852288 177 Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H)
e684db95
AM
178
179 Python/getplatform.o: $(srcdir)/Python/getplatform.c
e3852288
JB
180- $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
181+ $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
e684db95
AM
182
183 Python/importdl.o: $(srcdir)/Python/importdl.c
e3852288 184 $(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
514c1496
AM
185@@ -1470,9 +1470,9 @@ libainstall: @DEF_MAKE_RULE@ python-conf
186 @if test -d $(LIBRARY); then :; else \
187 if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
ea93f05f 188 if test "$(SHLIB_SUFFIX)" = .dll; then \
514c1496
AM
189- $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
190+ $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBDIR) ; \
ea93f05f
JK
191 else \
192- $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
ea93f05f 193+ $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBDIR)/$(LIBRARY) ; \
ea93f05f
JK
194 fi; \
195 else \
196 echo Skip install of $(LIBRARY) - use make frameworkinstall; \
c7fcbc4e 197diff -dur Python-3.5.0.orig/Modules/getpath.c Python-3.5.0/Modules/getpath.c
ea93f05f 198--- Python-3.5.0.orig/Modules/getpath.c 2015-09-13 13:41:24.000000000 +0200
c7fcbc4e 199+++ Python-3.5.0/Modules/getpath.c 2015-12-03 17:31:03.874280444 +0100
1e9d9e53
AM
200@@ -100,6 +100,17 @@
201 extern "C" {
e684db95
AM
202 #endif
203
204+#ifndef LIB_PYTHON
205+#if defined(__x86_64__) || (defined(__sparc__) && defined(__arch64__)) || defined(__powerpc64__) || defined(__s390x__)
58274b36
JR
206+#if defined(__ILP32__)
207+#define LIB_PYTHON "libx32/python"
208+#else
38874ce8 209+#define LIB_PYTHON "lib64/python"
58274b36 210+#endif
e684db95 211+#else
38874ce8 212+#define LIB_PYTHON "lib/python"
e684db95
AM
213+#endif
214+#endif
e684db95 215
1e9d9e53
AM
216 #if !defined(PREFIX) || !defined(EXEC_PREFIX) || !defined(VERSION) || !defined(VPATH)
217 #error "PREFIX, EXEC_PREFIX, VERSION, and VPATH must be constant defined"
3e35963a
AM
218@@ -1078,7 +1078,7 @@ calculate_zip_path(PyCalculatePath *calc
219 return PATHLEN_ERR();
220 }
221 }
222- status = joinpath(zip_path, L"lib/python00.zip", zip_path_len);
223+ status = joinpath(zip_path, L"" LIB_PYTHON "00.zip", zip_path_len);
224 if (_PyStatus_EXCEPTION(status)) {
225 return status;
514c1496 226 }
514c1496
AM
227@@ -878,7 +878,7 @@ calculate_init(PyCalculatePath *calculat
228 if (!calculate->prefix) {
229 return DECODE_LOCALE_ERR("EXEC_PREFIX define", len);
230 }
231- calculate->lib_python = Py_DecodeLocale("lib/python" VERSION, &len);
232+ calculate->lib_python = Py_DecodeLocale(LIB_PYTHON VERSION, &len);
233 if (!calculate->lib_python) {
234 return DECODE_LOCALE_ERR("EXEC_PREFIX define", len);
ea93f05f 235 }
c7fcbc4e 236diff -dur Python-3.5.0.orig/Python/getplatform.c Python-3.5.0/Python/getplatform.c
ea93f05f 237--- Python-3.5.0.orig/Python/getplatform.c 2015-09-13 13:41:26.000000000 +0200
c7fcbc4e 238+++ Python-3.5.0/Python/getplatform.c 2015-12-03 17:31:03.874280444 +0100
e684db95
AM
239@@ -10,3 +10,23 @@
240 {
241 return PLATFORM;
242 }
243+
244+#ifndef ARCH
245+#define ARCH "unknown"
246+#endif
247+
248+const char *
249+Py_GetArch(void)
250+{
251+ return ARCH;
252+}
253+
254+#ifndef LIB
255+#define LIB "lib"
256+#endif
257+
258+const char *
259+Py_GetLib(void)
260+{
261+ return LIB;
262+}
c7fcbc4e 263diff -dur Python-3.5.0.orig/Python/sysmodule.c Python-3.5.0/Python/sysmodule.c
ea93f05f 264--- Python-3.5.0.orig/Python/sysmodule.c 2015-09-13 13:41:26.000000000 +0200
c7fcbc4e 265+++ Python-3.5.0/Python/sysmodule.c 2015-12-03 17:31:03.874280444 +0100
514c1496 266@@ -2307,6 +2307,10 @@ _PySys_BeginInit(PyObject **sysmod)
e3852288
JB
267 PyUnicode_FromString(Py_GetCopyright()));
268 SET_SYS_FROM_STRING("platform",
269 PyUnicode_FromString(Py_GetPlatform()));
270+ SET_SYS_FROM_STRING("arch",
271+ PyUnicode_FromString(Py_GetArch()));
272+ SET_SYS_FROM_STRING("lib",
273+ PyUnicode_FromString(Py_GetLib()));
514c1496
AM
274 SET_SYS_FROM_STRING("maxsize",
275 PyLong_FromSsize_t(PY_SSIZE_T_MAX));
276 SET_SYS_FROM_STRING("float_info",
c7fcbc4e
JK
277diff -dur Python-3.5.0.orig/configure.ac Python-3.5.0/configure.ac
278--- Python-3.5.0.orig/configure.ac 2015-12-03 17:30:32.777292009 +0100
279+++ Python-3.5.0/configure.ac 2015-12-03 17:31:03.877613811 +0100
ea93f05f
JK
280@@ -722,6 +722,45 @@
281 ])
282 fi
283
284+AC_SUBST(ARCH)
285+AC_MSG_CHECKING(ARCH)
286+ARCH=`uname -m`
287+case $ARCH in
288+i?86) ARCH=i386;;
289+esac
290+AC_MSG_RESULT($ARCH)
291+
292+AC_SUBST(LIB)
293+AC_MSG_CHECKING(LIB)
294+case $ac_sys_system in
295+Linux*)
296+ # Test if the compiler is 64bit
297+ echo 'int i;' > conftest.$ac_ext
298+ python_cv_cc_64bit_output=no
299+ if AC_TRY_EVAL(ac_compile); then
300+ case `/usr/bin/file conftest.$ac_objext` in
301+ *"ELF 64"*)
302+ python_cv_cc_64bit_output=yes
303+ ;;
304+ esac
305+ fi
306+ rm -rf conftest*
307+ ;;
308+esac
309+
310+case $ARCH:$python_cv_cc_64bit_output in
311+powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
312+ LIB="lib64"
313+ ;;
314+x86_64:no)
315+ LIB="libx32"
316+ ;;
317+*:*)
318+ LIB="lib"
319+ ;;
320+esac
321+AC_MSG_RESULT($LIB)
322+
323
324 MULTIARCH=$($CC --print-multiarch 2>/dev/null)
325 AC_SUBST(MULTIARCH)
80febf2a 326@@ -4640,9 +4640,9 @@ AC_MSG_RESULT($LDVERSION)
ea93f05f
JK
327 dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
328 AC_SUBST(PY_ENABLE_SHARED)
80febf2a
AM
329 if test x$PLATFORM_TRIPLET = x; then
330- LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
331+ LIBPL='$(LIBDIR)/python'"${VERSION}/config-${LDVERSION}"
332 else
333- LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
334+ LIBPL='$(LIBDIR)/python'"${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
335 fi
ea93f05f
JK
336 AC_SUBST(LIBPL)
337
c7fcbc4e 338diff -dur Python-3.5.0.orig/setup.py Python-3.5.0/setup.py
ea93f05f 339--- Python-3.5.0.orig/setup.py 2015-09-13 13:41:26.000000000 +0200
c7fcbc4e 340+++ Python-3.5.0/setup.py 2015-12-03 17:31:03.877613811 +0100
380ee8da
AM
341@@ -569,7 +569,7 @@ class PyBuildExt(build_ext):
342 add_dir_to_list(self.compiler.include_dirs,
343 sysconfig.get_config_var("INCLUDEDIR"))
344
345- system_lib_dirs = ['/lib64', '/usr/lib64', '/lib', '/usr/lib']
346+ system_lib_dirs = ['/' + sys.lib, '/usr/' + sys.lib]
347 system_include_dirs = ['/usr/include']
348 # lib_dirs and inc_dirs are used to search for files;
349 # if a file is found in one of those directories, it can
3e35963a 350@@ -953,11 +953,11 @@ class PyBuildExt(build_ext):
e3852288
JB
351 elif curses_library:
352 readline_libs.append(curses_library)
3e35963a 353 elif self.compiler.find_library_file(self.lib_dirs +
e3852288 354- ['/usr/lib/termcap'],
cc48af34 355+ ['/usr/' + sys.lib + '/termcap'],
e3852288 356 'termcap'):
e684db95 357 readline_libs.append('termcap')
3e35963a
AM
358 self.add(Extension('readline', ['readline.c'],
359- library_dirs=['/usr/lib/termcap'],
360+ library_dirs=['/usr/' + sys.lib + '/termcap'],
361 extra_link_args=readline_extra_link_args,
362 libraries=readline_libs))
e3852288 363 else:
3e35963a
AM
364
365--- Python-3.8.0/Lib/test/test_embed.py~ 2019-10-14 15:34:47.000000000 +0200
366+++ Python-3.8.0/Lib/test/test_embed.py 2019-10-15 11:53:55.299065729 +0200
367@@ -1071,11 +1071,11 @@ class InitConfigTests(EmbeddingTestsMixi
368 else:
369 ver = sys.version_info
370 return [
371- os.path.join(prefix, 'lib',
372+ os.path.join(prefix, sys.lib,
373 f'python{ver.major}{ver.minor}.zip'),
374- os.path.join(prefix, 'lib',
375+ os.path.join(prefix, sys.lib,
376 f'python{ver.major}.{ver.minor}'),
377- os.path.join(exec_prefix, 'lib',
378+ os.path.join(exec_prefix, sys.lib,
379 f'python{ver.major}.{ver.minor}', 'lib-dynload'),
380 ]
381
This page took 0.118879 seconds and 4 git commands to generate.