]> git.pld-linux.org Git - packages/python3.git/blame - python3-lib64.patch
Suggests: pip
[packages/python3.git] / python3-lib64.patch
CommitLineData
71f47f15
JB
1--- Python-3.3.1/configure.ac.orig 2013-04-18 16:31:07.244030129 +0200
2+++ Python-3.3.1/configure.ac 2013-04-18 17:30:31.800622500 +0200
ac674191 3@@ -769,6 +769,45 @@
71f47f15
JB
4 MULTIARCH=$($CC --print-multiarch 2>/dev/null)
5 AC_SUBST(MULTIARCH)
e684db95
AM
6
7+AC_SUBST(ARCH)
8+AC_MSG_CHECKING(ARCH)
9+ARCH=`uname -m`
10+case $ARCH in
11+i?86) ARCH=i386;;
12+esac
13+AC_MSG_RESULT($ARCH)
14+
15+AC_SUBST(LIB)
16+AC_MSG_CHECKING(LIB)
17+case $ac_sys_system in
18+Linux*)
19+ # Test if the compiler is 64bit
20+ echo 'int i;' > conftest.$ac_ext
21+ python_cv_cc_64bit_output=no
22+ if AC_TRY_EVAL(ac_compile); then
23+ case `/usr/bin/file conftest.$ac_objext` in
24+ *"ELF 64"*)
25+ python_cv_cc_64bit_output=yes
26+ ;;
27+ esac
28+ fi
29+ rm -rf conftest*
30+ ;;
31+esac
32+
33+case $ARCH:$python_cv_cc_64bit_output in
34+powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
35+ LIB="lib64"
36+ ;;
58274b36
JR
37+x86_64:no)
38+ LIB="libx32"
39+ ;;
e684db95
AM
40+*:*)
41+ LIB="lib"
42+ ;;
43+esac
44+AC_MSG_RESULT($LIB)
71f47f15 45+
e684db95
AM
46
47 AC_SUBST(LIBRARY)
48 AC_MSG_CHECKING(LIBRARY)
ac674191
AM
49--- Python-3.5.0/Include/pylifecycle.h~ 2015-09-13 13:41:20.000000000 +0200
50+++ Python-3.5.0/Include/pylifecycle.h 2015-09-13 20:08:24.017308537 +0200
51@@ -65,6 +65,8 @@ int _Py_CheckPython3();
e684db95
AM
52 /* In their own files */
53 PyAPI_FUNC(const char *) Py_GetVersion(void);
54 PyAPI_FUNC(const char *) Py_GetPlatform(void);
55+PyAPI_FUNC(const char *) Py_GetArch(void);
56+PyAPI_FUNC(const char *) Py_GetLib(void);
57 PyAPI_FUNC(const char *) Py_GetCopyright(void);
58 PyAPI_FUNC(const char *) Py_GetCompiler(void);
59 PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
71f47f15 60--- Python-3.2.1.orig/Lib/distutils/command/install.py 2011-07-09 07:58:46.000000000 +0100
58aa28a5 61+++ Python-3.2.1/Lib/distutils/command/install.py 2011-07-12 22:20:12.000000000 +0100
38874ce8
AM
62@@ -19,6 +19,8 @@ from site import USER_BASE
63 from site import USER_SITE
64 HAS_USER_SITE = True
e684db95
AM
65
66+libname = sys.lib
67+
38874ce8
AM
68 WINDOWS_SCHEME = {
69 'purelib': '$base/Lib/site-packages',
70 'platlib': '$base/Lib/site-packages',
e3852288 71@@ -47,14 +49,14 @@
e684db95
AM
72 INSTALL_SCHEMES = {
73 'unix_prefix': {
74 'purelib': '$base/lib/python$py_version_short/site-packages',
75- 'platlib': '$platbase/lib/python$py_version_short/site-packages',
76+ 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages',
e3852288 77 'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
e684db95
AM
78 'scripts': '$base/bin',
79 'data' : '$base',
80 },
81 'unix_home': {
82 'purelib': '$base/lib/python',
83- 'platlib': '$base/lib/python',
84+ 'platlib': '$base/'+libname+'/python',
85 'headers': '$base/include/python/$dist_name',
86 'scripts': '$base/bin',
87 'data' : '$base',
71f47f15 88--- Python-3.2.1.orig/Lib/distutils/sysconfig.py 2011-07-09 07:58:47.000000000 +0100
58aa28a5 89+++ Python-3.2.1/Lib/distutils/sysconfig.py 2011-07-12 22:20:12.000000000 +0100
75257062 90@@ -124,8 +124,12 @@
e684db95
AM
91 prefix = plat_specific and EXEC_PREFIX or PREFIX
92
93 if os.name == "posix":
94+ if plat_specific:
95+ lib = sys.lib
96+ else:
97+ lib = 'lib'
98 libpython = os.path.join(prefix,
99- "lib", "python" + get_python_version())
100+ lib, "python" + get_python_version())
101 if standard_lib:
102 return libpython
103 else:
71f47f15 104--- Python-3.2.1.orig/Lib/distutils/tests/test_install.py 2011-07-09 07:58:47.000000000 +0100
58aa28a5 105+++ Python-3.2.1/Lib/distutils/tests/test_install.py 2011-07-12 22:20:12.000000000 +0100
75257062 106@@ -49,8 +49,9 @@
e684db95
AM
107 self.assertEqual(got, expected)
108
109 libdir = os.path.join(destination, "lib", "python")
110+ platlibdir = os.path.join(destination, sys.lib, "python")
111 check_path(cmd.install_lib, libdir)
112- check_path(cmd.install_platlib, libdir)
113+ check_path(cmd.install_platlib, platlibdir)
114 check_path(cmd.install_purelib, libdir)
115 check_path(cmd.install_headers,
116 os.path.join(destination, "include", "python", "foopkg"))
71f47f15 117--- Python-3.2.1.orig/Lib/site.py 2011-07-09 07:58:49.000000000 +0100
58aa28a5 118+++ Python-3.2.1/Lib/site.py 2011-07-12 22:20:12.000000000 +0100
ac674191 119@@ -304,12 +304,15 @@ def getsitepackages(prefixes=None):
38874ce8
AM
120 seen.add(prefix)
121
122 if os.sep == '/':
e3852288
JB
123- sitepackages.append(os.path.join(prefix, "lib",
124+ sitepackages.append(os.path.join(prefix, sys.lib,
04df829f 125 "python" + sys.version[:3],
126 "site-packages"))
e3852288 127+ sitepackages.append(os.path.join(prefix, sys.lib, "site-python"))
04df829f 128+ if sys.lib != 'lib':
e3852288 129+ sitepackages.append(os.path.join(prefix, "lib", "python" + sys.version[:3], "site-packages"))
04df829f 130 else:
e3852288
JB
131 sitepackages.append(prefix)
132- sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
133+ sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
04df829f 134 if sys.platform == "darwin":
135 # for framework builds *only* we add the standard Apple
e3852288 136 # locations.
71f47f15 137--- Python-3.2.1.orig/Lib/sysconfig.py 2011-07-09 07:58:49.000000000 +0100
58aa28a5 138+++ Python-3.2.1/Lib/sysconfig.py 2011-07-12 22:20:12.000000000 +0100
75257062 139@@ -21,10 +21,10 @@
140
141 _INSTALL_SCHEMES = {
142 'posix_prefix': {
b88f500a 143- 'stdlib': '{installed_base}/lib/python{py_version_short}',
75257062 144- 'platstdlib': '{platbase}/lib/python{py_version_short}',
b88f500a 145+ 'stdlib': '{installed_base}/' + sys.lib + '/python{py_version_short}',
75257062 146+ 'platstdlib': '{platbase}/' + sys.lib + '/python{py_version_short}',
147 'purelib': '{base}/lib/python{py_version_short}/site-packages',
148- 'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
149+ 'platlib': '{platbase}/' + sys.lib + '/python{py_version_short}/site-packages',
150 'include':
b88f500a 151 '{installed_base}/include/python{py_version_short}{abiflags}',
75257062 152 'platinclude':
153@@ -33,10 +33,10 @@
154 'data': '{base}',
155 },
156 'posix_home': {
b88f500a 157- 'stdlib': '{installed_base}/lib/python',
75257062 158- 'platstdlib': '{base}/lib/python',
b88f500a 159+ 'stdlib': '{installed_base}/' + sys.lib + '/python',
b9c7955e 160+ 'platstdlib': '{base}/' + sys.lib + '/python',
75257062 161 'purelib': '{base}/lib/python',
162- 'platlib': '{base}/lib/python',
163+ 'platlib': '{base}/' + sys.lib + '/python',
b88f500a
AM
164 'include': '{installed_base}/include/python',
165 'platinclude': '{installed_base}/include/python',
75257062 166 'scripts': '{base}/bin',
71f47f15 167--- Python-3.2.1.orig/Makefile.pre.in 2011-07-09 07:58:52.000000000 +0100
58aa28a5 168+++ Python-3.2.1/Makefile.pre.in 2011-07-12 22:20:12.000000000 +0100
169@@ -90,6 +90,8 @@
e684db95
AM
170
171 # Machine-dependent subdirectories
172 MACHDEP= @MACHDEP@
173+LIB= @LIB@
174+ARCH= @ARCH@
175
176 # Install prefix for architecture-independent files
177 prefix= @prefix@
58aa28a5 178@@ -106,7 +108,7 @@
e684db95
AM
179 MANDIR= @mandir@
180 INCLUDEDIR= @includedir@
181 CONFINCLUDEDIR= $(exec_prefix)/include
182-SCRIPTDIR= $(prefix)/lib
183+SCRIPTDIR= $(prefix)/$(LIB)
e3852288 184 ABIFLAGS= @ABIFLAGS@
e684db95
AM
185
186 # Detailed destination directories
58aa28a5 187@@ -611,7 +613,7 @@
e3852288 188 Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H)
e684db95
AM
189
190 Python/getplatform.o: $(srcdir)/Python/getplatform.c
e3852288
JB
191- $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
192+ $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
e684db95
AM
193
194 Python/importdl.o: $(srcdir)/Python/importdl.c
e3852288 195 $(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
71f47f15 196--- Python-3.2.1.orig/Modules/getpath.c 2011-07-09 07:58:54.000000000 +0100
58aa28a5 197+++ Python-3.2.1/Modules/getpath.c 2011-07-12 22:21:48.000000000 +0100
58274b36 198@@ -121,9 +121,21 @@
e684db95
AM
199 #define EXEC_PREFIX PREFIX
200 #endif
201
202+#ifndef LIB_PYTHON
203+#if defined(__x86_64__) || (defined(__sparc__) && defined(__arch64__)) || defined(__powerpc64__) || defined(__s390x__)
58274b36
JR
204+#if defined(__ILP32__)
205+#define LIB_PYTHON "libx32/python"
206+#else
38874ce8 207+#define LIB_PYTHON "lib64/python"
58274b36 208+#endif
e684db95 209+#else
38874ce8 210+#define LIB_PYTHON "lib/python"
e684db95
AM
211+#endif
212+#endif
213+
214 #ifndef PYTHONPATH
215-#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
216- EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
217+#define PYTHONPATH PREFIX "/" LIB_PYTHON VERSION ":" \
218+ EXEC_PREFIX "/" LIB_PYTHON VERSION "/lib-dynload:"
219 #endif
220
221 #ifndef LANDMARK
ac674191
AM
222@@ -502,7 +514,7 @@ calculate_path(void)
223 _pythonpath = Py_DecodeLocale(PYTHONPATH, NULL);
224 _prefix = Py_DecodeLocale(PREFIX, NULL);
225 _exec_prefix = Py_DecodeLocale(EXEC_PREFIX, NULL);
226- lib_python = Py_DecodeLocale("lib/python" VERSION, NULL);
227+ lib_python = Py_DecodeLocale(LIB_PYTHON VERSION, NULL);
04df829f 228
38874ce8
AM
229 if (!_pythonpath || !_prefix || !_exec_prefix || !lib_python) {
230 Py_FatalError(
71f47f15 231--- Python-3.2.1.orig/Python/getplatform.c 2011-07-09 07:58:56.000000000 +0100
58aa28a5 232+++ Python-3.2.1/Python/getplatform.c 2011-07-12 22:20:12.000000000 +0100
e684db95
AM
233@@ -10,3 +10,23 @@
234 {
235 return PLATFORM;
236 }
237+
238+#ifndef ARCH
239+#define ARCH "unknown"
240+#endif
241+
242+const char *
243+Py_GetArch(void)
244+{
245+ return ARCH;
246+}
247+
248+#ifndef LIB
249+#define LIB "lib"
250+#endif
251+
252+const char *
253+Py_GetLib(void)
254+{
255+ return LIB;
256+}
71f47f15 257--- Python-3.2.1.orig/Python/sysmodule.c 2011-07-09 07:58:56.000000000 +0100
58aa28a5 258+++ Python-3.2.1/Python/sysmodule.c 2011-07-12 22:20:12.000000000 +0100
259@@ -1560,6 +1560,10 @@
e3852288
JB
260 PyUnicode_FromString(Py_GetCopyright()));
261 SET_SYS_FROM_STRING("platform",
262 PyUnicode_FromString(Py_GetPlatform()));
263+ SET_SYS_FROM_STRING("arch",
264+ PyUnicode_FromString(Py_GetArch()));
265+ SET_SYS_FROM_STRING("lib",
266+ PyUnicode_FromString(Py_GetLib()));
267 SET_SYS_FROM_STRING("executable",
268 PyUnicode_FromWideChar(
269 Py_GetProgramFullPath(), -1));
71f47f15 270--- Python-3.2.1.orig/setup.py 2011-07-09 07:58:56.000000000 +0100
58aa28a5 271+++ Python-3.2.1/setup.py 2011-07-12 22:20:12.000000000 +0100
b88f500a 272@@ -516,8 +516,7 @@
e684db95 273 # be assumed that no additional -I,-L directives are needed.
b88f500a
AM
274 if not cross_compiling:
275 lib_dirs = self.compiler.library_dirs + [
276- '/lib64', '/usr/lib64',
277- '/lib', '/usr/lib',
08dc552f 278+ '/' + sys.lib, '/usr/' + sys.lib
b88f500a
AM
279 ]
280 inc_dirs = self.compiler.include_dirs + ['/usr/include']
e684db95 281 exts = []
ac674191 282@@ -643,11 +642,11 @@
e3852288
JB
283 elif curses_library:
284 readline_libs.append(curses_library)
e684db95 285 elif self.compiler.find_library_file(lib_dirs +
e3852288 286- ['/usr/lib/termcap'],
cc48af34 287+ ['/usr/' + sys.lib + '/termcap'],
e3852288 288 'termcap'):
e684db95
AM
289 readline_libs.append('termcap')
290 exts.append( Extension('readline', ['readline.c'],
291- library_dirs=['/usr/lib/termcap'],
cc48af34 292+ library_dirs=['/usr/' + sys.lib + '/termcap'],
e684db95
AM
293 extra_link_args=readline_extra_link_args,
294 libraries=readline_libs) )
e3852288 295 else:
This page took 0.06467 seconds and 4 git commands to generate.