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