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
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
15 from site import USER_SITE
20 if sys.version < "2.2":
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',
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',
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
46 prefix = plat_specific and EXEC_PREFIX or PREFIX
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())
55 + libpython = os.path.join(prefix,
56 + "share", "python" + get_python_version())
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
63 expected = os.path.normpath(expected)
64 self.assertEqual(got, expected)
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
74 if sys.platform in ('os2emx', 'riscos'):
75 sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
77 - sitepackages.append(os.path.join(prefix, "lib",
78 + sitepackages.append(os.path.join(prefix, sys.lib,
79 "python" + sys.version[:3],
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],
86 + sitepackages.append(os.path.join(prefix, "share", "site-python"))
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
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
98 from os.path import pardir, realpath
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',
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',
130 'data' : '{userbase}',
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}',
146 inc_dir = _PROJECT_BASE
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')
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
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)
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],
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)
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)
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
190 # Machine-dependent subdirectories
195 # Multiarch directory (may be empty)
196 MULTIARCH= @MULTIARCH@
199 INCLUDEDIR= @includedir@
200 CONFINCLUDEDIR= $(exec_prefix)/include
201 -SCRIPTDIR= $(prefix)/lib
202 +SCRIPTDIR= $(prefix)/$(LIB)
204 # Detailed destination directories
205 BINLIBDEST= $(LIBDIR)/python$(VERSION)
207 Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H)
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
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
218 #define EXEC_PREFIX PREFIX
222 +#if defined(__x86_64__) || (defined(__sparc__) && defined(__arch64__)) || defined(__powerpc64__) || defined(__s390x__)
223 +#if defined(__ILP32__)
224 +#define LIB_PYTHON "libx32/python"
226 +#define LIB_PYTHON "lib64/python"
229 +#define LIB_PYTHON "lib/python"
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:"
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;
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
258 +#define ARCH "unknown"
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
296 +AC_MSG_CHECKING(ARCH)
301 +AC_MSG_RESULT($ARCH)
304 +AC_MSG_CHECKING(LIB)
305 +case $ac_sys_system in
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
313 + python_cv_cc_64bit_output=yes
321 +case $ARCH:$python_cv_cc_64bit_output in
322 +powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
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
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.
348 add_dir_to_list(inc_dirs, d)
350 - '/lib64', '/usr/lib64',
351 - '/lib', '/usr/lib',
352 + libname, '/usr/'+libname
354 add_dir_to_list(lib_dirs, d)
356 @@ -762,11 +762,11 @@
358 readline_libs.append(curses_library)
359 elif self.compiler.find_library_file(lib_dirs +
360 - ['/usr/lib/termcap'],
361 + ['/usr' + libname + '/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) )
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')