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)
45 AC_MSG_CHECKING(LIBRARY)
46 --- Python-3.2.1.orig/Include/pythonrun.h 2011-07-09 07:58:46.000000000 +0100
47 +++ Python-3.2.1/Include/pythonrun.h 2011-07-12 22:20:12.000000000 +0100
49 /* In their own files */
50 PyAPI_FUNC(const char *) Py_GetVersion(void);
51 PyAPI_FUNC(const char *) Py_GetPlatform(void);
52 +PyAPI_FUNC(const char *) Py_GetArch(void);
53 +PyAPI_FUNC(const char *) Py_GetLib(void);
54 PyAPI_FUNC(const char *) Py_GetCopyright(void);
55 PyAPI_FUNC(const char *) Py_GetCompiler(void);
56 PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
57 --- Python-3.2.1.orig/Lib/distutils/command/install.py 2011-07-09 07:58:46.000000000 +0100
58 +++ Python-3.2.1/Lib/distutils/command/install.py 2011-07-12 22:20:12.000000000 +0100
60 from site import USER_SITE
65 if sys.version < "2.2":
71 'purelib': '$base/lib/python$py_version_short/site-packages',
72 - 'platlib': '$platbase/lib/python$py_version_short/site-packages',
73 + 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages',
74 'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
75 'scripts': '$base/bin',
79 'purelib': '$base/lib/python',
80 - 'platlib': '$base/lib/python',
81 + 'platlib': '$base/'+libname+'/python',
82 'headers': '$base/include/python/$dist_name',
83 'scripts': '$base/bin',
85 --- Python-3.2.1.orig/Lib/distutils/sysconfig.py 2011-07-09 07:58:47.000000000 +0100
86 +++ Python-3.2.1/Lib/distutils/sysconfig.py 2011-07-12 22:20:12.000000000 +0100
88 prefix = plat_specific and EXEC_PREFIX or PREFIX
90 if os.name == "posix":
95 libpython = os.path.join(prefix,
96 - "lib", "python" + get_python_version())
97 + lib, "python" + get_python_version())
101 --- Python-3.2.1.orig/Lib/distutils/tests/test_install.py 2011-07-09 07:58:47.000000000 +0100
102 +++ Python-3.2.1/Lib/distutils/tests/test_install.py 2011-07-12 22:20:12.000000000 +0100
104 self.assertEqual(got, expected)
106 libdir = os.path.join(destination, "lib", "python")
107 + platlibdir = os.path.join(destination, sys.lib, "python")
108 check_path(cmd.install_lib, libdir)
109 - check_path(cmd.install_platlib, libdir)
110 + check_path(cmd.install_platlib, platlibdir)
111 check_path(cmd.install_purelib, libdir)
112 check_path(cmd.install_headers,
113 os.path.join(destination, "include", "python", "foopkg"))
114 --- Python-3.2.1.orig/Lib/site.py 2011-07-09 07:58:49.000000000 +0100
115 +++ Python-3.2.1/Lib/site.py 2011-07-12 22:20:12.000000000 +0100
116 @@ -285,13 +285,16 @@
117 if sys.platform in ('os2emx', 'riscos'):
118 sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
120 - sitepackages.append(os.path.join(prefix, "lib",
121 + sitepackages.append(os.path.join(prefix, sys.lib,
122 "python" + sys.version[:3],
124 - sitepackages.append(os.path.join(prefix, "lib", "site-python"))
125 + sitepackages.append(os.path.join(prefix, sys.lib, "site-python"))
126 + if sys.lib != 'lib':
127 + sitepackages.append(os.path.join(prefix, "lib", "python" + sys.version[:3], "site-packages"))
128 + sitepackages.append(os.path.join(prefix, "lib", "site-python"))
130 sitepackages.append(prefix)
131 - sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
132 + sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
133 if sys.platform == "darwin":
134 # for framework builds *only* we add the standard Apple
136 --- Python-3.2.1.orig/Lib/sysconfig.py 2011-07-09 07:58:49.000000000 +0100
137 +++ Python-3.2.1/Lib/sysconfig.py 2011-07-12 22:20:12.000000000 +0100
142 - 'stdlib': '{installed_base}/lib/python{py_version_short}',
143 - 'platstdlib': '{platbase}/lib/python{py_version_short}',
144 + 'stdlib': '{installed_base}/' + sys.lib + '/python{py_version_short}',
145 + 'platstdlib': '{platbase}/' + sys.lib + '/python{py_version_short}',
146 'purelib': '{base}/lib/python{py_version_short}/site-packages',
147 - 'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
148 + 'platlib': '{platbase}/' + sys.lib + '/python{py_version_short}/site-packages',
150 '{installed_base}/include/python{py_version_short}{abiflags}',
156 - 'stdlib': '{installed_base}/lib/python',
157 - 'platstdlib': '{base}/lib/python',
158 + 'stdlib': '{installed_base}/' + sys.lib + '/python',
159 + 'platstdlib': '{base}/' + sys.lib + '/python',
160 'purelib': '{base}/lib/python',
161 - 'platlib': '{base}/lib/python',
162 + 'platlib': '{base}/' + sys.lib + '/python',
163 'include': '{installed_base}/include/python',
164 'platinclude': '{installed_base}/include/python',
165 'scripts': '{base}/bin',
166 --- Python-3.2.1.orig/Makefile.pre.in 2011-07-09 07:58:52.000000000 +0100
167 +++ Python-3.2.1/Makefile.pre.in 2011-07-12 22:20:12.000000000 +0100
170 # Machine-dependent subdirectories
175 # Install prefix for architecture-independent files
179 INCLUDEDIR= @includedir@
180 CONFINCLUDEDIR= $(exec_prefix)/include
181 -SCRIPTDIR= $(prefix)/lib
182 +SCRIPTDIR= $(prefix)/$(LIB)
185 # Detailed destination directories
187 Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H)
189 Python/getplatform.o: $(srcdir)/Python/getplatform.c
190 - $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
191 + $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
193 Python/importdl.o: $(srcdir)/Python/importdl.c
194 $(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
195 --- Python-3.2.1.orig/Modules/getpath.c 2011-07-09 07:58:54.000000000 +0100
196 +++ Python-3.2.1/Modules/getpath.c 2011-07-12 22:21:48.000000000 +0100
198 #define EXEC_PREFIX PREFIX
202 +#if defined(__x86_64__) || (defined(__sparc__) && defined(__arch64__)) || defined(__powerpc64__) || defined(__s390x__)
203 +#define LIB_PYTHON L"lib64/python"
205 +#define LIB_PYTHON L"lib/python"
210 -#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
211 - EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
212 +#define PYTHONPATH PREFIX "/" LIB_PYTHON VERSION ":" \
213 + EXEC_PREFIX "/" LIB_PYTHON VERSION "/lib-dynload:"
218 static wchar_t progpath[MAXPATHLEN+1];
219 static wchar_t *module_search_path = NULL;
220 static int module_search_path_malloced = 0;
221 -static wchar_t *lib_python = L"lib/python" VERSION;
222 ++static wchar_t *lib_python = LIB_PYTHON VERSION;
226 --- Python-3.2.1.orig/Python/getplatform.c 2011-07-09 07:58:56.000000000 +0100
227 +++ Python-3.2.1/Python/getplatform.c 2011-07-12 22:20:12.000000000 +0100
234 +#define ARCH "unknown"
252 --- Python-3.2.1.orig/Python/sysmodule.c 2011-07-09 07:58:56.000000000 +0100
253 +++ Python-3.2.1/Python/sysmodule.c 2011-07-12 22:20:12.000000000 +0100
254 @@ -1560,6 +1560,10 @@
255 PyUnicode_FromString(Py_GetCopyright()));
256 SET_SYS_FROM_STRING("platform",
257 PyUnicode_FromString(Py_GetPlatform()));
258 + SET_SYS_FROM_STRING("arch",
259 + PyUnicode_FromString(Py_GetArch()));
260 + SET_SYS_FROM_STRING("lib",
261 + PyUnicode_FromString(Py_GetLib()));
262 SET_SYS_FROM_STRING("executable",
263 PyUnicode_FromWideChar(
264 Py_GetProgramFullPath(), -1));
265 --- Python-3.2.1.orig/setup.py 2011-07-09 07:58:56.000000000 +0100
266 +++ Python-3.2.1/setup.py 2011-07-12 22:20:12.000000000 +0100
268 # be assumed that no additional -I,-L directives are needed.
269 if not cross_compiling:
270 lib_dirs = self.compiler.library_dirs + [
271 - '/lib64', '/usr/lib64',
272 - '/lib', '/usr/lib',
273 + '/' + sys.lib, '/usr/' + sys.lib
275 inc_dirs = self.compiler.include_dirs + ['/usr/include']
277 @@ -643,11 +643,11 @@
279 readline_libs.append(curses_library)
280 elif self.compiler.find_library_file(lib_dirs +
281 - ['/usr/lib/termcap'],
282 + ['/usr/' + sys.lib + '/termcap'],
284 readline_libs.append('termcap')
285 exts.append( Extension('readline', ['readline.c'],
286 - library_dirs=['/usr/lib/termcap'],
287 + library_dirs=['/usr/' + sys.lib + '/termcap'],
288 extra_link_args=readline_extra_link_args,
289 libraries=readline_libs) )