summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python3
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/python/python3')
-rw-r--r--meta/recipes-devtools/python/python3/000-cross-compile.patch83
-rw-r--r--meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch37
-rw-r--r--meta/recipes-devtools/python/python3/020-dont-compile-python-files.patch37
-rw-r--r--meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch42
-rw-r--r--meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch33
-rw-r--r--meta/recipes-devtools/python/python3/04-default-is-optimized.patch58
-rw-r--r--meta/recipes-devtools/python/python3/06-ctypes-libffi-fix-configure.patch44
-rw-r--r--meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch36
-rw-r--r--meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch92
-rw-r--r--meta/recipes-devtools/python/python3/110-enable-zlib.patch21
-rw-r--r--meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch78
-rw-r--r--meta/recipes-devtools/python/python3/130-readline-setup.patch55
-rw-r--r--meta/recipes-devtools/python/python3/150-fix-setupterm.patch17
-rw-r--r--meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch29
-rw-r--r--meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch25
-rw-r--r--meta/recipes-devtools/python/python3/cgi_py.patch23
-rw-r--r--meta/recipes-devtools/python/python3/fix-ast.h-dependency.patch26
-rw-r--r--meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch54
-rw-r--r--meta/recipes-devtools/python/python3/host_include_contamination.patch28
-rw-r--r--meta/recipes-devtools/python/python3/makerace.patch28
-rw-r--r--meta/recipes-devtools/python/python3/python-3.3-multilib.patch336
-rw-r--r--meta/recipes-devtools/python/python3/python-config.patch46
-rw-r--r--meta/recipes-devtools/python/python3/python3-fix-build-error-with-Readline-6.3.patch62
-rw-r--r--meta/recipes-devtools/python/python3/python3-setup.py-no-host-headers-libs.patch32
-rw-r--r--meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch27
-rw-r--r--meta/recipes-devtools/python/python3/remove_sqlite_rpath.patch19
-rw-r--r--meta/recipes-devtools/python/python3/setuptweaks.patch57
-rw-r--r--meta/recipes-devtools/python/python3/shutil-follow-symlink-fix.patch17
-rw-r--r--meta/recipes-devtools/python/python3/sitecustomize.py37
-rw-r--r--meta/recipes-devtools/python/python3/sys_platform_is_now_always_linux2.patch29
-rw-r--r--meta/recipes-devtools/python/python3/sysroot-include-headers.patch35
-rw-r--r--meta/recipes-devtools/python/python3/unixccompiler.patch35
32 files changed, 1578 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3/000-cross-compile.patch b/meta/recipes-devtools/python/python3/000-cross-compile.patch
new file mode 100644
index 0000000000..2506a590c0
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/000-cross-compile.patch
@@ -0,0 +1,83 @@
1We cross compile python. This patch uses tools from host/native
2python instead of in-tree tools
3
4-Khem
5
6Upstream-Status: Inappropriate[Configuration Specific]
7
8---
9 Makefile.pre.in | 25 +++++++++++++------------
10 1 file changed, 13 insertions(+), 12 deletions(-)
11
12--- a/Makefile.pre.in
13+++ b/Makefile.pre.in
14@@ -193,6 +193,7 @@ LIBOBJS= @LIBOBJS@
15
16 PYTHON= python$(EXE)
17 BUILDPYTHON= python$(BUILDEXE)
18+HOSTPYTHON= $(BUILDPYTHON)
19
20 PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@
21 _PYTHON_HOST_PLATFORM=@_PYTHON_HOST_PLATFORM@
22@@ -239,6 +240,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@
23 ##########################################################################
24 # Parser
25 PGEN= Parser/pgen$(EXE)
26+HOSTPGEN= $(PGEN)$(EXE)
27
28 PSRCS= \
29 Parser/acceler.c \
30@@ -451,7 +453,7 @@ build_all_generate_profile:
31
32 run_profile_task:
33 : # FIXME: can't run for a cross build
34- $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK)
35+ $(RUNSHARED) $(HOSTPYTHON) $(PROFILE_TASK)
36
37 build_all_use_profile:
38 $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-use -fprofile-correction"
39@@ -640,7 +642,7 @@ $(IO_OBJS): $(IO_H)
40 $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS)
41 @$(MKDIR_P) Include
42 $(MAKE) $(PGEN)
43- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
44+ $(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
45 $(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INPUT) $(PGENSRCS)
46 $(MAKE) $(GRAMMAR_H)
47 touch $(GRAMMAR_C)
48@@ -820,7 +822,7 @@ $(LIBRARY_OBJS) $(MODOBJS) Modules/pytho
49 ######################################################################
50
51 TESTOPTS= $(EXTRATESTOPTS)
52-TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) $(TESTPYTHONOPTS)
53+TESTPYTHON= $(RUNSHARED) $(HOSTPYTHON) $(TESTPYTHONOPTS)
54 TESTRUNNER= $(TESTPYTHON) $(srcdir)/Tools/scripts/run_tests.py
55 TESTTIMEOUT= 3600
56
57@@ -1229,7 +1231,7 @@ frameworkinstallstructure: $(LDLIBRARY)
58 fi; \
59 done
60 $(LN) -fsn include/python$(LDVERSION) $(DESTDIR)$(prefix)/Headers
61- sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
62+ sed 's/%VERSION%/'"`$(RUNSHARED) $(HOSTPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
63 $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
64 $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK)
65 $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
66@@ -1288,7 +1290,7 @@ config.status: $(srcdir)/configure
67
68 # Run reindent on the library
69 reindent:
70- ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
71+ $(HOSTPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
72
73 # Rerun configure with the same options as it was run last time,
74 # provided the config.status script exists
75@@ -1414,7 +1416,7 @@ funny:
76
77 # Perform some verification checks on any modified files.
78 patchcheck:
79- $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
80+ $(RUNSHARED) $(HOSTPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
81
82 # Dependencies
83
diff --git a/meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch b/meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch
new file mode 100644
index 0000000000..dd6b24fe92
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch
@@ -0,0 +1,37 @@
1From 2f5a4c708d90fa8db21f446ae879cff79387448d Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 20 May 2013 21:03:16 -0700
4Subject: [PATCH] h2py: Fix issue 13032 where it fails with UnicodeDecodeError
5
6use utf-8 to open the files
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9
10Upstream-Status: Pending
11---
12 Tools/scripts/h2py.py | 4 ++--
13 1 file changed, 2 insertions(+), 2 deletions(-)
14
15diff --git a/Tools/scripts/h2py.py b/Tools/scripts/h2py.py
16index 4f871d9..a53fbe0 100755
17--- a/Tools/scripts/h2py.py
18+++ b/Tools/scripts/h2py.py
19@@ -69,13 +69,13 @@ def main():
20 sys.stdout.write('# Generated by h2py from stdin\n')
21 process(sys.stdin, sys.stdout)
22 else:
23- fp = open(filename, 'r')
24+ fp = open(filename, 'r', encoding='utf-8')
25 outfile = os.path.basename(filename)
26 i = outfile.rfind('.')
27 if i > 0: outfile = outfile[:i]
28 modname = outfile.upper()
29 outfile = modname + '.py'
30- outfp = open(outfile, 'w')
31+ outfp = open(outfile, 'w', encoding='utf-8')
32 outfp.write('# Generated by h2py from %s\n' % filename)
33 filedict = {}
34 for dir in searchdirs:
35--
361.8.1.2
37
diff --git a/meta/recipes-devtools/python/python3/020-dont-compile-python-files.patch b/meta/recipes-devtools/python/python3/020-dont-compile-python-files.patch
new file mode 100644
index 0000000000..03ef286941
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/020-dont-compile-python-files.patch
@@ -0,0 +1,37 @@
1Dont cross compile site packages
2
3-Khem
4
5Upstream-Status: Inappropriate[Embedded-Specific]
6
7---
8 Makefile.pre.in | 16 ----------------
9 1 file changed, 16 deletions(-)
10
11--- a/Makefile.pre.in
12+++ b/Makefile.pre.in
13@@ -1078,24 +1078,6 @@ libinstall: build_all $(srcdir)/Lib/$(PL
14 $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
15 $(DESTDIR)$(LIBDEST)/distutils/tests ; \
16 fi
17- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
18- $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
19- -d $(LIBDEST) -f \
20- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
21- $(DESTDIR)$(LIBDEST)
22- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
23- $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
24- -d $(LIBDEST) -f \
25- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
26- $(DESTDIR)$(LIBDEST)
27- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
28- $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
29- -d $(LIBDEST)/site-packages -f \
30- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
31- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
32- $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
33- -d $(LIBDEST)/site-packages -f \
34- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
35 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
36 $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
37 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
diff --git a/meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch b/meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch
new file mode 100644
index 0000000000..fddfd2b2f6
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch
@@ -0,0 +1,42 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3# We need to supply STAGING_INCDIR here, otherwise the Tk headers
4# will not be found.
5# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille.de>
6
7Index: Python-3.3.0rc2/setup.py
8===================================================================
9--- Python-3.3.0rc2.orig/setup.py 2012-09-20 15:24:14.009124003 -0700
10+++ Python-3.3.0rc2/setup.py 2012-09-20 15:25:08.449124963 -0700
11@@ -1620,7 +1620,7 @@
12 dotversion = dotversion[:-1] + '.' + dotversion[-1]
13 tcl_include_sub = []
14 tk_include_sub = []
15- for dir in inc_dirs:
16+ for dir in [os.getenv("STAGING_INCDIR")]:
17 tcl_include_sub += [dir + os.sep + "tcl" + dotversion]
18 tk_include_sub += [dir + os.sep + "tk" + dotversion]
19 tk_include_sub += tcl_include_sub
20@@ -1639,22 +1639,6 @@
21 if dir not in include_dirs:
22 include_dirs.append(dir)
23
24- # Check for various platform-specific directories
25- if host_platform == 'sunos5':
26- include_dirs.append('/usr/openwin/include')
27- added_lib_dirs.append('/usr/openwin/lib')
28- elif os.path.exists('/usr/X11R6/include'):
29- include_dirs.append('/usr/X11R6/include')
30- added_lib_dirs.append('/usr/X11R6/lib64')
31- added_lib_dirs.append('/usr/X11R6/lib')
32- elif os.path.exists('/usr/X11R5/include'):
33- include_dirs.append('/usr/X11R5/include')
34- added_lib_dirs.append('/usr/X11R5/lib')
35- else:
36- # Assume default location for X11
37- include_dirs.append('/usr/X11/include')
38- added_lib_dirs.append('/usr/X11/lib')
39-
40 # If Cygwin, then verify that X is installed before proceeding
41 if host_platform == 'cygwin':
42 x11_inc = find_file('X11/Xlib.h', [], include_dirs)
diff --git a/meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch b/meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch
new file mode 100644
index 0000000000..6beac7b805
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch
@@ -0,0 +1,33 @@
1Do not hardcode /usr into include paths when cross compiling
2
3-Khem
4
5Upstream-Status: Pending
6
7---
8 setup.py | 15 ++-------------
9 1 file changed, 2 insertions(+), 13 deletions(-)
10
11Index: Python-3.3.2/setup.py
12===================================================================
13--- Python-3.3.2.orig/setup.py
14+++ Python-3.3.2/setup.py
15@@ -444,7 +444,8 @@ class PyBuildExt(build_ext):
16 # only change this for cross builds for 3.3, issues on Mageia
17 if cross_compiling:
18 self.add_gcc_paths()
19- self.add_multiarch_paths()
20+ if not cross_compiling:
21+ self.add_multiarch_paths()
22
23 # Add paths specified in the environment variables LDFLAGS and
24 # CPPFLAGS for header and library files.
25@@ -480,7 +481,7 @@ class PyBuildExt(build_ext):
26 for directory in reversed(options.dirs):
27 add_dir_to_list(dir_list, directory)
28
29- if os.path.normpath(sys.base_prefix) != '/usr' \
30+ if not cross_compiling and os.path.normpath(sys.base_prefix) != '/usr' \
31 and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
32 # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
33 # (PYTHONFRAMEWORK is set) to avoid # linking problems when
diff --git a/meta/recipes-devtools/python/python3/04-default-is-optimized.patch b/meta/recipes-devtools/python/python3/04-default-is-optimized.patch
new file mode 100644
index 0000000000..d5afd40025
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/04-default-is-optimized.patch
@@ -0,0 +1,58 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3Updated original patch for python 2.7.3
4
5Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
62012/05/01
7
8
9# when compiling for an embedded system, we need every bit of
10# performance we can get. default to optimized with the option
11# of opt-out.
12# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
13
14Index: Python-3.2.3/Python/compile.c
15===================================================================
16--- Python-3.2.3.orig/Python/compile.c 2012-04-10 23:54:08.000000000 -0700
17+++ Python-3.2.3/Python/compile.c 2012-09-19 15:58:46.649123998 -0700
18@@ -30,7 +30,7 @@
19 #include "symtable.h"
20 #include "opcode.h"
21
22-int Py_OptimizeFlag = 0;
23+int Py_OptimizeFlag = 1;
24
25 #define DEFAULT_BLOCK_SIZE 16
26 #define DEFAULT_BLOCKS 8
27Index: Python-3.2.3/Modules/main.c
28===================================================================
29--- Python-3.2.3.orig/Modules/main.c 2012-04-10 23:54:07.000000000 -0700
30+++ Python-3.2.3/Modules/main.c 2012-09-19 16:00:32.153124053 -0700
31@@ -46,7 +46,7 @@
32 static int orig_argc;
33
34 /* command line options */
35-#define BASE_OPTS L"bBc:dEhiJm:OqRsStuvVW:xX:?"
36+#define BASE_OPTS L"bBc:dEhiJm:NOqRsStuvVW:xX:?"
37
38 #define PROGRAM_OPTS BASE_OPTS
39
40@@ -71,6 +71,7 @@
41 -m mod : run library module as a script (terminates option list)\n\
42 -O : optimize generated bytecode slightly; also PYTHONOPTIMIZE=x\n\
43 -OO : remove doc-strings in addition to the -O optimizations\n\
44+-N : do NOT optimize generated bytecode\n\
45 -q : don't print version and copyright messages on interactive startup\n\
46 -R : use a pseudo-random salt to make hash() values of various types be\n\
47 unpredictable between separate invocations of the interpreter, as\n\
48@@ -407,8 +408,8 @@
49
50 /* case 'J': reserved for Jython */
51
52- case 'O':
53- Py_OptimizeFlag++;
54+ case 'N':
55+ Py_OptimizeFlag=0;
56 break;
57
58 case 'B':
diff --git a/meta/recipes-devtools/python/python3/06-ctypes-libffi-fix-configure.patch b/meta/recipes-devtools/python/python3/06-ctypes-libffi-fix-configure.patch
new file mode 100644
index 0000000000..abd63d2a96
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/06-ctypes-libffi-fix-configure.patch
@@ -0,0 +1,44 @@
1This fixes configure issues with recent autoconf, e.g:
2 autoreconf: Entering directory `Modules/_ctypes/libffi'
3 autoreconf: configure.ac: not using Gettext
4 autoreconf: running: aclocal --force
5 configure.ac:26: error: m4_copy: won't overwrite defined macro: _AC_ARG_VAR_PRECIOUS
6 configure.ac:26: the top level
7
8The problem is still present in python-2.6.5 but fixed in python-svn.
9
10Upstream-Status: Accepted [python-svn]
11
12Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
13Acked-by: Martin Jansa <Martin.Jansa@gmail.com>
14Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
15Signed-off-by: Saul Wold <sgw@linux.intel.com>
16
17
182011/09/29
19Rebased for python 2.7.2
20Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
21
22
23Index: Python-2.7.2/Modules/_ctypes/libffi/Makefile.am
24===================================================================
25--- Python-2.7.2.orig/Modules/_ctypes/libffi/Makefile.am
26+++ Python-2.7.2/Modules/_ctypes/libffi/Makefile.am
27@@ -2,7 +2,7 @@
28
29 AUTOMAKE_OPTIONS = foreign subdir-objects
30
31-SUBDIRS = include testsuite man
32+SUBDIRS = include
33
34 EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj configure.host \
35 src/alpha/ffi.c src/alpha/osf.S src/alpha/ffitarget.h \
36@@ -34,8 +34,6 @@ EXTRA_DIST = LICENSE ChangeLog.v1 Change
37 libtool-version ChangeLog.libffi m4/libtool.m4 \
38 m4/lt~obsolete.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4
39
40-info_TEXINFOS = doc/libffi.texi
41-
42 ## ################################################################
43
44 ##
diff --git a/meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch b/meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch
new file mode 100644
index 0000000000..789929b715
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch
@@ -0,0 +1,36 @@
1consider opkg directories when cleaning up
2
3-Khem
4
5Upstream-Status: Inappropriate [OE specific]
6
7---
8 Makefile.pre.in | 6 +++---
9 1 file changed, 3 insertions(+), 3 deletions(-)
10
11--- a/Makefile.pre.in
12+++ b/Makefile.pre.in
13@@ -1306,8 +1306,8 @@ touch:
14 # Sanitation targets -- clean leaves libraries, executables and tags
15 # files, which clobber removes as well
16 pycremoval:
17- -find $(srcdir) -depth -name '__pycache__' -exec rm -rf {} ';'
18- -find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'
19+ -find $(srcdir) ! -path './ipkg-install/*' -depth -name '__pycache__' -exec rm -rf {} ';'
20+ -find $(srcdir) ! -path './ipkg-install/*' -name '*.py[co]' -exec rm -f {} ';'
21
22 rmtestturds:
23 -rm -f *BAD *GOOD *SKIPPED
24@@ -1321,9 +1321,9 @@ docclean:
25 -rm -rf Doc/tools/sphinx Doc/tools/pygments Doc/tools/docutils
26
27 clean: pycremoval
28- find . -name '*.[oa]' -exec rm -f {} ';'
29- find . -name '*.s[ol]' -exec rm -f {} ';'
30- find . -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';'
31+ find . ! -path './ipkg-install/*' -name '*.[oa]' -exec rm -f {} ';'
32+ find . ! -path './ipkg-install/*' -name '*.s[ol]' -exec rm -f {} ';'
33+ find . ! -path './ipkg-install/*' -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';'
34 find build -name 'fficonfig.h' -exec rm -f {} ';' || true
35 find build -name 'fficonfig.py' -exec rm -f {} ';' || true
36 -rm -f Lib/lib2to3/*Grammar*.pickle
diff --git a/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch b/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch
new file mode 100644
index 0000000000..b96419a638
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch
@@ -0,0 +1,92 @@
1do not "adjust" python files before copying
2
3-Khem
4
5Upstream-Status: Inappropriate [Embedded-Specific]
6
7---
8 Lib/distutils/command/build_scripts.py | 43 +++------------------------------
9 1 file changed, 4 insertions(+), 39 deletions(-)
10
11--- a/Lib/distutils/command/build_scripts.py
12+++ b/Lib/distutils/command/build_scripts.py
13@@ -51,10 +51,7 @@ class build_scripts(Command):
14
15
16 def copy_scripts(self):
17- """Copy each script listed in 'self.scripts'; if it's marked as a
18- Python script in the Unix way (first line matches 'first_line_re',
19- ie. starts with "\#!" and contains "python"), then adjust the first
20- line to refer to the current Python interpreter as we copy.
21+ """Copy each script listed in 'self.scripts'
22 """
23 self.mkpath(self.build_dir)
24 outfiles = []
25@@ -78,64 +75,10 @@ class build_scripts(Command):
26 if not self.dry_run:
27 raise
28 f = None
29- else:
30- encoding, lines = tokenize.detect_encoding(f.readline)
31- f.seek(0)
32- first_line = f.readline()
33- if not first_line:
34- self.warn("%s is an empty file (skipping)" % script)
35- continue
36-
37- match = first_line_re.match(first_line)
38- if match:
39- adjust = True
40- post_interp = match.group(1) or b''
41-
42- if adjust:
43- log.info("copying and adjusting %s -> %s", script,
44- self.build_dir)
45- updated_files.append(outfile)
46- if not self.dry_run:
47- if not sysconfig.python_build:
48- executable = self.executable
49- else:
50- executable = os.path.join(
51- sysconfig.get_config_var("BINDIR"),
52- "python%s%s" % (sysconfig.get_config_var("VERSION"),
53- sysconfig.get_config_var("EXE")))
54- executable = os.fsencode(executable)
55- shebang = b"#!" + executable + post_interp + b"\n"
56- # Python parser starts to read a script using UTF-8 until
57- # it gets a #coding:xxx cookie. The shebang has to be the
58- # first line of a file, the #coding:xxx cookie cannot be
59- # written before. So the shebang has to be decodable from
60- # UTF-8.
61- try:
62- shebang.decode('utf-8')
63- except UnicodeDecodeError:
64- raise ValueError(
65- "The shebang ({!r}) is not decodable "
66- "from utf-8".format(shebang))
67- # If the script is encoded to a custom encoding (use a
68- # #coding:xxx cookie), the shebang has to be decodable from
69- # the script encoding too.
70- try:
71- shebang.decode(encoding)
72- except UnicodeDecodeError:
73- raise ValueError(
74- "The shebang ({!r}) is not decodable "
75- "from the script encoding ({})"
76- .format(shebang, encoding))
77- with open(outfile, "wb") as outf:
78- outf.write(shebang)
79- outf.writelines(f.readlines())
80- if f:
81- f.close()
82- else:
83- if f:
84+ if f:
85 f.close()
86- updated_files.append(outfile)
87- self.copy_file(script, outfile)
88+ updated_files.append(outfile)
89+ self.copy_file(script, outfile)
90
91 if os.name == 'posix':
92 for file in outfiles:
diff --git a/meta/recipes-devtools/python/python3/110-enable-zlib.patch b/meta/recipes-devtools/python/python3/110-enable-zlib.patch
new file mode 100644
index 0000000000..fb92a19163
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/110-enable-zlib.patch
@@ -0,0 +1,21 @@
1Enable zlib in python
2
3-Khem
4
5Upstream-Status: Inappropriate [OE-Specific]
6
7---
8 Modules/Setup.dist | 2 +-
9 1 file changed, 1 insertion(+), 1 deletion(-)
10
11--- a/Modules/Setup.dist
12+++ b/Modules/Setup.dist
13@@ -354,7 +354,7 @@ _symtable symtablemodule.c
14 # Andrew Kuchling's zlib module.
15 # This require zlib 1.1.3 (or later).
16 # See http://www.gzip.org/zlib/
17-#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
18+zlib zlibmodule.c -lz
19
20 # Interface to the Expat XML parser
21 #
diff --git a/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch b/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
new file mode 100644
index 0000000000..c5846a5af8
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
@@ -0,0 +1,78 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3# The proper prefix is inside our staging area.
4# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
5# Signed-off-by: Phil Blundell <philb@gnu.org>
6# Signed-off-by: Khem Raj <raj.khem@gmail.com>
7
8Index: Python-3.3.2/Lib/distutils/sysconfig.py
9===================================================================
10--- Python-3.3.2.orig/Lib/distutils/sysconfig.py 2013-07-30 00:00:52.769749805 -0700
11+++ Python-3.3.2/Lib/distutils/sysconfig.py 2013-07-30 00:16:22.545767248 -0700
12@@ -16,10 +16,11 @@
13 from .errors import DistutilsPlatformError
14
15 # These are needed in a couple of spots, so just compute them once.
16-PREFIX = os.path.normpath(sys.prefix)
17-EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
18-BASE_PREFIX = os.path.normpath(sys.base_prefix)
19-BASE_EXEC_PREFIX = os.path.normpath(sys.base_exec_prefix)
20+PREFIX = os.path.normpath(sys.prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
21+EXEC_PREFIX = os.path.normpath(sys.exec_prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
22+BASE_PREFIX = os.path.normpath(sys.base_prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
23+BASE_EXEC_PREFIX= os.path.normpath(sys.base_exec_prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
24+
25
26 # Path to the base directory of the project. On Windows the binary may
27 # live in project/PCBuild9. If we're dealing with an x64 Windows build,
28@@ -93,7 +94,9 @@
29 If 'prefix' is supplied, use it instead of sys.base_prefix or
30 sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
31 """
32- if prefix is None:
33+ if prefix is None and os.environ['STAGING_INCDIR'] != "":
34+ prefix = os.environ['STAGING_INCDIR'].rstrip('include')
35+ elif prefix is None:
36 prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
37 if os.name == "posix":
38 if python_build:
39@@ -136,6 +139,12 @@
40 If 'prefix' is supplied, use it instead of sys.base_prefix or
41 sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
42 """
43+ if prefix is None and os.environ['STAGING_LIBDIR'] != "":
44+ lib_basename = os.environ['STAGING_LIBDIR'].split('/')[-1]
45+ prefix = os.environ['STAGING_LIBDIR'].rstrip(lib_basename)
46+ else:
47+ lib_basename = sys.lib
48+
49 if prefix is None:
50 if standard_lib:
51 prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
52@@ -144,7 +153,7 @@
53
54 if os.name == "posix":
55 libpython = os.path.join(prefix,
56- "lib", "python" + get_python_version())
57+ lib_basename, "python" + get_python_version())
58 if standard_lib:
59 return libpython
60 else:
61@@ -249,7 +258,7 @@
62 else:
63 # The name of the config.h file changed in 2.2
64 config_h = 'pyconfig.h'
65- return os.path.join(inc_dir, config_h)
66+ return os.path.join(inc_dir, config_h).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
67
68
69 def get_makefile_filename():
70@@ -258,7 +267,7 @@
71 return os.path.join(_sys_home or project_base, "Makefile")
72 lib_dir = get_python_lib(plat_specific=0, standard_lib=1)
73 config_file = 'config-{}{}'.format(get_python_version(), build_flags)
74- return os.path.join(lib_dir, config_file, 'Makefile')
75+ return os.path.join(lib_dir, config_file, 'Makefile').replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
76
77
78 def parse_config_h(fp, g=None):
diff --git a/meta/recipes-devtools/python/python3/130-readline-setup.patch b/meta/recipes-devtools/python/python3/130-readline-setup.patch
new file mode 100644
index 0000000000..c805652d69
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/130-readline-setup.patch
@@ -0,0 +1,55 @@
1package python-readline
2
3-Khem
4
5Upstream-Status: Inappropriate [Embedded Specific]
6
7--- a/setup.py
8+++ b/setup.py
9@@ -666,45 +666,7 @@ class PyBuildExt(build_ext):
10 # readline
11 do_readline = self.compiler.find_library_file(lib_dirs, 'readline')
12 readline_termcap_library = ""
13- curses_library = ""
14- # Cannot use os.popen here in py3k.
15- tmpfile = os.path.join(self.build_temp, 'readline_termcap_lib')
16- if not os.path.exists(self.build_temp):
17- os.makedirs(self.build_temp)
18- # Determine if readline is already linked against curses or tinfo.
19- if do_readline:
20- if cross_compiling:
21- ret = os.system("%s -d %s | grep '(NEEDED)' > %s" \
22- % (sysconfig.get_config_var('READELF'),
23- do_readline, tmpfile))
24- elif find_executable('ldd'):
25- ret = os.system("ldd %s > %s" % (do_readline, tmpfile))
26- else:
27- ret = 256
28- if ret >> 8 == 0:
29- with open(tmpfile) as fp:
30- for ln in fp:
31- if 'curses' in ln:
32- readline_termcap_library = re.sub(
33- r'.*lib(n?cursesw?)\.so.*', r'\1', ln
34- ).rstrip()
35- break
36- # termcap interface split out from ncurses
37- if 'tinfo' in ln:
38- readline_termcap_library = 'tinfo'
39- break
40- if os.path.exists(tmpfile):
41- os.unlink(tmpfile)
42- # Issue 7384: If readline is already linked against curses,
43- # use the same library for the readline and curses modules.
44- if 'curses' in readline_termcap_library:
45- curses_library = readline_termcap_library
46- elif self.compiler.find_library_file(lib_dirs, 'ncursesw'):
47- curses_library = 'ncursesw'
48- elif self.compiler.find_library_file(lib_dirs, 'ncurses'):
49- curses_library = 'ncurses'
50- elif self.compiler.find_library_file(lib_dirs, 'curses'):
51- curses_library = 'curses'
52+ curses_library = "ncurses"
53
54 if host_platform == 'darwin':
55 os_release = int(os.uname()[2].split('.')[0])
diff --git a/meta/recipes-devtools/python/python3/150-fix-setupterm.patch b/meta/recipes-devtools/python/python3/150-fix-setupterm.patch
new file mode 100644
index 0000000000..78d7c78670
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/150-fix-setupterm.patch
@@ -0,0 +1,17 @@
1Fix warning with newer compiler
2
3-Khem
4
5Upstream-Status: Pending
6
7--- a/Modules/_cursesmodule.c
8+++ b/Modules/_cursesmodule.c
9@@ -116,7 +116,7 @@ char *PyCursesVersion = "2.2";
10 #defines many common symbols (such as "lines") which breaks the
11 curses module in other ways. So the code will just specify
12 explicit prototypes here. */
13-extern int setupterm(char *,int,int *);
14+//extern int setupterm(char *,int,int *);
15 #ifdef __sgi
16 #include <term.h>
17 #endif
diff --git a/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch b/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch
new file mode 100644
index 0000000000..054a13124c
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch
@@ -0,0 +1,29 @@
1We should make sure that sysroot is used by gcc instead of assuming
2hardcoded locations for include paths
3
4Upstream-Status: Pending
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7:
8Index: Python-3.3.3/configure.ac
9===================================================================
10--- Python-3.3.3.orig/configure.ac 2014-01-29 19:00:15.245312752 -0800
11+++ Python-3.3.3/configure.ac 2014-01-29 23:27:22.938526262 -0800
12@@ -1548,7 +1548,7 @@
13 # checks for header files
14 AC_HEADER_STDC
15 ac_save_cppflags="$CPPFLAGS"
16-CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
17+CPPFLAGS="$CPPFLAGS -I=/usr/include/ncursesw"
18 AC_CHECK_HEADERS(asm/types.h conio.h curses.h direct.h dlfcn.h errno.h \
19 fcntl.h grp.h \
20 ieeefp.h io.h langinfo.h libintl.h ncurses.h process.h pthread.h \
21@@ -4308,7 +4308,7 @@
22 fi
23
24 ac_save_cppflags="$CPPFLAGS"
25-CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
26+CPPFLAGS="$CPPFLAGS -I=/usr/include/ncursesw"
27 # On HP/UX 11.0, mvwdelch is a block with a return statement
28 AC_MSG_CHECKING(whether mvwdelch is an expression)
29 AC_CACHE_VAL(ac_cv_mvwdelch_is_expression,
diff --git a/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch b/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch
new file mode 100644
index 0000000000..208c57c822
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch
@@ -0,0 +1,25 @@
1_tkinter module needs tk module along with tcl. tk is not yet integrated
2in yocto so we skip the check for this module.
3Avoid a warning by not adding this module to missing variable.
4
5Upstream-Status: Inappropriate [distribution]
6
7Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
8
9Index: Python-2.7.2/setup.py
10===================================================================
11--- Python-2.7.2.orig/setup.py 2012-04-05 23:18:38.500136647 +0300
12+++ Python-2.7.2/setup.py 2012-04-05 23:19:35.888134969 +0300
13@@ -1634,8 +1634,10 @@
14 # Call the method for detecting whether _tkinter can be compiled
15 self.detect_tkinter(inc_dirs, lib_dirs)
16
17- if '_tkinter' not in [e.name for e in self.extensions]:
18- missing.append('_tkinter')
19+ # tkinter module will not be avalaible as yocto
20+ # doesn't have tk integrated (yet)
21+ #if '_tkinter' not in [e.name for e in self.extensions]:
22+ # missing.append('_tkinter')
23
24 return missing
25
diff --git a/meta/recipes-devtools/python/python3/cgi_py.patch b/meta/recipes-devtools/python/python3/cgi_py.patch
new file mode 100644
index 0000000000..de504f9dcf
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/cgi_py.patch
@@ -0,0 +1,23 @@
1Lib/cgi.py: Update the script as mentioned in the comment
2
3Upstream-Status: Inappropriate [distribution]
4
5Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
6
7--- Python-2.6.6/Lib/cgi.py.orig 2010-08-01 22:14:27.000000000 -0500
8+++ Python-2.6.6/Lib/cgi.py 2011-09-21 15:28:40.478208631 -0500
9@@ -1,13 +1,4 @@
10-#! /usr/local/bin/python
11-
12-# NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is
13-# intentionally NOT "/usr/bin/env python". On many systems
14-# (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI
15-# scripts, and /usr/local/bin is the default directory where Python is
16-# installed, so /usr/bin/env would be unable to find python. Granted,
17-# binary installations by Linux vendors often install Python in
18-# /usr/bin. So let those vendors patch cgi.py to match their choice
19-# of installation.
20+#! /usr/bin/env python
21
22 """Support module for CGI (Common Gateway Interface) scripts.
23
diff --git a/meta/recipes-devtools/python/python3/fix-ast.h-dependency.patch b/meta/recipes-devtools/python/python3/fix-ast.h-dependency.patch
new file mode 100644
index 0000000000..77c220aa82
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/fix-ast.h-dependency.patch
@@ -0,0 +1,26 @@
1Fix a missed dependency on ast.h which can result in race condition
2at high parallel build
3
4It fixed here
5
6http://hg.python.org/cpython/rev/cfe0a293551f
7
8[YOCTO #5884]
9
10Upstream-Status: Backport
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12
13Index: Python-3.3.3/Makefile.pre.in
14===================================================================
15--- Python-3.3.3.orig/Makefile.pre.in 2014-02-26 09:33:13.868288863 -0800
16+++ Python-3.3.3/Makefile.pre.in 2014-02-26 09:36:27.348292492 -0800
17@@ -853,7 +853,8 @@
18 $(srcdir)/Include/warnings.h \
19 $(srcdir)/Include/weakrefobject.h \
20 pyconfig.h \
21- $(PARSER_HEADERS)
22+ $(PARSER_HEADERS) \
23+ $(AST_H)
24
25 $(LIBRARY_OBJS) $(MODOBJS) Modules/python.o: $(PYTHON_HEADERS)
26
diff --git a/meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch b/meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch
new file mode 100644
index 0000000000..cd1a978eb3
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch
@@ -0,0 +1,54 @@
1Upstream-Status: Inappropriate [Embedded specific]
2
3This patch fixes issuing with different libdir like lib64.
4This patch makes the native python binary modules findable
5in the install process of the host python.
6
7Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
8Date: 2012/03/14
9
10Updated for python 2.7.3
11Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
12Date: 2012/05/01
13
14Index: Python-3.3.0rc2/Lib/sysconfig.py
15===================================================================
16--- Python-3.3.0rc2.orig/Lib/sysconfig.py 2012-09-20 22:50:11.000000000 -0700
17+++ Python-3.3.0rc2/Lib/sysconfig.py 2012-09-20 22:53:01.561123396 -0700
18@@ -21,9 +21,9 @@
19
20 _INSTALL_SCHEMES = {
21 'posix_prefix': {
22- 'stdlib': '{installed_base}/'+sys.lib+'/python{py_version_short}',
23+ 'stdlib': '{base}/'+sys.lib+'/python{py_version_short}',
24 'platstdlib': '{platbase}/'+sys.lib+'/python{py_version_short}',
25- 'purelib': '{base}/lib/python{py_version_short}/site-packages',
26+ 'purelib': '{base}/'+sys.lib+'/python{py_version_short}/site-packages',
27 'platlib': '{platbase}/'+sys.lib+'/python{py_version_short}/site-packages',
28 'include':
29 '{installed_base}/include/python{py_version_short}{abiflags}',
30@@ -83,7 +83,7 @@
31 'posix_user': {
32 'stdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
33 'platstdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
34- 'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
35+ 'purelib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
36 'platlib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
37 'include': '{userbase}/include/python{py_version_short}',
38 'scripts': '{userbase}/bin',
39Index: Python-3.3.0rc2/Makefile.pre.in
40===================================================================
41--- Python-3.3.0rc2.orig/Makefile.pre.in 2012-09-20 22:50:11.000000000 -0700
42+++ Python-3.3.0rc2/Makefile.pre.in 2012-09-20 22:50:54.245123997 -0700
43@@ -1080,9 +1080,9 @@
44 $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
45 $(DESTDIR)$(LIBDEST)/distutils/tests ; \
46 fi
47- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
48+ -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
49 $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
50- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
51+ -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
52 $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
53
54 # Create the PLATDIR source directory, if one wasn't distributed..
diff --git a/meta/recipes-devtools/python/python3/host_include_contamination.patch b/meta/recipes-devtools/python/python3/host_include_contamination.patch
new file mode 100644
index 0000000000..ef2054d9a9
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/host_include_contamination.patch
@@ -0,0 +1,28 @@
1when building python for qemux86-64 on ubuntu 11.10/64bit
2it gropes into host includes and then mixes them with cross
3includes and as a result some modules fail to compile and link
4one of the modules is python-elementtree which is then not
5found during image creation
6
7Proble is that setup.py tries to add native includes that newer
8ubuntu has introduced for multiarch support. But that should
9only happen for native builds and not cross building python
10so we add a check here.
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13Upstream-Status: Pending
14
15Index: Python-3.3.0rc2/setup.py
16===================================================================
17--- Python-3.3.0rc2.orig/setup.py 2012-09-20 21:54:50.000000000 -0700
18+++ Python-3.3.0rc2/setup.py 2012-09-20 21:57:35.029123858 -0700
19@@ -402,6 +402,9 @@
20
21 if not find_executable('dpkg-architecture'):
22 return
23+ if cross_compiling:
24+ return
25+
26 opt = ''
27 if cross_compiling:
28 opt = '-t' + sysconfig.get_config_var('HOST_GNU_TYPE')
diff --git a/meta/recipes-devtools/python/python3/makerace.patch b/meta/recipes-devtools/python/python3/makerace.patch
new file mode 100644
index 0000000000..d8a68923a8
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/makerace.patch
@@ -0,0 +1,28 @@
1There is a race due to the execution of make inside the makefile:
2
3| gcc -pthread -c -Wno-unused-result -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -I. -IInclude -I./Include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -fPIC -DPy_BUILD_CORE -o Objects/obmalloc.o Objects/obmalloc.c
4| gcc -pthread -c -Wno-unused-result -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -I. -IInclude -I./Include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -fPIC -DPy_BUILD_CORE -o Parser/pgen.o Parser/pgen.c| gcc -pthread -c -Wno-unused-result -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -I. -IInclude -I./Include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -fPIC -DPy_BUILD_CORE -o Objects/obmalloc.o Objects/obmalloc.c
5| gcc -pthread -c -Wno-unused-result -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -I. -IInclude -I./Include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -fPIC -DPy_BUILD_CORE -o Objects/obmalloc.o Objects/obmalloc.c
6| Objects/obmalloc.o: file not recognized: File truncated
7| collect2: error: ld returned 1 exit status
8| make[1]: *** [Parser/pgen] Error 1
9
10The easiest way to avoid this is to list the dependencies explictly.
11
12RP 28/2/2014
13
14Upstream-Status: Pending
15
16Index: Python-3.3.3/Makefile.pre.in
17===================================================================
18--- Python-3.3.3.orig/Makefile.pre.in 2014-02-27 14:04:38.268339533 +0000
19+++ Python-3.3.3/Makefile.pre.in 2014-02-28 10:40:59.166361125 +0000
20@@ -676,7 +676,7 @@
21
22 $(IO_OBJS): $(IO_H)
23
24-$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS)
25+$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS) $(PGEN)
26 @$(MKDIR_P) Include
27 $(MAKE) $(PGEN)
28 $(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
diff --git a/meta/recipes-devtools/python/python3/python-3.3-multilib.patch b/meta/recipes-devtools/python/python3/python-3.3-multilib.patch
new file mode 100644
index 0000000000..7d66a0e00d
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/python-3.3-multilib.patch
@@ -0,0 +1,336 @@
1get the sys.lib from python itself and do not use hardcoded value of 'lib'
2
3-Khem
4
5Upstream-Status: Pending
6
7Index: Python-3.3.2/Include/pythonrun.h
8===================================================================
9--- Python-3.3.2.orig/Include/pythonrun.h 2013-05-15 09:32:54.000000000 -0700
10+++ Python-3.3.2/Include/pythonrun.h 2013-07-27 16:19:54.099877246 -0700
11@@ -181,6 +181,8 @@
12 /* In their own files */
13 PyAPI_FUNC(const char *) Py_GetVersion(void);
14 PyAPI_FUNC(const char *) Py_GetPlatform(void);
15+PyAPI_FUNC(const char *) Py_GetArch(void);
16+PyAPI_FUNC(const char *) Py_GetLib(void);
17 PyAPI_FUNC(const char *) Py_GetCopyright(void);
18 PyAPI_FUNC(const char *) Py_GetCompiler(void);
19 PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
20Index: Python-3.3.2/Lib/distutils/command/install.py
21===================================================================
22--- Python-3.3.2.orig/Lib/distutils/command/install.py 2013-05-15 09:32:54.000000000 -0700
23+++ Python-3.3.2/Lib/distutils/command/install.py 2013-07-27 16:19:54.099877246 -0700
24@@ -25,6 +25,8 @@
25 from site import USER_SITE
26 HAS_USER_SITE = True
27
28+libname = sys.lib
29+
30 if sys.version < "2.2":
31 WINDOWS_SCHEME = {
32 'purelib': '$base',
33@@ -45,7 +47,7 @@
34 INSTALL_SCHEMES = {
35 'unix_prefix': {
36 'purelib': '$base/lib/python$py_version_short/site-packages',
37- 'platlib': '$platbase/lib/python$py_version_short/site-packages',
38+ 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages',
39 'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
40 'scripts': '$base/bin',
41 'data' : '$base',
42Index: Python-3.3.2/Lib/pydoc.py
43===================================================================
44--- Python-3.3.2.orig/Lib/pydoc.py 2013-05-15 09:32:55.000000000 -0700
45+++ Python-3.3.2/Lib/pydoc.py 2013-07-27 16:19:54.103877246 -0700
46@@ -372,7 +372,7 @@
47
48 docloc = os.environ.get("PYTHONDOCS", self.PYTHONDOCS)
49
50- basedir = os.path.join(sys.base_exec_prefix, "lib",
51+ basedir = os.path.join(sys.base_exec_prefix, sys.lib,
52 "python%d.%d" % sys.version_info[:2])
53 if (isinstance(object, type(os)) and
54 (object.__name__ in ('errno', 'exceptions', 'gc', 'imp',
55Index: Python-3.3.2/Lib/site.py
56===================================================================
57--- Python-3.3.2.orig/Lib/site.py 2013-05-15 09:32:55.000000000 -0700
58+++ Python-3.3.2/Lib/site.py 2013-07-27 16:19:54.103877246 -0700
59@@ -303,13 +303,19 @@
60 if sys.platform in ('os2emx', 'riscos'):
61 sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
62 elif os.sep == '/':
63- sitepackages.append(os.path.join(prefix, "lib",
64+ sitepackages.append(os.path.join(prefix, sys.lib,
65 "python" + sys.version[:3],
66 "site-packages"))
67- sitepackages.append(os.path.join(prefix, "lib", "site-python"))
68+ if sys.lib != "lib":
69+ sitepackages.append(os.path.join(prefix, "lib",
70+ "python" + sys.version[:3],
71+ "site-packages"))
72+ sitepackages.append(os.path.join(prefix, sys.lib, "site-python"))
73+ if sys.lib != "lib":
74+ sitepackages.append(os.path.join(prefix, "lib", "site-python"))
75 else:
76 sitepackages.append(prefix)
77- sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
78+ sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
79 if sys.platform == "darwin":
80 # for framework builds *only* we add the standard Apple
81 # locations.
82Index: Python-3.3.2/Lib/trace.py
83===================================================================
84--- Python-3.3.2.orig/Lib/trace.py 2013-05-15 09:32:56.000000000 -0700
85+++ Python-3.3.2/Lib/trace.py 2013-07-27 16:19:54.103877246 -0700
86@@ -751,10 +751,10 @@
87 # should I also call expanduser? (after all, could use $HOME)
88
89 s = s.replace("$prefix",
90- os.path.join(sys.base_prefix, "lib",
91+ os.path.join(sys.base_prefix, sys.lib,
92 "python" + sys.version[:3]))
93 s = s.replace("$exec_prefix",
94- os.path.join(sys.base_exec_prefix, "lib",
95+ os.path.join(sys.base_exec_prefix, sys.lib,
96 "python" + sys.version[:3]))
97 s = os.path.normpath(s)
98 ignore_dirs.append(s)
99Index: Python-3.3.2/Makefile.pre.in
100===================================================================
101--- Python-3.3.2.orig/Makefile.pre.in 2013-07-27 16:19:16.000000000 -0700
102+++ Python-3.3.2/Makefile.pre.in 2013-07-27 16:19:54.103877246 -0700
103@@ -96,6 +96,8 @@
104
105 # Machine-dependent subdirectories
106 MACHDEP= @MACHDEP@
107+LIB= @LIB@
108+ARCH= @ARCH@
109
110 # Multiarch directory (may be empty)
111 MULTIARCH= @MULTIARCH@
112@@ -115,7 +117,7 @@
113 MANDIR= @mandir@
114 INCLUDEDIR= @includedir@
115 CONFINCLUDEDIR= $(exec_prefix)/include
116-SCRIPTDIR= $(prefix)/lib
117+SCRIPTDIR= @libdir@
118 ABIFLAGS= @ABIFLAGS@
119
120 # Detailed destination directories
121@@ -635,6 +637,7 @@
122 -DEXEC_PREFIX='"$(exec_prefix)"' \
123 -DVERSION='"$(VERSION)"' \
124 -DVPATH='"$(VPATH)"' \
125+ -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' \
126 -o $@ $(srcdir)/Modules/getpath.c
127
128 Modules/python.o: $(srcdir)/Modules/python.c
129@@ -701,7 +704,7 @@
130 Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H)
131
132 Python/getplatform.o: $(srcdir)/Python/getplatform.c
133- $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
134+ $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
135
136 Python/importdl.o: $(srcdir)/Python/importdl.c
137 $(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
138Index: Python-3.3.2/Modules/getpath.c
139===================================================================
140--- Python-3.3.2.orig/Modules/getpath.c 2013-05-15 09:32:59.000000000 -0700
141+++ Python-3.3.2/Modules/getpath.c 2013-07-27 16:19:54.107877246 -0700
142@@ -121,9 +121,11 @@
143 #define EXEC_PREFIX PREFIX
144 #endif
145
146+#define LIB_PYTHON LIB "/python" VERSION
147+
148 #ifndef PYTHONPATH
149-#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
150- EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
151+#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \
152+ EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload"
153 #endif
154
155 #ifndef LANDMARK
156@@ -135,7 +137,7 @@
157 static wchar_t progpath[MAXPATHLEN+1];
158 static wchar_t *module_search_path = NULL;
159 static int module_search_path_malloced = 0;
160-static wchar_t *lib_python = L"lib/python" VERSION;
161+static wchar_t *lib_python = L"" LIB_PYTHON;
162
163 static void
164 reduce(wchar_t *dir)
165Index: Python-3.3.2/Python/getplatform.c
166===================================================================
167--- Python-3.3.2.orig/Python/getplatform.c 2013-05-15 09:33:00.000000000 -0700
168+++ Python-3.3.2/Python/getplatform.c 2013-07-27 16:19:54.107877246 -0700
169@@ -10,3 +10,23 @@
170 {
171 return PLATFORM;
172 }
173+
174+#ifndef ARCH
175+#define ARCH "unknown"
176+#endif
177+
178+const char *
179+Py_GetArch(void)
180+{
181+ return ARCH;
182+}
183+
184+#ifndef LIB
185+#define LIB "lib"
186+#endif
187+
188+const char *
189+Py_GetLib(void)
190+{
191+ return LIB;
192+}
193Index: Python-3.3.2/Python/sysmodule.c
194===================================================================
195--- Python-3.3.2.orig/Python/sysmodule.c 2013-05-15 09:33:00.000000000 -0700
196+++ Python-3.3.2/Python/sysmodule.c 2013-07-27 16:19:54.107877246 -0700
197@@ -1612,6 +1612,10 @@
198 PyUnicode_FromString(Py_GetCopyright()));
199 SET_SYS_FROM_STRING("platform",
200 PyUnicode_FromString(Py_GetPlatform()));
201+ SET_SYS_FROM_STRING("arch",
202+ PyUnicode_FromString(Py_GetArch()));
203+ SET_SYS_FROM_STRING("lib",
204+ PyUnicode_FromString(Py_GetLib()));
205 SET_SYS_FROM_STRING("executable",
206 PyUnicode_FromWideChar(
207 Py_GetProgramFullPath(), -1));
208Index: Python-3.3.2/setup.py
209===================================================================
210--- Python-3.3.2.orig/setup.py 2013-07-27 16:19:17.000000000 -0700
211+++ Python-3.3.2/setup.py 2013-07-27 16:19:54.107877246 -0700
212@@ -439,7 +439,7 @@
213 # directories (i.e. '.' and 'Include') must be first. See issue
214 # 10520.
215 if not cross_compiling:
216- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
217+ add_dir_to_list(self.compiler.library_dirs, os.path.join('/usr/local', sys.lib))
218 add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
219 # only change this for cross builds for 3.3, issues on Mageia
220 if cross_compiling:
221@@ -497,8 +497,7 @@
222 # be assumed that no additional -I,-L directives are needed.
223 if not cross_compiling:
224 lib_dirs = self.compiler.library_dirs + [
225- '/lib64', '/usr/lib64',
226- '/lib', '/usr/lib',
227+ '/' + sys.lib, '/usr/' + sys.lib,
228 ]
229 inc_dirs = self.compiler.include_dirs + ['/usr/include']
230 else:
231@@ -675,11 +674,11 @@
232 elif curses_library:
233 readline_libs.append(curses_library)
234 elif self.compiler.find_library_file(lib_dirs +
235- ['/usr/lib/termcap'],
236+ ['/usr/'+sys.lib+'/termcap'],
237 'termcap'):
238 readline_libs.append('termcap')
239 exts.append( Extension('readline', ['readline.c'],
240- library_dirs=['/usr/lib/termcap'],
241+ library_dirs=['/usr/'+sys.lib+'/termcap'],
242 extra_link_args=readline_extra_link_args,
243 libraries=readline_libs) )
244 else:
245Index: Python-3.3.2/Lib/sysconfig.py
246===================================================================
247--- Python-3.3.2.orig/Lib/sysconfig.py 2013-05-15 09:32:55.000000000 -0700
248+++ Python-3.3.2/Lib/sysconfig.py 2013-07-27 16:19:54.111877246 -0700
249@@ -21,10 +21,10 @@
250
251 _INSTALL_SCHEMES = {
252 'posix_prefix': {
253- 'stdlib': '{installed_base}/lib/python{py_version_short}',
254- 'platstdlib': '{platbase}/lib/python{py_version_short}',
255+ 'stdlib': '{installed_base}/'+sys.lib+'/python{py_version_short}',
256+ 'platstdlib': '{platbase}/'+sys.lib+'/python{py_version_short}',
257 'purelib': '{base}/lib/python{py_version_short}/site-packages',
258- 'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
259+ 'platlib': '{platbase}/'+sys.lib+'/python{py_version_short}/site-packages',
260 'include':
261 '{installed_base}/include/python{py_version_short}{abiflags}',
262 'platinclude':
263@@ -33,10 +33,10 @@
264 'data': '{base}',
265 },
266 'posix_home': {
267- 'stdlib': '{installed_base}/lib/python',
268- 'platstdlib': '{base}/lib/python',
269+ 'stdlib': '{installed_base}/'+sys.lib+'/python',
270+ 'platstdlib': '{base}/'+sys.lib+'/python',
271 'purelib': '{base}/lib/python',
272- 'platlib': '{base}/lib/python',
273+ 'platlib': '{base}/'+sys.lib+'/python',
274 'include': '{installed_base}/include/python',
275 'platinclude': '{installed_base}/include/python',
276 'scripts': '{base}/bin',
277@@ -81,10 +81,10 @@
278 'data': '{userbase}',
279 },
280 'posix_user': {
281- 'stdlib': '{userbase}/lib/python{py_version_short}',
282- 'platstdlib': '{userbase}/lib/python{py_version_short}',
283+ 'stdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
284+ 'platstdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
285 'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
286- 'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
287+ 'platlib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
288 'include': '{userbase}/include/python{py_version_short}',
289 'scripts': '{userbase}/bin',
290 'data': '{userbase}',
291Index: Python-3.3.2/configure.ac
292===================================================================
293--- Python-3.3.2.orig/configure.ac 2013-05-15 09:33:00.000000000 -0700
294+++ Python-3.3.2/configure.ac 2013-07-27 16:19:54.111877246 -0700
295@@ -769,6 +769,41 @@
296 MULTIARCH=$($CC --print-multiarch 2>/dev/null)
297 AC_SUBST(MULTIARCH)
298
299+AC_SUBST(ARCH)
300+AC_MSG_CHECKING(ARCH)
301+ARCH=`uname -m`
302+case $ARCH in
303+i?86) ARCH=i386;;
304+esac
305+AC_MSG_RESULT($ARCH)
306+
307+AC_SUBST(LIB)
308+AC_MSG_CHECKING(LIB)
309+case $ac_sys_system in
310+Linux*)
311+ # Test if the compiler is 64bit
312+ echo 'int i;' > conftest.$ac_ext
313+ python_cv_cc_64bit_output=no
314+ if AC_TRY_EVAL(ac_compile); then
315+ case `/usr/bin/file conftest.$ac_objext` in
316+ *"ELF 64"*)
317+ python_cv_cc_64bit_output=yes
318+ ;;
319+ esac
320+ fi
321+ rm -rf conftest*
322+ ;;
323+esac
324+
325+case $ARCH:$python_cv_cc_64bit_output in
326+ppc64:yes | powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
327+ LIB="lib64"
328+ ;;
329+*:*)
330+ LIB="lib"
331+ ;;
332+esac
333+AC_MSG_RESULT($LIB)
334
335 AC_SUBST(LIBRARY)
336 AC_MSG_CHECKING(LIBRARY)
diff --git a/meta/recipes-devtools/python/python3/python-config.patch b/meta/recipes-devtools/python/python3/python-config.patch
new file mode 100644
index 0000000000..f23b8b7df0
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/python-config.patch
@@ -0,0 +1,46 @@
1python-config: Revert to using distutils.sysconfig
2
3The newer sysconfig module shares some code with distutils.sysconfig, but the same modifications as in
4
512-distutils-prefix-is-inside-staging-area.patch makes distutils.sysconfig
6
7affect the native runtime as well as cross building. Use the old, patched
8implementation which returns paths in the staging directory and for the target,
9as appropriate.
10
11Upstream-Status: Inappropriate [Embedded Specific]
12
13Signed-off-by: Tyler Hall <tylerwhall@gmail.com>
14:
15Index: Python-3.3.3/Misc/python-config.in
16===================================================================
17--- Python-3.3.3.orig/Misc/python-config.in
18+++ Python-3.3.3/Misc/python-config.in
19@@ -4,7 +4,7 @@
20 import getopt
21 import os
22 import sys
23-import sysconfig
24+from distutils import sysconfig
25
26 valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags',
27 'ldflags', 'extension-suffix', 'help', 'abiflags', 'configdir']
28@@ -32,14 +32,14 @@ if '--help' in opt_flags:
29
30 for opt in opt_flags:
31 if opt == '--prefix':
32- print(sysconfig.get_config_var('prefix'))
33+ print(sysconfig.PREFIX)
34
35 elif opt == '--exec-prefix':
36- print(sysconfig.get_config_var('exec_prefix'))
37+ print(sysconfig.EXEC_PREFIX)
38
39 elif opt in ('--includes', '--cflags'):
40- flags = ['-I' + sysconfig.get_path('include'),
41- '-I' + sysconfig.get_path('platinclude')]
42+ flags = ['-I' + sysconfig.get_python_inc(),
43+ '-I' + sysconfig.get_python_inc(plat_specific=True)]
44 if opt == '--cflags':
45 flags.extend(getvar('CFLAGS').split())
46 print(' '.join(flags))
diff --git a/meta/recipes-devtools/python/python3/python3-fix-build-error-with-Readline-6.3.patch b/meta/recipes-devtools/python/python3/python3-fix-build-error-with-Readline-6.3.patch
new file mode 100644
index 0000000000..44e2b7e5f1
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/python3-fix-build-error-with-Readline-6.3.patch
@@ -0,0 +1,62 @@
1python3: fix build error with Readline 6.3
2
3Backport two patches from upstream:
4
5use new readline function types (closes #20374)
6Issue #20374: Avoid compiler warnings when compiling readline with libedit.
7
8Upstream-Status: Backport
9
10Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
11---
12 Modules/readline.c | 15 ++++++++++++---
13 1 file changed, 12 insertions(+), 3 deletions(-)
14
15diff --git a/Modules/readline.c b/Modules/readline.c
16index 096c6d1..1646ef8 100644
17--- a/Modules/readline.c
18+++ b/Modules/readline.c
19@@ -773,15 +773,24 @@ on_hook(PyObject *func)
20 return result;
21 }
22
23+
24 static int
25+#if defined(_RL_FUNCTION_TYPEDEF)
26 on_startup_hook(void)
27+#else
28+on_startup_hook()
29+#endif
30 {
31 return on_hook(startup_hook);
32 }
33
34 #ifdef HAVE_RL_PRE_INPUT_HOOK
35 static int
36+#if defined(_RL_FUNCTION_TYPEDEF)
37 on_pre_input_hook(void)
38+#else
39+on_pre_input_hook()
40+#endif
41 {
42 return on_hook(pre_input_hook);
43 }
44@@ -936,12 +945,12 @@ setup_readline(void)
45 rl_bind_key_in_map ('\t', rl_complete, emacs_meta_keymap);
46 rl_bind_key_in_map ('\033', rl_complete, emacs_meta_keymap);
47 /* Set our hook functions */
48- rl_startup_hook = (Function *)on_startup_hook;
49+ rl_startup_hook = (rl_hook_func_t *)on_startup_hook;
50 #ifdef HAVE_RL_PRE_INPUT_HOOK
51- rl_pre_input_hook = (Function *)on_pre_input_hook;
52+ rl_pre_input_hook = (rl_hook_func_t *)on_pre_input_hook;
53 #endif
54 /* Set our completion function */
55- rl_attempted_completion_function = (CPPFunction *)flex_complete;
56+ rl_attempted_completion_function = (rl_completion_func_t *)flex_complete;
57 /* Set Python word break characters */
58 completer_word_break_characters =
59 rl_completer_word_break_characters =
60--
611.7.9.5
62
diff --git a/meta/recipes-devtools/python/python3/python3-setup.py-no-host-headers-libs.patch b/meta/recipes-devtools/python/python3/python3-setup.py-no-host-headers-libs.patch
new file mode 100644
index 0000000000..8b6476037f
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/python3-setup.py-no-host-headers-libs.patch
@@ -0,0 +1,32 @@
1From 43238e1ac13e32984d015c92a5841f3de1fe1d15 Mon Sep 17 00:00:00 2001
2From: Jackie Huang <jackie.huang@windriver.com>
3Date: Tue, 18 Nov 2014 00:07:07 -0500
4Subject: [PATCH] setup.py: no host headers libs
5
6When we are cross-compiling, setup.py should never look in /usr
7or /usr/local to find headers or libraries.
8
9Upstream-Status: Inappropriate [Cross compile specific]
10
11Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
12---
13 setup.py | 3 ---
14 1 file changed, 3 deletions(-)
15
16diff --git a/setup.py b/setup.py
17index f020b28..e8339cd 100644
18--- a/setup.py
19+++ b/setup.py
20@@ -444,10 +444,7 @@ class PyBuildExt(build_ext):
21 if not cross_compiling:
22 add_dir_to_list(self.compiler.library_dirs, os.path.join('/usr/local', sys.lib))
23 add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
24- # only change this for cross builds for 3.3, issues on Mageia
25- if cross_compiling:
26 self.add_gcc_paths()
27- if not cross_compiling:
28 self.add_multiarch_paths()
29
30 # Add paths specified in the environment variables LDFLAGS and
31--
322.0.0
diff --git a/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch b/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch
new file mode 100644
index 0000000000..bf0a56f220
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch
@@ -0,0 +1,27 @@
1From 53ed216d7bf70dd2a925432b6805a701e5fc3e0e Mon Sep 17 00:00:00 2001
2From: Jackie Huang <jackie.huang@windriver.com>
3Date: Mon, 17 Nov 2014 06:44:47 +0000
4Subject: [PATCH] python3 use CROSSPYTHONPATH for PYTHON_FOR_BUILD
5
6Upstream-Status: Inappropriate [Cross compile specific]
7
8Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
9---
10 configure.ac | 2 +-
11 1 file changed, 1 insertion(+), 1 deletion(-)
12
13diff --git a/configure.ac b/configure.ac
14index 989baf9..2890c96 100644
15--- a/configure.ac
16+++ b/configure.ac
17@@ -67,7 +67,7 @@ if test "$cross_compiling" = yes; then
18 AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found])
19 fi
20 AC_MSG_RESULT($interp)
21- PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR) '$interp
22+ PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(CROSSPYTHONPATH) '$interp
23 fi
24 elif test "$cross_compiling" = maybe; then
25 AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH])
26--
272.0.1
diff --git a/meta/recipes-devtools/python/python3/remove_sqlite_rpath.patch b/meta/recipes-devtools/python/python3/remove_sqlite_rpath.patch
new file mode 100644
index 0000000000..4ec627ea51
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/remove_sqlite_rpath.patch
@@ -0,0 +1,19 @@
1This patch removes the RPATH setting which contains a pointer to
2the target relocated sysroot, which is incorrect.
3
4Upstream-Status: Inappropriate [Embedded Specific]
5
6Signed-off-by: Saul Wold <sgw@linux.intel.com>
7
8Index: Python-2.6.6/setup.py
9===================================================================
10--- Python-2.6.6.orig/setup.py 2011-09-28 14:22:57.000000000 -0700
11+++ Python-2.6.6/setup.py 2011-09-28 16:11:25.147279633 -0700
12@@ -1079,7 +1079,6 @@
13 include_dirs=["Modules/_sqlite",
14 sqlite_incdir],
15 library_dirs=sqlite_libdir,
16- runtime_library_dirs=sqlite_libdir,
17 extra_link_args=sqlite_extra_link_args,
18 libraries=["sqlite3",]))
19 else:
diff --git a/meta/recipes-devtools/python/python3/setuptweaks.patch b/meta/recipes-devtools/python/python3/setuptweaks.patch
new file mode 100644
index 0000000000..c34ef160d3
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/setuptweaks.patch
@@ -0,0 +1,57 @@
1This patch removes various ways native system options can pass into the python
2compilation and somehow break C modules.
3
4Upstream-Status: Configuration [OE Specific]
5
6RP 2012/04/23
7
8Index: Python-2.7.2/setup.py
9===================================================================
10--- Python-2.7.2.orig/setup.py 2012-04-23 20:03:47.295582553 +0000
11+++ Python-2.7.2/setup.py 2012-04-23 20:03:15.000000000 +0000
12@@ -231,7 +231,13 @@
13 # compilers
14 if compiler is not None:
15 (ccshared,cflags) = sysconfig.get_config_vars('CCSHARED','CFLAGS')
16- args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags
17+ # Need to filter out -isysroot from the flags. Ideally should
18+ # figure out target flags here.
19+ flags = []
20+ for f in cflags.split():
21+ if not f.startswith("-isystem"):
22+ flags.append(f)
23+ args['compiler_so'] = compiler + ' ' + ccshared + ' ' + ' '.join(flags)
24 self.compiler.set_executables(**args)
25
26 build_ext.build_extensions(self)
27@@ -393,7 +399,6 @@
28 # into configure and stored in the Makefile (issue found on OS X 10.3).
29 for env_var, arg_name, dir_list in (
30 ('LDFLAGS', '-R', self.compiler.runtime_library_dirs),
31- ('LDFLAGS', '-L', self.compiler.library_dirs),
32 ('CPPFLAGS', '-I', self.compiler.include_dirs)):
33 env_val = sysconfig.get_config_var(env_var)
34 if env_val:
35@@ -419,16 +424,16 @@
36 for directory in reversed(options.dirs):
37 add_dir_to_list(dir_list, directory)
38
39- if os.path.normpath(sys.prefix) != '/usr' \
40- and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
41+# if os.path.normpath(sys.prefix) != '/usr' \
42+# and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
43 # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
44 # (PYTHONFRAMEWORK is set) to avoid # linking problems when
45 # building a framework with different architectures than
46 # the one that is currently installed (issue #7473)
47- add_dir_to_list(self.compiler.library_dirs,
48- sysconfig.get_config_var("LIBDIR"))
49- add_dir_to_list(self.compiler.include_dirs,
50- sysconfig.get_config_var("INCLUDEDIR"))
51+# add_dir_to_list(self.compiler.library_dirs,
52+# sysconfig.get_config_var("LIBDIR"))
53+# add_dir_to_list(self.compiler.include_dirs,
54+# sysconfig.get_config_var("INCLUDEDIR"))
55
56 try:
57 have_unicode = unicode
diff --git a/meta/recipes-devtools/python/python3/shutil-follow-symlink-fix.patch b/meta/recipes-devtools/python/python3/shutil-follow-symlink-fix.patch
new file mode 100644
index 0000000000..802b1c7203
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/shutil-follow-symlink-fix.patch
@@ -0,0 +1,17 @@
1shutils should consider symlinks
2
3-Khem
4
5Upstream-Status: Pending
6
7--- a/Lib/shutil.py 2013-01-29 12:31:06.926555779 -0800
8+++ b/Lib/shutil.py 2013-01-29 16:31:39.097554182 -0800
9@@ -132,7 +132,7 @@ def copymode(src, dst, *, follow_symlink
10 st = stat_func(src)
11 chmod_func(dst, stat.S_IMODE(st.st_mode))
12
13-if hasattr(os, 'listxattr'):
14+if hasattr(os, 'listxattr') and os.listxattr in os.supports_follow_symlinks:
15 def _copyxattr(src, dst, *, follow_symlinks=True):
16 """Copy extended filesystem attributes from `src` to `dst`.
17
diff --git a/meta/recipes-devtools/python/python3/sitecustomize.py b/meta/recipes-devtools/python/python3/sitecustomize.py
new file mode 100644
index 0000000000..4c8b5e2ba3
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/sitecustomize.py
@@ -0,0 +1,37 @@
1# OpenEmbedded sitecustomize.py (C) 2002-2008 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
2# GPLv2 or later
3# Version: 20081123
4# Features:
5# * set proper default encoding
6# * enable readline completion in the interactive interpreter
7# * load command line history on startup
8# * save command line history on exit
9
10import os
11
12def __exithandler():
13 try:
14 readline.write_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) )
15 except IOError:
16 pass
17
18def __registerExitHandler():
19 import atexit
20 atexit.register( __exithandler )
21
22def __enableReadlineSupport():
23 readline.set_history_length( 1000 )
24 readline.parse_and_bind( "tab: complete" )
25 try:
26 readline.read_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) )
27 except IOError:
28 pass
29
30import sys
31try:
32 import rlcompleter, readline
33except ImportError:
34 pass
35else:
36 __registerExitHandler()
37 __enableReadlineSupport()
diff --git a/meta/recipes-devtools/python/python3/sys_platform_is_now_always_linux2.patch b/meta/recipes-devtools/python/python3/sys_platform_is_now_always_linux2.patch
new file mode 100644
index 0000000000..506210fa17
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/sys_platform_is_now_always_linux2.patch
@@ -0,0 +1,29 @@
1Upstream-Status: Accepted [http://hg.python.org/cpython/rev/c816479f6aaf/]
2Bugtracker: http://bugs.python.org/issue12326
3
4[Removed "Misc/NEWS" hunk]
5
6Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
7
8# HG changeset patch
9# User Victor Stinner <victor.stinner@haypocalc.com>
10# Date 1313841758 -7200
11# Node ID c816479f6aaf71dbd3f3fe4b239186d60c55ce48
12# Parent 3e093590ac57fdda428c7da3f72ddf0c475ecf2b
13Issue #12326: sys.platform is now always 'linux2' on Linux
14
15Even if Python is compiled on Linux 3.
16
17Index: Python-3.3.0rc2/configure.ac
18===================================================================
19--- Python-3.3.0rc2.orig/configure.ac 2012-09-09 02:11:14.000000000 -0700
20+++ Python-3.3.0rc2/configure.ac 2012-09-20 00:44:03.317124001 -0700
21@@ -366,7 +366,7 @@
22 MACHDEP="$ac_md_system$ac_md_release"
23
24 case $MACHDEP in
25- linux*) MACHDEP="linux";;
26+ linux*) MACHDEP="linux2";;
27 cygwin*) MACHDEP="cygwin";;
28 darwin*) MACHDEP="darwin";;
29 irix646) MACHDEP="irix6";;
diff --git a/meta/recipes-devtools/python/python3/sysroot-include-headers.patch b/meta/recipes-devtools/python/python3/sysroot-include-headers.patch
new file mode 100644
index 0000000000..785b5567f2
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/sysroot-include-headers.patch
@@ -0,0 +1,35 @@
1Dont search hardcoded paths, we might be doing a cross-build
2Use '=' in-front to let compiler append sysroot, if it can
3
4Should fix things like
5
6configure:6972: arm-angstrom-linux-gnueabi-gcc -march=armv7-a -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8 -DNDEBUG -fno-inline -D__SOFTFP__ --sysroot=/build/v2013.06/build/tmp-angstrom_v2013_06-eglibc/sysroots/beaglebone -c -O2 -pipe -g -feliminate-unused-debug-types -I/usr/include/ncursesw conftest.c >&5
7cc1: warning: include location "/usr/include/ncursesw" is unsafe for cross-compilation [-Wpoison-system-directories]
8
9
10Signed-off-by: Khem Raj
11Upstream-Status: Pending
12
13
14Index: Python-3.3.2/setup.py
15===================================================================
16--- Python-3.3.2.orig/setup.py 2013-07-30 01:30:48.000000000 -0700
17+++ Python-3.3.2/setup.py 2013-07-30 01:41:11.697862723 -0700
18@@ -1210,7 +1210,7 @@
19 panel_library = 'panel'
20 if curses_library == 'ncursesw':
21 curses_defines.append(('HAVE_NCURSESW', '1'))
22- curses_includes.append('/usr/include/ncursesw')
23+ curses_includes.append('=/usr/include/ncursesw')
24 # Bug 1464056: If _curses.so links with ncursesw,
25 # _curses_panel.so must link with panelw.
26 panel_library = 'panelw'
27@@ -1819,7 +1819,7 @@
28 if host_platform == 'darwin':
29 # OS X 10.5 comes with libffi.dylib; the include files are
30 # in /usr/include/ffi
31- inc_dirs.append('/usr/include/ffi')
32+ inc_dirs.append('=/usr/include/ffi')
33
34 ffi_inc = [sysconfig.get_config_var("LIBFFI_INCLUDEDIR")]
35 if not ffi_inc or ffi_inc[0] == '':
diff --git a/meta/recipes-devtools/python/python3/unixccompiler.patch b/meta/recipes-devtools/python/python3/unixccompiler.patch
new file mode 100644
index 0000000000..7b90f13883
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/unixccompiler.patch
@@ -0,0 +1,35 @@
1Upstream-Status: Pending
2
3The CC variable,sometimes like:"x86_64-poky-linux-gcc -m64 --sysroot=/${TMPDIR}/sysroots/qemux86-64", contains option information.
4This will lead to wrong compiler name "qemux86-64" rather than "x86_64-poky-linux-gcc" when python finding the compiler name.
5
6Secondly add -L=<path> this way linker will be able to resolve /usr/lib w.r.t sysroot and not
7use hardcoded /usr/lib to look for libs which is wrong in cross compile environment and this will work
8ok on native systems too since sysroot for native compilers is /
9
10Signed-off-by: Mei Lei <lei.mei@intel.com>
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12Index: Python-3.3.2/Lib/distutils/unixccompiler.py
13===================================================================
14--- Python-3.3.2.orig/Lib/distutils/unixccompiler.py 2013-05-15 09:32:54.000000000 -0700
15+++ Python-3.3.2/Lib/distutils/unixccompiler.py 2013-08-01 00:58:18.629056286 -0700
16@@ -202,7 +202,9 @@
17 # ccompiler.py.
18
19 def library_dir_option(self, dir):
20- return "-L" + dir
21+ if dir.startswith("."):
22+ return "-L" + dir
23+ return "-L=" + dir
24
25 def _is_gcc(self, compiler_name):
26 return "gcc" in compiler_name or "g++" in compiler_name
27@@ -221,7 +221,7 @@
28 # this time, there's no way to determine this information from
29 # the configuration data stored in the Python installation, so
30 # we use this hack.
31- compiler = os.path.basename(sysconfig.get_config_var("CC"))
32+ compiler = sysconfig.get_config_var("CC")
33 if sys.platform[:6] == "darwin":
34 # MacOSX's linker doesn't understand the -R flag at all
35 return "-L" + dir