Skip to content

Commit 8177af1

Browse files
committed
add python3
0 parents  commit 8177af1

7 files changed

Lines changed: 1149 additions & 0 deletions

python3-cflags.patch

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
diff -aurN Python-3.3.0.orig/Makefile.pre.in Python-3.3.0/Makefile.pre.in
2+
--- Python-3.3.0.orig/Makefile.pre.in 2012-10-02 15:36:16.893303385 +0200
3+
+++ Python-3.3.0/Makefile.pre.in 2012-10-02 15:36:56.103717219 +0200
4+
@@ -464,7 +464,7 @@
5+
6+
# Build the interpreter
7+
$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY)
8+
- $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Modules/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
9+
+ $(LINKCC) $(CFLAGS) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Modules/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
10+
11+
platform: $(BUILDPYTHON) $(SYSCONFIGDATA)
12+
$(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print(get_platform()+"-"+sys.version[0:3])' >platform
13+
@@ -581,7 +581,7 @@
14+
fi
15+
16+
Modules/_testembed: Modules/_testembed.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY)
17+
- $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Modules/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
18+
+ $(LINKCC) $(CFLAGS) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Modules/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
19+
20+
############################################################################
21+
# Importlib
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
--- Python-2.7.2/Lib/distutils/tests/test_install.py.lib64 2011-09-08 17:51:57.851405376 -0400
2+
+++ Python-2.7.2/Lib/distutils/tests/test_install.py 2011-09-08 18:40:46.754205096 -0400
3+
@@ -41,8 +41,9 @@ class InstallTestCase(support.TempdirMan
4+
self.assertEqual(got, expected)
5+
6+
libdir = os.path.join(destination, "lib", "python")
7+
+ platlibdir = os.path.join(destination, "lib64", "python")
8+
check_path(cmd.install_lib, libdir)
9+
- check_path(cmd.install_platlib, libdir)
10+
+ check_path(cmd.install_platlib, platlibdir)
11+
check_path(cmd.install_purelib, libdir)
12+
check_path(cmd.install_headers,
13+
os.path.join(destination, "include", "python", "foopkg"))

python3-lib64-regex.patch

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--- Python-2.3.4/Lib/test/test_re.py 2004-04-20 23:32:33.000000000 +0200
2+
+++ Python-2.3.4/Lib/test/test_re.py.lib64-regex 2004-05-29 17:36:52.000000000 +0200
3+
@@ -497,6 +497,15 @@
4+
self.assert_(re.compile('bug_926075') is not
5+
re.compile(eval("u'bug_926075'")))
6+
7+
+ def test_bug_931848(self):
8+
+ try:
9+
+ unicode
10+
+ except NameError:
11+
+ pass
12+
+ pattern = eval('u"[\u002E\u3002\uFF0E\uFF61]"')
13+
+ self.assertEqual(re.compile(pattern).split("a.b.c"),
14+
+ ['a','b','c'])
15+
+
16+
def run_re_tests():
17+
from test.re_tests import benchmarks, tests, SUCCEED, FAIL, SYNTAX_ERROR
18+
if verbose:

python3-lib64.patch

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
diff -aurN Python-3.3.0.orig/Lib/distutils/command/install.py Python-3.3.0/Lib/distutils/command/install.py
2+
--- Python-3.3.0.orig/Lib/distutils/command/install.py 2012-10-02 15:36:16.888303199 +0200
3+
+++ Python-3.3.0/Lib/distutils/command/install.py 2012-10-02 15:42:47.969469921 +0200
4+
@@ -45,14 +45,14 @@
5+
INSTALL_SCHEMES = {
6+
'unix_prefix': {
7+
'purelib': '$base/lib/python$py_version_short/site-packages',
8+
- 'platlib': '$platbase/lib/python$py_version_short/site-packages',
9+
+ 'platlib': '$platbase/lib64/python$py_version_short/site-packages',
10+
'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
11+
'scripts': '$base/bin',
12+
'data' : '$base',
13+
},
14+
'unix_home': {
15+
'purelib': '$base/lib/python',
16+
- 'platlib': '$base/lib/python',
17+
+ 'platlib': '$base/lib64/python',
18+
'headers': '$base/include/python/$dist_name',
19+
'scripts': '$base/bin',
20+
'data' : '$base',
21+
diff -aurN Python-3.3.0.orig/Lib/distutils/sysconfig.py Python-3.3.0/Lib/distutils/sysconfig.py
22+
--- Python-3.3.0.orig/Lib/distutils/sysconfig.py 2012-10-02 15:36:16.888303199 +0200
23+
+++ Python-3.3.0/Lib/distutils/sysconfig.py 2012-10-02 15:45:39.486653263 +0200
24+
@@ -139,8 +139,12 @@
25+
prefix = plat_specific and EXEC_PREFIX or PREFIX
26+
27+
if os.name == "posix":
28+
+ if plat_specific or standard_lib:
29+
+ lib = "lib64"
30+
+ else:
31+
+ lib = "lib"
32+
libpython = os.path.join(prefix,
33+
- "lib", "python" + get_python_version())
34+
+ lib, "python" + get_python_version())
35+
if standard_lib:
36+
return libpython
37+
else:
38+
diff -aurN Python-3.3.0.orig/Lib/site.py Python-3.3.0/Lib/site.py
39+
--- Python-3.3.0.orig/Lib/site.py 2012-10-02 15:36:16.877302790 +0200
40+
+++ Python-3.3.0/Lib/site.py 2012-10-02 15:49:53.994838722 +0200
41+
@@ -303,12 +303,16 @@
42+
if sys.platform in ('os2emx', 'riscos'):
43+
sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
44+
elif os.sep == '/':
45+
+ sitepackages.append(os.path.join(prefix, "lib64",
46+
+ "python" + sys.version[:3],
47+
+ "site-packages"))
48+
sitepackages.append(os.path.join(prefix, "lib",
49+
"python" + sys.version[:3],
50+
"site-packages"))
51+
sitepackages.append(os.path.join(prefix, "lib", "site-python"))
52+
else:
53+
sitepackages.append(prefix)
54+
+ sitepackages.append(os.path.join(prefix, "lib64", "site-packages"))
55+
sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
56+
if sys.platform == "darwin":
57+
# for framework builds *only* we add the standard Apple
58+
diff -aurN Python-3.3.0.orig/Lib/sysconfig.py Python-3.3.0/Lib/sysconfig.py
59+
--- Python-3.3.0.orig/Lib/sysconfig.py 2012-10-02 15:36:16.891303311 +0200
60+
+++ Python-3.3.0/Lib/sysconfig.py 2012-10-02 15:51:54.318165617 +0200
61+
@@ -21,10 +21,10 @@
62+
63+
_INSTALL_SCHEMES = {
64+
'posix_prefix': {
65+
- 'stdlib': '{installed_base}/lib/python{py_version_short}',
66+
- 'platstdlib': '{platbase}/lib/python{py_version_short}',
67+
+ 'stdlib': '{installed_base}/lib64/python{py_version_short}',
68+
+ 'platstdlib': '{platbase}/lib64/python{py_version_short}',
69+
'purelib': '{base}/lib/python{py_version_short}/site-packages',
70+
- 'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
71+
+ 'platlib': '{platbase}/lib64/python{py_version_short}/site-packages',
72+
'include':
73+
'{installed_base}/include/python{py_version_short}{abiflags}',
74+
'platinclude':
75+
@@ -33,10 +33,10 @@
76+
'data': '{base}',
77+
},
78+
'posix_home': {
79+
- 'stdlib': '{installed_base}/lib/python',
80+
- 'platstdlib': '{base}/lib/python',
81+
+ 'stdlib': '{installed_base}/lib64/python',
82+
+ 'platstdlib': '{base}/lib64/python',
83+
'purelib': '{base}/lib/python',
84+
- 'platlib': '{base}/lib/python',
85+
+ 'platlib': '{base}/lib64/python',
86+
'include': '{installed_base}/include/python',
87+
'platinclude': '{installed_base}/include/python',
88+
'scripts': '{base}/bin',
89+
@@ -81,10 +81,10 @@
90+
'data': '{userbase}',
91+
},
92+
'posix_user': {
93+
- 'stdlib': '{userbase}/lib/python{py_version_short}',
94+
- 'platstdlib': '{userbase}/lib/python{py_version_short}',
95+
+ 'stdlib': '{userbase}/lib64/python{py_version_short}',
96+
+ 'platstdlib': '{userbase}/lib64/python{py_version_short}',
97+
'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
98+
- 'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
99+
+ 'platlib': '{userbase}/lib64/python{py_version_short}/site-packages',
100+
'include': '{userbase}/include/python{py_version_short}',
101+
'scripts': '{userbase}/bin',
102+
'data': '{userbase}',
103+
diff -aurN Python-3.3.0.orig/Modules/getpath.c Python-3.3.0/Modules/getpath.c
104+
--- Python-3.3.0.orig/Modules/getpath.c 2012-10-02 15:36:16.860302152 +0200
105+
+++ Python-3.3.0/Modules/getpath.c 2012-10-02 15:57:35.280477469 +0200
106+
@@ -123,7 +123,7 @@
107+
108+
#ifndef PYTHONPATH
109+
#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
110+
- EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
111+
+ EXEC_PREFIX "/lib64/python" VERSION "/lib-dynload"
112+
#endif
113+
114+
#ifndef LANDMARK
115+
@@ -136,6 +136,7 @@
116+
static wchar_t *module_search_path = NULL;
117+
static int module_search_path_malloced = 0;
118+
static wchar_t *lib_python = L"lib/python" VERSION;
119+
+static wchar_t *lib64_python = L"lib64/python" VERSION;
120+
121+
static void
122+
reduce(wchar_t *dir)
123+
@@ -391,7 +392,7 @@
124+
wcsncpy(exec_prefix, delim+1, MAXPATHLEN);
125+
else
126+
wcsncpy(exec_prefix, home, MAXPATHLEN);
127+
- joinpath(exec_prefix, lib_python);
128+
+ joinpath(exec_prefix, lib64_python);
129+
joinpath(exec_prefix, L"lib-dynload");
130+
return 1;
131+
}
132+
@@ -432,7 +433,7 @@
133+
copy_absolute(exec_prefix, argv0_path, MAXPATHLEN+1);
134+
do {
135+
n = wcslen(exec_prefix);
136+
- joinpath(exec_prefix, lib_python);
137+
+ joinpath(exec_prefix, lib64_python);
138+
joinpath(exec_prefix, L"lib-dynload");
139+
if (isdir(exec_prefix))
140+
return 1;
141+
@@ -442,7 +443,7 @@
142+
143+
/* Look at configure's EXEC_PREFIX */
144+
wcsncpy(exec_prefix, _exec_prefix, MAXPATHLEN);
145+
- joinpath(exec_prefix, lib_python);
146+
+ joinpath(exec_prefix, lib64_python);
147+
joinpath(exec_prefix, L"lib-dynload");
148+
if (isdir(exec_prefix))
149+
return 1;
150+
@@ -687,7 +688,7 @@
151+
fprintf(stderr,
152+
"Could not find platform dependent libraries <exec_prefix>\n");
153+
wcsncpy(exec_prefix, _exec_prefix, MAXPATHLEN);
154+
- joinpath(exec_prefix, L"lib/lib-dynload");
155+
+ joinpath(exec_prefix, L"lib64/lib-dynload");
156+
}
157+
/* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */
158+

python3-opt.patch

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--- Python-3.2b1/configure.ac.orig 2010-12-12 16:18:42.000000000 +0000
2+
+++ Python-3.2b1/configure.ac 2010-12-12 16:20:34.000000000 +0000
3+
@@ -879,13 +879,13 @@
4+
if test "$Py_DEBUG" = 'true' ; then
5+
# Optimization messes up debuggers, so turn it off for
6+
# debug builds.
7+
- OPT="-g -O0 -Wall $STRICT_PROTO"
8+
+ OPT="-g $CPPFLAGS $CFLAGS -Wall $STRICT_PROTO"
9+
else
10+
- OPT="-g $WRAP -O3 -Wall $STRICT_PROTO"
11+
+ OPT="-g $WRAP $CPPFLAGS $CFLAGS -Wall $STRICT_PROTO"
12+
fi
13+
;;
14+
*)
15+
- OPT="-O3 -Wall $STRICT_PROTO"
16+
+ OPT="$CPPFLAGS $CFLAGS -Wall $STRICT_PROTO"
17+
;;
18+
esac
19+
case $ac_sys_system in

python3-pythonpath.patch

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
--- Python-3.0.1/Lib/distutils/tests/test_build_scripts.py.wiget 2004-08-26 07:44:02.000000000 +0200
2+
+++ Python-3.0.1/Lib/distutils/tests/test_build_scripts.py 2009-03-14 18:12:32.000000000 +0100
3+
@@ -58,7 +58,7 @@ class BuildScriptsTestCase(support.Tempd
4+
"pass\n"))
5+
expected.append("script2.py")
6+
self.write_script(dir, "script2.py",
7+
- ("#!/usr/bin/python\n"
8+
+ ("#!/usr/bin/python3\n"
9+
"# bogus script w/ Python sh-bang\n"
10+
"pass\n"))
11+
expected.append("shell.sh")
12+
--- Python-3.0.1/Lib/distutils/tests/test_install_scripts.py.wiget 2004-08-03 20:53:07.000000000 +0200
13+
+++ Python-3.0.1/Lib/distutils/tests/test_install_scripts.py 2009-03-14 18:12:32.000000000 +0100
14+
@@ -48,7 +48,7 @@ class InstallScriptsTestCase(support.Tem
15+
write_script("script1.py", ("#! /usr/bin/env python2.3\n"
16+
"# bogus script w/ Python sh-bang\n"
17+
"pass\n"))
18+
- write_script("script2.py", ("#!/usr/bin/python\n"
19+
+ write_script("script2.py", ("#!/usr/bin/python3\n"
20+
"# bogus script w/ Python sh-bang\n"
21+
"pass\n"))
22+
write_script("shell.sh", ("#!/bin/sh\n"
23+
--- Python-3.0.1/Lib/cgi.py.wiget 2008-12-04 21:11:57.000000000 +0100
24+
+++ Python-3.0.1/Lib/cgi.py 2009-03-14 18:12:32.000000000 +0100
25+
@@ -1,6 +1,6 @@
26+
-#! /usr/local/bin/python
27+
+#! /usr/bin/python3
28+
29+
-# NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is
30+
+# NOTE: the above "/usr/bin/python3" is NOT a mistake. It is
31+
# intentionally NOT "/usr/bin/env python". On many systems
32+
# (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI
33+
# scripts, and /usr/local/bin is the default directory where Python is
34+
--- Python-3.0.1/Tools/pybench/pybench.py.wiget 2009-02-07 18:28:46.000000000 +0100
35+
+++ Python-3.0.1/Tools/pybench/pybench.py 2009-03-14 18:12:32.000000000 +0100
36+
@@ -1,4 +1,4 @@
37+
-#!/usr/local/bin/python -O
38+
+#!/usr/bin/python3 -O
39+
40+
""" A Python Benchmark Suite
41+
42+
--- Python-3.0.1/Tools/scripts/fixps.py.wiget 2007-08-03 19:06:41.000000000 +0200
43+
+++ Python-3.0.1/Tools/scripts/fixps.py 2009-03-14 18:12:32.000000000 +0100
44+
@@ -15,13 +15,13 @@ def main():
45+
print(filename, ': can\'t open :', msg)
46+
continue
47+
line = f.readline()
48+
- if not re.match('^#! */usr/local/bin/python', line):
49+
- print(filename, ': not a /usr/local/bin/python script')
50+
+ if not re.match('^#! */usr/bin/python3', line):
51+
+ print(filename, ': not a /usr/bin/python3 script')
52+
f.close()
53+
continue
54+
rest = f.read()
55+
f.close()
56+
- line = re.sub('/usr/local/bin/python',
57+
+ line = re.sub('/usr/bin/python3',
58+
'/usr/bin/env python', line)
59+
print(filename, ':', repr(line))
60+
f = open(filename, "w")
61+
--- Python-3.0.1/Doc/README.txt.wiget 2009-02-13 00:46:00.000000000 +0100
62+
+++ Python-3.0.1/Doc/README.txt 2009-03-14 18:12:32.000000000 +0100
63+
@@ -37,7 +37,7 @@ the top-level index `build/html/index.ht
64+
To use a Python interpreter that's not called ``python``, use the standard
65+
way to set Makefile variables, using e.g. ::
66+
67+
- make html PYTHON=/usr/bin/python2.5
68+
+ make html PYTHON=/usr/bin/python3
69+
70+
Available make targets are:
71+

0 commit comments

Comments
 (0)