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