]> git.pld-linux.org Git - packages/python.git/blob - python-lib64.patch
f61de7397165a001c6657baa7657c84f2386c037
[packages/python.git] / python-lib64.patch
1 diff -Nur Python-2.5b2.orig/configure.ac Python-2.5b2/configure.ac
2 --- Python-2.5b2.orig/configure.ac      2006-07-06 11:13:35.000000000 +0100
3 +++ Python-2.5b2/configure.ac   2006-07-12 17:42:51.000000000 +0100
4 @@ -503,6 +503,44 @@
5      ;;
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 +x86_64:no)
39 +  LIB="libx32"
40 +  ;;
41 +*:*)
42 +  LIB="lib"
43 +  ;;
44 +esac
45 +AC_MSG_RESULT($LIB)
46  
47  AC_SUBST(LIBRARY)
48  AC_MSG_CHECKING(LIBRARY)
49 --- Python-2.5b2.orig/Include/pythonrun.h       2006-04-03 07:26:32.000000000 +0100
50 +++ Python-2.5b2/Include/pythonrun.h    2006-07-12 17:42:51.000000000 +0100
51 @@ -107,6 +107,8 @@
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);
60 --- Python-2.5b2.orig/Lib/distutils/command/install.py  2006-03-27 22:55:21.000000000 +0100
61 +++ Python-2.5b2/Lib/distutils/command/install.py       2006-07-12 17:42:51.000000000 +0100
62 @@ -19,6 +19,8 @@
63  from distutils.errors import DistutilsOptionError
64  from glob import glob
65  
66 +libname = sys.lib
67 +
68  if sys.version < "2.2":
69      WINDOWS_SCHEME = {
70          'purelib': '$base',
71 @@ -39,14 +41,14 @@
72  INSTALL_SCHEMES = {
73      'unix_prefix': {
74 -        'purelib': '$base/lib/python$py_version_short/site-packages',
75 +        'purelib': '$base/'+libname+'/python$py_version_short/site-packages',
76 -        'platlib': '$platbase/lib/python$py_version_short/site-packages',
77 +        'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages',
78          'headers': '$base/include/python$py_version_short/$dist_name',
79          'scripts': '$base/bin',
80          'data'   : '$base',
81          },
82      'unix_home': {
83 -        'purelib': '$base/lib/python',
84 +        'purelib': '$base/'+libname+'/python',
85 -        'platlib': '$base/lib/python',
86 +        'platlib': '$base/'+libname+'/python',
87          'headers': '$base/include/python/$dist_name',
88          'scripts': '$base/bin',
89          'data'   : '$base',
90 diff -Nur Python-2.5b2.orig/Lib/distutils/sysconfig.py Python-2.5b2/Lib/distutils/sysconfig.py
91 --- Python-2.5b2.orig/Lib/distutils/sysconfig.py        2006-06-27 11:08:25.000000000 +0100
92 +++ Python-2.5b2/Lib/distutils/sysconfig.py     2006-07-12 17:42:51.000000000 +0100
93 @@ -99,8 +99,12 @@
94          prefix = plat_specific and EXEC_PREFIX or PREFIX
95  
96      if os.name == "posix":
97 +        if plat_specific:
98 +            lib = sys.lib
99 +        else:
100 +            lib = 'lib'
101          libpython = os.path.join(prefix,
102 -                                 "lib", "python" + get_python_version())
103 +                                 lib, "python" + get_python_version())
104          if standard_lib:
105              return libpython
106          else:
107 --- Python-2.5b2.orig/Lib/distutils/tests/test_install.py       2004-06-26 00:02:59.000000000 +0100
108 +++ Python-2.5b2/Lib/distutils/tests/test_install.py    2006-07-12 17:42:51.000000000 +0100
109 @@ -39,8 +39,8 @@
110              self.assertEqual(got, expected)
111  
112 -        libdir = os.path.join(destination, "lib", "python")
113 +        libdir =  os.path.join(destination, sys.lib, "python")
114          check_path(cmd.install_lib, libdir)
115          check_path(cmd.install_platlib, libdir)
116          check_path(cmd.install_purelib, libdir)
117          check_path(cmd.install_headers,
118                     os.path.join(destination, "include", "python", "foopkg"))
119 diff -Nur Python-2.5b2.orig/Lib/site.py Python-2.5b2/Lib/site.py
120 --- Python-2.5b2.orig/Lib/site.py       2006-06-12 09:23:02.000000000 +0100
121 +++ Python-2.5b2/Lib/site.py    2006-07-12 17:42:51.000000000 +0100
122 @@ -265,12 +265,19 @@
123          if sys.platform in ('os2emx', 'riscos'):
124              sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
125          elif os.sep == '/':
126 -            sitepackages.append(os.path.join(prefix, "lib",
127 +            sitepackages.append(os.path.join(prefix, sys.lib,
128                                          "python" + sys.version[:3],
129                                          "site-packages"))
130 -            sitepackages.append(os.path.join(prefix, "lib", "site-python"))
131 +            sitepackages.append(os.path.join(prefix, sys.lib, "site-python"))
132 +            if sys.lib != 'lib':
133 +                sitepackages.append(os.path.join(prefix,
134 +                    'lib',
135 +                    "python" + sys.version[:3],
136 +                    "site-packages"))
137 +                sitepackages.append(os.path.join(prefix, 'lib', "site-python"))
138 +
139          else:
140              sitepackages.append(prefix)
141 -            sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
142 +            sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
143          if sys.platform == "darwin":
144              # for framework builds *only* we add the standard Apple
145 --- Python-2.5b2.orig/Makefile.pre.in   2006-06-27 16:45:32.000000000 +0100
146 +++ Python-2.5b2/Makefile.pre.in        2006-07-12 17:42:51.000000000 +0100
147 @@ -75,6 +75,8 @@
148  
149  # Machine-dependent subdirectories
150  MACHDEP=       @MACHDEP@
151 +LIB=           @LIB@
152 +ARCH=          @ARCH@
153  
154  # Install prefix for architecture-independent files
155  prefix=                @prefix@
156 @@ -84,11 +86,11 @@
157  
158  # Expanded directories
159  BINDIR=                @bindir@
160 -LIBDIR=                @libdir@
161 +LIBDIR=                @libdir@
162  MANDIR=                @mandir@
163  INCLUDEDIR=    @includedir@
164  CONFINCLUDEDIR=        $(exec_prefix)/include
165 -SCRIPTDIR=     $(prefix)/lib
166 +SCRIPTDIR=     $(prefix)/$(LIB)
167  
168  # Detailed destination directories
169  BINLIBDEST=    $(LIBDIR)/python$(VERSION)
170 @@ -489,7 +491,7 @@
171  Python/compile.o Python/symtable.o: $(GRAMMAR_H) $(AST_H)
172  
173  Python/getplatform.o: $(srcdir)/Python/getplatform.c
174 -               $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
175 +               $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
176  
177  Python/importdl.o: $(srcdir)/Python/importdl.c
178                 $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
179 --- Python-2.5b2.orig/Modules/getpath.c 2006-07-10 02:18:57.000000000 +0100
180 +++ Python-2.5b2/Modules/getpath.c      2006-07-12 17:42:51.000000000 +0100
181 @@ -116,9 +116,21 @@
182  #define EXEC_PREFIX PREFIX
183  #endif
184  
185 +#ifndef LIB_PYTHON
186 +#if defined(__x86_64__) || (defined(__sparc__) && defined(__arch64__)) || defined(__powerpc64__) || defined(__s390x__)
187 +#if defined(__ILP32__)
188 +#define LIB_PYTHON "libx32/python"
189 +#else
190 +#define LIB_PYTHON "lib64/python"
191 +#endif
192 +#else
193 +#define LIB_PYTHON "lib/python"
194 +#endif
195 +#endif
196 +
197  #ifndef PYTHONPATH
198 -#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
199 -              EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
200 +#define PYTHONPATH PREFIX "/" LIB_PYTHON VERSION ":" \
201 +              EXEC_PREFIX "/" LIB_PYTHON VERSION "/lib-dynload:"
202  #endif
203  
204  #ifndef LANDMARK
205 @@ -129,7 +137,7 @@
206  static char exec_prefix[MAXPATHLEN+1];
207  static char progpath[MAXPATHLEN+1];
208  static char *module_search_path = NULL;
209 -static char lib_python[] = "lib/python" VERSION;
210 +static char lib_python[] = LIB_PYTHON VERSION;
211  
212  static void
213  reduce(char *dir)
214 --- Python-2.5b2.orig/Python/getplatform.c      2000-09-02 00:29:29.000000000 +0100
215 +++ Python-2.5b2/Python/getplatform.c   2006-07-12 17:42:51.000000000 +0100
216 @@ -10,3 +10,23 @@
217  {
218         return PLATFORM;
219  }
220 +
221 +#ifndef ARCH
222 +#define ARCH "unknown"
223 +#endif
224 +
225 +const char *
226 +Py_GetArch(void)
227 +{
228 +       return ARCH;
229 +}
230 +
231 +#ifndef LIB
232 +#define LIB "lib"
233 +#endif
234 +
235 +const char *
236 +Py_GetLib(void)
237 +{
238 +       return LIB;
239 +}
240 --- Python-2.5b2.orig/Python/sysmodule.c        2006-07-10 22:08:24.000000000 +0100
241 +++ Python-2.5b2/Python/sysmodule.c     2006-07-12 17:42:51.000000000 +0100
242 @@ -1377,6 +1377,10 @@
243                          PyString_FromString(Py_GetCopyright()));
244      SET_SYS_FROM_STRING("platform",
245                          PyString_FromString(Py_GetPlatform()));
246 +    SET_SYS_FROM_STRING("arch",
247 +                        PyString_FromString(Py_GetArch()));
248 +    SET_SYS_FROM_STRING("lib",
249 +                        PyString_FromString(Py_GetLib()));
250      SET_SYS_FROM_STRING("executable",
251                          PyString_FromString(Py_GetProgramFullPath()));
252      SET_SYS_FROM_STRING("prefix",
253 --- Python-2.5b2.orig/setup.py  2006-06-30 07:18:39.000000000 +0100
254 +++ Python-2.5b2/setup.py       2006-07-12 17:45:14.000000000 +0100
255 @@ -491,6 +491,7 @@
256          except NameError:
257              have_unicode = 0
258  
259 +        libname = sys.lib
260          # lib_dirs and inc_dirs are used to search for files;
261          # if a file is found in one of those directories, it can
262          # be assumed that no additional -I,-L directives are needed.
263 @@ -502,8 +503,7 @@
264                  ):
265                  add_dir_to_list(inc_dirs, d)
266              for d in (
267 -                '/lib64', '/usr/lib64',
268 -                '/lib', '/usr/lib',
269 +                libname, '/usr/'+libname
270                  ):
271                  add_dir_to_list(lib_dirs, d)
272          exts = []
273 @@ -496,11 +496,11 @@
274              elif curses_library:
275                  readline_libs.append(curses_library)
276              elif self.compiler.find_library_file(lib_dirs +
277 -                                                     ['/usr/lib/termcap'],
278 +                                                     ['/usr' + libname + '/termcap'],
279                                                       'termcap'):
280                  readline_libs.append('termcap')
281              exts.append( Extension('readline', ['readline.c'],
282 -                                   library_dirs=['/usr/lib/termcap'],
283 +                                   library_dirs=['/usr' + libname + '/termcap'],
284                                     extra_link_args=readline_extra_link_args,
285                                     libraries=readline_libs) )
286          else:
287 @@ -1244,8 +1244,8 @@
288              added_lib_dirs.append('/usr/openwin/lib')
289          elif os.path.exists('/usr/X11R6/include'):
290              include_dirs.append('/usr/X11R6/include')
291 -            added_lib_dirs.append('/usr/X11R6/lib64')
292 -            added_lib_dirs.append('/usr/X11R6/lib')
293 +            added_lib_dirs.append('/usr/X11R6/'+sys.lib)
294 +            #added_lib_dirs.append('/usr/X11R6/lib')
295          elif os.path.exists('/usr/X11R5/include'):
296              include_dirs.append('/usr/X11R5/include')
297              added_lib_dirs.append('/usr/X11R5/lib')
298 --- Python-2.7/Lib/test/test_site.py~   2010-05-14 01:59:41.000000000 +0200
299 +++ Python-2.7/Lib/test/test_site.py    2010-07-05 20:36:37.311186935 +0200
300 @@ -226,7 +226,7 @@
301  
302          if sys.platform in ('os2emx', 'riscos'):
303              self.assertEqual(len(dirs), 1)
304 -            wanted = os.path.join('xoxo', 'Lib', 'site-packages')
305 +            wanted = os.path.join('xoxo', sys.lib, 'site-packages')
306              self.assertEqual(dirs[0], wanted)
307          elif (sys.platform == "darwin" and
308              sysconfig.get_config_var("PYTHONFRAMEWORK")):
309 @@ -242,16 +242,16 @@
310          elif os.sep == '/':
311              # OS X non-framwework builds, Linux, FreeBSD, etc
312              self.assertEqual(len(dirs), 2)
313 -            wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3],
314 +            wanted = os.path.join('xoxo', sys.lib, 'python' + sys.version[:3],
315                                    'site-packages')
316              self.assertEqual(dirs[0], wanted)
317 -            wanted = os.path.join('xoxo', 'lib', 'site-python')
318 +            wanted = os.path.join('xoxo', sys.lib, 'site-python')
319              self.assertEqual(dirs[1], wanted)
320          else:
321              # other platforms
322              self.assertEqual(len(dirs), 2)
323              self.assertEqual(dirs[0], 'xoxo')
324 -            wanted = os.path.join('xoxo', 'lib', 'site-packages')
325 +            wanted = os.path.join('xoxo', sys.lib, 'site-packages')
326              self.assertEqual(dirs[1], wanted)
327  
328  class PthFile(object):
329 --- Python-2.7/Lib/sysconfig.py.org     2010-05-20 00:20:14.000000000 +0200
330 +++ Python-2.7/Lib/sysconfig.py 2010-07-06 08:31:15.687728628 +0200
331 @@ -5,22 +5,24 @@
332  import os
333  from os.path import pardir, realpath
334  
335 +libname = sys.lib
336 +
337  _INSTALL_SCHEMES = {
338      'posix_prefix': {
339 -        'stdlib': '{base}/lib/python{py_version_short}',
340 -        'platstdlib': '{platbase}/lib/python{py_version_short}',
341 -        'purelib': '{base}/lib/python{py_version_short}/site-packages',
342 -        'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
343 +        'stdlib': '{base}/' + libname + '/python{py_version_short}',
344 +        'platstdlib': '{platbase}/' + libname + '/python{py_version_short}',
345 +        'purelib': '{base}/' + libname + '/python{py_version_short}/site-packages',
346 +        'platlib': '{platbase}/' + libname + '/python{py_version_short}/site-packages',
347          'include': '{base}/include/python{py_version_short}',
348          'platinclude': '{platbase}/include/python{py_version_short}',
349          'scripts': '{base}/bin',
350          'data': '{base}',
351          },
352      'posix_home': {
353 -        'stdlib': '{base}/lib/python',
354 -        'platstdlib': '{base}/lib/python',
355 -        'purelib': '{base}/lib/python',
356 -        'platlib': '{base}/lib/python',
357 +        'stdlib': '{base}/' + libname + '/python',
358 +        'platstdlib': '{base}/' + libname + '/python',
359 +        'purelib': '{base}/' + libname + '/python',
360 +        'platlib': '{base}/' + libname + '/python',
361          'include': '{base}/include/python',
362          'platinclude': '{base}/include/python',
363          'scripts': '{base}/bin',
364 @@ -65,10 +67,10 @@
365          'data'   : '{userbase}',
366          },
367      'posix_user': {
368 -        'stdlib': '{userbase}/lib/python{py_version_short}',
369 -        'platstdlib': '{userbase}/lib/python{py_version_short}',
370 -        'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
371 -        'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
372 +        'stdlib': '{userbase}/' + libname + '/python{py_version_short}',
373 +        'platstdlib': '{userbase}/' + libname + '/python{py_version_short}',
374 +        'purelib': '{userbase}/' + libname + '/python{py_version_short}/site-packages',
375 +        'platlib': '{userbase}/' + libname + '/python{py_version_short}/site-packages',
376          'include': '{userbase}/include/python{py_version_short}',
377          'scripts': '{userbase}/bin',
378          'data'   : '{userbase}',
379 diff -Nur Python-2.5.orig/Modules/getpath.c Python-2.5/Modules/getpath.c
380 @@ -532,7 +534,7 @@
381      }
382      else
383          strncpy(zip_path, PREFIX, MAXPATHLEN);
384 -    joinpath(zip_path, "lib/python00.zip");
385 +    joinpath(zip_path, LIB_PYTHON "00.zip");
386      bufsz = strlen(zip_path);   /* Replace "00" with version */
387      zip_path[bufsz - 6] = VERSION[0];
388      zip_path[bufsz - 5] = VERSION[2];
389
This page took 0.080526 seconds and 2 git commands to generate.