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
73 @@ -288,13 +288,18 @@ def getsitepackages():
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"))
89 sitepackages.append(prefix)
90 - sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
91 + sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
94 def addsitepackages(known_paths):
95 --- Python-2.7.10.orig/Lib/sysconfig.py 2015-05-23 18:09:07.000000000 +0200
96 +++ Python-2.7.10/Lib/sysconfig.py 2015-12-02 19:33:48.483250053 +0100
99 from os.path import pardir, realpath
105 - 'stdlib': '{base}/lib/python{py_version_short}',
106 - 'platstdlib': '{platbase}/lib/python{py_version_short}',
107 - 'purelib': '{base}/lib/python{py_version_short}/site-packages',
108 - 'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
109 + 'stdlib': '{base}/' + libname + '/python{py_version_short}',
110 + 'platstdlib': '{platbase}/' + libname + '/python{py_version_short}',
111 + 'purelib': '{base}/' + libname + '/python{py_version_short}/site-packages',
112 + 'platlib': '{platbase}/' + libname + '/python{py_version_short}/site-packages',
113 'include': '{base}/include/python{py_version_short}',
114 'platinclude': '{platbase}/include/python{py_version_short}',
115 'scripts': '{base}/bin',
119 - 'stdlib': '{base}/lib/python',
120 - 'platstdlib': '{base}/lib/python',
121 - 'purelib': '{base}/lib/python',
122 - 'platlib': '{base}/lib/python',
123 + 'stdlib': '{base}/' + libname + '/python',
124 + 'platstdlib': '{base}/' + libname + '/python',
125 + 'purelib': '{base}/' + libname + '/python',
126 + 'platlib': '{base}/' + libname + '/python',
127 'include': '{base}/include/python',
128 'platinclude': '{base}/include/python',
129 'scripts': '{base}/bin',
131 'data' : '{userbase}',
134 - 'stdlib': '{userbase}/lib/python{py_version_short}',
135 - 'platstdlib': '{userbase}/lib/python{py_version_short}',
136 - 'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
137 - 'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
138 + 'stdlib': '{userbase}/' + libname + '/python{py_version_short}',
139 + 'platstdlib': '{userbase}/' + libname + '/python{py_version_short}',
140 + 'purelib': '{userbase}/' + libname + '/python{py_version_short}/site-packages',
141 + 'platlib': '{userbase}/' + libname + '/python{py_version_short}/site-packages',
142 'include': '{userbase}/include/python{py_version_short}',
143 'scripts': '{userbase}/bin',
144 'data' : '{userbase}',
147 inc_dir = _PROJECT_BASE
149 - inc_dir = get_path('platinclude')
150 + inc_dir = os.path.join(get_path('platstdlib'), "config")
151 return os.path.join(inc_dir, 'pyconfig.h')
153 def get_scheme_names():
154 --- Python-2.7.10.orig/Lib/test/test_site.py 2015-05-23 18:09:12.000000000 +0200
155 +++ Python-2.7.10/Lib/test/test_site.py 2015-12-02 19:31:20.058862685 +0100
158 if sys.platform in ('os2emx', 'riscos'):
159 self.assertEqual(len(dirs), 1)
160 - wanted = os.path.join('xoxo', 'Lib', 'site-packages')
161 + wanted = os.path.join('xoxo', sys.lib, 'site-packages')
162 self.assertEqual(dirs[0], wanted)
163 elif (sys.platform == "darwin" and
164 sysconfig.get_config_var("PYTHONFRAMEWORK")):
165 @@ -235,17 +235,17 @@ class HelperFunctionsTests(unittest.Test
166 self.assertEqual(dirs[0], wanted)
168 # OS X, Linux, FreeBSD, etc
169 - self.assertEqual(len(dirs), 2)
170 - wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3],
171 + self.assertEqual(len(dirs), 4)
172 + wanted = os.path.join('xoxo', sys.lib, 'python' + sys.version[:3],
174 self.assertEqual(dirs[0], wanted)
175 - wanted = os.path.join('xoxo', 'lib', 'site-python')
176 + wanted = os.path.join('xoxo', sys.lib, 'site-python')
177 self.assertEqual(dirs[1], wanted)
180 self.assertEqual(len(dirs), 2)
181 self.assertEqual(dirs[0], 'xoxo')
182 - wanted = os.path.join('xoxo', 'lib', 'site-packages')
183 + wanted = os.path.join('xoxo', sys.lib, 'site-packages')
184 self.assertEqual(dirs[1], wanted)
186 class PthFile(object):
187 --- Python-2.7.10.orig/Makefile.pre.in 2015-12-02 19:31:01.322061528 +0100
188 +++ Python-2.7.10/Makefile.pre.in 2015-12-02 19:31:20.058862685 +0100
191 # Machine-dependent subdirectories
196 # Multiarch directory (may be empty)
197 MULTIARCH= @MULTIARCH@
200 INCLUDEDIR= @includedir@
201 CONFINCLUDEDIR= $(exec_prefix)/include
202 -SCRIPTDIR= $(prefix)/lib
203 +SCRIPTDIR= $(prefix)/$(LIB)
205 # Detailed destination directories
206 BINLIBDEST= $(LIBDIR)/python$(VERSION)
208 Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H)
210 Python/getplatform.o: $(srcdir)/Python/getplatform.c
211 - $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
212 + $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
214 Python/importdl.o: $(srcdir)/Python/importdl.c
215 $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
216 --- Python-2.7.10.orig/Modules/getpath.c 2015-05-23 18:09:20.000000000 +0200
217 +++ Python-2.7.10/Modules/getpath.c 2015-12-02 19:31:20.062196042 +0100
223 +#if defined(__x86_64__) || (defined(__sparc__) && defined(__arch64__)) || defined(__powerpc64__) || defined(__s390x__)
224 +#if defined(__ILP32__)
225 +#define LIB_PYTHON "libx32/python"
227 +#define LIB_PYTHON "lib64/python"
230 +#define LIB_PYTHON "lib/python"
234 #if !defined(PREFIX) || !defined(EXEC_PREFIX) || !defined(VERSION) || !defined(VPATH)
235 #error "PREFIX, EXEC_PREFIX, VERSION, and VPATH must be constant defined"
237 static char exec_prefix[MAXPATHLEN+1];
238 static char progpath[MAXPATHLEN+1];
239 static char *module_search_path = NULL;
240 -static char lib_python[] = "lib/python" VERSION;
241 +static char lib_python[] = LIB_PYTHON VERSION;
245 --- Python-2.7.10.orig/Python/getplatform.c 2015-05-23 18:09:24.000000000 +0200
246 +++ Python-2.7.10/Python/getplatform.c 2015-12-02 19:31:20.062196042 +0100
253 +#define ARCH "unknown"
271 --- Python-2.7.10.orig/Python/sysmodule.c 2015-05-23 18:09:24.000000000 +0200
272 +++ Python-2.7.10/Python/sysmodule.c 2015-12-02 19:31:20.062196042 +0100
273 @@ -1437,6 +1437,10 @@
274 PyString_FromString(Py_GetCopyright()));
275 SET_SYS_FROM_STRING("platform",
276 PyString_FromString(Py_GetPlatform()));
277 + SET_SYS_FROM_STRING("arch",
278 + PyString_FromString(Py_GetArch()));
279 + SET_SYS_FROM_STRING("lib",
280 + PyString_FromString(Py_GetLib()));
281 SET_SYS_FROM_STRING("executable",
282 PyString_FromString(Py_GetProgramFullPath()));
283 SET_SYS_FROM_STRING("prefix",
284 --- Python-2.7.10.orig/configure.ac 2015-12-02 19:31:01.322061528 +0100
285 +++ Python-2.7.10/configure.ac 2015-12-02 19:31:20.062196042 +0100
291 +AC_MSG_CHECKING(ARCH)
296 +AC_MSG_RESULT($ARCH)
299 +AC_MSG_CHECKING(LIB)
300 +case $ac_sys_system in
302 + # Test if the compiler is 64bit
303 + echo 'int i;' > conftest.$ac_ext
304 + python_cv_cc_64bit_output=no
305 + if AC_TRY_EVAL(ac_compile); then
306 + case `/usr/bin/file conftest.$ac_objext` in
308 + python_cv_cc_64bit_output=yes
316 +case $ARCH:$python_cv_cc_64bit_output in
317 +powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
330 AC_MSG_CHECKING(LIBRARY)
331 --- Python-2.7.10.orig/setup.py 2015-12-02 19:31:01.312061456 +0100
332 +++ Python-2.7.10/setup.py 2015-12-02 19:31:20.062196042 +0100
338 # lib_dirs and inc_dirs are used to search for files;
339 # if a file is found in one of those directories, it can
340 # be assumed that no additional -I,-L directives are needed.
343 add_dir_to_list(inc_dirs, d)
345 - '/lib64', '/usr/lib64',
346 - '/lib', '/usr/lib',
347 + libname, '/usr/'+libname
349 add_dir_to_list(lib_dirs, d)
351 @@ -762,11 +762,11 @@
353 readline_libs.append(curses_library)
354 elif self.compiler.find_library_file(lib_dirs +
355 - ['/usr/lib/termcap'],
356 + ['/usr' + libname + '/termcap'],
358 readline_libs.append('termcap')
359 exts.append( Extension('readline', ['readline.c'],
360 - library_dirs=['/usr/lib/termcap'],
361 + library_dirs=['/usr' + libname + '/termcap'],
362 extra_link_args=readline_extra_link_args,
363 libraries=readline_libs) )
365 @@ -1925,8 +1925,8 @@
366 added_lib_dirs.append('/usr/openwin/lib')
367 elif os.path.exists('/usr/X11R6/include'):
368 include_dirs.append('/usr/X11R6/include')
369 - added_lib_dirs.append('/usr/X11R6/lib64')
370 - added_lib_dirs.append('/usr/X11R6/lib')
371 + added_lib_dirs.append('/usr/X11R6/'+sys.lib)
372 + #added_lib_dirs.append('/usr/X11R6/lib')
373 elif os.path.exists('/usr/X11R5/include'):
374 include_dirs.append('/usr/X11R5/include')
375 added_lib_dirs.append('/usr/X11R5/lib')