[2.30] Bump shared-mime-info to 0.70 (GNOME bug 598317)
[jhbuild/xnox.git] / patches / python-2.5.2-lib64.patch
blob1547941161a863c92e8551fe57c04fe9ef6521ec
1 http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/python/current/SOURCES/
3 diff -Naur Python-2.5.2.orig/configure Python-2.5.2/configure
4 --- Python-2.5.2.orig/configure 2008-12-04 12:53:20.850370886 +0100
5 +++ Python-2.5.2/configure 2008-12-04 12:56:26.041364487 +0100
6 @@ -1,5 +1,5 @@
7 #! /bin/sh
8 -# From configure.in Revision: 60465 .
9 +# From configure.in Revision: 60766 .
10 # Guess values for system-dependent variables and create Makefiles.
11 # Generated by GNU Autoconf 2.61 for python 2.5.
13 @@ -685,6 +685,8 @@
14 GREP
15 EGREP
16 BUILDEXEEXT
17 +ARCH
18 +LIB
19 LIBRARY
20 LDLIBRARY
21 DLLLIBRARY
22 @@ -3833,6 +3835,49 @@
23 esac
26 +{ echo "$as_me:$LINENO: checking ARCH" >&5
27 +echo $ECHO_N "checking ARCH... $ECHO_C" >&6; }
28 +ARCH=`uname -m`
29 +case $ARCH in
30 +i?86) ARCH=i386;;
31 +esac
32 +{ echo "$as_me:$LINENO: result: $ARCH" >&5
33 +echo "${ECHO_T}$ARCH" >&6; }
36 +{ echo "$as_me:$LINENO: checking LIB" >&5
37 +echo $ECHO_N "checking LIB... $ECHO_C" >&6; }
38 +case $ac_sys_system in
39 +Linux*)
40 + # Test if the compiler is 64bit
41 + echo 'int i;' > conftest.$ac_ext
42 + python_cv_cc_64bit_output=no
43 + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
44 + (eval $ac_compile) 2>&5
45 + ac_status=$?
46 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
47 + (exit $ac_status); }; then
48 + case `/usr/bin/file conftest.$ac_objext` in
49 + *"ELF 64"*)
50 + python_cv_cc_64bit_output=yes
51 + ;;
52 + esac
53 + fi
54 + rm -rf conftest*
55 + ;;
56 +esac
58 +case $ARCH:$python_cv_cc_64bit_output in
59 +ppc64:yes | powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
60 + LIB="lib64"
61 + ;;
62 +*:*)
63 + LIB="lib"
64 + ;;
65 +esac
66 +{ echo "$as_me:$LINENO: result: $LIB" >&5
67 +echo "${ECHO_T}$LIB" >&6; }
70 { echo "$as_me:$LINENO: checking LIBRARY" >&5
71 echo $ECHO_N "checking LIBRARY... $ECHO_C" >&6; }
72 @@ -23367,6 +23412,8 @@
73 GREP!$GREP$ac_delim
74 EGREP!$EGREP$ac_delim
75 BUILDEXEEXT!$BUILDEXEEXT$ac_delim
76 +ARCH!$ARCH$ac_delim
77 +LIB!$LIB$ac_delim
78 LIBRARY!$LIBRARY$ac_delim
79 LDLIBRARY!$LDLIBRARY$ac_delim
80 DLLLIBRARY!$DLLLIBRARY$ac_delim
81 @@ -23393,8 +23440,6 @@
82 LINKFORSHARED!$LINKFORSHARED$ac_delim
83 CFLAGSFORSHARED!$CFLAGSFORSHARED$ac_delim
84 SHLIBS!$SHLIBS$ac_delim
85 -USE_SIGNAL_MODULE!$USE_SIGNAL_MODULE$ac_delim
86 -SIGNAL_OBJS!$SIGNAL_OBJS$ac_delim
87 _ACEOF
89 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
90 @@ -23436,6 +23481,8 @@
91 ac_delim='%!_!# '
92 for ac_last_try in false false false false false :; do
93 cat >conf$$subs.sed <<_ACEOF
94 +USE_SIGNAL_MODULE!$USE_SIGNAL_MODULE$ac_delim
95 +SIGNAL_OBJS!$SIGNAL_OBJS$ac_delim
96 USE_THREAD_MODULE!$USE_THREAD_MODULE$ac_delim
97 LDLAST!$LDLAST$ac_delim
98 THREADOBJ!$THREADOBJ$ac_delim
99 @@ -23457,7 +23504,7 @@
100 LTLIBOBJS!$LTLIBOBJS$ac_delim
101 _ACEOF
103 - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 19; then
104 + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 21; then
105 break
106 elif $ac_last_try; then
107 { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
108 diff -Naur Python-2.5.2.orig/configure.in Python-2.5.2/configure.in
109 --- Python-2.5.2.orig/configure.in 2008-12-04 12:53:22.283369893 +0100
110 +++ Python-2.5.2/configure.in 2008-12-04 12:54:55.362364592 +0100
111 @@ -513,6 +513,41 @@
113 esac
115 +AC_SUBST(ARCH)
116 +AC_MSG_CHECKING(ARCH)
117 +ARCH=`uname -m`
118 +case $ARCH in
119 +i?86) ARCH=i386;;
120 +esac
121 +AC_MSG_RESULT($ARCH)
123 +AC_SUBST(LIB)
124 +AC_MSG_CHECKING(LIB)
125 +case $ac_sys_system in
126 +Linux*)
127 + # Test if the compiler is 64bit
128 + echo 'int i;' > conftest.$ac_ext
129 + python_cv_cc_64bit_output=no
130 + if AC_TRY_EVAL(ac_compile); then
131 + case `/usr/bin/file conftest.$ac_objext` in
132 + *"ELF 64"*)
133 + python_cv_cc_64bit_output=yes
134 + ;;
135 + esac
136 + fi
137 + rm -rf conftest*
138 + ;;
139 +esac
141 +case $ARCH:$python_cv_cc_64bit_output in
142 +ppc64:yes | powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
143 + LIB="lib64"
144 + ;;
145 +*:*)
146 + LIB="lib"
147 + ;;
148 +esac
149 +AC_MSG_RESULT($LIB)
151 AC_SUBST(LIBRARY)
152 AC_MSG_CHECKING(LIBRARY)
153 diff -Naur Python-2.5.2.orig/Include/pythonrun.h Python-2.5.2/Include/pythonrun.h
154 --- Python-2.5.2.orig/Include/pythonrun.h 2008-12-04 12:53:23.384369909 +0100
155 +++ Python-2.5.2/Include/pythonrun.h 2008-12-04 12:54:55.366365660 +0100
156 @@ -107,6 +107,8 @@
157 /* In their own files */
158 PyAPI_FUNC(const char *) Py_GetVersion(void);
159 PyAPI_FUNC(const char *) Py_GetPlatform(void);
160 +PyAPI_FUNC(const char *) Py_GetArch(void);
161 +PyAPI_FUNC(const char *) Py_GetLib(void);
162 PyAPI_FUNC(const char *) Py_GetCopyright(void);
163 PyAPI_FUNC(const char *) Py_GetCompiler(void);
164 PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
165 diff -Naur Python-2.5.2.orig/Lib/distutils/command/install.py Python-2.5.2/Lib/distutils/command/install.py
166 --- Python-2.5.2.orig/Lib/distutils/command/install.py 2008-12-04 12:53:20.869369116 +0100
167 +++ Python-2.5.2/Lib/distutils/command/install.py 2008-12-04 12:54:55.365365533 +0100
168 @@ -19,6 +19,8 @@
169 from distutils.errors import DistutilsOptionError
170 from glob import glob
172 +libname = sys.lib
174 if sys.version < "2.2":
175 WINDOWS_SCHEME = {
176 'purelib': '$base',
177 @@ -39,14 +41,14 @@
178 INSTALL_SCHEMES = {
179 'unix_prefix': {
180 'purelib': '$base/lib/python$py_version_short/site-packages',
181 - 'platlib': '$platbase/lib/python$py_version_short/site-packages',
182 + 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages',
183 'headers': '$base/include/python$py_version_short/$dist_name',
184 'scripts': '$base/bin',
185 'data' : '$base',
187 'unix_home': {
188 'purelib': '$base/lib/python',
189 - 'platlib': '$base/lib/python',
190 + 'platlib': '$base/'+libname+'/python',
191 'headers': '$base/include/python/$dist_name',
192 'scripts': '$base/bin',
193 'data' : '$base',
194 diff -Naur Python-2.5.2.orig/Lib/distutils/sysconfig.py Python-2.5.2/Lib/distutils/sysconfig.py
195 --- Python-2.5.2.orig/Lib/distutils/sysconfig.py 2008-12-04 12:53:20.868368429 +0100
196 +++ Python-2.5.2/Lib/distutils/sysconfig.py 2008-12-04 12:54:55.364364847 +0100
197 @@ -99,8 +99,12 @@
198 prefix = plat_specific and EXEC_PREFIX or PREFIX
200 if os.name == "posix":
201 + if plat_specific:
202 + lib = sys.lib
203 + else:
204 + lib = 'lib'
205 libpython = os.path.join(prefix,
206 - "lib", "python" + get_python_version())
207 + lib, "python" + get_python_version())
208 if standard_lib:
209 return libpython
210 else:
211 diff -Naur Python-2.5.2.orig/Lib/distutils/tests/test_install.py Python-2.5.2/Lib/distutils/tests/test_install.py
212 --- Python-2.5.2.orig/Lib/distutils/tests/test_install.py 2008-12-04 12:53:20.870370919 +0100
213 +++ Python-2.5.2/Lib/distutils/tests/test_install.py 2008-12-04 12:54:55.365365533 +0100
214 @@ -1,6 +1,6 @@
215 """Tests for distutils.command.install."""
217 -import os
218 +import os,sys
219 import unittest
221 from distutils.command.install import install
222 @@ -39,8 +39,9 @@
223 self.assertEqual(got, expected)
225 libdir = os.path.join(destination, "lib", "python")
226 + platlibdir = os.path.join(destination, sys.lib, "python")
227 check_path(cmd.install_lib, libdir)
228 - check_path(cmd.install_platlib, libdir)
229 + check_path(cmd.install_platlib, platlibdir)
230 check_path(cmd.install_purelib, libdir)
231 check_path(cmd.install_headers,
232 os.path.join(destination, "include", "python", "foopkg"))
233 diff -Naur Python-2.5.2.orig/Lib/site.py Python-2.5.2/Lib/site.py
234 --- Python-2.5.2.orig/Lib/site.py 2008-12-04 12:53:20.861370890 +0100
235 +++ Python-2.5.2/Lib/site.py 2008-12-04 12:54:55.364364847 +0100
236 @@ -182,12 +182,18 @@
237 sitedirs = [os.path.join(prefix, "Lib", "site-packages")]
238 elif os.sep == '/':
239 sitedirs = [os.path.join(prefix,
240 - "lib",
241 + sys.lib,
242 "python" + sys.version[:3],
243 "site-packages"),
244 - os.path.join(prefix, "lib", "site-python")]
245 + os.path.join(prefix, sys.lib, "site-python")]
246 + if sys.lib != 'lib':
247 + sitedirs.append(os.path.join(prefix,
248 + 'lib',
249 + "python" + sys.version[:3],
250 + "site-packages"))
251 + sitedirs.append(os.path.join(prefix, 'lib', "site-python"))
252 else:
253 - sitedirs = [prefix, os.path.join(prefix, "lib", "site-packages")]
254 + sitedirs = [prefix, os.path.join(prefix, sys.lib, "site-packages")]
255 if sys.platform == 'darwin':
256 # for framework builds *only* we add the standard Apple
257 # locations. Currently only per-user, but /Library and
258 diff -Naur Python-2.5.2.orig/Makefile.pre.in Python-2.5.2/Makefile.pre.in
259 --- Python-2.5.2.orig/Makefile.pre.in 2008-12-04 12:53:22.283369893 +0100
260 +++ Python-2.5.2/Makefile.pre.in 2008-12-04 12:54:55.353367357 +0100
261 @@ -75,6 +75,8 @@
263 # Machine-dependent subdirectories
264 MACHDEP= @MACHDEP@
265 +LIB= @LIB@
266 +ARCH= @ARCH@
268 # Install prefix for architecture-independent files
269 prefix= @prefix@
270 @@ -87,11 +89,11 @@
272 # Expanded directories
273 BINDIR= $(exec_prefix)/bin
274 -LIBDIR= $(exec_prefix)/lib
275 +LIBDIR= $(exec_prefix)/$(LIB)
276 MANDIR= @mandir@
277 INCLUDEDIR= @includedir@
278 CONFINCLUDEDIR= $(exec_prefix)/include
279 -SCRIPTDIR= $(prefix)/lib
280 +SCRIPTDIR= $(prefix)/$(LIB)
282 # Detailed destination directories
283 BINLIBDEST= $(LIBDIR)/python$(VERSION)
284 @@ -495,7 +497,7 @@
285 Python/compile.o Python/symtable.o: $(GRAMMAR_H) $(AST_H)
287 Python/getplatform.o: $(srcdir)/Python/getplatform.c
288 - $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
289 + $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
291 Python/importdl.o: $(srcdir)/Python/importdl.c
292 $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
293 diff -Naur Python-2.5.2.orig/Modules/getpath.c Python-2.5.2/Modules/getpath.c
294 --- Python-2.5.2.orig/Modules/getpath.c 2008-12-04 12:53:23.369370512 +0100
295 +++ Python-2.5.2/Modules/getpath.c 2008-12-04 12:54:55.364364847 +0100
296 @@ -116,9 +116,17 @@
297 #define EXEC_PREFIX PREFIX
298 #endif
300 +#ifndef LIB_PYTHON
301 +#if defined(__x86_64__) || defined(__powerpc64__)
302 +#define LIB_PYTHON "lib64/python" VERSION
303 +#else
304 +#define LIB_PYTHON "lib/python" VERSION
305 +#endif
306 +#endif
308 #ifndef PYTHONPATH
309 -#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
310 - EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
311 +#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \
312 + EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload"
313 #endif
315 #ifndef LANDMARK
316 @@ -129,7 +137,7 @@
317 static char exec_prefix[MAXPATHLEN+1];
318 static char progpath[MAXPATHLEN+1];
319 static char *module_search_path = NULL;
320 -static char lib_python[] = "lib/python" VERSION;
321 +static char lib_python[] = LIB_PYTHON;
323 static void
324 reduce(char *dir)
325 diff -Naur Python-2.5.2.orig/Python/getplatform.c Python-2.5.2/Python/getplatform.c
326 --- Python-2.5.2.orig/Python/getplatform.c 2008-12-04 12:53:23.173370128 +0100
327 +++ Python-2.5.2/Python/getplatform.c 2008-12-04 12:54:55.365365533 +0100
328 @@ -10,3 +10,23 @@
330 return PLATFORM;
333 +#ifndef ARCH
334 +#define ARCH "unknown"
335 +#endif
337 +const char *
338 +Py_GetArch(void)
340 + return ARCH;
343 +#ifndef LIB
344 +#define LIB "lib"
345 +#endif
347 +const char *
348 +Py_GetLib(void)
350 + return LIB;
352 diff -Naur Python-2.5.2.orig/Python/sysmodule.c Python-2.5.2/Python/sysmodule.c
353 --- Python-2.5.2.orig/Python/sysmodule.c 2008-12-04 12:53:23.175368986 +0100
354 +++ Python-2.5.2/Python/sysmodule.c 2008-12-04 12:54:55.366365660 +0100
355 @@ -1159,6 +1159,10 @@
356 PyString_FromString(Py_GetPlatform()));
357 SET_SYS_FROM_STRING("executable",
358 PyString_FromString(Py_GetProgramFullPath()));
359 + SET_SYS_FROM_STRING("arch",
360 + PyString_FromString(Py_GetArch()));
361 + SET_SYS_FROM_STRING("lib",
362 + PyString_FromString(Py_GetLib()));
363 SET_SYS_FROM_STRING("prefix",
364 PyString_FromString(Py_GetPrefix()));
365 SET_SYS_FROM_STRING("exec_prefix",
366 diff -Naur Python-2.5.2.orig/setup.py Python-2.5.2/setup.py
367 --- Python-2.5.2.orig/setup.py 2008-12-04 12:53:22.286366085 +0100
368 +++ Python-2.5.2/setup.py 2008-12-04 12:54:55.363365837 +0100
369 @@ -291,12 +291,12 @@
370 except NameError:
371 have_unicode = 0
373 + libname = sys.lib
374 # lib_dirs and inc_dirs are used to search for files;
375 # if a file is found in one of those directories, it can
376 # be assumed that no additional -I,-L directives are needed.
377 lib_dirs = self.compiler.library_dirs + [
378 - '/lib64', '/usr/lib64',
379 - '/lib', '/usr/lib',
380 + libname, '/usr/'+libname
382 inc_dirs = self.compiler.include_dirs + ['/usr/include']
383 exts = []
384 @@ -497,11 +497,11 @@
385 elif self.compiler.find_library_file(lib_dirs, 'curses'):
386 readline_libs.append('curses')
387 elif self.compiler.find_library_file(lib_dirs +
388 - ['/usr/lib/termcap'],
389 + ['/usr/'+libname+'/termcap'],
390 'termcap'):
391 readline_libs.append('termcap')
392 exts.append( Extension('readline', ['readline.c'],
393 - library_dirs=['/usr/lib/termcap'],
394 + library_dirs=['/usr/'+libname+'/termcap'],
395 extra_link_args=readline_extra_link_args,
396 libraries=readline_libs) )
397 if platform not in ['mac']:
398 @@ -1267,8 +1267,8 @@
399 added_lib_dirs.append('/usr/openwin/lib')
400 elif os.path.exists('/usr/X11R6/include'):
401 include_dirs.append('/usr/X11R6/include')
402 - added_lib_dirs.append('/usr/X11R6/lib64')
403 - added_lib_dirs.append('/usr/X11R6/lib')
404 + added_lib_dirs.append('/usr/X11R6/'+sys.lib)
405 + #added_lib_dirs.append('/usr/X11R6/lib')
406 elif os.path.exists('/usr/X11R5/include'):
407 include_dirs.append('/usr/X11R5/include')
408 added_lib_dirs.append('/usr/X11R5/lib')