1 diff -Nur Python-3.2.1.orig//configure.in Python-3.2.1/configure.in
2 --- Python-3.2.1.orig//configure.in 2011-07-09 07:58:56.000000000 +0100
3 +++ Python-3.2.1/configure.in 2011-07-12 22:20:12.000000000 +0100
18 +case $ac_sys_system in
20 + # Test if the compiler is 64bit
21 + echo 'int i;' > conftest.$ac_ext
22 + python_cv_cc_64bit_output=no
23 + if AC_TRY_EVAL(ac_compile); then
24 + case `/usr/bin/file conftest.$ac_objext` in
26 + python_cv_cc_64bit_output=yes
34 +case $ARCH:$python_cv_cc_64bit_output in
35 +powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
45 AC_MSG_CHECKING(LIBRARY)
46 diff -Nur Python-3.2.1.orig//Include/pythonrun.h Python-3.2.1/Include/pythonrun.h
47 --- Python-3.2.1.orig//Include/pythonrun.h 2011-07-09 07:58:46.000000000 +0100
48 +++ Python-3.2.1/Include/pythonrun.h 2011-07-12 22:20:12.000000000 +0100
50 /* In their own files */
51 PyAPI_FUNC(const char *) Py_GetVersion(void);
52 PyAPI_FUNC(const char *) Py_GetPlatform(void);
53 +PyAPI_FUNC(const char *) Py_GetArch(void);
54 +PyAPI_FUNC(const char *) Py_GetLib(void);
55 PyAPI_FUNC(const char *) Py_GetCopyright(void);
56 PyAPI_FUNC(const char *) Py_GetCompiler(void);
57 PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
58 diff -Nur Python-3.2.1.orig//Lib/distutils/command/install.py Python-3.2.1/Lib/distutils/command/install.py
59 --- Python-3.2.1.orig//Lib/distutils/command/install.py 2011-07-09 07:58:46.000000000 +0100
60 +++ Python-3.2.1/Lib/distutils/command/install.py 2011-07-12 22:20:12.000000000 +0100
62 from site import USER_SITE
67 if sys.version < "2.2":
73 'purelib': '$base/lib/python$py_version_short/site-packages',
74 - 'platlib': '$platbase/lib/python$py_version_short/site-packages',
75 + 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages',
76 'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
77 'scripts': '$base/bin',
81 'purelib': '$base/lib/python',
82 - 'platlib': '$base/lib/python',
83 + 'platlib': '$base/'+libname+'/python',
84 'headers': '$base/include/python/$dist_name',
85 'scripts': '$base/bin',
87 diff -Nur Python-3.2.1.orig//Lib/distutils/sysconfig.py Python-3.2.1/Lib/distutils/sysconfig.py
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 diff -Nur Python-3.2.1.orig//Lib/distutils/tests/test_install.py Python-3.2.1/Lib/distutils/tests/test_install.py
105 --- Python-3.2.1.orig//Lib/distutils/tests/test_install.py 2011-07-09 07:58:47.000000000 +0100
106 +++ Python-3.2.1/Lib/distutils/tests/test_install.py 2011-07-12 22:20:12.000000000 +0100
108 self.assertEqual(got, expected)
110 libdir = os.path.join(destination, "lib", "python")
111 + platlibdir = os.path.join(destination, sys.lib, "python")
112 check_path(cmd.install_lib, libdir)
113 - check_path(cmd.install_platlib, libdir)
114 + check_path(cmd.install_platlib, platlibdir)
115 check_path(cmd.install_purelib, libdir)
116 check_path(cmd.install_headers,
117 os.path.join(destination, "include", "python", "foopkg"))
118 diff -Nur Python-3.2.1.orig//Lib/site.py Python-3.2.1/Lib/site.py
119 --- Python-3.2.1.orig//Lib/site.py 2011-07-09 07:58:49.000000000 +0100
120 +++ Python-3.2.1/Lib/site.py 2011-07-12 22:20:12.000000000 +0100
121 @@ -285,13 +285,16 @@
122 if sys.platform in ('os2emx', 'riscos'):
123 sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
125 - sitepackages.append(os.path.join(prefix, "lib",
126 + sitepackages.append(os.path.join(prefix, sys.lib,
127 "python" + sys.version[:3],
129 - sitepackages.append(os.path.join(prefix, "lib", "site-python"))
130 + sitepackages.append(os.path.join(prefix, sys.lib, "site-python"))
131 + if sys.lib != 'lib':
132 + sitepackages.append(os.path.join(prefix, "lib", "python" + sys.version[:3], "site-packages"))
133 + sitepackages.append(os.path.join(prefix, "lib", "site-python"))
135 sitepackages.append(prefix)
136 - sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
137 + sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
138 if sys.platform == "darwin":
139 # for framework builds *only* we add the standard Apple
141 diff -Nur Python-3.2.1.orig//Lib/sysconfig.py Python-3.2.1/Lib/sysconfig.py
142 --- Python-3.2.1.orig//Lib/sysconfig.py 2011-07-09 07:58:49.000000000 +0100
143 +++ Python-3.2.1/Lib/sysconfig.py 2011-07-12 22:20:12.000000000 +0100
148 - 'stdlib': '{base}/lib/python{py_version_short}',
149 - 'platstdlib': '{platbase}/lib/python{py_version_short}',
150 + 'stdlib': '{base}/' + sys.lib + '/python{py_version_short}',
151 + 'platstdlib': '{platbase}/' + sys.lib + '/python{py_version_short}',
152 'purelib': '{base}/lib/python{py_version_short}/site-packages',
153 - 'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
154 + 'platlib': '{platbase}/' + sys.lib + '/python{py_version_short}/site-packages',
156 '{base}/include/python{py_version_short}{abiflags}',
162 - 'stdlib': '{base}/lib/python',
163 - 'platstdlib': '{base}/lib/python',
164 + 'stdlib': '{base}/' + sys.lib + '/python',
165 + 'platstdlib': '{base}/' + sys.lib + '/python',
166 'purelib': '{base}/lib/python',
167 - 'platlib': '{base}/lib/python',
168 + 'platlib': '{base}/' + sys.lib + '/python',
169 'include': '{base}/include/python',
170 'platinclude': '{base}/include/python',
171 'scripts': '{base}/bin',
172 diff -Nur Python-3.2.1.orig//Makefile.pre.in Python-3.2.1/Makefile.pre.in
173 --- Python-3.2.1.orig//Makefile.pre.in 2011-07-09 07:58:52.000000000 +0100
174 +++ Python-3.2.1/Makefile.pre.in 2011-07-12 22:20:12.000000000 +0100
177 # Machine-dependent subdirectories
182 # Install prefix for architecture-independent files
186 INCLUDEDIR= @includedir@
187 CONFINCLUDEDIR= $(exec_prefix)/include
188 -SCRIPTDIR= $(prefix)/lib
189 +SCRIPTDIR= $(prefix)/$(LIB)
192 # Detailed destination directories
194 Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H)
196 Python/getplatform.o: $(srcdir)/Python/getplatform.c
197 - $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
198 + $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
200 Python/importdl.o: $(srcdir)/Python/importdl.c
201 $(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
202 diff -Nur Python-3.2.1.orig//Modules/getpath.c Python-3.2.1/Modules/getpath.c
203 --- Python-3.2.1.orig//Modules/getpath.c 2011-07-09 07:58:54.000000000 +0100
204 +++ Python-3.2.1/Modules/getpath.c 2011-07-12 22:21:48.000000000 +0100
206 #define EXEC_PREFIX PREFIX
210 +#if defined(__x86_64__) || (defined(__sparc__) && defined(__arch64__)) || defined(__powerpc64__) || defined(__s390x__)
211 +#define LIB_PYTHON L"lib64/python"
213 +#define LIB_PYTHON L"lib/python"
218 -#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
219 - EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
220 +#define PYTHONPATH PREFIX "/" LIB_PYTHON VERSION ":" \
221 + EXEC_PREFIX "/" LIB_PYTHON VERSION "/lib-dynload:"
226 static wchar_t progpath[MAXPATHLEN+1];
227 static wchar_t *module_search_path = NULL;
228 static int module_search_path_malloced = 0;
229 -static wchar_t *lib_python = L"lib/python" VERSION;
230 ++static wchar_t *lib_python = LIB_PYTHON VERSION;
234 diff -Nur Python-3.2.1.orig//Python/getplatform.c Python-3.2.1/Python/getplatform.c
235 --- Python-3.2.1.orig//Python/getplatform.c 2011-07-09 07:58:56.000000000 +0100
236 +++ Python-3.2.1/Python/getplatform.c 2011-07-12 22:20:12.000000000 +0100
243 +#define ARCH "unknown"
261 diff -Nur Python-3.2.1.orig//Python/sysmodule.c Python-3.2.1/Python/sysmodule.c
262 --- Python-3.2.1.orig//Python/sysmodule.c 2011-07-09 07:58:56.000000000 +0100
263 +++ Python-3.2.1/Python/sysmodule.c 2011-07-12 22:20:12.000000000 +0100
264 @@ -1560,6 +1560,10 @@
265 PyUnicode_FromString(Py_GetCopyright()));
266 SET_SYS_FROM_STRING("platform",
267 PyUnicode_FromString(Py_GetPlatform()));
268 + SET_SYS_FROM_STRING("arch",
269 + PyUnicode_FromString(Py_GetArch()));
270 + SET_SYS_FROM_STRING("lib",
271 + PyUnicode_FromString(Py_GetLib()));
272 SET_SYS_FROM_STRING("executable",
273 PyUnicode_FromWideChar(
274 Py_GetProgramFullPath(), -1));
275 diff -Nur Python-3.2.1.orig//setup.py Python-3.2.1/setup.py
276 --- Python-3.2.1.orig//setup.py 2011-07-09 07:58:56.000000000 +0100
277 +++ Python-3.2.1/setup.py 2011-07-12 22:20:12.000000000 +0100
278 @@ -445,12 +445,12 @@
279 add_dir_to_list(self.compiler.include_dirs,
280 sysconfig.get_config_var("INCLUDEDIR"))
283 # lib_dirs and inc_dirs are used to search for files;
284 # if a file is found in one of those directories, it can
285 # be assumed that no additional -I,-L directives are needed.
286 lib_dirs = self.compiler.library_dirs + [
287 - '/lib64', '/usr/lib64',
288 - '/lib', '/usr/lib',
289 + libname, '/usr/'+libname
291 inc_dirs = self.compiler.include_dirs + ['/usr/include']
293 @@ -643,11 +643,11 @@
295 readline_libs.append(curses_library)
296 elif self.compiler.find_library_file(lib_dirs +
297 - ['/usr/lib/termcap'],
298 + ['/usr/' + libname + '/termcap'],
300 readline_libs.append('termcap')
301 exts.append( Extension('readline', ['readline.c'],
302 - library_dirs=['/usr/lib/termcap'],
303 + library_dirs=['/usr/' + libname + '/termcap'],
304 extra_link_args=readline_extra_link_args,
305 libraries=readline_libs) )