1 --- Python-3.3.1/configure.ac.orig 2013-04-18 16:31:07.244030129 +0200
2 +++ Python-3.3.1/configure.ac 2013-04-18 17:30:31.800622500 +0200
4 MULTIARCH=$($CC --print-multiarch 2>/dev/null)
17 +case $ac_sys_system in
19 + # Test if the compiler is 64bit
20 + echo 'int i;' > conftest.$ac_ext
21 + python_cv_cc_64bit_output=no
22 + if AC_TRY_EVAL(ac_compile); then
23 + case `/usr/bin/file conftest.$ac_objext` in
25 + python_cv_cc_64bit_output=yes
33 +case $ARCH:$python_cv_cc_64bit_output in
34 +powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
48 AC_MSG_CHECKING(LIBRARY)
49 --- Python-3.5.0/Include/pylifecycle.h~ 2015-09-13 13:41:20.000000000 +0200
50 +++ Python-3.5.0/Include/pylifecycle.h 2015-09-13 20:08:24.017308537 +0200
51 @@ -65,6 +65,8 @@ int _Py_CheckPython3();
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-3.2.1.orig/Lib/distutils/command/install.py 2011-07-09 07:58:46.000000000 +0100
61 +++ Python-3.2.1/Lib/distutils/command/install.py 2011-07-12 22:20:12.000000000 +0100
62 @@ -19,6 +19,8 @@ from site import USER_BASE
63 from site import USER_SITE
69 'purelib': '$base/Lib/site-packages',
70 'platlib': '$base/Lib/site-packages',
74 'purelib': '$base/lib/python$py_version_short/site-packages',
75 - 'platlib': '$platbase/lib/python$py_version_short/site-packages',
76 + 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages',
77 'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
78 'scripts': '$base/bin',
82 'purelib': '$base/lib/python',
83 - 'platlib': '$base/lib/python',
84 + 'platlib': '$base/'+libname+'/python',
85 'headers': '$base/include/python/$dist_name',
86 'scripts': '$base/bin',
88 --- Python-3.2.1.orig/Lib/distutils/sysconfig.py 2011-07-09 07:58:47.000000000 +0100
89 +++ Python-3.2.1/Lib/distutils/sysconfig.py 2011-07-12 22:20:12.000000000 +0100
91 prefix = plat_specific and EXEC_PREFIX or PREFIX
93 if os.name == "posix":
98 libpython = os.path.join(prefix,
99 - "lib", "python" + get_python_version())
100 + lib, "python" + get_python_version())
104 --- Python-3.2.1.orig/Lib/distutils/tests/test_install.py 2011-07-09 07:58:47.000000000 +0100
105 +++ Python-3.2.1/Lib/distutils/tests/test_install.py 2011-07-12 22:20:12.000000000 +0100
107 self.assertEqual(got, expected)
109 libdir = os.path.join(destination, "lib", "python")
110 + platlibdir = os.path.join(destination, sys.lib, "python")
111 check_path(cmd.install_lib, libdir)
112 - check_path(cmd.install_platlib, libdir)
113 + check_path(cmd.install_platlib, platlibdir)
114 check_path(cmd.install_purelib, libdir)
115 check_path(cmd.install_headers,
116 os.path.join(destination, "include", "python", "foopkg"))
117 --- Python-3.2.1.orig/Lib/site.py 2011-07-09 07:58:49.000000000 +0100
118 +++ Python-3.2.1/Lib/site.py 2011-07-12 22:20:12.000000000 +0100
119 @@ -304,12 +304,15 @@ def getsitepackages(prefixes=None):
123 - sitepackages.append(os.path.join(prefix, "lib",
124 + sitepackages.append(os.path.join(prefix, sys.lib,
125 "python" + sys.version[:3],
127 + sitepackages.append(os.path.join(prefix, sys.lib, "site-python"))
128 + if sys.lib != 'lib':
129 + sitepackages.append(os.path.join(prefix, "lib", "python" + sys.version[:3], "site-packages"))
131 sitepackages.append(prefix)
132 - sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
133 + sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
134 if sys.platform == "darwin":
135 # for framework builds *only* we add the standard Apple
137 --- Python-3.2.1.orig/Lib/sysconfig.py 2011-07-09 07:58:49.000000000 +0100
138 +++ Python-3.2.1/Lib/sysconfig.py 2011-07-12 22:20:12.000000000 +0100
143 - 'stdlib': '{installed_base}/lib/python{py_version_short}',
144 - 'platstdlib': '{platbase}/lib/python{py_version_short}',
145 + 'stdlib': '{installed_base}/' + sys.lib + '/python{py_version_short}',
146 + 'platstdlib': '{platbase}/' + sys.lib + '/python{py_version_short}',
147 'purelib': '{base}/lib/python{py_version_short}/site-packages',
148 - 'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
149 + 'platlib': '{platbase}/' + sys.lib + '/python{py_version_short}/site-packages',
151 '{installed_base}/include/python{py_version_short}{abiflags}',
157 - 'stdlib': '{installed_base}/lib/python',
158 - 'platstdlib': '{base}/lib/python',
159 + 'stdlib': '{installed_base}/' + sys.lib + '/python',
160 + 'platstdlib': '{base}/' + sys.lib + '/python',
161 'purelib': '{base}/lib/python',
162 - 'platlib': '{base}/lib/python',
163 + 'platlib': '{base}/' + sys.lib + '/python',
164 'include': '{installed_base}/include/python',
165 'platinclude': '{installed_base}/include/python',
166 'scripts': '{base}/bin',
167 --- Python-3.2.1.orig/Makefile.pre.in 2011-07-09 07:58:52.000000000 +0100
168 +++ Python-3.2.1/Makefile.pre.in 2011-07-12 22:20:12.000000000 +0100
171 # Machine-dependent subdirectories
176 # Install prefix for architecture-independent files
180 INCLUDEDIR= @includedir@
181 CONFINCLUDEDIR= $(exec_prefix)/include
182 -SCRIPTDIR= $(prefix)/lib
183 +SCRIPTDIR= $(prefix)/$(LIB)
186 # Detailed destination directories
188 Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H)
190 Python/getplatform.o: $(srcdir)/Python/getplatform.c
191 - $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
192 + $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
194 Python/importdl.o: $(srcdir)/Python/importdl.c
195 $(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
196 --- Python-3.2.1.orig/Modules/getpath.c 2011-07-09 07:58:54.000000000 +0100
197 +++ Python-3.2.1/Modules/getpath.c 2011-07-12 22:21:48.000000000 +0100
199 #define EXEC_PREFIX PREFIX
203 +#if defined(__x86_64__) || (defined(__sparc__) && defined(__arch64__)) || defined(__powerpc64__) || defined(__s390x__)
204 +#if defined(__ILP32__)
205 +#define LIB_PYTHON "libx32/python"
207 +#define LIB_PYTHON "lib64/python"
210 +#define LIB_PYTHON "lib/python"
215 -#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
216 - EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
217 +#define PYTHONPATH PREFIX "/" LIB_PYTHON VERSION ":" \
218 + EXEC_PREFIX "/" LIB_PYTHON VERSION "/lib-dynload:"
222 @@ -502,7 +514,7 @@ calculate_path(void)
223 _pythonpath = Py_DecodeLocale(PYTHONPATH, NULL);
224 _prefix = Py_DecodeLocale(PREFIX, NULL);
225 _exec_prefix = Py_DecodeLocale(EXEC_PREFIX, NULL);
226 - lib_python = Py_DecodeLocale("lib/python" VERSION, NULL);
227 + lib_python = Py_DecodeLocale(LIB_PYTHON VERSION, NULL);
229 if (!_pythonpath || !_prefix || !_exec_prefix || !lib_python) {
231 --- Python-3.2.1.orig/Python/getplatform.c 2011-07-09 07:58:56.000000000 +0100
232 +++ Python-3.2.1/Python/getplatform.c 2011-07-12 22:20:12.000000000 +0100
239 +#define ARCH "unknown"
257 --- Python-3.2.1.orig/Python/sysmodule.c 2011-07-09 07:58:56.000000000 +0100
258 +++ Python-3.2.1/Python/sysmodule.c 2011-07-12 22:20:12.000000000 +0100
259 @@ -1560,6 +1560,10 @@
260 PyUnicode_FromString(Py_GetCopyright()));
261 SET_SYS_FROM_STRING("platform",
262 PyUnicode_FromString(Py_GetPlatform()));
263 + SET_SYS_FROM_STRING("arch",
264 + PyUnicode_FromString(Py_GetArch()));
265 + SET_SYS_FROM_STRING("lib",
266 + PyUnicode_FromString(Py_GetLib()));
267 SET_SYS_FROM_STRING("executable",
268 PyUnicode_FromWideChar(
269 Py_GetProgramFullPath(), -1));
270 --- Python-3.2.1.orig/setup.py 2011-07-09 07:58:56.000000000 +0100
271 +++ Python-3.2.1/setup.py 2011-07-12 22:20:12.000000000 +0100
273 # be assumed that no additional -I,-L directives are needed.
274 if not cross_compiling:
275 lib_dirs = self.compiler.library_dirs + [
276 - '/lib64', '/usr/lib64',
277 - '/lib', '/usr/lib',
278 + '/' + sys.lib, '/usr/' + sys.lib
280 inc_dirs = self.compiler.include_dirs + ['/usr/include']
282 @@ -643,11 +642,11 @@
284 readline_libs.append(curses_library)
285 elif self.compiler.find_library_file(lib_dirs +
286 - ['/usr/lib/termcap'],
287 + ['/usr/' + sys.lib + '/termcap'],
289 readline_libs.append('termcap')
290 exts.append( Extension('readline', ['readline.c'],
291 - library_dirs=['/usr/lib/termcap'],
292 + library_dirs=['/usr/' + sys.lib + '/termcap'],
293 extra_link_args=readline_extra_link_args,
294 libraries=readline_libs) )