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