summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-devtools/python/python3-native_3.3.3.bb70
-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_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/python-3.3-multilib.patch336
-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.patch33
-rw-r--r--meta/recipes-devtools/python/python3_3.3.3.bb211
28 files changed, 1636 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3-native_3.3.3.bb b/meta/recipes-devtools/python/python3-native_3.3.3.bb
new file mode 100644
index 0000000000..26b811fc5c
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-native_3.3.3.bb
@@ -0,0 +1,70 @@
1require recipes-devtools/python/python.inc
2
3PR = "${INC_PR}.0"
4PYTHON_MAJMIN = "3.3"
5DISTRO_SRC_URI ?= "file://sitecustomize.py"
6DISTRO_SRC_URI_linuxstdbase = ""
7SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.bz2 \
8file://12-distutils-prefix-is-inside-staging-area.patch \
9file://000-cross-compile.patch \
10file://020-dont-compile-python-files.patch \
11file://030-fixup-include-dirs.patch \
12file://070-dont-clean-ipkg-install.patch \
13file://080-distutils-dont_adjust_files.patch \
14file://110-enable-zlib.patch \
15file://130-readline-setup.patch \
16file://150-fix-setupterm.patch \
17file://python-3.3-multilib.patch \
18file://03-fix-tkinter-detection.patch \
19file://avoid_warning_about_tkinter.patch \
20file://06-ctypes-libffi-fix-configure.patch \
21file://shutil-follow-symlink-fix.patch \
22file://0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch \
23file://sysroot-include-headers.patch \
24file://unixccompiler.patch \
25${DISTRO_SRC_URI} \
26"
27SRC_URI[md5sum] = "f3ebe34d4d8695bf889279b54673e10c"
28SRC_URI[sha256sum] = "e526e9b612f623888364d30cc9f3dfc34dcef39065c713bdbcddf47df84d8dcb"
29
30LIC_FILES_CHKSUM = "file://LICENSE;md5=4eaea08eaaf6875189b0c49f26fa2005"
31
32S = "${WORKDIR}/Python-${PV}"
33
34EXTRANATIVEPATH += "bzip2-native"
35DEPENDS = "openssl-native bzip2-replacement-native zlib-native readline-native sqlite3-native"
36
37inherit native
38
39RPROVIDES += "python3-distutils-native python3-compression-native python3-textutils-native python3-core-native"
40
41EXTRA_OECONF_append = " --bindir=${bindir}/${PN}"
42
43EXTRA_OEMAKE = '\
44 BUILD_SYS="" \
45 HOST_SYS="" \
46 LIBC="" \
47 STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE} \
48 STAGING_INCDIR=${STAGING_INCDIR_NATIVE} \
49 LIB=${baselib} \
50 ARCH=${TARGET_ARCH} \
51'
52
53do_configure_prepend() {
54 autoreconf --verbose --install --force --exclude=autopoint Modules/_ctypes/libffi || bbnote "_ctypes failed to autoreconf"
55}
56
57do_install() {
58 install -d ${D}${libdir}/pkgconfig
59 oe_runmake 'DESTDIR=${D}' install
60 if [ -e ${WORKDIR}/sitecustomize.py ]; then
61 install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN}
62 fi
63 install -d ${D}${bindir}/${PN}
64 install -m 0755 Parser/pgen ${D}${bindir}/${PN}
65
66 # Make sure we use /usr/bin/env python
67 for PYTHSCRIPT in `grep -rIl ${bindir}/${PN}/python ${D}${bindir}/${PN}`; do
68 sed -i -e '1s|^#!.*|#!/usr/bin/env python|' $PYTHSCRIPT
69 done
70}
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_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/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/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..b2229b4a57
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/unixccompiler.patch
@@ -0,0 +1,33 @@
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,7 @@
17 # ccompiler.py.
18
19 def library_dir_option(self, dir):
20- return "-L" + dir
21+ return "-L=" + dir
22
23 def _is_gcc(self, compiler_name):
24 return "gcc" in compiler_name or "g++" in compiler_name
25@@ -221,7 +221,7 @@
26 # this time, there's no way to determine this information from
27 # the configuration data stored in the Python installation, so
28 # we use this hack.
29- compiler = os.path.basename(sysconfig.get_config_var("CC"))
30+ compiler = sysconfig.get_config_var("CC")
31 if sys.platform[:6] == "darwin":
32 # MacOSX's linker doesn't understand the -R flag at all
33 return "-L" + dir
diff --git a/meta/recipes-devtools/python/python3_3.3.3.bb b/meta/recipes-devtools/python/python3_3.3.3.bb
new file mode 100644
index 0000000000..d359863833
--- /dev/null
+++ b/meta/recipes-devtools/python/python3_3.3.3.bb
@@ -0,0 +1,211 @@
1require recipes-devtools/python/python.inc
2
3DEPENDS = "python3-native libffi bzip2 db gdbm openssl readline sqlite3 zlib virtual/libintl xz"
4PR = "${INC_PR}.0"
5PYTHON_MAJMIN = "3.3"
6PYTHON_BINABI= "${PYTHON_MAJMIN}m"
7DISTRO_SRC_URI ?= "file://sitecustomize.py"
8DISTRO_SRC_URI_linuxstdbase = ""
9SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.bz2 \
10file://12-distutils-prefix-is-inside-staging-area.patch \
11file://000-cross-compile.patch \
12file://020-dont-compile-python-files.patch \
13file://030-fixup-include-dirs.patch \
14file://070-dont-clean-ipkg-install.patch \
15file://080-distutils-dont_adjust_files.patch \
16file://110-enable-zlib.patch \
17file://130-readline-setup.patch \
18file://150-fix-setupterm.patch \
19file://0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch \
20${DISTRO_SRC_URI} \
21"
22
23SRC_URI += "\
24 file://03-fix-tkinter-detection.patch \
25 file://04-default-is-optimized.patch \
26 file://avoid_warning_about_tkinter.patch \
27 file://06-ctypes-libffi-fix-configure.patch \
28 file://remove_sqlite_rpath.patch \
29 file://cgi_py.patch \
30 file://host_include_contamination.patch \
31 file://python-3.3-multilib.patch \
32 file://shutil-follow-symlink-fix.patch \
33 file://sysroot-include-headers.patch \
34 file://unixccompiler.patch \
35 file://avoid-ncursesw-include-path.patch \
36 "
37SRC_URI[md5sum] = "f3ebe34d4d8695bf889279b54673e10c"
38SRC_URI[sha256sum] = "e526e9b612f623888364d30cc9f3dfc34dcef39065c713bdbcddf47df84d8dcb"
39
40LIC_FILES_CHKSUM = "file://LICENSE;md5=4eaea08eaaf6875189b0c49f26fa2005"
41
42S = "${WORKDIR}/Python-${PV}"
43
44inherit autotools multilib_header python3native pkgconfig
45
46CONFIGUREOPTS += " --with-system-ffi "
47
48CACHED_CONFIGUREVARS = "ac_cv_have_chflags=no \
49 ac_cv_have_lchflags=no \
50 ac_cv_have_long_long_format=yes \
51 ac_cv_buggy_getaddrinfo=no \
52 ac_cv_file__dev_ptmx=yes \
53 ac_cv_file__dev_ptc=no \
54"
55# The 3 lines below are copied from the libffi recipe, ctypes ships its own copy of the libffi sources
56#Somehow gcc doesn't set __SOFTFP__ when passing -mfloatabi=softp :(
57TARGET_CC_ARCH_append_armv6 = " -D__SOFTFP__"
58TARGET_CC_ARCH_append_armv7a = " -D__SOFTFP__"
59TARGET_CC_ARCH += "-DNDEBUG -fno-inline"
60EXTRA_OEMAKE += "CROSS_COMPILE=yes"
61
62do_configure_prepend() {
63 rm -f ${S}/Makefile.orig
64 autoreconf -Wcross --verbose --install --force --exclude=autopoint Modules/_ctypes/libffi || bbnote "_ctypes failed to autoreconf"
65}
66
67do_compile() {
68 # regenerate platform specific files, because they depend on system headers
69 cd Lib/plat-linux*
70 include=${STAGING_INCDIR} ${STAGING_BINDIR_NATIVE}/python3-native/python3 \
71 ${S}/Tools/scripts/h2py.py -i '(u_long)' \
72 ${STAGING_INCDIR}/dlfcn.h \
73 ${STAGING_INCDIR}/linux/cdrom.h \
74 ${STAGING_INCDIR}/netinet/in.h \
75 ${STAGING_INCDIR}/sys/types.h
76 sed -e 's,${STAGING_DIR_HOST},,g' -i *.py
77 cd -
78
79 # remove hardcoded ccache, see http://bugs.openembedded.net/show_bug.cgi?id=4144
80 sed -i -e s,ccache,'$(CCACHE)', Makefile
81
82 # remove any bogus LD_LIBRARY_PATH
83 sed -i -e s,RUNSHARED=.*,RUNSHARED=, Makefile
84
85 if [ ! -f Makefile.orig ]; then
86 install -m 0644 Makefile Makefile.orig
87 fi
88 sed -i -e 's,^CONFIGURE_LDFLAGS=.*,CONFIGURE_LDFLAGS=-L. -L${STAGING_LIBDIR},g' \
89 -e 's,libdir=${libdir},libdir=${STAGING_LIBDIR},g' \
90 -e 's,libexecdir=${libexecdir},libexecdir=${STAGING_DIR_HOST}${libexecdir},g' \
91 -e 's,^LIBDIR=.*,LIBDIR=${STAGING_LIBDIR},g' \
92 -e 's,includedir=${includedir},includedir=${STAGING_INCDIR},g' \
93 -e 's,^INCLUDEDIR=.*,INCLUDE=${STAGING_INCDIR},g' \
94 -e 's,^CONFINCLUDEDIR=.*,CONFINCLUDE=${STAGING_INCDIR},g' \
95 Makefile
96 # save copy of it now, because if we do it in do_install and
97 # then call do_install twice we get Makefile.orig == Makefile.sysroot
98 install -m 0644 Makefile Makefile.sysroot
99
100 export CROSS_COMPILE="${TARGET_PREFIX}"
101 export PYTHONBUILDDIR="${S}"
102 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \
103 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \
104 STAGING_LIBDIR=${STAGING_LIBDIR} \
105 STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
106 STAGING_INCDIR=${STAGING_INCDIR} \
107 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
108 LIB=${baselib} \
109 ARCH=${TARGET_ARCH} \
110 OPT="${CFLAGS}" libpython3.so
111
112 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native3/pgen \
113 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native3/python3 \
114 STAGING_LIBDIR=${STAGING_LIBDIR} \
115 STAGING_INCDIR=${STAGING_INCDIR} \
116 STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
117 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
118 LIB=${baselib} \
119 ARCH=${TARGET_ARCH} \
120 OPT="${CFLAGS}"
121}
122
123do_install() {
124 # make install needs the original Makefile, or otherwise the inclues would
125 # go to ${D}${STAGING...}/...
126 install -m 0644 Makefile.orig Makefile
127
128 export CROSS_COMPILE="${TARGET_PREFIX}"
129 export PYTHONBUILDDIR="${S}"
130 install -d ${D}${libdir}/pkgconfig
131 install -d ${D}${libdir}/python${PYTHON_MAJMIN}/config
132
133 # rerun the build once again with original makefile this time
134 # run install in a separate step to avoid compile/install race
135 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native3/pgen \
136 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native3/python3 \
137 CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \
138 STAGING_LIBDIR=${STAGING_LIBDIR} \
139 STAGING_INCDIR=${STAGING_INCDIR} \
140 STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
141 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
142 LIB=${baselib} \
143 ARCH=${TARGET_ARCH} \
144 DESTDIR=${D} LIBDIR=${libdir}
145
146 oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native3/pgen \
147 HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native3/python3 \
148 CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \
149 STAGING_LIBDIR=${STAGING_LIBDIR} \
150 STAGING_INCDIR=${STAGING_INCDIR} \
151 STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
152 BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
153 LIB=${baselib} \
154 ARCH=${TARGET_ARCH} \
155 DESTDIR=${D} LIBDIR=${libdir} install
156
157 install -m 0644 Makefile.sysroot ${D}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
158
159 if [ -e ${WORKDIR}/sitecustomize.py ]; then
160 install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN}
161 fi
162
163 oe_multilib_header python${PYTHON_MAJMIN}/pyconfig.h
164}
165
166do_install_append_class-nativesdk () {
167 create_wrapper ${D}${bindir}/python${PYTHON_MAJMIN} TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo'
168}
169
170SSTATE_SCAN_FILES += "Makefile"
171PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess"
172
173py_package_preprocess () {
174 # copy back the old Makefile to fix target package
175 install -m 0644 Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
176 # Remove references to buildmachine paths in target Makefile
177 sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
178}
179
180require python-${PYTHON_MAJMIN}-manifest.inc
181
182# manual dependency additions
183RPROVIDES_${PN}-core = "${PN}"
184RRECOMMENDS_${PN}-core = "${PN}-readline"
185RRECOMMENDS_${PN}-crypt = "openssl"
186RRECOMMENDS_${PN}-crypt_class-nativesdk = "nativesdk-openssl"
187
188FILES_${PN}-2to3 += "${bindir}/2to3-${PYTHON_MAJMIN}"
189FILES_${PN}-pydoc += "${bindir}/pydoc${PYTHON_MAJMIN} ${bindir}/pydoc3"
190FILES_${PN}-idle += "${bindir}/idle3 ${bindir}/idle${PYTHON_MAJMIN}"
191
192PACKAGES =+ "${PN}-pyvenv"
193FILES_${PN}-pyvenv += "${bindir}/pyvenv-${PYTHON_MAJMIN} ${bindir}/pyvenv"
194
195# package libpython3
196PACKAGES =+ "libpython3 libpython3-staticdev"
197FILES_libpython3 = "${libdir}/libpython*.so.*"
198FILES_libpython3-staticdev += "${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_BINABI}/libpython${PYTHON_BINABI}.a"
199
200# catch debug extensions (isn't that already in python-core-dbg?)
201FILES_${PN}-dbg += "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/.debug"
202
203# catch all the rest (unsorted)
204PACKAGES += "${PN}-misc"
205FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}"
206
207# catch manpage
208PACKAGES += "${PN}-man"
209FILES_${PN}-man = "${datadir}/man"
210
211BBCLASSEXTEND = "nativesdk"