summaryrefslogtreecommitdiffstats
path: root/poky/meta/recipes-devtools/python
diff options
context:
space:
mode:
Diffstat (limited to 'poky/meta/recipes-devtools/python')
-rw-r--r--poky/meta/recipes-devtools/python/python-async.inc14
-rw-r--r--poky/meta/recipes-devtools/python/python-git.inc32
-rw-r--r--poky/meta/recipes-devtools/python/python-gitdb.inc24
-rw-r--r--poky/meta/recipes-devtools/python/python-mako.inc21
-rw-r--r--poky/meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch18
-rw-r--r--poky/meta/recipes-devtools/python/python-native/11-distutils-never-modify-shebang-line.patch20
-rw-r--r--poky/meta/recipes-devtools/python/python-native/debug.patch32
-rw-r--r--poky/meta/recipes-devtools/python/python-native/multilib.patch235
-rw-r--r--poky/meta/recipes-devtools/python/python-native/nohostlibs.patch54
-rw-r--r--poky/meta/recipes-devtools/python/python-native/revert_use_of_sysconfigdata.patch86
-rw-r--r--poky/meta/recipes-devtools/python/python-native/unixccompiler.patch20
-rw-r--r--poky/meta/recipes-devtools/python/python-native_2.7.14.bb86
-rw-r--r--poky/meta/recipes-devtools/python/python-nose.inc18
-rw-r--r--poky/meta/recipes-devtools/python/python-nose_1.3.7.bb2
-rw-r--r--poky/meta/recipes-devtools/python/python-scons-native_3.0.1.bb8
-rw-r--r--poky/meta/recipes-devtools/python/python-scons_3.0.1.bb21
-rw-r--r--poky/meta/recipes-devtools/python/python-setuptools.inc48
-rw-r--r--poky/meta/recipes-devtools/python/python-setuptools_39.0.0.bb9
-rw-r--r--poky/meta/recipes-devtools/python/python-six.inc14
-rw-r--r--poky/meta/recipes-devtools/python/python-smmap.inc18
-rw-r--r--poky/meta/recipes-devtools/python/python.inc40
-rw-r--r--poky/meta/recipes-devtools/python/python/0001-distutils-set-the-prefix-to-be-inside-staging-direct.patch51
-rw-r--r--poky/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch100
-rw-r--r--poky/meta/recipes-devtools/python/python/03-fix-tkinter-detection.patch46
-rw-r--r--poky/meta/recipes-devtools/python/python/05-enable-ctypes-cross-build.patch27
-rw-r--r--poky/meta/recipes-devtools/python/python/06-avoid_usr_lib_termcap_path_in_linking.patch35
-rw-r--r--poky/meta/recipes-devtools/python/python/add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch28
-rw-r--r--poky/meta/recipes-devtools/python/python/add-md5module-support.patch18
-rw-r--r--poky/meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patch29
-rw-r--r--poky/meta/recipes-devtools/python/python/avoid_warning_for_sunos_specific_module.patch23
-rw-r--r--poky/meta/recipes-devtools/python/python/builddir.patch46
-rw-r--r--poky/meta/recipes-devtools/python/python/cgi_py.patch23
-rw-r--r--poky/meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch57
-rw-r--r--poky/meta/recipes-devtools/python/python/create_manifest2.py277
-rw-r--r--poky/meta/recipes-devtools/python/python/fix-gc-alignment.patch43
-rw-r--r--poky/meta/recipes-devtools/python/python/fix-makefile-for-ptest.patch34
-rw-r--r--poky/meta/recipes-devtools/python/python/fix_for_using_different_libdir.patch77
-rw-r--r--poky/meta/recipes-devtools/python/python/get_module_deps2.py112
-rw-r--r--poky/meta/recipes-devtools/python/python/host_include_contamination.patch28
-rw-r--r--poky/meta/recipes-devtools/python/python/multilib.patch298
-rw-r--r--poky/meta/recipes-devtools/python/python/parallel-makeinst-create-bindir.patch19
-rw-r--r--poky/meta/recipes-devtools/python/python/pass-missing-libraries-to-Extension-for-mul.patch82
-rw-r--r--poky/meta/recipes-devtools/python/python/python-2.7.3-remove-bsdb-rpath.patch28
-rw-r--r--poky/meta/recipes-devtools/python/python/python2-manifest.json1047
-rw-r--r--poky/meta/recipes-devtools/python/python/run-ptest5
-rw-r--r--poky/meta/recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch35
-rw-r--r--poky/meta/recipes-devtools/python/python/setup_py_skip_cross_import_check.patch27
-rw-r--r--poky/meta/recipes-devtools/python/python/setuptweaks.patch57
-rw-r--r--poky/meta/recipes-devtools/python/python/sitecustomize.py37
-rw-r--r--poky/meta/recipes-devtools/python/python/support_SOURCE_DATE_EPOCH_in_py_compile_2.7.patch34
-rw-r--r--poky/meta/recipes-devtools/python/python/use_sysroot_ncurses_instead_of_host.patch21
-rw-r--r--poky/meta/recipes-devtools/python/python3-async_0.6.2.bb2
-rw-r--r--poky/meta/recipes-devtools/python/python3-dbus_1.2.6.bb23
-rw-r--r--poky/meta/recipes-devtools/python/python3-docutils_0.14.bb18
-rw-r--r--poky/meta/recipes-devtools/python/python3-git_2.1.8.bb2
-rw-r--r--poky/meta/recipes-devtools/python/python3-gitdb_2.0.3.bb2
-rw-r--r--poky/meta/recipes-devtools/python/python3-iniparse/0001-Add-python-3-compatibility.patch552
-rw-r--r--poky/meta/recipes-devtools/python/python3-iniparse_0.4.bb17
-rw-r--r--poky/meta/recipes-devtools/python/python3-mako_1.0.7.bb2
-rw-r--r--poky/meta/recipes-devtools/python/python3-native_3.5.5.bb112
-rw-r--r--poky/meta/recipes-devtools/python/python3-nose_1.3.7.bb6
-rw-r--r--poky/meta/recipes-devtools/python/python3-pip_9.0.2.bb48
-rw-r--r--poky/meta/recipes-devtools/python/python3-pycairo_1.15.6.bb31
-rw-r--r--poky/meta/recipes-devtools/python/python3-pygobject_3.28.1.bb29
-rw-r--r--poky/meta/recipes-devtools/python/python3-setuptools_39.0.0.bb6
-rw-r--r--poky/meta/recipes-devtools/python/python3-six_1.11.0.bb2
-rw-r--r--poky/meta/recipes-devtools/python/python3-smmap_0.9.0.bb2
-rw-r--r--poky/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch38
-rw-r--r--poky/meta/recipes-devtools/python/python3/0001-Issue-21272-Use-_sysconfigdata.py-to-initialize-dist.patch66
-rw-r--r--poky/meta/recipes-devtools/python/python3/0001-cross-compile-support.patch96
-rw-r--r--poky/meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch37
-rw-r--r--poky/meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch42
-rw-r--r--poky/meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch33
-rw-r--r--poky/meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch38
-rw-r--r--poky/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch92
-rw-r--r--poky/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch57
-rw-r--r--poky/meta/recipes-devtools/python/python3/130-readline-setup.patch55
-rw-r--r--poky/meta/recipes-devtools/python/python3/150-fix-setupterm.patch17
-rw-r--r--poky/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch21
-rw-r--r--poky/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch29
-rw-r--r--poky/meta/recipes-devtools/python/python3/cgi_py.patch23
-rw-r--r--poky/meta/recipes-devtools/python/python3/configure.ac-fix-LIBPL.patch30
-rw-r--r--poky/meta/recipes-devtools/python/python3/create_manifest3.py354
-rw-r--r--poky/meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch54
-rw-r--r--poky/meta/recipes-devtools/python/python3/get_module_deps3.py146
-rw-r--r--poky/meta/recipes-devtools/python/python3/host_include_contamination.patch28
-rw-r--r--poky/meta/recipes-devtools/python/python3/pass-missing-libraries-to-Extension-for-mul.patch82
-rw-r--r--poky/meta/recipes-devtools/python/python3/python-3.3-multilib.patch363
-rw-r--r--poky/meta/recipes-devtools/python/python3/python-config.patch46
-rw-r--r--poky/meta/recipes-devtools/python/python3/python3-manifest.json1149
-rw-r--r--poky/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch25
-rw-r--r--poky/meta/recipes-devtools/python/python3/regen-all.patch25
-rw-r--r--poky/meta/recipes-devtools/python/python3/setup.py-check-cross_compiling-when-get-FLAGS.patch50
-rw-r--r--poky/meta/recipes-devtools/python/python3/setuptweaks.patch57
-rw-r--r--poky/meta/recipes-devtools/python/python3/shutil-follow-symlink-fix.patch17
-rw-r--r--poky/meta/recipes-devtools/python/python3/sitecustomize.py37
-rw-r--r--poky/meta/recipes-devtools/python/python3/support_SOURCE_DATE_EPOCH_in_py_compile.patch97
-rw-r--r--poky/meta/recipes-devtools/python/python3/sysconfig.py-add-_PYTHON_PROJECT_SRC.patch51
-rw-r--r--poky/meta/recipes-devtools/python/python3/sysroot-include-headers.patch35
-rw-r--r--poky/meta/recipes-devtools/python/python3/tweak-MULTIARCH-for-powerpc-linux-gnuspe.patch52
-rw-r--r--poky/meta/recipes-devtools/python/python3/unixccompiler.patch35
-rw-r--r--poky/meta/recipes-devtools/python/python3_3.5.5.bb323
-rw-r--r--poky/meta/recipes-devtools/python/python_2.7.14.bb282
103 files changed, 8400 insertions, 0 deletions
diff --git a/poky/meta/recipes-devtools/python/python-async.inc b/poky/meta/recipes-devtools/python/python-async.inc
new file mode 100644
index 000000000..6664ab013
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-async.inc
@@ -0,0 +1,14 @@
+SUMMARY = "Python framework to process interdependent tasks in a pool of workers"
+HOMEPAGE = "http://github.com/gitpython-developers/async"
+SECTION = "devel/python"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=88df8e78b9edfd744953862179f2d14e"
+
+inherit pypi
+
+SRC_URI[md5sum] = "9b06b5997de2154f3bc0273f80bcef6b"
+SRC_URI[sha256sum] = "ac6894d876e45878faae493b0cf61d0e28ec417334448ac0a6ea2229d8343051"
+
+RDEPENDS_${PN} += "${PYTHON_PN}-threading"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/poky/meta/recipes-devtools/python/python-git.inc b/poky/meta/recipes-devtools/python/python-git.inc
new file mode 100644
index 000000000..8d3769396
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-git.inc
@@ -0,0 +1,32 @@
+SUMMARY = "Python library used to interact with Git repositories"
+DESCRIPTION = "GitPython provides object model read and write access to \
+a git repository. Access repository information conveniently, alter the \
+index directly, handle remotes, or go down to low-level object database \
+access with big-files support."
+HOMEPAGE = "http://github.com/gitpython-developers/GitPython"
+SECTION = "devel/python"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=8b8d26c37c1d5a04f9b0186edbebc183"
+
+PYPI_PACKAGE = "GitPython"
+
+inherit pypi
+
+SRC_URI[md5sum] = "7a94ee1b923fb772a2a0c6649430a17c"
+SRC_URI[sha256sum] = "ad61bc25deadb535b047684d06f3654c001d9415e1971e51c9c20f5b510076e9"
+
+DEPENDS = "${PYTHON_PN}-gitdb"
+
+RDEPENDS_${PN} += " \
+ ${PYTHON_PN}-datetime \
+ ${PYTHON_PN}-gitdb \
+ ${PYTHON_PN}-io \
+ ${PYTHON_PN}-logging \
+ ${PYTHON_PN}-math \
+ ${PYTHON_PN}-netclient \
+ ${PYTHON_PN}-stringold \
+ ${PYTHON_PN}-unittest \
+ ${PYTHON_PN}-unixadmin \
+ git \
+"
+BBCLASSEXTEND = "nativesdk"
diff --git a/poky/meta/recipes-devtools/python/python-gitdb.inc b/poky/meta/recipes-devtools/python/python-gitdb.inc
new file mode 100644
index 000000000..2d5292e5d
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-gitdb.inc
@@ -0,0 +1,24 @@
+SUMMARY = "A pure-Python git object database"
+HOMEPAGE = "http://github.com/gitpython-developers/gitdb"
+SECTION = "devel/python"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=59e5ecb13339a936eedf83282eaf4528"
+
+inherit pypi
+
+PYPI_PACKAGE = "gitdb2"
+
+SRC_URI[md5sum] = "d5217eb94ebd36fcec62b929d1f72b00"
+SRC_URI[sha256sum] = "b60e29d4533e5e25bb50b7678bbc187c8f6bcff1344b4f293b2ba55c85795f09"
+
+DEPENDS = "${PYTHON_PN}-async ${PYTHON_PN}-setuptools-native ${PYTHON_PN}-smmap"
+
+RDEPENDS_${PN} += "${PYTHON_PN}-async \
+ ${PYTHON_PN}-compression \
+ ${PYTHON_PN}-crypt \
+ ${PYTHON_PN}-io \
+ ${PYTHON_PN}-mmap \
+ ${PYTHON_PN}-shell \
+ ${PYTHON_PN}-smmap \
+"
+BBCLASSEXTEND = "nativesdk"
diff --git a/poky/meta/recipes-devtools/python/python-mako.inc b/poky/meta/recipes-devtools/python/python-mako.inc
new file mode 100644
index 000000000..e265bde85
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-mako.inc
@@ -0,0 +1,21 @@
+SUMMARY = "Templating library for Python"
+HOMEPAGE = "http://www.makotemplates.org/"
+SECTION = "devel/python"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=1bb21fa2d2f7a534c884b990430a6863"
+
+PYPI_PACKAGE = "Mako"
+
+inherit pypi
+
+SRC_URI[md5sum] = "5836cc997b1b773ef389bf6629c30e65"
+SRC_URI[sha256sum] = "4e02fde57bd4abb5ec400181e4c314f56ac3e49ba4fb8b0d50bba18cb27d25ae"
+
+RDEPENDS_${PN} = "${PYTHON_PN}-html \
+ ${PYTHON_PN}-netclient \
+ ${PYTHON_PN}-threading \
+"
+
+RDEPENDS_${PN}_class-native = ""
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch b/poky/meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch
new file mode 100644
index 000000000..a39247ce7
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch
@@ -0,0 +1,18 @@
+Upstream-Status: Pending
+
+# Some versions of SWIG do not use the extension parameter.
+# Make it optional.
+# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
+Index: Python-2.6.1/Lib/distutils/command/build_ext.py
+===================================================================
+--- Python-2.6.1.orig/Lib/distutils/command/build_ext.py
++++ Python-2.6.1/Lib/distutils/command/build_ext.py
+@@ -566,7 +566,7 @@ class build_ext (Command):
+ target_lang=language)
+
+
+- def swig_sources (self, sources, extension):
++ def swig_sources (self, sources, extension=None):
+
+ """Walk the list of source files in 'sources', looking for SWIG
+ interface (.i) files. Run SWIG on all that are found, and
diff --git a/poky/meta/recipes-devtools/python/python-native/11-distutils-never-modify-shebang-line.patch b/poky/meta/recipes-devtools/python/python-native/11-distutils-never-modify-shebang-line.patch
new file mode 100644
index 000000000..c92469b9b
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-native/11-distutils-never-modify-shebang-line.patch
@@ -0,0 +1,20 @@
+Upstream-Status: Pending
+
+# Don't modify the she-bang line for a cross-build.
+# Otherwise it points to our hostpython (which we do not want)
+#
+# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
+
+Index: Python-2.6.1/Lib/distutils/command/build_scripts.py
+===================================================================
+--- Python-2.6.1.orig/Lib/distutils/command/build_scripts.py
++++ Python-2.6.1/Lib/distutils/command/build_scripts.py
+@@ -87,7 +87,7 @@ class build_scripts (Command):
+ continue
+
+ match = first_line_re.match(first_line)
+- if match:
++ if False: #match:
+ adjust = 1
+ post_interp = match.group(1) or ''
+
diff --git a/poky/meta/recipes-devtools/python/python-native/debug.patch b/poky/meta/recipes-devtools/python/python-native/debug.patch
new file mode 100644
index 000000000..361788264
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-native/debug.patch
@@ -0,0 +1,32 @@
+Upstream-Status: Pending
+
+Index: Python-2.7.12/Lib/distutils/unixccompiler.py
+===================================================================
+--- Python-2.7.12.orig/Lib/distutils/unixccompiler.py
++++ Python-2.7.12/Lib/distutils/unixccompiler.py
+@@ -278,6 +278,8 @@ class UnixCCompiler(CCompiler):
+
+
+
++ print "Looking in %s for %s" % (lib, dirs)
++
+ for dir in dirs:
+ shared = os.path.join(dir, shared_f)
+ dylib = os.path.join(dir, dylib_f)
+@@ -298,12 +300,16 @@ class UnixCCompiler(CCompiler):
+ # assuming that *all* Unix C compilers do. And of course I'm
+ # ignoring even GCC's "-static" option. So sue me.
+ if os.path.exists(dylib):
++ print "Found %s" % (dylib)
+ return dylib
+ elif os.path.exists(xcode_stub):
++ print "Found %s" % (xcode_stub)
+ return xcode_stub
+ elif os.path.exists(shared):
++ print "Found %s" % (shared)
+ return shared
+ elif os.path.exists(static):
++ print "Found %s" % (static)
+ return static
+
+ # Oops, didn't find it in *any* of 'dirs'
diff --git a/poky/meta/recipes-devtools/python/python-native/multilib.patch b/poky/meta/recipes-devtools/python/python-native/multilib.patch
new file mode 100644
index 000000000..af0f173c6
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-native/multilib.patch
@@ -0,0 +1,235 @@
+Rebased for Python 2.7.9
+
+Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+2011/09/29
+The python recipe building was failing because python-native
+could not handle sys.lib var. sys.lib var is defined in the
+multilib patch hence added this multilib.patch for python-native
+recipe.
+
+Upstream-Status: Inappropriate [oe-specific]
+
+Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+
+Index: Python-2.7.14/Include/pythonrun.h
+===================================================================
+--- Python-2.7.14.orig/Include/pythonrun.h
++++ Python-2.7.14/Include/pythonrun.h
+@@ -108,6 +108,7 @@ PyAPI_FUNC(char *) Py_GetPath(void);
+ /* In their own files */
+ PyAPI_FUNC(const char *) Py_GetVersion(void);
+ PyAPI_FUNC(const char *) Py_GetPlatform(void);
++PyAPI_FUNC(const char *) Py_GetLib(void);
+ PyAPI_FUNC(const char *) Py_GetCopyright(void);
+ PyAPI_FUNC(const char *) Py_GetCompiler(void);
+ PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
+Index: Python-2.7.14/Lib/distutils/command/install.py
+===================================================================
+--- Python-2.7.14.orig/Lib/distutils/command/install.py
++++ Python-2.7.14/Lib/distutils/command/install.py
+@@ -22,6 +22,8 @@ from site import USER_BASE
+ from site import USER_SITE
+
+
++libname = sys.lib
++
+ if sys.version < "2.2":
+ WINDOWS_SCHEME = {
+ 'purelib': '$base',
+@@ -42,7 +44,7 @@ else:
+ INSTALL_SCHEMES = {
+ 'unix_prefix': {
+ 'purelib': '$base/lib/python$py_version_short/site-packages',
+- 'platlib': '$platbase/lib/python$py_version_short/site-packages',
++ 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages',
+ 'headers': '$base/include/python$py_version_short/$dist_name',
+ 'scripts': '$base/bin',
+ 'data' : '$base',
+Index: Python-2.7.14/Lib/pydoc.py
+===================================================================
+--- Python-2.7.14.orig/Lib/pydoc.py
++++ Python-2.7.14/Lib/pydoc.py
+@@ -375,7 +375,7 @@ class Doc:
+ docmodule = docclass = docroutine = docother = docproperty = docdata = fail
+
+ def getdocloc(self, object,
+- basedir=os.path.join(sys.exec_prefix, "lib",
++ basedir=os.path.join(sys.exec_prefix, "sys.lib",
+ "python"+sys.version[0:3])):
+ """Return the location of module docs or None"""
+
+Index: Python-2.7.14/Lib/site.py
+===================================================================
+--- Python-2.7.14.orig/Lib/site.py
++++ Python-2.7.14/Lib/site.py
+@@ -288,13 +288,19 @@ def getsitepackages():
+ if sys.platform in ('os2emx', 'riscos'):
+ sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
+ elif os.sep == '/':
+- sitepackages.append(os.path.join(prefix, "lib",
++ sitepackages.append(os.path.join(prefix, sys.lib,
+ "python" + sys.version[:3],
+ "site-packages"))
+- sitepackages.append(os.path.join(prefix, "lib", "site-python"))
++ if sys.lib != "lib":
++ sitepackages.append(os.path.join(prefix, "lib",
++ "python" + sys.version[:3],
++ "site-packages"))
++ sitepackages.append(os.path.join(prefix, sys.lib, "site-python"))
++ if sys.lib != "lib":
++ sitepackages.append(os.path.join(prefix, "lib", "site-python"))
+ else:
+ sitepackages.append(prefix)
+- sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
++ sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
+ return sitepackages
+
+ def addsitepackages(known_paths):
+Index: Python-2.7.14/Lib/test/test_dl.py
+===================================================================
+--- Python-2.7.14.orig/Lib/test/test_dl.py
++++ Python-2.7.14/Lib/test/test_dl.py
+@@ -4,10 +4,11 @@
+ import unittest
+ from test.test_support import verbose, import_module
+ dl = import_module('dl', deprecated=True)
++import sys
+
+ sharedlibs = [
+- ('/usr/lib/libc.so', 'getpid'),
+- ('/lib/libc.so.6', 'getpid'),
++ ('/usr/'+sys.lib+'/libc.so', 'getpid'),
++ ('/'+sys.lib+'/libc.so.6', 'getpid'),
+ ('/usr/bin/cygwin1.dll', 'getpid'),
+ ('/usr/lib/libc.dylib', 'getpid'),
+ ]
+Index: Python-2.7.14/Lib/trace.py
+===================================================================
+--- Python-2.7.14.orig/Lib/trace.py
++++ Python-2.7.14/Lib/trace.py
+@@ -754,10 +754,10 @@ def main(argv=None):
+ # should I also call expanduser? (after all, could use $HOME)
+
+ s = s.replace("$prefix",
+- os.path.join(sys.prefix, "lib",
++ os.path.join(sys.prefix, sys.lib,
+ "python" + sys.version[:3]))
+ s = s.replace("$exec_prefix",
+- os.path.join(sys.exec_prefix, "lib",
++ os.path.join(sys.exec_prefix, sys.lib,
+ "python" + sys.version[:3]))
+ s = os.path.normpath(s)
+ ignore_dirs.append(s)
+Index: Python-2.7.14/Makefile.pre.in
+===================================================================
+--- Python-2.7.14.orig/Makefile.pre.in
++++ Python-2.7.14/Makefile.pre.in
+@@ -91,6 +91,7 @@ PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAG
+
+ # Machine-dependent subdirectories
+ MACHDEP= @MACHDEP@
++LIB= @LIB@
+
+ # Multiarch directory (may be empty)
+ MULTIARCH= @MULTIARCH@
+@@ -110,7 +111,7 @@ LIBDIR= @libdir@
+ MANDIR= @mandir@
+ INCLUDEDIR= @includedir@
+ CONFINCLUDEDIR= $(exec_prefix)/include
+-SCRIPTDIR= $(prefix)/lib
++SCRIPTDIR= $(prefix)/@LIB@
+
+ # Detailed destination directories
+ BINLIBDEST= $(LIBDIR)/python$(VERSION)
+@@ -644,6 +645,7 @@ Modules/getpath.o: $(srcdir)/Modules/get
+ -DEXEC_PREFIX='"$(exec_prefix)"' \
+ -DVERSION='"$(VERSION)"' \
+ -DVPATH='"$(VPATH)"' \
++ -DLIB='"$(LIB)"' \
+ -o $@ $(srcdir)/Modules/getpath.c
+
+ Modules/python.o: $(srcdir)/Modules/python.c
+@@ -692,7 +694,7 @@ regen-ast:
+ Python/compile.o Python/symtable.o Python/ast.o: $(srcdir)/Include/graminit.h $(srcdir)/Include/Python-ast.h
+
+ Python/getplatform.o: $(srcdir)/Python/getplatform.c
+- $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
++ $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
+
+ Python/importdl.o: $(srcdir)/Python/importdl.c
+ $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
+Index: Python-2.7.14/Modules/getpath.c
+===================================================================
+--- Python-2.7.14.orig/Modules/getpath.c
++++ Python-2.7.14/Modules/getpath.c
+@@ -100,6 +100,13 @@
+ #error "PREFIX, EXEC_PREFIX, VERSION, and VPATH must be constant defined"
+ #endif
+
++#define LIB_PYTHON LIB "/python" VERSION
++
++#ifndef PYTHONPATH
++#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \
++ EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload"
++#endif
++
+ #ifndef LANDMARK
+ #define LANDMARK "os.py"
+ #endif
+@@ -108,7 +115,7 @@ static char prefix[MAXPATHLEN+1];
+ static char exec_prefix[MAXPATHLEN+1];
+ static char progpath[MAXPATHLEN+1];
+ static char *module_search_path = NULL;
+-static char lib_python[] = "lib/python" VERSION;
++static char lib_python[] = LIB_PYTHON;
+
+ static void
+ reduce(char *dir)
+Index: Python-2.7.14/Python/getplatform.c
+===================================================================
+--- Python-2.7.14.orig/Python/getplatform.c
++++ Python-2.7.14/Python/getplatform.c
+@@ -10,3 +10,13 @@ Py_GetPlatform(void)
+ {
+ return PLATFORM;
+ }
++
++#ifndef LIB
++#define LIB "lib"
++#endif
++
++const char *
++Py_GetLib(void)
++{
++ return LIB;
++}
+Index: Python-2.7.14/Python/sysmodule.c
+===================================================================
+--- Python-2.7.14.orig/Python/sysmodule.c
++++ Python-2.7.14/Python/sysmodule.c
+@@ -1437,6 +1437,8 @@ _PySys_Init(void)
+ PyString_FromString(Py_GetCopyright()));
+ SET_SYS_FROM_STRING("platform",
+ PyString_FromString(Py_GetPlatform()));
++ SET_SYS_FROM_STRING("lib",
++ PyString_FromString(Py_GetLib()));
+ SET_SYS_FROM_STRING("executable",
+ PyString_FromString(Py_GetProgramFullPath()));
+ SET_SYS_FROM_STRING("prefix",
+Index: Python-2.7.14/configure.ac
+===================================================================
+--- Python-2.7.14.orig/configure.ac
++++ Python-2.7.14/configure.ac
+@@ -758,6 +758,11 @@ SunOS*)
+ ;;
+ esac
+
++AC_SUBST(LIB)
++AC_MSG_CHECKING(LIB)
++LIB=`basename ${libdir}`
++AC_MSG_RESULT($LIB)
++
+
+ AC_SUBST(LIBRARY)
+ AC_MSG_CHECKING(LIBRARY)
diff --git a/poky/meta/recipes-devtools/python/python-native/nohostlibs.patch b/poky/meta/recipes-devtools/python/python-native/nohostlibs.patch
new file mode 100644
index 000000000..078060b49
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-native/nohostlibs.patch
@@ -0,0 +1,54 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+2014/12/15
+Rebased for python-2.7.9
+Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+Index: Python-2.7.9/setup.py
+===================================================================
+--- Python-2.7.9.orig/setup.py
++++ Python-2.7.9/setup.py
+@@ -439,9 +439,9 @@ class PyBuildExt(build_ext):
+
+ def detect_modules(self):
+ # Ensure that /usr/local is always used
+- if not cross_compiling:
+- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
+- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
++ # if not cross_compiling:
++ # add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
++ # add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+ if cross_compiling:
+ self.add_gcc_paths()
+ self.add_multiarch_paths()
+@@ -480,15 +480,15 @@ class PyBuildExt(build_ext):
+ for directory in reversed(options.dirs):
+ add_dir_to_list(dir_list, directory)
+
+- if os.path.normpath(sys.prefix) != '/usr' \
+- and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
++ #if os.path.normpath(sys.prefix) != '/usr' \
++ #and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
+ # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
+ # (PYTHONFRAMEWORK is set) to avoid # linking problems when
+ # building a framework with different architectures than
+ # the one that is currently installed (issue #7473)
+- add_dir_to_list(self.compiler.library_dirs,
++ add_dir_to_list(self.compiler.library_dirs,
+ sysconfig.get_config_var("LIBDIR"))
+- add_dir_to_list(self.compiler.include_dirs,
++ add_dir_to_list(self.compiler.include_dirs,
+ sysconfig.get_config_var("INCLUDEDIR"))
+
+ try:
+@@ -761,8 +761,7 @@ class PyBuildExt(build_ext):
+ pass # Issue 7384: Already linked against curses or tinfo.
+ elif curses_library:
+ readline_libs.append(curses_library)
+- elif self.compiler.find_library_file(lib_dirs +
+- ['/usr/lib/termcap'],
++ elif self.compiler.find_library_file(lib_dirs,
+ 'termcap'):
+ readline_libs.append('termcap')
+ exts.append( Extension('readline', ['readline.c'],
diff --git a/poky/meta/recipes-devtools/python/python-native/revert_use_of_sysconfigdata.patch b/poky/meta/recipes-devtools/python/python-native/revert_use_of_sysconfigdata.patch
new file mode 100644
index 000000000..202aaf106
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-native/revert_use_of_sysconfigdata.patch
@@ -0,0 +1,86 @@
+On older versions of Python, sysconfig read the data from both the Makefile and
+the Python.h file generated at build time, created dictionaries with their variables
+and used those when using get_config_var(), now it uses _sysconfigdata.build_time_vars[]
+which contains information from the HOST, erroneous in our case, this patch reverts this
+behavior and uses Python.h and Makefile to get information.
+
+Upstream-Status: Inappropriate [oe-specific]
+
+Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+Index: Python-2.7.9/Lib/distutils/sysconfig.py
+===================================================================
+--- Python-2.7.9.orig/Lib/distutils/sysconfig.py
++++ Python-2.7.9/Lib/distutils/sysconfig.py
+@@ -401,12 +401,66 @@ _config_vars = None
+
+ def _init_posix():
+ """Initialize the module as appropriate for POSIX systems."""
+- # _sysconfigdata is generated at build time, see the sysconfig module
+- from _sysconfigdata import build_time_vars
+- global _config_vars
+- _config_vars = {}
+- _config_vars.update(build_time_vars)
++ g = {}
++ # load the installed Makefile:
++ try:
++ filename = get_makefile_filename()
++ parse_makefile(filename, g)
++ except IOError, msg:
++ my_msg = "invalid Python installation: unable to open %s" % filename
++ if hasattr(msg, "strerror"):
++ my_msg = my_msg + " (%s)" % msg.strerror
++
++ raise DistutilsPlatformError(my_msg)
++
++ # load the installed pyconfig.h:
++ try:
++ filename = get_config_h_filename()
++ parse_config_h(file(filename), g)
++ except IOError, msg:
++ my_msg = "invalid Python installation: unable to open %s" % filename
++ if hasattr(msg, "strerror"):
++ my_msg = my_msg + " (%s)" % msg.strerror
++
++ raise DistutilsPlatformError(my_msg)
++
++ # On AIX, there are wrong paths to the linker scripts in the Makefile
++ # -- these paths are relative to the Python source, but when installed
++ # the scripts are in another directory.
++ if python_build:
++ g['LDSHARED'] = g['BLDSHARED']
+
++ elif get_python_version() < '2.1':
++ # The following two branches are for 1.5.2 compatibility.
++ if sys.platform == 'aix4': # what about AIX 3.x ?
++ # Linker script is in the config directory, not in Modules as the
++ # Makefile says.
++ python_lib = get_python_lib(standard_lib=1)
++ ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix')
++ python_exp = os.path.join(python_lib, 'config', 'python.exp')
++
++ g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp)
++
++ elif sys.platform == 'beos':
++ # Linker script is in the config directory. In the Makefile it is
++ # relative to the srcdir, which after installation no longer makes
++ # sense.
++ python_lib = get_python_lib(standard_lib=1)
++ linkerscript_path = string.split(g['LDSHARED'])[0]
++ linkerscript_name = os.path.basename(linkerscript_path)
++ linkerscript = os.path.join(python_lib, 'config',
++ linkerscript_name)
++
++ # XXX this isn't the right place to do this: adding the Python
++ # library to the link, if needed, should be in the "build_ext"
++ # command. (It's also needed for non-MS compilers on Windows, and
++ # it's taken care of for them by the 'build_ext.get_libraries()'
++ # method.)
++ g['LDSHARED'] = ("%s -L%s/lib -lpython%s" %
++ (linkerscript, PREFIX, get_python_version()))
++
++ global _config_vars
++ _config_vars = g
+
+ def _init_nt():
+ """Initialize the module as appropriate for NT"""
diff --git a/poky/meta/recipes-devtools/python/python-native/unixccompiler.patch b/poky/meta/recipes-devtools/python/python-native/unixccompiler.patch
new file mode 100644
index 000000000..450282912
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-native/unixccompiler.patch
@@ -0,0 +1,20 @@
+Upstream-Status: Pending
+
+The CC variable,sometimes like:"x86_64-poky-linux-gcc -m64 --sysroot=/${TMPDIR}/sysroots/qemux86-64", contains option information.
+This will lead to wrong compiler name "qemux86-64" rather than "x86_64-poky-linux-gcc" when python finding the compiler name.
+
+Signed-off-by: Mei Lei <lei.mei@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Index: Python-2.7.2/Lib/distutils/unixccompiler.py
+===================================================================
+--- Python-2.7.2.orig/Lib/distutils/unixccompiler.py 2011-11-24 13:51:10.539998722 -0800
++++ Python-2.7.2/Lib/distutils/unixccompiler.py 2011-11-24 15:54:36.872137766 -0800
+@@ -282,7 +282,7 @@
+ # this time, there's no way to determine this information from
+ # the configuration data stored in the Python installation, so
+ # we use this hack.
+- compiler = os.path.basename(sysconfig.get_config_var("CC"))
++ compiler = sysconfig.get_config_var("CC")
+ if sys.platform[:6] == "darwin":
+ # MacOSX's linker doesn't understand the -R flag at all
+ return "-L" + dir
diff --git a/poky/meta/recipes-devtools/python/python-native_2.7.14.bb b/poky/meta/recipes-devtools/python/python-native_2.7.14.bb
new file mode 100644
index 000000000..b822583c5
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-native_2.7.14.bb
@@ -0,0 +1,86 @@
+require python.inc
+EXTRANATIVEPATH += "bzip2-native"
+DEPENDS = "openssl-native bzip2-replacement-native zlib-native readline-native sqlite3-native expat-native gdbm-native db-native"
+PR = "${INC_PR}.1"
+
+SRC_URI += "\
+ file://05-enable-ctypes-cross-build.patch \
+ file://10-distutils-fix-swig-parameter.patch \
+ file://11-distutils-never-modify-shebang-line.patch \
+ file://0001-distutils-set-the-prefix-to-be-inside-staging-direct.patch \
+ file://debug.patch \
+ file://unixccompiler.patch \
+ file://nohostlibs.patch \
+ file://multilib.patch \
+ file://add-md5module-support.patch \
+ file://builddir.patch \
+ file://parallel-makeinst-create-bindir.patch \
+ file://revert_use_of_sysconfigdata.patch \
+ file://fix-gc-alignment.patch \
+ "
+
+S = "${WORKDIR}/Python-${PV}"
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/${PN}:"
+
+inherit native
+
+EXTRA_OECONF_append = " --bindir=${bindir}/${PN} --with-system-expat=${STAGING_DIR_HOST}"
+
+EXTRA_OEMAKE = '\
+ LIBC="" \
+ STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE} \
+ STAGING_INCDIR=${STAGING_INCDIR_NATIVE} \
+'
+
+do_configure_append() {
+ autoreconf --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi
+}
+
+# Regenerate all of the generated files
+# This ensures that pgen and friends get created during the compile phase
+do_compile_prepend() {
+ oe_runmake regen-all
+}
+
+do_install() {
+ oe_runmake 'DESTDIR=${D}' install
+ install -d ${D}${bindir}/${PN}
+ install -m 0755 Parser/pgen ${D}${bindir}/${PN}
+
+ # Make sure we use /usr/bin/env python
+ for PYTHSCRIPT in `grep -rIl ${bindir}/${PN}/python ${D}${bindir}/${PN}`; do
+ sed -i -e '1s|^#!.*|#!/usr/bin/env python|' $PYTHSCRIPT
+ done
+
+ # Add a symlink to the native Python so that scripts can just invoke
+ # "nativepython" and get the right one without needing absolute paths
+ # (these often end up too long for the #! parser in the kernel as the
+ # buffer is 128 bytes long).
+ ln -s python-native/python ${D}${bindir}/nativepython
+
+ # We don't want modules in ~/.local being used in preference to those
+ # installed in the native sysroot, so disable user site support.
+ sed -i -e 's,^\(ENABLE_USER_SITE = \).*,\1False,' ${D}${libdir}/python${PYTHON_MAJMIN}/site.py
+}
+
+python(){
+
+ # Read JSON manifest
+ import json
+ pythondir = d.getVar('THISDIR',True)
+ with open(pythondir+'/python/python2-manifest.json') as manifest_file:
+ python_manifest=json.load(manifest_file)
+
+ rprovides = d.getVar('RPROVIDES').split()
+
+ # Hardcoded since it cant be python-native-foo, should be python-foo-native
+ pn = 'python'
+
+ for key in python_manifest:
+ pypackage = pn + '-' + key + '-native'
+ if pypackage not in rprovides:
+ rprovides.append(pypackage)
+
+ d.setVar('RPROVIDES', ' '.join(rprovides))
+}
diff --git a/poky/meta/recipes-devtools/python/python-nose.inc b/poky/meta/recipes-devtools/python/python-nose.inc
new file mode 100644
index 000000000..ccec68a0e
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-nose.inc
@@ -0,0 +1,18 @@
+SUMMARY = "Extends Python unittest to make testing easier"
+HOMEPAGE = "http://readthedocs.org/docs/nose/"
+DESCRIPTION = "nose extends the test loading and running features of unittest, \
+making it easier to write, find and run tests."
+SECTION = "devel/python"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://lgpl.txt;md5=a6f89e2100d9b6cdffcea4f398e37343"
+
+SRC_URI[md5sum] = "4d3ad0ff07b61373d2cefc89c5d0b20b"
+SRC_URI[sha256sum] = "f1bffef9cbc82628f6e7d7b40d7e255aefaa1adb6a1b1d26c69a8b79e6208a98"
+
+inherit pypi
+
+RDEPENDS_${PN} = "\
+ ${PYTHON_PN}-unittest \
+ "
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/python/python-nose_1.3.7.bb b/poky/meta/recipes-devtools/python/python-nose_1.3.7.bb
new file mode 100644
index 000000000..6d69d2d62
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-nose_1.3.7.bb
@@ -0,0 +1,2 @@
+inherit setuptools
+require python-nose.inc
diff --git a/poky/meta/recipes-devtools/python/python-scons-native_3.0.1.bb b/poky/meta/recipes-devtools/python/python-scons-native_3.0.1.bb
new file mode 100644
index 000000000..dae89ab5d
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-scons-native_3.0.1.bb
@@ -0,0 +1,8 @@
+require python-scons_${PV}.bb
+inherit native pythonnative
+DEPENDS = "python-native"
+RDEPENDS_${PN} = ""
+
+do_install_append() {
+ create_wrapper ${D}${bindir}/scons SCONS_LIB_DIR='${STAGING_DIR_HOST}/${PYTHON_SITEPACKAGES_DIR}'
+}
diff --git a/poky/meta/recipes-devtools/python/python-scons_3.0.1.bb b/poky/meta/recipes-devtools/python/python-scons_3.0.1.bb
new file mode 100644
index 000000000..d5084b2d1
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-scons_3.0.1.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Software Construction tool (make/autotools replacement)"
+SECTION = "devel/python"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=46ddf66004e5be5566367cb525a66fc6"
+
+SRC_URI[md5sum] = "b6a292e251b34b82c203b56cfa3968b3"
+SRC_URI[sha256sum] = "24475e38d39c19683bc88054524df018fe6949d70fbd4c69e298d39a0269f173"
+
+UPSTREAM_CHECK_URI = "http://scons.org/pages/download.html"
+UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.tar"
+
+inherit pypi setuptools
+
+RDEPENDS_${PN} = "\
+ python-fcntl \
+ python-io \
+ python-json \
+ python-subprocess \
+ python-shell \
+ python-pprint \
+ "
diff --git a/poky/meta/recipes-devtools/python/python-setuptools.inc b/poky/meta/recipes-devtools/python/python-setuptools.inc
new file mode 100644
index 000000000..74706bf04
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-setuptools.inc
@@ -0,0 +1,48 @@
+SUMMARY = "Download, build, install, upgrade, and uninstall Python packages"
+HOMEPAGE = "https://pypi.python.org/pypi/setuptools"
+SECTION = "devel/python"
+LICENSE = "MIT"
+
+LIC_FILES_CHKSUM = "file://LICENSE;beginline=1;endline=19;md5=9a33897f1bca1160d7aad3835152e158"
+
+PYPI_PACKAGE_EXT = "zip"
+
+inherit pypi
+
+SRC_URI[md5sum] = "379642a4f17214071fdc1894255d8d11"
+SRC_URI[sha256sum] = "94dc566247f35009ed42c0f4422f2b4f0a032fab1372c8308b864c8f26d93388"
+
+DEPENDS += "${PYTHON_PN}"
+DEPENDS_class-native += "${PYTHON_PN}-native"
+DEPENDS_class-nativesdk += "nativesdk-${PYTHON_PN}"
+
+DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${PYTHON_SITEPACKAGES_DIR} \
+ --script-dir=${bindir}"
+
+RDEPENDS_${PN}_class-native = "\
+ ${PYTHON_PN}-distutils \
+ ${PYTHON_PN}-compression \
+"
+RDEPENDS_${PN} = "\
+ ${PYTHON_PN}-compile \
+ ${PYTHON_PN}-compression \
+ ${PYTHON_PN}-ctypes \
+ ${PYTHON_PN}-distutils \
+ ${PYTHON_PN}-email \
+ ${PYTHON_PN}-html \
+ ${PYTHON_PN}-netserver \
+ ${PYTHON_PN}-numbers \
+ ${PYTHON_PN}-pkgutil \
+ ${PYTHON_PN}-plistlib \
+ ${PYTHON_PN}-shell \
+ ${PYTHON_PN}-stringold \
+ ${PYTHON_PN}-threading \
+ ${PYTHON_PN}-unittest \
+ ${PYTHON_PN}-xml \
+"
+
+do_install_prepend() {
+ install -d ${D}${PYTHON_SITEPACKAGES_DIR}
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/python/python-setuptools_39.0.0.bb b/poky/meta/recipes-devtools/python/python-setuptools_39.0.0.bb
new file mode 100644
index 000000000..cf9440495
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-setuptools_39.0.0.bb
@@ -0,0 +1,9 @@
+require python-setuptools.inc
+
+PROVIDES = "python-distribute"
+
+inherit setuptools
+
+RREPLACES_${PN} = "python-distribute"
+RPROVIDES_${PN} = "python-distribute"
+RCONFLICTS_${PN} = "python-distribute"
diff --git a/poky/meta/recipes-devtools/python/python-six.inc b/poky/meta/recipes-devtools/python/python-six.inc
new file mode 100644
index 000000000..c77498457
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-six.inc
@@ -0,0 +1,14 @@
+SUMMARY = "Python 2 and 3 compatibility library"
+HOMEPAGE = "https://pypi.python.org/pypi/six/"
+SECTION = "devel/python"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=35cec5bf04dd0820d0a18533ea7c774a"
+
+SRC_URI[md5sum] = "d12789f9baf7e9fb2524c0c64f1773f8"
+SRC_URI[sha256sum] = "70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9"
+
+inherit pypi
+
+RDEPENDS_${PN} = "${PYTHON_PN}-io"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/python/python-smmap.inc b/poky/meta/recipes-devtools/python/python-smmap.inc
new file mode 100644
index 000000000..55aa516e0
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python-smmap.inc
@@ -0,0 +1,18 @@
+SUMMARY = "Python implementation of a sliding window memory map manager"
+DESCRIPTION = "A pure Python implementation of a sliding memory map to \
+help unifying memory mapped access on 32 and 64 bit systems and to help \
+managing resources more efficiently."
+HOMEPAGE = "http://github.com/gitpython-developers/GitPython"
+SECTION = "devel/python"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=e910b35b0ef4e1f665b9a75d6afb7709"
+
+inherit pypi
+
+SRC_URI[md5sum] = "d7932d5ace206bf4ae15198cf36fb6ab"
+SRC_URI[sha256sum] = "0e2b62b497bd5f0afebc002eda4d90df9d209c30ef257e8673c90a6b5c119d62"
+
+RDEPENDS_${PN} += "${PYTHON_PN}-codecs \
+ ${PYTHON_PN}-mmap \
+"
+BBCLASSEXTEND = "nativesdk"
diff --git a/poky/meta/recipes-devtools/python/python.inc b/poky/meta/recipes-devtools/python/python.inc
new file mode 100644
index 000000000..979b601bf
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python.inc
@@ -0,0 +1,40 @@
+SUMMARY = "The Python Programming Language"
+HOMEPAGE = "http://www.python.org"
+LICENSE = "PSFv2"
+SECTION = "devel/python"
+# bump this on every change in contrib/python/generate-manifest-2.7.py
+INC_PR = "r1"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=f741e51de91d4eeea5930b9c3c7fa69d"
+
+SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "1f6db41ad91d9eb0a6f0c769b8613c5b"
+SRC_URI[sha256sum] = "71ffb26e09e78650e424929b2b457b9c912ac216576e6bd9e7d204ed03296a66"
+
+# python recipe is actually python 2.x
+# also, exclude pre-releases for both python 2.x and 3.x
+UPSTREAM_CHECK_REGEX = "[Pp]ython-(?P<pver>2(\.\d+)+).tar"
+
+CVE_PRODUCT = "python"
+
+PYTHON_MAJMIN = "2.7"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "\
+ --with-threads \
+ --with-pymalloc \
+ --without-cxx-main \
+ --with-signal-module \
+ --enable-shared \
+ --enable-ipv6=${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'yes', 'no', d)} \
+ ac_cv_header_bluetooth_bluetooth_h=no ac_cv_header_bluetooth_h=no \
+ ${PYTHONLSBOPTS} \
+"
+
+do_install_append () {
+ sed -i -e 's:${HOSTTOOLS_DIR}/install:install:g' \
+ -e 's:${HOSTTOOLS_DIR}/mkdir:mkdir:g' \
+ ${D}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py
+}
diff --git a/poky/meta/recipes-devtools/python/python/0001-distutils-set-the-prefix-to-be-inside-staging-direct.patch b/poky/meta/recipes-devtools/python/python/0001-distutils-set-the-prefix-to-be-inside-staging-direct.patch
new file mode 100644
index 000000000..502f84980
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/0001-distutils-set-the-prefix-to-be-inside-staging-direct.patch
@@ -0,0 +1,51 @@
+From 4cdf2e9df13c6327fcc94d53e4953005543aef3d Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 6 Apr 2016 17:43:02 +0300
+Subject: [PATCH 01/10] distutils: set the prefix to be inside staging
+ directory
+
+The proper prefix is inside our staging area.
+
+Upstream-Status: Inappropriate [embedded specific]
+Signed-off-by: Michael 'Mickey' Lauer <mickey@vanille-media.de>
+Signed-off-by: Phil Blundell <philb@gnu.org>
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ Lib/distutils/sysconfig.py | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
+index de7da1d..f3aacf7 100644
+--- a/Lib/distutils/sysconfig.py
++++ b/Lib/distutils/sysconfig.py
+@@ -75,7 +75,7 @@ def get_python_inc(plat_specific=0, prefix=None):
+ sys.exec_prefix -- i.e., ignore 'plat_specific'.
+ """
+ if prefix is None:
+- prefix = plat_specific and EXEC_PREFIX or PREFIX
++ prefix = os.environ['STAGING_INCDIR'].rstrip('include')
+
+ if os.name == "posix":
+ if python_build:
+@@ -115,12 +115,16 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
+ If 'prefix' is supplied, use it instead of sys.prefix or
+ sys.exec_prefix -- i.e., ignore 'plat_specific'.
+ """
++ lib_basename = os.environ['STAGING_LIBDIR'].split('/')[-1]
+ if prefix is None:
+- prefix = plat_specific and EXEC_PREFIX or PREFIX
++ if plat_specific:
++ prefix = os.environ['STAGING_LIBDIR'].rstrip(lib_basename)
++ else:
++ prefix = PREFIX
+
+ if os.name == "posix":
+ libpython = os.path.join(prefix,
+- "lib", "python" + get_python_version())
++ lib_basename, "python" + get_python_version())
+ if standard_lib:
+ return libpython
+ else:
+--
+2.8.0.rc3
+
diff --git a/poky/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch b/poky/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch
new file mode 100644
index 000000000..e795a74b9
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch
@@ -0,0 +1,100 @@
+We need to ensure our host tools get run during build, not the freshly
+built cross-tools (this will not work), so we introduce HOSTPYTHON and HOSTPGEN.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Michael 'Mickey' Lauer <mickey@vanille-media.de>
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+Rebased for python-2.7.9
+Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+Rebased for python-2.7.14
+Signed-off-by: Derek Straka <derek@asterius.io>
+
+Index: Python-2.7.13/Makefile.pre.in
+===================================================================
+--- Python-2.7.13.orig/Makefile.pre.in
++++ Python-2.7.13/Makefile.pre.in
+@@ -245,6 +245,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@
+ ##########################################################################
+ # Parser
+ PGEN= Parser/pgen$(EXE)
++HOSTPGEN= $(PGEN)$(EXE)
+
+ PSRCS= \
+ Parser/acceler.c \
+@@ -512,7 +513,7 @@ $(BUILDPYTHON): Modules/python.o $(LIBRA
+ $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
+
+ platform: $(BUILDPYTHON) pybuilddir.txt
+- $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
++ $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
+
+ # Create build directory and generate the sysconfig build-time data there.
+ # pybuilddir.txt contains the name of the build dir and is used for
+@@ -663,7 +663,7 @@
+ # Regenerate Include/graminit.h and Python/graminit.c
+ # from Grammar/Grammar using pgen
+ @$(MKDIR_P) Include
+- $(PGEN) $(srcdir)/Grammar/Grammar \
++ $(HOSTPGEN) $(srcdir)/Grammar/Grammar \
+ $(srcdir)/Include/graminit.h \
+ $(srcdir)/Python/graminit.c
+
+@@ -1121,27 +1122,27 @@ libinstall: build_all $(srcdir)/Lib/$(PL
+ $(DESTDIR)$(LIBDEST)/distutils/tests ; \
+ fi
+ PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- $(PYTHON_FOR_BUILD) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
++ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ -d $(LIBDEST) -f \
+ -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+ $(DESTDIR)$(LIBDEST)
+ PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- $(PYTHON_FOR_BUILD) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
++ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ -d $(LIBDEST) -f \
+ -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+ $(DESTDIR)$(LIBDEST)
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- $(PYTHON_FOR_BUILD) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
++ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ -d $(LIBDEST)/site-packages -f \
+ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- $(PYTHON_FOR_BUILD) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
++ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ -d $(LIBDEST)/site-packages -f \
+ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
++ $(HOSTPYTHON) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+- $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
++ $(HOSTPYTHON) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
+
+ # Create the PLATDIR source directory, if one wasn't distributed..
+ $(srcdir)/Lib/$(PLATDIR):
+Index: Python-2.7.13/setup.py
+===================================================================
+--- Python-2.7.13.orig/setup.py
++++ Python-2.7.13/setup.py
+@@ -350,6 +350,7 @@ class PyBuildExt(build_ext):
+ self.failed.append(ext.name)
+ self.announce('*** WARNING: renaming "%s" since importing it'
+ ' failed: %s' % (ext.name, why), level=3)
++ return
+ assert not self.inplace
+ basename, tail = os.path.splitext(ext_filename)
+ newname = basename + "_failed" + tail
+@@ -574,6 +575,9 @@ class PyBuildExt(build_ext):
+
+ # XXX Omitted modules: gl, pure, dl, SGI-specific modules
+
++ lib_dirs = [ os.getenv("STAGING_LIBDIR"), os.getenv("STAGING_BASELIBDIR") ]
++ inc_dirs = [ os.getenv("STAGING_INCDIR") ]
++
+ #
+ # The following modules are all pretty straightforward, and compile
+ # on pretty much any POSIXish platform.
diff --git a/poky/meta/recipes-devtools/python/python/03-fix-tkinter-detection.patch b/poky/meta/recipes-devtools/python/python/03-fix-tkinter-detection.patch
new file mode 100644
index 000000000..650ceb595
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/03-fix-tkinter-detection.patch
@@ -0,0 +1,46 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+We need to supply STAGING_INCDIR here, otherwise the Tk headers
+will not be found.
+
+Signed-off-by: Michael 'Mickey' Lauer <mickey@vanille.de>
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+Rebased for python-2.7.9
+
+diff --git a/setup.py b/setup.py
+index 8fe1fb8..67eda74 100644
+--- a/setup.py
++++ b/setup.py
+@@ -1892,7 +1892,7 @@ class PyBuildExt(build_ext):
+ dotversion = dotversion[:-1] + '.' + dotversion[-1]
+ tcl_include_sub = []
+ tk_include_sub = []
+- for dir in inc_dirs:
++ for dir in [os.getenv("STAGING_INCDIR")]:
+ tcl_include_sub += [dir + os.sep + "tcl" + dotversion]
+ tk_include_sub += [dir + os.sep + "tk" + dotversion]
+ tk_include_sub += tcl_include_sub
+@@ -1911,22 +1911,6 @@ class PyBuildExt(build_ext):
+ if dir not in include_dirs:
+ include_dirs.append(dir)
+
+- # Check for various platform-specific directories
+- if host_platform == 'sunos5':
+- include_dirs.append('/usr/openwin/include')
+- added_lib_dirs.append('/usr/openwin/lib')
+- elif os.path.exists('/usr/X11R6/include'):
+- include_dirs.append('/usr/X11R6/include')
+- added_lib_dirs.append('/usr/X11R6/lib64')
+- added_lib_dirs.append('/usr/X11R6/lib')
+- elif os.path.exists('/usr/X11R5/include'):
+- include_dirs.append('/usr/X11R5/include')
+- added_lib_dirs.append('/usr/X11R5/lib')
+- else:
+- # Assume default location for X11
+- include_dirs.append('/usr/X11/include')
+- added_lib_dirs.append('/usr/X11/lib')
+-
+ # If Cygwin, then verify that X is installed before proceeding
+ if host_platform == 'cygwin':
+ x11_inc = find_file('X11/Xlib.h', [], include_dirs)
diff --git a/poky/meta/recipes-devtools/python/python/05-enable-ctypes-cross-build.patch b/poky/meta/recipes-devtools/python/python/05-enable-ctypes-cross-build.patch
new file mode 100644
index 000000000..5cc874246
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/05-enable-ctypes-cross-build.patch
@@ -0,0 +1,27 @@
+Rebased for python 2.7.9
+
+Upstream-Status: Inappropriate [embedded specific]
+
+# CTypes need to know the actual host we are building on.
+# Signed-Off: Michael Dietrich <mdt@emdete.de>
+
+Index: Python-2.7.9/setup.py
+===================================================================
+--- Python-2.7.9.orig/setup.py
++++ Python-2.7.9/setup.py
+@@ -2028,12 +2028,12 @@ class PyBuildExt(build_ext):
+
+ # Pass empty CFLAGS because we'll just append the resulting
+ # CFLAGS to Python's; -g or -O2 is to be avoided.
+- cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \
+- % (ffi_builddir, ffi_srcdir, " ".join(config_args))
++ cmd = "(cd %s && autoconf -W cross) && (cd %s && env CFLAGS='' '%s/configure' %s)" \
++ % (ffi_srcdir, ffi_builddir, ffi_srcdir, " ".join(config_args))
+
+ res = os.system(cmd)
+ if res or not os.path.exists(ffi_configfile):
+- print "Failed to configure _ctypes module"
++ print "Failed to configure _ctypes module (res=%d) or missing conffile=%s" % ( res, ffi_configfile )
+ return False
+
+ fficonfig = {}
diff --git a/poky/meta/recipes-devtools/python/python/06-avoid_usr_lib_termcap_path_in_linking.patch b/poky/meta/recipes-devtools/python/python/06-avoid_usr_lib_termcap_path_in_linking.patch
new file mode 100644
index 000000000..435b31901
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/06-avoid_usr_lib_termcap_path_in_linking.patch
@@ -0,0 +1,35 @@
+Upstream-Status: Pending
+
+The poison directories patch has detected library path issue while
+compiling the python in cross environment, as seen bellow.
+
+warning: library search path "/usr/lib/termcap" is unsafe for cross-compilation
+
+This Patch fixes this issue in the python build environment.
+11 Oct 2010
+Nitin A Kamble <nitin.a.kamble@intel.com>
+
+2011/09/29
+Rebased for python 2.7.2
+Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+diff --git a/setup.py b/setup.py
+index 67eda74..59c537e 100644
+--- a/setup.py
++++ b/setup.py
+@@ -761,12 +761,10 @@ class PyBuildExt(build_ext):
+ pass # Issue 7384: Already linked against curses or tinfo.
+ elif curses_library:
+ readline_libs.append(curses_library)
+- elif self.compiler.find_library_file(lib_dirs +
+- ['/usr/lib/termcap'],
++ elif self.compiler.find_library_file(lib_dirs,
+ 'termcap'):
+ readline_libs.append('termcap')
+ exts.append( Extension('readline', ['readline.c'],
+- library_dirs=['/usr/lib/termcap'],
+ extra_link_args=readline_extra_link_args,
+ libraries=readline_libs) )
+ else:
diff --git a/poky/meta/recipes-devtools/python/python/add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch b/poky/meta/recipes-devtools/python/python/add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch
new file mode 100644
index 000000000..329734064
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch
@@ -0,0 +1,28 @@
+configure.ac: add CROSSPYTHONPATH into PYTHONPATH for PYTHON_FOR_BUILD
+
+When building x86->x86 the system will try to execute .so and related items
+from the default PYTHONPATH. This will fail if the target CPU contains
+instructions that the host CPU does not have, add CROSSPYTHONPATH
+into PYTHONPATH so we can prepend the list to find correct libs.
+
+Upstream-Status: Inappropriate [OE-Core integration specific]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: Python-2.7.14/configure.ac
+===================================================================
+--- Python-2.7.14.orig/configure.ac
++++ Python-2.7.14/configure.ac
+@@ -36,7 +36,7 @@ if test "$cross_compiling" = yes; then
+ AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found])
+ fi
+ AC_MSG_RESULT($interp)
+- 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
++ PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(CROSSPYTHONPATH):$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/plat-$(MACHDEP) '$interp
+ fi
+ elif test "$cross_compiling" = maybe; then
+ AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH])
diff --git a/poky/meta/recipes-devtools/python/python/add-md5module-support.patch b/poky/meta/recipes-devtools/python/python/add-md5module-support.patch
new file mode 100644
index 000000000..33fea7755
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/add-md5module-support.patch
@@ -0,0 +1,18 @@
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: Python-2.7.2/Modules/Setup.dist
+===================================================================
+--- Python-2.7.2.orig/Modules/Setup.dist 2011-06-11 08:46:26.000000000 -0700
++++ Python-2.7.2/Modules/Setup.dist 2011-12-27 15:51:41.244623219 -0800
+@@ -248,7 +248,7 @@
+ # Message-Digest Algorithm, described in RFC 1321. The necessary files
+ # md5.c and md5.h are included here.
+
+-#_md5 md5module.c md5.c
++_md5 md5module.c md5.c
+
+
+ # The _sha module implements the SHA checksum algorithms.
diff --git a/poky/meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patch b/poky/meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patch
new file mode 100644
index 000000000..287095f61
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patch
@@ -0,0 +1,29 @@
+_tkinter module needs tk module along with tcl. tk is not yet integrated
+in yocto so we skip the check for this module.
+Avoid a warning by not adding this module to missing variable.
+
+Upstream-Status: Inappropriate [distribution]
+
+Also simply disable the tk module since its not in DEPENDS.
+Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
+
+Index: Python-2.7.13/setup.py
+===================================================================
+--- Python-2.7.13.orig/setup.py
++++ Python-2.7.13/setup.py
+@@ -1783,10 +1783,12 @@ class PyBuildExt(build_ext):
+ self.extensions.extend(exts)
+
+ # Call the method for detecting whether _tkinter can be compiled
+- self.detect_tkinter(inc_dirs, lib_dirs)
++ # self.detect_tkinter(inc_dirs, lib_dirs)
+
+- if '_tkinter' not in [e.name for e in self.extensions]:
+- missing.append('_tkinter')
++ # tkinter module will not be avalaible as yocto
++ # doesn't have tk integrated (yet)
++ #if '_tkinter' not in [e.name for e in self.extensions]:
++ # missing.append('_tkinter')
+
+ ## # Uncomment these lines if you want to play with xxmodule.c
+ ## ext = Extension('xx', ['xxmodule.c'])
diff --git a/poky/meta/recipes-devtools/python/python/avoid_warning_for_sunos_specific_module.patch b/poky/meta/recipes-devtools/python/python/avoid_warning_for_sunos_specific_module.patch
new file mode 100644
index 000000000..8ba582301
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/avoid_warning_for_sunos_specific_module.patch
@@ -0,0 +1,23 @@
+sunaudiodev module is sunos specific so we avoid a warning by not
+adding this module to missing variable.
+
+Upstream-Status: Inappropriate [distribution]
+
+Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
+
+Index: Python-2.7.13/setup.py
+===================================================================
+--- Python-2.7.13.orig/setup.py
++++ Python-2.7.13/setup.py
+@@ -1671,8 +1671,9 @@ class PyBuildExt(build_ext):
+ if host_platform == 'sunos5':
+ # SunOS specific modules
+ exts.append( Extension('sunaudiodev', ['sunaudiodev.c']) )
+- else:
+- missing.append('sunaudiodev')
++ # If platform is not sunos warning is useless
++ #else:
++ # missing.append('sunaudiodev')
+
+ if host_platform == 'darwin':
+ # _scproxy
diff --git a/poky/meta/recipes-devtools/python/python/builddir.patch b/poky/meta/recipes-devtools/python/python/builddir.patch
new file mode 100644
index 000000000..ad629a022
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/builddir.patch
@@ -0,0 +1,46 @@
+When cross compiling python, we used to need to install the Makefile, pyconfig.h
+and the python library to their final location before being able to compile the
+rest of python. This change allows us to point python at its own source when
+building, avoiding a variety of sysroot staging issues and simplifying the main
+python recipe.
+
+Upstream-Status: Inappropriate
+RP 2012/11/13
+
+Index: Python-2.7.9/Lib/sysconfig.py
+===================================================================
+--- Python-2.7.9.orig/Lib/sysconfig.py
++++ Python-2.7.9/Lib/sysconfig.py
+@@ -93,6 +93,7 @@ _PREFIX = os.path.normpath(sys.prefix)
+ _EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
+ _CONFIG_VARS = None
+ _USER_BASE = None
++_PYTHONBUILDDIR = os.environ.get("PYTHONBUILDDIR", None)
+
+ def _safe_realpath(path):
+ try:
+@@ -100,7 +101,9 @@ def _safe_realpath(path):
+ except OSError:
+ return path
+
+-if sys.executable:
++if _PYTHONBUILDDIR:
++ _PROJECT_BASE = _PYTHONBUILDDIR
++elif sys.executable:
+ _PROJECT_BASE = os.path.dirname(_safe_realpath(sys.executable))
+ else:
+ # sys.executable can be empty if argv[0] has been changed and Python is
+Index: Python-2.7.9/Lib/distutils/sysconfig.py
+===================================================================
+--- Python-2.7.9.orig/Lib/distutils/sysconfig.py
++++ Python-2.7.9/Lib/distutils/sysconfig.py
+@@ -26,6 +26,9 @@ EXEC_PREFIX = os.path.normpath(sys.exec_
+ # live in project/PCBuild9. If we're dealing with an x64 Windows build,
+ # it'll live in project/PCbuild/amd64.
+ project_base = os.path.dirname(os.path.abspath(sys.executable))
++_PYTHONBUILDDIR = os.environ.get("PYTHONBUILDDIR", None)
++if _PYTHONBUILDDIR:
++ project_base = _PYTHONBUILDDIR
+ if os.name == "nt" and "pcbuild" in project_base[-8:].lower():
+ project_base = os.path.abspath(os.path.join(project_base, os.path.pardir))
+ # PC/VS7.1
diff --git a/poky/meta/recipes-devtools/python/python/cgi_py.patch b/poky/meta/recipes-devtools/python/python/cgi_py.patch
new file mode 100644
index 000000000..de504f9dc
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/cgi_py.patch
@@ -0,0 +1,23 @@
+Lib/cgi.py: Update the script as mentioned in the comment
+
+Upstream-Status: Inappropriate [distribution]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+--- Python-2.6.6/Lib/cgi.py.orig 2010-08-01 22:14:27.000000000 -0500
++++ Python-2.6.6/Lib/cgi.py 2011-09-21 15:28:40.478208631 -0500
+@@ -1,13 +1,4 @@
+-#! /usr/local/bin/python
+-
+-# NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is
+-# intentionally NOT "/usr/bin/env python". On many systems
+-# (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI
+-# scripts, and /usr/local/bin is the default directory where Python is
+-# installed, so /usr/bin/env would be unable to find python. Granted,
+-# binary installations by Linux vendors often install Python in
+-# /usr/bin. So let those vendors patch cgi.py to match their choice
+-# of installation.
++#! /usr/bin/env python
+
+ """Support module for CGI (Common Gateway Interface) scripts.
+
diff --git a/poky/meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch b/poky/meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch
new file mode 100644
index 000000000..e6d6c65bb
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch
@@ -0,0 +1,57 @@
+Author: Andrei Gherzan <andrei@gherzan.ro>
+Date: Sun Mar 25 02:02:27 2012 +0200
+
+This patch was added for 64bit host machines. In the compile process python
+is checking if platform is a 64bit platform using sys.maxint which is the host's
+value. The patch fixes this issue so that python would check if TARGET machine
+is 64bit not the HOST machine. In this way will have "dl" and "imageop" modules
+built if HOST machine is 64bit but the target machine is 32bit.
+
+Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
+
+Upstream-Status: Pending
+
+Index: Python-2.7.11/setup.py
+===================================================================
+--- Python-2.7.11.orig/setup.py
++++ Python-2.7.11/setup.py
+@@ -35,6 +35,21 @@ COMPILED_WITH_PYDEBUG = ('--with-pydebug
+ # This global variable is used to hold the list of modules to be disabled.
+ disabled_module_list = []
+
++def target_is_64bit_platform ():
++ """
++ In case of cross-compile, some modules are not build as setup checks if HOST
++ is 64bit and not TARGET.
++ As python was built for TARGET we can check this in pyconfig.h in this way:
++ Sizeof LONG on a 32 bit platform is 4 bytes
++ Sizeof LONG on a 64 bit platform is 8 bytes
++ """
++ pyconf = open("pyconfig.h").read()
++ aux = re.search(r"#s*define\s+SIZEOF_LONG\s+8\s*", pyconf)
++ if aux is not None:
++ return True
++ else:
++ return False
++
+ def add_dir_to_list(dirlist, dir):
+ """Add the directory 'dir' to the list 'dirlist' (at the front) if
+ 1) 'dir' is not already in 'dirlist'
+@@ -716,7 +731,7 @@ class PyBuildExt(build_ext):
+ exts.append( Extension('audioop', ['audioop.c']) )
+
+ # Disabled on 64-bit platforms
+- if sys.maxsize != 9223372036854775807L:
++ if not target_is_64bit_platform():
+ # Operations on images
+ exts.append( Extension('imageop', ['imageop.c']) )
+ else:
+@@ -1545,7 +1560,7 @@ class PyBuildExt(build_ext):
+ missing.append('_codecs_%s' % loc)
+
+ # Dynamic loading module
+- if sys.maxint == 0x7fffffff:
++ if not target_is_64bit_platform():
+ # This requires sizeof(int) == sizeof(long) == sizeof(char*)
+ dl_inc = find_file('dlfcn.h', [], inc_dirs)
+ if (dl_inc is not None) and (host_platform not in ['atheos']):
diff --git a/poky/meta/recipes-devtools/python/python/create_manifest2.py b/poky/meta/recipes-devtools/python/python/create_manifest2.py
new file mode 100644
index 000000000..e7450452b
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/create_manifest2.py
@@ -0,0 +1,277 @@
+# This script is used as a bitbake task to create a new python manifest
+# $ bitbake python -c create_manifest
+#
+# Our goal is to keep python-core as small as posible and add other python
+# packages only when the user needs them, hence why we split upstream python
+# into several packages.
+#
+# In a very simplistic way what this does is:
+# Launch python and see specifically what is required for it to run at a minimum
+#
+# Go through the python-manifest file and launch a separate task for every single
+# one of the files on each package, this task will check what was required for that
+# specific module to run, these modules will be called dependencies.
+# The output of such task will be a list of the modules or dependencies that were
+# found for that file.
+#
+# Such output will be parsed by this script, we will look for each dependency on the
+# manifest and if we find that another package already includes it, then we will add
+# that package as an RDEPENDS to the package we are currently checking; in case we dont
+# find the current dependency on any other package we will add it to the current package
+# as part of FILES.
+#
+#
+# This way we will create a new manifest from the data structure that was built during
+# this process, ont this new manifest each package will contain specifically only
+# what it needs to run.
+#
+# There are some caveats which we try to deal with, such as repeated files on different
+# packages, packages that include folders, wildcards, and special packages.
+# Its also important to note that this method only works for python files, and shared
+# libraries. Static libraries, header files and binaries need to be dealt with manually.
+#
+# Author: Alejandro Enedino Hernandez Samaniego "aehs29" <aehs29@gmail.com>
+
+
+import sys
+import subprocess
+import json
+import os
+
+# Hack to get native python search path (for folders), not fond of it but it works for now
+pivot='recipe-sysroot-native'
+for p in sys.path:
+ if pivot in p:
+ nativelibfolder=p[:p.find(pivot)+len(pivot)]
+
+# Empty dict to hold the whole manifest
+new_manifest = {}
+
+# Check for repeated files, folders and wildcards
+allfiles=[]
+repeated=[]
+wildcards=[]
+
+hasfolders=[]
+allfolders=[]
+
+def isFolder(value):
+ if os.path.isdir(value.replace('${libdir}',nativelibfolder+'/usr/lib')) or os.path.isdir(value.replace('${libdir}',nativelibfolder+'/usr/lib64')) or os.path.isdir(value.replace('${libdir}',nativelibfolder+'/usr/lib32')):
+ return True
+ else:
+ return False
+
+# Read existing JSON manifest
+with open('python2-manifest.json') as manifest:
+ old_manifest=json.load(manifest)
+
+
+# First pass to get core-package functionality, because we base everything on the fact that core is actually working
+# Not exactly the same so it should not be a function
+print ("Getting dependencies for core package:")
+
+# Special call to check for core package
+output = subprocess.check_output([sys.executable, 'get_module_deps2.py', 'python-core-package'])
+for item in output.split():
+ # We append it so it doesnt hurt what we currently have:
+ if item not in old_manifest['core']['files']:
+ # We use the same data structure since its the one which will be used to check
+ # dependencies for other packages
+ old_manifest['core']['files'].append(item)
+
+for value in old_manifest['core']['files']:
+ # Ignore folders, since we don't import those, difficult to handle multilib
+ if isFolder(value):
+ # Pass it directly
+ if value not in old_manifest['core']['files']:
+ old_manifest['core']['files'].append(value)
+ # Ignore binaries, since we don't import those, assume it was added correctly (manually)
+ if '${bindir}' in value:
+ # Pass it directly
+ if value not in old_manifest['core']['files']:
+ old_manifest['core']['files'].append(value)
+ continue
+ # Ignore empty values
+ if value == '':
+ continue
+ if '${includedir}' in value:
+ if value not in old_manifest['core']['files']:
+ old_manifest['core']['files'].append(value)
+ continue
+ # Get module name , shouldnt be affected by libdir/bindir
+ value = os.path.splitext(os.path.basename(os.path.normpath(value)))[0]
+
+
+ # Launch separate task for each module for deterministic behavior
+ # Each module will only import what is necessary for it to work in specific
+ print ('Getting dependencies for module: %s' % value)
+ output = subprocess.check_output([sys.executable, 'get_module_deps2.py', '%s' % value])
+ for item in output.split():
+ # We append it so it doesnt hurt what we currently have:
+ if item not in old_manifest['core']['files']:
+ old_manifest['core']['files'].append(item)
+
+# We check which packages include folders
+for key in old_manifest:
+ for value in old_manifest[key]['files']:
+ # Ignore folders, since we don't import those, difficult to handle multilib
+ if isFolder(value):
+ print ('%s is a folder' % value)
+ if key not in hasfolders:
+ hasfolders.append(key)
+ if value not in allfolders:
+ allfolders.append(value)
+
+for key in old_manifest:
+ # Use an empty dict as data structure to hold data for each package and fill it up
+ new_manifest[key]={}
+ new_manifest[key]['files']=[]
+ new_manifest[key]['rdepends']=[]
+ # All packages should depend on core
+ if key != 'core':
+ new_manifest[key]['rdepends'].append('core')
+ new_manifest[key]['summary']=old_manifest[key]['summary']
+
+ # Handle special cases, we assume that when they were manually added
+ # to the manifest we knew what we were doing.
+ print ('Handling package %s' % key)
+ special_packages=['misc', 'modules', 'dev']
+ if key in special_packages or 'staticdev' in key:
+ print('Passing %s package directly' % key)
+ new_manifest[key]=old_manifest[key]
+ continue
+
+ for value in old_manifest[key]['files']:
+ # We already handled core on the first pass
+ if key == 'core':
+ new_manifest[key]['files'].append(value)
+ continue
+ # Ignore folders, since we don't import those, difficult to handle multilib
+ if isFolder(value):
+ # Pass folders directly
+ new_manifest[key]['files'].append(value)
+ # Ignore binaries, since we don't import those
+ if '${bindir}' in value:
+ # Pass it directly to the new manifest data structure
+ if value not in new_manifest[key]['files']:
+ new_manifest[key]['files'].append(value)
+ continue
+ # Ignore empty values
+ if value == '':
+ continue
+ if '${includedir}' in value:
+ if value not in new_manifest[key]['files']:
+ new_manifest[key]['files'].append(value)
+ continue
+ # Get module name , shouldnt be affected by libdir/bindir
+ value = os.path.splitext(os.path.basename(os.path.normpath(value)))[0]
+
+ # Launch separate task for each module for deterministic behavior
+ # Each module will only import what is necessary for it to work in specific
+ print ('Getting dependencies for module: %s' % value)
+ output = subprocess.check_output([sys.executable, 'get_module_deps2.py', '%s' % value])
+
+ # We can print dependencies for debugging purposes
+ #print (output)
+ # Output will have all dependencies
+ for item in output.split():
+
+ # Warning: This first part is ugly
+ # One of the dependencies that was found, could be inside of one of the folders included by another package
+ # We need to check if this happens so we can add the package containing the folder as an RDEPENDS
+ # e.g. Folder encodings contained in codecs
+ # This would be solved if no packages included any folders
+
+ # This can be done in two ways:
+ # 1 - We assume that if we take out the filename from the path we would get
+ # the folder string, then we would check if folder string is in the list of folders
+ # This would not work if a package contains a folder which contains another folder
+ # e.g. path/folder1/folder2/filename folder_string= path/folder1/folder2
+ # folder_string would not match any value contained in the list of folders
+ #
+ # 2 - We do it the other way around, checking if the folder is contained in the path
+ # e.g. path/folder1/folder2/filename folder_string= path/folder1/folder2
+ # is folder_string inside path/folder1/folder2/filename?,
+ # Yes, it works, but we waste a couple of milliseconds.
+
+ inFolders=False
+ for folder in allfolders:
+ if folder in item:
+ inFolders = True # Did we find a folder?
+ folderFound = False # Second flag to break inner for
+ # Loop only through packages which contain folders
+ for keyfolder in hasfolders:
+ if (folderFound == False):
+ #print("Checking folder %s on package %s" % (item,keyfolder))
+ for file_folder in old_manifest[keyfolder]['files']:
+ if file_folder==folder:
+ print ('%s found in %s' % (folder, keyfolder))
+ folderFound = True
+ if keyfolder not in new_manifest[key]['rdepends'] and keyfolder != key:
+ new_manifest[key]['rdepends'].append(keyfolder)
+ else:
+ break
+
+ # A folder was found so we're done with this item, we can go on
+ if inFolders:
+ continue
+
+ # We might already have it on the dictionary since it could depend on a (previously checked) module
+ if item not in new_manifest[key]['files']:
+ # Handle core as a special package, we already did it so we pass it to NEW data structure directly
+ if key=='core':
+ print('Adding %s to %s FILES' % (item, key))
+ if item.endswith('*'):
+ wildcards.append(item)
+ new_manifest[key]['files'].append(item)
+
+ # Check for repeated files
+ if item not in allfiles:
+ allfiles.append(item)
+ else:
+ repeated.append(item)
+
+ else:
+
+ # Check if this dependency is already contained on another package, so we add it
+ # as an RDEPENDS, or if its not, it means it should be contained on the current
+ # package, so we should add it to FILES
+ for newkey in old_manifest:
+ # Debug
+ #print("Checking %s " % item + " in %s" % newkey)
+ if item in old_manifest[newkey]['files']:
+ # Since were nesting, we need to check its not the same key
+ if(newkey!=key):
+ if newkey not in new_manifest[key]['rdepends']:
+ # Add it to the new manifest data struct
+ # Debug
+ print('Adding %s to %s RDEPENDS, because it contains %s' % (newkey, key, item))
+ new_manifest[key]['rdepends'].append(newkey)
+ break
+ else:
+ # Debug
+ print('Adding %s to %s FILES' % (item, key))
+ # Since it wasnt found on another package, its not an RDEP, so add it to FILES for this package
+ new_manifest[key]['files'].append(item)
+ if item.endswith('*'):
+ wildcards.append(item)
+ if item not in allfiles:
+ allfiles.append(item)
+ else:
+ repeated.append(item)
+
+print ('The following files are repeated (contained in more than one package), please check which package should get it:')
+print (repeated)
+print('The following files contain wildcards, please check they are necessary')
+print(wildcards)
+print('The following files contain folders, please check they are necessary')
+print(hasfolders)
+
+# Sort it just so it looks nice
+for key in new_manifest:
+ new_manifest[key]['files'].sort()
+ new_manifest[key]['rdepends'].sort()
+
+# Create the manifest from the data structure that was built
+with open('python2-manifest.json.new','w') as outfile:
+ json.dump(new_manifest,outfile,sort_keys=True, indent=4, separators=(',', ': '))
diff --git a/poky/meta/recipes-devtools/python/python/fix-gc-alignment.patch b/poky/meta/recipes-devtools/python/python/fix-gc-alignment.patch
new file mode 100644
index 000000000..b63cd0874
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/fix-gc-alignment.patch
@@ -0,0 +1,43 @@
+Upstream-Status: Submitted
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+Fix for over-aligned GC info
+Patch by Florian Weimer
+
+See: https://bugzilla.redhat.com/show_bug.cgi?id=1540316
+Upstream discussion: https://mail.python.org/pipermail/python-dev/2018-January/152000.html
+
+diff --git a/Include/objimpl.h b/Include/objimpl.h
+index 55e83eced6..aa906144dc 100644
+--- a/Include/objimpl.h
++++ b/Include/objimpl.h
+@@ -248,6 +248,18 @@ PyAPI_FUNC(PyVarObject *) _PyObject_GC_Resize(PyVarObject *, Py_ssize_t);
+ /* for source compatibility with 2.2 */
+ #define _PyObject_GC_Del PyObject_GC_Del
+
++/* Former over-aligned definition of PyGC_Head, used to compute the
++ size of the padding for the new version below. */
++union _gc_head;
++union _gc_head_old {
++ struct {
++ union _gc_head *gc_next;
++ union _gc_head *gc_prev;
++ Py_ssize_t gc_refs;
++ } gc;
++ long double dummy;
++};
++
+ /* GC information is stored BEFORE the object structure. */
+ typedef union _gc_head {
+ struct {
+@@ -255,7 +267,8 @@ typedef union _gc_head {
+ union _gc_head *gc_prev;
+ Py_ssize_t gc_refs;
+ } gc;
+- long double dummy; /* force worst-case alignment */
++ double dummy; /* force worst-case alignment */
++ char dummy_padding[sizeof(union _gc_head_old)];
+ } PyGC_Head;
+
+ extern PyGC_Head *_PyGC_generation0;
+ \ No newline at end of file
diff --git a/poky/meta/recipes-devtools/python/python/fix-makefile-for-ptest.patch b/poky/meta/recipes-devtools/python/python/fix-makefile-for-ptest.patch
new file mode 100644
index 000000000..60d782cd2
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/fix-makefile-for-ptest.patch
@@ -0,0 +1,34 @@
+Add 'build-test' and 'runtest-TESTS' targets to Makefile, to build and run tests
+cross-compiled.
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Upstream-Status: Pending
+---
+Index: Python-2.7.14/Makefile.pre.in
+===================================================================
+--- Python-2.7.14.orig/Makefile.pre.in
++++ Python-2.7.14/Makefile.pre.in
+@@ -846,14 +846,19 @@ $(LIBRARY_OBJS) $(MODOBJS) Modules/pytho
+
+ .PHONY: test testall testuniversal buildbottest pythoninfo
+
+-TESTOPTS= -l $(EXTRATESTOPTS)
++TESTOPTS= -l -v $(EXTRATESTOPTS)
+ TESTPROG= $(srcdir)/Lib/test/regrtest.py
+-TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS)
+-test: @DEF_MAKE_RULE@ platform
+- -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
++TESTPYTHON= $(RUNSHARED) $(BUILDPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS)
++test: build-test
++ $(MAKE) runtest-TESTS
++
++runtest-TESTS:
++ -find $(srcdir) -name '*.py[co]' -print | xargs rm -f
+ -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
+ $(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
+
++build-test: @DEF_MAKE_RULE@ platform
++
+ testall: @DEF_MAKE_RULE@ platform
+ -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
+ $(TESTPYTHON) $(srcdir)/Lib/compileall.py
diff --git a/poky/meta/recipes-devtools/python/python/fix_for_using_different_libdir.patch b/poky/meta/recipes-devtools/python/python/fix_for_using_different_libdir.patch
new file mode 100644
index 000000000..5f7309367
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/fix_for_using_different_libdir.patch
@@ -0,0 +1,77 @@
+Upstream-Status: Inappropriate [Embedded specific]
+
+This patch fixes issuing with different libdir like lib64.
+This patch makes the native python binary modules findable
+in the install process of the host python.
+
+Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+Date: 2012/03/14
+
+Updated for python 2.7.3
+Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+Date: 2012/05/01
+
+Rebased for python-2.7.9
+Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+
+Index: Python-2.7.9/Lib/sysconfig.py
+===================================================================
+--- Python-2.7.9.orig/Lib/sysconfig.py
++++ Python-2.7.9/Lib/sysconfig.py
+@@ -9,7 +9,7 @@ _INSTALL_SCHEMES = {
+ 'posix_prefix': {
+ 'stdlib': '{base}/'+sys.lib+'/python{py_version_short}',
+ 'platstdlib': '{platbase}/'+sys.lib+'/python{py_version_short}',
+- 'purelib': '{base}/lib/python{py_version_short}/site-packages',
++ 'purelib': '{base}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'platlib': '{platbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'include': '{base}/include/python{py_version_short}',
+ 'platinclude': '{platbase}/include/python{py_version_short}',
+@@ -67,7 +67,7 @@ _INSTALL_SCHEMES = {
+ 'posix_user': {
+ 'stdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
+ 'platstdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
+- 'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
++ 'purelib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'platlib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'include': '{userbase}/include/python{py_version_short}',
+ 'scripts': '{userbase}/bin',
+Index: Python-2.7.9/Makefile.pre.in
+===================================================================
+--- Python-2.7.9.orig/Makefile.pre.in
++++ Python-2.7.9/Makefile.pre.in
+@@ -1046,27 +1046,27 @@ libinstall: build_all $(srcdir)/Lib/$(PL
+ $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
+ $(DESTDIR)$(LIBDEST)/distutils/tests ; \
+ fi
+- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++ PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
+ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ -d $(LIBDEST) -f \
+ -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+ $(DESTDIR)$(LIBDEST)
+- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++ PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH}$(RUNSHARED) \
+ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ -d $(LIBDEST) -f \
+ -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+ $(DESTDIR)$(LIBDEST)
+- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++ -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
+ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ -d $(LIBDEST)/site-packages -f \
+ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++ -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
+ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ -d $(LIBDEST)/site-packages -f \
+ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++ -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
+ $(HOSTPYTHON) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
+- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++ -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
+ $(HOSTPYTHON) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
+
+ # Create the PLATDIR source directory, if one wasn't distributed..
diff --git a/poky/meta/recipes-devtools/python/python/get_module_deps2.py b/poky/meta/recipes-devtools/python/python/get_module_deps2.py
new file mode 100644
index 000000000..73e7c6f6d
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/get_module_deps2.py
@@ -0,0 +1,112 @@
+# This script is launched on separate task for each python module
+# It checks for dependencies for that specific module and prints
+# them out, the output of this execution will have all dependencies
+# for a specific module, which will be parsed an dealt on create_manifest.py
+#
+# Author: Alejandro Enedino Hernandez Samaniego "aehs29" <aehs29@gmail.com>
+
+
+# We can get a log per module, for all the dependencies that were found, but its messy.
+debug=False
+
+import sys
+
+# We can get a list of the modules which are currently required to run python
+# so we run python-core and get its modules, we then import what we need
+# and check what modules are currently running, if we substract them from the
+# modules we had initially, we get the dependencies for the module we imported.
+
+# We use importlib to achieve this, so we also need to know what modules importlib needs
+import importlib
+
+core_deps=set(sys.modules)
+
+def fix_path(dep_path):
+ import os
+ # We DONT want the path on our HOST system
+ pivot='recipe-sysroot-native'
+ dep_path=dep_path[dep_path.find(pivot)+len(pivot):]
+
+ if '/usr/bin' in dep_path:
+ dep_path = dep_path.replace('/usr/bin''${bindir}')
+
+ # Handle multilib, is there a better way?
+ if '/usr/lib32' in dep_path:
+ dep_path = dep_path.replace('/usr/lib32','${libdir}')
+ if '/usr/lib64' in dep_path:
+ dep_path = dep_path.replace('/usr/lib64','${libdir}')
+ if '/usr/lib' in dep_path:
+ dep_path = dep_path.replace('/usr/lib','${libdir}')
+ if '/usr/include' in dep_path:
+ dep_path = dep_path.replace('/usr/include','${includedir}')
+ if '__init__.' in dep_path:
+ dep_path = os.path.split(dep_path)[0]
+
+ # If a *.pyc file was imported, we replace it with *.py (since we deal with PYCs on create_manifest)
+ if '.pyc' in dep_path:
+ dep_path = dep_path.replace('.pyc','.py')
+
+ return dep_path
+
+# Module to import was passed as an argument
+current_module = str(sys.argv[1]).rstrip()
+if(debug==True):
+ log = open('log_%s' % current_module,'w')
+ log.write('Module %s generated the following dependencies:\n' % current_module)
+try:
+ importlib.import_module('%s' % current_module)
+except ImportError as e:
+ if (debug==True):
+ log.write('Module was not found')
+ pass
+
+
+# Get current module dependencies, dif will contain a list of specific deps for this module
+module_deps=set(sys.modules)
+
+# We handle the core package (1st pass on create_manifest.py) as a special case
+if current_module == 'python-core-package':
+ dif = core_deps
+else:
+ dif = module_deps-core_deps
+
+
+# Check where each dependency came from
+for item in dif:
+ dep_path=''
+ try:
+ if (debug==True):
+ log.write('Calling: sys.modules[' + '%s' % item + '].__file__\n')
+ dep_path = sys.modules['%s' % item].__file__
+ except AttributeError as e:
+ # Deals with thread (builtin module) not having __file__ attribute
+ if debug==True:
+ log.write(item + ' ')
+ log.write(str(e))
+ log.write('\n')
+ pass
+ except NameError as e:
+ # Deals with NameError: name 'dep_path' is not defined
+ # because module is not found (wasn't compiled?), e.g. bddsm
+ if (debug==True):
+ log.write(item+' ')
+ log.write(str(e))
+ pass
+
+ # Site-customize is a special case since we (OpenEmbedded) put it there manually
+ if 'sitecustomize' in dep_path:
+ dep_path = '${libdir}/python2.7/sitecustomize.py'
+ # Prints out result, which is what will be used by create_manifest
+ print (dep_path)
+ continue
+
+ dep_path = fix_path(dep_path)
+
+ if (debug==True):
+ log.write(dep_path+'\n')
+
+ # Prints out result, which is what will be used by create_manifest
+ print (dep_path)
+
+if debug==True:
+ log.close()
diff --git a/poky/meta/recipes-devtools/python/python/host_include_contamination.patch b/poky/meta/recipes-devtools/python/python/host_include_contamination.patch
new file mode 100644
index 000000000..e0aafb218
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/host_include_contamination.patch
@@ -0,0 +1,28 @@
+when building python for qemux86-64 on ubuntu 11.10/64bit
+it gropes into host includes and then mixes them with cross
+includes and as a result some modules fail to compile and link
+one of the modules is python-elementtree which is then not
+found during image creation
+
+Proble is that setup.py tries to add native includes that newer
+ubuntu has introduced for multiarch support. But that should
+only happen for native builds and not cross building python
+so we add a check here.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+
+diff --git a/setup.py b/setup.py
+index ba2d242..bf859be 100644
+--- a/setup.py
++++ b/setup.py
+@@ -393,6 +393,8 @@ class PyBuildExt(build_ext):
+
+ if not find_executable('dpkg-architecture'):
+ return
++ if os.environ.get('CROSS_COMPILE') is not None:
++ return
+ opt = ''
+ if cross_compiling:
+ opt = '-t' + sysconfig.get_config_var('HOST_GNU_TYPE')
diff --git a/poky/meta/recipes-devtools/python/python/multilib.patch b/poky/meta/recipes-devtools/python/python/multilib.patch
new file mode 100644
index 000000000..1116dd518
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/multilib.patch
@@ -0,0 +1,298 @@
+Rebased for python-2.7.9
+Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+Upstream-Status: Pending
+Index: Python-2.7.14/configure.ac
+===================================================================
+--- Python-2.7.14.orig/configure.ac
++++ Python-2.7.14/configure.ac
+@@ -758,6 +758,10 @@ SunOS*)
+ ;;
+ esac
+
++AC_SUBST(LIB)
++AC_MSG_CHECKING(LIB)
++LIB=`basename ${libdir}`
++AC_MSG_RESULT($LIB)
+
+ AC_SUBST(LIBRARY)
+ AC_MSG_CHECKING(LIBRARY)
+Index: Python-2.7.14/Include/pythonrun.h
+===================================================================
+--- Python-2.7.14.orig/Include/pythonrun.h
++++ Python-2.7.14/Include/pythonrun.h
+@@ -108,6 +108,7 @@ PyAPI_FUNC(char *) Py_GetPath(void);
+ /* In their own files */
+ PyAPI_FUNC(const char *) Py_GetVersion(void);
+ PyAPI_FUNC(const char *) Py_GetPlatform(void);
++PyAPI_FUNC(const char *) Py_GetLib(void);
+ PyAPI_FUNC(const char *) Py_GetCopyright(void);
+ PyAPI_FUNC(const char *) Py_GetCompiler(void);
+ PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
+Index: Python-2.7.14/Lib/distutils/command/install.py
+===================================================================
+--- Python-2.7.14.orig/Lib/distutils/command/install.py
++++ Python-2.7.14/Lib/distutils/command/install.py
+@@ -22,6 +22,8 @@ from site import USER_BASE
+ from site import USER_SITE
+
+
++libname = sys.lib
++
+ if sys.version < "2.2":
+ WINDOWS_SCHEME = {
+ 'purelib': '$base',
+@@ -41,8 +43,8 @@ else:
+
+ INSTALL_SCHEMES = {
+ 'unix_prefix': {
+- 'purelib': '$base/lib/python$py_version_short/site-packages',
+- 'platlib': '$platbase/lib/python$py_version_short/site-packages',
++ 'purelib': '$platbase/'+libname+'/python$py_version_short/site-packages',
++ 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages',
+ 'headers': '$base/include/python$py_version_short/$dist_name',
+ 'scripts': '$base/bin',
+ 'data' : '$base',
+Index: Python-2.7.14/Lib/distutils/sysconfig.py
+===================================================================
+--- Python-2.7.14.orig/Lib/distutils/sysconfig.py
++++ Python-2.7.14/Lib/distutils/sysconfig.py
+@@ -119,8 +119,11 @@ def get_python_lib(plat_specific=0, stan
+ prefix = plat_specific and EXEC_PREFIX or PREFIX
+
+ if os.name == "posix":
+- libpython = os.path.join(prefix,
+- "lib", "python" + get_python_version())
++ if plat_specific or standard_lib:
++ lib = sys.lib
++ else:
++ lib = "lib"
++ libpython = os.path.join(prefix, lib, "python" + get_python_version())
+ if standard_lib:
+ return libpython
+ else:
+Index: Python-2.7.14/Lib/pydoc.py
+===================================================================
+--- Python-2.7.14.orig/Lib/pydoc.py
++++ Python-2.7.14/Lib/pydoc.py
+@@ -375,7 +375,7 @@ class Doc:
+ docmodule = docclass = docroutine = docother = docproperty = docdata = fail
+
+ def getdocloc(self, object,
+- basedir=os.path.join(sys.exec_prefix, "lib",
++ basedir=os.path.join(sys.exec_prefix, "sys.lib",
+ "python"+sys.version[0:3])):
+ """Return the location of module docs or None"""
+
+Index: Python-2.7.14/Lib/site.py
+===================================================================
+--- Python-2.7.14.orig/Lib/site.py
++++ Python-2.7.14/Lib/site.py
+@@ -288,13 +288,18 @@ def getsitepackages():
+ if sys.platform in ('os2emx', 'riscos'):
+ sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
+ elif os.sep == '/':
+- sitepackages.append(os.path.join(prefix, "lib",
++ sitepackages.append(os.path.join(prefix, sys.lib,
+ "python" + sys.version[:3],
+ "site-packages"))
+- sitepackages.append(os.path.join(prefix, "lib", "site-python"))
++ sitepackages.append(os.path.join(prefix, sys.lib, "site-python"))
++ if sys.lib != "lib":
++ sitepackages.append(os.path.join(prefix, "lib",
++ "python" + sys.version[:3],
++ "site-packages"))
++ sitepackages.append(os.path.join(prefix, "lib", "site-python"))
+ else:
+ sitepackages.append(prefix)
+- sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
++ sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
+ return sitepackages
+
+ def addsitepackages(known_paths):
+Index: Python-2.7.14/Lib/sysconfig.py
+===================================================================
+--- Python-2.7.14.orig/Lib/sysconfig.py
++++ Python-2.7.14/Lib/sysconfig.py
+@@ -7,10 +7,10 @@ from os.path import pardir, realpath
+
+ _INSTALL_SCHEMES = {
+ 'posix_prefix': {
+- 'stdlib': '{base}/lib/python{py_version_short}',
+- 'platstdlib': '{platbase}/lib/python{py_version_short}',
++ 'stdlib': '{base}/'+sys.lib+'/python{py_version_short}',
++ 'platstdlib': '{platbase}/'+sys.lib+'/python{py_version_short}',
+ 'purelib': '{base}/lib/python{py_version_short}/site-packages',
+- 'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
++ 'platlib': '{platbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'include': '{base}/include/python{py_version_short}',
+ 'platinclude': '{platbase}/include/python{py_version_short}',
+ 'scripts': '{base}/bin',
+@@ -65,10 +65,10 @@ _INSTALL_SCHEMES = {
+ 'data' : '{userbase}',
+ },
+ 'posix_user': {
+- 'stdlib': '{userbase}/lib/python{py_version_short}',
+- 'platstdlib': '{userbase}/lib/python{py_version_short}',
++ 'stdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
++ 'platstdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
+ 'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
+- 'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
++ 'platlib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'include': '{userbase}/include/python{py_version_short}',
+ 'scripts': '{userbase}/bin',
+ 'data' : '{userbase}',
+Index: Python-2.7.14/Lib/test/test_dl.py
+===================================================================
+--- Python-2.7.14.orig/Lib/test/test_dl.py
++++ Python-2.7.14/Lib/test/test_dl.py
+@@ -4,10 +4,11 @@
+ import unittest
+ from test.test_support import verbose, import_module
+ dl = import_module('dl', deprecated=True)
++import sys
+
+ sharedlibs = [
+- ('/usr/lib/libc.so', 'getpid'),
+- ('/lib/libc.so.6', 'getpid'),
++ ('/usr/'+sys.lib+'/libc.so', 'getpid'),
++ ('/'+sys.lib+'/libc.so.6', 'getpid'),
+ ('/usr/bin/cygwin1.dll', 'getpid'),
+ ('/usr/lib/libc.dylib', 'getpid'),
+ ]
+Index: Python-2.7.14/Lib/test/test_site.py
+===================================================================
+--- Python-2.7.14.orig/Lib/test/test_site.py
++++ Python-2.7.14/Lib/test/test_site.py
+@@ -252,12 +252,16 @@ class HelperFunctionsTests(unittest.Test
+ self.assertEqual(dirs[0], wanted)
+ elif os.sep == '/':
+ # OS X, Linux, FreeBSD, etc
+- self.assertEqual(len(dirs), 2)
+ wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3],
+ 'site-packages')
+- self.assertEqual(dirs[0], wanted)
++ self.assertTrue(wanted in dirs)
+ wanted = os.path.join('xoxo', 'lib', 'site-python')
+- self.assertEqual(dirs[1], wanted)
++ self.assertTrue(wanted in dirs)
++ wanted = os.path.join('xoxo', sys.lib, 'python' + sys.version[:3],
++ 'site-packages')
++ self.assertTrue(wanted in dirs)
++ wanted = os.path.join('xoxo', sys.lib, 'site-python')
++ self.assertTrue(wanted in dirs)
+ else:
+ # other platforms
+ self.assertEqual(len(dirs), 2)
+Index: Python-2.7.14/Lib/trace.py
+===================================================================
+--- Python-2.7.14.orig/Lib/trace.py
++++ Python-2.7.14/Lib/trace.py
+@@ -754,10 +754,10 @@ def main(argv=None):
+ # should I also call expanduser? (after all, could use $HOME)
+
+ s = s.replace("$prefix",
+- os.path.join(sys.prefix, "lib",
++ os.path.join(sys.prefix, sys.lib,
+ "python" + sys.version[:3]))
+ s = s.replace("$exec_prefix",
+- os.path.join(sys.exec_prefix, "lib",
++ os.path.join(sys.exec_prefix, sys.lib,
+ "python" + sys.version[:3]))
+ s = os.path.normpath(s)
+ ignore_dirs.append(s)
+Index: Python-2.7.14/Makefile.pre.in
+===================================================================
+--- Python-2.7.14.orig/Makefile.pre.in
++++ Python-2.7.14/Makefile.pre.in
+@@ -91,6 +91,7 @@ PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAG
+
+ # Machine-dependent subdirectories
+ MACHDEP= @MACHDEP@
++LIB= @LIB@
+
+ # Multiarch directory (may be empty)
+ MULTIARCH= @MULTIARCH@
+@@ -110,7 +111,7 @@ LIBDIR= @libdir@
+ MANDIR= @mandir@
+ INCLUDEDIR= @includedir@
+ CONFINCLUDEDIR= $(exec_prefix)/include
+-SCRIPTDIR= $(prefix)/lib
++SCRIPTDIR= $(prefix)/@LIB@
+
+ # Detailed destination directories
+ BINLIBDEST= $(LIBDIR)/python$(VERSION)
+@@ -645,6 +646,7 @@ Modules/getpath.o: $(srcdir)/Modules/get
+ -DEXEC_PREFIX='"$(exec_prefix)"' \
+ -DVERSION='"$(VERSION)"' \
+ -DVPATH='"$(VPATH)"' \
++ -DLIB='"$(LIB)"' \
+ -o $@ $(srcdir)/Modules/getpath.c
+
+ Modules/python.o: $(srcdir)/Modules/python.c
+@@ -693,7 +695,7 @@ regen-ast:
+ Python/compile.o Python/symtable.o Python/ast.o: $(srcdir)/Include/graminit.h $(srcdir)/Include/Python-ast.h
+
+ Python/getplatform.o: $(srcdir)/Python/getplatform.c
+- $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
++ $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
+
+ Python/importdl.o: $(srcdir)/Python/importdl.c
+ $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
+Index: Python-2.7.14/Modules/getpath.c
+===================================================================
+--- Python-2.7.14.orig/Modules/getpath.c
++++ Python-2.7.14/Modules/getpath.c
+@@ -100,6 +100,13 @@
+ #error "PREFIX, EXEC_PREFIX, VERSION, and VPATH must be constant defined"
+ #endif
+
++#define LIB_PYTHON LIB "/python" VERSION
++
++#ifndef PYTHONPATH
++#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \
++ EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload"
++#endif
++
+ #ifndef LANDMARK
+ #define LANDMARK "os.py"
+ #endif
+@@ -108,7 +115,7 @@ static char prefix[MAXPATHLEN+1];
+ static char exec_prefix[MAXPATHLEN+1];
+ static char progpath[MAXPATHLEN+1];
+ static char *module_search_path = NULL;
+-static char lib_python[] = "lib/python" VERSION;
++static char lib_python[] = LIB_PYTHON;
+
+ static void
+ reduce(char *dir)
+Index: Python-2.7.14/Python/getplatform.c
+===================================================================
+--- Python-2.7.14.orig/Python/getplatform.c
++++ Python-2.7.14/Python/getplatform.c
+@@ -10,3 +10,13 @@ Py_GetPlatform(void)
+ {
+ return PLATFORM;
+ }
++
++#ifndef LIB
++#define LIB "lib"
++#endif
++
++const char *
++Py_GetLib(void)
++{
++ return LIB;
++}
+Index: Python-2.7.14/Python/sysmodule.c
+===================================================================
+--- Python-2.7.14.orig/Python/sysmodule.c
++++ Python-2.7.14/Python/sysmodule.c
+@@ -1437,6 +1437,8 @@ _PySys_Init(void)
+ PyString_FromString(Py_GetCopyright()));
+ SET_SYS_FROM_STRING("platform",
+ PyString_FromString(Py_GetPlatform()));
++ SET_SYS_FROM_STRING("lib",
++ PyString_FromString(Py_GetLib()));
+ SET_SYS_FROM_STRING("executable",
+ PyString_FromString(Py_GetProgramFullPath()));
+ SET_SYS_FROM_STRING("prefix",
diff --git a/poky/meta/recipes-devtools/python/python/parallel-makeinst-create-bindir.patch b/poky/meta/recipes-devtools/python/python/parallel-makeinst-create-bindir.patch
new file mode 100644
index 000000000..abab41e95
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/parallel-makeinst-create-bindir.patch
@@ -0,0 +1,19 @@
+When using make -j with the 'install' target, it's possible for altbininstall
+(which normally creates BINDIR) and libainstall (which doesn't, though it
+installs python-config there) to race, resulting in a failure due to
+attempting to install python-config into a nonexistent BINDIR. Ensure it also
+exists in the libainstall target.
+
+Upstream-Status: Pending
+
+--- Python-2.7.3.orig/Makefile.pre.in
++++ Python-2.7.3/Makefile.pre.in
+@@ -1187,7 +1187,7 @@
+ LIBPC= $(LIBDIR)/pkgconfig
+
+ libainstall: @DEF_MAKE_RULE@ python-config
+- @for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \
++ @for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC) $(BINDIR); \
+ do \
+ if test ! -d $(DESTDIR)$$i; then \
+ echo "Creating directory $$i"; \
diff --git a/poky/meta/recipes-devtools/python/python/pass-missing-libraries-to-Extension-for-mul.patch b/poky/meta/recipes-devtools/python/python/pass-missing-libraries-to-Extension-for-mul.patch
new file mode 100644
index 000000000..44fcaacf3
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/pass-missing-libraries-to-Extension-for-mul.patch
@@ -0,0 +1,82 @@
+From 71447f04979b267f8866573b67a4340b2719d799 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Fri, 4 Aug 2017 14:10:43 +0800
+Subject: [PATCH] setup.py: pass missing libraries to Extension for multiprocessing module
+
+In the following commit:
+...
+commit e711cafab13efc9c1fe6c5cd75826401445eb585
+Author: Benjamin Peterson <benjamin@python.org>
+Date: Wed Jun 11 16:44:04 2008 +0000
+
+ Merged revisions 64104,64117 via svnmerge from
+ svn+ssh://pythondev@svn.python.org/python/trunk
+...
+(see diff in setup.py)
+It assigned libraries for multiprocessing module according
+the host_platform, but not pass it to Extension.
+
+In glibc, the following commit caused two definition of
+sem_getvalue are different.
+https://sourceware.org/git/?p=glibc.git;a=commit;h=042e1521c794a945edc43b5bfa7e69ad70420524
+(see diff in nptl/sem_getvalue.c for detail)
+`__new_sem_getvalue' is the latest sem_getvalue@@GLIBC_2.1
+and `__old_sem_getvalue' is to compat the old version
+sem_getvalue@GLIBC_2.0.
+
+To build python for embedded Linux systems:
+http://www.yoctoproject.org/docs/2.3.1/yocto-project-qs/yocto-project-qs.html
+If not explicitly link to library pthread (-lpthread), it will
+load glibc's sem_getvalue randomly at runtime.
+
+Such as build python on linux x86_64 host and run the python
+on linux x86_32 target. If not link library pthread, it caused
+multiprocessing bounded semaphore could not work correctly.
+...
+>>> import multiprocessing
+>>> pool_sema = multiprocessing.BoundedSemaphore(value=1)
+>>> pool_sema.acquire()
+True
+>>> pool_sema.release()
+Traceback (most recent call last):
+ File "<stdin>", line 1, in <module>
+ValueError: semaphore or lock released too many times
+...
+
+And the semaphore issue also caused multiprocessing.Queue().put() hung.
+
+Upstream-Status: Submitted [https://github.com/python/cpython/pull/2999]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ setup.py | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index 54054c2..9646bfc 100644
+--- a/setup.py
++++ b/setup.py
+@@ -1586,8 +1586,10 @@ class PyBuildExt(build_ext):
+ elif host_platform.startswith('netbsd'):
+ macros = dict()
+ libraries = []
+-
+- else: # Linux and other unices
++ elif host_platform.startswith(('linux')):
++ macros = dict()
++ libraries = ['pthread']
++ else: # Other unices
+ macros = dict()
+ libraries = ['rt']
+
+@@ -1610,6 +1612,7 @@ class PyBuildExt(build_ext):
+ if sysconfig.get_config_var('WITH_THREAD'):
+ exts.append ( Extension('_multiprocessing', multiprocessing_srcs,
+ define_macros=macros.items(),
++ libraries=libraries,
+ include_dirs=["Modules/_multiprocessing"]))
+ else:
+ missing.append('_multiprocessing')
+--
+2.7.4
+
diff --git a/poky/meta/recipes-devtools/python/python/python-2.7.3-remove-bsdb-rpath.patch b/poky/meta/recipes-devtools/python/python/python-2.7.3-remove-bsdb-rpath.patch
new file mode 100644
index 000000000..216be0a44
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/python-2.7.3-remove-bsdb-rpath.patch
@@ -0,0 +1,28 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Remove the RPATH to avoid QA issue warning.
+
+RP: Added secondary unnecessary rpath to the list 2012/8/7
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+
+
+Index: Python-2.7.3/setup.py
+===================================================================
+--- Python-2.7.3.orig/setup.py 2012-08-07 10:41:58.560132529 +0000
++++ Python-2.7.3/setup.py 2012-08-07 11:09:47.852094515 +0000
+@@ -1042,7 +1042,6 @@
+ exts.append(Extension('_bsddb', ['_bsddb.c'],
+ depends = ['bsddb.h'],
+ library_dirs=dblib_dir,
+- runtime_library_dirs=dblib_dir,
+ include_dirs=db_incs,
+ libraries=dblibs))
+ else:
+@@ -1252,7 +1251,6 @@
+ print "building dbm using bdb"
+ dbmext = Extension('dbm', ['dbmmodule.c'],
+ library_dirs=dblib_dir,
+- runtime_library_dirs=dblib_dir,
+ include_dirs=db_incs,
+ define_macros=[
+ ('HAVE_BERKDB_H', None),
diff --git a/poky/meta/recipes-devtools/python/python/python2-manifest.json b/poky/meta/recipes-devtools/python/python/python2-manifest.json
new file mode 100644
index 000000000..723e5138e
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/python2-manifest.json
@@ -0,0 +1,1047 @@
+{
+ "2to3": {
+ "files": [
+ "${bindir}/2to3",
+ "${libdir}/python2.7/lib2to3"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python automated Python 2 to 3 code translator"
+ },
+ "argparse": {
+ "files": [
+ "${libdir}/python2.7/argparse.py"
+ ],
+ "rdepends": [
+ "codecs",
+ "core",
+ "lang",
+ "textutils"
+ ],
+ "summary": "Python command line argument parser"
+ },
+ "audio": {
+ "files": [
+ "${libdir}/python2.7/audiodev.py",
+ "${libdir}/python2.7/chunk.py",
+ "${libdir}/python2.7/lib-dynload/audioop.so",
+ "${libdir}/python2.7/lib-dynload/ossaudiodev.so",
+ "${libdir}/python2.7/sndhdr.py",
+ "${libdir}/python2.7/sunau.py",
+ "${libdir}/python2.7/sunaudio.py",
+ "${libdir}/python2.7/toaiff.py",
+ "${libdir}/python2.7/wave.py"
+ ],
+ "rdepends": [
+ "core",
+ "crypt",
+ "fcntl",
+ "io",
+ "math"
+ ],
+ "summary": "Python Audio Handling"
+ },
+ "bsddb": {
+ "files": [
+ "${libdir}/python2.7/bsddb",
+ "${libdir}/python2.7/lib-dynload/_bsddb.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python bindings for the Berkeley Database"
+ },
+ "codecs": {
+ "files": [
+ "${libdir}/python2.7/gettext.py",
+ "${libdir}/python2.7/lib-dynload/_codecs_cn.so",
+ "${libdir}/python2.7/lib-dynload/_codecs_hk.so",
+ "${libdir}/python2.7/lib-dynload/_codecs_iso2022.so",
+ "${libdir}/python2.7/lib-dynload/_codecs_jp.so",
+ "${libdir}/python2.7/lib-dynload/_codecs_kr.so",
+ "${libdir}/python2.7/lib-dynload/_codecs_tw.so",
+ "${libdir}/python2.7/lib-dynload/_multibytecodec.so",
+ "${libdir}/python2.7/lib-dynload/unicodedata.so",
+ "${libdir}/python2.7/locale.py",
+ "${libdir}/python2.7/stringprep.py",
+ "${libdir}/python2.7/xdrlib.py"
+ ],
+ "rdepends": [
+ "core",
+ "io",
+ "lang"
+ ],
+ "summary": "Python codec"
+ },
+ "compile": {
+ "files": [
+ "${libdir}/python2.7/compileall.py",
+ "${libdir}/python2.7/py_compile.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python bytecode compilation support"
+ },
+ "compiler": {
+ "files": [
+ "${libdir}/python2.7/compiler"
+ ],
+ "rdepends": [
+ "core",
+ "io",
+ "lang"
+ ],
+ "summary": "Python compiler support"
+ },
+ "compression": {
+ "files": [
+ "${libdir}/python2.7/gzip.py",
+ "${libdir}/python2.7/lib-dynload/bz2.so",
+ "${libdir}/python2.7/tarfile.py",
+ "${libdir}/python2.7/zipfile.py"
+ ],
+ "rdepends": [
+ "core",
+ "io",
+ "shell",
+ "unixadmin",
+ "zlib"
+ ],
+ "summary": "Python high-level compression support"
+ },
+ "contextlib": {
+ "files": [
+ "${libdir}/python2.7/contextlib.py"
+ ],
+ "rdepends": [
+ "core",
+ "lang"
+ ],
+ "summary": "Python utilities for with-statementcontexts."
+ },
+ "core": {
+ "files": [
+ "${bindir}/python*",
+ "${includedir}/python2.7/pyconfig*.h",
+ "${libdir}/python2.7/ConfigParser.py",
+ "${libdir}/python2.7/UserDict.py",
+ "${libdir}/python2.7/UserList.py",
+ "${libdir}/python2.7/UserString.py",
+ "${libdir}/python2.7/__future__.py",
+ "${libdir}/python2.7/_abcoll.py",
+ "${libdir}/python2.7/_sysconfigdata.py",
+ "${libdir}/python2.7/_weakrefset.py",
+ "${libdir}/python2.7/abc.py",
+ "${libdir}/python2.7/ast.py",
+ "${libdir}/python2.7/atexit.py",
+ "${libdir}/python2.7/codecs.py",
+ "${libdir}/python2.7/collections.py",
+ "${libdir}/python2.7/copy.py",
+ "${libdir}/python2.7/copy_reg.py",
+ "${libdir}/python2.7/encodings",
+ "${libdir}/python2.7/encodings/aliases.py",
+ "${libdir}/python2.7/encodings/utf_8.py",
+ "${libdir}/python2.7/genericpath.py",
+ "${libdir}/python2.7/getopt.py",
+ "${libdir}/python2.7/heapq.py",
+ "${libdir}/python2.7/importlib",
+ "${libdir}/python2.7/keyword.py",
+ "${libdir}/python2.7/lib-dynload/_collections.so",
+ "${libdir}/python2.7/lib-dynload/_heapq.so",
+ "${libdir}/python2.7/lib-dynload/_locale.so",
+ "${libdir}/python2.7/lib-dynload/_struct.so",
+ "${libdir}/python2.7/lib-dynload/binascii.so",
+ "${libdir}/python2.7/lib-dynload/itertools.so",
+ "${libdir}/python2.7/lib-dynload/operator.so",
+ "${libdir}/python2.7/lib-dynload/readline.so",
+ "${libdir}/python2.7/lib-dynload/strop.so",
+ "${libdir}/python2.7/lib-dynload/time.so",
+ "${libdir}/python2.7/lib-dynload/xreadlines.so",
+ "${libdir}/python2.7/linecache.py",
+ "${libdir}/python2.7/new.py",
+ "${libdir}/python2.7/os.py",
+ "${libdir}/python2.7/platform.py",
+ "${libdir}/python2.7/posixpath.py",
+ "${libdir}/python2.7/re.py",
+ "${libdir}/python2.7/rlcompleter.py",
+ "${libdir}/python2.7/site.py",
+ "${libdir}/python2.7/sitecustomize.py",
+ "${libdir}/python2.7/sre_compile.py",
+ "${libdir}/python2.7/sre_constants.py",
+ "${libdir}/python2.7/sre_parse.py",
+ "${libdir}/python2.7/stat.py",
+ "${libdir}/python2.7/string.py",
+ "${libdir}/python2.7/struct.py",
+ "${libdir}/python2.7/sysconfig.py",
+ "${libdir}/python2.7/traceback.py",
+ "${libdir}/python2.7/types.py",
+ "${libdir}/python2.7/warnings.py",
+ "${libdir}/python2.7/weakref.py"
+ ],
+ "rdepends": [],
+ "summary": "Python interpreter and core modules"
+ },
+ "crypt": {
+ "files": [
+ "${libdir}/python2.7/hashlib.py",
+ "${libdir}/python2.7/lib-dynload/_hashlib.so",
+ "${libdir}/python2.7/lib-dynload/crypt.so",
+ "${libdir}/python2.7/md5.py",
+ "${libdir}/python2.7/sha.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python basic cryptographic and hashing support"
+ },
+ "ctypes": {
+ "files": [
+ "${libdir}/python2.7/ctypes",
+ "${libdir}/python2.7/lib-dynload/_ctypes.so",
+ "${libdir}/python2.7/lib-dynload/_ctypes_test.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python C types support"
+ },
+ "curses": {
+ "files": [
+ "${libdir}/python2.7/curses",
+ "${libdir}/python2.7/lib-dynload/_curses.so",
+ "${libdir}/python2.7/lib-dynload/_curses_panel.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python curses support"
+ },
+ "datetime": {
+ "files": [
+ "${libdir}/python2.7/_strptime.py",
+ "${libdir}/python2.7/calendar.py",
+ "${libdir}/python2.7/lib-dynload/datetime.so"
+ ],
+ "rdepends": [
+ "codecs",
+ "core",
+ "lang"
+ ],
+ "summary": "Python calendar and time support"
+ },
+ "db": {
+ "files": [
+ "${libdir}/python2.7/anydbm.py",
+ "${libdir}/python2.7/dbhash.py",
+ "${libdir}/python2.7/dumbdbm.py",
+ "${libdir}/python2.7/lib-dynload/dbm.so",
+ "${libdir}/python2.7/whichdb.py"
+ ],
+ "rdepends": [
+ "bsddb",
+ "core",
+ "gdbm"
+ ],
+ "summary": "Python file-based database support"
+ },
+ "debugger": {
+ "files": [
+ "${libdir}/python2.7/bdb.py",
+ "${libdir}/python2.7/pdb.py"
+ ],
+ "rdepends": [
+ "core",
+ "io",
+ "lang",
+ "pprint",
+ "shell"
+ ],
+ "summary": "Python debugger"
+ },
+ "dev": {
+ "files": [
+ "${base_libdir}/*.a",
+ "${base_libdir}/*.o",
+ "${datadir}/aclocal",
+ "${datadir}/pkgconfig",
+ "${includedir}",
+ "${libdir}/*.a",
+ "${libdir}/*.la",
+ "${libdir}/*.o",
+ "${libdir}/lib*${SOLIBSDEV}",
+ "${libdir}/pkgconfig",
+ "${libdir}/python2.7/config/Makefile"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python development package"
+ },
+ "difflib": {
+ "files": [
+ "${libdir}/python2.7/difflib.py"
+ ],
+ "rdepends": [
+ "core",
+ "lang"
+ ],
+ "summary": "Python helpers for computing deltas between objects"
+ },
+ "distutils": {
+ "files": [
+ "${libdir}/python2.7/config",
+ "${libdir}/python2.7/distutils"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python Distribution Utilities"
+ },
+ "distutils-staticdev": {
+ "files": [
+ "${libdir}/python2.7/config/lib*.a"
+ ],
+ "rdepends": [
+ "distutils"
+ ],
+ "summary": "Python distribution utilities (static libraries)"
+ },
+ "doctest": {
+ "files": [
+ "${libdir}/python2.7/doctest.py"
+ ],
+ "rdepends": [
+ "core",
+ "crypt",
+ "debugger",
+ "difflib",
+ "fcntl",
+ "io",
+ "lang",
+ "math",
+ "pprint",
+ "shell",
+ "unittest"
+ ],
+ "summary": "Python framework for running examples in docstrings"
+ },
+ "email": {
+ "files": [
+ "${libdir}/python2.7/email",
+ "${libdir}/python2.7/imaplib.py"
+ ],
+ "rdepends": [
+ "contextlib",
+ "core",
+ "crypt",
+ "fcntl",
+ "io",
+ "lang",
+ "math",
+ "netclient",
+ "pickle",
+ "subprocess",
+ "textutils"
+ ],
+ "summary": "Python email support"
+ },
+ "fcntl": {
+ "files": [
+ "${libdir}/python2.7/lib-dynload/fcntl.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python's fcntl interface"
+ },
+ "gdbm": {
+ "files": [
+ "${libdir}/python2.7/lib-dynload/gdbm.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python GNU database support"
+ },
+ "hotshot": {
+ "files": [
+ "${libdir}/python2.7/hotshot",
+ "${libdir}/python2.7/lib-dynload/_hotshot.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python hotshot performance profiler"
+ },
+ "html": {
+ "files": [
+ "${libdir}/python2.7/HTMLParser.py",
+ "${libdir}/python2.7/formatter.py",
+ "${libdir}/python2.7/htmlentitydefs.py",
+ "${libdir}/python2.7/htmllib.py",
+ "${libdir}/python2.7/markupbase.py",
+ "${libdir}/python2.7/sgmllib.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python HTML processing support"
+ },
+ "idle": {
+ "files": [
+ "${bindir}/idle",
+ "${libdir}/python2.7/idlelib"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python Integrated Development Environment"
+ },
+ "image": {
+ "files": [
+ "${libdir}/python2.7/colorsys.py",
+ "${libdir}/python2.7/imghdr.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python graphical image handling"
+ },
+ "io": {
+ "files": [
+ "${libdir}/python2.7/StringIO.py",
+ "${libdir}/python2.7/_pyio.py",
+ "${libdir}/python2.7/io.py",
+ "${libdir}/python2.7/lib-dynload/_io.so",
+ "${libdir}/python2.7/lib-dynload/_socket.so",
+ "${libdir}/python2.7/lib-dynload/_ssl.so",
+ "${libdir}/python2.7/lib-dynload/cStringIO.so",
+ "${libdir}/python2.7/lib-dynload/select.so",
+ "${libdir}/python2.7/lib-dynload/termios.so",
+ "${libdir}/python2.7/pipes.py",
+ "${libdir}/python2.7/socket.py",
+ "${libdir}/python2.7/ssl.py",
+ "${libdir}/python2.7/tempfile.py"
+ ],
+ "rdepends": [
+ "contextlib",
+ "core",
+ "crypt",
+ "fcntl",
+ "lang",
+ "math",
+ "netclient",
+ "textutils"
+ ],
+ "summary": "Python low-level I/O"
+ },
+ "json": {
+ "files": [
+ "${libdir}/python2.7/json",
+ "${libdir}/python2.7/lib-dynload/_json.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python JSON support"
+ },
+ "lang": {
+ "files": [
+ "${libdir}/python2.7/bisect.py",
+ "${libdir}/python2.7/code.py",
+ "${libdir}/python2.7/codeop.py",
+ "${libdir}/python2.7/dis.py",
+ "${libdir}/python2.7/functools.py",
+ "${libdir}/python2.7/inspect.py",
+ "${libdir}/python2.7/lib-dynload/_bisect.so",
+ "${libdir}/python2.7/lib-dynload/_functools.so",
+ "${libdir}/python2.7/lib-dynload/array.so",
+ "${libdir}/python2.7/lib-dynload/parser.so",
+ "${libdir}/python2.7/opcode.py",
+ "${libdir}/python2.7/repr.py",
+ "${libdir}/python2.7/symbol.py",
+ "${libdir}/python2.7/token.py",
+ "${libdir}/python2.7/tokenize.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python low-level language support"
+ },
+ "logging": {
+ "files": [
+ "${libdir}/python2.7/logging"
+ ],
+ "rdepends": [
+ "core",
+ "io",
+ "threading"
+ ],
+ "summary": "Python logging support"
+ },
+ "mailbox": {
+ "files": [
+ "${libdir}/python2.7/mailbox.py"
+ ],
+ "rdepends": [
+ "codecs",
+ "contextlib",
+ "core",
+ "crypt",
+ "datetime",
+ "email",
+ "fcntl",
+ "io",
+ "lang",
+ "math",
+ "mime",
+ "netclient",
+ "textutils"
+ ],
+ "summary": "Python mailbox format support"
+ },
+ "math": {
+ "files": [
+ "${libdir}/python2.7/lib-dynload/_random.so",
+ "${libdir}/python2.7/lib-dynload/cmath.so",
+ "${libdir}/python2.7/lib-dynload/math.so",
+ "${libdir}/python2.7/random.py",
+ "${libdir}/python2.7/sets.py"
+ ],
+ "rdepends": [
+ "core",
+ "crypt"
+ ],
+ "summary": "Python math support"
+ },
+ "mime": {
+ "files": [
+ "${libdir}/python2.7/MimeWriter.py",
+ "${libdir}/python2.7/mimetools.py",
+ "${libdir}/python2.7/mimetypes.py",
+ "${libdir}/python2.7/quopri.py",
+ "${libdir}/python2.7/rfc822.py",
+ "${libdir}/python2.7/uu.py"
+ ],
+ "rdepends": [
+ "contextlib",
+ "core",
+ "crypt",
+ "fcntl",
+ "io",
+ "lang",
+ "math",
+ "netclient",
+ "textutils"
+ ],
+ "summary": "Python MIME handling APIs"
+ },
+ "mmap": {
+ "files": [
+ "${libdir}/python2.7/lib-dynload/mmap.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python memory-mapped file support"
+ },
+ "modules": {
+ "files": [],
+ "rdepends": [
+ "2to3",
+ "argparse",
+ "audio",
+ "bsddb",
+ "codecs",
+ "compile",
+ "compiler",
+ "compression",
+ "contextlib",
+ "core",
+ "crypt",
+ "ctypes",
+ "curses",
+ "datetime",
+ "db",
+ "debugger",
+ "difflib",
+ "distutils",
+ "doctest",
+ "email",
+ "fcntl",
+ "gdbm",
+ "hotshot",
+ "html",
+ "idle",
+ "image",
+ "io",
+ "json",
+ "lang",
+ "logging",
+ "mailbox",
+ "math",
+ "mime",
+ "mmap",
+ "multiprocessing",
+ "netclient",
+ "netserver",
+ "numbers",
+ "pickle",
+ "pkgutil",
+ "plistlib",
+ "pprint",
+ "profile",
+ "pydoc",
+ "re",
+ "resource",
+ "robotparser",
+ "runpy",
+ "shell",
+ "smtpd",
+ "sqlite3",
+ "sqlite3",
+ "stringold",
+ "subprocess",
+ "syslog",
+ "terminal",
+ "textutils",
+ "threading",
+ "tkinter",
+ "unittest",
+ "unixadmin",
+ "xml",
+ "xmlrpc",
+ "zlib"
+ ],
+ "summary": "All Python modules"
+ },
+ "multiprocessing": {
+ "files": [
+ "${libdir}/python2.7/lib-dynload/_multiprocessing.so",
+ "${libdir}/python2.7/multiprocessing"
+ ],
+ "rdepends": [
+ "core",
+ "fcntl",
+ "io",
+ "pickle",
+ "subprocess",
+ "threading"
+ ],
+ "summary": "Python multiprocessing support"
+ },
+ "netclient": {
+ "files": [
+ "${libdir}/python2.7/Cookie.py",
+ "${libdir}/python2.7/_LWPCookieJar.py",
+ "${libdir}/python2.7/_MozillaCookieJar.py",
+ "${libdir}/python2.7/base64.py",
+ "${libdir}/python2.7/cookielib.py",
+ "${libdir}/python2.7/ftplib.py",
+ "${libdir}/python2.7/hmac.py",
+ "${libdir}/python2.7/httplib.py",
+ "${libdir}/python2.7/nntplib.py",
+ "${libdir}/python2.7/poplib.py",
+ "${libdir}/python2.7/smtplib.py",
+ "${libdir}/python2.7/telnetlib.py",
+ "${libdir}/python2.7/urllib.py",
+ "${libdir}/python2.7/urllib2.py",
+ "${libdir}/python2.7/urlparse.py",
+ "${libdir}/python2.7/uuid.py"
+ ],
+ "rdepends": [
+ "codecs",
+ "contextlib",
+ "core",
+ "crypt",
+ "ctypes",
+ "datetime",
+ "email",
+ "fcntl",
+ "io",
+ "lang",
+ "math",
+ "mime",
+ "pickle",
+ "subprocess",
+ "textutils",
+ "threading"
+ ],
+ "summary": "Python Internet Protocol clients"
+ },
+ "netserver": {
+ "files": [
+ "${libdir}/python2.7/BaseHTTPServer.py",
+ "${libdir}/python2.7/CGIHTTPServer.py",
+ "${libdir}/python2.7/SimpleHTTPServer.py",
+ "${libdir}/python2.7/SocketServer.py",
+ "${libdir}/python2.7/cgi.py"
+ ],
+ "rdepends": [
+ "compression",
+ "contextlib",
+ "core",
+ "crypt",
+ "fcntl",
+ "io",
+ "lang",
+ "math",
+ "mime",
+ "netclient",
+ "shell",
+ "textutils",
+ "threading",
+ "unixadmin",
+ "zlib"
+ ],
+ "summary": "Python Internet Protocol servers"
+ },
+ "numbers": {
+ "files": [
+ "${libdir}/python2.7/decimal.py",
+ "${libdir}/python2.7/fractions.py",
+ "${libdir}/python2.7/numbers.py"
+ ],
+ "rdepends": [
+ "codecs",
+ "core",
+ "lang",
+ "math",
+ "threading"
+ ],
+ "summary": "Python number APIs"
+ },
+ "pickle": {
+ "files": [
+ "${libdir}/python2.7/lib-dynload/cPickle.so",
+ "${libdir}/python2.7/pickle.py",
+ "${libdir}/python2.7/pickletools.py",
+ "${libdir}/python2.7/shelve.py"
+ ],
+ "rdepends": [
+ "core",
+ "io"
+ ],
+ "summary": "Python serialisation/persistence support"
+ },
+ "pkgutil": {
+ "files": [
+ "${libdir}/python2.7/pkgutil.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python package extension utility support"
+ },
+ "plistlib": {
+ "files": [
+ "${libdir}/python2.7/plistlib.py"
+ ],
+ "rdepends": [
+ "core",
+ "datetime",
+ "io"
+ ],
+ "summary": "Generate and parse Mac OS X .plist files"
+ },
+ "pprint": {
+ "files": [
+ "${libdir}/python2.7/pprint.py"
+ ],
+ "rdepends": [
+ "core",
+ "io"
+ ],
+ "summary": "Python pretty-print support"
+ },
+ "profile": {
+ "files": [
+ "${libdir}/python2.7/cProfile.py",
+ "${libdir}/python2.7/lib-dynload/_lsprof.so",
+ "${libdir}/python2.7/profile.py",
+ "${libdir}/python2.7/pstats.py"
+ ],
+ "rdepends": [
+ "codecs",
+ "core",
+ "lang",
+ "resource",
+ "textutils"
+ ],
+ "summary": "Python basic performance profiling support"
+ },
+ "pydoc": {
+ "files": [
+ "${bindir}/pydoc",
+ "${libdir}/python2.7/pydoc.py",
+ "${libdir}/python2.7/pydoc_data"
+ ],
+ "rdepends": [
+ "codecs",
+ "core",
+ "lang",
+ "pkgutil"
+ ],
+ "summary": "Python interactive help support"
+ },
+ "re": {
+ "files": [
+ "${libdir}/python2.7/sre.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python Regular Expression APIs"
+ },
+ "resource": {
+ "files": [
+ "${libdir}/python2.7/lib-dynload/resource.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python resource control interface"
+ },
+ "robotparser": {
+ "files": [
+ "${libdir}/python2.7/robotparser.py"
+ ],
+ "rdepends": [
+ "contextlib",
+ "core",
+ "io",
+ "lang",
+ "netclient",
+ "textutils"
+ ],
+ "summary": "Python robots.txt parser"
+ },
+ "runpy": {
+ "files": [
+ "${libdir}/python2.7/runpy.py"
+ ],
+ "rdepends": [
+ "core",
+ "pkgutil"
+ ],
+ "summary": "Python helper for locating/executing scripts in module namespace"
+ },
+ "shell": {
+ "files": [
+ "${libdir}/python2.7/cmd.py",
+ "${libdir}/python2.7/commands.py",
+ "${libdir}/python2.7/dircache.py",
+ "${libdir}/python2.7/fnmatch.py",
+ "${libdir}/python2.7/glob.py",
+ "${libdir}/python2.7/popen2.py",
+ "${libdir}/python2.7/shlex.py",
+ "${libdir}/python2.7/shutil.py"
+ ],
+ "rdepends": [
+ "compression",
+ "core",
+ "io",
+ "unixadmin",
+ "zlib"
+ ],
+ "summary": "Python shell-like functionality"
+ },
+ "smtpd": {
+ "files": [
+ "${bindir}/smtpd.py",
+ "${libdir}/python2.7/asynchat.py",
+ "${libdir}/python2.7/asyncore.py",
+ "${libdir}/python2.7/smtpd.py"
+ ],
+ "rdepends": [
+ "core",
+ "fcntl",
+ "io",
+ "lang"
+ ],
+ "summary": "Python Simple Mail Transport Daemon"
+ },
+ "sqlite3": {
+ "files": [
+ "${libdir}/python2.7/lib-dynload/_sqlite3.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python Sqlite3 database support"
+ },
+ "sqlite3-tests": {
+ "files": [
+ "${libdir}/python2.7/sqlite3/test"
+ ],
+ "rdepends": [
+ "core",
+ "tests"
+ ],
+ "summary": "Python Sqlite3 database support tests"
+ },
+ "stringold": {
+ "files": [
+ "${libdir}/python2.7/stringold.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python string APIs [deprecated]"
+ },
+ "subprocess": {
+ "files": [
+ "${libdir}/python2.7/subprocess.py"
+ ],
+ "rdepends": [
+ "core",
+ "fcntl",
+ "io",
+ "pickle"
+ ],
+ "summary": "Python subprocess support"
+ },
+ "syslog": {
+ "files": [
+ "${libdir}/python2.7/lib-dynload/syslog.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python syslog interface"
+ },
+ "terminal": {
+ "files": [
+ "${libdir}/python2.7/pty.py",
+ "${libdir}/python2.7/tty.py"
+ ],
+ "rdepends": [
+ "core",
+ "io"
+ ],
+ "summary": "Python terminal controlling support"
+ },
+ "tests": {
+ "files": [
+ "${libdir}/python2.7/test"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python tests"
+ },
+ "textutils": {
+ "files": [
+ "${libdir}/python2.7/csv.py",
+ "${libdir}/python2.7/lib-dynload/_csv.so",
+ "${libdir}/python2.7/optparse.py",
+ "${libdir}/python2.7/textwrap.py"
+ ],
+ "rdepends": [
+ "codecs",
+ "core",
+ "io",
+ "lang"
+ ],
+ "summary": "Python option parsin"
+ },
+ "threading": {
+ "files": [
+ "${libdir}/python2.7/Queue.py",
+ "${libdir}/python2.7/_threading_local.py",
+ "${libdir}/python2.7/dummy_thread.py",
+ "${libdir}/python2.7/dummy_threading.py",
+ "${libdir}/python2.7/mutex.py",
+ "${libdir}/python2.7/threading.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python threading & synchronization support"
+ },
+ "tkinter": {
+ "files": [
+ "${libdir}/python2.7/lib-tk"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python Tcl/Tk bindings"
+ },
+ "unittest": {
+ "files": [
+ "${libdir}/python2.7/unittest"
+ ],
+ "rdepends": [
+ "core",
+ "difflib",
+ "io",
+ "lang",
+ "pprint",
+ "shell"
+ ],
+ "summary": "Python unit testing framework"
+ },
+ "unixadmin": {
+ "files": [
+ "${libdir}/python2.7/getpass.py",
+ "${libdir}/python2.7/lib-dynload/grp.so",
+ "${libdir}/python2.7/lib-dynload/nis.so"
+ ],
+ "rdepends": [
+ "core",
+ "io"
+ ],
+ "summary": "Python Unix administration support"
+ },
+ "xml": {
+ "files": [
+ "${libdir}/python2.7/lib-dynload/_elementtree.so",
+ "${libdir}/python2.7/lib-dynload/pyexpat.so",
+ "${libdir}/python2.7/xml"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python basic XML support"
+ },
+ "xmlrpc": {
+ "files": [
+ "${libdir}/python2.7/DocXMLRPCServer.py",
+ "${libdir}/python2.7/SimpleXMLRPCServer.py"
+ ],
+ "rdepends": [
+ "codecs",
+ "compression",
+ "contextlib",
+ "core",
+ "crypt",
+ "datetime",
+ "fcntl",
+ "io",
+ "lang",
+ "math",
+ "mime",
+ "netclient",
+ "netserver",
+ "pkgutil",
+ "pydoc",
+ "textutils",
+ "threading",
+ "xml",
+ "zlib"
+ ],
+ "summary": "Python XML-RPC support"
+ },
+ "zlib": {
+ "files": [
+ "${libdir}/python2.7/lib-dynload/zlib.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python zlib compression support"
+ }
+}
diff --git a/poky/meta/recipes-devtools/python/python/run-ptest b/poky/meta/recipes-devtools/python/python/run-ptest
new file mode 100644
index 000000000..a2f9eed44
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/run-ptest
@@ -0,0 +1,5 @@
+#!/bin/sh
+#
+#This script is used to run python test suites
+
+make -f LIBDIR/python/ptest/Makefile -k runtest-TESTS srcdir=LIBDIR/python2.7 TESTPROG=LIBDIR/python2.7/test/regrtest.py | sed -e '/\.\.\. ok/ s/^/PASS: /g' -e '/\.\.\. [ERROR|FAIL]/ s/^/FAIL: /g' -e '/\.\.\. skipped/ s/^/SKIP: /g' -e 's/ \.\.\. ok//g' -e 's/ \.\.\. ERROR//g' -e 's/ \.\.\. FAIL//g' -e 's/ \.\.\. skipped//g'
diff --git a/poky/meta/recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch b/poky/meta/recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch
new file mode 100644
index 000000000..dacb552ec
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch
@@ -0,0 +1,35 @@
+python should search for db.h in inc_dirs and not in a hardcoded path.
+If db.h is found but HASHVERSION is not 2 we avoid a warning by not
+adding this module to missing variable.
+
+Upstream-Status: Inappropriate [distribution]
+
+Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
+
+
+diff --git a/setup.py b/setup.py
+index b887808..ae51607 100644
+--- a/setup.py
++++ b/setup.py
+@@ -1237,6 +1237,8 @@ class PyBuildExt(build_ext):
+ # the more recent berkeleydb's db.h file first in the include path
+ # when attempting to compile and it will fail.
+ f = "/usr/include/db.h"
++ if len(inc_dirs) != 0:
++ f = os.path.join(inc_dirs[0], "db.h")
+
+ if host_platform == 'darwin':
+ if is_macosx_sdk_path(f):
+@@ -1257,8 +1259,10 @@ class PyBuildExt(build_ext):
+ libraries=libraries))
+ else:
+ exts.append(Extension('bsddb185', ['bsddbmodule.c']))
+- else:
+- missing.append('bsddb185')
++ # If a newer version is detected don't report an useless
++ # warning
++ #else:
++ # missing.append('bsddb185')
+ else:
+ missing.append('bsddb185')
+
diff --git a/poky/meta/recipes-devtools/python/python/setup_py_skip_cross_import_check.patch b/poky/meta/recipes-devtools/python/python/setup_py_skip_cross_import_check.patch
new file mode 100644
index 000000000..6ccdb948b
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/setup_py_skip_cross_import_check.patch
@@ -0,0 +1,27 @@
+This patch skips over the 'import check' setup.py does when building
+extensions. This generally won't work when cross-compiling.
+
+Upstream-Status: Inappropriate [embedded-specific]
+
+Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
+
+Index: Python-2.7.2/setup.py
+===================================================================
+--- Python-2.7.2.orig/setup.py 2011-11-04 16:46:34.553796410 -0500
++++ Python-2.7.2/setup.py 2011-11-04 16:59:49.692802313 -0500
+@@ -287,6 +287,15 @@
+ (ext.name, sys.exc_info()[1]))
+ self.failed.append(ext.name)
+ return
++
++ # If we're cross-compiling, we want to skip the import check
++ # i.e. we shouldn't be dynamically loading target shared libs
++ if os.environ.get('CROSS_COMPILE') is not None:
++ self.announce(
++ 'WARNING: skipping import check for cross-compiled "%s"' %
++ ext.name)
++ return
++
+ # Workaround for Mac OS X: The Carbon-based modules cannot be
+ # reliably imported into a command-line Python
+ if 'Carbon' in ext.extra_link_args:
diff --git a/poky/meta/recipes-devtools/python/python/setuptweaks.patch b/poky/meta/recipes-devtools/python/python/setuptweaks.patch
new file mode 100644
index 000000000..3a91b1916
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/setuptweaks.patch
@@ -0,0 +1,57 @@
+This patch removes various ways native system options can pass into the python
+compilation and somehow break C modules.
+
+Upstream-Status: Inappropriate [OE Specific]
+
+RP 2012/04/23
+
+Index: Python-2.7.2/setup.py
+===================================================================
+--- Python-2.7.2.orig/setup.py 2012-04-23 20:03:47.295582553 +0000
++++ Python-2.7.2/setup.py 2012-04-23 20:03:15.000000000 +0000
+@@ -231,7 +231,13 @@
+ # compilers
+ if compiler is not None:
+ (ccshared,cflags) = sysconfig.get_config_vars('CCSHARED','CFLAGS')
+- args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags
++ # Need to filter out -isysroot from the flags. Ideally should
++ # figure out target flags here.
++ flags = []
++ for f in cflags.split():
++ if not f.startswith("-isystem"):
++ flags.append(f)
++ args['compiler_so'] = compiler + ' ' + ccshared + ' ' + ' '.join(flags)
+ self.compiler.set_executables(**args)
+
+ build_ext.build_extensions(self)
+@@ -393,7 +399,6 @@
+ # into configure and stored in the Makefile (issue found on OS X 10.3).
+ for env_var, arg_name, dir_list in (
+ ('LDFLAGS', '-R', self.compiler.runtime_library_dirs),
+- ('LDFLAGS', '-L', self.compiler.library_dirs),
+ ('CPPFLAGS', '-I', self.compiler.include_dirs)):
+ env_val = sysconfig.get_config_var(env_var)
+ if env_val:
+@@ -419,16 +424,16 @@
+ for directory in reversed(options.dirs):
+ add_dir_to_list(dir_list, directory)
+
+- if os.path.normpath(sys.prefix) != '/usr' \
+- and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
++# if os.path.normpath(sys.prefix) != '/usr' \
++# and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
+ # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
+ # (PYTHONFRAMEWORK is set) to avoid # linking problems when
+ # building a framework with different architectures than
+ # the one that is currently installed (issue #7473)
+- add_dir_to_list(self.compiler.library_dirs,
+- sysconfig.get_config_var("LIBDIR"))
+- add_dir_to_list(self.compiler.include_dirs,
+- sysconfig.get_config_var("INCLUDEDIR"))
++# add_dir_to_list(self.compiler.library_dirs,
++# sysconfig.get_config_var("LIBDIR"))
++# add_dir_to_list(self.compiler.include_dirs,
++# sysconfig.get_config_var("INCLUDEDIR"))
+
+ try:
+ have_unicode = unicode
diff --git a/poky/meta/recipes-devtools/python/python/sitecustomize.py b/poky/meta/recipes-devtools/python/python/sitecustomize.py
new file mode 100644
index 000000000..4c8b5e2ba
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/sitecustomize.py
@@ -0,0 +1,37 @@
+# OpenEmbedded sitecustomize.py (C) 2002-2008 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
+# GPLv2 or later
+# Version: 20081123
+# Features:
+# * set proper default encoding
+# * enable readline completion in the interactive interpreter
+# * load command line history on startup
+# * save command line history on exit
+
+import os
+
+def __exithandler():
+ try:
+ readline.write_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) )
+ except IOError:
+ pass
+
+def __registerExitHandler():
+ import atexit
+ atexit.register( __exithandler )
+
+def __enableReadlineSupport():
+ readline.set_history_length( 1000 )
+ readline.parse_and_bind( "tab: complete" )
+ try:
+ readline.read_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) )
+ except IOError:
+ pass
+
+import sys
+try:
+ import rlcompleter, readline
+except ImportError:
+ pass
+else:
+ __registerExitHandler()
+ __enableReadlineSupport()
diff --git a/poky/meta/recipes-devtools/python/python/support_SOURCE_DATE_EPOCH_in_py_compile_2.7.patch b/poky/meta/recipes-devtools/python/python/support_SOURCE_DATE_EPOCH_in_py_compile_2.7.patch
new file mode 100644
index 000000000..12651798e
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/support_SOURCE_DATE_EPOCH_in_py_compile_2.7.patch
@@ -0,0 +1,34 @@
+The compiled .pyc files contain time stamp corresponding to the compile time.
+This prevents binary reproducibility. This patch allows to achieve binary
+reproducibility by overriding the build time stamp by the value
+exported via SOURCE_DATE_EPOCH.
+
+Patch by Bernhard M. Wiedemann
+
+Upstream-Status: Backport
+
+Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
+
+Fri Feb 24 17:08:25 UTC 2017 - bwiedemann@suse.com
+
+- Add reproducible.patch to allow reproducible builds of various
+ python packages like python-amqp
+ Upstream: https://github.com/python/cpython/pull/296
+
+
+@@ -0,0 +1,15 @@
+Index: Python-2.7.13/Lib/py_compile.py
+===================================================================
+--- Python-2.7.13.orig/Lib/py_compile.py
++++ Python-2.7.13/Lib/py_compile.py
+@@ -108,6 +108,10 @@ def compile(file, cfile=None, dfile=None
+ timestamp = long(os.fstat(f.fileno()).st_mtime)
+ except AttributeError:
+ timestamp = long(os.stat(file).st_mtime)
++ sde = os.environ.get('SOURCE_DATE_EPOCH')
++ if sde and timestamp > int(sde):
++ timestamp = int(sde)
++ os.utime(file, (timestamp, timestamp))
+ codestring = f.read()
+ try:
+ codeobject = __builtin__.compile(codestring, dfile or file,'exec')
diff --git a/poky/meta/recipes-devtools/python/python/use_sysroot_ncurses_instead_of_host.patch b/poky/meta/recipes-devtools/python/python/use_sysroot_ncurses_instead_of_host.patch
new file mode 100644
index 000000000..fb4a3bcf9
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python/use_sysroot_ncurses_instead_of_host.patch
@@ -0,0 +1,21 @@
+Python tries to use ncursesw from the host,
+if it is not found causes an error on configure,
+we should use ncursesw from sysroot instead
+
+Upstream-Status: Pending
+
+Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+Index: Python-2.7.9/configure.ac
+===================================================================
+--- Python-2.7.9.orig/configure.ac
++++ Python-2.7.9/configure.ac
+@@ -4311,7 +4311,7 @@ fi
+
+ # first curses configure check
+ ac_save_cppflags="$CPPFLAGS"
+-CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
++CPPFLAGS="$CPPFLAGS -I=/usr/include/ncursesw"
+
+ AC_CHECK_HEADERS(curses.h ncurses.h)
+
diff --git a/poky/meta/recipes-devtools/python/python3-async_0.6.2.bb b/poky/meta/recipes-devtools/python/python3-async_0.6.2.bb
new file mode 100644
index 000000000..0da5fdecd
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3-async_0.6.2.bb
@@ -0,0 +1,2 @@
+inherit setuptools3
+require python-async.inc
diff --git a/poky/meta/recipes-devtools/python/python3-dbus_1.2.6.bb b/poky/meta/recipes-devtools/python/python3-dbus_1.2.6.bb
new file mode 100644
index 000000000..19cbae91a
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3-dbus_1.2.6.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Python bindings for the DBus inter-process communication system"
+SECTION = "devel/python"
+HOMEPAGE = "http://www.freedesktop.org/Software/dbus"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b03240518994df6d8c974675675e5ca4"
+DEPENDS = "expat dbus dbus-glib virtual/libintl"
+
+SRC_URI = "http://dbus.freedesktop.org/releases/dbus-python/dbus-python-${PV}.tar.gz \
+"
+
+RSRC_URI[md5sum] = "1ce1ddf2582060f8f971652ea54cc17e"
+SRC_URI[sha256sum] = "32f29c17172cdb9cb61c68b1f1a71dfe7351506fc830869029c47449bd04faeb"
+S = "${WORKDIR}/dbus-python-${PV}"
+
+inherit distutils3-base autotools pkgconfig
+
+PACKAGECONFIG ?= ""
+PACKAGECONFIG[docs] = "--enable-html-docs,--disable-html-docs,python3-docutils-native"
+PACKAGECONFIG[api-docs] = "--enable-api-docs,--disable-api-docs,python3-docutils-native python3-epydoc-native"
+
+RDEPENDS_${PN} = "python3-io python3-logging python3-stringold python3-threading python3-xml"
+
+FILES_${PN}-dev += "${libdir}/pkgconfig"
diff --git a/poky/meta/recipes-devtools/python/python3-docutils_0.14.bb b/poky/meta/recipes-devtools/python/python3-docutils_0.14.bb
new file mode 100644
index 000000000..81a449d64
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3-docutils_0.14.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Text processing system for documentation"
+HOMEPAGE = "http://docutils.sourceforge.net"
+SECTION = "devel/python"
+LICENSE = "PSF & BSD-2-Clause & GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING.txt;md5=35a23d42b615470583563132872c97d6"
+
+DEPENDS = "python3"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/docutils/docutils-${PV}.tar.gz"
+SRC_URI[md5sum] = "c53768d63db3873b7d452833553469de"
+SRC_URI[sha256sum] = "51e64ef2ebfb29cae1faa133b3710143496eca21c530f3f71424d77687764274"
+
+S = "${WORKDIR}/docutils-${PV}"
+
+inherit distutils3
+
+BBCLASSEXTEND = "native"
+
diff --git a/poky/meta/recipes-devtools/python/python3-git_2.1.8.bb b/poky/meta/recipes-devtools/python/python3-git_2.1.8.bb
new file mode 100644
index 000000000..ac320fa56
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3-git_2.1.8.bb
@@ -0,0 +1,2 @@
+require python-git.inc
+inherit setuptools3
diff --git a/poky/meta/recipes-devtools/python/python3-gitdb_2.0.3.bb b/poky/meta/recipes-devtools/python/python3-gitdb_2.0.3.bb
new file mode 100644
index 000000000..fe158327c
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3-gitdb_2.0.3.bb
@@ -0,0 +1,2 @@
+inherit setuptools3
+require python-gitdb.inc
diff --git a/poky/meta/recipes-devtools/python/python3-iniparse/0001-Add-python-3-compatibility.patch b/poky/meta/recipes-devtools/python/python3-iniparse/0001-Add-python-3-compatibility.patch
new file mode 100644
index 000000000..44090a20d
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3-iniparse/0001-Add-python-3-compatibility.patch
@@ -0,0 +1,552 @@
+From 8a98e4d44a5e59439a4b6bd95368cc362412c995 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 24 Mar 2017 18:06:08 +0200
+Subject: [PATCH] Add python 3 compatibility.
+
+Taken from
+http://pkgs.fedoraproject.org/cgit/rpms/python-iniparse.git/tree/python-iniparse-python3-compat.patch
+
+Upstream-Status: Inappropriate [upstream is defunct]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ iniparse/__init__.py | 20 ++++++++++----------
+ iniparse/compat.py | 30 ++++++++++++++++--------------
+ iniparse/config.py | 16 ++++++++--------
+ iniparse/configparser.py | 7 +++++++
+ iniparse/ini.py | 20 ++++++++++++--------
+ iniparse/utils.py | 4 ++--
+ tests/__init__.py | 14 +++++++-------
+ tests/test_compat.py | 23 +++++++++++++++--------
+ tests/test_fuzz.py | 18 +++++++++---------
+ tests/test_ini.py | 8 ++++----
+ tests/test_misc.py | 4 ++--
+ tests/test_tidy.py | 2 +-
+ tests/test_unicode.py | 10 +++++-----
+ 13 files changed, 98 insertions(+), 78 deletions(-)
+ create mode 100644 iniparse/configparser.py
+
+diff --git a/iniparse/__init__.py b/iniparse/__init__.py
+index 8de756f..7193f92 100644
+--- a/iniparse/__init__.py
++++ b/iniparse/__init__.py
+@@ -3,17 +3,17 @@
+ # Copyright (c) 2007 Tim Lauridsen <tla@rasmil.dk>
+ # All Rights Reserved. See LICENSE-PSF & LICENSE for details.
+
+-from ini import INIConfig, change_comment_syntax
+-from config import BasicConfig, ConfigNamespace
+-from compat import RawConfigParser, ConfigParser, SafeConfigParser
+-from utils import tidy
++from .ini import INIConfig, change_comment_syntax
++from .config import BasicConfig, ConfigNamespace
++from .compat import RawConfigParser, ConfigParser, SafeConfigParser
++from .utils import tidy
+
+-from ConfigParser import DuplicateSectionError, \
+- NoSectionError, NoOptionError, \
+- InterpolationMissingOptionError, \
+- InterpolationDepthError, \
+- InterpolationSyntaxError, \
+- DEFAULTSECT, MAX_INTERPOLATION_DEPTH
++from .configparser import DuplicateSectionError, \
++ NoSectionError, NoOptionError, \
++ InterpolationMissingOptionError, \
++ InterpolationDepthError, \
++ InterpolationSyntaxError, \
++ DEFAULTSECT, MAX_INTERPOLATION_DEPTH
+
+ __all__ = [
+ 'BasicConfig', 'ConfigNamespace',
+diff --git a/iniparse/compat.py b/iniparse/compat.py
+index db89ed8..f95c25c 100644
+--- a/iniparse/compat.py
++++ b/iniparse/compat.py
+@@ -12,19 +12,21 @@ The underlying INIConfig object can be accessed as cfg.data
+ """
+
+ import re
+-from ConfigParser import DuplicateSectionError, \
+- NoSectionError, NoOptionError, \
+- InterpolationMissingOptionError, \
+- InterpolationDepthError, \
+- InterpolationSyntaxError, \
+- DEFAULTSECT, MAX_INTERPOLATION_DEPTH
++from .configparser import DuplicateSectionError, \
++ NoSectionError, NoOptionError, \
++ InterpolationMissingOptionError, \
++ InterpolationDepthError, \
++ InterpolationSyntaxError, \
++ DEFAULTSECT, MAX_INTERPOLATION_DEPTH
+
+ # These are imported only for compatiability.
+ # The code below does not reference them directly.
+-from ConfigParser import Error, InterpolationError, \
+- MissingSectionHeaderError, ParsingError
++from .configparser import Error, InterpolationError, \
++ MissingSectionHeaderError, ParsingError
+
+-import ini
++import six
++
++from . import ini
+
+ class RawConfigParser(object):
+ def __init__(self, defaults=None, dict_type=dict):
+@@ -56,7 +58,7 @@ class RawConfigParser(object):
+ # The default section is the only one that gets the case-insensitive
+ # treatment - so it is special-cased here.
+ if section.lower() == "default":
+- raise ValueError, 'Invalid section name: %s' % section
++ raise ValueError('Invalid section name: %s' % section)
+
+ if self.has_section(section):
+ raise DuplicateSectionError(section)
+@@ -88,7 +90,7 @@ class RawConfigParser(object):
+ filename may also be given.
+ """
+ files_read = []
+- if isinstance(filenames, basestring):
++ if isinstance(filenames, six.string_types):
+ filenames = [filenames]
+ for filename in filenames:
+ try:
+@@ -143,7 +145,7 @@ class RawConfigParser(object):
+ def getboolean(self, section, option):
+ v = self.get(section, option)
+ if v.lower() not in self._boolean_states:
+- raise ValueError, 'Not a boolean: %s' % v
++ raise ValueError('Not a boolean: %s' % v)
+ return self._boolean_states[v.lower()]
+
+ def has_option(self, section, option):
+@@ -234,7 +236,7 @@ class ConfigParser(RawConfigParser):
+ if "%(" in value:
+ try:
+ value = value % vars
+- except KeyError, e:
++ except KeyError as e:
+ raise InterpolationMissingOptionError(
+ option, section, rawval, e.args[0])
+ else:
+@@ -283,7 +285,7 @@ class SafeConfigParser(ConfigParser):
+ _badpercent_re = re.compile(r"%[^%]|%$")
+
+ def set(self, section, option, value):
+- if not isinstance(value, basestring):
++ if not isinstance(value, six.string_types):
+ raise TypeError("option values must be strings")
+ # check for bad percent signs:
+ # first, replace all "good" interpolations
+diff --git a/iniparse/config.py b/iniparse/config.py
+index 5cfa2ea..3b28549 100644
+--- a/iniparse/config.py
++++ b/iniparse/config.py
+@@ -143,7 +143,7 @@ class BasicConfig(ConfigNamespace):
+
+ >>> n.aaa = 42
+ >>> del n.x
+- >>> print n
++ >>> print(n)
+ aaa = 42
+ name.first = paramjit
+ name.last = oberoi
+@@ -152,7 +152,7 @@ class BasicConfig(ConfigNamespace):
+
+ >>> isinstance(n.name, ConfigNamespace)
+ True
+- >>> print n.name
++ >>> print(n.name)
+ first = paramjit
+ last = oberoi
+ >>> sorted(list(n.name))
+@@ -160,7 +160,7 @@ class BasicConfig(ConfigNamespace):
+
+ Finally, values can be read from a file as follows:
+
+- >>> from StringIO import StringIO
++ >>> from six import StringIO
+ >>> sio = StringIO('''
+ ... # comment
+ ... ui.height = 100
+@@ -171,7 +171,7 @@ class BasicConfig(ConfigNamespace):
+ ... ''')
+ >>> n = BasicConfig()
+ >>> n._readfp(sio)
+- >>> print n
++ >>> print(n)
+ complexity = medium
+ data.secret.password = goodness=gracious me
+ have_python
+@@ -199,7 +199,7 @@ class BasicConfig(ConfigNamespace):
+
+ def __str__(self, prefix=''):
+ lines = []
+- keys = self._data.keys()
++ keys = list(self._data.keys())
+ keys.sort()
+ for name in keys:
+ value = self._data[name]
+@@ -258,7 +258,7 @@ def update_config(target, source):
+ >>> n.ui.display_clock = True
+ >>> n.ui.display_qlength = True
+ >>> n.ui.width = 150
+- >>> print n
++ >>> print(n)
+ playlist.expand_playlist = True
+ ui.display_clock = True
+ ui.display_qlength = True
+@@ -267,7 +267,7 @@ def update_config(target, source):
+ >>> from iniparse import ini
+ >>> i = ini.INIConfig()
+ >>> update_config(i, n)
+- >>> print i
++ >>> print(i)
+ [playlist]
+ expand_playlist = True
+ <BLANKLINE>
+@@ -277,7 +277,7 @@ def update_config(target, source):
+ width = 150
+
+ """
+- for name in source:
++ for name in sorted(source):
+ value = source[name]
+ if isinstance(value, ConfigNamespace):
+ if name in target:
+diff --git a/iniparse/configparser.py b/iniparse/configparser.py
+new file mode 100644
+index 0000000..c543d50
+--- /dev/null
++++ b/iniparse/configparser.py
+@@ -0,0 +1,7 @@
++try:
++ from ConfigParser import *
++ # not all objects get imported with __all__
++ from ConfigParser import Error, InterpolationMissingOptionError
++except ImportError:
++ from configparser import *
++ from configparser import Error, InterpolationMissingOptionError
+diff --git a/iniparse/ini.py b/iniparse/ini.py
+index 408354d..052d9e9 100644
+--- a/iniparse/ini.py
++++ b/iniparse/ini.py
+@@ -7,7 +7,7 @@
+
+ Example:
+
+- >>> from StringIO import StringIO
++ >>> from six import StringIO
+ >>> sio = StringIO('''# configure foo-application
+ ... [foo]
+ ... bar1 = qualia
+@@ -16,14 +16,14 @@ Example:
+ ... special = 1''')
+
+ >>> cfg = INIConfig(sio)
+- >>> print cfg.foo.bar1
++ >>> print(cfg.foo.bar1)
+ qualia
+- >>> print cfg['foo-ext'].special
++ >>> print(cfg['foo-ext'].special)
+ 1
+ >>> cfg.foo.newopt = 'hi!'
+ >>> cfg.baz.enabled = 0
+
+- >>> print cfg
++ >>> print(cfg)
+ # configure foo-application
+ [foo]
+ bar1 = qualia
+@@ -42,9 +42,11 @@ Example:
+ # Backward-compatiable with ConfigParser
+
+ import re
+-from ConfigParser import DEFAULTSECT, ParsingError, MissingSectionHeaderError
++from .configparser import DEFAULTSECT, ParsingError, MissingSectionHeaderError
+
+-import config
++import six
++
++from . import config
+
+ class LineType(object):
+ line = None
+@@ -278,6 +280,8 @@ class LineContainer(object):
+ value = property(get_value, set_value)
+
+ def __str__(self):
++ for c in self.contents:
++ pass#print(c.__str__())
+ s = [x.__str__() for x in self.contents]
+ return '\n'.join(s)
+
+@@ -465,7 +469,7 @@ class INIConfig(config.ConfigNamespace):
+ self._sections = {}
+ if defaults is None: defaults = {}
+ self._defaults = INISection(LineContainer(), optionxformsource=self)
+- for name, value in defaults.iteritems():
++ for name, value in defaults.items():
+ self._defaults[name] = value
+ if fp is not None:
+ self._readfp(fp)
+@@ -551,7 +555,7 @@ class INIConfig(config.ConfigNamespace):
+
+ for line in readline_iterator(fp):
+ # Check for BOM on first line
+- if linecount == 0 and isinstance(line, unicode):
++ if linecount == 0 and isinstance(line, six.text_type):
+ if line[0] == u'\ufeff':
+ line = line[1:]
+ self._bom = True
+diff --git a/iniparse/utils.py b/iniparse/utils.py
+index 829fc28..f8b773a 100644
+--- a/iniparse/utils.py
++++ b/iniparse/utils.py
+@@ -1,5 +1,5 @@
+-import compat
+-from ini import LineContainer, EmptyLine
++from . import compat
++from .ini import LineContainer, EmptyLine
+
+ def tidy(cfg):
+ """Clean up blank lines.
+diff --git a/tests/__init__.py b/tests/__init__.py
+index f1fa321..88689fb 100644
+--- a/tests/__init__.py
++++ b/tests/__init__.py
+@@ -1,12 +1,12 @@
+ import unittest, doctest
+
+-import test_ini
+-import test_misc
+-import test_fuzz
+-import test_compat
+-import test_unicode
+-import test_tidy
+-import test_multiprocessing
++from . import test_ini
++from . import test_misc
++from . import test_fuzz
++from . import test_compat
++from . import test_unicode
++from . import test_tidy
++from . import test_multiprocessing
+ from iniparse import config
+ from iniparse import ini
+
+diff --git a/tests/test_compat.py b/tests/test_compat.py
+index b8da3d5..b6dfb5c 100644
+--- a/tests/test_compat.py
++++ b/tests/test_compat.py
+@@ -1,9 +1,16 @@
+ from iniparse import compat as ConfigParser
+-import StringIO
++from six import StringIO
++try:
++ import UserDict
++except ImportError:
++ import collections as UserDict
+ import unittest
+-import UserDict
+
+-from test import test_support
++import sys
++if sys.version_info[0] < 3:
++ from test import test_support
++else:
++ from test import support as test_support
+
+ class SortedDict(UserDict.UserDict):
+ def items(self):
+@@ -35,7 +42,7 @@ class TestCaseBase(unittest.TestCase):
+
+ def fromstring(self, string, defaults=None):
+ cf = self.newconfig(defaults)
+- sio = StringIO.StringIO(string)
++ sio = StringIO(string)
+ cf.readfp(sio)
+ return cf
+
+@@ -161,7 +168,7 @@ class TestCaseBase(unittest.TestCase):
+ "No Section!\n")
+
+ def parse_error(self, exc, src):
+- sio = StringIO.StringIO(src)
++ sio = StringIO(src)
+ self.assertRaises(exc, self.cf.readfp, sio)
+
+ def test_query_errors(self):
+@@ -181,7 +188,7 @@ class TestCaseBase(unittest.TestCase):
+ def get_error(self, exc, section, option):
+ try:
+ self.cf.get(section, option)
+- except exc, e:
++ except exc as e:
+ return e
+ else:
+ self.fail("expected exception type %s.%s"
+@@ -227,7 +234,7 @@ class TestCaseBase(unittest.TestCase):
+ "foo: another very\n"
+ " long line"
+ )
+- output = StringIO.StringIO()
++ output = StringIO()
+ cf.write(output)
+ self.assertEqual(
+ output.getvalue(),
+@@ -465,7 +472,7 @@ class SortedTestCase(RawConfigParserTestCase):
+ "o1=4\n"
+ "[a]\n"
+ "k=v\n")
+- output = StringIO.StringIO()
++ output = StringIO()
+ self.cf.write(output)
+ self.assertEquals(output.getvalue(),
+ "[a]\n"
+diff --git a/tests/test_fuzz.py b/tests/test_fuzz.py
+index 5420dcc..b219500 100644
+--- a/tests/test_fuzz.py
++++ b/tests/test_fuzz.py
+@@ -1,9 +1,10 @@
+ import re
+ import os
+ import random
++import sys
+ import unittest
+-import ConfigParser
+-from StringIO import StringIO
++from six import StringIO
++from six.moves import configparser
+ from iniparse import compat, ini, tidy
+
+ # TODO:
+@@ -96,24 +97,25 @@ class test_fuzz(unittest.TestCase):
+ s = '\n'.join(good_lines)
+ cc = compat.RawConfigParser()
+ cc.readfp(StringIO(s))
+- cc_py = ConfigParser.RawConfigParser()
++ cc_py = configparser.RawConfigParser()
+ cc_py.readfp(StringIO(s))
+ # compare the two configparsers
+ self.assertEqualConfig(cc_py, cc)
+ # check that tidy does not change semantics
+ tidy(cc)
+- cc_tidy = ConfigParser.RawConfigParser()
++ cc_tidy = configparser.RawConfigParser()
+ cc_tidy.readfp(StringIO(str(cc.data)))
+ self.assertEqualConfig(cc_py, cc_tidy)
+ except AssertionError:
+ fname = 'fuzz-test-iter-%d.ini' % fuzz_iter
+- print 'Fuzz test failed at iteration', fuzz_iter
+- print 'Writing out failing INI file as', fname
++ print('Fuzz test failed at iteration', fuzz_iter)
++ print('Writing out failing INI file as', fname)
+ f = open(fname, 'w')
+ f.write(s)
+ f.close()
+ raise
+
++ @unittest.skipIf(sys.version_info[0] > 2, 'http://code.google.com/p/iniparse/issues/detail?id=22#c9')
+ def assertEqualConfig(self, c1, c2):
+ self.assertEqualSorted(c1.sections(), c2.sections())
+ self.assertEqualSorted(c1.defaults().items(), c2.defaults().items())
+@@ -123,9 +125,7 @@ class test_fuzz(unittest.TestCase):
+ self.assertEqual(c1.get(sec, opt), c2.get(sec, opt))
+
+ def assertEqualSorted(self, l1, l2):
+- l1.sort()
+- l2.sort()
+- self.assertEqual(l1, l2)
++ self.assertEqual(sorted(l1), sorted(l2))
+
+ class suite(unittest.TestSuite):
+ def __init__(self):
+diff --git a/tests/test_ini.py b/tests/test_ini.py
+index 6a76edb..07d4f4e 100644
+--- a/tests/test_ini.py
++++ b/tests/test_ini.py
+@@ -1,5 +1,5 @@
+ import unittest
+-from StringIO import StringIO
++from six import StringIO
+
+ from iniparse import ini
+ from iniparse import compat
+@@ -196,13 +196,13 @@ but = also me
+ self.assertEqual(p._data.find('section2').find('just').value, 'kidding')
+
+ itr = p._data.finditer('section1')
+- v = itr.next()
++ v = next(itr)
+ self.assertEqual(v.find('help').value, 'yourself')
+ self.assertEqual(v.find('but').value, 'also me')
+- v = itr.next()
++ v = next(itr)
+ self.assertEqual(v.find('help').value, 'me')
+ self.assertEqual(v.find('I\'m').value, 'desperate')
+- self.assertRaises(StopIteration, itr.next)
++ self.assertRaises(StopIteration, next, itr)
+
+ self.assertRaises(KeyError, p._data.find, 'section')
+ self.assertRaises(KeyError, p._data.find('section2').find, 'ahem')
+diff --git a/tests/test_misc.py b/tests/test_misc.py
+index 31cf4da..96ef035 100644
+--- a/tests/test_misc.py
++++ b/tests/test_misc.py
+@@ -1,9 +1,9 @@
+ import re
+ import unittest
+ import pickle
+-import ConfigParser
++from six.moves import configparser
++from six import StringIO
+ from textwrap import dedent
+-from StringIO import StringIO
+ from iniparse import compat, ini
+
+ class CaseSensitiveConfigParser(compat.ConfigParser):
+diff --git a/tests/test_tidy.py b/tests/test_tidy.py
+index 7304747..26b6cde 100644
+--- a/tests/test_tidy.py
++++ b/tests/test_tidy.py
+@@ -1,6 +1,6 @@
+ import unittest
+ from textwrap import dedent
+-from StringIO import StringIO
++from six import StringIO
+
+ from iniparse import tidy,INIConfig
+ from iniparse.ini import EmptyLine
+diff --git a/tests/test_unicode.py b/tests/test_unicode.py
+index a56fcab..14d4fbd 100644
+--- a/tests/test_unicode.py
++++ b/tests/test_unicode.py
+@@ -1,5 +1,5 @@
+ import unittest
+-from StringIO import StringIO
++import six
+ from iniparse import compat, ini
+
+ class test_unicode(unittest.TestCase):
+@@ -17,14 +17,14 @@ baz = Marc-Andr\202
+ """
+
+ def basic_tests(self, s, strable):
+- f = StringIO(s)
++ f = six.StringIO(s)
+ i = ini.INIConfig(f)
+- self.assertEqual(unicode(i), s)
+- self.assertEqual(type(i.foo.bar), unicode)
++ self.assertEqual(six.text_type(i), s)
++ self.assertEqual(type(i.foo.bar), six.text_type)
+ if strable:
+ self.assertEqual(str(i), str(s))
+ else:
+- self.assertRaises(UnicodeEncodeError, lambda: str(i))
++ self.assertRaises(UnicodeEncodeError, lambda: six.text_type(i).encode('ascii'))
+ return i
+
+ def test_ascii(self):
+--
+2.11.0
+
diff --git a/poky/meta/recipes-devtools/python/python3-iniparse_0.4.bb b/poky/meta/recipes-devtools/python/python3-iniparse_0.4.bb
new file mode 100644
index 000000000..4eba9ecd3
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3-iniparse_0.4.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Accessing and Modifying INI files"
+HOMEPAGE = "https://pypi.python.org/pypi/iniparse/"
+LICENSE = "MIT & PSF"
+LIC_FILES_CHKSUM = "file://LICENSE-PSF;md5=1c78a5bb3584b353496d5f6f34edb4b2 \
+ file://LICENSE;md5=52f28065af11d69382693b45b5a8eb54"
+
+SRC_URI = "file://0001-Add-python-3-compatibility.patch "
+
+SRC_URI[md5sum] = "5e573e9e9733d97623881ce9bbe5eca6"
+SRC_URI[sha256sum] = "abc1ee12d2cfb2506109072d6c21e40b6c75a3fe90a9c924327d80bc0d99c054"
+
+inherit pypi distutils3
+
+RDEPENDS_${PN} += "python3-core python3-six"
+DEPENDS += "python3-six"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/python/python3-mako_1.0.7.bb b/poky/meta/recipes-devtools/python/python3-mako_1.0.7.bb
new file mode 100644
index 000000000..22ceeeb39
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3-mako_1.0.7.bb
@@ -0,0 +1,2 @@
+inherit setuptools3
+require python-mako.inc
diff --git a/poky/meta/recipes-devtools/python/python3-native_3.5.5.bb b/poky/meta/recipes-devtools/python/python3-native_3.5.5.bb
new file mode 100644
index 000000000..3098027d8
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3-native_3.5.5.bb
@@ -0,0 +1,112 @@
+require recipes-devtools/python/python.inc
+
+PR = "${INC_PR}.0"
+PYTHON_MAJMIN = "3.5"
+DISTRO_SRC_URI ?= "file://sitecustomize.py"
+DISTRO_SRC_URI_linuxstdbase = ""
+SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
+file://12-distutils-prefix-is-inside-staging-area.patch \
+file://python-config.patch \
+file://0001-cross-compile-support.patch \
+file://030-fixup-include-dirs.patch \
+file://070-dont-clean-ipkg-install.patch \
+file://080-distutils-dont_adjust_files.patch \
+file://130-readline-setup.patch \
+file://150-fix-setupterm.patch \
+file://python-3.3-multilib.patch \
+file://03-fix-tkinter-detection.patch \
+file://avoid_warning_about_tkinter.patch \
+file://shutil-follow-symlink-fix.patch \
+file://0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch \
+file://sysroot-include-headers.patch \
+file://unixccompiler.patch \
+${DISTRO_SRC_URI} \
+file://sysconfig.py-add-_PYTHON_PROJECT_SRC.patch \
+file://setup.py-check-cross_compiling-when-get-FLAGS.patch \
+file://0001-Do-not-use-the-shell-version-of-python-config-that-w.patch \
+file://support_SOURCE_DATE_EPOCH_in_py_compile.patch \
+file://regen-all.patch \
+"
+
+SRC_URI[md5sum] = "f3763edf9824d5d3a15f5f646083b6e0"
+SRC_URI[sha256sum] = "063d2c3b0402d6191b90731e0f735c64830e7522348aeb7ed382a83165d45009"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=b6ec515b22618f55fa07276b897bacea"
+
+# exclude pre-releases for both python 2.x and 3.x
+UPSTREAM_CHECK_REGEX = "[Pp]ython-(?P<pver>\d+(\.\d+)+).tar"
+
+S = "${WORKDIR}/Python-${PV}"
+
+EXTRANATIVEPATH += "bzip2-native"
+DEPENDS = "openssl-native bzip2-replacement-native zlib-native readline-native sqlite3-native gdbm-native"
+
+inherit native
+
+EXTRA_OECONF_append = " --bindir=${bindir}/${PN} --without-ensurepip"
+
+EXTRA_OEMAKE = '\
+ LIBC="" \
+ STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE} \
+ STAGING_INCDIR=${STAGING_INCDIR_NATIVE} \
+ LIB=${baselib} \
+ ARCH=${TARGET_ARCH} \
+'
+
+# No ctypes option for python 3
+PYTHONLSBOPTS = ""
+
+do_configure_append() {
+ autoreconf --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi
+ sed -i -e 's,#define HAVE_GETRANDOM 1,/\* #undef HAVE_GETRANDOM \*/,' ${B}/pyconfig.h
+}
+
+# Regenerate all of the generated files
+# This ensures that pgen and friends get created during the compile phase
+#
+do_compile_prepend() {
+ # Assuming https://bugs.python.org/issue33080 has been addressed in Makefile.
+ oe_runmake regen-all
+}
+
+do_install() {
+ install -d ${D}${libdir}/pkgconfig
+ oe_runmake 'DESTDIR=${D}' install
+ if [ -e ${WORKDIR}/sitecustomize.py ]; then
+ install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN}
+ fi
+ install -d ${D}${bindir}/${PN}
+ install -m 0755 Parser/pgen ${D}${bindir}/${PN}
+
+ # Make sure we use /usr/bin/env python
+ for PYTHSCRIPT in `grep -rIl ${bindir}/${PN}/python ${D}${bindir}/${PN}`; do
+ sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' $PYTHSCRIPT
+ done
+
+ # Add a symlink to the native Python so that scripts can just invoke
+ # "nativepython" and get the right one without needing absolute paths
+ # (these often end up too long for the #! parser in the kernel as the
+ # buffer is 128 bytes long).
+ ln -s python3-native/python3 ${D}${bindir}/nativepython3
+}
+
+python(){
+
+ # Read JSON manifest
+ import json
+ pythondir = d.getVar('THISDIR',True)
+ with open(pythondir+'/python3/python3-manifest.json') as manifest_file:
+ python_manifest=json.load(manifest_file)
+
+ rprovides = d.getVar('RPROVIDES').split()
+
+ # Hardcoded since it cant be python3-native-foo, should be python3-foo-native
+ pn = 'python3'
+
+ for key in python_manifest:
+ pypackage = pn + '-' + key + '-native'
+ if pypackage not in rprovides:
+ rprovides.append(pypackage)
+
+ d.setVar('RPROVIDES', ' '.join(rprovides))
+}
diff --git a/poky/meta/recipes-devtools/python/python3-nose_1.3.7.bb b/poky/meta/recipes-devtools/python/python3-nose_1.3.7.bb
new file mode 100644
index 000000000..8bc1f4983
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3-nose_1.3.7.bb
@@ -0,0 +1,6 @@
+inherit setuptools3
+require python-nose.inc
+
+do_install_append() {
+ mv ${D}${bindir}/nosetests ${D}${bindir}/nosetests3
+}
diff --git a/poky/meta/recipes-devtools/python/python3-pip_9.0.2.bb b/poky/meta/recipes-devtools/python/python3-pip_9.0.2.bb
new file mode 100644
index 000000000..53fd6dcf2
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3-pip_9.0.2.bb
@@ -0,0 +1,48 @@
+SUMMARY = "The PyPA recommended tool for installing Python packages"
+HOMEPAGE = "https://pypi.python.org/pypi/pip"
+SECTION = "devel/python"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=25fba45109565f87de20bae85bc39452"
+
+DEPENDS += "python3 python3-setuptools-native"
+
+SRC_URI[md5sum] = "2fddd680422326b9d1fbf56112cf341d"
+SRC_URI[sha256sum] = "88110a224e9d30e5d76592a0b2130ef10e7e67a6426e8617bb918fffbfe91fe5"
+
+inherit pypi distutils3
+
+DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${PYTHON_SITEPACKAGES_DIR}"
+
+do_install_prepend() {
+ install -d ${D}${PYTHON_SITEPACKAGES_DIR}
+}
+
+# Use setuptools site.py instead, avoid shared state issue
+do_install_append() {
+ rm ${D}${PYTHON_SITEPACKAGES_DIR}/site.py
+ rm ${D}${PYTHON_SITEPACKAGES_DIR}/__pycache__/site.cpython-*.pyc
+
+ # Install as pip3 and leave pip2 as default
+ rm ${D}/${bindir}/pip
+
+ # Installed eggs need to be passed directly to the interpreter via a pth file
+ echo "./${PYPI_PACKAGE}-${PV}-py${PYTHON_BASEVERSION}.egg" > ${D}${PYTHON_SITEPACKAGES_DIR}/${PYPI_PACKAGE}-${PV}.pth
+
+ # Make sure we use /usr/bin/env python3
+ for PYTHSCRIPT in `grep -rIl ${bindir} ${D}${bindir}/pip3*`; do
+ sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' $PYTHSCRIPT
+ done
+}
+
+RDEPENDS_${PN} = "\
+ python3-compile \
+ python3-io \
+ python3-html \
+ python3-json \
+ python3-netserver \
+ python3-setuptools \
+ python3-unixadmin \
+ python3-xmlrpc \
+"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/poky/meta/recipes-devtools/python/python3-pycairo_1.15.6.bb b/poky/meta/recipes-devtools/python/python3-pycairo_1.15.6.bb
new file mode 100644
index 000000000..5c3e1e6f0
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3-pycairo_1.15.6.bb
@@ -0,0 +1,31 @@
+SUMMARY = "Python bindings for the Cairo canvas library"
+HOMEPAGE = "http://cairographics.org/pycairo"
+BUGTRACKER = "http://bugs.freedesktop.org"
+SECTION = "python-devel"
+LICENSE = "LGPLv2.1 & MPLv1.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f2e071ab72978431b294a0d696327421 \
+ file://COPYING-LGPL-2.1;md5=fad9b3332be894bab9bc501572864b29 \
+ file://COPYING-MPL-1.1;md5=bfe1f75d606912a4111c90743d6c7325"
+
+# cairo >= 1.14
+DEPENDS = "cairo"
+
+SRC_URI = "https://github.com/pygobject/pycairo/releases/download/v${PV}/pycairo-${PV}.tar.gz"
+UPSTREAM_CHECK_URI = "https://github.com/pygobject/pycairo/releases/"
+
+SRC_URI[md5sum] = "3ff210c34e7b052590e15fd0fb147766"
+SRC_URI[sha256sum] = "ad150ea637860836b66705e0513b8e59494538f0b80497ad3462051368755016"
+
+S = "${WORKDIR}/pycairo-${PV}"
+
+inherit setuptools3 pkgconfig
+
+CFLAGS += "-fPIC"
+
+BBCLASSEXTEND = "native"
+
+do_install_append() {
+ install -d ${D}${includedir}/pycairo/
+ install -m 0644 ${D}${datadir}/include/pycairo/py3cairo.h ${D}${includedir}/pycairo/
+}
+FILES_${PN} += "${datadir}/include/pycairo/py3cairo.h"
diff --git a/poky/meta/recipes-devtools/python/python3-pygobject_3.28.1.bb b/poky/meta/recipes-devtools/python/python3-pygobject_3.28.1.bb
new file mode 100644
index 000000000..97286f4e8
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3-pygobject_3.28.1.bb
@@ -0,0 +1,29 @@
+SUMMARY = "Python GObject bindings"
+SECTION = "devel/python"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a916467b91076e631dd8edb7424769c7"
+
+inherit gnomebase distutils3-base gobject-introspection upstream-version-is-even
+
+DEPENDS += "python3 glib-2.0"
+
+SRCNAME="pygobject"
+SRC_URI = " \
+ http://ftp.gnome.org/pub/GNOME/sources/${SRCNAME}/${@gnome_verdir("${PV}")}/${SRCNAME}-${PV}.tar.xz \
+"
+
+SRC_URI[md5sum] = "612e9e2863d117d810e78672f7bc3ad6"
+SRC_URI[sha256sum] = "42312b4a5015571fa0a4f2d201005da46b71c251ea2625bc95702d071c4ff895"
+
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+PACKAGECONFIG ??= "${@bb.utils.contains_any('DISTRO_FEATURES', [ 'directfb', 'wayland', 'x11' ], 'cairo', '', d)}"
+
+# python3-pycairo is checked on configuration -> DEPENDS
+# we don't link against python3-pycairo -> RDEPENDS
+PACKAGECONFIG[cairo] = "--enable-cairo,--disable-cairo,cairo python3-pycairo, python3-pycairo"
+
+RDEPENDS_${PN} += "python3-setuptools"
+
+BBCLASSEXTEND = "native"
+PACKAGECONFIG_class-native = ""
diff --git a/poky/meta/recipes-devtools/python/python3-setuptools_39.0.0.bb b/poky/meta/recipes-devtools/python/python3-setuptools_39.0.0.bb
new file mode 100644
index 000000000..0dc1ed862
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3-setuptools_39.0.0.bb
@@ -0,0 +1,6 @@
+require python-setuptools.inc
+inherit setuptools3
+
+do_install_append() {
+ mv ${D}${bindir}/easy_install ${D}${bindir}/easy3_install
+}
diff --git a/poky/meta/recipes-devtools/python/python3-six_1.11.0.bb b/poky/meta/recipes-devtools/python/python3-six_1.11.0.bb
new file mode 100644
index 000000000..8795313be
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3-six_1.11.0.bb
@@ -0,0 +1,2 @@
+inherit setuptools3
+require python-six.inc
diff --git a/poky/meta/recipes-devtools/python/python3-smmap_0.9.0.bb b/poky/meta/recipes-devtools/python/python3-smmap_0.9.0.bb
new file mode 100644
index 000000000..e87b8df8c
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3-smmap_0.9.0.bb
@@ -0,0 +1,2 @@
+inherit setuptools3
+require python-smmap.inc
diff --git a/poky/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch b/poky/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch
new file mode 100644
index 000000000..8ea3f03fe
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch
@@ -0,0 +1,38 @@
+From 04df959365e2b54d7503edf0e5534ff094284f2d Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 23 Oct 2015 12:25:09 +0300
+Subject: [PATCH] Do not use the shell version of python-config that was
+ introduced in 3.4
+
+Revert instead to the original python version: it has our tweaks and
+outputs directories correctly.
+
+Upstream-Status: Inappropriate [oe-specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ Makefile.pre.in | 9 +++------
+ 1 file changed, 3 insertions(+), 6 deletions(-)
+
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index 236f005..5c4337f 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -1348,12 +1348,9 @@ python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh
+ sed -e "s,@EXENAME@,$(BINDIR)/python$(LDVERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config.py
+ # Replace makefile compat. variable references with shell script compat. ones; $(VAR) -> ${VAR}
+ LC_ALL=C sed -e 's,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g' < Misc/python-config.sh >python-config
+- # On Darwin, always use the python version of the script, the shell
+- # version doesn't use the compiler customizations that are provided
+- # in python (_osx_support.py).
+- if test `uname -s` = Darwin; then \
+- cp python-config.py python-config; \
+- fi
++ # In OpenEmbedded, always use the python version of the script, the shell
++ # version is broken in multiple ways, and doesn't return correct directories
++ cp python-config.py python-config
+
+
+ # Install the include files
+--
+2.11.0
+
diff --git a/poky/meta/recipes-devtools/python/python3/0001-Issue-21272-Use-_sysconfigdata.py-to-initialize-dist.patch b/poky/meta/recipes-devtools/python/python3/0001-Issue-21272-Use-_sysconfigdata.py-to-initialize-dist.patch
new file mode 100644
index 000000000..d1c92e9ee
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/0001-Issue-21272-Use-_sysconfigdata.py-to-initialize-dist.patch
@@ -0,0 +1,66 @@
+From bcddbf40c7f1b80336268cdddacc17369fb0ccea Mon Sep 17 00:00:00 2001
+From: Libin Dang <libin.dang@windriver.com>
+Date: Tue, 11 Apr 2017 14:12:15 +0800
+Subject: [PATCH] Issue #21272: Use _sysconfigdata.py to initialize
+ distutils.sysconfig
+
+Backport upstream commit
+https://github.com/python/cpython/commit/409482251b06fe75c4ee56e85ffbb4b23d934159
+
+Upstream-Status: Backport
+
+Signed-off-by: Li Zhou <li.zhou@windriver.com>
+---
+ Lib/distutils/sysconfig.py | 35 ++++-------------------------------
+ 1 file changed, 4 insertions(+), 31 deletions(-)
+
+diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
+index 6d5cfd0..9925d24 100644
+--- a/Lib/distutils/sysconfig.py
++++ b/Lib/distutils/sysconfig.py
+@@ -424,38 +424,11 @@ _config_vars = None
+
+ def _init_posix():
+ """Initialize the module as appropriate for POSIX systems."""
+- g = {}
+- # load the installed Makefile:
+- try:
+- filename = get_makefile_filename()
+- parse_makefile(filename, g)
+- except OSError as msg:
+- my_msg = "invalid Python installation: unable to open %s" % filename
+- if hasattr(msg, "strerror"):
+- my_msg = my_msg + " (%s)" % msg.strerror
+-
+- raise DistutilsPlatformError(my_msg)
+-
+- # load the installed pyconfig.h:
+- try:
+- filename = get_config_h_filename()
+- with open(filename) as file:
+- parse_config_h(file, g)
+- except OSError as msg:
+- my_msg = "invalid Python installation: unable to open %s" % filename
+- if hasattr(msg, "strerror"):
+- my_msg = my_msg + " (%s)" % msg.strerror
+-
+- raise DistutilsPlatformError(my_msg)
+-
+- # On AIX, there are wrong paths to the linker scripts in the Makefile
+- # -- these paths are relative to the Python source, but when installed
+- # the scripts are in another directory.
+- if python_build:
+- g['LDSHARED'] = g['BLDSHARED']
+-
++ # _sysconfigdata is generated at build time, see the sysconfig module
++ from _sysconfigdata import build_time_vars
+ global _config_vars
+- _config_vars = g
++ _config_vars = {}
++ _config_vars.update(build_time_vars)
+
+
+ def _init_nt():
+--
+1.8.3.1
+
diff --git a/poky/meta/recipes-devtools/python/python3/0001-cross-compile-support.patch b/poky/meta/recipes-devtools/python/python3/0001-cross-compile-support.patch
new file mode 100644
index 000000000..7cd7e3b49
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/0001-cross-compile-support.patch
@@ -0,0 +1,96 @@
+From ecde3ea170999a9ef734e8af4d7c25be5ba81697 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 31 Mar 2017 15:42:46 +0300
+Subject: [PATCH] cross-compile support
+
+We cross compile python. This patch uses tools from host/native
+python instead of in-tree tools
+
+-Khem
+
+Rebased on 3.5.4
+
+Upstream-Status: Inappropriate[Configuration Specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+Signed-off-by: Derek Straka <derek@asterius.io>
+---
+ Makefile.pre.in | 14 ++++++++------
+ 1 file changed, 8 insertions(+), 6 deletions(-)
+
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index 144c1f8629..f252ac2417 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -223,6 +223,7 @@ LIBOBJS= @LIBOBJS@
+
+ PYTHON= python$(EXE)
+ BUILDPYTHON= python$(BUILDEXE)
++HOSTPYTHON= $(BUILDPYTHON)
+
+ PYTHON_FOR_REGEN=@PYTHON_FOR_REGEN@
+ PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@
+@@ -277,6 +278,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@
+ ##########################################################################
+ # Parser
+ PGEN= Parser/pgen$(EXE)
++HOSTPGEN= $(PGEN)$(EXE)
+
+ PSRCS= \
+ Parser/acceler.c \
+@@ -478,7 +480,7 @@ build_all_generate_profile:
+
+ run_profile_task:
+ : # FIXME: can't run for a cross build
+- $(LLVM_PROF_FILE) $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) || true
++ $(LLVM_PROF_FILE) $(RUNSHARED) $(HOSTPYTHON) $(PROFILE_TASK) || true
+
+ build_all_merge_profile:
+ $(LLVM_PROF_MERGER)
+@@ -772,7 +774,7 @@ regen-grammar: $(PGEN)
+ # Regenerate Include/graminit.h and Python/graminit.c
+ # from Grammar/Grammar using pgen
+ @$(MKDIR_P) Include
+- $(PGEN) $(srcdir)/Grammar/Grammar \
++ $(HOSTPGEN) $(srcdir)/Grammar/Grammar \
+ $(srcdir)/Include/graminit.h \
+ $(srcdir)/Python/graminit.c
+
+@@ -978,7 +980,7 @@ $(LIBRARY_OBJS) $(MODOBJS) Programs/python.o: $(PYTHON_HEADERS)
+ ######################################################################
+
+ TESTOPTS= $(EXTRATESTOPTS)
+-TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) $(TESTPYTHONOPTS)
++TESTPYTHON= $(RUNSHARED) $(HOSTPYTHON) $(TESTPYTHONOPTS)
+ TESTRUNNER= $(TESTPYTHON) $(srcdir)/Tools/scripts/run_tests.py
+ TESTTIMEOUT= 3600
+
+@@ -1470,7 +1472,7 @@ frameworkinstallstructure: $(LDLIBRARY)
+ fi; \
+ done
+ $(LN) -fsn include/python$(LDVERSION) $(DESTDIR)$(prefix)/Headers
+- sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
++ sed 's/%VERSION%/'"`$(RUNSHARED) $(HOSTPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
+ $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
+ $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK)
+ $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
+@@ -1543,7 +1545,7 @@ Python/dtoa.o: Python/dtoa.c
+
+ # Run reindent on the library
+ reindent:
+- ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
++ $(HOSTPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
+
+ # Rerun configure with the same options as it was run last time,
+ # provided the config.status script exists
+@@ -1678,7 +1680,7 @@ funny:
+
+ # Perform some verification checks on any modified files.
+ patchcheck: @DEF_MAKE_RULE@
+- $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
++ $(RUNSHARED) $(HOSTPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
+
+ # Dependencies
+
+--
+2.11.0
+
diff --git a/poky/meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch b/poky/meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch
new file mode 100644
index 000000000..dd6b24fe9
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch
@@ -0,0 +1,37 @@
+From 2f5a4c708d90fa8db21f446ae879cff79387448d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 20 May 2013 21:03:16 -0700
+Subject: [PATCH] h2py: Fix issue 13032 where it fails with UnicodeDecodeError
+
+use utf-8 to open the files
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ Tools/scripts/h2py.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Tools/scripts/h2py.py b/Tools/scripts/h2py.py
+index 4f871d9..a53fbe0 100755
+--- a/Tools/scripts/h2py.py
++++ b/Tools/scripts/h2py.py
+@@ -69,13 +69,13 @@ def main():
+ sys.stdout.write('# Generated by h2py from stdin\n')
+ process(sys.stdin, sys.stdout)
+ else:
+- fp = open(filename, 'r')
++ fp = open(filename, 'r', encoding='utf-8')
+ outfile = os.path.basename(filename)
+ i = outfile.rfind('.')
+ if i > 0: outfile = outfile[:i]
+ modname = outfile.upper()
+ outfile = modname + '.py'
+- outfp = open(outfile, 'w')
++ outfp = open(outfile, 'w', encoding='utf-8')
+ outfp.write('# Generated by h2py from %s\n' % filename)
+ filedict = {}
+ for dir in searchdirs:
+--
+1.8.1.2
+
diff --git a/poky/meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch b/poky/meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch
new file mode 100644
index 000000000..fddfd2b2f
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch
@@ -0,0 +1,42 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+# We need to supply STAGING_INCDIR here, otherwise the Tk headers
+# will not be found.
+# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille.de>
+
+Index: Python-3.3.0rc2/setup.py
+===================================================================
+--- Python-3.3.0rc2.orig/setup.py 2012-09-20 15:24:14.009124003 -0700
++++ Python-3.3.0rc2/setup.py 2012-09-20 15:25:08.449124963 -0700
+@@ -1620,7 +1620,7 @@
+ dotversion = dotversion[:-1] + '.' + dotversion[-1]
+ tcl_include_sub = []
+ tk_include_sub = []
+- for dir in inc_dirs:
++ for dir in [os.getenv("STAGING_INCDIR")]:
+ tcl_include_sub += [dir + os.sep + "tcl" + dotversion]
+ tk_include_sub += [dir + os.sep + "tk" + dotversion]
+ tk_include_sub += tcl_include_sub
+@@ -1639,22 +1639,6 @@
+ if dir not in include_dirs:
+ include_dirs.append(dir)
+
+- # Check for various platform-specific directories
+- if host_platform == 'sunos5':
+- include_dirs.append('/usr/openwin/include')
+- added_lib_dirs.append('/usr/openwin/lib')
+- elif os.path.exists('/usr/X11R6/include'):
+- include_dirs.append('/usr/X11R6/include')
+- added_lib_dirs.append('/usr/X11R6/lib64')
+- added_lib_dirs.append('/usr/X11R6/lib')
+- elif os.path.exists('/usr/X11R5/include'):
+- include_dirs.append('/usr/X11R5/include')
+- added_lib_dirs.append('/usr/X11R5/lib')
+- else:
+- # Assume default location for X11
+- include_dirs.append('/usr/X11/include')
+- added_lib_dirs.append('/usr/X11/lib')
+-
+ # If Cygwin, then verify that X is installed before proceeding
+ if host_platform == 'cygwin':
+ x11_inc = find_file('X11/Xlib.h', [], include_dirs)
diff --git a/poky/meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch b/poky/meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch
new file mode 100644
index 000000000..6beac7b80
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch
@@ -0,0 +1,33 @@
+Do not hardcode /usr into include paths when cross compiling
+
+-Khem
+
+Upstream-Status: Pending
+
+---
+ setup.py | 15 ++-------------
+ 1 file changed, 2 insertions(+), 13 deletions(-)
+
+Index: Python-3.3.2/setup.py
+===================================================================
+--- Python-3.3.2.orig/setup.py
++++ Python-3.3.2/setup.py
+@@ -444,7 +444,8 @@ class PyBuildExt(build_ext):
+ # only change this for cross builds for 3.3, issues on Mageia
+ if cross_compiling:
+ self.add_gcc_paths()
+- self.add_multiarch_paths()
++ if not cross_compiling:
++ self.add_multiarch_paths()
+
+ # Add paths specified in the environment variables LDFLAGS and
+ # CPPFLAGS for header and library files.
+@@ -480,7 +481,7 @@ class PyBuildExt(build_ext):
+ for directory in reversed(options.dirs):
+ add_dir_to_list(dir_list, directory)
+
+- if os.path.normpath(sys.base_prefix) != '/usr' \
++ if not cross_compiling and os.path.normpath(sys.base_prefix) != '/usr' \
+ and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
+ # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
+ # (PYTHONFRAMEWORK is set) to avoid # linking problems when
diff --git a/poky/meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch b/poky/meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch
new file mode 100644
index 000000000..f9971c6ba
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch
@@ -0,0 +1,38 @@
+consider opkg directories when cleaning up
+
+-Khem
+
+Upstream-Status: Inappropriate [OE specific]
+
+---
+ Makefile.pre.in | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+Index: Python-3.5.3/Makefile.pre.in
+===================================================================
+--- Python-3.5.3.orig/Makefile.pre.in
++++ Python-3.5.3/Makefile.pre.in
+@@ -1574,8 +1574,8 @@ touch:
+ # Sanitation targets -- clean leaves libraries, executables and tags
+ # files, which clobber removes as well
+ pycremoval:
+- -find $(srcdir) -depth -name '__pycache__' -exec rm -rf {} ';'
+- -find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'
++ -find $(srcdir) ! -path './ipkg-install/*' -depth -name '__pycache__' -exec rm -rf {} ';'
++ -find $(srcdir) ! -path './ipkg-install/*' -name '*.py[co]' -exec rm -f {} ';'
+
+ rmtestturds:
+ -rm -f *BAD *GOOD *SKIPPED
+@@ -1589,9 +1589,9 @@ docclean:
+ -rm -rf Doc/tools/sphinx Doc/tools/pygments Doc/tools/docutils
+
+ clean: pycremoval
+- find . -name '*.[oa]' -exec rm -f {} ';'
+- find . -name '*.s[ol]' -exec rm -f {} ';'
+- find . -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';'
++ find . ! -path './ipkg-install/*' -name '*.[oa]' -exec rm -f {} ';'
++ find . ! -path './ipkg-install/*' -name '*.s[ol]' -exec rm -f {} ';'
++ find . ! -path './ipkg-install/*' -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';'
+ find build -name 'fficonfig.h' -exec rm -f {} ';' || true
+ find build -name '*.py' -exec rm -f {} ';' || true
+ find build -name '*.py[co]' -exec rm -f {} ';' || true
diff --git a/poky/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch b/poky/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch
new file mode 100644
index 000000000..b96419a63
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch
@@ -0,0 +1,92 @@
+do not "adjust" python files before copying
+
+-Khem
+
+Upstream-Status: Inappropriate [Embedded-Specific]
+
+---
+ Lib/distutils/command/build_scripts.py | 43 +++------------------------------
+ 1 file changed, 4 insertions(+), 39 deletions(-)
+
+--- a/Lib/distutils/command/build_scripts.py
++++ b/Lib/distutils/command/build_scripts.py
+@@ -51,10 +51,7 @@ class build_scripts(Command):
+
+
+ def copy_scripts(self):
+- """Copy each script listed in 'self.scripts'; if it's marked as a
+- Python script in the Unix way (first line matches 'first_line_re',
+- ie. starts with "\#!" and contains "python"), then adjust the first
+- line to refer to the current Python interpreter as we copy.
++ """Copy each script listed in 'self.scripts'
+ """
+ self.mkpath(self.build_dir)
+ outfiles = []
+@@ -78,64 +75,10 @@ class build_scripts(Command):
+ if not self.dry_run:
+ raise
+ f = None
+- else:
+- encoding, lines = tokenize.detect_encoding(f.readline)
+- f.seek(0)
+- first_line = f.readline()
+- if not first_line:
+- self.warn("%s is an empty file (skipping)" % script)
+- continue
+-
+- match = first_line_re.match(first_line)
+- if match:
+- adjust = True
+- post_interp = match.group(1) or b''
+-
+- if adjust:
+- log.info("copying and adjusting %s -> %s", script,
+- self.build_dir)
+- updated_files.append(outfile)
+- if not self.dry_run:
+- if not sysconfig.python_build:
+- executable = self.executable
+- else:
+- executable = os.path.join(
+- sysconfig.get_config_var("BINDIR"),
+- "python%s%s" % (sysconfig.get_config_var("VERSION"),
+- sysconfig.get_config_var("EXE")))
+- executable = os.fsencode(executable)
+- shebang = b"#!" + executable + post_interp + b"\n"
+- # Python parser starts to read a script using UTF-8 until
+- # it gets a #coding:xxx cookie. The shebang has to be the
+- # first line of a file, the #coding:xxx cookie cannot be
+- # written before. So the shebang has to be decodable from
+- # UTF-8.
+- try:
+- shebang.decode('utf-8')
+- except UnicodeDecodeError:
+- raise ValueError(
+- "The shebang ({!r}) is not decodable "
+- "from utf-8".format(shebang))
+- # If the script is encoded to a custom encoding (use a
+- # #coding:xxx cookie), the shebang has to be decodable from
+- # the script encoding too.
+- try:
+- shebang.decode(encoding)
+- except UnicodeDecodeError:
+- raise ValueError(
+- "The shebang ({!r}) is not decodable "
+- "from the script encoding ({})"
+- .format(shebang, encoding))
+- with open(outfile, "wb") as outf:
+- outf.write(shebang)
+- outf.writelines(f.readlines())
+- if f:
+- f.close()
+- else:
+- if f:
++ if f:
+ f.close()
+- updated_files.append(outfile)
+- self.copy_file(script, outfile)
++ updated_files.append(outfile)
++ self.copy_file(script, outfile)
+
+ if os.name == 'posix':
+ for file in outfiles:
diff --git a/poky/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch b/poky/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
new file mode 100644
index 000000000..c53ec0cfc
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
@@ -0,0 +1,57 @@
+From 7630ab22578746d3d790d0598c0d279cf7afed97 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 14 May 2013 15:00:26 -0700
+Subject: [PATCH 01/20] python3: Add target and native recipes
+
+Upstream-Status: Inappropriate [embedded specific]
+
+02/2015 Rebased for Python 3.4.2
+
+# The proper prefix is inside our staging area.
+# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
+# Signed-off-by: Phil Blundell <philb@gnu.org>
+# Signed-off-by: Khem Raj <raj.khem@gmail.com>
+# Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+---
+ Lib/distutils/sysconfig.py | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
+index 573724d..390c485 100644
+--- a/Lib/distutils/sysconfig.py
++++ b/Lib/distutils/sysconfig.py
+@@ -84,7 +84,9 @@ def get_python_inc(plat_specific=0, prefix=None):
+ If 'prefix' is supplied, use it instead of sys.base_prefix or
+ sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
+ """
+- if prefix is None:
++ if prefix is None and os.environ['STAGING_INCDIR'] != "":
++ prefix = os.environ['STAGING_INCDIR'].rstrip('include')
++ elif prefix is None:
+ prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
+ if os.name == "posix":
+ if python_build:
+@@ -125,6 +127,10 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
+ If 'prefix' is supplied, use it instead of sys.base_prefix or
+ sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
+ """
++ lib_basename = os.environ['STAGING_LIBDIR'].split('/')[-1]
++ if prefix is None and os.environ['STAGING_LIBDIR'] != "":
++ prefix = os.environ['STAGING_LIBDIR'].rstrip(lib_basename)
++
+ if prefix is None:
+ if standard_lib:
+ prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
+@@ -133,7 +139,7 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
+
+ if os.name == "posix":
+ libpython = os.path.join(prefix,
+- "lib", "python" + get_python_version())
++ lib_basename, "python" + get_python_version())
+ if standard_lib:
+ return libpython
+ else:
+--
+2.8.0.rc3
+
diff --git a/poky/meta/recipes-devtools/python/python3/130-readline-setup.patch b/poky/meta/recipes-devtools/python/python3/130-readline-setup.patch
new file mode 100644
index 000000000..c805652d6
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/130-readline-setup.patch
@@ -0,0 +1,55 @@
+package python-readline
+
+-Khem
+
+Upstream-Status: Inappropriate [Embedded Specific]
+
+--- a/setup.py
++++ b/setup.py
+@@ -666,45 +666,7 @@ class PyBuildExt(build_ext):
+ # readline
+ do_readline = self.compiler.find_library_file(lib_dirs, 'readline')
+ readline_termcap_library = ""
+- curses_library = ""
+- # Cannot use os.popen here in py3k.
+- tmpfile = os.path.join(self.build_temp, 'readline_termcap_lib')
+- if not os.path.exists(self.build_temp):
+- os.makedirs(self.build_temp)
+- # Determine if readline is already linked against curses or tinfo.
+- if do_readline:
+- if cross_compiling:
+- ret = os.system("%s -d %s | grep '(NEEDED)' > %s" \
+- % (sysconfig.get_config_var('READELF'),
+- do_readline, tmpfile))
+- elif find_executable('ldd'):
+- ret = os.system("ldd %s > %s" % (do_readline, tmpfile))
+- else:
+- ret = 256
+- if ret >> 8 == 0:
+- with open(tmpfile) as fp:
+- for ln in fp:
+- if 'curses' in ln:
+- readline_termcap_library = re.sub(
+- r'.*lib(n?cursesw?)\.so.*', r'\1', ln
+- ).rstrip()
+- break
+- # termcap interface split out from ncurses
+- if 'tinfo' in ln:
+- readline_termcap_library = 'tinfo'
+- break
+- if os.path.exists(tmpfile):
+- os.unlink(tmpfile)
+- # Issue 7384: If readline is already linked against curses,
+- # use the same library for the readline and curses modules.
+- if 'curses' in readline_termcap_library:
+- curses_library = readline_termcap_library
+- elif self.compiler.find_library_file(lib_dirs, 'ncursesw'):
+- curses_library = 'ncursesw'
+- elif self.compiler.find_library_file(lib_dirs, 'ncurses'):
+- curses_library = 'ncurses'
+- elif self.compiler.find_library_file(lib_dirs, 'curses'):
+- curses_library = 'curses'
++ curses_library = "ncurses"
+
+ if host_platform == 'darwin':
+ os_release = int(os.uname()[2].split('.')[0])
diff --git a/poky/meta/recipes-devtools/python/python3/150-fix-setupterm.patch b/poky/meta/recipes-devtools/python/python3/150-fix-setupterm.patch
new file mode 100644
index 000000000..78d7c7867
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/150-fix-setupterm.patch
@@ -0,0 +1,17 @@
+Fix warning with newer compiler
+
+-Khem
+
+Upstream-Status: Pending
+
+--- a/Modules/_cursesmodule.c
++++ b/Modules/_cursesmodule.c
+@@ -116,7 +116,7 @@ char *PyCursesVersion = "2.2";
+ #defines many common symbols (such as "lines") which breaks the
+ curses module in other ways. So the code will just specify
+ explicit prototypes here. */
+-extern int setupterm(char *,int,int *);
++//extern int setupterm(char *,int,int *);
+ #ifdef __sgi
+ #include <term.h>
+ #endif
diff --git a/poky/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch b/poky/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch
new file mode 100644
index 000000000..f29ae5337
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch
@@ -0,0 +1,21 @@
+Upstream-Status: Pending
+
+We should make sure that sysroot is used by gcc instead of assuming
+hardcoded locations for include paths
+
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: Python-3.4.2/configure.ac
+===================================================================
+--- Python-3.4.2.orig/configure.ac
++++ Python-3.4.2/configure.ac
+@@ -4434,7 +4434,7 @@ fi
+
+ # first curses header check
+ ac_save_cppflags="$CPPFLAGS"
+-CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
++CPPFLAGS="$CPPFLAGS -I=/usr/include/ncursesw"
+
+ AC_CHECK_HEADERS(curses.h ncurses.h)
+
diff --git a/poky/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch b/poky/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch
new file mode 100644
index 000000000..a3cc48c9a
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch
@@ -0,0 +1,29 @@
+_tkinter module needs tk module along with tcl. tk is not yet integrated
+in yocto so we skip the check for this module.
+Avoid a warning by not adding this module to missing variable.
+
+Upstream-Status: Inappropriate [distribution]
+
+Also simply disable the tk module since its not in DEPENDS.
+Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
+
+Index: Python-3.5.3/setup.py
+===================================================================
+--- Python-3.5.3.orig/setup.py
++++ Python-3.5.3/setup.py
+@@ -1558,10 +1558,12 @@ class PyBuildExt(build_ext):
+ self.extensions.extend(exts)
+
+ # Call the method for detecting whether _tkinter can be compiled
+- self.detect_tkinter(inc_dirs, lib_dirs)
++ # self.detect_tkinter(inc_dirs, lib_dirs)
+
+- if '_tkinter' not in [e.name for e in self.extensions]:
+- missing.append('_tkinter')
++ # tkinter module will not be avalaible as yocto
++ # doesn't have tk integrated (yet)
++ #if '_tkinter' not in [e.name for e in self.extensions]:
++ # missing.append('_tkinter')
+
+ ## # Uncomment these lines if you want to play with xxmodule.c
+ ## ext = Extension('xx', ['xxmodule.c'])
diff --git a/poky/meta/recipes-devtools/python/python3/cgi_py.patch b/poky/meta/recipes-devtools/python/python3/cgi_py.patch
new file mode 100644
index 000000000..de504f9dc
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/cgi_py.patch
@@ -0,0 +1,23 @@
+Lib/cgi.py: Update the script as mentioned in the comment
+
+Upstream-Status: Inappropriate [distribution]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+--- Python-2.6.6/Lib/cgi.py.orig 2010-08-01 22:14:27.000000000 -0500
++++ Python-2.6.6/Lib/cgi.py 2011-09-21 15:28:40.478208631 -0500
+@@ -1,13 +1,4 @@
+-#! /usr/local/bin/python
+-
+-# NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is
+-# intentionally NOT "/usr/bin/env python". On many systems
+-# (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI
+-# scripts, and /usr/local/bin is the default directory where Python is
+-# installed, so /usr/bin/env would be unable to find python. Granted,
+-# binary installations by Linux vendors often install Python in
+-# /usr/bin. So let those vendors patch cgi.py to match their choice
+-# of installation.
++#! /usr/bin/env python
+
+ """Support module for CGI (Common Gateway Interface) scripts.
+
diff --git a/poky/meta/recipes-devtools/python/python3/configure.ac-fix-LIBPL.patch b/poky/meta/recipes-devtools/python/python3/configure.ac-fix-LIBPL.patch
new file mode 100644
index 000000000..97214f9aa
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/configure.ac-fix-LIBPL.patch
@@ -0,0 +1,30 @@
+From 7c4f8d87473d6238c120ec6031b58f83a17a39a5 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 28 Dec 2015 22:52:06 -0800
+Subject: [PATCH] configure.ac: fix LIBPL
+
+Use LIBDIR rather than prefix/lib, so that it would work when lib64.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 63aef8e..aefb27f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -4366,7 +4366,7 @@ AC_MSG_RESULT($LDVERSION)
+
+ dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
+ AC_SUBST(PY_ENABLE_SHARED)
+-LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
++LIBPL='$(LIBDIR)'"/python${VERSION}/config-${LDVERSION}"
+ AC_SUBST(LIBPL)
+
+ # Check whether right shifting a negative integer extends the sign bit
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-devtools/python/python3/create_manifest3.py b/poky/meta/recipes-devtools/python/python3/create_manifest3.py
new file mode 100644
index 000000000..2f944f9b1
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/create_manifest3.py
@@ -0,0 +1,354 @@
+# This script is used as a bitbake task to create a new python manifest
+# $ bitbake python -c create_manifest
+#
+# Our goal is to keep python-core as small as posible and add other python
+# packages only when the user needs them, hence why we split upstream python
+# into several packages.
+#
+# In a very simplistic way what this does is:
+# Launch python and see specifically what is required for it to run at a minimum
+#
+# Go through the python-manifest file and launch a separate task for every single
+# one of the files on each package, this task will check what was required for that
+# specific module to run, these modules will be called dependencies.
+# The output of such task will be a list of the modules or dependencies that were
+# found for that file.
+#
+# Such output will be parsed by this script, we will look for each dependency on the
+# manifest and if we find that another package already includes it, then we will add
+# that package as an RDEPENDS to the package we are currently checking; in case we dont
+# find the current dependency on any other package we will add it to the current package
+# as part of FILES.
+#
+#
+# This way we will create a new manifest from the data structure that was built during
+# this process, ont this new manifest each package will contain specifically only
+# what it needs to run.
+#
+# There are some caveats which we try to deal with, such as repeated files on different
+# packages, packages that include folders, wildcards, and special packages.
+# Its also important to note that this method only works for python files, and shared
+# libraries. Static libraries, header files and binaries need to be dealt with manually.
+#
+# This script differs from its python2 version mostly on how shared libraries are handled
+# The manifest file for python3 has an extra field which contains the cached files for
+# each package.
+# Tha method to handle cached files does not work when a module includes a folder which
+# itself contains the pycache folder, gladly this is almost never the case.
+#
+# Author: Alejandro Enedino Hernandez Samaniego "aehs29" <aehs29@gmail.com>
+
+
+import sys
+import subprocess
+import json
+import os
+
+# Hack to get native python search path (for folders), not fond of it but it works for now
+pivot='recipe-sysroot-native'
+for p in sys.path:
+ if pivot in p:
+ nativelibfolder=p[:p.find(pivot)+len(pivot)]
+
+# Empty dict to hold the whole manifest
+new_manifest = {}
+
+# Check for repeated files, folders and wildcards
+allfiles=[]
+repeated=[]
+wildcards=[]
+
+hasfolders=[]
+allfolders=[]
+
+def isFolder(value):
+ if os.path.isdir(value.replace('${libdir}',nativelibfolder+'/usr/lib')) or os.path.isdir(value.replace('${libdir}',nativelibfolder+'/usr/lib64')) or os.path.isdir(value.replace('${libdir}',nativelibfolder+'/usr/lib32')):
+ return True
+ else:
+ return False
+
+def isCached(item):
+ if '__pycache__' in item:
+ return True
+ else:
+ return False
+
+# Read existing JSON manifest
+with open('python3-manifest.json') as manifest:
+ old_manifest=json.load(manifest)
+
+
+# First pass to get core-package functionality, because we base everything on the fact that core is actually working
+# Not exactly the same so it should not be a function
+print ('Getting dependencies for package: core')
+
+# Special call to check for core package
+output = subprocess.check_output([sys.executable, 'get_module_deps3.py', 'python-core-package']).decode('utf8')
+for item in output.split():
+ # We append it so it doesnt hurt what we currently have:
+ if isCached(item):
+ if item not in old_manifest['core']['cached']:
+ # We use the same data structure since its the one which will be used to check
+ # dependencies for other packages
+ old_manifest['core']['cached'].append(item)
+ else:
+ if item not in old_manifest['core']['files']:
+ # We use the same data structure since its the one which will be used to check
+ # dependencies for other packages
+ old_manifest['core']['files'].append(item)
+
+for value in old_manifest['core']['files']:
+ # Ignore folders, since we don't import those, difficult to handle multilib
+ if isFolder(value):
+ # Pass it directly
+ if isCached(value):
+ if value not in old_manifest['core']['cached']:
+ old_manifest['core']['cached'].append(value)
+ else:
+ if value not in old_manifest['core']['files']:
+ old_manifest['core']['files'].append(value)
+ continue
+ # Ignore binaries, since we don't import those, assume it was added correctly (manually)
+ if '${bindir}' in value:
+ # Pass it directly
+ if value not in old_manifest['core']['files']:
+ old_manifest['core']['files'].append(value)
+ continue
+ # Ignore empty values
+ if value == '':
+ continue
+ if '${includedir}' in value:
+ if value not in old_manifest['core']['files']:
+ old_manifest['core']['files'].append(value)
+ continue
+ # Get module name , shouldnt be affected by libdir/bindir
+ value = os.path.splitext(os.path.basename(os.path.normpath(value)))[0]
+
+ # Launch separate task for each module for deterministic behavior
+ # Each module will only import what is necessary for it to work in specific
+ print ('Getting dependencies for module: %s' % value)
+ output = subprocess.check_output([sys.executable, 'get_module_deps3.py', '%s' % value]).decode('utf8')
+ print ('The following dependencies were found for module %s:\n' % value)
+ print (output)
+ for item in output.split():
+ # We append it so it doesnt hurt what we currently have:
+ if isCached(item):
+ if item not in old_manifest['core']['cached']:
+ # We use the same data structure since its the one which will be used to check
+ # dependencies for other packages
+ old_manifest['core']['cached'].append(item)
+ else:
+ if item not in old_manifest['core']['files']:
+ # We use the same data structure since its the one which will be used to check
+ # dependencies for other packages
+ old_manifest['core']['files'].append(item)
+
+
+# We check which packages include folders
+for key in old_manifest:
+ for value in old_manifest[key]['files']:
+ # Ignore folders, since we don't import those, difficult to handle multilib
+ if isFolder(value):
+ print ('%s is a folder' % value)
+ if key not in hasfolders:
+ hasfolders.append(key)
+ if value not in allfolders:
+ allfolders.append(value)
+
+for key in old_manifest:
+ # Use an empty dict as data structure to hold data for each package and fill it up
+ new_manifest[key]={}
+ new_manifest[key]['files']=[]
+
+ new_manifest[key]['rdepends']=[]
+ # All packages should depend on core
+ if key != 'core':
+ new_manifest[key]['rdepends'].append('core')
+ new_manifest[key]['cached']=[]
+ else:
+ new_manifest[key]['cached']=old_manifest[key]['cached']
+ new_manifest[key]['summary']=old_manifest[key]['summary']
+
+ # Handle special cases, we assume that when they were manually added
+ # to the manifest we knew what we were doing.
+ print('\n')
+ print('--------------------------')
+ print ('Handling package %s' % key)
+ print('--------------------------')
+ special_packages=['misc', 'modules', 'dev']
+ if key in special_packages or 'staticdev' in key:
+ print('Passing %s package directly' % key)
+ new_manifest[key]=old_manifest[key]
+ continue
+
+ for value in old_manifest[key]['files']:
+ # We already handled core on the first pass
+ if key == 'core':
+ new_manifest[key]['files'].append(value)
+ continue
+ # Ignore folders, since we don't import those, difficult to handle multilib
+ if isFolder(value):
+ # Pass folders directly
+ new_manifest[key]['files'].append(value)
+ # Ignore binaries, since we don't import those
+ if '${bindir}' in value:
+ # Pass it directly to the new manifest data structure
+ if value not in new_manifest[key]['files']:
+ new_manifest[key]['files'].append(value)
+ continue
+ # Ignore empty values
+ if value == '':
+ continue
+ if '${includedir}' in value:
+ if value not in new_manifest[key]['files']:
+ new_manifest[key]['files'].append(value)
+ continue
+
+ # Get module name , shouldnt be affected by libdir/bindir
+ # We need to check if the imported module comes from another (e.g. sqlite3.dump)
+ path,value = os.path.split(value)
+ path = os.path.basename(path)
+ value = os.path.splitext(os.path.basename(value))[0]
+
+ # If this condition is met, it means we need to import it from another module
+ # or its the folder itself (e.g. unittest)
+ if path == key:
+ if value:
+ value = path + '.' + value
+ else:
+ value = path
+
+ # Launch separate task for each module for deterministic behavior
+ # Each module will only import what is necessary for it to work in specific
+ print ('\nGetting dependencies for module: %s' % value)
+ output = subprocess.check_output([sys.executable, 'get_module_deps3.py', '%s' % value]).decode('utf8')
+ # We can print dependencies for debugging purposes
+ print ('The following dependencies were found for module %s:\n' % value)
+ print (output)
+ # Output will have all dependencies
+
+ reportFILES = []
+ reportRDEPS = []
+
+ for item in output.split():
+
+ # Warning: This first part is ugly
+ # One of the dependencies that was found, could be inside of one of the folders included by another package
+ # We need to check if this happens so we can add the package containing the folder as an rdependency
+ # e.g. Folder encodings contained in codecs
+ # This would be solved if no packages included any folders
+
+ # This can be done in two ways:
+ # 1 - We assume that if we take out the filename from the path we would get
+ # the folder string, then we would check if folder string is in the list of folders
+ # This would not work if a package contains a folder which contains another folder
+ # e.g. path/folder1/folder2/filename folder_string= path/folder1/folder2
+ # folder_string would not match any value contained in the list of folders
+ #
+ # 2 - We do it the other way around, checking if the folder is contained in the path
+ # e.g. path/folder1/folder2/filename folder_string= path/folder1/folder2
+ # is folder_string inside path/folder1/folder2/filename?,
+ # Yes, it works, but we waste a couple of milliseconds.
+
+ inFolders=False
+ for folder in allfolders:
+ if folder in item:
+ inFolders = True # Did we find a folder?
+ folderFound = False # Second flag to break inner for
+ # Loop only through packages which contain folders
+ for keyfolder in hasfolders:
+ if (folderFound == False):
+ #print('Checking folder %s on package %s' % (item,keyfolder))
+ for file_folder in old_manifest[keyfolder]['files'] or file_folder in old_manifest[keyfolder]['cached']:
+ if file_folder==folder:
+ print ('%s folder found in %s' % (folder, keyfolder))
+ folderFound = True
+ if keyfolder not in new_manifest[key]['rdepends'] and keyfolder != key:
+ new_manifest[key]['rdepends'].append(keyfolder)
+
+ else:
+ break
+
+ # A folder was found so we're done with this item, we can go on
+ if inFolders:
+ continue
+
+
+ # We might already have it on the dictionary since it could depend on a (previously checked) module
+ if item not in new_manifest[key]['files'] and item not in new_manifest[key]['cached']:
+ # Handle core as a special package, we already did it so we pass it to NEW data structure directly
+ if key=='core':
+ print('Adding %s to %s FILES' % (item, key))
+ if item.endswith('*'):
+ wildcards.append(item)
+ if isCached(item):
+ new_manifest[key]['cached'].append(item)
+ else:
+ new_manifest[key]['files'].append(item)
+
+ # Check for repeated files
+ if item not in allfiles:
+ allfiles.append(item)
+ else:
+ repeated.append(item)
+
+ else:
+
+
+ # Check if this dependency is already contained on another package, so we add it
+ # as an RDEPENDS, or if its not, it means it should be contained on the current
+ # package, so we should add it to FILES
+ for newkey in old_manifest:
+ # Debug
+ #print('Checking %s ' % item + ' in %s' % newkey)
+ if item in old_manifest[newkey]['files'] or item in old_manifest[newkey]['cached']:
+ # Since were nesting, we need to check its not the same key
+ if(newkey!=key):
+ if newkey not in new_manifest[key]['rdepends']:
+ # Add it to the new manifest data struct
+ reportRDEPS.append('Adding %s to %s RDEPENDS, because it contains %s\n' % (newkey, key, item))
+ new_manifest[key]['rdepends'].append(newkey)
+ break
+ else:
+ # A module shouldn't contain itself (${libdir}/python3/sqlite3 shouldnt be on sqlite3 files)
+ if os.path.basename(item) != key:
+ reportFILES.append(('Adding %s to %s FILES\n' % (item, key)))
+ # Since it wasnt found on another package, its not an RDEP, so add it to FILES for this package
+ if isCached(item):
+ new_manifest[key]['cached'].append(item)
+ else:
+ new_manifest[key]['files'].append(item)
+
+ if item.endswith('*'):
+ wildcards.append(item)
+ if item not in allfiles:
+ allfiles.append(item)
+ else:
+ repeated.append(item)
+
+ print('\n')
+ print('#################################')
+ print('Summary for module %s' % value)
+ print('FILES found for module %s:' % value)
+ print(''.join(reportFILES))
+ print('RDEPENDS found for module %s:' % value)
+ print(''.join(reportRDEPS))
+ print('#################################')
+
+print ('The following files are repeated (contained in more than one package), please check which package should get it:')
+print (repeated)
+print('The following files contain wildcards, please check they are necessary')
+print(wildcards)
+print('The following files contain folders, please check they are necessary')
+print(hasfolders)
+
+# Sort it just so it looks nicer
+for key in new_manifest:
+ new_manifest[key]['files'].sort()
+ new_manifest[key]['cached'].sort()
+ new_manifest[key]['rdepends'].sort()
+
+# Create the manifest from the data structure that was built
+with open('python3-manifest.json.new','w') as outfile:
+ json.dump(new_manifest,outfile,sort_keys=True, indent=4)
+ outfile.write('\n')
diff --git a/poky/meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch b/poky/meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch
new file mode 100644
index 000000000..0610565d3
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch
@@ -0,0 +1,54 @@
+Upstream-Status: Inappropriate [Embedded specific]
+
+This patch fixes issuing with different libdir like lib64.
+This patch makes the native python binary modules findable
+in the install process of the host python.
+
+Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+Date: 2012/03/14
+
+Updated for python 2.7.3
+Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+Date: 2012/05/01
+
+Index: Python-3.3.0rc2/Lib/sysconfig.py
+===================================================================
+--- Python-3.3.0rc2.orig/Lib/sysconfig.py 2012-09-20 22:50:11.000000000 -0700
++++ Python-3.3.0rc2/Lib/sysconfig.py 2012-09-20 22:53:01.561123396 -0700
+@@ -21,9 +21,9 @@
+
+ _INSTALL_SCHEMES = {
+ 'posix_prefix': {
+- 'stdlib': '{installed_base}/'+sys.lib+'/python{py_version_short}',
++ 'stdlib': '{base}/'+sys.lib+'/python{py_version_short}',
+ 'platstdlib': '{platbase}/'+sys.lib+'/python{py_version_short}',
+- 'purelib': '{base}/lib/python{py_version_short}/site-packages',
++ 'purelib': '{base}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'platlib': '{platbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'include':
+ '{installed_base}/include/python{py_version_short}{abiflags}',
+@@ -83,7 +83,7 @@
+ 'posix_user': {
+ 'stdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
+ 'platstdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
+- 'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
++ 'purelib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'platlib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'include': '{userbase}/include/python{py_version_short}',
+ 'scripts': '{userbase}/bin',
+Index: Python-3.3.0rc2/Makefile.pre.in
+===================================================================
+--- Python-3.3.0rc2.orig/Makefile.pre.in 2012-09-20 22:50:11.000000000 -0700
++++ Python-3.3.0rc2/Makefile.pre.in 2012-09-20 22:50:54.245123997 -0700
+@@ -1080,9 +1080,9 @@
+ $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
+ $(DESTDIR)$(LIBDEST)/distutils/tests ; \
+ fi
+- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++ -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
+ $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
+- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++ -PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
+ $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
+
+ # Create the PLATDIR source directory, if one wasn't distributed..
diff --git a/poky/meta/recipes-devtools/python/python3/get_module_deps3.py b/poky/meta/recipes-devtools/python/python3/get_module_deps3.py
new file mode 100644
index 000000000..fd12baad8
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/get_module_deps3.py
@@ -0,0 +1,146 @@
+# This script is launched on separate task for each python module
+# It checks for dependencies for that specific module and prints
+# them out, the output of this execution will have all dependencies
+# for a specific module, which will be parsed an dealt on create_manifest.py
+#
+# Author: Alejandro Enedino Hernandez Samaniego "aehs29" <aehs29@gmail.com>
+
+# We can get a log per module, for all the dependencies that were found, but its messy.
+debug=False
+
+import sys
+
+# We can get a list of the modules which are currently required to run python
+# so we run python-core and get its modules, we then import what we need
+# and check what modules are currently running, if we substract them from the
+# modules we had initially, we get the dependencies for the module we imported.
+
+# We use importlib to achieve this, so we also need to know what modules importlib needs
+import importlib
+
+core_deps=set(sys.modules)
+
+def fix_path(dep_path):
+ import os
+ # We DONT want the path on our HOST system
+ pivot='recipe-sysroot-native'
+ dep_path=dep_path[dep_path.find(pivot)+len(pivot):]
+
+ if '/usr/bin' in dep_path:
+ dep_path = dep_path.replace('/usr/bin''${bindir}')
+
+ # Handle multilib, is there a better way?
+ if '/usr/lib32' in dep_path:
+ dep_path = dep_path.replace('/usr/lib32','${libdir}')
+ if '/usr/lib64' in dep_path:
+ dep_path = dep_path.replace('/usr/lib64','${libdir}')
+ if '/usr/lib' in dep_path:
+ dep_path = dep_path.replace('/usr/lib','${libdir}')
+ if '/usr/include' in dep_path:
+ dep_path = dep_path.replace('/usr/include','${includedir}')
+ if '__init__.' in dep_path:
+ dep_path = os.path.split(dep_path)[0]
+ return dep_path
+
+
+# Module to import was passed as an argument
+current_module = str(sys.argv[1]).rstrip()
+if(debug==True):
+ log = open('log_%s' % current_module,'w')
+ log.write('Module %s generated the following dependencies:\n' % current_module)
+try:
+ importlib.import_module('%s' % current_module)
+except ImportError as e:
+ if (debug==True):
+ log.write('Module was not found')
+ pass
+
+
+# Get current module dependencies, dif will contain a list of specific deps for this module
+module_deps=set(sys.modules)
+
+# We handle the core package (1st pass on create_manifest.py) as a special case
+if current_module == 'python-core-package':
+ dif = core_deps
+else:
+ # We know this is not the core package, so there must be a difference.
+ dif = module_deps-core_deps
+
+
+# Check where each dependency came from
+for item in dif:
+ dep_path=''
+ try:
+ if (debug==True):
+ log.write('Calling: sys.modules[' + '%s' % item + '].__file__\n')
+ dep_path = sys.modules['%s' % item].__file__
+ except AttributeError as e:
+ # Deals with thread (builtin module) not having __file__ attribute
+ if debug==True:
+ log.write(item + ' ')
+ log.write(str(e))
+ log.write('\n')
+ pass
+ except NameError as e:
+ # Deals with NameError: name 'dep_path' is not defined
+ # because module is not found (wasn't compiled?), e.g. bddsm
+ if (debug==True):
+ log.write(item+' ')
+ log.write(str(e))
+ pass
+
+ # Site-customize is a special case since we (OpenEmbedded) put it there manually
+ if 'sitecustomize' in dep_path:
+ dep_path = '${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py'
+ # Prints out result, which is what will be used by create_manifest
+ print (dep_path)
+ continue
+
+ dep_path = fix_path(dep_path)
+
+ import sysconfig
+ soabi=sysconfig.get_config_var('SOABI')
+ # Check if its a shared library and deconstruct it
+ if soabi in dep_path:
+ if (debug==True):
+ log.write('Shared library found in %s' % dep_path)
+ dep_path = dep_path.replace(soabi,'*')
+ print (dep_path)
+ continue
+
+ if (debug==True):
+ log.write(dep_path+'\n')
+ # Prints out result, which is what will be used by create_manifest
+ print (dep_path)
+
+
+ import imp
+ cpython_tag = imp.get_tag()
+ cached=''
+ # Theres no naive way to find *.pyc files on python3
+ try:
+ if (debug==True):
+ log.write('Calling: sys.modules[' + '%s' % item + '].__cached__\n')
+ cached = sys.modules['%s' % item].__cached__
+ except AttributeError as e:
+ # Deals with thread (builtin module) not having __cached__ attribute
+ if debug==True:
+ log.write(item + ' ')
+ log.write(str(e))
+ log.write('\n')
+ pass
+ except NameError as e:
+ # Deals with NameError: name 'cached' is not defined
+ if (debug==True):
+ log.write(item+' ')
+ log.write(str(e))
+ pass
+ if cached is not None:
+ if (debug==True):
+ log.write(cached)
+ cached = fix_path(cached)
+ cached = cached.replace(cpython_tag,'*')
+ print (cached)
+
+if debug==True:
+ log.close()
diff --git a/poky/meta/recipes-devtools/python/python3/host_include_contamination.patch b/poky/meta/recipes-devtools/python/python3/host_include_contamination.patch
new file mode 100644
index 000000000..ef2054d9a
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/host_include_contamination.patch
@@ -0,0 +1,28 @@
+when building python for qemux86-64 on ubuntu 11.10/64bit
+it gropes into host includes and then mixes them with cross
+includes and as a result some modules fail to compile and link
+one of the modules is python-elementtree which is then not
+found during image creation
+
+Proble is that setup.py tries to add native includes that newer
+ubuntu has introduced for multiarch support. But that should
+only happen for native builds and not cross building python
+so we add a check here.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: Python-3.3.0rc2/setup.py
+===================================================================
+--- Python-3.3.0rc2.orig/setup.py 2012-09-20 21:54:50.000000000 -0700
++++ Python-3.3.0rc2/setup.py 2012-09-20 21:57:35.029123858 -0700
+@@ -402,6 +402,9 @@
+
+ if not find_executable('dpkg-architecture'):
+ return
++ if cross_compiling:
++ return
++
+ opt = ''
+ if cross_compiling:
+ opt = '-t' + sysconfig.get_config_var('HOST_GNU_TYPE')
diff --git a/poky/meta/recipes-devtools/python/python3/pass-missing-libraries-to-Extension-for-mul.patch b/poky/meta/recipes-devtools/python/python3/pass-missing-libraries-to-Extension-for-mul.patch
new file mode 100644
index 000000000..5c3af6b62
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/pass-missing-libraries-to-Extension-for-mul.patch
@@ -0,0 +1,82 @@
+From a784b70d47ba2104afbcfd805e2a66cdc2109ec5 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Fri, 4 Aug 2017 11:16:14 +0800
+Subject: [PATCH] setup.py: pass missing libraries to Extension for multiprocessing module
+
+In the following commit:
+...
+commit e711cafab13efc9c1fe6c5cd75826401445eb585
+Author: Benjamin Peterson <benjamin@python.org>
+Date: Wed Jun 11 16:44:04 2008 +0000
+
+ Merged revisions 64104,64117 via svnmerge from
+ svn+ssh://pythondev@svn.python.org/python/trunk
+...
+(see diff in setup.py)
+It assigned libraries for multiprocessing module according
+the host_platform, but not pass it to Extension.
+
+In glibc, the following commit caused two definition of
+sem_getvalue are different.
+https://sourceware.org/git/?p=glibc.git;a=commit;h=042e1521c794a945edc43b5bfa7e69ad70420524
+(see diff in nptl/sem_getvalue.c for detail)
+`__new_sem_getvalue' is the latest sem_getvalue@@GLIBC_2.1
+and `__old_sem_getvalue' is to compat the old version
+sem_getvalue@GLIBC_2.0.
+
+To build python for embedded Linux systems:
+http://www.yoctoproject.org/docs/2.3.1/yocto-project-qs/yocto-project-qs.html
+If not explicitly link to library pthread (-lpthread), it will
+load glibc's sem_getvalue randomly at runtime.
+
+Such as build python on linux x86_64 host and run the python
+on linux x86_32 target. If not link library pthread, it caused
+multiprocessing bounded semaphore could not work correctly.
+...
+>>> import multiprocessing
+>>> pool_sema = multiprocessing.BoundedSemaphore(value=1)
+>>> pool_sema.acquire()
+True
+>>> pool_sema.release()
+Traceback (most recent call last):
+ File "<stdin>", line 1, in <module>
+ValueError: semaphore or lock released too many times
+...
+
+And the semaphore issue also caused multiprocessing.Queue().put() hung.
+
+Upstream-Status: Submitted [https://github.com/python/cpython/pull/2999]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ setup.py | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index 4f0f522..d05707d 100644
+--- a/setup.py
++++ b/setup.py
+@@ -1606,8 +1606,10 @@ class PyBuildExt(build_ext):
+ elif host_platform.startswith('netbsd'):
+ macros = dict()
+ libraries = []
+-
+- else: # Linux and other unices
++ elif host_platform.startswith(('linux')):
++ macros = dict()
++ libraries = ['pthread']
++ else: # Other unices
+ macros = dict()
+ libraries = ['rt']
+
+@@ -1626,6 +1628,7 @@ class PyBuildExt(build_ext):
+ if sysconfig.get_config_var('WITH_THREAD'):
+ exts.append ( Extension('_multiprocessing', multiprocessing_srcs,
+ define_macros=list(macros.items()),
++ libraries=libraries,
+ include_dirs=["Modules/_multiprocessing"]))
+ else:
+ missing.append('_multiprocessing')
+--
+2.7.4
+
diff --git a/poky/meta/recipes-devtools/python/python3/python-3.3-multilib.patch b/poky/meta/recipes-devtools/python/python3/python-3.3-multilib.patch
new file mode 100644
index 000000000..cc35dc161
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/python-3.3-multilib.patch
@@ -0,0 +1,363 @@
+From 51fe6f22d0ba113674fb358bd11d75fe659bd26e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 14 May 2013 15:00:26 -0700
+Subject: [PATCH 01/13] get the sys.lib from python itself and do not use
+ hardcoded value of 'lib'
+
+02/2015 Rebased for 3.4.2
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+---
+ Include/pythonrun.h | 3 +++
+ Lib/distutils/command/install.py | 4 +++-
+ Lib/pydoc.py | 2 +-
+ Lib/site.py | 4 ++--
+ Lib/sysconfig.py | 18 +++++++++---------
+ Lib/trace.py | 4 ++--
+ Makefile.pre.in | 7 +++++--
+ Modules/getpath.c | 10 +++++++++-
+ Python/getplatform.c | 20 ++++++++++++++++++++
+ Python/sysmodule.c | 4 ++++
+ configure.ac | 35 +++++++++++++++++++++++++++++++++++
+ setup.py | 9 ++++-----
+ 12 files changed, 97 insertions(+), 23 deletions(-)
+
+Index: Python-3.5.4/Include/pythonrun.h
+===================================================================
+--- Python-3.5.4.orig/Include/pythonrun.h
++++ Python-3.5.4/Include/pythonrun.h
+@@ -23,6 +23,9 @@ typedef struct {
+ } PyCompilerFlags;
+ #endif
+
++PyAPI_FUNC(const char *) Py_GetArch(void);
++PyAPI_FUNC(const char *) Py_GetLib(void);
++
+ #ifndef Py_LIMITED_API
+ PyAPI_FUNC(int) PyRun_SimpleStringFlags(const char *, PyCompilerFlags *);
+ PyAPI_FUNC(int) PyRun_AnyFileFlags(FILE *, const char *, PyCompilerFlags *);
+Index: Python-3.5.4/Lib/distutils/command/install.py
+===================================================================
+--- Python-3.5.4.orig/Lib/distutils/command/install.py
++++ Python-3.5.4/Lib/distutils/command/install.py
+@@ -19,6 +19,8 @@ from site import USER_BASE
+ from site import USER_SITE
+ HAS_USER_SITE = True
+
++libname = sys.lib
++
+ WINDOWS_SCHEME = {
+ 'purelib': '$base/Lib/site-packages',
+ 'platlib': '$base/Lib/site-packages',
+@@ -29,8 +31,8 @@ WINDOWS_SCHEME = {
+
+ INSTALL_SCHEMES = {
+ 'unix_prefix': {
+- 'purelib': '$base/lib/python$py_version_short/site-packages',
+- 'platlib': '$platbase/lib/python$py_version_short/site-packages',
++ 'purelib': '$platbase/'+libname+'/python$py_version_short/site-packages',
++ 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages',
+ 'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
+ 'scripts': '$base/bin',
+ 'data' : '$base',
+Index: Python-3.5.4/Lib/pydoc.py
+===================================================================
+--- Python-3.5.4.orig/Lib/pydoc.py
++++ Python-3.5.4/Lib/pydoc.py
+@@ -389,7 +389,7 @@ class Doc:
+ docmodule = docclass = docroutine = docother = docproperty = docdata = fail
+
+ def getdocloc(self, object,
+- basedir=os.path.join(sys.base_exec_prefix, "lib",
++ basedir=os.path.join(sys.base_exec_prefix, sys.lib,
+ "python%d.%d" % sys.version_info[:2])):
+ """Return the location of module docs or None"""
+
+Index: Python-3.5.4/Lib/site.py
+===================================================================
+--- Python-3.5.4.orig/Lib/site.py
++++ Python-3.5.4/Lib/site.py
+@@ -303,12 +303,12 @@ def getsitepackages(prefixes=None):
+ seen.add(prefix)
+
+ if os.sep == '/':
+- sitepackages.append(os.path.join(prefix, "lib",
++ sitepackages.append(os.path.join(prefix, sys.lib,
+ "python" + sys.version[:3],
+ "site-packages"))
+ else:
+ sitepackages.append(prefix)
+- sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
++ sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
+ if sys.platform == "darwin":
+ # for framework builds *only* we add the standard Apple
+ # locations.
+Index: Python-3.5.4/Lib/sysconfig.py
+===================================================================
+--- Python-3.5.4.orig/Lib/sysconfig.py
++++ Python-3.5.4/Lib/sysconfig.py
+@@ -20,10 +20,10 @@ __all__ = [
+
+ _INSTALL_SCHEMES = {
+ 'posix_prefix': {
+- 'stdlib': '{installed_base}/lib/python{py_version_short}',
+- 'platstdlib': '{platbase}/lib/python{py_version_short}',
+- 'purelib': '{base}/lib/python{py_version_short}/site-packages',
+- 'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
++ 'stdlib': '{installed_base}/'+sys.lib+'/python{py_version_short}',
++ 'platstdlib': '{platbase}/'+sys.lib+'/python{py_version_short}',
++ 'purelib': '{platbase}/'+sys.lib+'/python{py_version_short}/site-packages',
++ 'platlib': '{platbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'include':
+ '{installed_base}/include/python{py_version_short}{abiflags}',
+ 'platinclude':
+@@ -32,10 +32,10 @@ _INSTALL_SCHEMES = {
+ 'data': '{base}',
+ },
+ 'posix_home': {
+- 'stdlib': '{installed_base}/lib/python',
+- 'platstdlib': '{base}/lib/python',
+- 'purelib': '{base}/lib/python',
+- 'platlib': '{base}/lib/python',
++ 'stdlib': '{installed_base}/'+sys.lib+'/python',
++ 'platstdlib': '{base}/'+sys.lib+'/python',
++ 'purelib': '{base}/'+sys.lib+'/python',
++ 'platlib': '{base}/'+sys.lib+'/python',
+ 'include': '{installed_base}/include/python',
+ 'platinclude': '{installed_base}/include/python',
+ 'scripts': '{base}/bin',
+@@ -61,10 +61,10 @@ _INSTALL_SCHEMES = {
+ 'data': '{userbase}',
+ },
+ 'posix_user': {
+- 'stdlib': '{userbase}/lib/python{py_version_short}',
+- 'platstdlib': '{userbase}/lib/python{py_version_short}',
+- 'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
+- 'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
++ 'stdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
++ 'platstdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
++ 'purelib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
++ 'platlib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+ 'include': '{userbase}/include/python{py_version_short}',
+ 'scripts': '{userbase}/bin',
+ 'data': '{userbase}',
+Index: Python-3.5.4/Lib/trace.py
+===================================================================
+--- Python-3.5.4.orig/Lib/trace.py
++++ Python-3.5.4/Lib/trace.py
+@@ -749,10 +749,10 @@ def main(argv=None):
+ # should I also call expanduser? (after all, could use $HOME)
+
+ s = s.replace("$prefix",
+- os.path.join(sys.base_prefix, "lib",
++ os.path.join(sys.base_prefix, sys.lib,
+ "python" + sys.version[:3]))
+ s = s.replace("$exec_prefix",
+- os.path.join(sys.base_exec_prefix, "lib",
++ os.path.join(sys.base_exec_prefix, sys.lib,
+ "python" + sys.version[:3]))
+ s = os.path.normpath(s)
+ ignore_dirs.append(s)
+Index: Python-3.5.4/Makefile.pre.in
+===================================================================
+--- Python-3.5.4.orig/Makefile.pre.in
++++ Python-3.5.4/Makefile.pre.in
+@@ -109,6 +109,8 @@ CFLAGS_ALIASING=@CFLAGS_ALIASING@
+
+ # Machine-dependent subdirectories
+ MACHDEP= @MACHDEP@
++LIB= @LIB@
++ARCH= @ARCH@
+
+ # Multiarch directory (may be empty)
+ MULTIARCH= @MULTIARCH@
+@@ -128,7 +130,7 @@ LIBDIR= @libdir@
+ MANDIR= @mandir@
+ INCLUDEDIR= @includedir@
+ CONFINCLUDEDIR= $(exec_prefix)/include
+-SCRIPTDIR= $(prefix)/lib
++SCRIPTDIR= @libdir@
+ ABIFLAGS= @ABIFLAGS@
+
+ # Detailed destination directories
+@@ -731,6 +733,7 @@ Modules/getpath.o: $(srcdir)/Modules/get
+ -DEXEC_PREFIX='"$(exec_prefix)"' \
+ -DVERSION='"$(VERSION)"' \
+ -DVPATH='"$(VPATH)"' \
++ -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' \
+ -o $@ $(srcdir)/Modules/getpath.c
+
+ Programs/python.o: $(srcdir)/Programs/python.c
+@@ -813,7 +816,7 @@ regen-opcode:
+ Python/compile.o Python/symtable.o Python/ast.o: $(srcdir)/Include/graminit.h $(srcdir)/Include/Python-ast.h
+
+ Python/getplatform.o: $(srcdir)/Python/getplatform.c
+- $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
++ $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
+
+ Python/importdl.o: $(srcdir)/Python/importdl.c
+ $(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
+Index: Python-3.5.4/Modules/getpath.c
+===================================================================
+--- Python-3.5.4.orig/Modules/getpath.c
++++ Python-3.5.4/Modules/getpath.c
+@@ -105,6 +105,13 @@
+ #error "PREFIX, EXEC_PREFIX, VERSION, and VPATH must be constant defined"
+ #endif
+
++#define LIB_PYTHON LIB "/python" VERSION
++
++#ifndef PYTHONPATH
++#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \
++ EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload"
++#endif
++
+ #ifndef LANDMARK
+ #define LANDMARK L"os.py"
+ #endif
+@@ -113,6 +120,7 @@ static wchar_t prefix[MAXPATHLEN+1];
+ static wchar_t exec_prefix[MAXPATHLEN+1];
+ static wchar_t progpath[MAXPATHLEN+1];
+ static wchar_t *module_search_path = NULL;
++static wchar_t *lib_python = L"" LIB_PYTHON;
+
+ /* Get file status. Encode the path to the locale encoding. */
+
+@@ -494,7 +502,7 @@ calculate_path(void)
+ _pythonpath = Py_DecodeLocale(PYTHONPATH, NULL);
+ _prefix = Py_DecodeLocale(PREFIX, NULL);
+ _exec_prefix = Py_DecodeLocale(EXEC_PREFIX, NULL);
+- lib_python = Py_DecodeLocale("lib/python" VERSION, NULL);
++ lib_python = Py_DecodeLocale(LIB_PYTHON, NULL);
+
+ if (!_pythonpath || !_prefix || !_exec_prefix || !lib_python) {
+ Py_FatalError(
+Index: Python-3.5.4/Python/getplatform.c
+===================================================================
+--- Python-3.5.4.orig/Python/getplatform.c
++++ Python-3.5.4/Python/getplatform.c
+@@ -10,3 +10,23 @@ Py_GetPlatform(void)
+ {
+ return PLATFORM;
+ }
++
++#ifndef ARCH
++#define ARCH "unknown"
++#endif
++
++const char *
++Py_GetArch(void)
++{
++ return ARCH;
++}
++
++#ifndef LIB
++#define LIB "lib"
++#endif
++
++const char *
++Py_GetLib(void)
++{
++ return LIB;
++}
+Index: Python-3.5.4/Python/sysmodule.c
+===================================================================
+--- Python-3.5.4.orig/Python/sysmodule.c
++++ Python-3.5.4/Python/sysmodule.c
+@@ -1827,6 +1827,10 @@ _PySys_Init(void)
+ PyUnicode_FromString(Py_GetCopyright()));
+ SET_SYS_FROM_STRING("platform",
+ PyUnicode_FromString(Py_GetPlatform()));
++ SET_SYS_FROM_STRING("arch",
++ PyUnicode_FromString(Py_GetArch()));
++ SET_SYS_FROM_STRING("lib",
++ PyUnicode_FromString(Py_GetLib()));
+ SET_SYS_FROM_STRING("executable",
+ PyUnicode_FromWideChar(
+ Py_GetProgramFullPath(), -1));
+Index: Python-3.5.4/configure.ac
+===================================================================
+--- Python-3.5.4.orig/configure.ac
++++ Python-3.5.4/configure.ac
+@@ -885,6 +885,41 @@ PLATDIR=plat-$MACHDEP
+ AC_SUBST(PLATDIR)
+ AC_SUBST(PLATFORM_TRIPLET)
+
++AC_SUBST(ARCH)
++AC_MSG_CHECKING(ARCH)
++ARCH=`uname -m`
++case $ARCH in
++i?86) ARCH=i386;;
++esac
++AC_MSG_RESULT($ARCH)
++
++AC_SUBST(LIB)
++AC_MSG_CHECKING(LIB)
++case $ac_sys_system in
++Linux*)
++ # Test if the compiler is 64bit
++ echo 'int i;' > conftest.$ac_ext
++ python_cv_cc_64bit_output=no
++ if AC_TRY_EVAL(ac_compile); then
++ case `/usr/bin/file conftest.$ac_objext` in
++ *"ELF 64"*)
++ python_cv_cc_64bit_output=yes
++ ;;
++ esac
++ fi
++ rm -rf conftest*
++ ;;
++esac
++
++case $ARCH:$python_cv_cc_64bit_output in
++ppc64:yes | powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
++ LIB="lib64"
++ ;;
++*:*)
++ LIB="lib"
++ ;;
++esac
++AC_MSG_RESULT($LIB)
+
+ AC_MSG_CHECKING([for -Wl,--no-as-needed])
+ save_LDFLAGS="$LDFLAGS"
+Index: Python-3.5.4/setup.py
+===================================================================
+--- Python-3.5.4.orig/setup.py
++++ Python-3.5.4/setup.py
+@@ -494,7 +494,7 @@ class PyBuildExt(build_ext):
+ # directories (i.e. '.' and 'Include') must be first. See issue
+ # 10520.
+ if not cross_compiling:
+- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
++ add_dir_to_list(self.compiler.library_dirs, os.path.join('/usr/local', sys.lib))
+ add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+ # only change this for cross builds for 3.3, issues on Mageia
+ if cross_compiling:
+@@ -552,8 +552,7 @@ class PyBuildExt(build_ext):
+ # be assumed that no additional -I,-L directives are needed.
+ if not cross_compiling:
+ lib_dirs = self.compiler.library_dirs + [
+- '/lib64', '/usr/lib64',
+- '/lib', '/usr/lib',
++ '/' + sys.lib, '/usr/' + sys.lib,
+ ]
+ inc_dirs = self.compiler.include_dirs + ['/usr/include']
+ else:
+@@ -745,11 +744,11 @@ class PyBuildExt(build_ext):
+ elif curses_library:
+ readline_libs.append(curses_library)
+ elif self.compiler.find_library_file(lib_dirs +
+- ['/usr/lib/termcap'],
++ ['/usr/'+sys.lib+'/termcap'],
+ 'termcap'):
+ readline_libs.append('termcap')
+ exts.append( Extension('readline', ['readline.c'],
+- library_dirs=['/usr/lib/termcap'],
++ library_dirs=['/usr/'+sys.lib+'/termcap'],
+ extra_link_args=readline_extra_link_args,
+ libraries=readline_libs) )
+ else:
diff --git a/poky/meta/recipes-devtools/python/python3/python-config.patch b/poky/meta/recipes-devtools/python/python3/python-config.patch
new file mode 100644
index 000000000..f23b8b7df
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/python-config.patch
@@ -0,0 +1,46 @@
+python-config: Revert to using distutils.sysconfig
+
+The newer sysconfig module shares some code with distutils.sysconfig, but the same modifications as in
+
+12-distutils-prefix-is-inside-staging-area.patch makes distutils.sysconfig
+
+affect the native runtime as well as cross building. Use the old, patched
+implementation which returns paths in the staging directory and for the target,
+as appropriate.
+
+Upstream-Status: Inappropriate [Embedded Specific]
+
+Signed-off-by: Tyler Hall <tylerwhall@gmail.com>
+:
+Index: Python-3.3.3/Misc/python-config.in
+===================================================================
+--- Python-3.3.3.orig/Misc/python-config.in
++++ Python-3.3.3/Misc/python-config.in
+@@ -4,7 +4,7 @@
+ import getopt
+ import os
+ import sys
+-import sysconfig
++from distutils import sysconfig
+
+ valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags',
+ 'ldflags', 'extension-suffix', 'help', 'abiflags', 'configdir']
+@@ -32,14 +32,14 @@ if '--help' in opt_flags:
+
+ for opt in opt_flags:
+ if opt == '--prefix':
+- print(sysconfig.get_config_var('prefix'))
++ print(sysconfig.PREFIX)
+
+ elif opt == '--exec-prefix':
+- print(sysconfig.get_config_var('exec_prefix'))
++ print(sysconfig.EXEC_PREFIX)
+
+ elif opt in ('--includes', '--cflags'):
+- flags = ['-I' + sysconfig.get_path('include'),
+- '-I' + sysconfig.get_path('platinclude')]
++ flags = ['-I' + sysconfig.get_python_inc(),
++ '-I' + sysconfig.get_python_inc(plat_specific=True)]
+ if opt == '--cflags':
+ flags.extend(getvar('CFLAGS').split())
+ print(' '.join(flags))
diff --git a/poky/meta/recipes-devtools/python/python3/python3-manifest.json b/poky/meta/recipes-devtools/python/python3/python3-manifest.json
new file mode 100644
index 000000000..2491f36db
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/python3-manifest.json
@@ -0,0 +1,1149 @@
+{
+ "2to3": {
+ "cached": [],
+ "files": [
+ "${bindir}/2to3-*",
+ "${libdir}/python3.5/lib2to3"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python automated Python 2 to 3 code translator"
+ },
+ "asyncio": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/asyncio",
+ "${libdir}/python3.5/concurrent",
+ "${libdir}/python3.5/concurrent/futures"
+ ],
+ "rdepends": [
+ "compression",
+ "core",
+ "crypt",
+ "io",
+ "logging",
+ "math",
+ "multiprocessing",
+ "netclient",
+ "pickle",
+ "shell",
+ "stringold",
+ "threading",
+ "unixadmin"
+ ],
+ "summary": "Python Asynchronous I/"
+ },
+ "audio": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/chunk.*.pyc",
+ "${libdir}/python3.5/__pycache__/sndhdr.*.pyc",
+ "${libdir}/python3.5/__pycache__/sunau.*.pyc",
+ "${libdir}/python3.5/__pycache__/wave.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/chunk.py",
+ "${libdir}/python3.5/lib-dynload/audioop.*.so",
+ "${libdir}/python3.5/lib-dynload/ossaudiodev.*.so",
+ "${libdir}/python3.5/sndhdr.py",
+ "${libdir}/python3.5/sunau.py",
+ "${libdir}/python3.5/wave.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python Audio Handling"
+ },
+ "codecs": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/xdrlib.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/lib-dynload/_multibytecodec.*.so",
+ "${libdir}/python3.5/xdrlib.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python codec"
+ },
+ "compile": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/compileall.*.pyc",
+ "${libdir}/python3.5/__pycache__/py_compile.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/compileall.py",
+ "${libdir}/python3.5/py_compile.py"
+ ],
+ "rdepends": [
+ "asyncio",
+ "compression",
+ "core",
+ "crypt",
+ "io",
+ "logging",
+ "math",
+ "multiprocessing",
+ "pickle",
+ "shell",
+ "stringold",
+ "threading",
+ "unixadmin"
+ ],
+ "summary": "Python bytecode compilation support"
+ },
+ "compression": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/_compression.*.pyc",
+ "${libdir}/python3.5/__pycache__/bz2.*.pyc",
+ "${libdir}/python3.5/__pycache__/gzip.*.pyc",
+ "${libdir}/python3.5/__pycache__/lzma.*.pyc",
+ "${libdir}/python3.5/__pycache__/tarfile.*.pyc",
+ "${libdir}/python3.5/__pycache__/zipfile.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/_compression.py",
+ "${libdir}/python3.5/bz2.py",
+ "${libdir}/python3.5/gzip.py",
+ "${libdir}/python3.5/lib-dynload/_bz2.*.so",
+ "${libdir}/python3.5/lib-dynload/_lzma.*.so",
+ "${libdir}/python3.5/lib-dynload/zlib.*.so",
+ "${libdir}/python3.5/lzma.py",
+ "${libdir}/python3.5/tarfile.py",
+ "${libdir}/python3.5/zipfile.py"
+ ],
+ "rdepends": [
+ "core",
+ "shell",
+ "unixadmin"
+ ],
+ "summary": "Python high-level compression support"
+ },
+ "core": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/__future__.*.pyc",
+ "${libdir}/python3.5/__pycache__/_bootlocale.*.pyc",
+ "${libdir}/python3.5/__pycache__/_collections_abc.*.pyc",
+ "${libdir}/python3.5/__pycache__/_markupbase.*.pyc",
+ "${libdir}/python3.5/__pycache__/_sitebuiltins.*.pyc",
+ "${libdir}/python3.5/__pycache__/_sysconfigdata.*.pyc",
+ "${libdir}/python3.5/__pycache__/_weakrefset.*.pyc",
+ "${libdir}/python3.5/__pycache__/abc.*.pyc",
+ "${libdir}/python3.5/__pycache__/argparse.*.pyc",
+ "${libdir}/python3.5/__pycache__/ast.*.pyc",
+ "${libdir}/python3.5/__pycache__/bisect.*.pyc",
+ "${libdir}/python3.5/__pycache__/code.*.pyc",
+ "${libdir}/python3.5/__pycache__/codecs.*.pyc",
+ "${libdir}/python3.5/__pycache__/codeop.*.pyc",
+ "${libdir}/python3.5/__pycache__/configparser.*.pyc",
+ "${libdir}/python3.5/__pycache__/contextlib.*.pyc",
+ "${libdir}/python3.5/__pycache__/copy.*.pyc",
+ "${libdir}/python3.5/__pycache__/copyreg.*.pyc",
+ "${libdir}/python3.5/__pycache__/csv.*.pyc",
+ "${libdir}/python3.5/__pycache__/dis.*.pyc",
+ "${libdir}/python3.5/__pycache__/enum.*.pyc",
+ "${libdir}/python3.5/__pycache__/functools.*.pyc",
+ "${libdir}/python3.5/__pycache__/genericpath.*.pyc",
+ "${libdir}/python3.5/__pycache__/getopt.*.pyc",
+ "${libdir}/python3.5/__pycache__/gettext.*.pyc",
+ "${libdir}/python3.5/__pycache__/heapq.*.pyc",
+ "${libdir}/python3.5/__pycache__/imp.*.pyc",
+ "${libdir}/python3.5/__pycache__/inspect.*.pyc",
+ "${libdir}/python3.5/__pycache__/io.*.pyc",
+ "${libdir}/python3.5/__pycache__/keyword.*.pyc",
+ "${libdir}/python3.5/__pycache__/linecache.*.pyc",
+ "${libdir}/python3.5/__pycache__/locale.*.pyc",
+ "${libdir}/python3.5/__pycache__/opcode.*.pyc",
+ "${libdir}/python3.5/__pycache__/operator.*.pyc",
+ "${libdir}/python3.5/__pycache__/optparse.*.pyc",
+ "${libdir}/python3.5/__pycache__/os.*.pyc",
+ "${libdir}/python3.5/__pycache__/platform.*.pyc",
+ "${libdir}/python3.5/__pycache__/posixpath.*.pyc",
+ "${libdir}/python3.5/__pycache__/re.*.pyc",
+ "${libdir}/python3.5/__pycache__/reprlib.*.pyc",
+ "${libdir}/python3.5/__pycache__/rlcompleter.*.pyc",
+ "${libdir}/python3.5/__pycache__/selectors.*.pyc",
+ "${libdir}/python3.5/__pycache__/signal.*.pyc",
+ "${libdir}/python3.5/__pycache__/site.*.pyc",
+ "${libdir}/python3.5/__pycache__/sre_compile.*.pyc",
+ "${libdir}/python3.5/__pycache__/sre_constants.*.pyc",
+ "${libdir}/python3.5/__pycache__/sre_parse.*.pyc",
+ "${libdir}/python3.5/__pycache__/stat.*.pyc",
+ "${libdir}/python3.5/__pycache__/stringprep.*.pyc",
+ "${libdir}/python3.5/__pycache__/struct.*.pyc",
+ "${libdir}/python3.5/__pycache__/subprocess.*.pyc",
+ "${libdir}/python3.5/__pycache__/symbol.*.pyc",
+ "${libdir}/python3.5/__pycache__/sysconfig.*.pyc",
+ "${libdir}/python3.5/__pycache__/textwrap.*.pyc",
+ "${libdir}/python3.5/__pycache__/threading.*.pyc",
+ "${libdir}/python3.5/__pycache__/token.*.pyc",
+ "${libdir}/python3.5/__pycache__/tokenize.*.pyc",
+ "${libdir}/python3.5/__pycache__/traceback.*.pyc",
+ "${libdir}/python3.5/__pycache__/types.*.pyc",
+ "${libdir}/python3.5/__pycache__/warnings.*.pyc",
+ "${libdir}/python3.5/__pycache__/weakref.*.pyc",
+ "${libdir}/python3.5/collections/__pycache__",
+ "${libdir}/python3.5/collections/__pycache__/abc.*.pyc",
+ "${libdir}/python3.5/encodings/__pycache__",
+ "${libdir}/python3.5/encodings/__pycache__/aliases.*.pyc",
+ "${libdir}/python3.5/encodings/__pycache__/latin_1.*.pyc",
+ "${libdir}/python3.5/encodings/__pycache__/utf_8.*.pyc",
+ "${libdir}/python3.5/importlib/__pycache__",
+ "${libdir}/python3.5/importlib/__pycache__/abc.*.pyc",
+ "${libdir}/python3.5/importlib/__pycache__/machinery.*.pyc",
+ "${libdir}/python3.5/importlib/__pycache__/util.*.pyc"
+ ],
+ "files": [
+ "${bindir}/python*[!-config]",
+ "${includedir}/python${PYTHON_BINABI}/pyconfig*.h",
+ "${libdir}/python${PYTHON_MAJMIN}/_collections_abc.py",
+ "${libdir}/python${PYTHON_MAJMIN}/_sitebuiltins.py",
+ "${libdir}/python${PYTHON_MAJMIN}/collections",
+ "${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py",
+ "${libdir}/python3.5/UserDict.py",
+ "${libdir}/python3.5/UserList.py",
+ "${libdir}/python3.5/UserString.py",
+ "${libdir}/python3.5/__future__.py",
+ "${libdir}/python3.5/_abcoll.py",
+ "${libdir}/python3.5/_bootlocale.py",
+ "${libdir}/python3.5/_collections_abc.py",
+ "${libdir}/python3.5/_markupbase.py",
+ "${libdir}/python3.5/_sitebuiltins.py",
+ "${libdir}/python3.5/_sysconfigdata.py",
+ "${libdir}/python3.5/_weakrefset.py",
+ "${libdir}/python3.5/abc.py",
+ "${libdir}/python3.5/argparse.py",
+ "${libdir}/python3.5/ast.py",
+ "${libdir}/python3.5/bisect.py",
+ "${libdir}/python3.5/code.py",
+ "${libdir}/python3.5/codecs.py",
+ "${libdir}/python3.5/codeop.py",
+ "${libdir}/python3.5/collections",
+ "${libdir}/python3.5/collections/abc.py",
+ "${libdir}/python3.5/configparser.py",
+ "${libdir}/python3.5/contextlib.py",
+ "${libdir}/python3.5/copy.py",
+ "${libdir}/python3.5/copyreg.py",
+ "${libdir}/python3.5/csv.py",
+ "${libdir}/python3.5/dis.py",
+ "${libdir}/python3.5/encodings",
+ "${libdir}/python3.5/encodings/aliases.py",
+ "${libdir}/python3.5/encodings/latin_1.py",
+ "${libdir}/python3.5/encodings/utf_8.py",
+ "${libdir}/python3.5/enum.py",
+ "${libdir}/python3.5/functools.py",
+ "${libdir}/python3.5/genericpath.py",
+ "${libdir}/python3.5/getopt.py",
+ "${libdir}/python3.5/gettext.py",
+ "${libdir}/python3.5/heapq.py",
+ "${libdir}/python3.5/imp.py",
+ "${libdir}/python3.5/importlib",
+ "${libdir}/python3.5/importlib/_bootstrap.py",
+ "${libdir}/python3.5/importlib/_bootstrap_external.py",
+ "${libdir}/python3.5/importlib/abc.py",
+ "${libdir}/python3.5/importlib/machinery.py",
+ "${libdir}/python3.5/importlib/util.py",
+ "${libdir}/python3.5/inspect.py",
+ "${libdir}/python3.5/io.py",
+ "${libdir}/python3.5/keyword.py",
+ "${libdir}/python3.5/lib-dynload/__pycache__/_struct.*.so",
+ "${libdir}/python3.5/lib-dynload/__pycache__/binascii.*.so",
+ "${libdir}/python3.5/lib-dynload/__pycache__/time.*.so",
+ "${libdir}/python3.5/lib-dynload/__pycache__/xreadlines.*.so",
+ "${libdir}/python3.5/lib-dynload/_bisect.*.so",
+ "${libdir}/python3.5/lib-dynload/_csv.*.so",
+ "${libdir}/python3.5/lib-dynload/_heapq.*.so",
+ "${libdir}/python3.5/lib-dynload/_opcode.*.so",
+ "${libdir}/python3.5/lib-dynload/_posixsubprocess.*.so",
+ "${libdir}/python3.5/lib-dynload/_struct.*.so",
+ "${libdir}/python3.5/lib-dynload/array.*.so",
+ "${libdir}/python3.5/lib-dynload/binascii.*.so",
+ "${libdir}/python3.5/lib-dynload/math.*.so",
+ "${libdir}/python3.5/lib-dynload/parser.*.so",
+ "${libdir}/python3.5/lib-dynload/readline.*.so",
+ "${libdir}/python3.5/lib-dynload/select.*.so",
+ "${libdir}/python3.5/lib-dynload/time.*.so",
+ "${libdir}/python3.5/lib-dynload/unicodedata.*.so",
+ "${libdir}/python3.5/lib-dynload/xreadlines.*.so",
+ "${libdir}/python3.5/linecache.py",
+ "${libdir}/python3.5/locale.py",
+ "${libdir}/python3.5/new.py",
+ "${libdir}/python3.5/opcode.py",
+ "${libdir}/python3.5/operator.py",
+ "${libdir}/python3.5/optparse.py",
+ "${libdir}/python3.5/os.py",
+ "${libdir}/python3.5/platform.py",
+ "${libdir}/python3.5/posixpath.py",
+ "${libdir}/python3.5/re.py",
+ "${libdir}/python3.5/reprlib.py",
+ "${libdir}/python3.5/rlcompleter.py",
+ "${libdir}/python3.5/selectors.py",
+ "${libdir}/python3.5/signal.py",
+ "${libdir}/python3.5/site.py",
+ "${libdir}/python3.5/sre_compile.py",
+ "${libdir}/python3.5/sre_constants.py",
+ "${libdir}/python3.5/sre_parse.py",
+ "${libdir}/python3.5/stat.py",
+ "${libdir}/python3.5/stringprep.py",
+ "${libdir}/python3.5/struct.py",
+ "${libdir}/python3.5/subprocess.py",
+ "${libdir}/python3.5/symbol.py",
+ "${libdir}/python3.5/sysconfig.py",
+ "${libdir}/python3.5/textwrap.py",
+ "${libdir}/python3.5/threading.py",
+ "${libdir}/python3.5/token.py",
+ "${libdir}/python3.5/tokenize.py",
+ "${libdir}/python3.5/traceback.py",
+ "${libdir}/python3.5/types.py",
+ "${libdir}/python3.5/warnings.py",
+ "${libdir}/python3.5/weakref.py"
+ ],
+ "rdepends": [],
+ "summary": "Python interpreter and core modules"
+ },
+ "crypt": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/crypt.*.pyc",
+ "${libdir}/python3.5/__pycache__/hashlib.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/crypt.py",
+ "${libdir}/python3.5/hashlib.py",
+ "${libdir}/python3.5/lib-dynload/_crypt.*.so",
+ "${libdir}/python3.5/lib-dynload/_hashlib.*.so",
+ "${libdir}/python3.5/lib-dynload/_sha256.*.so",
+ "${libdir}/python3.5/lib-dynload/_sha512.*.so"
+ ],
+ "rdepends": [
+ "core",
+ "math",
+ "stringold"
+ ],
+ "summary": "Python basic cryptographic and hashing support"
+ },
+ "ctypes": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/ctypes",
+ "${libdir}/python3.5/lib-dynload/_ctypes.*.so",
+ "${libdir}/python3.5/lib-dynload/_ctypes_test.*.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python C types support"
+ },
+ "curses": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/curses",
+ "${libdir}/python3.5/lib-dynload/_curses.*.so",
+ "${libdir}/python3.5/lib-dynload/_curses_panel.*.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python curses support"
+ },
+ "datetime": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/_strptime.*.pyc",
+ "${libdir}/python3.5/__pycache__/calendar.*.pyc",
+ "${libdir}/python3.5/__pycache__/datetime.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/_strptime.py",
+ "${libdir}/python3.5/calendar.py",
+ "${libdir}/python3.5/datetime.py",
+ "${libdir}/python3.5/lib-dynload/_datetime.*.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python calendar and time support"
+ },
+ "db": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/dbm",
+ "${libdir}/python3.5/lib-dynload/_dbm.*.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python file-based database support"
+ },
+ "debugger": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/bdb.*.pyc",
+ "${libdir}/python3.5/__pycache__/pdb.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/bdb.py",
+ "${libdir}/python3.5/pdb.py"
+ ],
+ "rdepends": [
+ "core",
+ "pprint",
+ "shell",
+ "stringold"
+ ],
+ "summary": "Python debugger"
+ },
+ "dev": {
+ "cached": [],
+ "files": [
+ "${base_libdir}/*.a",
+ "${base_libdir}/*.o",
+ "${bindir}/python*-config",
+ "${datadir}/aclocal",
+ "${datadir}/pkgconfig",
+ "${includedir}",
+ "${libdir}/*.a",
+ "${libdir}/*.la",
+ "${libdir}/*.o",
+ "${libdir}/lib*${SOLIBSDEV}",
+ "${libdir}/pkgconfig",
+ "${libdir}/python3.5/config*/Makefile",
+ "${libdir}/python3.5/config*/Makefile/__pycache__"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python development package"
+ },
+ "difflib": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/difflib.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/difflib.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python helpers for computing deltas between objects"
+ },
+ "distutils": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/distutils"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python Distribution Utilities"
+ },
+ "distutils-staticdev": {
+ "cached": [
+ "${libdir}/python3.5/config/__pycache__/lib*.a"
+ ],
+ "files": [
+ "${libdir}/python3.5/config/lib*.a"
+ ],
+ "rdepends": [
+ "distutils"
+ ],
+ "summary": "Python distribution utilities (static libraries)"
+ },
+ "doctest": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/doctest.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/doctest.py"
+ ],
+ "rdepends": [
+ "core",
+ "debugger",
+ "difflib",
+ "logging",
+ "pprint",
+ "shell",
+ "stringold",
+ "unittest"
+ ],
+ "summary": "Python framework for running examples in docstrings"
+ },
+ "email": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/imaplib.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/email",
+ "${libdir}/python3.5/imaplib.py"
+ ],
+ "rdepends": [
+ "core",
+ "crypt",
+ "datetime",
+ "io",
+ "math",
+ "netclient"
+ ],
+ "summary": "Python email support"
+ },
+ "fcntl": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/lib-dynload/fcntl.*.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python's fcntl interface"
+ },
+ "gdbm": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/lib-dynload/_gdbm.*.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python GNU database support"
+ },
+ "html": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/formatter.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/formatter.py",
+ "${libdir}/python3.5/html"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python HTML processing support"
+ },
+ "idle": {
+ "cached": [],
+ "files": [
+ "${bindir}/idle*",
+ "${libdir}/python3.5/idlelib"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python Integrated Development Environment"
+ },
+ "image": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/colorsys.*.pyc",
+ "${libdir}/python3.5/__pycache__/imghdr.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/colorsys.py",
+ "${libdir}/python3.5/imghdr.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python graphical image handling"
+ },
+ "io": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/_pyio.*.pyc",
+ "${libdir}/python3.5/__pycache__/ipaddress.*.pyc",
+ "${libdir}/python3.5/__pycache__/pipes.*.pyc",
+ "${libdir}/python3.5/__pycache__/socket.*.pyc",
+ "${libdir}/python3.5/__pycache__/ssl.*.pyc",
+ "${libdir}/python3.5/__pycache__/tempfile.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/_pyio.py",
+ "${libdir}/python3.5/ipaddress.py",
+ "${libdir}/python3.5/lib-dynload/_socket.*.so",
+ "${libdir}/python3.5/lib-dynload/_ssl.*.so",
+ "${libdir}/python3.5/lib-dynload/termios.*.so",
+ "${libdir}/python3.5/pipes.py",
+ "${libdir}/python3.5/socket.py",
+ "${libdir}/python3.5/ssl.py",
+ "${libdir}/python3.5/tempfile.py"
+ ],
+ "rdepends": [
+ "compression",
+ "core",
+ "crypt",
+ "math",
+ "netclient",
+ "shell",
+ "unixadmin"
+ ],
+ "summary": "Python low-level I/O"
+ },
+ "json": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/json",
+ "${libdir}/python3.5/lib-dynload/_json.*.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python JSON support"
+ },
+ "logging": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/logging"
+ ],
+ "rdepends": [
+ "core",
+ "stringold"
+ ],
+ "summary": "Python logging support"
+ },
+ "mailbox": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/mailbox.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/mailbox.py"
+ ],
+ "rdepends": [
+ "core",
+ "crypt",
+ "datetime",
+ "email",
+ "fcntl",
+ "io",
+ "math",
+ "mime",
+ "netclient",
+ "stringold"
+ ],
+ "summary": "Python mailbox format support"
+ },
+ "math": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/random.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/lib-dynload/_random.*.so",
+ "${libdir}/python3.5/lib-dynload/cmath.*.so",
+ "${libdir}/python3.5/random.py"
+ ],
+ "rdepends": [
+ "core",
+ "crypt"
+ ],
+ "summary": "Python math support"
+ },
+ "mime": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/quopri.*.pyc",
+ "${libdir}/python3.5/__pycache__/uu.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/quopri.py",
+ "${libdir}/python3.5/uu.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python MIME handling APIs"
+ },
+ "mmap": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/lib-dynload/mmap.*.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python memory-mapped file support"
+ },
+ "modules": {
+ "cached": [],
+ "files": [],
+ "rdepends": [
+ "2to3",
+ "asyncio",
+ "audio",
+ "codecs",
+ "compile",
+ "compression",
+ "core",
+ "crypt",
+ "ctypes",
+ "curses",
+ "datetime",
+ "db",
+ "debugger",
+ "difflib",
+ "distutils",
+ "doctest",
+ "email",
+ "fcntl",
+ "html",
+ "idle",
+ "image",
+ "io",
+ "json",
+ "logging",
+ "mailbox",
+ "math",
+ "mime",
+ "mmap",
+ "multiprocessing",
+ "netclient",
+ "netserver",
+ "numbers",
+ "pickle",
+ "pkgutil",
+ "plistlib",
+ "pprint",
+ "profile",
+ "pydoc",
+ "resource",
+ "runpy",
+ "shell",
+ "smtpd",
+ "sqlite3",
+ "stringold",
+ "syslog",
+ "terminal",
+ "threading",
+ "tkinter",
+ "typing",
+ "unittest",
+ "unixadmin",
+ "xml",
+ "xmlrpc"
+ ],
+ "summary": "All Python modules"
+ },
+ "multiprocessing": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/lib-dynload/_multiprocessing.*.so",
+ "${libdir}/python3.5/multiprocessing"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python multiprocessing support"
+ },
+ "netclient": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/base64.*.pyc",
+ "${libdir}/python3.5/__pycache__/ftplib.*.pyc",
+ "${libdir}/python3.5/__pycache__/hmac.*.pyc",
+ "${libdir}/python3.5/__pycache__/mimetypes.*.pyc",
+ "${libdir}/python3.5/__pycache__/nntplib.*.pyc",
+ "${libdir}/python3.5/__pycache__/poplib.*.pyc",
+ "${libdir}/python3.5/__pycache__/smtplib.*.pyc",
+ "${libdir}/python3.5/__pycache__/telnetlib.*.pyc",
+ "${libdir}/python3.5/__pycache__/uuid.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/base64.py",
+ "${libdir}/python3.5/ftplib.py",
+ "${libdir}/python3.5/hmac.py",
+ "${libdir}/python3.5/http",
+ "${libdir}/python3.5/http/__pycache__",
+ "${libdir}/python3.5/mimetypes.py",
+ "${libdir}/python3.5/nntplib.py",
+ "${libdir}/python3.5/poplib.py",
+ "${libdir}/python3.5/smtplib.py",
+ "${libdir}/python3.5/telnetlib.py",
+ "${libdir}/python3.5/urllib",
+ "${libdir}/python3.5/urllib/__pycache__",
+ "${libdir}/python3.5/uuid.py"
+ ],
+ "rdepends": [
+ "compression",
+ "core",
+ "crypt",
+ "ctypes",
+ "datetime",
+ "email",
+ "io",
+ "math",
+ "mime",
+ "shell",
+ "stringold",
+ "unixadmin"
+ ],
+ "summary": "Python Internet Protocol clients"
+ },
+ "netserver": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/cgi.*.pyc",
+ "${libdir}/python3.5/__pycache__/socketserver.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/cgi.py",
+ "${libdir}/python3.5/socketserver.py"
+ ],
+ "rdepends": [
+ "compression",
+ "core",
+ "crypt",
+ "datetime",
+ "email",
+ "html",
+ "io",
+ "math",
+ "mime",
+ "netclient",
+ "shell",
+ "stringold",
+ "unixadmin"
+ ],
+ "summary": "Python Internet Protocol servers"
+ },
+ "numbers": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/_pydecimal.*.pyc",
+ "${libdir}/python3.5/__pycache__/decimal.*.pyc",
+ "${libdir}/python3.5/__pycache__/fractions.*.pyc",
+ "${libdir}/python3.5/__pycache__/numbers.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/_pydecimal.py",
+ "${libdir}/python3.5/decimal.py",
+ "${libdir}/python3.5/fractions.py",
+ "${libdir}/python3.5/lib-dynload/_decimal.*.so",
+ "${libdir}/python3.5/numbers.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python number APIs"
+ },
+ "pickle": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/_compat_pickle.*.pyc",
+ "${libdir}/python3.5/__pycache__/pickle.*.pyc",
+ "${libdir}/python3.5/__pycache__/pickletools.*.pyc",
+ "${libdir}/python3.5/__pycache__/shelve.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/_compat_pickle.py",
+ "${libdir}/python3.5/lib-dynload/_pickle.*.so",
+ "${libdir}/python3.5/pickle.py",
+ "${libdir}/python3.5/pickletools.py",
+ "${libdir}/python3.5/shelve.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python serialisation/persistence support"
+ },
+ "pkgutil": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/pkgutil.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/pkgutil.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python package extension utility support"
+ },
+ "plistlib": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/plistlib.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/plistlib.py"
+ ],
+ "rdepends": [
+ "core",
+ "datetime",
+ "xml"
+ ],
+ "summary": "Generate and parse Mac OS X .plist files"
+ },
+ "pprint": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/pprint.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/pprint.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python pretty-print support"
+ },
+ "profile": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/cProfile.*.pyc",
+ "${libdir}/python3.5/__pycache__/profile.*.pyc",
+ "${libdir}/python3.5/__pycache__/pstats.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/cProfile.py",
+ "${libdir}/python3.5/lib-dynload/_lsprof.*.so",
+ "${libdir}/python3.5/profile.py",
+ "${libdir}/python3.5/pstats.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python basic performance profiling support"
+ },
+ "pydoc": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/pydoc.*.pyc"
+ ],
+ "files": [
+ "${bindir}/pydoc*",
+ "${libdir}/python3.5/pydoc.py",
+ "${libdir}/python3.5/pydoc_data"
+ ],
+ "rdepends": [
+ "core",
+ "netclient",
+ "pkgutil"
+ ],
+ "summary": "Python interactive help support"
+ },
+ "resource": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/lib-dynload/resource.*.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python resource control interface"
+ },
+ "runpy": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/runpy.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/runpy.py"
+ ],
+ "rdepends": [
+ "core",
+ "pkgutil"
+ ],
+ "summary": "Python helper for locating/executing scripts in module namespace"
+ },
+ "shell": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/cmd.*.pyc",
+ "${libdir}/python3.5/__pycache__/fnmatch.*.pyc",
+ "${libdir}/python3.5/__pycache__/glob.*.pyc",
+ "${libdir}/python3.5/__pycache__/shlex.*.pyc",
+ "${libdir}/python3.5/__pycache__/shutil.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/cmd.py",
+ "${libdir}/python3.5/fnmatch.py",
+ "${libdir}/python3.5/glob.py",
+ "${libdir}/python3.5/shlex.py",
+ "${libdir}/python3.5/shutil.py"
+ ],
+ "rdepends": [
+ "compression",
+ "core",
+ "stringold",
+ "unixadmin"
+ ],
+ "summary": "Python shell-like functionality"
+ },
+ "smtpd": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/asynchat.*.pyc",
+ "${libdir}/python3.5/__pycache__/asyncore.*.pyc",
+ "${libdir}/python3.5/__pycache__/smtpd.*.pyc"
+ ],
+ "files": [
+ "${bindir}/smtpd.py",
+ "${libdir}/python3.5/asynchat.py",
+ "${libdir}/python3.5/asyncore.py",
+ "${libdir}/python3.5/smtpd.py"
+ ],
+ "rdepends": [
+ "core",
+ "crypt",
+ "datetime",
+ "email",
+ "io",
+ "math",
+ "mime",
+ "netclient",
+ "stringold"
+ ],
+ "summary": "Python Simple Mail Transport Daemon"
+ },
+ "sqlite3": {
+ "cached": [
+ "${libdir}/python3.5/sqlite3/__pycache__",
+ "${libdir}/python3.5/sqlite3/__pycache__/dbapi2.*.pyc",
+ "${libdir}/python3.5/sqlite3/__pycache__/dump.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/lib-dynload/_sqlite3.*.so",
+ "${libdir}/python3.5/sqlite3/dbapi2.py",
+ "${libdir}/python3.5/sqlite3/dump.py"
+ ],
+ "rdepends": [
+ "core",
+ "datetime"
+ ],
+ "summary": "Python Sqlite3 database support"
+ },
+ "sqlite3-tests": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/sqlite3/test"
+ ],
+ "rdepends": [
+ "core",
+ "tests"
+ ],
+ "summary": "Python Sqlite3 database support tests"
+ },
+ "stringold": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/string.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/string.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python string APIs [deprecated]"
+ },
+ "syslog": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/lib-dynload/syslog.*.so"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python syslog interface"
+ },
+ "terminal": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/pty.*.pyc",
+ "${libdir}/python3.5/__pycache__/tty.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/pty.py",
+ "${libdir}/python3.5/tty.py"
+ ],
+ "rdepends": [
+ "core",
+ "io"
+ ],
+ "summary": "Python terminal controlling support"
+ },
+ "tests": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/test"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python tests"
+ },
+ "threading": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/_dummy_thread.*.pyc",
+ "${libdir}/python3.5/__pycache__/_threading_local.*.pyc",
+ "${libdir}/python3.5/__pycache__/dummy_threading.*.pyc",
+ "${libdir}/python3.5/__pycache__/queue.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/_dummy_thread.py",
+ "${libdir}/python3.5/_threading_local.py",
+ "${libdir}/python3.5/dummy_threading.py",
+ "${libdir}/python3.5/queue.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python threading & synchronization support"
+ },
+ "tkinter": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/tkinter"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python Tcl/Tk bindings"
+ },
+ "typing": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/typing.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/typing.py"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python typing support"
+ },
+ "unittest": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/unittest",
+ "${libdir}/python3.5/unittest/",
+ "${libdir}/python3.5/unittest/__pycache__"
+ ],
+ "rdepends": [
+ "core",
+ "difflib",
+ "logging",
+ "pprint",
+ "shell",
+ "stringold"
+ ],
+ "summary": "Python unit testing framework"
+ },
+ "unixadmin": {
+ "cached": [
+ "${libdir}/python3.5/__pycache__/getpass.*.pyc"
+ ],
+ "files": [
+ "${libdir}/python3.5/getpass.py",
+ "${libdir}/python3.5/lib-dynload/grp.*.so",
+ "${libdir}/python3.5/lib-dynload/nis.*.so"
+ ],
+ "rdepends": [
+ "core",
+ "io"
+ ],
+ "summary": "Python Unix administration support"
+ },
+ "xml": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/lib-dynload/_elementtree.*.so",
+ "${libdir}/python3.5/lib-dynload/pyexpat.*.so",
+ "${libdir}/python3.5/xml"
+ ],
+ "rdepends": [
+ "core"
+ ],
+ "summary": "Python basic XML support"
+ },
+ "xmlrpc": {
+ "cached": [],
+ "files": [
+ "${libdir}/python3.5/xmlrpc",
+ "${libdir}/python3.5/xmlrpc/__pycache__"
+ ],
+ "rdepends": [
+ "core",
+ "xml"
+ ],
+ "summary": "Python XML-RPC support"
+ }
+} \ No newline at end of file
diff --git a/poky/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch b/poky/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch
new file mode 100644
index 000000000..a4f8bd471
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch
@@ -0,0 +1,25 @@
+From 53ed216d7bf70dd2a925432b6805a701e5fc3e0e Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Mon, 17 Nov 2014 06:44:47 +0000
+Subject: [PATCH] python3 use CROSSPYTHONPATH for PYTHON_FOR_BUILD
+
+Upstream-Status: Inappropriate [Cross compile specific]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: Python-3.5.4/configure.ac
+===================================================================
+--- Python-3.5.4.orig/configure.ac
++++ Python-3.5.4/configure.ac
+@@ -73,7 +73,7 @@ if test "$cross_compiling" = yes; then
+ AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found])
+ fi
+ AC_MSG_RESULT($interp)
+- 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
++ PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(CROSSPYTHONPATH) '$interp
+ fi
+ elif test "$cross_compiling" = maybe; then
+ AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH])
diff --git a/poky/meta/recipes-devtools/python/python3/regen-all.patch b/poky/meta/recipes-devtools/python/python3/regen-all.patch
new file mode 100644
index 000000000..36b9d9d91
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/regen-all.patch
@@ -0,0 +1,25 @@
+python3-native: run regen-importlib target correctly
+
+regen-importlib depends on other regen- targets, so we must be sure to
+run it after (most of) the others. In reality, we do not need to run it
+at all since "make" will invoke it, if necessary. We do not want to
+rely on that, though.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+
+
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -709,7 +709,8 @@ regen-importlib: Programs/_freeze_import
+ ############################################################################
+ # Regenerate all generated files
+
+-regen-all: regen-opcode regen-opcode-targets regen-typeslots regen-grammar regen-ast regen-importlib
++regen-all: regen-opcode regen-opcode-targets regen-typeslots regen-grammar regen-ast
++ $(MAKE) regen-importlib
+
+ ############################################################################
+ # Special rules for object files
diff --git a/poky/meta/recipes-devtools/python/python3/setup.py-check-cross_compiling-when-get-FLAGS.patch b/poky/meta/recipes-devtools/python/python3/setup.py-check-cross_compiling-when-get-FLAGS.patch
new file mode 100644
index 000000000..fc2e12dfe
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/setup.py-check-cross_compiling-when-get-FLAGS.patch
@@ -0,0 +1,50 @@
+From 8dad810f3a3d073f09ad72e1a3ee0a895eab2ca1 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Sun, 18 Jan 2015 19:05:36 -0800
+Subject: [PATCH] setup.py:check cross_compiling when get FLAGS
+
+Fixed when compile target pythnon3:
+gcc -isystem/path/to/sysroots/x86_64-linux/usr/include \
+ -L=/path/to/sysroots/x86_64-linux/usr/lib
+
+This is incorrect, the native sysroot should not be used by target
+python3.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ setup.py | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index e8339cd..83fd31f 100644
+--- a/setup.py
++++ b/setup.py
+@@ -238,7 +238,10 @@ class PyBuildExt(build_ext):
+ # unfortunately, distutils doesn't let us provide separate C and C++
+ # compilers
+ if compiler is not None:
+- (ccshared,cflags) = sysconfig.get_config_vars('CCSHARED','CFLAGS')
++ if cross_compiling:
++ (ccshared,cflags) = (os.environ.get('CCSHARED') or '', os.environ.get('CFLAGS') or '')
++ else:
++ (ccshared,cflags) = sysconfig.get_config_vars('CCSHARED','CFLAGS')
+ args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags
+ self.compiler.set_executables(**args)
+
+@@ -457,7 +460,10 @@ class PyBuildExt(build_ext):
+ ('LDFLAGS', '-R', self.compiler.runtime_library_dirs),
+ ('LDFLAGS', '-L', self.compiler.library_dirs),
+ ('CPPFLAGS', '-I', self.compiler.include_dirs)):
+- env_val = sysconfig.get_config_var(env_var)
++ if cross_compiling:
++ env_val = os.environ.get(env_var)
++ else:
++ env_val = sysconfig.get_config_var(env_var)
+ if env_val:
+ # To prevent optparse from raising an exception about any
+ # options in env_val that it doesn't know about we strip out
+--
+1.7.9.5
+
diff --git a/poky/meta/recipes-devtools/python/python3/setuptweaks.patch b/poky/meta/recipes-devtools/python/python3/setuptweaks.patch
new file mode 100644
index 000000000..3a91b1916
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/setuptweaks.patch
@@ -0,0 +1,57 @@
+This patch removes various ways native system options can pass into the python
+compilation and somehow break C modules.
+
+Upstream-Status: Inappropriate [OE Specific]
+
+RP 2012/04/23
+
+Index: Python-2.7.2/setup.py
+===================================================================
+--- Python-2.7.2.orig/setup.py 2012-04-23 20:03:47.295582553 +0000
++++ Python-2.7.2/setup.py 2012-04-23 20:03:15.000000000 +0000
+@@ -231,7 +231,13 @@
+ # compilers
+ if compiler is not None:
+ (ccshared,cflags) = sysconfig.get_config_vars('CCSHARED','CFLAGS')
+- args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags
++ # Need to filter out -isysroot from the flags. Ideally should
++ # figure out target flags here.
++ flags = []
++ for f in cflags.split():
++ if not f.startswith("-isystem"):
++ flags.append(f)
++ args['compiler_so'] = compiler + ' ' + ccshared + ' ' + ' '.join(flags)
+ self.compiler.set_executables(**args)
+
+ build_ext.build_extensions(self)
+@@ -393,7 +399,6 @@
+ # into configure and stored in the Makefile (issue found on OS X 10.3).
+ for env_var, arg_name, dir_list in (
+ ('LDFLAGS', '-R', self.compiler.runtime_library_dirs),
+- ('LDFLAGS', '-L', self.compiler.library_dirs),
+ ('CPPFLAGS', '-I', self.compiler.include_dirs)):
+ env_val = sysconfig.get_config_var(env_var)
+ if env_val:
+@@ -419,16 +424,16 @@
+ for directory in reversed(options.dirs):
+ add_dir_to_list(dir_list, directory)
+
+- if os.path.normpath(sys.prefix) != '/usr' \
+- and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
++# if os.path.normpath(sys.prefix) != '/usr' \
++# and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
+ # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
+ # (PYTHONFRAMEWORK is set) to avoid # linking problems when
+ # building a framework with different architectures than
+ # the one that is currently installed (issue #7473)
+- add_dir_to_list(self.compiler.library_dirs,
+- sysconfig.get_config_var("LIBDIR"))
+- add_dir_to_list(self.compiler.include_dirs,
+- sysconfig.get_config_var("INCLUDEDIR"))
++# add_dir_to_list(self.compiler.library_dirs,
++# sysconfig.get_config_var("LIBDIR"))
++# add_dir_to_list(self.compiler.include_dirs,
++# sysconfig.get_config_var("INCLUDEDIR"))
+
+ try:
+ have_unicode = unicode
diff --git a/poky/meta/recipes-devtools/python/python3/shutil-follow-symlink-fix.patch b/poky/meta/recipes-devtools/python/python3/shutil-follow-symlink-fix.patch
new file mode 100644
index 000000000..802b1c720
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/shutil-follow-symlink-fix.patch
@@ -0,0 +1,17 @@
+shutils should consider symlinks
+
+-Khem
+
+Upstream-Status: Pending
+
+--- a/Lib/shutil.py 2013-01-29 12:31:06.926555779 -0800
++++ b/Lib/shutil.py 2013-01-29 16:31:39.097554182 -0800
+@@ -132,7 +132,7 @@ def copymode(src, dst, *, follow_symlink
+ st = stat_func(src)
+ chmod_func(dst, stat.S_IMODE(st.st_mode))
+
+-if hasattr(os, 'listxattr'):
++if hasattr(os, 'listxattr') and os.listxattr in os.supports_follow_symlinks:
+ def _copyxattr(src, dst, *, follow_symlinks=True):
+ """Copy extended filesystem attributes from `src` to `dst`.
+
diff --git a/poky/meta/recipes-devtools/python/python3/sitecustomize.py b/poky/meta/recipes-devtools/python/python3/sitecustomize.py
new file mode 100644
index 000000000..4c8b5e2ba
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/sitecustomize.py
@@ -0,0 +1,37 @@
+# OpenEmbedded sitecustomize.py (C) 2002-2008 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
+# GPLv2 or later
+# Version: 20081123
+# Features:
+# * set proper default encoding
+# * enable readline completion in the interactive interpreter
+# * load command line history on startup
+# * save command line history on exit
+
+import os
+
+def __exithandler():
+ try:
+ readline.write_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) )
+ except IOError:
+ pass
+
+def __registerExitHandler():
+ import atexit
+ atexit.register( __exithandler )
+
+def __enableReadlineSupport():
+ readline.set_history_length( 1000 )
+ readline.parse_and_bind( "tab: complete" )
+ try:
+ readline.read_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) )
+ except IOError:
+ pass
+
+import sys
+try:
+ import rlcompleter, readline
+except ImportError:
+ pass
+else:
+ __registerExitHandler()
+ __enableReadlineSupport()
diff --git a/poky/meta/recipes-devtools/python/python3/support_SOURCE_DATE_EPOCH_in_py_compile.patch b/poky/meta/recipes-devtools/python/python3/support_SOURCE_DATE_EPOCH_in_py_compile.patch
new file mode 100644
index 000000000..32ecab9fe
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/support_SOURCE_DATE_EPOCH_in_py_compile.patch
@@ -0,0 +1,97 @@
+The compiled .pyc files contain time stamp corresponding to the compile time.
+This prevents binary reproducibility. This patch allows to achieve binary
+reproducibility by overriding the build time stamp by the value
+exported via SOURCE_DATE_EPOCH.
+
+Upstream-Status: Backport
+
+Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
+
+
+From aeab488630fdb1b56a8d0b0c13fa88706b2afe9b Mon Sep 17 00:00:00 2001
+From: "Bernhard M. Wiedemann" <bwiedemann@suse.de>
+Date: Sat, 25 Feb 2017 06:42:28 +0100
+Subject: [PATCH] bpo-29708: support SOURCE_DATE_EPOCH env var in py_compile
+
+to allow for reproducible builds of python packages
+
+See https://reproducible-builds.org/ for why this is good
+and https://reproducible-builds.org/specs/source-date-epoch/
+for the definition of this variable.
+
+Background:
+In some distributions like openSUSE, binary rpms contain precompiled .pyc files.
+
+And packages like amqp or twisted dynamically generate .py files at build time
+so those have the current time and that timestamp gets embedded
+into the .pyc file header.
+When we then adapt file timestamps in rpms to be constant,
+the timestamp in the .pyc header will no more match
+the .py timestamp in the filesystem.
+The software will still work, but it will not use the .pyc file as it should.
+---
+ Doc/library/py_compile.rst | 4 ++++
+ Lib/py_compile.py | 4 ++++
+ Lib/test/test_py_compile.py | 19 +++++++++++++++++++
+ 3 files changed, 27 insertions(+)
+
+diff --git a/Doc/library/py_compile.rst b/Doc/library/py_compile.rst
+index 0af8fb1..841f3e8 100644
+--- a/Doc/library/py_compile.rst
++++ b/Doc/library/py_compile.rst
+@@ -53,6 +53,10 @@ byte-code cache files in the directory containing the source code.
+ :func:`compile` function. The default of ``-1`` selects the optimization
+ level of the current interpreter.
+
++ If the SOURCE_DATE_EPOCH environment variable is set, the .py file mtime
++ and timestamp entry in .pyc file header, will be limited to this value.
++ See https://reproducible-builds.org/specs/source-date-epoch/ for more info.
++
+ .. versionchanged:: 3.2
+ Changed default value of *cfile* to be :PEP:`3147`-compliant. Previous
+ default was *file* + ``'c'`` (``'o'`` if optimization was enabled).
+diff --git a/Lib/py_compile.py b/Lib/py_compile.py
+index 11c5b50..62dcdc7 100644
+--- a/Lib/py_compile.py
++++ b/Lib/py_compile.py
+@@ -137,6 +137,10 @@ def compile(file, cfile=None, dfile=None, doraise=False, optimize=-1):
+ except FileExistsError:
+ pass
+ source_stats = loader.path_stats(file)
++ sde = os.environ.get('SOURCE_DATE_EPOCH')
++ if sde and source_stats['mtime'] > int(sde):
++ source_stats['mtime'] = int(sde)
++ os.utime(file, (source_stats['mtime'], source_stats['mtime']))
+ bytecode = importlib._bootstrap_external._code_to_bytecode(
+ code, source_stats['mtime'], source_stats['size'])
+ mode = importlib._bootstrap_external._calc_mode(file)
+diff --git a/Lib/test/test_py_compile.py b/Lib/test/test_py_compile.py
+index 4a6caa5..3d09963 100644
+--- a/Lib/test/test_py_compile.py
++++ b/Lib/test/test_py_compile.py
+@@ -98,6 +98,25 @@ def test_bad_coding(self):
+ self.assertFalse(os.path.exists(
+ importlib.util.cache_from_source(bad_coding)))
+
++ def test_source_date_epoch(self):
++ testtime = 123456789
++ orig_sde = os.getenv("SOURCE_DATE_EPOCH")
++ os.environ["SOURCE_DATE_EPOCH"] = str(testtime)
++ py_compile.compile(self.source_path, self.pyc_path)
++ if orig_sde:
++ os.environ["SOURCE_DATE_EPOCH"] = orig_sde
++ else:
++ del os.environ["SOURCE_DATE_EPOCH"]
++ self.assertTrue(os.path.exists(self.pyc_path))
++ self.assertFalse(os.path.exists(self.cache_path))
++ statinfo = os.stat(self.source_path)
++ self.assertEqual(statinfo.st_mtime, testtime)
++ f = open(self.pyc_path, "rb")
++ f.read(4)
++ timebytes = f.read(4) # read timestamp from pyc header
++ f.close()
++ self.assertEqual(timebytes, (testtime).to_bytes(4, 'little'))
++
+ @unittest.skipIf(sys.flags.optimize > 0, 'test does not work with -O')
+ def test_double_dot_no_clobber(self):
+ # http://bugs.python.org/issue22966
diff --git a/poky/meta/recipes-devtools/python/python3/sysconfig.py-add-_PYTHON_PROJECT_SRC.patch b/poky/meta/recipes-devtools/python/python3/sysconfig.py-add-_PYTHON_PROJECT_SRC.patch
new file mode 100644
index 000000000..c89d9a3d8
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/sysconfig.py-add-_PYTHON_PROJECT_SRC.patch
@@ -0,0 +1,51 @@
+From fc93b3cc23b4f9698ae92a42986dbb02b6f19588 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Sun, 18 Jan 2015 06:29:50 -0800
+Subject: [PATCH] sysconfig.py: add _PYTHON_PROJECT_SRC
+
+python3 has introduced _PYTHON_PROJECT_BASE which is used for separate B
+and S, but it doesn't work when compile Modules, the target python3 runs
+python3-native's sysconfig to get srcdir which is the native's, there
+would be errors when native's srcdir has been removed, add
+_PYTHON_PROJECT_SRC to fix the problem.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ Lib/distutils/sysconfig.py | 5 ++++-
+ Lib/sysconfig.py | 5 ++++-
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+Index: Python-3.5.3/Lib/distutils/sysconfig.py
+===================================================================
+--- Python-3.5.3.orig/Lib/distutils/sysconfig.py
++++ Python-3.5.3/Lib/distutils/sysconfig.py
+@@ -498,7 +498,10 @@ def get_config_vars(*args):
+ _config_vars['SO'] = SO
+
+ # Always convert srcdir to an absolute path
+- srcdir = _config_vars.get('srcdir', project_base)
++ if "_PYTHON_PROJECT_SRC" in os.environ:
++ srcdir = os.path.abspath(os.environ["_PYTHON_PROJECT_SRC"])
++ else:
++ srcdir = _config_vars.get('srcdir', project_base)
+ if os.name == 'posix':
+ if python_build:
+ # If srcdir is a relative path (typically '.' or '..')
+Index: Python-3.5.3/Lib/sysconfig.py
+===================================================================
+--- Python-3.5.3.orig/Lib/sysconfig.py
++++ Python-3.5.3/Lib/sysconfig.py
+@@ -544,7 +544,10 @@ def get_config_vars(*args):
+ _CONFIG_VARS['userbase'] = _getuserbase()
+
+ # Always convert srcdir to an absolute path
+- srcdir = _CONFIG_VARS.get('srcdir', _PROJECT_BASE)
++ if "_PYTHON_PROJECT_SRC" in os.environ:
++ srcdir = os.path.abspath(os.environ["_PYTHON_PROJECT_SRC"])
++ else:
++ srcdir = _CONFIG_VARS.get('srcdir', _PROJECT_BASE)
+ if os.name == 'posix':
+ if _PYTHON_BUILD:
+ # If srcdir is a relative path (typically '.' or '..')
diff --git a/poky/meta/recipes-devtools/python/python3/sysroot-include-headers.patch b/poky/meta/recipes-devtools/python/python3/sysroot-include-headers.patch
new file mode 100644
index 000000000..785b5567f
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/sysroot-include-headers.patch
@@ -0,0 +1,35 @@
+Dont search hardcoded paths, we might be doing a cross-build
+Use '=' in-front to let compiler append sysroot, if it can
+
+Should fix things like
+
+configure: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
+cc1: warning: include location "/usr/include/ncursesw" is unsafe for cross-compilation [-Wpoison-system-directories]
+
+
+Signed-off-by: Khem Raj
+Upstream-Status: Pending
+
+
+Index: Python-3.3.2/setup.py
+===================================================================
+--- Python-3.3.2.orig/setup.py 2013-07-30 01:30:48.000000000 -0700
++++ Python-3.3.2/setup.py 2013-07-30 01:41:11.697862723 -0700
+@@ -1210,7 +1210,7 @@
+ panel_library = 'panel'
+ if curses_library == 'ncursesw':
+ curses_defines.append(('HAVE_NCURSESW', '1'))
+- curses_includes.append('/usr/include/ncursesw')
++ curses_includes.append('=/usr/include/ncursesw')
+ # Bug 1464056: If _curses.so links with ncursesw,
+ # _curses_panel.so must link with panelw.
+ panel_library = 'panelw'
+@@ -1819,7 +1819,7 @@
+ if host_platform == 'darwin':
+ # OS X 10.5 comes with libffi.dylib; the include files are
+ # in /usr/include/ffi
+- inc_dirs.append('/usr/include/ffi')
++ inc_dirs.append('=/usr/include/ffi')
+
+ ffi_inc = [sysconfig.get_config_var("LIBFFI_INCLUDEDIR")]
+ if not ffi_inc or ffi_inc[0] == '':
diff --git a/poky/meta/recipes-devtools/python/python3/tweak-MULTIARCH-for-powerpc-linux-gnuspe.patch b/poky/meta/recipes-devtools/python/python3/tweak-MULTIARCH-for-powerpc-linux-gnuspe.patch
new file mode 100644
index 000000000..8d037278b
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/tweak-MULTIARCH-for-powerpc-linux-gnuspe.patch
@@ -0,0 +1,52 @@
+From 5d6509313198ec9b686cad50b002212e4344004b Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Fri, 11 Mar 2016 01:15:45 -0500
+Subject: [PATCH] configure.ac: tweak MULTIARCH for powerpc-linux-gnuspe
+
+For p1022ds bsp, the MULTIARCH is powerpc-linux-gnuspev1 and
+python3 did not recognize the extra 'v1' which caused python3
+configure error for the platform triplet.
+
+Q:Why Python3 check platform triplet?
+
+A:Under Linux, GNU/KFreeBSD and the Hurd, C extensions now include
+the architecture triplet in the extension name, to make it easy to
+test builds for different ABIs in the same working tree.
+
+Here is the generated C extensions which take platform triplet into account.
+...
+|image/usr/lib/python3.5/lib-dynload/_datetime.cpython-35m-powerpc-linux-gnuspe.so
+...
+
+https://bugs.python.org/issue22980
+https://www.python.org/dev/peps/pep-3149/
+https://bugs.python.org/review/22980/patch/14593/54808
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ configure.ac | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 9eb3d22..c34a9a0 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -724,6 +724,13 @@ fi
+
+
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
++
++# Tweak MULTIARCH
++if test x$MULTIARCH = xpowerpc-linux-gnuspev1
++then
++ MULTIARCH="powerpc-linux-gnuspe"
++fi
++
+ AC_SUBST(MULTIARCH)
+
+ AC_MSG_CHECKING([for the platform triplet based on compiler characteristics])
+--
+1.9.1
+
diff --git a/poky/meta/recipes-devtools/python/python3/unixccompiler.patch b/poky/meta/recipes-devtools/python/python3/unixccompiler.patch
new file mode 100644
index 000000000..3e2b1d1c2
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3/unixccompiler.patch
@@ -0,0 +1,35 @@
+Upstream-Status: Pending
+
+The CC variable,sometimes like:"x86_64-poky-linux-gcc -m64 --sysroot=/${TMPDIR}/sysroots/qemux86-64", contains option information.
+This will lead to wrong compiler name "qemux86-64" rather than "x86_64-poky-linux-gcc" when python finding the compiler name.
+
+Secondly add -L=<path> this way linker will be able to resolve /usr/lib w.r.t sysroot and not
+use hardcoded /usr/lib to look for libs which is wrong in cross compile environment and this will work
+ok on native systems too since sysroot for native compilers is /
+
+Signed-off-by: Mei Lei <lei.mei@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Index: Python-3.3.2/Lib/distutils/unixccompiler.py
+===================================================================
+--- Python-3.3.2.orig/Lib/distutils/unixccompiler.py 2013-05-15 09:32:54.000000000 -0700
++++ Python-3.3.2/Lib/distutils/unixccompiler.py 2013-08-01 00:58:18.629056286 -0700
+@@ -202,7 +202,9 @@
+ # ccompiler.py.
+
+ def library_dir_option(self, dir):
+- return "-L" + dir
++ if dir.startswith("/"):
++ return "-L=" + dir
++ return "-L" + dir
+
+ def _is_gcc(self, compiler_name):
+ return "gcc" in compiler_name or "g++" in compiler_name
+@@ -221,7 +221,7 @@
+ # this time, there's no way to determine this information from
+ # the configuration data stored in the Python installation, so
+ # we use this hack.
+- compiler = os.path.basename(sysconfig.get_config_var("CC"))
++ compiler = sysconfig.get_config_var("CC")
+ if sys.platform[:6] == "darwin":
+ # MacOSX's linker doesn't understand the -R flag at all
+ return "-L" + dir
diff --git a/poky/meta/recipes-devtools/python/python3_3.5.5.bb b/poky/meta/recipes-devtools/python/python3_3.5.5.bb
new file mode 100644
index 000000000..f893b846a
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python3_3.5.5.bb
@@ -0,0 +1,323 @@
+require recipes-devtools/python/python.inc
+
+DEPENDS = "python3-native libffi bzip2 gdbm openssl sqlite3 zlib virtual/libintl xz"
+
+PR = "${INC_PR}.0"
+PYTHON_MAJMIN = "3.5"
+PYTHON_BINABI= "${PYTHON_MAJMIN}m"
+DISTRO_SRC_URI ?= "file://sitecustomize.py"
+DISTRO_SRC_URI_linuxstdbase = ""
+SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
+file://python-config.patch \
+file://0001-cross-compile-support.patch \
+file://030-fixup-include-dirs.patch \
+file://070-dont-clean-ipkg-install.patch \
+file://080-distutils-dont_adjust_files.patch \
+file://130-readline-setup.patch \
+file://150-fix-setupterm.patch \
+file://0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch \
+file://tweak-MULTIARCH-for-powerpc-linux-gnuspe.patch \
+file://support_SOURCE_DATE_EPOCH_in_py_compile.patch \
+${DISTRO_SRC_URI} \
+"
+
+SRC_URI += "\
+ file://03-fix-tkinter-detection.patch \
+ file://avoid_warning_about_tkinter.patch \
+ file://cgi_py.patch \
+ file://host_include_contamination.patch \
+ file://python-3.3-multilib.patch \
+ file://shutil-follow-symlink-fix.patch \
+ file://sysroot-include-headers.patch \
+ file://unixccompiler.patch \
+ file://avoid-ncursesw-include-path.patch \
+ file://python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch \
+ file://sysconfig.py-add-_PYTHON_PROJECT_SRC.patch \
+ file://setup.py-check-cross_compiling-when-get-FLAGS.patch \
+ file://configure.ac-fix-LIBPL.patch \
+ file://0001-Issue-21272-Use-_sysconfigdata.py-to-initialize-dist.patch \
+ file://pass-missing-libraries-to-Extension-for-mul.patch \
+ "
+SRC_URI[md5sum] = "f3763edf9824d5d3a15f5f646083b6e0"
+SRC_URI[sha256sum] = "063d2c3b0402d6191b90731e0f735c64830e7522348aeb7ed382a83165d45009"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=b6ec515b22618f55fa07276b897bacea"
+
+# exclude pre-releases for both python 2.x and 3.x
+UPSTREAM_CHECK_REGEX = "[Pp]ython-(?P<pver>\d+(\.\d+)+).tar"
+
+S = "${WORKDIR}/Python-${PV}"
+
+inherit autotools multilib_header python3native pkgconfig
+
+CONFIGUREOPTS += " --with-system-ffi "
+
+CACHED_CONFIGUREVARS = "ac_cv_have_chflags=no \
+ ac_cv_have_lchflags=no \
+ ac_cv_have_long_long_format=yes \
+ ac_cv_buggy_getaddrinfo=no \
+ ac_cv_file__dev_ptmx=yes \
+ ac_cv_file__dev_ptc=no \
+"
+
+TARGET_CC_ARCH += "-DNDEBUG -fno-inline"
+SDK_CC_ARCH += "-DNDEBUG -fno-inline"
+EXTRA_OEMAKE += "CROSS_COMPILE=yes"
+EXTRA_OECONF += "CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ --without-ensurepip"
+
+export CROSS_COMPILE = "${TARGET_PREFIX}"
+export _PYTHON_PROJECT_BASE = "${B}"
+export _PYTHON_PROJECT_SRC = "${S}"
+export CCSHARED = "-fPIC"
+
+# Fix cross compilation of different modules
+export CROSSPYTHONPATH = "${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/:${B}/build/lib.linux-${TARGET_ARCH}-${PYTHON_MAJMIN}:${S}/Lib:${S}/Lib/plat-linux"
+
+# No ctypes option for python 3
+PYTHONLSBOPTS = ""
+
+PACKAGECONFIG ??= "readline"
+PACKAGECONFIG[readline] = ",,readline"
+
+do_configure_append() {
+ rm -f ${S}/Makefile.orig
+ autoreconf -Wcross --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi
+}
+
+do_compile() {
+ # regenerate platform specific files, because they depend on system headers
+ cd ${S}/Lib/plat-linux*
+ include=${STAGING_INCDIR} ${STAGING_BINDIR_NATIVE}/python3-native/python3 \
+ ${S}/Tools/scripts/h2py.py -i '(u_long)' \
+ ${STAGING_INCDIR}/dlfcn.h \
+ ${STAGING_INCDIR}/linux/cdrom.h \
+ ${STAGING_INCDIR}/netinet/in.h \
+ ${STAGING_INCDIR}/sys/types.h
+ sed -e 's,${STAGING_DIR_HOST},,g' -i *.py
+ cd -
+
+
+ # remove any bogus LD_LIBRARY_PATH
+ sed -i -e s,RUNSHARED=.*,RUNSHARED=, Makefile
+
+ if [ ! -f Makefile.orig ]; then
+ install -m 0644 Makefile Makefile.orig
+ fi
+ sed -i -e 's,^CONFIGURE_LDFLAGS=.*,CONFIGURE_LDFLAGS=-L. -L${STAGING_LIBDIR},g' \
+ -e 's,libdir=${libdir},libdir=${STAGING_LIBDIR},g' \
+ -e 's,libexecdir=${libexecdir},libexecdir=${STAGING_DIR_HOST}${libexecdir},g' \
+ -e 's,^LIBDIR=.*,LIBDIR=${STAGING_LIBDIR},g' \
+ -e 's,includedir=${includedir},includedir=${STAGING_INCDIR},g' \
+ -e 's,^INCLUDEDIR=.*,INCLUDE=${STAGING_INCDIR},g' \
+ -e 's,^CONFINCLUDEDIR=.*,CONFINCLUDE=${STAGING_INCDIR},g' \
+ Makefile
+ # save copy of it now, because if we do it in do_install and
+ # then call do_install twice we get Makefile.orig == Makefile.sysroot
+ install -m 0644 Makefile Makefile.sysroot
+
+ oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \
+ HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \
+ STAGING_LIBDIR=${STAGING_LIBDIR} \
+ STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
+ STAGING_INCDIR=${STAGING_INCDIR} \
+ LIB=${baselib} \
+ ARCH=${TARGET_ARCH} \
+ OPT="${CFLAGS}" libpython3.so
+
+ oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \
+ HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \
+ STAGING_LIBDIR=${STAGING_LIBDIR} \
+ STAGING_INCDIR=${STAGING_INCDIR} \
+ STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
+ LIB=${baselib} \
+ ARCH=${TARGET_ARCH} \
+ OPT="${CFLAGS}"
+}
+
+do_install() {
+ # make install needs the original Makefile, or otherwise the inclues would
+ # go to ${D}${STAGING...}/...
+ install -m 0644 Makefile.orig Makefile
+
+ install -d ${D}${libdir}/pkgconfig
+ install -d ${D}${libdir}/python${PYTHON_MAJMIN}/config
+
+ # rerun the build once again with original makefile this time
+ # run install in a separate step to avoid compile/install race
+ oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \
+ HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \
+ STAGING_LIBDIR=${STAGING_LIBDIR} \
+ STAGING_INCDIR=${STAGING_INCDIR} \
+ STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
+ LIB=${baselib} \
+ ARCH=${TARGET_ARCH} \
+ DESTDIR=${D} LIBDIR=${libdir}
+
+ oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \
+ HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \
+ STAGING_LIBDIR=${STAGING_LIBDIR} \
+ STAGING_INCDIR=${STAGING_INCDIR} \
+ STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
+ LIB=${baselib} \
+ ARCH=${TARGET_ARCH} \
+ DESTDIR=${D} LIBDIR=${libdir} install
+
+ # avoid conflict with 2to3 from Python 2
+ rm -f ${D}/${bindir}/2to3
+
+ install -m 0644 Makefile.sysroot ${D}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
+ install -m 0644 Makefile.sysroot ${D}/${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_MAJMIN}${PYTHON_ABI}/Makefile
+
+ if [ -e ${WORKDIR}/sitecustomize.py ]; then
+ install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN}
+ fi
+
+ oe_multilib_header python${PYTHON_BINABI}/pyconfig.h
+}
+
+do_install_append_class-nativesdk () {
+ create_wrapper ${D}${bindir}/python${PYTHON_MAJMIN} TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo'
+}
+
+SSTATE_SCAN_FILES += "Makefile"
+PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess"
+
+py_package_preprocess () {
+ # copy back the old Makefile to fix target package
+ install -m 0644 ${B}/Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
+ install -m 0644 ${B}/Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_MAJMIN}${PYTHON_ABI}/Makefile
+ # Remove references to buildmachine paths in target Makefile and _sysconfigdata
+ sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g \
+ -e 's|${DEBUG_PREFIX_MAP}||g' \
+ -e 's:${HOSTTOOLS_DIR}/::g' \
+ -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
+ -e 's:${RECIPE_SYSROOT}::g' \
+ -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \
+ ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile \
+ ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_MAJMIN}${PYTHON_ABI}/Makefile \
+ ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py \
+ ${PKGD}/${bindir}/python${PYTHON_BINABI}-config
+
+ # Recompile _sysconfigdata after modifying it
+ cd ${PKGD}
+ ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} \
+ -c "from py_compile import compile; compile('./${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py')"
+ ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} \
+ -c "from py_compile import compile; compile('./${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py', optimize=1)"
+ ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} \
+ -c "from py_compile import compile; compile('./${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py', optimize=2)"
+ cd -
+}
+
+# manual dependency additions
+RPROVIDES_${PN}-modules = "${PN}"
+RRECOMMENDS_${PN}-core_append_class-nativesdk = " nativesdk-python3-modules"
+RRECOMMENDS_${PN}-crypt = "openssl"
+RRECOMMENDS_${PN}-crypt_class-nativesdk = "nativesdk-openssl"
+
+FILES_${PN}-2to3 += "${bindir}/2to3-${PYTHON_MAJMIN}"
+FILES_${PN}-pydoc += "${bindir}/pydoc${PYTHON_MAJMIN} ${bindir}/pydoc3"
+FILES_${PN}-idle += "${bindir}/idle3 ${bindir}/idle${PYTHON_MAJMIN}"
+
+PACKAGES =+ "${PN}-pyvenv"
+FILES_${PN}-pyvenv += "${bindir}/pyvenv-${PYTHON_MAJMIN} ${bindir}/pyvenv"
+
+# package libpython3
+PACKAGES =+ "libpython3 libpython3-staticdev"
+FILES_libpython3 = "${libdir}/libpython*.so.*"
+FILES_libpython3-staticdev += "${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_BINABI}/libpython${PYTHON_BINABI}.a"
+INSANE_SKIP_${PN}-dev += "dev-elf"
+
+# catch all the rest (unsorted)
+PACKAGES += "${PN}-misc"
+RDEPENDS_${PN}-misc += "${PN}-core ${PN}-email ${PN}-codecs"
+RDEPENDS_${PN}-modules += "${PN}-misc"
+FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}"
+
+# catch manpage
+PACKAGES += "${PN}-man"
+FILES_${PN}-man = "${datadir}/man"
+
+BBCLASSEXTEND = "nativesdk"
+
+RPROVIDES_${PN} += "${PN}-modules"
+
+# We want bytecode precompiled .py files (.pyc's) by default
+# but the user may set it on their own conf
+INCLUDE_PYCS ?= "1"
+
+python(){
+ import json
+
+ filename = os.path.join(d.getVar('THISDIR'), 'python3', 'python3-manifest.json')
+ # This python changes the datastore based on the contents of a file, so mark
+ # that dependency.
+ bb.parse.mark_dependency(d, filename)
+
+ with open(filename) as manifest_file:
+ python_manifest=json.load(manifest_file)
+
+ include_pycs = d.getVar('INCLUDE_PYCS')
+
+ packages = d.getVar('PACKAGES').split()
+ pn = d.getVar('PN')
+
+ newpackages=[]
+ for key in python_manifest:
+ pypackage= pn + '-' + key
+
+ if pypackage not in packages:
+ # We need to prepend, otherwise python-misc gets everything
+ # so we use a new variable
+ newpackages.append(pypackage)
+
+ # "Build" python's manifest FILES, RDEPENDS and SUMMARY
+ d.setVar('FILES_' + pypackage, '')
+ for value in python_manifest[key]['files']:
+ d.appendVar('FILES_' + pypackage, ' ' + value)
+
+ # Add cached files
+ if include_pycs == '1':
+ for value in python_manifest[key]['cached']:
+ d.appendVar('FILES_' + pypackage, ' ' + value)
+
+ d.setVar('RDEPENDS_' + pypackage, '')
+ for value in python_manifest[key]['rdepends']:
+ # Make it work with or without $PN
+ if '${PN}' in value:
+ value=value.split('-')[1]
+ d.appendVar('RDEPENDS_' + pypackage, ' ' + pn + '-' + value)
+ d.setVar('SUMMARY_' + pypackage, python_manifest[key]['summary'])
+
+ # We need to ensure staticdev packages match for files first so we sort in reverse
+ newpackages.sort(reverse=True)
+ # Prepending so to avoid python-misc getting everything
+ packages = newpackages + packages
+ d.setVar('PACKAGES', ' '.join(packages))
+ d.setVar('ALLOW_EMPTY_${PN}-modules', '1')
+}
+
+# Files needed to create a new manifest
+SRC_URI += "file://create_manifest3.py file://get_module_deps3.py file://python3-manifest.json"
+
+do_create_manifest() {
+ # This task should be run with every new release of Python.
+ # We must ensure that PACKAGECONFIG enables everything when creating
+ # a new manifest, this is to base our new manifest on a complete
+ # native python build, containing all dependencies, otherwise the task
+ # wont be able to find the required files.
+ # e.g. BerkeleyDB is an optional build dependency so it may or may not
+ # be present, we must ensure it is.
+
+ cd ${WORKDIR}
+ # This needs to be executed by python-native and NOT by HOST's python
+ nativepython3 create_manifest3.py
+ cp python3-manifest.json.new ${THISDIR}/python3/python3-manifest.json
+}
+
+# bitbake python -c create_manifest
+addtask do_create_manifest
+
+# Make sure we have native python ready when we create a new manifest
+do_create_manifest[depends] += "python3:do_prepare_recipe_sysroot"
+do_create_manifest[depends] += "python3:do_patch"
diff --git a/poky/meta/recipes-devtools/python/python_2.7.14.bb b/poky/meta/recipes-devtools/python/python_2.7.14.bb
new file mode 100644
index 000000000..41a8609b1
--- /dev/null
+++ b/poky/meta/recipes-devtools/python/python_2.7.14.bb
@@ -0,0 +1,282 @@
+require python.inc
+
+DEPENDS = "python-native libffi bzip2 gdbm openssl readline sqlite3 zlib"
+
+PR = "${INC_PR}"
+
+DISTRO_SRC_URI ?= "file://sitecustomize.py"
+DISTRO_SRC_URI_linuxstdbase = ""
+SRC_URI += "\
+ file://01-use-proper-tools-for-cross-build.patch \
+ file://03-fix-tkinter-detection.patch \
+ file://06-avoid_usr_lib_termcap_path_in_linking.patch \
+ ${DISTRO_SRC_URI} \
+ file://multilib.patch \
+ file://cgi_py.patch \
+ file://setup_py_skip_cross_import_check.patch \
+ file://add-md5module-support.patch \
+ file://host_include_contamination.patch \
+ file://fix_for_using_different_libdir.patch \
+ file://setuptweaks.patch \
+ file://check-if-target-is-64b-not-host.patch \
+ file://search_db_h_in_inc_dirs_and_avoid_warning.patch \
+ file://avoid_warning_about_tkinter.patch \
+ file://avoid_warning_for_sunos_specific_module.patch \
+ file://python-2.7.3-remove-bsdb-rpath.patch \
+ file://fix-makefile-for-ptest.patch \
+ file://run-ptest \
+ file://parallel-makeinst-create-bindir.patch \
+ file://use_sysroot_ncurses_instead_of_host.patch \
+ file://add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch \
+ file://pass-missing-libraries-to-Extension-for-mul.patch \
+ file://support_SOURCE_DATE_EPOCH_in_py_compile_2.7.patch \
+ file://fix-gc-alignment.patch \
+"
+
+S = "${WORKDIR}/Python-${PV}"
+
+inherit autotools multilib_header python-dir pythonnative
+
+CONFIGUREOPTS += " --with-system-ffi "
+
+EXTRA_OECONF += "ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=no"
+
+PACKAGECONFIG ??= "bdb"
+PACKAGECONFIG[bdb] = ",,db"
+
+do_configure_append() {
+ rm -f ${S}/Makefile.orig
+ autoreconf -Wcross --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi
+}
+
+do_compile() {
+ # regenerate platform specific files, because they depend on system headers
+ cd ${S}/Lib/plat-linux2
+ include=${STAGING_INCDIR} ${STAGING_BINDIR_NATIVE}/python-native/python \
+ ${S}/Tools/scripts/h2py.py -i '(u_long)' \
+ ${STAGING_INCDIR}/dlfcn.h \
+ ${STAGING_INCDIR}/linux/cdrom.h \
+ ${STAGING_INCDIR}/netinet/in.h \
+ ${STAGING_INCDIR}/sys/types.h
+ sed -e 's,${STAGING_DIR_HOST},,g' -i *.py
+ cd -
+
+ # remove any bogus LD_LIBRARY_PATH
+ sed -i -e s,RUNSHARED=.*,RUNSHARED=, Makefile
+
+ if [ ! -f Makefile.orig ]; then
+ install -m 0644 Makefile Makefile.orig
+ fi
+ sed -i -e 's#^LDFLAGS=.*#LDFLAGS=${LDFLAGS} -L. -L${STAGING_LIBDIR}#g' \
+ -e 's,libdir=${libdir},libdir=${STAGING_LIBDIR},g' \
+ -e 's,libexecdir=${libexecdir},libexecdir=${STAGING_DIR_HOST}${libexecdir},g' \
+ -e 's,^LIBDIR=.*,LIBDIR=${STAGING_LIBDIR},g' \
+ -e 's,includedir=${includedir},includedir=${STAGING_INCDIR},g' \
+ -e 's,^INCLUDEDIR=.*,INCLUDE=${STAGING_INCDIR},g' \
+ -e 's,^CONFINCLUDEDIR=.*,CONFINCLUDE=${STAGING_INCDIR},g' \
+ Makefile
+ # save copy of it now, because if we do it in do_install and
+ # then call do_install twice we get Makefile.orig == Makefile.sysroot
+ install -m 0644 Makefile Makefile.sysroot
+
+ export CROSS_COMPILE="${TARGET_PREFIX}"
+ export PYTHONBUILDDIR="${B}"
+
+ oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
+ HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \
+ STAGING_LIBDIR=${STAGING_LIBDIR} \
+ STAGING_INCDIR=${STAGING_INCDIR} \
+ STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
+ OPT="${CFLAGS}"
+}
+
+do_install() {
+ # make install needs the original Makefile, or otherwise the inclues would
+ # go to ${D}${STAGING...}/...
+ install -m 0644 Makefile.orig Makefile
+
+ export CROSS_COMPILE="${TARGET_PREFIX}"
+ export PYTHONBUILDDIR="${B}"
+
+ # After swizzling the makefile, we need to run the build again.
+ # install can race with the build so we have to run this first, then install
+ oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
+ HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \
+ CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \
+ STAGING_LIBDIR=${STAGING_LIBDIR} \
+ STAGING_INCDIR=${STAGING_INCDIR} \
+ STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
+ DESTDIR=${D} LIBDIR=${libdir}
+
+ oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
+ HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \
+ CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \
+ STAGING_LIBDIR=${STAGING_LIBDIR} \
+ STAGING_INCDIR=${STAGING_INCDIR} \
+ STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
+ DESTDIR=${D} LIBDIR=${libdir} install
+
+ install -m 0644 Makefile.sysroot ${D}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
+
+ if [ -e ${WORKDIR}/sitecustomize.py ]; then
+ install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN}
+ fi
+
+ oe_multilib_header python${PYTHON_MAJMIN}/pyconfig.h
+
+ if [ -z "${@bb.utils.filter('PACKAGECONFIG', 'bdb', d)}" ]; then
+ rm -rf ${D}/${libdir}/python${PYTHON_MAJMIN}/bsddb
+ fi
+}
+
+do_install_append_class-nativesdk () {
+ create_wrapper ${D}${bindir}/python2.7 PYTHONHOME='${prefix}' TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo'
+}
+
+SSTATE_SCAN_FILES += "Makefile"
+PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess"
+
+py_package_preprocess () {
+ # copy back the old Makefile to fix target package
+ install -m 0644 ${B}/Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
+
+ # Remove references to buildmachine paths in target Makefile and _sysconfigdata
+ sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g \
+ -e 's|${DEBUG_PREFIX_MAP}||g' \
+ -e 's:${HOSTTOOLS_DIR}/::g' \
+ -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
+ -e 's:${RECIPE_SYSROOT}::g' \
+ -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \
+ ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile \
+ ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py
+ (cd ${PKGD}; python -m py_compile ./${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py)
+}
+
+
+# manual dependency additions
+RPROVIDES_${PN}-core = "${PN}"
+RRECOMMENDS_${PN}-core_append_class-nativesdk = " nativesdk-python-modules"
+RRECOMMENDS_${PN}-crypt = "openssl"
+
+# package libpython2
+PACKAGES =+ "lib${BPN}2"
+FILES_lib${BPN}2 = "${libdir}/libpython*.so.*"
+
+# catch all the rest (unsorted)
+PACKAGES += "${PN}-misc"
+FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}"
+RDEPENDS_${PN}-modules += "${PN}-misc"
+
+# ptest
+RDEPENDS_${PN}-ptest = "${PN}-modules ${PN}-tests"
+#inherit ptest after "require python-${PYTHON_MAJMIN}-manifest.inc" so PACKAGES doesn't get overwritten
+inherit ptest
+
+# This must come after inherit ptest for the override to take effect
+do_install_ptest() {
+ cp ${B}/Makefile ${D}${PTEST_PATH}
+ sed -e s:LIBDIR/python/ptest:${PTEST_PATH}:g \
+ -e s:LIBDIR:${libdir}:g \
+ -i ${D}${PTEST_PATH}/run-ptest
+
+ #Remove build host references
+ sed -i \
+ -e 's:--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g \
+ -e 's:--sysroot=${STAGING_DIR_TARGET}::g' \
+ -e 's|${DEBUG_PREFIX_MAP}||g' \
+ -e 's:${HOSTTOOLS_DIR}/::g' \
+ -e 's:${RECIPE_SYSROOT}::g' \
+ -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \
+ ${D}/${PTEST_PATH}/Makefile
+}
+
+# catch manpage
+PACKAGES += "${PN}-man"
+FILES_${PN}-man = "${datadir}/man"
+
+# Nasty but if bdb isn't enabled the package won't be generated
+RDEPENDS_${PN}-modules_remove = "${@bb.utils.contains('PACKAGECONFIG', 'bdb', '', '${PN}-bsddb', d)}"
+
+BBCLASSEXTEND = "nativesdk"
+
+RPROVIDES_${PN} += "${PN}-modules"
+
+# We want bytecode precompiled .py files (.pyc's) by default
+# but the user may set it on their own conf
+
+INCLUDE_PYCS ?= "1"
+
+python(){
+ import json
+
+ filename = os.path.join(d.getVar('THISDIR'), 'python', 'python2-manifest.json')
+ # This python changes the datastore based on the contents of a file, so mark
+ # that dependency.
+ bb.parse.mark_dependency(d, filename)
+
+ with open(filename) as manifest_file:
+ python_manifest=json.load(manifest_file)
+
+ include_pycs = d.getVar('INCLUDE_PYCS')
+
+ packages = d.getVar('PACKAGES').split()
+ pn = d.getVar('PN')
+
+ newpackages=[]
+
+ for key in python_manifest:
+ pypackage= pn + '-' + key
+
+ if pypackage not in packages:
+ # We need to prepend, otherwise python-misc gets everything
+ # so we use a new variable
+ newpackages.append(pypackage)
+
+ # "Build" python's manifest FILES, RDEPENDS and SUMMARY
+ d.setVar('FILES_' + pypackage, '')
+ for value in python_manifest[key]['files']:
+ d.appendVar('FILES_' + pypackage, ' ' + value)
+ if include_pycs == '1':
+ if value.endswith('.py'):
+ d.appendVar('FILES_' + pypackage, ' ' + value + 'c')
+
+ d.setVar('RDEPENDS_' + pypackage, '')
+ for value in python_manifest[key]['rdepends']:
+ # Make it work with or without $PN
+ if '${PN}' in value:
+ value=value.split('-')[1]
+ d.appendVar('RDEPENDS_' + pypackage, ' ' + pn + '-' + value)
+ d.setVar('SUMMARY_' + pypackage, python_manifest[key]['summary'])
+
+ # We need to ensure staticdev packages match for files first so we sort in reverse
+ newpackages.sort(reverse=True)
+ # Prepending so to avoid python-misc getting everything
+ packages = newpackages + packages
+ d.setVar('PACKAGES', ' '.join(packages))
+ d.setVar('ALLOW_EMPTY_${PN}-modules', '1')
+}
+
+# Files needed to create a new manifest
+SRC_URI += "file://create_manifest2.py file://get_module_deps2.py file://python2-manifest.json"
+
+do_create_manifest() {
+ # This task should be run with every new release of Python.
+ # We must ensure that PACKAGECONFIG enables everything when creating
+ # a new manifest, this is to base our new manifest on a complete
+ # native python build, containing all dependencies, otherwise the task
+ # wont be able to find the required files.
+ # e.g. BerkeleyDB is an optional build dependency so it may or may not
+ # be present, we must ensure it is.
+
+ cd ${WORKDIR}
+ # This needs to be executed by python-native and NOT by HOST's python
+ nativepython create_manifest2.py
+ cp python2-manifest.json.new ${THISDIR}/python/python2-manifest.json
+}
+
+# bitbake python -c create_manifest
+addtask do_create_manifest
+
+# Make sure we have native python ready when we create a new manifest
+do_create_manifest[depends] += "python:do_prepare_recipe_sysroot"
+do_create_manifest[depends] += "python:do_patch"
OpenPOWER on IntegriCloud