]> git.pld-linux.org Git - packages/python.git/blob - python-lib64.patch
- up to 2.7.3; include py files
[packages/python.git] / python-lib64.patch
1 diff -Nur Python-2.5b2.orig/configure.in Python-2.5b2/configure.in
2 --- Python-2.5b2.orig/configure.in      2006-07-06 11:13:35.000000000 +0100
3 +++ Python-2.5b2/configure.in   2006-07-12 17:42:51.000000000 +0100
4 @@ -503,6 +503,41 @@
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 +*:*)
39 +  LIB="lib"
40 +  ;;
41 +esac
42 +AC_MSG_RESULT($LIB)
43  
44  AC_SUBST(LIBRARY)
45  AC_MSG_CHECKING(LIBRARY)
46 diff -Nur Python-2.5b2.orig/Include/pythonrun.h Python-2.5b2/Include/pythonrun.h
47 --- Python-2.5b2.orig/Include/pythonrun.h       2006-04-03 07:26:32.000000000 +0100
48 +++ Python-2.5b2/Include/pythonrun.h    2006-07-12 17:42:51.000000000 +0100
49 @@ -107,6 +107,8 @@
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);
58 diff -Nur Python-2.5b2.orig/Lib/distutils/command/install.py Python-2.5b2/Lib/distutils/command/install.py
59 --- Python-2.5b2.orig/Lib/distutils/command/install.py  2006-03-27 22:55:21.000000000 +0100
60 +++ Python-2.5b2/Lib/distutils/command/install.py       2006-07-12 17:42:51.000000000 +0100
61 @@ -19,6 +19,8 @@
62  from distutils.errors import DistutilsOptionError
63  from glob import glob
64  
65 +libname = sys.lib
66 +
67  if sys.version < "2.2":
68      WINDOWS_SCHEME = {
69          'purelib': '$base',
70 @@ -39,14 +41,14 @@
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',
76          'headers': '$base/include/python$py_version_short/$dist_name',
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',
87 diff -Nur Python-2.5b2.orig/Lib/distutils/sysconfig.py Python-2.5b2/Lib/distutils/sysconfig.py
88 --- Python-2.5b2.orig/Lib/distutils/sysconfig.py        2006-06-27 11:08:25.000000000 +0100
89 +++ Python-2.5b2/Lib/distutils/sysconfig.py     2006-07-12 17:42:51.000000000 +0100
90 @@ -99,8 +99,12 @@
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:
104 diff -Nur Python-2.5b2.orig/Lib/distutils/tests/test_install.py Python-2.5b2/Lib/distutils/tests/test_install.py
105 --- Python-2.5b2.orig/Lib/distutils/tests/test_install.py       2004-06-26 00:02:59.000000000 +0100
106 +++ Python-2.5b2/Lib/distutils/tests/test_install.py    2006-07-12 17:42:51.000000000 +0100
107 @@ -39,8 +39,9 @@
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"))
118 diff -Nur Python-2.5b2.orig/Lib/site.py Python-2.5b2/Lib/site.py
119 --- Python-2.5b2.orig/Lib/site.py       2006-06-12 09:23:02.000000000 +0100
120 +++ Python-2.5b2/Lib/site.py    2006-07-12 17:42:51.000000000 +0100
121 @@ -265,12 +265,19 @@
122          if sys.platform in ('os2emx', 'riscos'):
123              sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
124          elif os.sep == '/':
125 -            sitepackages.append(os.path.join(prefix, "lib",
126 +            sitepackages.append(os.path.join(prefix, sys.lib,
127                                          "python" + sys.version[:3],
128                                          "site-packages"))
129 -            sitepackages.append(os.path.join(prefix, "lib", "site-python"))
130 +            sitepackages.append(os.path.join(prefix, sys.lib, "site-python"))
131 +            if sys.lib != 'lib':
132 +                sitepackages.append(os.path.join(prefix,
133 +                    'lib',
134 +                    "python" + sys.version[:3],
135 +                    "site-packages"))
136 +                sitepackages.append(os.path.join(prefix, 'lib', "site-python"))
137 +
138          else:
139              sitepackages.append(prefix)
140 -            sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
141 +            sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
142          if sys.platform == "darwin":
143              # for framework builds *only* we add the standard Apple
144 diff -Nur Python-2.5b2.orig/Makefile.pre.in Python-2.5b2/Makefile.pre.in
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 diff -Nur Python-2.5b2.orig/Modules/getpath.c Python-2.5b2/Modules/getpath.c
180 --- Python-2.5b2.orig/Modules/getpath.c 2006-07-10 02:18:57.000000000 +0100
181 +++ Python-2.5b2/Modules/getpath.c      2006-07-12 17:42:51.000000000 +0100
182 @@ -116,9 +116,17 @@
183  #define EXEC_PREFIX PREFIX
184  #endif
185  
186 +#ifndef LIB_PYTHON
187 +#if defined(__x86_64__) || (defined(__sparc__) && defined(__arch64__)) || defined(__powerpc64__) || defined(__s390x__)
188 +#define LIB_PYTHON "lib64/python"
189 +#else
190 +#define LIB_PYTHON "lib/python"
191 +#endif
192 +#endif
193 +
194  #ifndef PYTHONPATH
195 -#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
196 -              EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
197 +#define PYTHONPATH PREFIX "/" LIB_PYTHON VERSION ":" \
198 +              EXEC_PREFIX "/" LIB_PYTHON VERSION "/lib-dynload:"
199  #endif
200  
201  #ifndef LANDMARK
202 @@ -129,7 +137,7 @@
203  static char exec_prefix[MAXPATHLEN+1];
204  static char progpath[MAXPATHLEN+1];
205  static char *module_search_path = NULL;
206 -static char lib_python[] = "lib/python" VERSION;
207 +static char lib_python[] = LIB_PYTHON VERSION;
208  
209  static void
210  reduce(char *dir)
211 diff -Nur Python-2.5b2.orig/Python/getplatform.c Python-2.5b2/Python/getplatform.c
212 --- Python-2.5b2.orig/Python/getplatform.c      2000-09-02 00:29:29.000000000 +0100
213 +++ Python-2.5b2/Python/getplatform.c   2006-07-12 17:42:51.000000000 +0100
214 @@ -10,3 +10,23 @@
215  {
216         return PLATFORM;
217  }
218 +
219 +#ifndef ARCH
220 +#define ARCH "unknown"
221 +#endif
222 +
223 +const char *
224 +Py_GetArch(void)
225 +{
226 +       return ARCH;
227 +}
228 +
229 +#ifndef LIB
230 +#define LIB "lib"
231 +#endif
232 +
233 +const char *
234 +Py_GetLib(void)
235 +{
236 +       return LIB;
237 +}
238 diff -Nur Python-2.5b2.orig/Python/sysmodule.c Python-2.5b2/Python/sysmodule.c
239 --- Python-2.5b2.orig/Python/sysmodule.c        2006-07-10 22:08:24.000000000 +0100
240 +++ Python-2.5b2/Python/sysmodule.c     2006-07-12 17:42:51.000000000 +0100
241 @@ -1377,6 +1377,10 @@
242                          PyString_FromString(Py_GetCopyright()));
243      SET_SYS_FROM_STRING("platform",
244                          PyString_FromString(Py_GetPlatform()));
245 +    SET_SYS_FROM_STRING("arch",
246 +                        PyString_FromString(Py_GetArch()));
247 +    SET_SYS_FROM_STRING("lib",
248 +                        PyString_FromString(Py_GetLib()));
249      SET_SYS_FROM_STRING("executable",
250                          PyString_FromString(Py_GetProgramFullPath()));
251      SET_SYS_FROM_STRING("prefix",
252 diff -Nur Python-2.5b2.orig/setup.py Python-2.5b2/setup.py
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 @@ -290,12 +290,12 @@
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          lib_dirs = self.compiler.library_dirs + [
264 -            '/lib64', '/usr/lib64',
265 -            '/lib', '/usr/lib',
266 +            libname, '/usr/'+libname
267              ]
268          inc_dirs = self.compiler.include_dirs + ['/usr/include']
269          exts = []
270 @@ -496,11 +496,11 @@
271              elif curses_library:
272                  readline_libs.append(curses_library)
273              elif self.compiler.find_library_file(lib_dirs +
274 -                                                     ['/usr/lib/termcap'],
275 +                                                     ['/usr' + libname + '/termcap'],
276                                                       'termcap'):
277                  readline_libs.append('termcap')
278              exts.append( Extension('readline', ['readline.c'],
279 -                                   library_dirs=['/usr/lib/termcap'],
280 +                                   library_dirs=['/usr' + libname + '/termcap'],
281                                     extra_link_args=readline_extra_link_args,
282                                     libraries=readline_libs) )
283          else:
284 @@ -1244,8 +1244,8 @@
285              added_lib_dirs.append('/usr/openwin/lib')
286          elif os.path.exists('/usr/X11R6/include'):
287              include_dirs.append('/usr/X11R6/include')
288 -            added_lib_dirs.append('/usr/X11R6/lib64')
289 -            added_lib_dirs.append('/usr/X11R6/lib')
290 +            added_lib_dirs.append('/usr/X11R6/'+sys.lib)
291 +            #added_lib_dirs.append('/usr/X11R6/lib')
292          elif os.path.exists('/usr/X11R5/include'):
293              include_dirs.append('/usr/X11R5/include')
294              added_lib_dirs.append('/usr/X11R5/lib')
295 --- Python-2.7/Lib/test/test_site.py~   2010-05-14 01:59:41.000000000 +0200
296 +++ Python-2.7/Lib/test/test_site.py    2010-07-05 20:36:37.311186935 +0200
297 @@ -226,7 +226,7 @@
298  
299          if sys.platform in ('os2emx', 'riscos'):
300              self.assertEqual(len(dirs), 1)
301 -            wanted = os.path.join('xoxo', 'Lib', 'site-packages')
302 +            wanted = os.path.join('xoxo', sys.lib, 'site-packages')
303              self.assertEqual(dirs[0], wanted)
304          elif (sys.platform == "darwin" and
305              sysconfig.get_config_var("PYTHONFRAMEWORK")):
306 @@ -242,16 +242,16 @@
307          elif os.sep == '/':
308              # OS X non-framwework builds, Linux, FreeBSD, etc
309              self.assertEqual(len(dirs), 2)
310 -            wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3],
311 +            wanted = os.path.join('xoxo', sys.lib, 'python' + sys.version[:3],
312                                    'site-packages')
313              self.assertEqual(dirs[0], wanted)
314 -            wanted = os.path.join('xoxo', 'lib', 'site-python')
315 +            wanted = os.path.join('xoxo', sys.lib, 'site-python')
316              self.assertEqual(dirs[1], wanted)
317          else:
318              # other platforms
319              self.assertEqual(len(dirs), 2)
320              self.assertEqual(dirs[0], 'xoxo')
321 -            wanted = os.path.join('xoxo', 'lib', 'site-packages')
322 +            wanted = os.path.join('xoxo', sys.lib, 'site-packages')
323              self.assertEqual(dirs[1], wanted)
324  
325  class PthFile(object):
326 --- Python-2.7/Lib/sysconfig.py.org     2010-05-20 00:20:14.000000000 +0200
327 +++ Python-2.7/Lib/sysconfig.py 2010-07-06 08:31:15.687728628 +0200
328 @@ -5,22 +5,24 @@
329  import os
330  from os.path import pardir, realpath
331  
332 +libname = sys.lib
333 +
334  _INSTALL_SCHEMES = {
335      'posix_prefix': {
336 -        'stdlib': '{base}/lib/python{py_version_short}',
337 -        'platstdlib': '{platbase}/lib/python{py_version_short}',
338 -        'purelib': '{base}/lib/python{py_version_short}/site-packages',
339 -        'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
340 +        'stdlib': '{base}/' + libname + '/python{py_version_short}',
341 +        'platstdlib': '{platbase}/' + libname + '/python{py_version_short}',
342 +        'purelib': '{base}/' + libname + '/python{py_version_short}/site-packages',
343 +        'platlib': '{platbase}/' + libname + '/python{py_version_short}/site-packages',
344          'include': '{base}/include/python{py_version_short}',
345          'platinclude': '{platbase}/include/python{py_version_short}',
346          'scripts': '{base}/bin',
347          'data': '{base}',
348          },
349      'posix_home': {
350 -        'stdlib': '{base}/lib/python',
351 -        'platstdlib': '{base}/lib/python',
352 -        'purelib': '{base}/lib/python',
353 -        'platlib': '{base}/lib/python',
354 +        'stdlib': '{base}/' + libname + '/python',
355 +        'platstdlib': '{base}/' + libname + '/python',
356 +        'purelib': '{base}/' + libname + '/python',
357 +        'platlib': '{base}/' + libname + '/python',
358          'include': '{base}/include/python',
359          'platinclude': '{base}/include/python',
360          'scripts': '{base}/bin',
361 @@ -65,10 +67,10 @@
362          'data'   : '{userbase}',
363          },
364      'posix_user': {
365 -        'stdlib': '{userbase}/lib/python{py_version_short}',
366 -        'platstdlib': '{userbase}/lib/python{py_version_short}',
367 -        'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
368 -        'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
369 +        'stdlib': '{userbase}/' + libname + '/python{py_version_short}',
370 +        'platstdlib': '{userbase}/' + libname + '/python{py_version_short}',
371 +        'purelib': '{userbase}/' + libname + '/python{py_version_short}/site-packages',
372 +        'platlib': '{userbase}/' + libname + '/python{py_version_short}/site-packages',
373          'include': '{userbase}/include/python{py_version_short}',
374          'scripts': '{userbase}/bin',
375          'data'   : '{userbase}',
This page took 0.07597 seconds and 3 git commands to generate.