summaryrefslogtreecommitdiffstats
path: root/external/poky/meta/recipes-devtools/python
diff options
context:
space:
mode:
Diffstat (limited to 'external/poky/meta/recipes-devtools/python')
-rw-r--r--external/poky/meta/recipes-devtools/python/files/0001-bpo-39503-CVE-2020-8492-Fix-AbstractBasicAuthHandler.patch248
-rw-r--r--external/poky/meta/recipes-devtools/python/files/0001-conditionally-do-not-fetch-code-by-easy_install.patch10
-rw-r--r--external/poky/meta/recipes-devtools/python/python-async.inc4
-rw-r--r--external/poky/meta/recipes-devtools/python/python-gitdb.inc6
-rw-r--r--external/poky/meta/recipes-devtools/python/python-native/0001-python-native-fix-one-do_populate_sysroot-warning.patch39
-rw-r--r--external/poky/meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch18
-rw-r--r--external/poky/meta/recipes-devtools/python/python-native/11-distutils-never-modify-shebang-line.patch20
-rw-r--r--external/poky/meta/recipes-devtools/python/python-native/debug.patch32
-rw-r--r--external/poky/meta/recipes-devtools/python/python-native/multilib.patch235
-rw-r--r--external/poky/meta/recipes-devtools/python/python-native/nohostlibs.patch54
-rw-r--r--external/poky/meta/recipes-devtools/python/python-native/revert_use_of_sysconfigdata.patch86
-rw-r--r--external/poky/meta/recipes-devtools/python/python-native/unixccompiler.patch20
-rw-r--r--external/poky/meta/recipes-devtools/python/python-native_2.7.16.bb89
-rw-r--r--external/poky/meta/recipes-devtools/python/python-nose_1.3.7.bb2
-rw-r--r--external/poky/meta/recipes-devtools/python/python-pbr.inc3
-rw-r--r--external/poky/meta/recipes-devtools/python/python-pycryptodome.inc26
-rw-r--r--external/poky/meta/recipes-devtools/python/python-scons_3.0.1.bb21
-rw-r--r--external/poky/meta/recipes-devtools/python/python-setuptools.inc18
-rw-r--r--external/poky/meta/recipes-devtools/python/python-setuptools_40.0.0.bb9
-rw-r--r--external/poky/meta/recipes-devtools/python/python-six.inc5
-rw-r--r--external/poky/meta/recipes-devtools/python/python-smmap.inc10
-rw-r--r--external/poky/meta/recipes-devtools/python/python-testtools.inc1
-rw-r--r--external/poky/meta/recipes-devtools/python/python.inc46
-rw-r--r--external/poky/meta/recipes-devtools/python/python/0001-distutils-set-the-prefix-to-be-inside-staging-direct.patch51
-rw-r--r--external/poky/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch100
-rw-r--r--external/poky/meta/recipes-devtools/python/python/03-fix-tkinter-detection.patch46
-rw-r--r--external/poky/meta/recipes-devtools/python/python/05-enable-ctypes-cross-build.patch27
-rw-r--r--external/poky/meta/recipes-devtools/python/python/06-avoid_usr_lib_termcap_path_in_linking.patch35
-rw-r--r--external/poky/meta/recipes-devtools/python/python/add-md5module-support.patch18
-rw-r--r--external/poky/meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patch29
-rw-r--r--external/poky/meta/recipes-devtools/python/python/avoid_warning_for_sunos_specific_module.patch23
-rw-r--r--external/poky/meta/recipes-devtools/python/python/bpo-30458-cve-2019-9740.patch219
-rw-r--r--external/poky/meta/recipes-devtools/python/python/bpo-35121-cve-2018-20852.patch127
-rw-r--r--external/poky/meta/recipes-devtools/python/python/bpo-35907-cve-2019-9948-fix.patch55
-rw-r--r--external/poky/meta/recipes-devtools/python/python/bpo-35907-cve-2019-9948.patch55
-rw-r--r--external/poky/meta/recipes-devtools/python/python/bpo-36216-cve-2019-9636-fix.patch28
-rw-r--r--external/poky/meta/recipes-devtools/python/python/bpo-36216-cve-2019-9636.patch111
-rw-r--r--external/poky/meta/recipes-devtools/python/python/builddir.patch46
-rw-r--r--external/poky/meta/recipes-devtools/python/python/cgi_py.patch23
-rw-r--r--external/poky/meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch57
-rw-r--r--external/poky/meta/recipes-devtools/python/python/create_manifest2.py292
-rw-r--r--external/poky/meta/recipes-devtools/python/python/fix_for_using_different_libdir.patch77
-rw-r--r--external/poky/meta/recipes-devtools/python/python/float-endian.patch216
-rw-r--r--external/poky/meta/recipes-devtools/python/python/get_module_deps2.py112
-rw-r--r--external/poky/meta/recipes-devtools/python/python/host_include_contamination.patch28
-rw-r--r--external/poky/meta/recipes-devtools/python/python/multilib.patch298
-rw-r--r--external/poky/meta/recipes-devtools/python/python/parallel-makeinst-create-bindir.patch19
-rw-r--r--external/poky/meta/recipes-devtools/python/python/python-2.7.3-remove-bsdb-rpath.patch28
-rw-r--r--external/poky/meta/recipes-devtools/python/python/python2-manifest.json1136
-rw-r--r--external/poky/meta/recipes-devtools/python/python/run-ptest3
-rw-r--r--external/poky/meta/recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch35
-rw-r--r--external/poky/meta/recipes-devtools/python/python/setup_py_skip_cross_import_check.patch27
-rw-r--r--external/poky/meta/recipes-devtools/python/python/setuptweaks.patch57
-rw-r--r--external/poky/meta/recipes-devtools/python/python/sitecustomize.py37
-rw-r--r--external/poky/meta/recipes-devtools/python/python/support_SOURCE_DATE_EPOCH_in_py_compile_2.7.patch34
-rw-r--r--external/poky/meta/recipes-devtools/python/python/use_sysroot_ncurses_instead_of_host.patch21
-rw-r--r--external/poky/meta/recipes-devtools/python/python3-dbus_1.2.16.bb (renamed from external/poky/meta/recipes-devtools/python/python3-dbus_1.2.8.bb)12
-rw-r--r--external/poky/meta/recipes-devtools/python/python3-docutils_0.16.bb (renamed from external/poky/meta/recipes-devtools/python/python3-docutils_0.14.bb)7
-rw-r--r--external/poky/meta/recipes-devtools/python/python3-git_2.1.11.bb2
-rw-r--r--external/poky/meta/recipes-devtools/python/python3-git_3.0.5.bb (renamed from external/poky/meta/recipes-devtools/python/python-git.inc)11
-rw-r--r--external/poky/meta/recipes-devtools/python/python3-gitdb_2.0.6.bb (renamed from external/poky/meta/recipes-devtools/python/python3-gitdb_2.0.4.bb)1
-rw-r--r--external/poky/meta/recipes-devtools/python/python3-libarchive-c_2.9.bb21
-rw-r--r--external/poky/meta/recipes-devtools/python/python3-magic_0.4.15.bb19
-rw-r--r--external/poky/meta/recipes-devtools/python/python3-mako_1.0.7.bb2
-rw-r--r--external/poky/meta/recipes-devtools/python/python3-mako_1.1.1.bb (renamed from external/poky/meta/recipes-devtools/python/python-mako.inc)8
-rw-r--r--external/poky/meta/recipes-devtools/python/python3-native_3.5.6.bb99
-rw-r--r--external/poky/meta/recipes-devtools/python/python3-nose_1.3.7.bb4
-rw-r--r--external/poky/meta/recipes-devtools/python/python3-pbr_4.2.0.bb2
-rw-r--r--external/poky/meta/recipes-devtools/python/python3-pbr_5.4.4.bb5
-rw-r--r--external/poky/meta/recipes-devtools/python/python3-pip_20.0.2.bb (renamed from external/poky/meta/recipes-devtools/python/python3-pip_18.0.bb)7
-rw-r--r--external/poky/meta/recipes-devtools/python/python3-pycairo_1.19.0.bb (renamed from external/poky/meta/recipes-devtools/python/python3-pycairo_1.15.6.bb)16
-rw-r--r--external/poky/meta/recipes-devtools/python/python3-pycryptodome_3.9.7.bb5
-rw-r--r--external/poky/meta/recipes-devtools/python/python3-pycryptodomex_3.9.7.bb9
-rw-r--r--external/poky/meta/recipes-devtools/python/python3-pyelftools_0.26.bb14
-rw-r--r--external/poky/meta/recipes-devtools/python/python3-pygments_2.5.2.bb20
-rw-r--r--external/poky/meta/recipes-devtools/python/python3-pygobject/0001-Do-not-build-tests.patch30
-rw-r--r--external/poky/meta/recipes-devtools/python/python3-pygobject_3.34.0.bb (renamed from external/poky/meta/recipes-devtools/python/python3-pygobject_3.28.3.bb)14
-rw-r--r--external/poky/meta/recipes-devtools/python/python3-scons-native_3.1.2.bb (renamed from external/poky/meta/recipes-devtools/python/python-scons-native_3.0.1.bb)7
-rw-r--r--external/poky/meta/recipes-devtools/python/python3-scons_3.1.2.bb33
-rw-r--r--external/poky/meta/recipes-devtools/python/python3-setuptools_45.2.0.bb (renamed from external/poky/meta/recipes-devtools/python/python3-setuptools_40.0.0.bb)0
-rw-r--r--external/poky/meta/recipes-devtools/python/python3-six_1.11.0.bb2
-rw-r--r--external/poky/meta/recipes-devtools/python/python3-six_1.14.0.bb5
-rw-r--r--external/poky/meta/recipes-devtools/python/python3-smmap_2.0.5.bb (renamed from external/poky/meta/recipes-devtools/python/python3-smmap_0.9.0.bb)0
-rw-r--r--external/poky/meta/recipes-devtools/python/python3-subunit_1.3.0.bb2
-rw-r--r--external/poky/meta/recipes-devtools/python/python3-testtools/no_traceback2.patch23
-rw-r--r--external/poky/meta/recipes-devtools/python/python3-testtools_2.3.0.bb2
-rw-r--r--external/poky/meta/recipes-devtools/python/python3.inc43
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/0001-Do-not-add-usr-lib-termcap-to-linker-flags-to-avoid-.patch25
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch214
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch25
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/0001-Don-t-search-system-for-headers-libraries.patch29
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/0001-Issue-21272-Use-_sysconfigdata.py-to-initialize-dist.patch66
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/0001-Issue-28043-SSLContext-has-improved-default-settings.patch272
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/0001-Lib-sysconfig.py-fix-another-place-where-lib-is-hard.patch31
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/0001-Makefile-do-not-compile-.pyc-in-parallel.patch58
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch34
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch25
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/0001-Use-FLAG_REF-always-for-interned-strings.patch35
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch209
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/0001-configure.ac-fix-LIBPL.patch35
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch42
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch37
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/0001-python3-Do-not-hardcode-lib-for-distutils.patch43
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch121
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/0001-setup.py-pass-missing-libraries-to-Extension-for-mul.patch (renamed from external/poky/meta/recipes-devtools/python/python/pass-missing-libraries-to-Extension-for-mul.patch)49
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/0001-test_locale.py-correct-the-test-output-format.patch46
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/0002-Makefile-add-target-to-split-profile-generation.patch40
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/0002-bpo-29136-Add-TLS-1.3-cipher-suites-and-OP_NO_TLSv1_.patch227
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/0003-bpo-32947-Fixes-for-TLS-1.3-and-OpenSSL-1.1.1-GH-876.patch173
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/0004-bpo-33570-TLS-1.3-ciphers-for-OpenSSL-1.1.1-GH-6976.patch110
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/0005-bpo-30714-ALPN-changes-for-OpenSSL-1.1.0f-2305.patch68
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch32
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch48
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch42
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch33
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch92
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch33
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/130-readline-setup.patch55
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/150-fix-setupterm.patch17
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/CVE-2018-14647.patch95
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/CVE-2018-20406.patch217
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/CVE-2018-20852.patch129
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/CVE-2019-9636.patch154
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/CVE-2019-9740.patch155
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/CVE-2020-14422.patch77
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/Use-correct-CFLAGS-for-extensions-when-cross-compili.patch56
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch21
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch44
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/cgi_py.patch15
-rwxr-xr-xexternal/poky/meta/recipes-devtools/python/python3/check_build_completeness.py17
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/configure.ac-fix-LIBPL.patch30
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/create_manifest3.py28
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/crosspythonpath.patch (renamed from external/poky/meta/recipes-devtools/python/python/add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch)23
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch54
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/float-endian.patch212
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/ftplib.patch60
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/host_include_contamination.patch28
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/pass-missing-libraries-to-Extension-for-mul.patch82
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/python-3.3-multilib.patch363
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/python-config.patch24
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/python3-manifest.json282
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch25
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/reformat_sysconfig.py21
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/regen-all.patch25
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/run-ptest2
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/setup.py-check-cross_compiling-when-get-FLAGS.patch50
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/setuptweaks.patch57
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/signal.patch56
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/sitecustomize.py37
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/support_SOURCE_DATE_EPOCH_in_py_compile.patch97
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/sysconfig.py-add-_PYTHON_PROJECT_SRC.patch51
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/sysroot-include-headers.patch35
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/tweak-MULTIARCH-for-powerpc-linux-gnuspe.patch52
-rw-r--r--external/poky/meta/recipes-devtools/python/python3/unixccompiler.patch35
-rw-r--r--external/poky/meta/recipes-devtools/python/python3_3.5.6.bb333
-rw-r--r--external/poky/meta/recipes-devtools/python/python3_3.8.2.bb353
-rw-r--r--external/poky/meta/recipes-devtools/python/python_2.7.16.bb270
157 files changed, 2342 insertions, 8586 deletions
diff --git a/external/poky/meta/recipes-devtools/python/files/0001-bpo-39503-CVE-2020-8492-Fix-AbstractBasicAuthHandler.patch b/external/poky/meta/recipes-devtools/python/files/0001-bpo-39503-CVE-2020-8492-Fix-AbstractBasicAuthHandler.patch
new file mode 100644
index 00000000..e16b99bc
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/python/files/0001-bpo-39503-CVE-2020-8492-Fix-AbstractBasicAuthHandler.patch
@@ -0,0 +1,248 @@
+From 0b297d4ff1c0e4480ad33acae793fbaf4bf015b4 Mon Sep 17 00:00:00 2001
+From: Victor Stinner <vstinner@python.org>
+Date: Thu, 2 Apr 2020 02:52:20 +0200
+Subject: [PATCH] bpo-39503: CVE-2020-8492: Fix AbstractBasicAuthHandler
+ (GH-18284)
+
+Upstream-Status: Backport
+(https://github.com/python/cpython/commit/0b297d4ff1c0e4480ad33acae793fbaf4bf015b4)
+
+CVE: CVE-2020-8492
+
+The AbstractBasicAuthHandler class of the urllib.request module uses
+an inefficient regular expression which can be exploited by an
+attacker to cause a denial of service. Fix the regex to prevent the
+catastrophic backtracking. Vulnerability reported by Ben Caller
+and Matt Schwager.
+
+AbstractBasicAuthHandler of urllib.request now parses all
+WWW-Authenticate HTTP headers and accepts multiple challenges per
+header: use the realm of the first Basic challenge.
+
+Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com>
+Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com>
+---
+ Lib/test/test_urllib2.py | 90 ++++++++++++-------
+ Lib/urllib/request.py | 69 ++++++++++----
+ .../2020-03-25-16-02-16.bpo-39503.YmMbYn.rst | 3 +
+ .../2020-01-30-16-15-29.bpo-39503.B299Yq.rst | 5 ++
+ 4 files changed, 115 insertions(+), 52 deletions(-)
+ create mode 100644 Misc/NEWS.d/next/Library/2020-03-25-16-02-16.bpo-39503.YmMbYn.rst
+ create mode 100644 Misc/NEWS.d/next/Security/2020-01-30-16-15-29.bpo-39503.B299Yq.rst
+
+diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py
+index 8abedaac98..e69ac3e213 100644
+--- a/Lib/test/test_urllib2.py
++++ b/Lib/test/test_urllib2.py
+@@ -1446,40 +1446,64 @@ class HandlerTests(unittest.TestCase):
+ bypass = {'exclude_simple': True, 'exceptions': []}
+ self.assertTrue(_proxy_bypass_macosx_sysconf('test', bypass))
+
+- def test_basic_auth(self, quote_char='"'):
+- opener = OpenerDirector()
+- password_manager = MockPasswordManager()
+- auth_handler = urllib.request.HTTPBasicAuthHandler(password_manager)
+- realm = "ACME Widget Store"
+- http_handler = MockHTTPHandler(
+- 401, 'WWW-Authenticate: Basic realm=%s%s%s\r\n\r\n' %
+- (quote_char, realm, quote_char))
+- opener.add_handler(auth_handler)
+- opener.add_handler(http_handler)
+- self._test_basic_auth(opener, auth_handler, "Authorization",
+- realm, http_handler, password_manager,
+- "http://acme.example.com/protected",
+- "http://acme.example.com/protected",
+- )
+-
+- def test_basic_auth_with_single_quoted_realm(self):
+- self.test_basic_auth(quote_char="'")
+-
+- def test_basic_auth_with_unquoted_realm(self):
+- opener = OpenerDirector()
+- password_manager = MockPasswordManager()
+- auth_handler = urllib.request.HTTPBasicAuthHandler(password_manager)
+- realm = "ACME Widget Store"
+- http_handler = MockHTTPHandler(
+- 401, 'WWW-Authenticate: Basic realm=%s\r\n\r\n' % realm)
+- opener.add_handler(auth_handler)
+- opener.add_handler(http_handler)
+- with self.assertWarns(UserWarning):
++ def check_basic_auth(self, headers, realm):
++ with self.subTest(realm=realm, headers=headers):
++ opener = OpenerDirector()
++ password_manager = MockPasswordManager()
++ auth_handler = urllib.request.HTTPBasicAuthHandler(password_manager)
++ body = '\r\n'.join(headers) + '\r\n\r\n'
++ http_handler = MockHTTPHandler(401, body)
++ opener.add_handler(auth_handler)
++ opener.add_handler(http_handler)
+ self._test_basic_auth(opener, auth_handler, "Authorization",
+- realm, http_handler, password_manager,
+- "http://acme.example.com/protected",
+- "http://acme.example.com/protected",
+- )
++ realm, http_handler, password_manager,
++ "http://acme.example.com/protected",
++ "http://acme.example.com/protected")
++
++ def test_basic_auth(self):
++ realm = "realm2@example.com"
++ realm2 = "realm2@example.com"
++ basic = f'Basic realm="{realm}"'
++ basic2 = f'Basic realm="{realm2}"'
++ other_no_realm = 'Otherscheme xxx'
++ digest = (f'Digest realm="{realm2}", '
++ f'qop="auth, auth-int", '
++ f'nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093", '
++ f'opaque="5ccc069c403ebaf9f0171e9517f40e41"')
++ for realm_str in (
++ # test "quote" and 'quote'
++ f'Basic realm="{realm}"',
++ f"Basic realm='{realm}'",
++
++ # charset is ignored
++ f'Basic realm="{realm}", charset="UTF-8"',
++
++ # Multiple challenges per header
++ f'{basic}, {basic2}',
++ f'{basic}, {other_no_realm}',
++ f'{other_no_realm}, {basic}',
++ f'{basic}, {digest}',
++ f'{digest}, {basic}',
++ ):
++ headers = [f'WWW-Authenticate: {realm_str}']
++ self.check_basic_auth(headers, realm)
++
++ # no quote: expect a warning
++ with support.check_warnings(("Basic Auth Realm was unquoted",
++ UserWarning)):
++ headers = [f'WWW-Authenticate: Basic realm={realm}']
++ self.check_basic_auth(headers, realm)
++
++ # Multiple headers: one challenge per header.
++ # Use the first Basic realm.
++ for challenges in (
++ [basic, basic2],
++ [basic, digest],
++ [digest, basic],
++ ):
++ headers = [f'WWW-Authenticate: {challenge}'
++ for challenge in challenges]
++ self.check_basic_auth(headers, realm)
+
+ def test_proxy_basic_auth(self):
+ opener = OpenerDirector()
+diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
+index 7fe50535da..2a3d71554f 100644
+--- a/Lib/urllib/request.py
++++ b/Lib/urllib/request.py
+@@ -937,8 +937,15 @@ class AbstractBasicAuthHandler:
+
+ # allow for double- and single-quoted realm values
+ # (single quotes are a violation of the RFC, but appear in the wild)
+- rx = re.compile('(?:.*,)*[ \t]*([^ \t]+)[ \t]+'
+- 'realm=(["\']?)([^"\']*)\\2', re.I)
++ rx = re.compile('(?:^|,)' # start of the string or ','
++ '[ \t]*' # optional whitespaces
++ '([^ \t]+)' # scheme like "Basic"
++ '[ \t]+' # mandatory whitespaces
++ # realm=xxx
++ # realm='xxx'
++ # realm="xxx"
++ 'realm=(["\']?)([^"\']*)\\2',
++ re.I)
+
+ # XXX could pre-emptively send auth info already accepted (RFC 2617,
+ # end of section 2, and section 1.2 immediately after "credentials"
+@@ -950,27 +957,51 @@ class AbstractBasicAuthHandler:
+ self.passwd = password_mgr
+ self.add_password = self.passwd.add_password
+
++ def _parse_realm(self, header):
++ # parse WWW-Authenticate header: accept multiple challenges per header
++ found_challenge = False
++ for mo in AbstractBasicAuthHandler.rx.finditer(header):
++ scheme, quote, realm = mo.groups()
++ if quote not in ['"', "'"]:
++ warnings.warn("Basic Auth Realm was unquoted",
++ UserWarning, 3)
++
++ yield (scheme, realm)
++
++ found_challenge = True
++
++ if not found_challenge:
++ if header:
++ scheme = header.split()[0]
++ else:
++ scheme = ''
++ yield (scheme, None)
++
+ def http_error_auth_reqed(self, authreq, host, req, headers):
+ # host may be an authority (without userinfo) or a URL with an
+ # authority
+- # XXX could be multiple headers
+- authreq = headers.get(authreq, None)
++ headers = headers.get_all(authreq)
++ if not headers:
++ # no header found
++ return
+
+- if authreq:
+- scheme = authreq.split()[0]
+- if scheme.lower() != 'basic':
+- raise ValueError("AbstractBasicAuthHandler does not"
+- " support the following scheme: '%s'" %
+- scheme)
+- else:
+- mo = AbstractBasicAuthHandler.rx.search(authreq)
+- if mo:
+- scheme, quote, realm = mo.groups()
+- if quote not in ['"',"'"]:
+- warnings.warn("Basic Auth Realm was unquoted",
+- UserWarning, 2)
+- if scheme.lower() == 'basic':
+- return self.retry_http_basic_auth(host, req, realm)
++ unsupported = None
++ for header in headers:
++ for scheme, realm in self._parse_realm(header):
++ if scheme.lower() != 'basic':
++ unsupported = scheme
++ continue
++
++ if realm is not None:
++ # Use the first matching Basic challenge.
++ # Ignore following challenges even if they use the Basic
++ # scheme.
++ return self.retry_http_basic_auth(host, req, realm)
++
++ if unsupported is not None:
++ raise ValueError("AbstractBasicAuthHandler does not "
++ "support the following scheme: %r"
++ % (scheme,))
+
+ def retry_http_basic_auth(self, host, req, realm):
+ user, pw = self.passwd.find_user_password(realm, host)
+diff --git a/Misc/NEWS.d/next/Library/2020-03-25-16-02-16.bpo-39503.YmMbYn.rst b/Misc/NEWS.d/next/Library/2020-03-25-16-02-16.bpo-39503.YmMbYn.rst
+new file mode 100644
+index 0000000000..be80ce79d9
+--- /dev/null
++++ b/Misc/NEWS.d/next/Library/2020-03-25-16-02-16.bpo-39503.YmMbYn.rst
+@@ -0,0 +1,3 @@
++:class:`~urllib.request.AbstractBasicAuthHandler` of :mod:`urllib.request`
++now parses all WWW-Authenticate HTTP headers and accepts multiple challenges
++per header: use the realm of the first Basic challenge.
+diff --git a/Misc/NEWS.d/next/Security/2020-01-30-16-15-29.bpo-39503.B299Yq.rst b/Misc/NEWS.d/next/Security/2020-01-30-16-15-29.bpo-39503.B299Yq.rst
+new file mode 100644
+index 0000000000..9f2800581c
+--- /dev/null
++++ b/Misc/NEWS.d/next/Security/2020-01-30-16-15-29.bpo-39503.B299Yq.rst
+@@ -0,0 +1,5 @@
++CVE-2020-8492: The :class:`~urllib.request.AbstractBasicAuthHandler` class of the
++:mod:`urllib.request` module uses an inefficient regular expression which can
++be exploited by an attacker to cause a denial of service. Fix the regex to
++prevent the catastrophic backtracking. Vulnerability reported by Ben Caller
++and Matt Schwager.
+--
+2.24.1
+
diff --git a/external/poky/meta/recipes-devtools/python/files/0001-conditionally-do-not-fetch-code-by-easy_install.patch b/external/poky/meta/recipes-devtools/python/files/0001-conditionally-do-not-fetch-code-by-easy_install.patch
index 4b179218..5f99cd25 100644
--- a/external/poky/meta/recipes-devtools/python/files/0001-conditionally-do-not-fetch-code-by-easy_install.patch
+++ b/external/poky/meta/recipes-devtools/python/files/0001-conditionally-do-not-fetch-code-by-easy_install.patch
@@ -1,4 +1,4 @@
-From 019422d19c6401fa8f45b1311ecd31bb087c809d Mon Sep 17 00:00:00 2001
+From a8f871c9ebc4fcb99d4163b226aabeef26567099 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Tue, 17 Jul 2018 10:13:38 +0800
Subject: [PATCH] conditionally do not fetch code by easy_install
@@ -9,15 +9,16 @@ internet by easy_install.
Upstream-Status: Inappropriate [oe specific]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+
---
setuptools/command/easy_install.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
-index 85ee40f..7eb9d2a 100755
+index 426301d..55c8062 100644
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
-@@ -637,6 +637,11 @@ class easy_install(Command):
+@@ -649,6 +649,11 @@ class easy_install(Command):
os.path.exists(tmpdir) and rmtree(rmtree_safe(tmpdir))
def easy_install(self, spec, deps=False):
@@ -29,6 +30,3 @@ index 85ee40f..7eb9d2a 100755
if not self.editable:
self.install_site_py()
---
-2.7.4
-
diff --git a/external/poky/meta/recipes-devtools/python/python-async.inc b/external/poky/meta/recipes-devtools/python/python-async.inc
index 6664ab01..af887dc4 100644
--- a/external/poky/meta/recipes-devtools/python/python-async.inc
+++ b/external/poky/meta/recipes-devtools/python/python-async.inc
@@ -1,7 +1,7 @@
SUMMARY = "Python framework to process interdependent tasks in a pool of workers"
HOMEPAGE = "http://github.com/gitpython-developers/async"
SECTION = "devel/python"
-LICENSE = "BSD"
+LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=88df8e78b9edfd744953862179f2d14e"
inherit pypi
@@ -11,4 +11,4 @@ SRC_URI[sha256sum] = "ac6894d876e45878faae493b0cf61d0e28ec417334448ac0a6ea2229d8
RDEPENDS_${PN} += "${PYTHON_PN}-threading"
-BBCLASSEXTEND = "nativesdk"
+BBCLASSEXTEND = "native nativesdk"
diff --git a/external/poky/meta/recipes-devtools/python/python-gitdb.inc b/external/poky/meta/recipes-devtools/python/python-gitdb.inc
index 789ab959..23ec2986 100644
--- a/external/poky/meta/recipes-devtools/python/python-gitdb.inc
+++ b/external/poky/meta/recipes-devtools/python/python-gitdb.inc
@@ -8,8 +8,8 @@ inherit pypi
PYPI_PACKAGE = "gitdb2"
-SRC_URI[md5sum] = "6e21f5795a204f7afecb0a72fff66932"
-SRC_URI[sha256sum] = "bb4c85b8a58531c51373c89f92163b92f30f81369605a67cd52d1fc21246c044"
+SRC_URI[md5sum] = "1a7ea3362e405f8a5634f7ee53636094"
+SRC_URI[sha256sum] = "1b6df1433567a51a4a9c1a5a0de977aa351a405cc56d7d35f3388bad1f630350"
DEPENDS = "${PYTHON_PN}-async ${PYTHON_PN}-setuptools-native ${PYTHON_PN}-smmap"
@@ -21,4 +21,4 @@ RDEPENDS_${PN} += "${PYTHON_PN}-async \
${PYTHON_PN}-shell \
${PYTHON_PN}-smmap \
"
-BBCLASSEXTEND = "nativesdk"
+BBCLASSEXTEND = "native nativesdk"
diff --git a/external/poky/meta/recipes-devtools/python/python-native/0001-python-native-fix-one-do_populate_sysroot-warning.patch b/external/poky/meta/recipes-devtools/python/python-native/0001-python-native-fix-one-do_populate_sysroot-warning.patch
deleted file mode 100644
index 98981892..00000000
--- a/external/poky/meta/recipes-devtools/python/python-native/0001-python-native-fix-one-do_populate_sysroot-warning.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From 12292444e1b3662b994bc223d92b8338fb0895ff Mon Sep 17 00:00:00 2001
-From: Changqing Li <changqing.li@windriver.com>
-Date: Thu, 25 Oct 2018 07:32:14 +0000
-Subject: [PATCH] python-native: fix one do_populate_sysroot warning
-
-Fix below warning:
-WARNING: Skipping RPATH /usr/lib64 as is a standard search path for
-work/x86_64-linux/python-native/2.7.15-r1.1/recipe-sysroot-native/
-usr/lib/python2.7/lib-dynload/_bsddb.so
-
-setup.py will check db.h under include_dirs, for native build,
-/usr/lib64 will be insert to postion 0 of include_dirs, so
-it's priority is higher then our sysroot, cause db.h sysroot
-is ignored, and rpath set to /usr/lib64. and this cause warning
-when do_populate_sysroot. use append to fix it.
-
-Upstream-Status: Inappropriate [oe-specific]
-
-Signed-off-by: Changqing Li <changqing.li@windriver.com>
----
- setup.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/setup.py b/setup.py
-index 7bf13ed..6c0f29b 100644
---- a/setup.py
-+++ b/setup.py
-@@ -40,7 +40,7 @@ def add_dir_to_list(dirlist, dir):
- 1) 'dir' is not already in 'dirlist'
- 2) 'dir' actually exists, and is a directory."""
- if dir is not None and os.path.isdir(dir) and dir not in dirlist:
-- dirlist.insert(0, dir)
-+ dirlist.append(dir)
-
- def macosx_sdk_root():
- """
---
-2.18.0
-
diff --git a/external/poky/meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch b/external/poky/meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch
deleted file mode 100644
index a39247ce..00000000
--- a/external/poky/meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python-native/11-distutils-never-modify-shebang-line.patch b/external/poky/meta/recipes-devtools/python/python-native/11-distutils-never-modify-shebang-line.patch
deleted file mode 100644
index c92469b9..00000000
--- a/external/poky/meta/recipes-devtools/python/python-native/11-distutils-never-modify-shebang-line.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python-native/debug.patch b/external/poky/meta/recipes-devtools/python/python-native/debug.patch
deleted file mode 100644
index 36178826..00000000
--- a/external/poky/meta/recipes-devtools/python/python-native/debug.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python-native/multilib.patch b/external/poky/meta/recipes-devtools/python/python-native/multilib.patch
deleted file mode 100644
index af0f173c..00000000
--- a/external/poky/meta/recipes-devtools/python/python-native/multilib.patch
+++ /dev/null
@@ -1,235 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python-native/nohostlibs.patch b/external/poky/meta/recipes-devtools/python/python-native/nohostlibs.patch
deleted file mode 100644
index 078060b4..00000000
--- a/external/poky/meta/recipes-devtools/python/python-native/nohostlibs.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python-native/revert_use_of_sysconfigdata.patch b/external/poky/meta/recipes-devtools/python/python-native/revert_use_of_sysconfigdata.patch
deleted file mode 100644
index 202aaf10..00000000
--- a/external/poky/meta/recipes-devtools/python/python-native/revert_use_of_sysconfigdata.patch
+++ /dev/null
@@ -1,86 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python-native/unixccompiler.patch b/external/poky/meta/recipes-devtools/python/python-native/unixccompiler.patch
deleted file mode 100644
index 45028291..00000000
--- a/external/poky/meta/recipes-devtools/python/python-native/unixccompiler.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python-native_2.7.16.bb b/external/poky/meta/recipes-devtools/python/python-native_2.7.16.bb
deleted file mode 100644
index b7442800..00000000
--- a/external/poky/meta/recipes-devtools/python/python-native_2.7.16.bb
+++ /dev/null
@@ -1,89 +0,0 @@
-require python.inc
-EXTRANATIVEPATH += "bzip2-native"
-DEPENDS = "openssl-native bzip2-replacement-native zlib-native readline-native sqlite3-native expat-native gdbm-native db-native"
-
-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://0001-python-native-fix-one-do_populate_sysroot-warning.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')
- with open(pythondir+'/python/python2-manifest.json') as manifest_file:
- manifest_str = manifest_file.read()
- json_start = manifest_str.find('# EOC') + 6
- manifest_file.seek(json_start)
- manifest_str = manifest_file.read()
- python_manifest = json.loads(manifest_str)
-
- 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/external/poky/meta/recipes-devtools/python/python-nose_1.3.7.bb b/external/poky/meta/recipes-devtools/python/python-nose_1.3.7.bb
deleted file mode 100644
index 6d69d2d6..00000000
--- a/external/poky/meta/recipes-devtools/python/python-nose_1.3.7.bb
+++ /dev/null
@@ -1,2 +0,0 @@
-inherit setuptools
-require python-nose.inc
diff --git a/external/poky/meta/recipes-devtools/python/python-pbr.inc b/external/poky/meta/recipes-devtools/python/python-pbr.inc
index 5a295c5f..0e64501c 100644
--- a/external/poky/meta/recipes-devtools/python/python-pbr.inc
+++ b/external/poky/meta/recipes-devtools/python/python-pbr.inc
@@ -5,9 +5,6 @@ SECTION = "devel/python"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=1dece7821bf3fd70fe1309eaa37d52a2"
-SRC_URI[md5sum] = "6619780896ca81c7cd19c6e2f439b6c9"
-SRC_URI[sha256sum] = "1b8be50d938c9bb75d0eaf7eda111eec1bf6dc88a62a6412e33bf077457e0f45"
-
inherit pypi
RDEPENDS_${PN} += "${PYTHON_PN}-pip"
diff --git a/external/poky/meta/recipes-devtools/python/python-pycryptodome.inc b/external/poky/meta/recipes-devtools/python/python-pycryptodome.inc
new file mode 100644
index 00000000..68b084eb
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/python/python-pycryptodome.inc
@@ -0,0 +1,26 @@
+SUMMARY = "Cryptographic library for Python"
+DESCRIPTION = "PyCryptodome is a self-contained Python package of low-level\
+ cryptographic primitives."
+HOMEPAGE = "http://www.pycryptodome.org"
+LICENSE = "PD & BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE.rst;md5=6dc0e2a13d2f25d6f123c434b761faba"
+
+inherit pypi
+
+RDEPENDS_${PN} += " \
+ ${PYTHON_PN}-io \
+ ${PYTHON_PN}-math \
+"
+
+RDEPENDS_${PN}-tests += " \
+ ${PYTHON_PN}-unittest \
+"
+
+PACKAGES =+ "${PN}-tests"
+
+FILES_${PN}-tests = " \
+ ${PYTHON_SITEPACKAGES_DIR}/Crypto/SelfTest/ \
+ ${PYTHON_SITEPACKAGES_DIR}/Crypto/SelfTest/__pycache__/ \
+"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/external/poky/meta/recipes-devtools/python/python-scons_3.0.1.bb b/external/poky/meta/recipes-devtools/python/python-scons_3.0.1.bb
deleted file mode 100644
index d5084b2d..00000000
--- a/external/poky/meta/recipes-devtools/python/python-scons_3.0.1.bb
+++ /dev/null
@@ -1,21 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python-setuptools.inc b/external/poky/meta/recipes-devtools/python/python-setuptools.inc
index 315ba313..29be852f 100644
--- a/external/poky/meta/recipes-devtools/python/python-setuptools.inc
+++ b/external/poky/meta/recipes-devtools/python/python-setuptools.inc
@@ -10,20 +10,23 @@ inherit pypi
SRC_URI_append_class-native = " file://0001-conditionally-do-not-fetch-code-by-easy_install.patch"
-SRC_URI[md5sum] = "260630ae1a64bafa39dcc53404d63829"
-SRC_URI[sha256sum] = "012adb8e25fbfd64c652e99e7bab58799a3aaf05d39ab38561f69190a909015f"
+SRC_URI[md5sum] = "0c956eea142af9c2b02d72e3c042af30"
+SRC_URI[sha256sum] = "89c6e6011ec2f6d57d43a3f9296c4ef022c2cbf49bab26b407fe67992ae3397f"
DEPENDS += "${PYTHON_PN}"
RDEPENDS_${PN} = "\
+ ${PYTHON_PN}-2to3 \
${PYTHON_PN}-compile \
${PYTHON_PN}-compression \
${PYTHON_PN}-ctypes \
${PYTHON_PN}-distutils \
${PYTHON_PN}-email \
${PYTHON_PN}-html \
+ ${PYTHON_PN}-json \
${PYTHON_PN}-netserver \
${PYTHON_PN}-numbers \
+ ${PYTHON_PN}-pickle \
${PYTHON_PN}-pkgutil \
${PYTHON_PN}-plistlib \
${PYTHON_PN}-shell \
@@ -37,3 +40,14 @@ do_install_prepend() {
}
BBCLASSEXTEND = "native nativesdk"
+
+# The pkg-resources module can be used by itself, without the package downloader
+# and easy_install. Ship it in a separate package so that it can be used by
+# minimal distributions.
+PACKAGES =+ "${PYTHON_PN}-pkg-resources "
+FILES_${PYTHON_PN}-pkg-resources = "${PYTHON_SITEPACKAGES_DIR}/pkg_resources/*"
+# Due to the way OE-Core implemented native recipes, the native class cannot
+# have a dependency on something that is not a recipe name. Work around that by
+# manually setting RPROVIDES.
+RDEPENDS_${PN}_append = " ${PYTHON_PN}-pkg-resources"
+RPROVIDES_append_class-native = " ${PYTHON_PN}-pkg-resources-native"
diff --git a/external/poky/meta/recipes-devtools/python/python-setuptools_40.0.0.bb b/external/poky/meta/recipes-devtools/python/python-setuptools_40.0.0.bb
deleted file mode 100644
index cf944049..00000000
--- a/external/poky/meta/recipes-devtools/python/python-setuptools_40.0.0.bb
+++ /dev/null
@@ -1,9 +0,0 @@
-require python-setuptools.inc
-
-PROVIDES = "python-distribute"
-
-inherit setuptools
-
-RREPLACES_${PN} = "python-distribute"
-RPROVIDES_${PN} = "python-distribute"
-RCONFLICTS_${PN} = "python-distribute"
diff --git a/external/poky/meta/recipes-devtools/python/python-six.inc b/external/poky/meta/recipes-devtools/python/python-six.inc
index c7749845..05b32810 100644
--- a/external/poky/meta/recipes-devtools/python/python-six.inc
+++ b/external/poky/meta/recipes-devtools/python/python-six.inc
@@ -2,10 +2,7 @@ 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"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=43cfc9e4ac0e377acfb9b76f56b8415d"
inherit pypi
diff --git a/external/poky/meta/recipes-devtools/python/python-smmap.inc b/external/poky/meta/recipes-devtools/python/python-smmap.inc
index 55aa516e..b878b4b3 100644
--- a/external/poky/meta/recipes-devtools/python/python-smmap.inc
+++ b/external/poky/meta/recipes-devtools/python/python-smmap.inc
@@ -4,15 +4,17 @@ 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"
+LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=e910b35b0ef4e1f665b9a75d6afb7709"
inherit pypi
-SRC_URI[md5sum] = "d7932d5ace206bf4ae15198cf36fb6ab"
-SRC_URI[sha256sum] = "0e2b62b497bd5f0afebc002eda4d90df9d209c30ef257e8673c90a6b5c119d62"
+PYPI_PACKAGE = "smmap2"
+
+SRC_URI[md5sum] = "1c59a985be5aa645c4c5a4e063a40dd5"
+SRC_URI[sha256sum] = "29a9ffa0497e7f2be94ca0ed1ca1aa3cd4cf25a1f6b4f5f87f74b46ed91d609a"
RDEPENDS_${PN} += "${PYTHON_PN}-codecs \
${PYTHON_PN}-mmap \
"
-BBCLASSEXTEND = "nativesdk"
+BBCLASSEXTEND = "native nativesdk"
diff --git a/external/poky/meta/recipes-devtools/python/python-testtools.inc b/external/poky/meta/recipes-devtools/python/python-testtools.inc
index 1011c98a..d0b2e46d 100644
--- a/external/poky/meta/recipes-devtools/python/python-testtools.inc
+++ b/external/poky/meta/recipes-devtools/python/python-testtools.inc
@@ -19,6 +19,7 @@ DEPENDS += " \
"
RDEPENDS_${PN} += "\
+ ${PYTHON_PN}-doctest \
${PYTHON_PN}-extras \
${PYTHON_PN}-pbr \
${PYTHON_PN}-six \
diff --git a/external/poky/meta/recipes-devtools/python/python.inc b/external/poky/meta/recipes-devtools/python/python.inc
deleted file mode 100644
index e5f1981a..00000000
--- a/external/poky/meta/recipes-devtools/python/python.inc
+++ /dev/null
@@ -1,46 +0,0 @@
-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=e466242989bd33c1bd2b6a526a742498"
-
-SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz"
-
-SRC_URI[md5sum] = "30157d85a2c0479c09ea2cbe61f2aaf5"
-SRC_URI[sha256sum] = "f222ef602647eecb6853681156d32de4450a2c39f4de93bd5b20235f2e660ed7"
-
-# 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_configure_prepend() {
- libdirleaf="$(echo ${libdir} | sed -e 's:${prefix}/::')"
- sed -i -e "s:SEDMELIBLEAF:${libdirleaf}:g" \
- ${S}/configure.ac
-}
-
-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/external/poky/meta/recipes-devtools/python/python/0001-distutils-set-the-prefix-to-be-inside-staging-direct.patch b/external/poky/meta/recipes-devtools/python/python/0001-distutils-set-the-prefix-to-be-inside-staging-direct.patch
deleted file mode 100644
index 502f8498..00000000
--- a/external/poky/meta/recipes-devtools/python/python/0001-distutils-set-the-prefix-to-be-inside-staging-direct.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch b/external/poky/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch
deleted file mode 100644
index e795a74b..00000000
--- a/external/poky/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch
+++ /dev/null
@@ -1,100 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python/03-fix-tkinter-detection.patch b/external/poky/meta/recipes-devtools/python/python/03-fix-tkinter-detection.patch
deleted file mode 100644
index 650ceb59..00000000
--- a/external/poky/meta/recipes-devtools/python/python/03-fix-tkinter-detection.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python/05-enable-ctypes-cross-build.patch b/external/poky/meta/recipes-devtools/python/python/05-enable-ctypes-cross-build.patch
deleted file mode 100644
index 5cc87424..00000000
--- a/external/poky/meta/recipes-devtools/python/python/05-enable-ctypes-cross-build.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python/06-avoid_usr_lib_termcap_path_in_linking.patch b/external/poky/meta/recipes-devtools/python/python/06-avoid_usr_lib_termcap_path_in_linking.patch
deleted file mode 100644
index 435b3190..00000000
--- a/external/poky/meta/recipes-devtools/python/python/06-avoid_usr_lib_termcap_path_in_linking.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python/add-md5module-support.patch b/external/poky/meta/recipes-devtools/python/python/add-md5module-support.patch
deleted file mode 100644
index 33fea775..00000000
--- a/external/poky/meta/recipes-devtools/python/python/add-md5module-support.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-
-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/external/poky/meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patch b/external/poky/meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patch
deleted file mode 100644
index 287095f6..00000000
--- a/external/poky/meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-_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/external/poky/meta/recipes-devtools/python/python/avoid_warning_for_sunos_specific_module.patch b/external/poky/meta/recipes-devtools/python/python/avoid_warning_for_sunos_specific_module.patch
deleted file mode 100644
index 8ba58230..00000000
--- a/external/poky/meta/recipes-devtools/python/python/avoid_warning_for_sunos_specific_module.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python/bpo-30458-cve-2019-9740.patch b/external/poky/meta/recipes-devtools/python/python/bpo-30458-cve-2019-9740.patch
deleted file mode 100644
index f4c56bb8..00000000
--- a/external/poky/meta/recipes-devtools/python/python/bpo-30458-cve-2019-9740.patch
+++ /dev/null
@@ -1,219 +0,0 @@
-From 39815ee5bb7f2f9ca1f0d5e9f51e27a2877ec35b Mon Sep 17 00:00:00 2001
-From: Victor Stinner <victor.stinner@gmail.com>
-Date: Tue, 21 May 2019 15:12:33 +0200
-Subject: [PATCH] bpo-30458: Disallow control chars in http URLs (GH-12755)
- (GH-13154) (GH-13315)
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Disallow control chars in http URLs in urllib2.urlopen. This
-addresses a potential security problem for applications that do not
-sanity check their URLs where http request headers could be injected.
-
-Disable https related urllib tests on a build without ssl (GH-13032)
-These tests require an SSL enabled build. Skip these tests when
-python is built without SSL to fix test failures.
-
-Use httplib.InvalidURL instead of ValueError as the new error case's
-exception. (GH-13044)
-
-Backport Co-Authored-By: Miro Hrončok <miro@hroncok.cz>
-
-(cherry picked from commit 7e200e0763f5b71c199aaf98bd5588f291585619)
-
-Notes on backport to Python 2.7:
-
-* test_urllib tests urllib.urlopen() which quotes the URL and so is
- not vulerable to HTTP Header Injection.
-* Add tests to test_urllib2 on urllib2.urlopen().
-* Reject non-ASCII characters: range 0x80-0xff.
-
-CVE: CVE-2019-9740 CVE-2019-9747
-Upstream-Status: Accepted
-
-Signed-off-by: Dan Tran <dantran@microsoft.com>
----
- Lib/httplib.py | 16 ++++++
- Lib/test/test_urllib.py | 25 +++++++++
- Lib/test/test_urllib2.py | 51 ++++++++++++++++++-
- Lib/test/test_xmlrpc.py | 8 ++-
- .../2019-04-10-08-53-30.bpo-30458.51E-DA.rst | 1 +
- 5 files changed, 99 insertions(+), 2 deletions(-)
- create mode 100644 Misc/NEWS.d/next/Security/2019-04-10-08-53-30.bpo-30458.51E-DA.rst
-
-diff --git a/Lib/httplib.py b/Lib/httplib.py
-index 60a8fb4e35..1b41c346e0 100644
---- a/Lib/httplib.py
-+++ b/Lib/httplib.py
-@@ -247,6 +247,16 @@ _MAXHEADERS = 100
- _is_legal_header_name = re.compile(r'\A[^:\s][^:\r\n]*\Z').match
- _is_illegal_header_value = re.compile(r'\n(?![ \t])|\r(?![ \t\n])').search
-
-+# These characters are not allowed within HTTP URL paths.
-+# See https://tools.ietf.org/html/rfc3986#section-3.3 and the
-+# https://tools.ietf.org/html/rfc3986#appendix-A pchar definition.
-+# Prevents CVE-2019-9740. Includes control characters such as \r\n.
-+# Restrict non-ASCII characters above \x7f (0x80-0xff).
-+_contains_disallowed_url_pchar_re = re.compile('[\x00-\x20\x7f-\xff]')
-+# Arguably only these _should_ allowed:
-+# _is_allowed_url_pchars_re = re.compile(r"^[/!$&'()*+,;=:@%a-zA-Z0-9._~-]+$")
-+# We are more lenient for assumed real world compatibility purposes.
-+
- # We always set the Content-Length header for these methods because some
- # servers will otherwise respond with a 411
- _METHODS_EXPECTING_BODY = {'PATCH', 'POST', 'PUT'}
-@@ -927,6 +937,12 @@ class HTTPConnection:
- self._method = method
- if not url:
- url = '/'
-+ # Prevent CVE-2019-9740.
-+ match = _contains_disallowed_url_pchar_re.search(url)
-+ if match:
-+ raise InvalidURL("URL can't contain control characters. %r "
-+ "(found at least %r)"
-+ % (url, match.group()))
- hdr = '%s %s %s' % (method, url, self._http_vsn_str)
-
- self._output(hdr)
-diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py
-index 1ce9201c06..d7778d4194 100644
---- a/Lib/test/test_urllib.py
-+++ b/Lib/test/test_urllib.py
-@@ -257,6 +257,31 @@ class urlopen_HttpTests(unittest.TestCase, FakeHTTPMixin):
- finally:
- self.unfakehttp()
-
-+ def test_url_with_control_char_rejected(self):
-+ for char_no in range(0, 0x21) + range(0x7f, 0x100):
-+ char = chr(char_no)
-+ schemeless_url = "//localhost:7777/test%s/" % char
-+ self.fakehttp(b"HTTP/1.1 200 OK\r\n\r\nHello.")
-+ try:
-+ # urllib quotes the URL so there is no injection.
-+ resp = urllib.urlopen("http:" + schemeless_url)
-+ self.assertNotIn(char, resp.geturl())
-+ finally:
-+ self.unfakehttp()
-+
-+ def test_url_with_newline_header_injection_rejected(self):
-+ self.fakehttp(b"HTTP/1.1 200 OK\r\n\r\nHello.")
-+ host = "localhost:7777?a=1 HTTP/1.1\r\nX-injected: header\r\nTEST: 123"
-+ schemeless_url = "//" + host + ":8080/test/?test=a"
-+ try:
-+ # urllib quotes the URL so there is no injection.
-+ resp = urllib.urlopen("http:" + schemeless_url)
-+ self.assertNotIn(' ', resp.geturl())
-+ self.assertNotIn('\r', resp.geturl())
-+ self.assertNotIn('\n', resp.geturl())
-+ finally:
-+ self.unfakehttp()
-+
- def test_read_bogus(self):
- # urlopen() should raise IOError for many error codes.
- self.fakehttp('''HTTP/1.1 401 Authentication Required
-diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py
-index 6d24d5ddf8..9531818e16 100644
---- a/Lib/test/test_urllib2.py
-+++ b/Lib/test/test_urllib2.py
-@@ -15,6 +15,9 @@ try:
- except ImportError:
- ssl = None
-
-+from test.test_urllib import FakeHTTPMixin
-+
-+
- # XXX
- # Request
- # CacheFTPHandler (hard to write)
-@@ -1262,7 +1265,7 @@ class HandlerTests(unittest.TestCase):
- self.assertEqual(len(http_handler.requests), 1)
- self.assertFalse(http_handler.requests[0].has_header(auth_header))
-
--class MiscTests(unittest.TestCase):
-+class MiscTests(unittest.TestCase, FakeHTTPMixin):
-
- def test_build_opener(self):
- class MyHTTPHandler(urllib2.HTTPHandler): pass
-@@ -1317,6 +1320,52 @@ class MiscTests(unittest.TestCase):
- "Unsupported digest authentication algorithm 'invalid'"
- )
-
-+ @unittest.skipUnless(ssl, "ssl module required")
-+ def test_url_with_control_char_rejected(self):
-+ for char_no in range(0, 0x21) + range(0x7f, 0x100):
-+ char = chr(char_no)
-+ schemeless_url = "//localhost:7777/test%s/" % char
-+ self.fakehttp(b"HTTP/1.1 200 OK\r\n\r\nHello.")
-+ try:
-+ # We explicitly test urllib.request.urlopen() instead of the top
-+ # level 'def urlopen()' function defined in this... (quite ugly)
-+ # test suite. They use different url opening codepaths. Plain
-+ # urlopen uses FancyURLOpener which goes via a codepath that
-+ # calls urllib.parse.quote() on the URL which makes all of the
-+ # above attempts at injection within the url _path_ safe.
-+ escaped_char_repr = repr(char).replace('\\', r'\\')
-+ InvalidURL = httplib.InvalidURL
-+ with self.assertRaisesRegexp(
-+ InvalidURL, "contain control.*" + escaped_char_repr):
-+ urllib2.urlopen("http:" + schemeless_url)
-+ with self.assertRaisesRegexp(
-+ InvalidURL, "contain control.*" + escaped_char_repr):
-+ urllib2.urlopen("https:" + schemeless_url)
-+ finally:
-+ self.unfakehttp()
-+
-+ @unittest.skipUnless(ssl, "ssl module required")
-+ def test_url_with_newline_header_injection_rejected(self):
-+ self.fakehttp(b"HTTP/1.1 200 OK\r\n\r\nHello.")
-+ host = "localhost:7777?a=1 HTTP/1.1\r\nX-injected: header\r\nTEST: 123"
-+ schemeless_url = "//" + host + ":8080/test/?test=a"
-+ try:
-+ # We explicitly test urllib2.urlopen() instead of the top
-+ # level 'def urlopen()' function defined in this... (quite ugly)
-+ # test suite. They use different url opening codepaths. Plain
-+ # urlopen uses FancyURLOpener which goes via a codepath that
-+ # calls urllib.parse.quote() on the URL which makes all of the
-+ # above attempts at injection within the url _path_ safe.
-+ InvalidURL = httplib.InvalidURL
-+ with self.assertRaisesRegexp(
-+ InvalidURL, r"contain control.*\\r.*(found at least . .)"):
-+ urllib2.urlopen("http:" + schemeless_url)
-+ with self.assertRaisesRegexp(InvalidURL, r"contain control.*\\n"):
-+ urllib2.urlopen("https:" + schemeless_url)
-+ finally:
-+ self.unfakehttp()
-+
-+
-
- class RequestTests(unittest.TestCase):
-
-diff --git a/Lib/test/test_xmlrpc.py b/Lib/test/test_xmlrpc.py
-index 36b3be67fd..90ccb30716 100644
---- a/Lib/test/test_xmlrpc.py
-+++ b/Lib/test/test_xmlrpc.py
-@@ -659,7 +659,13 @@ class SimpleServerTestCase(BaseServerTestCase):
- def test_partial_post(self):
- # Check that a partial POST doesn't make the server loop: issue #14001.
- conn = httplib.HTTPConnection(ADDR, PORT)
-- conn.request('POST', '/RPC2 HTTP/1.0\r\nContent-Length: 100\r\n\r\nbye')
-+ conn.send('POST /RPC2 HTTP/1.0\r\n'
-+ 'Content-Length: 100\r\n\r\n'
-+ 'bye HTTP/1.1\r\n'
-+ 'Host: %s:%s\r\n'
-+ 'Accept-Encoding: identity\r\n'
-+ 'Content-Length: 0\r\n\r\n'
-+ % (ADDR, PORT))
- conn.close()
-
- class SimpleServerEncodingTestCase(BaseServerTestCase):
-diff --git a/Misc/NEWS.d/next/Security/2019-04-10-08-53-30.bpo-30458.51E-DA.rst b/Misc/NEWS.d/next/Security/2019-04-10-08-53-30.bpo-30458.51E-DA.rst
-new file mode 100644
-index 0000000000..47cb899df1
---- /dev/null
-+++ b/Misc/NEWS.d/next/Security/2019-04-10-08-53-30.bpo-30458.51E-DA.rst
-@@ -0,0 +1 @@
-+Address CVE-2019-9740 by disallowing URL paths with embedded whitespace or control characters through into the underlying http client request. Such potentially malicious header injection URLs now cause an httplib.InvalidURL exception to be raised.
---
-2.22.0.vfs.1.1.57.gbaf16c8
-
diff --git a/external/poky/meta/recipes-devtools/python/python/bpo-35121-cve-2018-20852.patch b/external/poky/meta/recipes-devtools/python/python/bpo-35121-cve-2018-20852.patch
deleted file mode 100644
index 7ce7b1f9..00000000
--- a/external/poky/meta/recipes-devtools/python/python/bpo-35121-cve-2018-20852.patch
+++ /dev/null
@@ -1,127 +0,0 @@
-From 1bd50d351e508b8947e5813c5f925eb4b61c8d76 Mon Sep 17 00:00:00 2001
-From: Xtreak <tir.karthi@gmail.com>
-Date: Sat, 15 Jun 2019 20:59:43 +0530
-Subject: [PATCH] [2.7] bpo-35121: prefix dot in domain for proper subdomain
- validation (GH-10258) (GH-13426)
-
-This is a manual backport of ca7fe5063593958e5efdf90f068582837f07bd14 since 2.7 has `http.cookiejar` in `cookielib`
-
-https://bugs.python.org/issue35121
-
-CVE: CVE-2018-20852
-Upstream-Status: Accepted
-
-Signed-off-by: Dan Tran <dantran@microsoft.com>
----
- Lib/cookielib.py | 13 ++++++--
- Lib/test/test_cookielib.py | 30 +++++++++++++++++++
- .../2019-05-20-00-35-12.bpo-35121.RRi-HU.rst | 4 +++
- 3 files changed, 45 insertions(+), 2 deletions(-)
- create mode 100644 Misc/NEWS.d/next/Security/2019-05-20-00-35-12.bpo-35121.RRi-HU.rst
-
-diff --git a/Lib/cookielib.py b/Lib/cookielib.py
-index 2dd7c48728..0b471a42f2 100644
---- a/Lib/cookielib.py
-+++ b/Lib/cookielib.py
-@@ -1139,6 +1139,11 @@ class DefaultCookiePolicy(CookiePolicy):
- req_host, erhn = eff_request_host(request)
- domain = cookie.domain
-
-+ if domain and not domain.startswith("."):
-+ dotdomain = "." + domain
-+ else:
-+ dotdomain = domain
-+
- # strict check of non-domain cookies: Mozilla does this, MSIE5 doesn't
- if (cookie.version == 0 and
- (self.strict_ns_domain & self.DomainStrictNonDomain) and
-@@ -1151,7 +1156,7 @@ class DefaultCookiePolicy(CookiePolicy):
- _debug(" effective request-host name %s does not domain-match "
- "RFC 2965 cookie domain %s", erhn, domain)
- return False
-- if cookie.version == 0 and not ("."+erhn).endswith(domain):
-+ if cookie.version == 0 and not ("."+erhn).endswith(dotdomain):
- _debug(" request-host %s does not match Netscape cookie domain "
- "%s", req_host, domain)
- return False
-@@ -1165,7 +1170,11 @@ class DefaultCookiePolicy(CookiePolicy):
- req_host = "."+req_host
- if not erhn.startswith("."):
- erhn = "."+erhn
-- if not (req_host.endswith(domain) or erhn.endswith(domain)):
-+ if domain and not domain.startswith("."):
-+ dotdomain = "." + domain
-+ else:
-+ dotdomain = domain
-+ if not (req_host.endswith(dotdomain) or erhn.endswith(dotdomain)):
- #_debug(" request domain %s does not match cookie domain %s",
- # req_host, domain)
- return False
-diff --git a/Lib/test/test_cookielib.py b/Lib/test/test_cookielib.py
-index f2dd9727d1..7f7ff614d6 100644
---- a/Lib/test/test_cookielib.py
-+++ b/Lib/test/test_cookielib.py
-@@ -368,6 +368,7 @@ class CookieTests(TestCase):
- ("http://foo.bar.com/", ".foo.bar.com", True),
- ("http://foo.bar.com/", "foo.bar.com", True),
- ("http://foo.bar.com/", ".bar.com", True),
-+ ("http://foo.bar.com/", "bar.com", True),
- ("http://foo.bar.com/", "com", True),
- ("http://foo.com/", "rhubarb.foo.com", False),
- ("http://foo.com/", ".foo.com", True),
-@@ -378,6 +379,8 @@ class CookieTests(TestCase):
- ("http://foo/", "foo", True),
- ("http://foo/", "foo.local", True),
- ("http://foo/", ".local", True),
-+ ("http://barfoo.com", ".foo.com", False),
-+ ("http://barfoo.com", "foo.com", False),
- ]:
- request = urllib2.Request(url)
- r = pol.domain_return_ok(domain, request)
-@@ -938,6 +941,33 @@ class CookieTests(TestCase):
- c.add_cookie_header(req)
- self.assertFalse(req.has_header("Cookie"))
-
-+ c.clear()
-+
-+ pol.set_blocked_domains([])
-+ req = Request("http://acme.com/")
-+ res = FakeResponse(headers, "http://acme.com/")
-+ cookies = c.make_cookies(res, req)
-+ c.extract_cookies(res, req)
-+ self.assertEqual(len(c), 1)
-+
-+ req = Request("http://acme.com/")
-+ c.add_cookie_header(req)
-+ self.assertTrue(req.has_header("Cookie"))
-+
-+ req = Request("http://badacme.com/")
-+ c.add_cookie_header(req)
-+ self.assertFalse(pol.return_ok(cookies[0], req))
-+ self.assertFalse(req.has_header("Cookie"))
-+
-+ p = pol.set_blocked_domains(["acme.com"])
-+ req = Request("http://acme.com/")
-+ c.add_cookie_header(req)
-+ self.assertFalse(req.has_header("Cookie"))
-+
-+ req = Request("http://badacme.com/")
-+ c.add_cookie_header(req)
-+ self.assertFalse(req.has_header("Cookie"))
-+
- def test_secure(self):
- from cookielib import CookieJar, DefaultCookiePolicy
-
-diff --git a/Misc/NEWS.d/next/Security/2019-05-20-00-35-12.bpo-35121.RRi-HU.rst b/Misc/NEWS.d/next/Security/2019-05-20-00-35-12.bpo-35121.RRi-HU.rst
-new file mode 100644
-index 0000000000..7725180616
---- /dev/null
-+++ b/Misc/NEWS.d/next/Security/2019-05-20-00-35-12.bpo-35121.RRi-HU.rst
-@@ -0,0 +1,4 @@
-+Don't send cookies of domain A without Domain attribute to domain B when
-+domain A is a suffix match of domain B while using a cookiejar with
-+:class:`cookielib.DefaultCookiePolicy` policy. Patch by Karthikeyan
-+Singaravelan.
---
-2.22.0.vfs.1.1.57.gbaf16c8
-
diff --git a/external/poky/meta/recipes-devtools/python/python/bpo-35907-cve-2019-9948-fix.patch b/external/poky/meta/recipes-devtools/python/python/bpo-35907-cve-2019-9948-fix.patch
deleted file mode 100644
index b2672370..00000000
--- a/external/poky/meta/recipes-devtools/python/python/bpo-35907-cve-2019-9948-fix.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 179a5f75f1121dab271fe8f90eb35145f9dcbbda Mon Sep 17 00:00:00 2001
-From: Sihoon Lee <push0ebp@gmail.com>
-Date: Fri, 17 May 2019 02:41:06 +0900
-Subject: [PATCH] Update test_urllib.py and urllib.py\nchange assertEqual into
- assertRasies in DummyURLopener test, and simplify mitigation
-
-Upstream-Status: Submitted https://github.com/python/cpython/pull/11842
-
-CVE: CVE-2019-9948
-
-Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
----
- Lib/test/test_urllib.py | 11 +++--------
- Lib/urllib.py | 4 ++--
- 2 files changed, 5 insertions(+), 10 deletions(-)
-
-diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py
-index e5f210e62a18..1e23dfb0bb16 100644
---- a/Lib/test/test_urllib.py
-+++ b/Lib/test/test_urllib.py
-@@ -1027,14 +1027,9 @@ def test_local_file_open(self):
- class DummyURLopener(urllib.URLopener):
- def open_local_file(self, url):
- return url
-- self.assertEqual(DummyURLopener().open(
-- 'local-file://example'), '//example')
-- self.assertEqual(DummyURLopener().open(
-- 'local_file://example'), '//example')
-- self.assertRaises(IOError, urllib.urlopen,
-- 'local-file://example')
-- self.assertRaises(IOError, urllib.urlopen,
-- 'local_file://example')
-+ for url in ('local_file://example', 'local-file://example'):
-+ self.assertRaises(IOError, DummyURLopener().open, url)
-+ self.assertRaises(IOError, urllib.urlopen, url)
-
- # Just commented them out.
- # Can't really tell why keep failing in windows and sparc.
-diff --git a/Lib/urllib.py b/Lib/urllib.py
-index a24e9a5c68fb..39b834054e9e 100644
---- a/Lib/urllib.py
-+++ b/Lib/urllib.py
-@@ -203,10 +203,10 @@ def open(self, fullurl, data=None):
- name = 'open_' + urltype
- self.type = urltype
- name = name.replace('-', '_')
--
-+
- # bpo-35907: # disallow the file reading with the type not allowed
- if not hasattr(self, name) or \
-- (self == _urlopener and name == 'open_local_file'):
-+ getattr(self, name) == self.open_local_file:
- if proxy:
- return self.open_unknown_proxy(proxy, fullurl, data)
- else:
diff --git a/external/poky/meta/recipes-devtools/python/python/bpo-35907-cve-2019-9948.patch b/external/poky/meta/recipes-devtools/python/python/bpo-35907-cve-2019-9948.patch
deleted file mode 100644
index f4c225d2..00000000
--- a/external/poky/meta/recipes-devtools/python/python/bpo-35907-cve-2019-9948.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 8f99cc799e4393bf1112b9395b2342f81b3f45ef Mon Sep 17 00:00:00 2001
-From: push0ebp <push0ebp@shl-MacBook-Pro.local>
-Date: Thu, 14 Feb 2019 02:05:46 +0900
-Subject: [PATCH] bpo-35907: Avoid file reading as disallowing the unnecessary
- URL scheme in urllib
-
-Upstream-Status: Submitted https://github.com/python/cpython/pull/11842
-
-CVE: CVE-2019-9948
-
-Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
----
- Lib/test/test_urllib.py | 12 ++++++++++++
- Lib/urllib.py | 5 ++++-
- 2 files changed, 16 insertions(+), 1 deletion(-)
-
-diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py
-index 1ce9201c0693..e5f210e62a18 100644
---- a/Lib/test/test_urllib.py
-+++ b/Lib/test/test_urllib.py
-@@ -1023,6 +1023,18 @@ def open_spam(self, url):
- "spam://c:|windows%/:=&?~#+!$,;'@()*[]|/path/"),
- "//c:|windows%/:=&?~#+!$,;'@()*[]|/path/")
-
-+ def test_local_file_open(self):
-+ class DummyURLopener(urllib.URLopener):
-+ def open_local_file(self, url):
-+ return url
-+ self.assertEqual(DummyURLopener().open(
-+ 'local-file://example'), '//example')
-+ self.assertEqual(DummyURLopener().open(
-+ 'local_file://example'), '//example')
-+ self.assertRaises(IOError, urllib.urlopen,
-+ 'local-file://example')
-+ self.assertRaises(IOError, urllib.urlopen,
-+ 'local_file://example')
-
- # Just commented them out.
- # Can't really tell why keep failing in windows and sparc.
-diff --git a/Lib/urllib.py b/Lib/urllib.py
-index d85504a5cb7e..a24e9a5c68fb 100644
---- a/Lib/urllib.py
-+++ b/Lib/urllib.py
-@@ -203,7 +203,10 @@ def open(self, fullurl, data=None):
- name = 'open_' + urltype
- self.type = urltype
- name = name.replace('-', '_')
-- if not hasattr(self, name):
-+
-+ # bpo-35907: # disallow the file reading with the type not allowed
-+ if not hasattr(self, name) or \
-+ (self == _urlopener and name == 'open_local_file'):
- if proxy:
- return self.open_unknown_proxy(proxy, fullurl, data)
- else:
diff --git a/external/poky/meta/recipes-devtools/python/python/bpo-36216-cve-2019-9636-fix.patch b/external/poky/meta/recipes-devtools/python/python/bpo-36216-cve-2019-9636-fix.patch
deleted file mode 100644
index 2ce4d2cd..00000000
--- a/external/poky/meta/recipes-devtools/python/python/bpo-36216-cve-2019-9636-fix.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 06b5ee585d6e76bdbb4002f642d864d860cbbd2b Mon Sep 17 00:00:00 2001
-From: Steve Dower <steve.dower@python.org>
-Date: Tue, 12 Mar 2019 08:23:33 -0700
-Subject: [PATCH] bpo-36216: Only print test messages when verbose
-
-CVE: CVE-2019-9636
-
-Upstream-Status: Backport https://github.com/python/cpython/pull/12291/commits/06b5ee585d6e76bdbb4002f642d864d860cbbd2b
-
-Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
----
- Lib/test/test_urlparse.py | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py
-index 73b0228ea8e3..1830d0b28688 100644
---- a/Lib/test/test_urlparse.py
-+++ b/Lib/test/test_urlparse.py
-@@ -644,7 +644,8 @@ def test_urlsplit_normalization(self):
- for scheme in [u"http", u"https", u"ftp"]:
- for c in denorm_chars:
- url = u"{}://netloc{}false.netloc/path".format(scheme, c)
-- print "Checking %r" % url
-+ if test_support.verbose:
-+ print "Checking %r" % url
- with self.assertRaises(ValueError):
- urlparse.urlsplit(url)
-
diff --git a/external/poky/meta/recipes-devtools/python/python/bpo-36216-cve-2019-9636.patch b/external/poky/meta/recipes-devtools/python/python/bpo-36216-cve-2019-9636.patch
deleted file mode 100644
index 352b13ba..00000000
--- a/external/poky/meta/recipes-devtools/python/python/bpo-36216-cve-2019-9636.patch
+++ /dev/null
@@ -1,111 +0,0 @@
-From 3e3669c9c41a27e1466e2c28b3906e3dd0ce3e7e Mon Sep 17 00:00:00 2001
-From: Steve Dower <steve.dower@python.org>
-Date: Thu, 7 Mar 2019 08:25:22 -0800
-Subject: [PATCH] bpo-36216: Add check for characters in netloc that normalize
- to separators (GH-12201)
-
-CVE: CVE-2019-9636
-
-Upstream-Status: Backport https://github.com/python/cpython/pull/12216/commits/3e3669c9c41a27e1466e2c28b3906e3dd0ce3e7e
-
-Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
----
- Doc/library/urlparse.rst | 20 ++++++++++++++++
- Lib/test/test_urlparse.py | 24 +++++++++++++++++++
- Lib/urlparse.py | 17 +++++++++++++
- .../2019-03-06-09-38-40.bpo-36216.6q1m4a.rst | 3 +++
- 4 files changed, 64 insertions(+)
- create mode 100644 Misc/NEWS.d/next/Security/2019-03-06-09-38-40.bpo-36216.6q1m4a.rst
-
-diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py
-index 4e1ded73c266..73b0228ea8e3 100644
---- a/Lib/test/test_urlparse.py
-+++ b/Lib/test/test_urlparse.py
-@@ -1,4 +1,6 @@
- from test import test_support
-+import sys
-+import unicodedata
- import unittest
- import urlparse
-
-@@ -624,6 +626,28 @@ def test_portseparator(self):
- self.assertEqual(urlparse.urlparse("http://www.python.org:80"),
- ('http','www.python.org:80','','','',''))
-
-+ def test_urlsplit_normalization(self):
-+ # Certain characters should never occur in the netloc,
-+ # including under normalization.
-+ # Ensure that ALL of them are detected and cause an error
-+ illegal_chars = u'/:#?@'
-+ hex_chars = {'{:04X}'.format(ord(c)) for c in illegal_chars}
-+ denorm_chars = [
-+ c for c in map(unichr, range(128, sys.maxunicode))
-+ if (hex_chars & set(unicodedata.decomposition(c).split()))
-+ and c not in illegal_chars
-+ ]
-+ # Sanity check that we found at least one such character
-+ self.assertIn(u'\u2100', denorm_chars)
-+ self.assertIn(u'\uFF03', denorm_chars)
-+
-+ for scheme in [u"http", u"https", u"ftp"]:
-+ for c in denorm_chars:
-+ url = u"{}://netloc{}false.netloc/path".format(scheme, c)
-+ print "Checking %r" % url
-+ with self.assertRaises(ValueError):
-+ urlparse.urlsplit(url)
-+
- def test_main():
- test_support.run_unittest(UrlParseTestCase)
-
-diff --git a/Lib/urlparse.py b/Lib/urlparse.py
-index f7c2b032b097..54eda08651ab 100644
---- a/Lib/urlparse.py
-+++ b/Lib/urlparse.py
-@@ -165,6 +165,21 @@ def _splitnetloc(url, start=0):
- delim = min(delim, wdelim) # use earliest delim position
- return url[start:delim], url[delim:] # return (domain, rest)
-
-+def _checknetloc(netloc):
-+ if not netloc or not isinstance(netloc, unicode):
-+ return
-+ # looking for characters like \u2100 that expand to 'a/c'
-+ # IDNA uses NFKC equivalence, so normalize for this check
-+ import unicodedata
-+ netloc2 = unicodedata.normalize('NFKC', netloc)
-+ if netloc == netloc2:
-+ return
-+ _, _, netloc = netloc.rpartition('@') # anything to the left of '@' is okay
-+ for c in '/?#@:':
-+ if c in netloc2:
-+ raise ValueError("netloc '" + netloc2 + "' contains invalid " +
-+ "characters under NFKC normalization")
-+
- def urlsplit(url, scheme='', allow_fragments=True):
- """Parse a URL into 5 components:
- <scheme>://<netloc>/<path>?<query>#<fragment>
-@@ -193,6 +208,7 @@ def urlsplit(url, scheme='', allow_fragments=True):
- url, fragment = url.split('#', 1)
- if '?' in url:
- url, query = url.split('?', 1)
-+ _checknetloc(netloc)
- v = SplitResult(scheme, netloc, url, query, fragment)
- _parse_cache[key] = v
- return v
-@@ -216,6 +232,7 @@ def urlsplit(url, scheme='', allow_fragments=True):
- url, fragment = url.split('#', 1)
- if '?' in url:
- url, query = url.split('?', 1)
-+ _checknetloc(netloc)
- v = SplitResult(scheme, netloc, url, query, fragment)
- _parse_cache[key] = v
- return v
-diff --git a/Misc/NEWS.d/next/Security/2019-03-06-09-38-40.bpo-36216.6q1m4a.rst b/Misc/NEWS.d/next/Security/2019-03-06-09-38-40.bpo-36216.6q1m4a.rst
-new file mode 100644
-index 000000000000..1e1ad92c6feb
---- /dev/null
-+++ b/Misc/NEWS.d/next/Security/2019-03-06-09-38-40.bpo-36216.6q1m4a.rst
-@@ -0,0 +1,3 @@
-+Changes urlsplit() to raise ValueError when the URL contains characters that
-+decompose under IDNA encoding (NFKC-normalization) into characters that
-+affect how the URL is parsed.
-\ No newline at end of file
diff --git a/external/poky/meta/recipes-devtools/python/python/builddir.patch b/external/poky/meta/recipes-devtools/python/python/builddir.patch
deleted file mode 100644
index ad629a02..00000000
--- a/external/poky/meta/recipes-devtools/python/python/builddir.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python/cgi_py.patch b/external/poky/meta/recipes-devtools/python/python/cgi_py.patch
deleted file mode 100644
index de504f9d..00000000
--- a/external/poky/meta/recipes-devtools/python/python/cgi_py.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch b/external/poky/meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch
deleted file mode 100644
index e6d6c65b..00000000
--- a/external/poky/meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python/create_manifest2.py b/external/poky/meta/recipes-devtools/python/python/create_manifest2.py
deleted file mode 100644
index b6748653..00000000
--- a/external/poky/meta/recipes-devtools/python/python/create_manifest2.py
+++ /dev/null
@@ -1,292 +0,0 @@
-# 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, on 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 at gmail dot com>
-
-
-import sys
-import subprocess
-import json
-import os
-import collections
-
-# 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 = collections.OrderedDict()
-
-# 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 prepend_comments(comments, json_manifest):
- with open(json_manifest, 'r+') as manifest:
- json_contents = manifest.read()
- manifest.seek(0, 0)
- manifest.write(comments + json_contents)
-
-# Read existing JSON manifest
-with open('python2-manifest.json') as manifest:
- # The JSON format doesn't allow comments so we hack the call to keep the comments using a marker
- manifest_str = manifest.read()
- json_start = manifest_str.find('# EOC') + 6 # EOC + \n
- manifest.seek(0)
- comments = manifest.read(json_start)
- manifest_str = manifest.read()
- old_manifest = json.loads(manifest_str, object_pairs_hook=collections.OrderedDict)
-
-# 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] = collections.OrderedDict()
- new_manifest[key]['summary'] = old_manifest[key]['summary']
- new_manifest[key]['rdepends']=[]
- new_manifest[key]['files'] = []
-
- # All packages should depend on core
- if key != 'core':
- new_manifest[key]['rdepends'].append('core')
-
- # 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', 'tests', '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, indent=4)
-
-prepend_comments(comments,'python2-manifest.json.new')
diff --git a/external/poky/meta/recipes-devtools/python/python/fix_for_using_different_libdir.patch b/external/poky/meta/recipes-devtools/python/python/fix_for_using_different_libdir.patch
deleted file mode 100644
index 5f730936..00000000
--- a/external/poky/meta/recipes-devtools/python/python/fix_for_using_different_libdir.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python/float-endian.patch b/external/poky/meta/recipes-devtools/python/python/float-endian.patch
deleted file mode 100644
index 8a5c90ae..00000000
--- a/external/poky/meta/recipes-devtools/python/python/float-endian.patch
+++ /dev/null
@@ -1,216 +0,0 @@
-Python uses AC_RUN_IFELSE to determine the byte order for floats and doubles,
-and falls back onto "I don't know" if it can't run code. This results in
-crippled floating point numbers in Python, and the regression tests fail.
-
-Instead of running code, take a macro from autoconf-archive which compiles C
-with a special double in which has an ASCII representation, and then greps the
-binary to identify the format.
-
-Upstream-Status: Backport
-Signed-off-by: Ross Burton <ross.burton@intel.com>
-
-From 253f47b28120c42cfe53a4e2f5ed0ab0ed469deb Mon Sep 17 00:00:00 2001
-From: Ross Burton <ross@burtonini.com>
-Date: Wed, 19 Sep 2018 07:25:48 +0100
-Subject: [PATCH] closes bpo-34585: Don't do runtime test to get float byte
- order. (GH-9085)
-
-Currently configure.ac uses AC_RUN_IFELSE to determine the byte order of doubles, but this silently fails under cross compilation and Python doesn't do floats properly.
-
-Instead, steal a macro from autoconf-archive which compiles code using magic doubles (which encode to ASCII) and grep for the representation in the binary.
-
-RFC because this doesn't yet handle the weird ancient ARMv4 OABI 'mixed-endian' encoding properly. This encoding is ancient and I don't believe the union of "Python 3.8 users" and "OABI users" has anything in. Should the support for this just be dropped too? Alternatively, someone will need to find an OABI toolchain to verify the encoding of the magic double.
-
-Signed-off-by: Ross Burton <ross.burton@intel.com>
----
- .../Build/2018-09-18-16-28-31.bpo-34585.CGMu0h.rst | 3 +
- configure.ac | 76 ++++----------------
- m4/ax_c_float_words_bigendian.m4 | 83 ++++++++++++++++++++++
- 3 files changed, 99 insertions(+), 63 deletions(-)
- create mode 100644 Misc/NEWS.d/next/Build/2018-09-18-16-28-31.bpo-34585.CGMu0h.rst
- create mode 100644 m4/ax_c_float_words_bigendian.m4
-
-diff --git a/configure.ac b/configure.ac
-index 913d5469d0..7672735396 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -3835,74 +3835,24 @@ fi],
- # * Check for various properties of floating point *
- # **************************************************
-
--AC_MSG_CHECKING(whether C doubles are little-endian IEEE 754 binary64)
--AC_CACHE_VAL(ac_cv_little_endian_double, [
--AC_RUN_IFELSE([AC_LANG_SOURCE([[
--#include <string.h>
--int main() {
-- double x = 9006104071832581.0;
-- if (memcmp(&x, "\x05\x04\x03\x02\x01\xff\x3f\x43", 8) == 0)
-- return 0;
-- else
-- return 1;
--}
--]])],
--[ac_cv_little_endian_double=yes],
--[ac_cv_little_endian_double=no],
--[ac_cv_little_endian_double=no])])
--AC_MSG_RESULT($ac_cv_little_endian_double)
--if test "$ac_cv_little_endian_double" = yes
--then
-- AC_DEFINE(DOUBLE_IS_LITTLE_ENDIAN_IEEE754, 1,
-- [Define if C doubles are 64-bit IEEE 754 binary format, stored
-- with the least significant byte first])
--fi
--
--AC_MSG_CHECKING(whether C doubles are big-endian IEEE 754 binary64)
--AC_CACHE_VAL(ac_cv_big_endian_double, [
--AC_RUN_IFELSE([AC_LANG_SOURCE([[
--#include <string.h>
--int main() {
-- double x = 9006104071832581.0;
-- if (memcmp(&x, "\x43\x3f\xff\x01\x02\x03\x04\x05", 8) == 0)
-- return 0;
-- else
-- return 1;
--}
--]])],
--[ac_cv_big_endian_double=yes],
--[ac_cv_big_endian_double=no],
--[ac_cv_big_endian_double=no])])
--AC_MSG_RESULT($ac_cv_big_endian_double)
--if test "$ac_cv_big_endian_double" = yes
-+AX_C_FLOAT_WORDS_BIGENDIAN
-+if test "$ax_cv_c_float_words_bigendian" = "yes"
- then
- AC_DEFINE(DOUBLE_IS_BIG_ENDIAN_IEEE754, 1,
- [Define if C doubles are 64-bit IEEE 754 binary format, stored
- with the most significant byte first])
--fi
--
--# Some ARM platforms use a mixed-endian representation for doubles.
--# While Python doesn't currently have full support for these platforms
--# (see e.g., issue 1762561), we can at least make sure that float <-> string
--# conversions work.
--AC_MSG_CHECKING(whether C doubles are ARM mixed-endian IEEE 754 binary64)
--AC_CACHE_VAL(ac_cv_mixed_endian_double, [
--AC_RUN_IFELSE([AC_LANG_SOURCE([[
--#include <string.h>
--int main() {
-- double x = 9006104071832581.0;
-- if (memcmp(&x, "\x01\xff\x3f\x43\x05\x04\x03\x02", 8) == 0)
-- return 0;
-- else
-- return 1;
--}
--]])],
--[ac_cv_mixed_endian_double=yes],
--[ac_cv_mixed_endian_double=no],
--[ac_cv_mixed_endian_double=no])])
--AC_MSG_RESULT($ac_cv_mixed_endian_double)
--if test "$ac_cv_mixed_endian_double" = yes
-+elif test "$ax_cv_c_float_words_bigendian" = "no"
- then
-+ AC_DEFINE(DOUBLE_IS_LITTLE_ENDIAN_IEEE754, 1,
-+ [Define if C doubles are 64-bit IEEE 754 binary format, stored
-+ with the least significant byte first])
-+else
-+ # Some ARM platforms use a mixed-endian representation for doubles.
-+ # While Python doesn't currently have full support for these platforms
-+ # (see e.g., issue 1762561), we can at least make sure that float <-> string
-+ # conversions work.
-+ # FLOAT_WORDS_BIGENDIAN doesnt actually detect this case, but if it's not big
-+ # or little, then it must be this?
- AC_DEFINE(DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754, 1,
- [Define if C doubles are 64-bit IEEE 754 binary format, stored
- in ARM mixed-endian order (byte order 45670123)])
-diff --git a/m4/ax_c_float_words_bigendian.m4 b/m4/ax_c_float_words_bigendian.m4
-new file mode 100644
-index 0000000000..216b90d803
---- /dev/null
-+++ b/m4/ax_c_float_words_bigendian.m4
-@@ -0,0 +1,83 @@
-+# ===============================================================================
-+# https://www.gnu.org/software/autoconf-archive/ax_c_float_words_bigendian.html
-+# ===============================================================================
-+#
-+# SYNOPSIS
-+#
-+# AX_C_FLOAT_WORDS_BIGENDIAN([ACTION-IF-TRUE], [ACTION-IF-FALSE], [ACTION-IF-UNKNOWN])
-+#
-+# DESCRIPTION
-+#
-+# Checks the ordering of words within a multi-word float. This check is
-+# necessary because on some systems (e.g. certain ARM systems), the float
-+# word ordering can be different from the byte ordering. In a multi-word
-+# float context, "big-endian" implies that the word containing the sign
-+# bit is found in the memory location with the lowest address. This
-+# implementation was inspired by the AC_C_BIGENDIAN macro in autoconf.
-+#
-+# The endianness is detected by first compiling C code that contains a
-+# special double float value, then grepping the resulting object file for
-+# certain strings of ASCII values. The double is specially crafted to have
-+# a binary representation that corresponds with a simple string. In this
-+# implementation, the string "noonsees" was selected because the
-+# individual word values ("noon" and "sees") are palindromes, thus making
-+# this test byte-order agnostic. If grep finds the string "noonsees" in
-+# the object file, the target platform stores float words in big-endian
-+# order. If grep finds "seesnoon", float words are in little-endian order.
-+# If neither value is found, the user is instructed to specify the
-+# ordering.
-+#
-+# LICENSE
-+#
-+# Copyright (c) 2008 Daniel Amelang <dan@amelang.net>
-+#
-+# Copying and distribution of this file, with or without modification, are
-+# permitted in any medium without royalty provided the copyright notice
-+# and this notice are preserved. This file is offered as-is, without any
-+# warranty.
-+
-+#serial 11
-+
-+AC_DEFUN([AX_C_FLOAT_WORDS_BIGENDIAN],
-+ [AC_CACHE_CHECK(whether float word ordering is bigendian,
-+ ax_cv_c_float_words_bigendian, [
-+
-+ax_cv_c_float_words_bigendian=unknown
-+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
-+
-+double d = 90904234967036810337470478905505011476211692735615632014797120844053488865816695273723469097858056257517020191247487429516932130503560650002327564517570778480236724525140520121371739201496540132640109977779420565776568942592.0;
-+
-+]])], [
-+
-+if grep noonsees conftest.$ac_objext >/dev/null ; then
-+ ax_cv_c_float_words_bigendian=yes
-+fi
-+if grep seesnoon conftest.$ac_objext >/dev/null ; then
-+ if test "$ax_cv_c_float_words_bigendian" = unknown; then
-+ ax_cv_c_float_words_bigendian=no
-+ else
-+ ax_cv_c_float_words_bigendian=unknown
-+ fi
-+fi
-+
-+])])
-+
-+case $ax_cv_c_float_words_bigendian in
-+ yes)
-+ m4_default([$1],
-+ [AC_DEFINE([FLOAT_WORDS_BIGENDIAN], 1,
-+ [Define to 1 if your system stores words within floats
-+ with the most significant word first])]) ;;
-+ no)
-+ $2 ;;
-+ *)
-+ m4_default([$3],
-+ [AC_MSG_ERROR([
-+
-+Unknown float word ordering. You need to manually preset
-+ax_cv_c_float_words_bigendian=no (or yes) according to your system.
-+
-+ ])]) ;;
-+esac
-+
-+])# AX_C_FLOAT_WORDS_BIGENDIAN
---
-2.11.0
-
diff --git a/external/poky/meta/recipes-devtools/python/python/get_module_deps2.py b/external/poky/meta/recipes-devtools/python/python/get_module_deps2.py
deleted file mode 100644
index 73e7c6f6..00000000
--- a/external/poky/meta/recipes-devtools/python/python/get_module_deps2.py
+++ /dev/null
@@ -1,112 +0,0 @@
-# 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/external/poky/meta/recipes-devtools/python/python/host_include_contamination.patch b/external/poky/meta/recipes-devtools/python/python/host_include_contamination.patch
deleted file mode 100644
index e0aafb21..00000000
--- a/external/poky/meta/recipes-devtools/python/python/host_include_contamination.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python/multilib.patch b/external/poky/meta/recipes-devtools/python/python/multilib.patch
deleted file mode 100644
index d24bc15f..00000000
--- a/external/poky/meta/recipes-devtools/python/python/multilib.patch
+++ /dev/null
@@ -1,298 +0,0 @@
-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="SEDMELIBLEAF"
-+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/external/poky/meta/recipes-devtools/python/python/parallel-makeinst-create-bindir.patch b/external/poky/meta/recipes-devtools/python/python/parallel-makeinst-create-bindir.patch
deleted file mode 100644
index abab41e9..00000000
--- a/external/poky/meta/recipes-devtools/python/python/parallel-makeinst-create-bindir.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python/python-2.7.3-remove-bsdb-rpath.patch b/external/poky/meta/recipes-devtools/python/python/python-2.7.3-remove-bsdb-rpath.patch
deleted file mode 100644
index 216be0a4..00000000
--- a/external/poky/meta/recipes-devtools/python/python/python-2.7.3-remove-bsdb-rpath.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python/python2-manifest.json b/external/poky/meta/recipes-devtools/python/python/python2-manifest.json
deleted file mode 100644
index c092e69d..00000000
--- a/external/poky/meta/recipes-devtools/python/python/python2-manifest.json
+++ /dev/null
@@ -1,1136 +0,0 @@
-# DO NOT (entirely) modify this file manually, please read.
-#
-# IMPORTANT NOTE:
-# Please keep in mind that the create_manifest task relies on the fact the the
-# target and native Python packages are the same, and it also needs to be executed
-# with a fully working native package (with all the PACKAGECONFIGs enabled and all
-# and all the modules should be working, check log.do_compile), otherwise the script
-# will fail to find dependencies correctly, this note is valid either if you are
-# upgrading to a new Python version or adding a new package.
-#
-#
-# If you are adding a new package please follow the next steps:
-# How to add a new package:
-# - If a user wants to add a new package all that has to be done is:
-# Modify the python2-manifest.json file, and add the required file(s) to the FILES list,
-# fill up the SUMMARY section as well, the script should handle all the rest.
-#
-# Real example:
-# We want to add a web browser package, including the file webbrowser.py
-# which at the moment is on python-misc.
-# "webbrowser": {
-# "files": ["${libdir}/python2.7/lib-dynload/webbrowser.py"],
-# "rdepends": [],
-# "summary": "Python Web Browser support"}
-#
-# * Note that the rdepends field was left empty
-#
-# We run $ bitbake python -c create_manifest and the resulting manifest
-# should be completed after a few seconds, showing something like:
-# "webbrowser": {
-# "files": ["${libdir}/python2.7/webbrowser.py"],
-# "rdepends": ["core","fcntl","io","pickle","shell","subprocess"],
-# "summary": "Python Web Browser support"}
-#
-#
-# If you are upgrading Python to a new version please follow the next steps:
-# After each Python upgrade, the create_manifest task should be executed, because we
-# don't control what changes on upstream Python, so, some module dependency
-# might have changed without us realizing it, a certain module can either have
-# more or less dependencies, or could be depending on a new file that was just
-# created on the new release and for obvious reasons we wouldn't have it on our
-# old manifest, all of these issues would cause runtime errors on our system.
-#
-# - Upgrade both the native and target Python packages to a new version
-# - Run the create_manifest task for the target Python package as its shown below:
-#
-# $ bitbake python -c create_manifest
-#
-# This will automatically replace your manifest file located under the Python directory
-# with an new one, which contains the new dependencies (if any).
-#
-# Several things could have gone wrong here, I will try to explain a few:
-#
-# a) A new file was introduced on this release, e.g. sha3*.so:
-# The task will check what its needed to import every module, more than one module would
-# would probably depend on sha3*.so, although only one module should contain it.
-#
-# After running the task, the new manifest will have the sha3*.so file on more than one
-# module, you need to manually decide which one of them should get it and delete it from
-# the others, for example sha3*.so should likely be on ${PN}-crypt.
-# Once you have deleted from the others you need to run the create_manifest task again,
-# this will populate the other module's rdepends fields, with ${PN}-crypt and you should be
-# good to go.
-#
-# b) The native package wasn't built correctly and its missing a certain module:
-# As mentioned before, you need to make sure the native package was built with all the modules
-# because it is used as base to build the manifest file, you need to manually check log.do_compile
-# since it won't error out the compile function if its only missing a couple of modules.
-#
-# e.g. missing the _uuid module, log.do_compile would show the following:
-# Python build finished successfully!
-# The necessary bits to build these optional modules were not found:
-# _uuid
-#
-# What will happen here is that the new manifest would not be aware that the _uuid module exists, so
-# not only we won't know of any dependencies to it, but also, the _uuid* files will be packaged on
-# the misc package (which is where any file that doesn't belong anywhere else ends up).
-#
-# This will eventually cause runtime errors on our system if we don't include the misc package on
-# on our image, because the _uuid files will be missing.
-# If we build the _uuid module correctly and run the create_manifest task the _uuid files will be
-# detected correctly along with its dependencies, and we will get a working manifest.
-#
-# This is the reason why it is important to make sure we have a fully working native build,
-# so we can avoid these errors.
-#
-#
-#
-# DO NOT MODIFY THE NEXT LINE!, IT IS USED AS A MARKER FOR THE ACTUAL JSON MANIFEST
-# EOC
-{
- "tests": {
- "summary": "Python test suite",
- "rdepends": [
- "core",
- "modules"
- ],
- "files": [
- "${libdir}/python2.7/*/test",
- "${libdir}/python2.7/*/tests",
- "${libdir}/python2.7/idlelib/idle_test/",
- "${libdir}/python2.7/test"
- ],
- "cached": []
- },
- "2to3": {
- "summary": "Python automated Python 2 to 3 code translator",
- "rdepends": [
- "core"
- ],
- "files": [
- "${bindir}/2to3",
- "${libdir}/python2.7/lib2to3"
- ]
- },
- "argparse": {
- "summary": "Python command line argument parser",
- "rdepends": [
- "codecs",
- "core",
- "lang",
- "textutils"
- ],
- "files": [
- "${libdir}/python2.7/argparse.py"
- ]
- },
- "audio": {
- "summary": "Python Audio Handling",
- "rdepends": [
- "core",
- "crypt",
- "fcntl",
- "io",
- "math"
- ],
- "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"
- ]
- },
- "bsddb": {
- "summary": "Python bindings for the Berkeley Database",
- "rdepends": [
- "core"
- ],
- "files": [
- "${libdir}/python2.7/bsddb",
- "${libdir}/python2.7/lib-dynload/_bsddb.so"
- ]
- },
- "codecs": {
- "summary": "Python codec",
- "rdepends": [
- "core",
- "io",
- "lang"
- ],
- "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"
- ]
- },
- "compile": {
- "summary": "Python bytecode compilation support",
- "rdepends": [
- "core"
- ],
- "files": [
- "${libdir}/python2.7/compileall.py",
- "${libdir}/python2.7/py_compile.py"
- ]
- },
- "compiler": {
- "summary": "Python compiler support",
- "rdepends": [
- "core",
- "io",
- "lang"
- ],
- "files": [
- "${libdir}/python2.7/compiler"
- ]
- },
- "compression": {
- "summary": "Python high-level compression support",
- "rdepends": [
- "core",
- "io",
- "shell",
- "unixadmin",
- "zlib"
- ],
- "files": [
- "${libdir}/python2.7/gzip.py",
- "${libdir}/python2.7/lib-dynload/bz2.so",
- "${libdir}/python2.7/tarfile.py",
- "${libdir}/python2.7/zipfile.py"
- ]
- },
- "contextlib": {
- "summary": "Python utilities for with-statementcontexts.",
- "rdepends": [
- "core",
- "lang"
- ],
- "files": [
- "${libdir}/python2.7/contextlib.py"
- ]
- },
- "core": {
- "summary": "Python interpreter and core modules",
- "rdepends": [],
- "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"
- ]
- },
- "crypt": {
- "summary": "Python basic cryptographic and hashing support",
- "rdepends": [
- "core"
- ],
- "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"
- ]
- },
- "ctypes": {
- "summary": "Python C types support",
- "rdepends": [
- "core"
- ],
- "files": [
- "${libdir}/python2.7/ctypes",
- "${libdir}/python2.7/lib-dynload/_ctypes.so",
- "${libdir}/python2.7/lib-dynload/_ctypes_test.so"
- ]
- },
- "curses": {
- "summary": "Python curses support",
- "rdepends": [
- "core"
- ],
- "files": [
- "${libdir}/python2.7/curses",
- "${libdir}/python2.7/lib-dynload/_curses.so",
- "${libdir}/python2.7/lib-dynload/_curses_panel.so"
- ]
- },
- "datetime": {
- "summary": "Python calendar and time support",
- "rdepends": [
- "codecs",
- "core",
- "lang"
- ],
- "files": [
- "${libdir}/python2.7/_strptime.py",
- "${libdir}/python2.7/calendar.py",
- "${libdir}/python2.7/lib-dynload/datetime.so"
- ]
- },
- "db": {
- "summary": "Python file-based database support",
- "rdepends": [
- "bsddb",
- "core",
- "gdbm"
- ],
- "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"
- ]
- },
- "debugger": {
- "summary": "Python debugger",
- "rdepends": [
- "core",
- "io",
- "lang",
- "pprint",
- "shell"
- ],
- "files": [
- "${libdir}/python2.7/bdb.py",
- "${libdir}/python2.7/pdb.py"
- ]
- },
- "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": {
- "summary": "Python helpers for computing deltas between objects",
- "rdepends": [
- "core",
- "lang"
- ],
- "files": [
- "${libdir}/python2.7/difflib.py"
- ]
- },
- "distutils-staticdev": {
- "files": [
- "${libdir}/python2.7/config/lib*.a"
- ],
- "rdepends": [
- "distutils"
- ],
- "summary": "Python distribution utilities (static libraries)"
- },
- "distutils": {
- "summary": "Python Distribution Utilities",
- "rdepends": [
- "core"
- ],
- "files": [
- "${libdir}/python2.7/config",
- "${libdir}/python2.7/distutils"
- ]
- },
- "doctest": {
- "summary": "Python framework for running examples in docstrings",
- "rdepends": [
- "core",
- "crypt",
- "debugger",
- "difflib",
- "fcntl",
- "io",
- "lang",
- "math",
- "pprint",
- "shell",
- "unittest"
- ],
- "files": [
- "${libdir}/python2.7/doctest.py"
- ]
- },
- "email": {
- "summary": "Python email support",
- "rdepends": [
- "contextlib",
- "core",
- "crypt",
- "fcntl",
- "io",
- "lang",
- "math",
- "netclient",
- "pickle",
- "subprocess",
- "textutils",
- "threading"
- ],
- "files": [
- "${libdir}/python2.7/email",
- "${libdir}/python2.7/imaplib.py"
- ]
- },
- "fcntl": {
- "summary": "Python's fcntl interface",
- "rdepends": [
- "core"
- ],
- "files": [
- "${libdir}/python2.7/lib-dynload/fcntl.so"
- ]
- },
- "gdbm": {
- "summary": "Python GNU database support",
- "rdepends": [
- "core"
- ],
- "files": [
- "${libdir}/python2.7/lib-dynload/gdbm.so"
- ]
- },
- "hotshot": {
- "summary": "Python hotshot performance profiler",
- "rdepends": [
- "core"
- ],
- "files": [
- "${libdir}/python2.7/hotshot",
- "${libdir}/python2.7/lib-dynload/_hotshot.so"
- ]
- },
- "html": {
- "summary": "Python HTML processing support",
- "rdepends": [
- "core"
- ],
- "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"
- ]
- },
- "idle": {
- "summary": "Python Integrated Development Environment",
- "rdepends": [
- "core"
- ],
- "files": [
- "${bindir}/idle",
- "${libdir}/python2.7/idlelib"
- ]
- },
- "image": {
- "summary": "Python graphical image handling",
- "rdepends": [
- "core"
- ],
- "files": [
- "${libdir}/python2.7/colorsys.py",
- "${libdir}/python2.7/imghdr.py"
- ]
- },
- "io": {
- "summary": "Python low-level I/O",
- "rdepends": [
- "contextlib",
- "core",
- "crypt",
- "fcntl",
- "lang",
- "math",
- "netclient",
- "textutils"
- ],
- "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"
- ]
- },
- "json": {
- "summary": "Python JSON support",
- "rdepends": [
- "core"
- ],
- "files": [
- "${libdir}/python2.7/json",
- "${libdir}/python2.7/lib-dynload/_json.so"
- ]
- },
- "lang": {
- "summary": "Python low-level language support",
- "rdepends": [
- "core"
- ],
- "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"
- ]
- },
- "logging": {
- "summary": "Python logging support",
- "rdepends": [
- "core",
- "io",
- "threading"
- ],
- "files": [
- "${libdir}/python2.7/logging"
- ]
- },
- "mailbox": {
- "summary": "Python mailbox format support",
- "rdepends": [
- "codecs",
- "contextlib",
- "core",
- "crypt",
- "datetime",
- "email",
- "fcntl",
- "io",
- "lang",
- "math",
- "mime",
- "netclient",
- "textutils"
- ],
- "files": [
- "${libdir}/python2.7/mailbox.py"
- ]
- },
- "math": {
- "summary": "Python math support",
- "rdepends": [
- "core",
- "crypt"
- ],
- "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"
- ]
- },
- "mime": {
- "summary": "Python MIME handling APIs",
- "rdepends": [
- "contextlib",
- "core",
- "crypt",
- "fcntl",
- "io",
- "lang",
- "math",
- "netclient",
- "textutils"
- ],
- "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"
- ]
- },
- "mmap": {
- "summary": "Python memory-mapped file support",
- "rdepends": [
- "core"
- ],
- "files": [
- "${libdir}/python2.7/lib-dynload/mmap.so"
- ]
- },
- "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": {
- "summary": "Python multiprocessing support",
- "rdepends": [
- "core",
- "fcntl",
- "io",
- "pickle",
- "subprocess",
- "threading"
- ],
- "files": [
- "${libdir}/python2.7/lib-dynload/_multiprocessing.so",
- "${libdir}/python2.7/multiprocessing"
- ]
- },
- "netclient": {
- "summary": "Python Internet Protocol clients",
- "rdepends": [
- "codecs",
- "contextlib",
- "core",
- "crypt",
- "ctypes",
- "datetime",
- "email",
- "fcntl",
- "io",
- "lang",
- "math",
- "mime",
- "pickle",
- "subprocess",
- "textutils",
- "threading"
- ],
- "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"
- ]
- },
- "netserver": {
- "summary": "Python Internet Protocol servers",
- "rdepends": [
- "compression",
- "contextlib",
- "core",
- "crypt",
- "fcntl",
- "io",
- "lang",
- "math",
- "mime",
- "netclient",
- "shell",
- "textutils",
- "threading",
- "unixadmin",
- "zlib"
- ],
- "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"
- ]
- },
- "numbers": {
- "summary": "Python number APIs",
- "rdepends": [
- "codecs",
- "core",
- "lang",
- "math",
- "threading"
- ],
- "files": [
- "${libdir}/python2.7/decimal.py",
- "${libdir}/python2.7/fractions.py",
- "${libdir}/python2.7/numbers.py"
- ]
- },
- "pickle": {
- "summary": "Python serialisation/persistence support",
- "rdepends": [
- "core",
- "io"
- ],
- "files": [
- "${libdir}/python2.7/lib-dynload/cPickle.so",
- "${libdir}/python2.7/pickle.py",
- "${libdir}/python2.7/pickletools.py",
- "${libdir}/python2.7/shelve.py"
- ]
- },
- "pkgutil": {
- "summary": "Python package extension utility support",
- "rdepends": [
- "core"
- ],
- "files": [
- "${libdir}/python2.7/pkgutil.py"
- ]
- },
- "plistlib": {
- "summary": "Generate and parse Mac OS X .plist files",
- "rdepends": [
- "core",
- "datetime",
- "io"
- ],
- "files": [
- "${libdir}/python2.7/plistlib.py"
- ]
- },
- "pprint": {
- "summary": "Python pretty-print support",
- "rdepends": [
- "core",
- "io"
- ],
- "files": [
- "${libdir}/python2.7/pprint.py"
- ]
- },
- "profile": {
- "summary": "Python basic performance profiling support",
- "rdepends": [
- "codecs",
- "core",
- "lang",
- "resource",
- "textutils"
- ],
- "files": [
- "${libdir}/python2.7/cProfile.py",
- "${libdir}/python2.7/lib-dynload/_lsprof.so",
- "${libdir}/python2.7/profile.py",
- "${libdir}/python2.7/pstats.py"
- ]
- },
- "pydoc": {
- "summary": "Python interactive help support",
- "rdepends": [
- "codecs",
- "core",
- "lang",
- "pkgutil"
- ],
- "files": [
- "${bindir}/pydoc",
- "${libdir}/python2.7/pydoc.py",
- "${libdir}/python2.7/pydoc_data"
- ]
- },
- "re": {
- "summary": "Python Regular Expression APIs",
- "rdepends": [
- "core"
- ],
- "files": [
- "${libdir}/python2.7/sre.py"
- ]
- },
- "resource": {
- "summary": "Python resource control interface",
- "rdepends": [
- "core"
- ],
- "files": [
- "${libdir}/python2.7/lib-dynload/resource.so"
- ]
- },
- "robotparser": {
- "summary": "Python robots.txt parser",
- "rdepends": [
- "contextlib",
- "core",
- "io",
- "lang",
- "netclient",
- "textutils"
- ],
- "files": [
- "${libdir}/python2.7/robotparser.py"
- ]
- },
- "runpy": {
- "summary": "Python helper for locating/executing scripts in module namespace",
- "rdepends": [
- "core",
- "pkgutil"
- ],
- "files": [
- "${libdir}/python2.7/runpy.py"
- ]
- },
- "shell": {
- "summary": "Python shell-like functionality",
- "rdepends": [
- "compression",
- "core",
- "io",
- "unixadmin",
- "zlib"
- ],
- "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"
- ]
- },
- "smtpd": {
- "summary": "Python Simple Mail Transport Daemon",
- "rdepends": [
- "core",
- "fcntl",
- "io",
- "lang"
- ],
- "files": [
- "${bindir}/smtpd.py",
- "${libdir}/python2.7/asynchat.py",
- "${libdir}/python2.7/asyncore.py",
- "${libdir}/python2.7/smtpd.py"
- ]
- },
- "sqlite3": {
- "summary": "Python Sqlite3 database support",
- "rdepends": [
- "core",
- "datetime"
- ],
- "files": [
- "${libdir}/python2.7/lib-dynload/_sqlite3.so",
- "${libdir}/python2.7/sqlite3"
- ]
- },
- "stringold": {
- "summary": "Python string APIs [deprecated]",
- "rdepends": [
- "core"
- ],
- "files": [
- "${libdir}/python2.7/stringold.py"
- ]
- },
- "subprocess": {
- "summary": "Python subprocess support",
- "rdepends": [
- "core",
- "fcntl",
- "io",
- "pickle",
- "threading"
- ],
- "files": [
- "${libdir}/python2.7/subprocess.py"
- ]
- },
- "syslog": {
- "summary": "Python syslog interface",
- "rdepends": [
- "core"
- ],
- "files": [
- "${libdir}/python2.7/lib-dynload/syslog.so"
- ]
- },
- "terminal": {
- "summary": "Python terminal controlling support",
- "rdepends": [
- "core",
- "io"
- ],
- "files": [
- "${libdir}/python2.7/pty.py",
- "${libdir}/python2.7/tty.py"
- ]
- },
- "textutils": {
- "summary": "Python option parsin",
- "rdepends": [
- "codecs",
- "core",
- "io",
- "lang"
- ],
- "files": [
- "${libdir}/python2.7/csv.py",
- "${libdir}/python2.7/lib-dynload/_csv.so",
- "${libdir}/python2.7/optparse.py",
- "${libdir}/python2.7/textwrap.py"
- ]
- },
- "threading": {
- "summary": "Python threading & synchronization support",
- "rdepends": [
- "core"
- ],
- "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"
- ]
- },
- "tkinter": {
- "summary": "Python Tcl/Tk bindings",
- "rdepends": [
- "core"
- ],
- "files": [
- "${libdir}/python2.7/lib-tk"
- ]
- },
- "unittest": {
- "summary": "Python unit testing framework",
- "rdepends": [
- "core",
- "difflib",
- "io",
- "lang",
- "pprint",
- "shell"
- ],
- "files": [
- "${libdir}/python2.7/unittest"
- ]
- },
- "unixadmin": {
- "summary": "Python Unix administration support",
- "rdepends": [
- "core",
- "io"
- ],
- "files": [
- "${libdir}/python2.7/getpass.py",
- "${libdir}/python2.7/lib-dynload/grp.so",
- "${libdir}/python2.7/lib-dynload/nis.so"
- ]
- },
- "xml": {
- "summary": "Python basic XML support",
- "rdepends": [
- "core"
- ],
- "files": [
- "${libdir}/python2.7/lib-dynload/_elementtree.so",
- "${libdir}/python2.7/lib-dynload/pyexpat.so",
- "${libdir}/python2.7/xml"
- ]
- },
- "xmlrpc": {
- "summary": "Python XML-RPC support",
- "rdepends": [
- "codecs",
- "compression",
- "contextlib",
- "core",
- "crypt",
- "datetime",
- "fcntl",
- "io",
- "lang",
- "math",
- "mime",
- "netclient",
- "netserver",
- "pkgutil",
- "pydoc",
- "textutils",
- "threading",
- "xml",
- "zlib"
- ],
- "files": [
- "${libdir}/python2.7/DocXMLRPCServer.py",
- "${libdir}/python2.7/SimpleXMLRPCServer.py"
- ]
- },
- "zlib": {
- "summary": "Python zlib compression support",
- "rdepends": [
- "core"
- ],
- "files": [
- "${libdir}/python2.7/lib-dynload/zlib.so"
- ]
- }
-} \ No newline at end of file
diff --git a/external/poky/meta/recipes-devtools/python/python/run-ptest b/external/poky/meta/recipes-devtools/python/python/run-ptest
deleted file mode 100644
index 832551a1..00000000
--- a/external/poky/meta/recipes-devtools/python/python/run-ptest
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-python -m test.regrtest -v | 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/external/poky/meta/recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch b/external/poky/meta/recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch
deleted file mode 100644
index dacb552e..00000000
--- a/external/poky/meta/recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python/setup_py_skip_cross_import_check.patch b/external/poky/meta/recipes-devtools/python/python/setup_py_skip_cross_import_check.patch
deleted file mode 100644
index 6ccdb948..00000000
--- a/external/poky/meta/recipes-devtools/python/python/setup_py_skip_cross_import_check.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python/setuptweaks.patch b/external/poky/meta/recipes-devtools/python/python/setuptweaks.patch
deleted file mode 100644
index 3a91b191..00000000
--- a/external/poky/meta/recipes-devtools/python/python/setuptweaks.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python/sitecustomize.py b/external/poky/meta/recipes-devtools/python/python/sitecustomize.py
deleted file mode 100644
index 4c8b5e2b..00000000
--- a/external/poky/meta/recipes-devtools/python/python/sitecustomize.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# 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/external/poky/meta/recipes-devtools/python/python/support_SOURCE_DATE_EPOCH_in_py_compile_2.7.patch b/external/poky/meta/recipes-devtools/python/python/support_SOURCE_DATE_EPOCH_in_py_compile_2.7.patch
deleted file mode 100644
index 12651798..00000000
--- a/external/poky/meta/recipes-devtools/python/python/support_SOURCE_DATE_EPOCH_in_py_compile_2.7.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python/use_sysroot_ncurses_instead_of_host.patch b/external/poky/meta/recipes-devtools/python/python/use_sysroot_ncurses_instead_of_host.patch
deleted file mode 100644
index fb4a3bcf..00000000
--- a/external/poky/meta/recipes-devtools/python/python/use_sysroot_ncurses_instead_of_host.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python3-dbus_1.2.8.bb b/external/poky/meta/recipes-devtools/python/python3-dbus_1.2.16.bb
index c9bf8df4..e1700fa8 100644
--- a/external/poky/meta/recipes-devtools/python/python3-dbus_1.2.8.bb
+++ b/external/poky/meta/recipes-devtools/python/python3-dbus_1.2.16.bb
@@ -3,13 +3,13 @@ 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"
+DEPENDS = "expat dbus glib-2.0 virtual/libintl"
-SRC_URI = "http://dbus.freedesktop.org/releases/dbus-python/dbus-python-${PV}.tar.gz \
-"
+SRC_URI = "http://dbus.freedesktop.org/releases/dbus-python/dbus-python-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "51a45c973d82bedff033a4b57d69d5d8"
+SRC_URI[sha256sum] = "11238f1d86c995d8aed2e22f04a1e3779f0d70e587caffeab4857f3c662ed5a4"
-SRC_URI[md5sum] = "7379db774c10904f27e7e2743d90fb43"
-SRC_URI[sha256sum] = "abf12bbb765e300bf8e2a1b2f32f85949eab06998dbda127952c31cb63957b6f"
S = "${WORKDIR}/dbus-python-${PV}"
inherit distutils3-base autotools pkgconfig
@@ -22,3 +22,5 @@ EXTRA_OECONF += "--disable-documentation"
RDEPENDS_${PN} = "python3-io python3-logging python3-stringold python3-threading python3-xml"
FILES_${PN}-dev += "${libdir}/pkgconfig"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/external/poky/meta/recipes-devtools/python/python3-docutils_0.14.bb b/external/poky/meta/recipes-devtools/python/python3-docutils_0.16.bb
index 81a449d6..50547a1b 100644
--- a/external/poky/meta/recipes-devtools/python/python3-docutils_0.14.bb
+++ b/external/poky/meta/recipes-devtools/python/python3-docutils_0.16.bb
@@ -2,17 +2,16 @@ 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"
+LIC_FILES_CHKSUM = "file://COPYING.txt;md5=7a4646907ab9083c826280b19e103106"
DEPENDS = "python3"
SRC_URI = "${SOURCEFORGE_MIRROR}/docutils/docutils-${PV}.tar.gz"
-SRC_URI[md5sum] = "c53768d63db3873b7d452833553469de"
-SRC_URI[sha256sum] = "51e64ef2ebfb29cae1faa133b3710143496eca21c530f3f71424d77687764274"
+SRC_URI[md5sum] = "9ccb6f332e23360f964de72c8ea5f0ed"
+SRC_URI[sha256sum] = "7d4e999cca74a52611773a42912088078363a30912e8822f7a3d38043b767573"
S = "${WORKDIR}/docutils-${PV}"
inherit distutils3
BBCLASSEXTEND = "native"
-
diff --git a/external/poky/meta/recipes-devtools/python/python3-git_2.1.11.bb b/external/poky/meta/recipes-devtools/python/python3-git_2.1.11.bb
deleted file mode 100644
index ac320fa5..00000000
--- a/external/poky/meta/recipes-devtools/python/python3-git_2.1.11.bb
+++ /dev/null
@@ -1,2 +0,0 @@
-require python-git.inc
-inherit setuptools3
diff --git a/external/poky/meta/recipes-devtools/python/python-git.inc b/external/poky/meta/recipes-devtools/python/python3-git_3.0.5.bb
index 7ccf1686..36313ef8 100644
--- a/external/poky/meta/recipes-devtools/python/python-git.inc
+++ b/external/poky/meta/recipes-devtools/python/python3-git_3.0.5.bb
@@ -10,12 +10,12 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=8b8d26c37c1d5a04f9b0186edbebc183"
PYPI_PACKAGE = "GitPython"
-inherit pypi
+inherit pypi setuptools3
-SRC_URI[md5sum] = "cee43a39a1468084d49d1c49fb675204"
-SRC_URI[sha256sum] = "8237dc5bfd6f1366abeee5624111b9d6879393d84745a507de0fda86043b65a8"
+SRC_URI[md5sum] = "7555ad89a22f663c25cced5f623bdef0"
+SRC_URI[sha256sum] = "9c2398ffc3dcb3c40b27324b316f08a4f93ad646d5a6328cafbb871aa79f5e42"
-DEPENDS = "${PYTHON_PN}-gitdb"
+DEPENDS += " ${PYTHON_PN}-gitdb"
RDEPENDS_${PN} += " \
${PYTHON_PN}-datetime \
@@ -29,4 +29,5 @@ RDEPENDS_${PN} += " \
${PYTHON_PN}-unixadmin \
git \
"
-BBCLASSEXTEND = "nativesdk"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/external/poky/meta/recipes-devtools/python/python3-gitdb_2.0.4.bb b/external/poky/meta/recipes-devtools/python/python3-gitdb_2.0.6.bb
index fe158327..2dcd9c8a 100644
--- a/external/poky/meta/recipes-devtools/python/python3-gitdb_2.0.4.bb
+++ b/external/poky/meta/recipes-devtools/python/python3-gitdb_2.0.6.bb
@@ -1,2 +1,3 @@
inherit setuptools3
require python-gitdb.inc
+
diff --git a/external/poky/meta/recipes-devtools/python/python3-libarchive-c_2.9.bb b/external/poky/meta/recipes-devtools/python/python3-libarchive-c_2.9.bb
new file mode 100644
index 00000000..3a2d8733
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/python/python3-libarchive-c_2.9.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Python interface to libarchive"
+DESCRIPTION = "A Python interface to libarchive. It uses the standard ctypes module to \
+ dynamically load and access the C library."
+HOMEPAGE = "https://github.com/Changaco/python-libarchive-c"
+LICENSE = "CC0-1.0"
+LIC_FILES_CHKSUM = "file://LICENSE.md;md5=bcab380227a83bc147350b40a81e6ffc"
+
+PYPI_PACKAGE = "libarchive-c"
+
+inherit pypi setuptools3
+
+SRC_URI[md5sum] = "083bd2cb0043c1e22a52cb9a05e31532"
+SRC_URI[sha256sum] = "9919344cec203f5db6596a29b5bc26b07ba9662925a05e24980b84709232ef60"
+
+RDEPENDS_${PN} += "\
+ libarchive \
+ ${PYTHON_PN}-ctypes \
+ ${PYTHON_PN}-mmap \
+"
+
+BBCLASSEXTEND = "native"
diff --git a/external/poky/meta/recipes-devtools/python/python3-magic_0.4.15.bb b/external/poky/meta/recipes-devtools/python/python3-magic_0.4.15.bb
new file mode 100644
index 00000000..698016ba
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/python/python3-magic_0.4.15.bb
@@ -0,0 +1,19 @@
+SUMMARY = "File type identification using libmagic"
+DESCRIPTION = "This module uses ctypes to access the libmagic file type \
+ identification library. It makes use of the local magic database and supports \
+ both textual and MIME-type output."
+HOMEPAGE = "http://github.com/ahupp/python-magic"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=16a934f165e8c3245f241e77d401bb88"
+
+PYPI_PACKAGE = "python-magic"
+
+inherit pypi setuptools3
+
+SRC_URI[md5sum] = "e384c95a47218f66c6501cd6dd45ff59"
+SRC_URI[sha256sum] = "f3765c0f582d2dfc72c15f3b5a82aecfae9498bd29ca840d72f37d7bd38bfcd5"
+
+RDEPENDS_${PN} += "file"
+
+BBCLASSEXTEND = "native"
diff --git a/external/poky/meta/recipes-devtools/python/python3-mako_1.0.7.bb b/external/poky/meta/recipes-devtools/python/python3-mako_1.0.7.bb
deleted file mode 100644
index 22ceeeb3..00000000
--- a/external/poky/meta/recipes-devtools/python/python3-mako_1.0.7.bb
+++ /dev/null
@@ -1,2 +0,0 @@
-inherit setuptools3
-require python-mako.inc
diff --git a/external/poky/meta/recipes-devtools/python/python-mako.inc b/external/poky/meta/recipes-devtools/python/python3-mako_1.1.1.bb
index e265bde8..bc38009d 100644
--- a/external/poky/meta/recipes-devtools/python/python-mako.inc
+++ b/external/poky/meta/recipes-devtools/python/python3-mako_1.1.1.bb
@@ -2,14 +2,14 @@ SUMMARY = "Templating library for Python"
HOMEPAGE = "http://www.makotemplates.org/"
SECTION = "devel/python"
LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=1bb21fa2d2f7a534c884b990430a6863"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=943eb67718222db21d44a4ef1836675f"
PYPI_PACKAGE = "Mako"
-inherit pypi
+inherit pypi setuptools3
-SRC_URI[md5sum] = "5836cc997b1b773ef389bf6629c30e65"
-SRC_URI[sha256sum] = "4e02fde57bd4abb5ec400181e4c314f56ac3e49ba4fb8b0d50bba18cb27d25ae"
+SRC_URI[md5sum] = "2660a4916f2f63456e6885c727b7cd2f"
+SRC_URI[sha256sum] = "2984a6733e1d472796ceef37ad48c26f4a984bb18119bb2dbc37a44d8f6e75a4"
RDEPENDS_${PN} = "${PYTHON_PN}-html \
${PYTHON_PN}-netclient \
diff --git a/external/poky/meta/recipes-devtools/python/python3-native_3.5.6.bb b/external/poky/meta/recipes-devtools/python/python3-native_3.5.6.bb
deleted file mode 100644
index c7bc4f3b..00000000
--- a/external/poky/meta/recipes-devtools/python/python3-native_3.5.6.bb
+++ /dev/null
@@ -1,99 +0,0 @@
-require recipes-devtools/python/python3.inc
-
-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://030-fixup-include-dirs.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://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 \
-file://0001-Issue-28043-SSLContext-has-improved-default-settings.patch \
-file://0002-bpo-29136-Add-TLS-1.3-cipher-suites-and-OP_NO_TLSv1_.patch \
-file://0003-bpo-32947-Fixes-for-TLS-1.3-and-OpenSSL-1.1.1-GH-876.patch \
-file://0004-bpo-33570-TLS-1.3-ciphers-for-OpenSSL-1.1.1-GH-6976.patch \
-file://0005-bpo-30714-ALPN-changes-for-OpenSSL-1.1.0f-2305.patch \
-"
-
-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} \
-'
-
-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')
- 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/external/poky/meta/recipes-devtools/python/python3-nose_1.3.7.bb b/external/poky/meta/recipes-devtools/python/python3-nose_1.3.7.bb
index 8bc1f498..13dbf961 100644
--- a/external/poky/meta/recipes-devtools/python/python3-nose_1.3.7.bb
+++ b/external/poky/meta/recipes-devtools/python/python3-nose_1.3.7.bb
@@ -1,6 +1,2 @@
inherit setuptools3
require python-nose.inc
-
-do_install_append() {
- mv ${D}${bindir}/nosetests ${D}${bindir}/nosetests3
-}
diff --git a/external/poky/meta/recipes-devtools/python/python3-pbr_4.2.0.bb b/external/poky/meta/recipes-devtools/python/python3-pbr_4.2.0.bb
deleted file mode 100644
index 97e7361b..00000000
--- a/external/poky/meta/recipes-devtools/python/python3-pbr_4.2.0.bb
+++ /dev/null
@@ -1,2 +0,0 @@
-inherit setuptools3
-require python-pbr.inc
diff --git a/external/poky/meta/recipes-devtools/python/python3-pbr_5.4.4.bb b/external/poky/meta/recipes-devtools/python/python3-pbr_5.4.4.bb
new file mode 100644
index 00000000..6f335ea3
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/python/python3-pbr_5.4.4.bb
@@ -0,0 +1,5 @@
+inherit setuptools3
+require python-pbr.inc
+
+SRC_URI[md5sum] = "65cdc32e1a1ff56d481fc15aa8caf988"
+SRC_URI[sha256sum] = "139d2625547dbfa5fb0b81daebb39601c478c21956dc57e2e07b74450a8c506b"
diff --git a/external/poky/meta/recipes-devtools/python/python3-pip_18.0.bb b/external/poky/meta/recipes-devtools/python/python3-pip_20.0.2.bb
index 3fcdb801..08738fb2 100644
--- a/external/poky/meta/recipes-devtools/python/python3-pip_18.0.bb
+++ b/external/poky/meta/recipes-devtools/python/python3-pip_20.0.2.bb
@@ -2,12 +2,12 @@ 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=593c6cd9d639307226978cbcae61ad4b"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=8ba06d529c955048e5ddd7c45459eb2e"
DEPENDS += "python3 python3-setuptools-native"
-SRC_URI[md5sum] = "52f75ceb21e96c258f289859a2996b60"
-SRC_URI[sha256sum] = "a0e11645ee37c90b40c46d607070c4fd583e2cd46231b1c06e389c5e814eed76"
+SRC_URI[md5sum] = "7d42ba49b809604f0df3d55df1c3fd86"
+SRC_URI[sha256sum] = "7db0c8ea4c7ea51c8049640e8e6e7fde949de672bfa4949920675563a5a6967f"
inherit pypi distutils3
@@ -25,6 +25,7 @@ RDEPENDS_${PN} = "\
python3-setuptools \
python3-unixadmin \
python3-xmlrpc \
+ python3-pickle \
"
BBCLASSEXTEND = "native nativesdk"
diff --git a/external/poky/meta/recipes-devtools/python/python3-pycairo_1.15.6.bb b/external/poky/meta/recipes-devtools/python/python3-pycairo_1.19.0.bb
index 5c3e1e6f..8f60834c 100644
--- a/external/poky/meta/recipes-devtools/python/python3-pycairo_1.15.6.bb
+++ b/external/poky/meta/recipes-devtools/python/python3-pycairo_1.19.0.bb
@@ -3,29 +3,25 @@ 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 \
+LIC_FILES_CHKSUM = "file://COPYING;md5=f3713ca2c28d9312ad718520b6dc3eee \
file://COPYING-LGPL-2.1;md5=fad9b3332be894bab9bc501572864b29 \
file://COPYING-MPL-1.1;md5=bfe1f75d606912a4111c90743d6c7325"
# cairo >= 1.14
-DEPENDS = "cairo"
+DEPENDS = "cairo python3"
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"
+SRC_URI[md5sum] = "38b84416021640b01250c8f8ec4c52d4"
+SRC_URI[sha256sum] = "4f5ba9374a46c98729dd3727d993f5e17ed0286fd6738ed464fe4efa0612d19c"
S = "${WORKDIR}/pycairo-${PV}"
-inherit setuptools3 pkgconfig
+inherit meson 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"
+FILES_${PN} = "${PYTHON_SITEPACKAGES_DIR}/*"
diff --git a/external/poky/meta/recipes-devtools/python/python3-pycryptodome_3.9.7.bb b/external/poky/meta/recipes-devtools/python/python3-pycryptodome_3.9.7.bb
new file mode 100644
index 00000000..8f19984b
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/python/python3-pycryptodome_3.9.7.bb
@@ -0,0 +1,5 @@
+require python-pycryptodome.inc
+inherit setuptools3
+
+SRC_URI[sha256sum] = "f1add21b6d179179b3c177c33d18a2186a09cc0d3af41ff5ed3f377360b869f2"
+
diff --git a/external/poky/meta/recipes-devtools/python/python3-pycryptodomex_3.9.7.bb b/external/poky/meta/recipes-devtools/python/python3-pycryptodomex_3.9.7.bb
new file mode 100644
index 00000000..abb03b99
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/python/python3-pycryptodomex_3.9.7.bb
@@ -0,0 +1,9 @@
+require python-pycryptodome.inc
+inherit setuptools3
+
+SRC_URI[sha256sum] = "50163324834edd0c9ce3e4512ded3e221c969086e10fdd5d3fdcaadac5e24a78"
+
+FILES_${PN}-tests = " \
+ ${PYTHON_SITEPACKAGES_DIR}/Cryptodome/SelfTest/ \
+ ${PYTHON_SITEPACKAGES_DIR}/Cryptodome/SelfTest/__pycache__/ \
+"
diff --git a/external/poky/meta/recipes-devtools/python/python3-pyelftools_0.26.bb b/external/poky/meta/recipes-devtools/python/python3-pyelftools_0.26.bb
new file mode 100644
index 00000000..575dfc4d
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/python/python3-pyelftools_0.26.bb
@@ -0,0 +1,14 @@
+DESCRIPTION = "pyelftools is a pure-Python library for parsing and analyzing ELF files and DWARF debugging information"
+HOMEPAGE = "https://github.com/eliben/pyelftools"
+SECTION = "devel/python"
+LICENSE = "PD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=5ce2a2b07fca326bc7c146d10105ccfc"
+
+SRC_URI[md5sum] = "0ba0de4b47127249c4d632ae299cb0e8"
+SRC_URI[sha256sum] = "86ac6cee19f6c945e8dedf78c6ee74f1112bd14da5a658d8c9d4103aed5756a2"
+
+PYPI_PACKAGE = "pyelftools"
+
+inherit pypi setuptools3
+
+BBCLASSEXTEND = "native"
diff --git a/external/poky/meta/recipes-devtools/python/python3-pygments_2.5.2.bb b/external/poky/meta/recipes-devtools/python/python3-pygments_2.5.2.bb
new file mode 100644
index 00000000..474b9549
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/python/python3-pygments_2.5.2.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Pygments is a syntax highlighting package written in Python."
+DESCRIPTION = "Pygments is a syntax highlighting package written in Python."
+HOMEPAGE = "http://pygments.org/"
+LICENSE = "BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e1d7b7bffbfeaa14083fd2bd3236aea8"
+
+inherit setuptools3
+SRC_URI[md5sum] = "465a35559863089d959d783a69f79b9f"
+SRC_URI[sha256sum] = "98c8aa5a9f778fcd1026a17361ddaf7330d1b7c62ae97c3bb0ae73e0b9b6b0fe"
+
+DEPENDS += "\
+ ${PYTHON_PN} \
+ "
+
+PYPI_PACKAGE = "Pygments"
+
+inherit pypi
+
+BBCLASSEXTEND = "native nativesdk"
+
diff --git a/external/poky/meta/recipes-devtools/python/python3-pygobject/0001-Do-not-build-tests.patch b/external/poky/meta/recipes-devtools/python/python3-pygobject/0001-Do-not-build-tests.patch
new file mode 100644
index 00000000..0f2465bb
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/python/python3-pygobject/0001-Do-not-build-tests.patch
@@ -0,0 +1,30 @@
+From c125a806de951359ab7e302b0584f7c92fa451ad Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 12 Apr 2019 16:25:58 +0200
+Subject: [PATCH] Do not build tests
+
+They require installing tests from g-i, which we do not do.
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 278fa16f..aacbd4a2 100644
+--- a/meson.build
++++ b/meson.build
+@@ -175,6 +175,6 @@ configure_file(input : 'PKG-INFO.in',
+ subdir('gi')
+ subdir('pygtkcompat')
+ with_tests = get_option('tests')
+-if with_tests
+-subdir('tests')
+-endif
++#if with_tests
++#subdir('tests')
++#endif
+--
+2.17.1
+
diff --git a/external/poky/meta/recipes-devtools/python/python3-pygobject_3.28.3.bb b/external/poky/meta/recipes-devtools/python/python3-pygobject_3.34.0.bb
index 313af227..6babf0ca 100644
--- a/external/poky/meta/recipes-devtools/python/python3-pygobject_3.28.3.bb
+++ b/external/poky/meta/recipes-devtools/python/python3-pygobject_3.34.0.bb
@@ -3,27 +3,31 @@ SECTION = "devel/python"
LICENSE = "LGPLv2.1"
LIC_FILES_CHKSUM = "file://COPYING;md5=a916467b91076e631dd8edb7424769c7"
+GNOMEBASEBUILDCLASS = "meson"
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 \
+ file://0001-Do-not-build-tests.patch \
"
+SRC_URI[md5sum] = "ca1dc4f31c1d6d283758e8f315a88ab6"
+SRC_URI[sha256sum] = "87e2c9aa785f352ef111dcc5f63df9b85cf6e05e52ff04f803ffbebdacf5271a"
-SRC_URI[md5sum] = "3bac63c86bb963aa401f97859464aa90"
-SRC_URI[sha256sum] = "3dd3e21015d06e00482ea665fc1733b77e754a6ab656a5db5d7f7bfaf31ad0b0"
+UNKNOWN_CONFIGURE_WHITELIST = "introspection"
S = "${WORKDIR}/${SRCNAME}-${PV}"
PACKAGECONFIG ??= "${@bb.utils.contains_any('DISTRO_FEATURES', [ 'directfb', 'wayland', 'x11' ], 'cairo', '', d)}"
+RDEPENDS_${PN} += "python3-pkgutil"
+
# 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"
+PACKAGECONFIG[cairo] = "-Dpycairo=true,-Dpycairo=false, cairo python3-pycairo, python3-pycairo"
BBCLASSEXTEND = "native"
PACKAGECONFIG_class-native = ""
diff --git a/external/poky/meta/recipes-devtools/python/python-scons-native_3.0.1.bb b/external/poky/meta/recipes-devtools/python/python3-scons-native_3.1.2.bb
index 68b63c93..9e127304 100644
--- a/external/poky/meta/recipes-devtools/python/python-scons-native_3.0.1.bb
+++ b/external/poky/meta/recipes-devtools/python/python3-scons-native_3.1.2.bb
@@ -1,7 +1,6 @@
-require python-scons_${PV}.bb
-inherit native pythonnative
-DEPENDS = "python-native"
-RDEPENDS_${PN} = ""
+require python3-scons_${PV}.bb
+inherit native python3native
+DEPENDS = "python3-native python3-setuptools-native"
do_install_append() {
create_wrapper ${D}${bindir}/scons SCONS_LIB_DIR='${STAGING_DIR_HOST}/${PYTHON_SITEPACKAGES_DIR}' PYTHONNOUSERSITE='1'
diff --git a/external/poky/meta/recipes-devtools/python/python3-scons_3.1.2.bb b/external/poky/meta/recipes-devtools/python/python3-scons_3.1.2.bb
new file mode 100644
index 00000000..ce117a92
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/python/python3-scons_3.1.2.bb
@@ -0,0 +1,33 @@
+SUMMARY = "Software Construction tool (make/autotools replacement)"
+SECTION = "devel/python"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE-python3-scons-${PV};md5=e14e1b33428df24a40a782ae142785d0"
+
+# pypi package does not have a valid license file
+SRC_URI += "https://raw.githubusercontent.com/SCons/scons/${PV}/LICENSE;downloadfilename=LICENSE-python3-scons-${PV};name=license"
+
+SRC_URI[md5sum] = "f9c4ad06dcf1427be95472eaf380c81a"
+SRC_URI[sha256sum] = "8aaa483c303efeb678e6f7c776c8444a482f8ddc3ad891f8b6cdd35264da9a1f"
+SRC_URI[license.md5sum] = "e14e1b33428df24a40a782ae142785d0"
+SRC_URI[license.sha256sum] = "72ed889165fb28378cadac14552be4a959f1ebab6b148abb5dd2b49712c3c6f6"
+
+S = "${WORKDIR}/scons-${PV}"
+
+UPSTREAM_CHECK_URI = "http://scons.org/pages/download.html"
+UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.tar"
+
+inherit pypi setuptools3
+
+do_install_prepend() {
+ sed -i -e "1s,#!.*python.*,#!${USRBINPATH}/env python3," ${S}/script/*
+}
+
+RDEPENDS_${PN}_class-target = "\
+ python3-core \
+ python3-fcntl \
+ python3-io \
+ python3-json \
+ python3-shell \
+ python3-pickle \
+ python3-pprint \
+ "
diff --git a/external/poky/meta/recipes-devtools/python/python3-setuptools_40.0.0.bb b/external/poky/meta/recipes-devtools/python/python3-setuptools_45.2.0.bb
index 0dc1ed86..0dc1ed86 100644
--- a/external/poky/meta/recipes-devtools/python/python3-setuptools_40.0.0.bb
+++ b/external/poky/meta/recipes-devtools/python/python3-setuptools_45.2.0.bb
diff --git a/external/poky/meta/recipes-devtools/python/python3-six_1.11.0.bb b/external/poky/meta/recipes-devtools/python/python3-six_1.11.0.bb
deleted file mode 100644
index 8795313b..00000000
--- a/external/poky/meta/recipes-devtools/python/python3-six_1.11.0.bb
+++ /dev/null
@@ -1,2 +0,0 @@
-inherit setuptools3
-require python-six.inc
diff --git a/external/poky/meta/recipes-devtools/python/python3-six_1.14.0.bb b/external/poky/meta/recipes-devtools/python/python3-six_1.14.0.bb
new file mode 100644
index 00000000..151c366c
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/python/python3-six_1.14.0.bb
@@ -0,0 +1,5 @@
+inherit setuptools3
+require python-six.inc
+
+SRC_URI[md5sum] = "21674588a57e649d1a6d977ec3122140"
+SRC_URI[sha256sum] = "236bdbdce46e6e6a3d61a337c0f8b763ca1e8717c03b369e87a7ec7ce1319c0a"
diff --git a/external/poky/meta/recipes-devtools/python/python3-smmap_0.9.0.bb b/external/poky/meta/recipes-devtools/python/python3-smmap_2.0.5.bb
index e87b8df8..e87b8df8 100644
--- a/external/poky/meta/recipes-devtools/python/python3-smmap_0.9.0.bb
+++ b/external/poky/meta/recipes-devtools/python/python3-smmap_2.0.5.bb
diff --git a/external/poky/meta/recipes-devtools/python/python3-subunit_1.3.0.bb b/external/poky/meta/recipes-devtools/python/python3-subunit_1.3.0.bb
index 2ece4451..55066e2d 100644
--- a/external/poky/meta/recipes-devtools/python/python3-subunit_1.3.0.bb
+++ b/external/poky/meta/recipes-devtools/python/python3-subunit_1.3.0.bb
@@ -1,2 +1,4 @@
inherit setuptools3
require python-subunit.inc
+
+RDEPENDS_${PN} = " python3-testtools"
diff --git a/external/poky/meta/recipes-devtools/python/python3-testtools/no_traceback2.patch b/external/poky/meta/recipes-devtools/python/python3-testtools/no_traceback2.patch
new file mode 100644
index 00000000..59451034
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/python/python3-testtools/no_traceback2.patch
@@ -0,0 +1,23 @@
+traceback2 adds traceback for python2. Rather than depend on traceback2, we're
+python3 only so just use traceback.
+This caused breakage in oe-selftest -j which uses testtools on the autobuilder
+using buildtools-tarball.
+
+Upstream-Status: Inappropriate [Our recipe is python3 specific]
+(Once py2 is EOL upstream probably could/should take this)
+Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+
+Index: testtools-2.3.0/testtools/content.py
+===================================================================
+--- testtools-2.3.0.orig/testtools/content.py
++++ testtools-2.3.0/testtools/content.py
+@@ -19,8 +19,7 @@ import os
+ import sys
+
+ from extras import try_import
+-# To let setup.py work, make this a conditional import.
+-traceback = try_import('traceback2')
++import traceback
+
+ from testtools.compat import (
+ _b,
diff --git a/external/poky/meta/recipes-devtools/python/python3-testtools_2.3.0.bb b/external/poky/meta/recipes-devtools/python/python3-testtools_2.3.0.bb
index 896ecee6..a254b90a 100644
--- a/external/poky/meta/recipes-devtools/python/python3-testtools_2.3.0.bb
+++ b/external/poky/meta/recipes-devtools/python/python3-testtools_2.3.0.bb
@@ -1,2 +1,4 @@
inherit setuptools3
require python-testtools.inc
+
+SRC_URI += "file://no_traceback2.patch"
diff --git a/external/poky/meta/recipes-devtools/python/python3.inc b/external/poky/meta/recipes-devtools/python/python3.inc
deleted file mode 100644
index f565b3f1..00000000
--- a/external/poky/meta/recipes-devtools/python/python3.inc
+++ /dev/null
@@ -1,43 +0,0 @@
-SUMMARY = "The Python Programming Language"
-HOMEPAGE = "http://www.python.org"
-LICENSE = "PSFv2"
-SECTION = "devel/python"
-
-# TODO Remove this when we upgrade
-INC_PR = "r1"
-PR = "${INC_PR}.0"
-
-LIC_FILES_CHKSUM = "file://LICENSE;md5=b6ec515b22618f55fa07276b897bacea"
-
-# TODO consolidate patch set
-SRC_URI[md5sum] = "f5a99f765e765336a3ebbb2a24ca2be3"
-SRC_URI[sha256sum] = "f55cde04f521f273c7cba08912921cc5642cfc15ca7b22d5829f0aff4371155f"
-
-# exclude pre-releases for both python 2.x and 3.x
-UPSTREAM_CHECK_REGEX = "[Pp]ython-(?P<pver>\d+(\.\d+)+).tar"
-
-CVE_PRODUCT = "python"
-
-PYTHON_MAJMIN = "3.5"
-PYTHON_BINABI = "${PYTHON_MAJMIN}m"
-
-S = "${WORKDIR}/Python-${PV}"
-
-inherit autotools bluetooth 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)} \
-"
-
-PACKAGECONFIG[bluetooth] = ",ac_cv_header_bluetooth_bluetooth_h=no ac_cv_header_bluetooth_h=no,${BLUEZ}"
-
-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/external/poky/meta/recipes-devtools/python/python3/0001-Do-not-add-usr-lib-termcap-to-linker-flags-to-avoid-.patch b/external/poky/meta/recipes-devtools/python/python3/0001-Do-not-add-usr-lib-termcap-to-linker-flags-to-avoid-.patch
new file mode 100644
index 00000000..59592821
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/python/python3/0001-Do-not-add-usr-lib-termcap-to-linker-flags-to-avoid-.patch
@@ -0,0 +1,25 @@
+From 039c53dd5baddec3359a05be0bff46a3b32bbb84 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 25 Jan 2019 19:04:13 +0100
+Subject: [PATCH] Do not add /usr/lib/termcap to linker flags to avoid host
+ contamination
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ setup.py | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/setup.py b/setup.py
+index 20d7f35..ab18ff0 100644
+--- a/setup.py
++++ b/setup.py
+@@ -957,7 +957,6 @@ class PyBuildExt(build_ext):
+ 'termcap'):
+ readline_libs.append('termcap')
+ self.add(Extension('readline', ['readline.c'],
+- library_dirs=['/usr/lib/termcap'],
+ extra_link_args=readline_extra_link_args,
+ libraries=readline_libs))
+ else:
diff --git a/external/poky/meta/recipes-devtools/python/python3/0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch b/external/poky/meta/recipes-devtools/python/python3/0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch
new file mode 100644
index 00000000..112c9794
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/python/python3/0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch
@@ -0,0 +1,214 @@
+From a078b6ff1492e848ad1055764fb9a414abaf3e12 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Tue, 5 Feb 2019 15:52:02 +0100
+Subject: [PATCH] Do not hardcode "lib" as location for modules, site-packages
+ and lib-dynload
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ Include/pythonrun.h | 2 ++
+ Lib/site.py | 4 ++--
+ Makefile.pre.in | 5 +++--
+ Modules/getpath.c | 22 ++++++++++++++--------
+ Python/getplatform.c | 10 ++++++++++
+ Python/sysmodule.c | 2 ++
+ 6 files changed, 33 insertions(+), 12 deletions(-)
+
+diff --git a/Include/pythonrun.h b/Include/pythonrun.h
+index 46091e0..61b2e15 100644
+--- a/Include/pythonrun.h
++++ b/Include/pythonrun.h
+@@ -7,6 +7,8 @@
+ extern "C" {
+ #endif
+
++PyAPI_FUNC(const char *) Py_GetLib(void);
++
+ #ifndef Py_LIMITED_API
+ PyAPI_FUNC(int) PyRun_SimpleStringFlags(const char *, PyCompilerFlags *);
+ PyAPI_FUNC(int) PyRun_AnyFileExFlags(
+diff --git a/Lib/site.py b/Lib/site.py
+index a065ab0..1d720ef 100644
+--- a/Lib/site.py
++++ b/Lib/site.py
+@@ -335,12 +335,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%d.%d" % sys.version_info[:2],
+ "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"))
+ return sitepackages
+
+ def addsitepackages(known_paths, prefixes=None):
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index 65665df..be49140 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -143,7 +143,7 @@ LIBDIR= @libdir@
+ MANDIR= @mandir@
+ INCLUDEDIR= @includedir@
+ CONFINCLUDEDIR= $(exec_prefix)/include
+-SCRIPTDIR= $(prefix)/lib
++SCRIPTDIR= @libdir@
+ ABIFLAGS= @ABIFLAGS@
+
+ # Detailed destination directories
+@@ -753,6 +753,7 @@ Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
+ -DEXEC_PREFIX='"$(exec_prefix)"' \
+ -DVERSION='"$(VERSION)"' \
+ -DVPATH='"$(VPATH)"' \
++ -DLIB='"$(LIB)"' \
+ -o $@ $(srcdir)/Modules/getpath.c
+
+ Programs/python.o: $(srcdir)/Programs/python.c
+@@ -868,7 +869,7 @@ regen-symbol: $(srcdir)/Include/graminit.h
+ Python/compile.o Python/symtable.o Python/ast_unparse.o Python/ast.o Python/future.o Parser/parsetok.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)"' -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
+diff --git a/Modules/getpath.c b/Modules/getpath.c
+index b727f66..c003e46 100644
+--- a/Modules/getpath.c
++++ b/Modules/getpath.c
+@@ -128,6 +128,7 @@ typedef struct {
+ wchar_t *exec_prefix; /* EXEC_PREFIX macro */
+
+ wchar_t *lib_python; /* "lib/pythonX.Y" */
++ wchar_t *multilib_python; /* "lib[suffix]/pythonX.Y" */
+
+ int prefix_found; /* found platform independent libraries? */
+ int exec_prefix_found; /* found the platform dependent libraries? */
+@@ -386,7 +387,7 @@ search_for_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig,
+ if (delim) {
+ *delim = L'\0';
+ }
+- status = joinpath(prefix, calculate->lib_python, prefix_len);
++ status = joinpath(prefix, calculate->multilib_python, prefix_len);
+ if (_PyStatus_EXCEPTION(status)) {
+ return status;
+ }
+@@ -444,7 +445,7 @@ search_for_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig,
+ do {
+ /* Path: <argv0_path or substring> / <lib_python> / LANDMARK */
+ size_t n = wcslen(prefix);
+- status = joinpath(prefix, calculate->lib_python, prefix_len);
++ status = joinpath(prefix, calculate->multilib_python, prefix_len);
+ if (_PyStatus_EXCEPTION(status)) {
+ return status;
+ }
+@@ -467,7 +468,7 @@ search_for_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig,
+ if (safe_wcscpy(prefix, calculate->prefix, prefix_len) < 0) {
+ return PATHLEN_ERR();
+ }
+- status = joinpath(prefix, calculate->lib_python, prefix_len);
++ status = joinpath(prefix, calculate->multilib_python, prefix_len);
+ if (_PyStatus_EXCEPTION(status)) {
+ return status;
+ }
+@@ -510,7 +511,7 @@ calculate_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig,
+ if (safe_wcscpy(prefix, calculate->prefix, prefix_len) < 0) {
+ return PATHLEN_ERR();
+ }
+- status = joinpath(prefix, calculate->lib_python, prefix_len);
++ status = joinpath(prefix, calculate->multilib_python, prefix_len);
+ if (_PyStatus_EXCEPTION(status)) {
+ return status;
+ }
+@@ -635,7 +636,7 @@ search_for_exec_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig,
+ return PATHLEN_ERR();
+ }
+ }
+- status = joinpath(exec_prefix, calculate->lib_python, exec_prefix_len);
++ status = joinpath(exec_prefix, calculate->multilib_python, exec_prefix_len);
+ if (_PyStatus_EXCEPTION(status)) {
+ return status;
+ }
+@@ -667,7 +668,7 @@ search_for_exec_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig,
+ do {
+ /* Path: <argv0_path or substring> / <lib_python> / "lib-dynload" */
+ size_t n = wcslen(exec_prefix);
+- status = joinpath(exec_prefix, calculate->lib_python, exec_prefix_len);
++ status = joinpath(exec_prefix, calculate->multilib_python, exec_prefix_len);
+ if (_PyStatus_EXCEPTION(status)) {
+ return status;
+ }
+@@ -689,7 +690,7 @@ search_for_exec_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig,
+ if (safe_wcscpy(exec_prefix, calculate->exec_prefix, exec_prefix_len) < 0) {
+ return PATHLEN_ERR();
+ }
+- status = joinpath(exec_prefix, calculate->lib_python, exec_prefix_len);
++ status = joinpath(exec_prefix, calculate->multilib_python, exec_prefix_len);
+ if (_PyStatus_EXCEPTION(status)) {
+ return status;
+ }
+@@ -928,7 +929,7 @@ calculate_argv0_path(PyCalculatePath *calculate, const wchar_t *program_full_pat
+ return PATHLEN_ERR();
+ }
+ reduce(argv0_path);
+- status = joinpath(argv0_path, calculate->lib_python, argv0_path_len);
++ status = joinpath(argv0_path, calculate->multilib_python, argv0_path_len);
+ if (_PyStatus_EXCEPTION(status)) {
+ PyMem_RawFree(wbuf);
+ return status;
+@@ -1201,6 +1202,10 @@ calculate_init(PyCalculatePath *calculate, const PyConfig *config)
+ if (!calculate->lib_python) {
+ return DECODE_LOCALE_ERR("EXEC_PREFIX define", len);
+ }
++ calculate->multilib_python = Py_DecodeLocale(LIB "/python" VERSION, &len);
++ if (!calculate->multilib_python) {
++ return DECODE_LOCALE_ERR("EXEC_PREFIX define", len);
++ }
+
+ calculate->warnings = config->pathconfig_warnings;
+ calculate->pythonpath_env = config->pythonpath_env;
+@@ -1216,6 +1221,7 @@ calculate_free(PyCalculatePath *calculate)
+ PyMem_RawFree(calculate->prefix);
+ PyMem_RawFree(calculate->exec_prefix);
+ PyMem_RawFree(calculate->lib_python);
++ PyMem_RawFree(calculate->multilib_python);
+ PyMem_RawFree(calculate->path_env);
+ }
+
+diff --git a/Python/getplatform.c b/Python/getplatform.c
+index 81a0f7a..d55396b 100644
+--- a/Python/getplatform.c
++++ b/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;
++}
+diff --git a/Python/sysmodule.c b/Python/sysmodule.c
+index 5b0fb81..0dce754 100644
+--- a/Python/sysmodule.c
++++ b/Python/sysmodule.c
+@@ -2668,6 +2668,8 @@ _PySys_InitCore(_PyRuntimeState *runtime, PyInterpreterState *interp,
+ PyUnicode_FromString(Py_GetCopyright()));
+ SET_SYS_FROM_STRING("platform",
+ PyUnicode_FromString(Py_GetPlatform()));
++ SET_SYS_FROM_STRING("lib",
++ PyUnicode_FromString(Py_GetLib()));
+ SET_SYS_FROM_STRING("maxsize",
+ PyLong_FromSsize_t(PY_SSIZE_T_MAX));
+ SET_SYS_FROM_STRING("float_info",
diff --git a/external/poky/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch b/external/poky/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch
index 8ea3f03f..83fd52d8 100644
--- a/external/poky/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch
+++ b/external/poky/meta/recipes-devtools/python/python3/0001-Do-not-use-the-shell-version-of-python-config-that-w.patch
@@ -1,6 +1,6 @@
-From 04df959365e2b54d7503edf0e5534ff094284f2d Mon Sep 17 00:00:00 2001
+From 148861fa16f2aaacd518770f337ea54b5182f981 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex.kanavin@gmail.com>
-Date: Fri, 23 Oct 2015 12:25:09 +0300
+Date: Tue, 29 Jan 2019 15:03:01 +0100
Subject: [PATCH] Do not use the shell version of python-config that was
introduced in 3.4
@@ -14,25 +14,22 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/Makefile.pre.in b/Makefile.pre.in
-index 236f005..5c4337f 100644
+index 2d2e11f..cc19942 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
-@@ -1348,12 +1348,9 @@ python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh
+@@ -1431,12 +1431,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}
+ @ # 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 \
+- @ # 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
++ @ # 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/external/poky/meta/recipes-devtools/python/python3/0001-Don-t-search-system-for-headers-libraries.patch b/external/poky/meta/recipes-devtools/python/python3/0001-Don-t-search-system-for-headers-libraries.patch
new file mode 100644
index 00000000..acf8e1e9
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/python/python3/0001-Don-t-search-system-for-headers-libraries.patch
@@ -0,0 +1,29 @@
+From 85e8f86ad2b7dec0848cd55b8e810a5e2722b20a Mon Sep 17 00:00:00 2001
+From: Jeremy Puhlman <jpuhlman@mvista.com>
+Date: Wed, 4 Mar 2020 00:06:42 +0000
+Subject: [PATCH] Don't search system for headers/libraries
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Jeremy Puhlman <jpuhlman@mvista.com>
+---
+ setup.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index 9da1b3a..59782c0 100644
+--- a/setup.py
++++ b/setup.py
+@@ -674,8 +674,8 @@ class PyBuildExt(build_ext):
+ add_dir_to_list(self.compiler.include_dirs,
+ sysconfig.get_config_var("INCLUDEDIR"))
+
+- system_lib_dirs = ['/lib64', '/usr/lib64', '/lib', '/usr/lib']
+- system_include_dirs = ['/usr/include']
++ system_lib_dirs = []
++ system_include_dirs = []
+ # lib_dirs and inc_dirs are used to search for files;
+ # if a file is found in one of those directories, it can
+ # be assumed that no additional -I,-L directives are needed.
+--
+2.24.1
+
diff --git a/external/poky/meta/recipes-devtools/python/python3/0001-Issue-21272-Use-_sysconfigdata.py-to-initialize-dist.patch b/external/poky/meta/recipes-devtools/python/python3/0001-Issue-21272-Use-_sysconfigdata.py-to-initialize-dist.patch
deleted file mode 100644
index d1c92e9e..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/0001-Issue-21272-Use-_sysconfigdata.py-to-initialize-dist.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python3/0001-Issue-28043-SSLContext-has-improved-default-settings.patch b/external/poky/meta/recipes-devtools/python/python3/0001-Issue-28043-SSLContext-has-improved-default-settings.patch
deleted file mode 100644
index 321b4afa..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/0001-Issue-28043-SSLContext-has-improved-default-settings.patch
+++ /dev/null
@@ -1,272 +0,0 @@
-From 758e7463c104f71b810c8588166747eeab6148d7 Mon Sep 17 00:00:00 2001
-From: Christian Heimes <christian@python.org>
-Date: Sat, 10 Sep 2016 22:43:48 +0200
-Subject: [PATCH 1/4] Issue 28043: SSLContext has improved default settings
-
-The options OP_NO_COMPRESSION, OP_CIPHER_SERVER_PREFERENCE, OP_SINGLE_DH_USE, OP_SINGLE_ECDH_USE, OP_NO_SSLv2 (except for PROTOCOL_SSLv2), and OP_NO_SSLv3 (except for PROTOCOL_SSLv3) are set by default. The initial cipher suite list contains only HIGH ciphers, no NULL ciphers and MD5 ciphers (except for PROTOCOL_SSLv2).
-
-Upstream-Status: Backport
-[https://github.com/python/cpython/commit/358cfd426ccc0fcd6a7940d306602138e76420ae]
-
-Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
----
- Doc/library/ssl.rst | 9 ++++++-
- Lib/ssl.py | 30 +++++----------------
- Lib/test/test_ssl.py | 62 +++++++++++++++++++++++---------------------
- Modules/_ssl.c | 31 ++++++++++++++++++++++
- 4 files changed, 78 insertions(+), 54 deletions(-)
-
-diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst
-index a2f008346b..14f2d68217 100644
---- a/Doc/library/ssl.rst
-+++ b/Doc/library/ssl.rst
-@@ -1151,7 +1151,14 @@ to speed up repeated connections from the same clients.
-
- .. versionchanged:: 3.5.3
-
-- :data:`PROTOCOL_TLS` is the default value.
-+ The context is created with secure default values. The options
-+ :data:`OP_NO_COMPRESSION`, :data:`OP_CIPHER_SERVER_PREFERENCE`,
-+ :data:`OP_SINGLE_DH_USE`, :data:`OP_SINGLE_ECDH_USE`,
-+ :data:`OP_NO_SSLv2` (except for :data:`PROTOCOL_SSLv2`),
-+ and :data:`OP_NO_SSLv3` (except for :data:`PROTOCOL_SSLv3`) are
-+ set by default. The initial cipher suite list contains only ``HIGH``
-+ ciphers, no ``NULL`` ciphers and no ``MD5`` ciphers (except for
-+ :data:`PROTOCOL_SSLv2`).
-
-
- :class:`SSLContext` objects have the following methods and attributes:
-diff --git a/Lib/ssl.py b/Lib/ssl.py
-index e1913904f3..4d302a78fa 100644
---- a/Lib/ssl.py
-+++ b/Lib/ssl.py
-@@ -446,32 +446,16 @@ def create_default_context(purpose=Purpose.SERVER_AUTH, *, cafile=None,
- if not isinstance(purpose, _ASN1Object):
- raise TypeError(purpose)
-
-+ # SSLContext sets OP_NO_SSLv2, OP_NO_SSLv3, OP_NO_COMPRESSION,
-+ # OP_CIPHER_SERVER_PREFERENCE, OP_SINGLE_DH_USE and OP_SINGLE_ECDH_USE
-+ # by default.
- context = SSLContext(PROTOCOL_TLS)
-
-- # SSLv2 considered harmful.
-- context.options |= OP_NO_SSLv2
--
-- # SSLv3 has problematic security and is only required for really old
-- # clients such as IE6 on Windows XP
-- context.options |= OP_NO_SSLv3
--
-- # disable compression to prevent CRIME attacks (OpenSSL 1.0+)
-- context.options |= getattr(_ssl, "OP_NO_COMPRESSION", 0)
--
- if purpose == Purpose.SERVER_AUTH:
- # verify certs and host name in client mode
- context.verify_mode = CERT_REQUIRED
- context.check_hostname = True
- elif purpose == Purpose.CLIENT_AUTH:
-- # Prefer the server's ciphers by default so that we get stronger
-- # encryption
-- context.options |= getattr(_ssl, "OP_CIPHER_SERVER_PREFERENCE", 0)
--
-- # Use single use keys in order to improve forward secrecy
-- context.options |= getattr(_ssl, "OP_SINGLE_DH_USE", 0)
-- context.options |= getattr(_ssl, "OP_SINGLE_ECDH_USE", 0)
--
-- # disallow ciphers with known vulnerabilities
- context.set_ciphers(_RESTRICTED_SERVER_CIPHERS)
-
- if cafile or capath or cadata:
-@@ -497,12 +481,10 @@ def _create_unverified_context(protocol=PROTOCOL_TLS, *, cert_reqs=None,
- if not isinstance(purpose, _ASN1Object):
- raise TypeError(purpose)
-
-+ # SSLContext sets OP_NO_SSLv2, OP_NO_SSLv3, OP_NO_COMPRESSION,
-+ # OP_CIPHER_SERVER_PREFERENCE, OP_SINGLE_DH_USE and OP_SINGLE_ECDH_USE
-+ # by default.
- context = SSLContext(protocol)
-- # SSLv2 considered harmful.
-- context.options |= OP_NO_SSLv2
-- # SSLv3 has problematic security and is only required for really old
-- # clients such as IE6 on Windows XP
-- context.options |= OP_NO_SSLv3
-
- if cert_reqs is not None:
- context.verify_mode = cert_reqs
-diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
-index ffb7314f57..f91af7bd05 100644
---- a/Lib/test/test_ssl.py
-+++ b/Lib/test/test_ssl.py
-@@ -73,6 +73,12 @@ NULLBYTECERT = data_file("nullbytecert.pem")
- DHFILE = data_file("dh1024.pem")
- BYTES_DHFILE = os.fsencode(DHFILE)
-
-+# Not defined in all versions of OpenSSL
-+OP_NO_COMPRESSION = getattr(ssl, "OP_NO_COMPRESSION", 0)
-+OP_SINGLE_DH_USE = getattr(ssl, "OP_SINGLE_DH_USE", 0)
-+OP_SINGLE_ECDH_USE = getattr(ssl, "OP_SINGLE_ECDH_USE", 0)
-+OP_CIPHER_SERVER_PREFERENCE = getattr(ssl, "OP_CIPHER_SERVER_PREFERENCE", 0)
-+
-
- def handle_error(prefix):
- exc_format = ' '.join(traceback.format_exception(*sys.exc_info()))
-@@ -839,8 +845,9 @@ class ContextTests(unittest.TestCase):
- ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
- # OP_ALL | OP_NO_SSLv2 | OP_NO_SSLv3 is the default value
- default = (ssl.OP_ALL | ssl.OP_NO_SSLv2 | ssl.OP_NO_SSLv3)
-- if not IS_LIBRESSL and ssl.OPENSSL_VERSION_INFO >= (1, 1, 0):
-- default |= ssl.OP_NO_COMPRESSION
-+ # SSLContext also enables these by default
-+ default |= (OP_NO_COMPRESSION | OP_CIPHER_SERVER_PREFERENCE |
-+ OP_SINGLE_DH_USE | OP_SINGLE_ECDH_USE)
- self.assertEqual(default, ctx.options)
- ctx.options |= ssl.OP_NO_TLSv1
- self.assertEqual(default | ssl.OP_NO_TLSv1, ctx.options)
-@@ -1205,16 +1212,29 @@ class ContextTests(unittest.TestCase):
- stats["x509"] += 1
- self.assertEqual(ctx.cert_store_stats(), stats)
-
-+ def _assert_context_options(self, ctx):
-+ self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2)
-+ if OP_NO_COMPRESSION != 0:
-+ self.assertEqual(ctx.options & OP_NO_COMPRESSION,
-+ OP_NO_COMPRESSION)
-+ if OP_SINGLE_DH_USE != 0:
-+ self.assertEqual(ctx.options & OP_SINGLE_DH_USE,
-+ OP_SINGLE_DH_USE)
-+ if OP_SINGLE_ECDH_USE != 0:
-+ self.assertEqual(ctx.options & OP_SINGLE_ECDH_USE,
-+ OP_SINGLE_ECDH_USE)
-+ if OP_CIPHER_SERVER_PREFERENCE != 0:
-+ self.assertEqual(ctx.options & OP_CIPHER_SERVER_PREFERENCE,
-+ OP_CIPHER_SERVER_PREFERENCE)
-+
- def test_create_default_context(self):
- ctx = ssl.create_default_context()
-+
- self.assertEqual(ctx.protocol, ssl.PROTOCOL_SSLv23)
- self.assertEqual(ctx.verify_mode, ssl.CERT_REQUIRED)
- self.assertTrue(ctx.check_hostname)
-- self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2)
-- self.assertEqual(
-- ctx.options & getattr(ssl, "OP_NO_COMPRESSION", 0),
-- getattr(ssl, "OP_NO_COMPRESSION", 0),
-- )
-+ self._assert_context_options(ctx)
-+
-
- with open(SIGNING_CA) as f:
- cadata = f.read()
-@@ -1222,40 +1242,24 @@ class ContextTests(unittest.TestCase):
- cadata=cadata)
- self.assertEqual(ctx.protocol, ssl.PROTOCOL_SSLv23)
- self.assertEqual(ctx.verify_mode, ssl.CERT_REQUIRED)
-- self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2)
-- self.assertEqual(
-- ctx.options & getattr(ssl, "OP_NO_COMPRESSION", 0),
-- getattr(ssl, "OP_NO_COMPRESSION", 0),
-- )
-+ self._assert_context_options(ctx)
-
- ctx = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
- self.assertEqual(ctx.protocol, ssl.PROTOCOL_SSLv23)
- self.assertEqual(ctx.verify_mode, ssl.CERT_NONE)
-- self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2)
-- self.assertEqual(
-- ctx.options & getattr(ssl, "OP_NO_COMPRESSION", 0),
-- getattr(ssl, "OP_NO_COMPRESSION", 0),
-- )
-- self.assertEqual(
-- ctx.options & getattr(ssl, "OP_SINGLE_DH_USE", 0),
-- getattr(ssl, "OP_SINGLE_DH_USE", 0),
-- )
-- self.assertEqual(
-- ctx.options & getattr(ssl, "OP_SINGLE_ECDH_USE", 0),
-- getattr(ssl, "OP_SINGLE_ECDH_USE", 0),
-- )
-+ self._assert_context_options(ctx)
-
- def test__create_stdlib_context(self):
- ctx = ssl._create_stdlib_context()
- self.assertEqual(ctx.protocol, ssl.PROTOCOL_SSLv23)
- self.assertEqual(ctx.verify_mode, ssl.CERT_NONE)
- self.assertFalse(ctx.check_hostname)
-- self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2)
-+ self._assert_context_options(ctx)
-
- ctx = ssl._create_stdlib_context(ssl.PROTOCOL_TLSv1)
- self.assertEqual(ctx.protocol, ssl.PROTOCOL_TLSv1)
- self.assertEqual(ctx.verify_mode, ssl.CERT_NONE)
-- self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2)
-+ self._assert_context_options(ctx)
-
- ctx = ssl._create_stdlib_context(ssl.PROTOCOL_TLSv1,
- cert_reqs=ssl.CERT_REQUIRED,
-@@ -1263,12 +1267,12 @@ class ContextTests(unittest.TestCase):
- self.assertEqual(ctx.protocol, ssl.PROTOCOL_TLSv1)
- self.assertEqual(ctx.verify_mode, ssl.CERT_REQUIRED)
- self.assertTrue(ctx.check_hostname)
-- self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2)
-+ self._assert_context_options(ctx)
-
- ctx = ssl._create_stdlib_context(purpose=ssl.Purpose.CLIENT_AUTH)
- self.assertEqual(ctx.protocol, ssl.PROTOCOL_SSLv23)
- self.assertEqual(ctx.verify_mode, ssl.CERT_NONE)
-- self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2)
-+ self._assert_context_options(ctx)
-
- def test_check_hostname(self):
- ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
-diff --git a/Modules/_ssl.c b/Modules/_ssl.c
-index 86482677ae..0d5c121d2c 100644
---- a/Modules/_ssl.c
-+++ b/Modules/_ssl.c
-@@ -2330,6 +2330,7 @@ _ssl__SSLContext_impl(PyTypeObject *type, int proto_version)
- PySSLContext *self;
- long options;
- SSL_CTX *ctx = NULL;
-+ int result;
- #if defined(SSL_MODE_RELEASE_BUFFERS)
- unsigned long libver;
- #endif
-@@ -2393,8 +2394,38 @@ _ssl__SSLContext_impl(PyTypeObject *type, int proto_version)
- options |= SSL_OP_NO_SSLv2;
- if (proto_version != PY_SSL_VERSION_SSL3)
- options |= SSL_OP_NO_SSLv3;
-+ /* Minimal security flags for server and client side context.
-+ * Client sockets ignore server-side parameters. */
-+#ifdef SSL_OP_NO_COMPRESSION
-+ options |= SSL_OP_NO_COMPRESSION;
-+#endif
-+#ifdef SSL_OP_CIPHER_SERVER_PREFERENCE
-+ options |= SSL_OP_CIPHER_SERVER_PREFERENCE;
-+#endif
-+#ifdef SSL_OP_SINGLE_DH_USE
-+ options |= SSL_OP_SINGLE_DH_USE;
-+#endif
-+#ifdef SSL_OP_SINGLE_ECDH_USE
-+ options |= SSL_OP_SINGLE_ECDH_USE;
-+#endif
- SSL_CTX_set_options(self->ctx, options);
-
-+ /* A bare minimum cipher list without completly broken cipher suites.
-+ * It's far from perfect but gives users a better head start. */
-+ if (proto_version != PY_SSL_VERSION_SSL2) {
-+ result = SSL_CTX_set_cipher_list(ctx, "HIGH:!aNULL:!eNULL:!MD5");
-+ } else {
-+ /* SSLv2 needs MD5 */
-+ result = SSL_CTX_set_cipher_list(ctx, "HIGH:!aNULL:!eNULL");
-+ }
-+ if (result == 0) {
-+ Py_DECREF(self);
-+ ERR_clear_error();
-+ PyErr_SetString(PySSLErrorObject,
-+ "No cipher can be selected.");
-+ return NULL;
-+ }
-+
- #if defined(SSL_MODE_RELEASE_BUFFERS)
- /* Set SSL_MODE_RELEASE_BUFFERS. This potentially greatly reduces memory
- usage for no cost at all. However, don't do this for OpenSSL versions
---
-2.17.1
-
diff --git a/external/poky/meta/recipes-devtools/python/python3/0001-Lib-sysconfig.py-fix-another-place-where-lib-is-hard.patch b/external/poky/meta/recipes-devtools/python/python3/0001-Lib-sysconfig.py-fix-another-place-where-lib-is-hard.patch
new file mode 100644
index 00000000..b9758368
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/python/python3/0001-Lib-sysconfig.py-fix-another-place-where-lib-is-hard.patch
@@ -0,0 +1,31 @@
+From a21f4f8fa5e5c0601898740b4ac08ec84f41e190 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 18 Apr 2019 17:11:06 +0200
+Subject: [PATCH] Lib/sysconfig.py: fix another place where 'lib' is hardcoded
+ as the library path
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ Lib/sysconfig.py | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
+index d15cec8..87fa5e6 100644
+--- a/Lib/sysconfig.py
++++ b/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': '{LIBDEST}',
++ 'platstdlib': '{LIBDEST}',
++ 'purelib': '{LIBDEST}/site-packages',
++ 'platlib': '{LIBDEST}/site-packages',
+ 'include':
+ '{installed_base}/include/python{py_version_short}{abiflags}',
+ 'platinclude':
diff --git a/external/poky/meta/recipes-devtools/python/python3/0001-Makefile-do-not-compile-.pyc-in-parallel.patch b/external/poky/meta/recipes-devtools/python/python3/0001-Makefile-do-not-compile-.pyc-in-parallel.patch
new file mode 100644
index 00000000..b1bceac5
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/python/python3/0001-Makefile-do-not-compile-.pyc-in-parallel.patch
@@ -0,0 +1,58 @@
+From c501e121a872cbcef8ffe626c1de173a125be9f8 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 16 Jan 2020 12:34:20 +0100
+Subject: [PATCH] Makefile: do not compile .pyc in parallel
+
+This was found to break reproducibility, and produce strange file ownership
+races.
+
+The upstream commit introducing the change was:
+https://github.com/python/cpython/commit/1a2dd82f56bd813aacc570e172cefe55a8a41504
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ Makefile.pre.in | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index 1241112..5dfdf44 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -1457,30 +1457,30 @@ libinstall: build_all $(srcdir)/Modules/xxmodule.c
+ fi
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+ $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
+- -j0 -d $(LIBDEST) -f \
++ -d $(LIBDEST) -f \
+ -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+ $(DESTDIR)$(LIBDEST)
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+ $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
+- -j0 -d $(LIBDEST) -f \
++ -d $(LIBDEST) -f \
+ -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+ $(DESTDIR)$(LIBDEST)
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+ $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \
+- -j0 -d $(LIBDEST) -f \
++ -d $(LIBDEST) -f \
+ -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+ $(DESTDIR)$(LIBDEST)
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+ $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
+- -j0 -d $(LIBDEST)/site-packages -f \
++ -d $(LIBDEST)/site-packages -f \
+ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+ $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
+- -j0 -d $(LIBDEST)/site-packages -f \
++ -d $(LIBDEST)/site-packages -f \
+ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+ $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \
+- -j0 -d $(LIBDEST)/site-packages -f \
++ -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
diff --git a/external/poky/meta/recipes-devtools/python/python3/0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch b/external/poky/meta/recipes-devtools/python/python3/0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch
new file mode 100644
index 00000000..237645bc
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/python/python3/0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch
@@ -0,0 +1,34 @@
+From 840fda32c82550259d02a7a56a78a9c05162b1a1 Mon Sep 17 00:00:00 2001
+From: Changqing Li <changqing.li@windriver.com>
+Date: Wed, 8 May 2019 16:10:29 +0800
+Subject: [PATCH] Makefile: fix Issue36464 (parallel build race problem)
+
+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: Submitted [https://github.com/python/cpython/pull/13186]
+
+Signed-off-by: Changqing Li <changqing.li@windriver.com>
+---
+ Makefile.pre.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index 15f3687..7e9f173 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -1456,7 +1456,7 @@ LIBPL= @LIBPL@
+ LIBPC= $(LIBDIR)/pkgconfig
+
+ libainstall: @DEF_MAKE_RULE@ python-config
+- @for i in $(LIBDIR) $(LIBPL) $(LIBPC); \
++ @for i in $(LIBDIR) $(LIBPL) $(LIBPC) $(BINDIR); \
+ do \
+ if test ! -d $(DESTDIR)$$i; then \
+ echo "Creating directory $$i"; \
+--
+2.7.4
+
diff --git a/external/poky/meta/recipes-devtools/python/python3/0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch b/external/poky/meta/recipes-devtools/python/python3/0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch
new file mode 100644
index 00000000..fa7735ff
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/python/python3/0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch
@@ -0,0 +1,25 @@
+From cf6a9100902484e4d028ee88742dd2487b014a98 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 30 Jan 2019 12:41:04 +0100
+Subject: [PATCH] Makefile.pre: use qemu wrapper when gathering profile data
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ Makefile.pre.in | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index a3a02a7..d5503dd 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -507,8 +507,7 @@ build_all_generate_profile:
+ $(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LDFLAGS_NODIST="$(LDFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LIBS="$(LIBS)"
+
+ run_profile_task:
+- @ # FIXME: can't run for a cross build
+- $(LLVM_PROF_FILE) $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) || true
++ ./pgo-wrapper ./python -m test.regrtest --pgo test_grammar test_opcodes test_dict test_builtin test_exceptions test_types test_support || true
+
+ build_all_merge_profile:
+ $(LLVM_PROF_MERGER)
diff --git a/external/poky/meta/recipes-devtools/python/python3/0001-Use-FLAG_REF-always-for-interned-strings.patch b/external/poky/meta/recipes-devtools/python/python3/0001-Use-FLAG_REF-always-for-interned-strings.patch
new file mode 100644
index 00000000..957839bf
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/python/python3/0001-Use-FLAG_REF-always-for-interned-strings.patch
@@ -0,0 +1,35 @@
+From 6c8ea7c1dacd42f3ba00440231ec0e6b1a38300d Mon Sep 17 00:00:00 2001
+From: Inada Naoki <songofacandy@gmail.com>
+Date: Sat, 14 Jul 2018 00:46:11 +0900
+Subject: [PATCH] Use FLAG_REF always for interned strings
+
+Upstream-Status: Submitted [https://github.com/python/cpython/pull/8226]
+Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
+---
+ Python/marshal.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/Python/marshal.c b/Python/marshal.c
+index 6d06266c6a..51db2e3b2e 100644
+--- a/Python/marshal.c
++++ b/Python/marshal.c
+@@ -275,9 +275,14 @@ w_ref(PyObject *v, char *flag, WFILE *p)
+ if (p->version < 3 || p->hashtable == NULL)
+ return 0; /* not writing object references */
+
+- /* if it has only one reference, it definitely isn't shared */
+- if (Py_REFCNT(v) == 1)
++ /* If it has only one reference, it definitely isn't shared.
++ * But we use TYPE_REF always for interned string, to PYC file stable
++ * as possible.
++ */
++ if (Py_REFCNT(v) == 1 &&
++ !(PyUnicode_CheckExact(v) && PyUnicode_CHECK_INTERNED(v))) {
+ return 0;
++ }
+
+ entry = _Py_HASHTABLE_GET_ENTRY(p->hashtable, v);
+ if (entry != NULL) {
+--
+2.21.0
+
diff --git a/external/poky/meta/recipes-devtools/python/python3/0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch b/external/poky/meta/recipes-devtools/python/python3/0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch
new file mode 100644
index 00000000..c4fae09a
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/python/python3/0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch
@@ -0,0 +1,209 @@
+From 1ad771d86728ee2ed30e202e9768d8d825f96467 Mon Sep 17 00:00:00 2001
+From: Matthias Schoepfer <matthias.schoepfer@ithinx.io>
+Date: Fri, 31 May 2019 15:34:34 +0200
+Subject: [PATCH] bpo-36852: proper detection of mips architecture for soft
+ float
+
+When (cross) compiling for softfloat mips, __mips_hard_float will not be
+defined and detection of OS triplet in configure.ac / configure will fail.
+
+This also has to do with the custom detection of the build triplet. Trying
+to do this in a more autoconf/autotools manner.
+
+Upstream-Status: Submitted [https://github.com/python/cpython/pull/13196]
+Signed-off-by: Matthias Schoepfer <matthias.schoepfer@ithinx.io>
+
+%% original patch: 0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch
+---
+ configure.ac | 175 +++++++--------------------------------------------
+ 1 file changed, 21 insertions(+), 154 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index ede710e..bc81b0b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -710,160 +710,27 @@ fi
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
+ AC_SUBST(MULTIARCH)
+
+-AC_MSG_CHECKING([for the platform triplet based on compiler characteristics])
+-cat >> conftest.c <<EOF
+-#undef bfin
+-#undef cris
+-#undef fr30
+-#undef linux
+-#undef hppa
+-#undef hpux
+-#undef i386
+-#undef mips
+-#undef powerpc
+-#undef sparc
+-#undef unix
+-#if defined(__ANDROID__)
+- # Android is not a multiarch system.
+-#elif defined(__linux__)
+-# if defined(__x86_64__) && defined(__LP64__)
+- x86_64-linux-gnu
+-# elif defined(__x86_64__) && defined(__ILP32__)
+- x86_64-linux-gnux32
+-# elif defined(__i386__)
+- i386-linux-gnu
+-# elif defined(__aarch64__) && defined(__AARCH64EL__)
+-# if defined(__ILP32__)
+- aarch64_ilp32-linux-gnu
+-# else
+- aarch64-linux-gnu
+-# endif
+-# elif defined(__aarch64__) && defined(__AARCH64EB__)
+-# if defined(__ILP32__)
+- aarch64_be_ilp32-linux-gnu
+-# else
+- aarch64_be-linux-gnu
+-# endif
+-# elif defined(__alpha__)
+- alpha-linux-gnu
+-# elif defined(__ARM_EABI__) && defined(__ARM_PCS_VFP)
+-# if defined(__ARMEL__)
+- arm-linux-gnueabihf
+-# else
+- armeb-linux-gnueabihf
+-# endif
+-# elif defined(__ARM_EABI__) && !defined(__ARM_PCS_VFP)
+-# if defined(__ARMEL__)
+- arm-linux-gnueabi
+-# else
+- armeb-linux-gnueabi
+-# endif
+-# elif defined(__hppa__)
+- hppa-linux-gnu
+-# elif defined(__ia64__)
+- ia64-linux-gnu
+-# elif defined(__m68k__) && !defined(__mcoldfire__)
+- m68k-linux-gnu
+-# elif defined(__mips_hard_float) && defined(__mips_isa_rev) && (__mips_isa_rev >=6) && defined(_MIPSEL)
+-# if _MIPS_SIM == _ABIO32
+- mipsisa32r6el-linux-gnu
+-# elif _MIPS_SIM == _ABIN32
+- mipsisa64r6el-linux-gnuabin32
+-# elif _MIPS_SIM == _ABI64
+- mipsisa64r6el-linux-gnuabi64
+-# else
+-# error unknown platform triplet
+-# endif
+-# elif defined(__mips_hard_float) && defined(__mips_isa_rev) && (__mips_isa_rev >=6)
+-# if _MIPS_SIM == _ABIO32
+- mipsisa32r6-linux-gnu
+-# elif _MIPS_SIM == _ABIN32
+- mipsisa64r6-linux-gnuabin32
+-# elif _MIPS_SIM == _ABI64
+- mipsisa64r6-linux-gnuabi64
+-# else
+-# error unknown platform triplet
+-# endif
+-# elif defined(__mips_hard_float) && defined(_MIPSEL)
+-# if _MIPS_SIM == _ABIO32
+- mipsel-linux-gnu
+-# elif _MIPS_SIM == _ABIN32
+- mips64el-linux-gnuabin32
+-# elif _MIPS_SIM == _ABI64
+- mips64el-linux-gnuabi64
+-# else
+-# error unknown platform triplet
+-# endif
+-# elif defined(__mips_hard_float)
+-# if _MIPS_SIM == _ABIO32
+- mips-linux-gnu
+-# elif _MIPS_SIM == _ABIN32
+- mips64-linux-gnuabin32
+-# elif _MIPS_SIM == _ABI64
+- mips64-linux-gnuabi64
+-# else
+-# error unknown platform triplet
+-# endif
+-# elif defined(__or1k__)
+- or1k-linux-gnu
+-# elif defined(__powerpc__) && defined(__SPE__)
+- powerpc-linux-gnuspe
+-# elif defined(__powerpc64__)
+-# if defined(__LITTLE_ENDIAN__)
+- powerpc64le-linux-gnu
+-# else
+- powerpc64-linux-gnu
+-# endif
+-# elif defined(__powerpc__)
+- powerpc-linux-gnu
+-# elif defined(__s390x__)
+- s390x-linux-gnu
+-# elif defined(__s390__)
+- s390-linux-gnu
+-# elif defined(__sh__) && defined(__LITTLE_ENDIAN__)
+- sh4-linux-gnu
+-# elif defined(__sparc__) && defined(__arch64__)
+- sparc64-linux-gnu
+-# elif defined(__sparc__)
+- sparc-linux-gnu
+-# elif defined(__riscv)
+-# if __riscv_xlen == 32
+- riscv32-linux-gnu
+-# elif __riscv_xlen == 64
+- riscv64-linux-gnu
+-# else
+-# error unknown platform triplet
+-# endif
+-# else
+-# error unknown platform triplet
+-# endif
+-#elif defined(__FreeBSD_kernel__)
+-# if defined(__LP64__)
+- x86_64-kfreebsd-gnu
+-# elif defined(__i386__)
+- i386-kfreebsd-gnu
+-# else
+-# error unknown platform triplet
+-# endif
+-#elif defined(__gnu_hurd__)
+- i386-gnu
+-#elif defined(__APPLE__)
+- darwin
+-#elif defined(__VXWORKS__)
+- vxworks
+-#else
+-# error unknown platform triplet
+-#endif
+-
+-EOF
+-
+-if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then
+- PLATFORM_TRIPLET=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' '`
+- AC_MSG_RESULT([$PLATFORM_TRIPLET])
+-else
+- AC_MSG_RESULT([none])
+-fi
+-rm -f conftest.c conftest.out
++AC_CANONICAL_TARGET
++## Not using $target to filter out vendor
++## Need to handle macos, vxworks and hurd special (?) :-/
++case ${target_os} in
++ darwin*)
++ PLATFORM_TRIPLET=darwin
++ ;;
++ hurd*)
++ PLATFORM_TRIPLET=i386-gnu
++ ;;
++ vxworks*)
++ PLATFORM_TRIPLET=vxworks
++ ;;
++ *)
++ if test "${target_cpu}" != "i686"; then
++ PLATFORM_TRIPLET=${target_cpu}-${target_os}
++ else
++ PLATFORM_TRIPLET=i386-${target_os}
++ fi
++ ;;
++esac
+
+ if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
+ if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
+--
+2.24.1
+
diff --git a/external/poky/meta/recipes-devtools/python/python3/0001-configure.ac-fix-LIBPL.patch b/external/poky/meta/recipes-devtools/python/python3/0001-configure.ac-fix-LIBPL.patch
new file mode 100644
index 00000000..123ce3a2
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/python/python3/0001-configure.ac-fix-LIBPL.patch
@@ -0,0 +1,35 @@
+From acce3d441e7eadadd2d3ce38654155dc43f1f607 Mon Sep 17 00:00:00 2001
+From: Changqing Li <changqing.li@windriver.com>
+Date: Fri, 7 Feb 2020 09:36:25 +0800
+Subject: [PATCH] configure.ac: fix LIBPL
+
+Use LIBDIR rather than prefix/lib, so that it would work when lib64.
+
+Upstream-Status: Inappropriate [oe-core specific]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Signed-off-by: Li Zhou <li.zhou@windriver.c>
+Signed-off-by: Changqing Li <changqing.li@windriver.com>
+---
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index ce04258..915f475 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -4532,9 +4532,9 @@ fi
+ dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
+ AC_SUBST(PY_ENABLE_SHARED)
+ if test x$PLATFORM_TRIPLET = x; then
+- LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
++ LIBPL='$(LIBDIR)'"/python${VERSION}/config-${LDVERSION}"
+ else
+- LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
++ LIBPL='$(LIBDIR)'"/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
+ fi
+ AC_SUBST(LIBPL)
+
+--
+2.7.4
+
diff --git a/external/poky/meta/recipes-devtools/python/python3/0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch b/external/poky/meta/recipes-devtools/python/python3/0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch
new file mode 100644
index 00000000..e7af3c6f
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/python/python3/0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch
@@ -0,0 +1,42 @@
+From 7ada9c749f6beb51c13a3debc850755e911548a6 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 31 Jan 2019 16:46:30 +0100
+Subject: [PATCH] distutils/sysconfig: append
+ STAGING_LIBDIR/python-sysconfigdata to sys.path
+
+So that target configuration can be used when running native python
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ Lib/distutils/sysconfig.py | 2 ++
+ Lib/sysconfig.py | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
+index b51629e..2df348c 100644
+--- a/Lib/distutils/sysconfig.py
++++ b/Lib/distutils/sysconfig.py
+@@ -438,6 +438,8 @@ def _init_posix():
+ platform=sys.platform,
+ multiarch=getattr(sys.implementation, '_multiarch', ''),
+ ))
++ if 'STAGING_LIBDIR' in os.environ:
++ sys.path.append(os.environ['STAGING_LIBDIR']+'/python-sysconfigdata')
+ _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
+ build_time_vars = _temp.build_time_vars
+ global _config_vars
+diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
+index b2d790b..405273c 100644
+--- a/Lib/sysconfig.py
++++ b/Lib/sysconfig.py
+@@ -419,6 +419,8 @@ def _init_posix(vars):
+ """Initialize the module as appropriate for POSIX systems."""
+ # _sysconfigdata is generated at build time, see _generate_posix_vars()
+ name = _get_sysconfigdata_name()
++ if 'STAGING_LIBDIR' in os.environ:
++ sys.path.append(os.environ['STAGING_LIBDIR']+'/python-sysconfigdata')
+ _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
+ build_time_vars = _temp.build_time_vars
+ vars.update(build_time_vars)
diff --git a/external/poky/meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch b/external/poky/meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch
deleted file mode 100644
index dd6b24fe..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python3/0001-python3-Do-not-hardcode-lib-for-distutils.patch b/external/poky/meta/recipes-devtools/python/python3/0001-python3-Do-not-hardcode-lib-for-distutils.patch
new file mode 100644
index 00000000..fe031b99
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/python/python3/0001-python3-Do-not-hardcode-lib-for-distutils.patch
@@ -0,0 +1,43 @@
+From bb711b53f10d32a90a27ccf4b0dc51e4a701d862 Mon Sep 17 00:00:00 2001
+From: Changqing Li <changqing.li@windriver.com>
+Date: Fri, 7 Feb 2020 09:42:09 +0800
+Subject: [PATCH] python3: Do not hardcode "lib" for distutils
+
+Get the sys.lib from python3 itself and do not use
+hardcoded value of 'lib' for distutils.
+
+Upstream-Status: Inappropriate [oe-core specific]
+
+Signed-off-by: Li Zhou <li.zhou@windriver.com>
+Signed-off-by: Changqing Li <changqing.li@windriver.com>
+---
+ Lib/distutils/command/install.py | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
+index c625c95..8e32f54 100644
+--- a/Lib/distutils/command/install.py
++++ b/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': '$base/' + 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',
+--
+2.7.4
+
diff --git a/external/poky/meta/recipes-devtools/python/python3/0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch b/external/poky/meta/recipes-devtools/python/python3/0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch
new file mode 100644
index 00000000..fb10ca94
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/python/python3/0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch
@@ -0,0 +1,121 @@
+From 994783da5c21cab81b6589ed2d4275e665a946f9 Mon Sep 17 00:00:00 2001
+From: Changqing Li <changqing.li@windriver.com>
+Date: Mon, 22 Oct 2018 15:19:51 +0800
+Subject: [PATCH] python3: use cc_basename to replace CC for checking compiler
+
+When working path contains "clang"/"gcc"/"icc", it might be part of $CC
+because of the "--sysroot" parameter. That could cause judgement error
+about clang/gcc/icc compilers. e.g.
+When "icc" is containded in working path, below errors are reported when
+compiling python3:
+x86_64-wrs-linux-gcc: error: strict: No such file or directory
+x86_64-wrs-linux-gcc: error: unrecognized command line option '-fp-model'
+
+Here use cc_basename to replace CC for checking compiler to avoid such
+kind of issue.
+
+Upstream-Status: Pending
+
+Signed-off-by: Li Zhou <li.zhou@windriver.com>
+
+patch originally from Li Zhou, I just rework it to new version
+
+Signed-off-by: Changqing Li <changqing.li@windriver.com>
+
+---
+ configure.ac | 19 ++++++++++---------
+ 1 file changed, 10 insertions(+), 9 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index a189d42..0f85486 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -54,6 +54,7 @@ AC_CONFIG_HEADER(pyconfig.h)
+ AC_CANONICAL_HOST
+ AC_SUBST(build)
+ AC_SUBST(host)
++LT_INIT
+
+ # pybuilddir.txt will be created by --generate-posix-vars in the Makefile
+ rm -f pybuilddir.txt
+@@ -671,7 +672,7 @@ AC_MSG_RESULT($with_cxx_main)
+ preset_cxx="$CXX"
+ if test -z "$CXX"
+ then
+- case "$CC" in
++ case "$cc_basename" in
+ gcc) AC_PATH_TOOL(CXX, [g++], [g++], [notfound]) ;;
+ cc) AC_PATH_TOOL(CXX, [c++], [c++], [notfound]) ;;
+ clang|*/clang) AC_PATH_TOOL(CXX, [clang++], [clang++], [notfound]) ;;
+@@ -957,7 +958,7 @@ rmdir CaseSensitiveTestDir
+
+ case $ac_sys_system in
+ hp*|HP*)
+- case $CC in
++ case $cc_basename in
+ cc|*/cc) CC="$CC -Ae";;
+ esac;;
+ esac
+@@ -1335,7 +1336,7 @@ else
+ fi],
+ [AC_MSG_RESULT(no)])
+ if test "$Py_LTO" = 'true' ; then
+- case $CC in
++ case $cc_basename in
+ *clang*)
+ AC_SUBST(LLVM_AR)
+ AC_PATH_TOOL(LLVM_AR, llvm-ar, '', ${llvm_path})
+@@ -1425,7 +1426,7 @@ then
+ fi
+ fi
+ LLVM_PROF_ERR=no
+-case $CC in
++case $cc_basename in
+ *clang*)
+ # Any changes made here should be reflected in the GCC+Darwin case below
+ PGO_PROF_GEN_FLAG="-fprofile-instr-generate"
+@@ -1486,7 +1487,7 @@ esac
+ # compiler and platform. BASECFLAGS tweaks need to be made even if the
+ # user set OPT.
+
+-case $CC in
++case $cc_basename in
+ *clang*)
+ cc_is_clang=1
+ ;;
+@@ -1622,7 +1623,7 @@ yes)
+
+ # ICC doesn't recognize the option, but only emits a warning
+ ## XXX does it emit an unused result warning and can it be disabled?
+- case "$CC" in
++ case "$cc_basename" in
+ *icc*)
+ ac_cv_disable_unused_result_warning=no
+ ;;
+@@ -1943,7 +1944,7 @@ yes)
+ esac
+
+ # ICC needs -fp-model strict or floats behave badly
+-case "$CC" in
++case "$cc_basename" in
+ *icc*)
+ CFLAGS_NODIST="$CFLAGS_NODIST -fp-model strict"
+ ;;
+@@ -2711,7 +2712,7 @@ then
+ then
+ LINKFORSHARED="-Wl,--export-dynamic"
+ fi;;
+- SunOS/5*) case $CC in
++ SunOS/5*) case $cc_basename in
+ *gcc*)
+ if $CC -Xlinker --help 2>&1 | grep export-dynamic >/dev/null
+ then
+@@ -5362,7 +5363,7 @@ if test "$have_gcc_asm_for_x87" = yes; then
+ # Some versions of gcc miscompile inline asm:
+ # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46491
+ # http://gcc.gnu.org/ml/gcc/2010-11/msg00366.html
+- case $CC in
++ case $cc_basename in
+ *gcc*)
+ AC_MSG_CHECKING(for gcc ipa-pure-const bug)
+ saved_cflags="$CFLAGS"
diff --git a/external/poky/meta/recipes-devtools/python/python/pass-missing-libraries-to-Extension-for-mul.patch b/external/poky/meta/recipes-devtools/python/python3/0001-setup.py-pass-missing-libraries-to-Extension-for-mul.patch
index 44fcaacf..d38ed61d 100644
--- a/external/poky/meta/recipes-devtools/python/python/pass-missing-libraries-to-Extension-for-mul.patch
+++ b/external/poky/meta/recipes-devtools/python/python3/0001-setup.py-pass-missing-libraries-to-Extension-for-mul.patch
@@ -1,7 +1,8 @@
-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
+From 7019ba184b828ed7253750cf409fc5760ef90a54 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 9 Jan 2020 17:44:05 +0100
+Subject: [PATCH] setup.py: pass missing libraries to Extension for
+ multiprocessing module
In the following commit:
...
@@ -45,38 +46,24 @@ 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]
+Upstream-Status: Pensing
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
- setup.py | 7 +++++--
- 1 file changed, 5 insertions(+), 2 deletions(-)
+ setup.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/setup.py b/setup.py
-index 54054c2..9646bfc 100644
+index ec3f2a4..b0f1541 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']
+@@ -1671,7 +1671,7 @@ class PyBuildExt(build_ext):
+ libraries=libs,
+ include_dirs=["Modules/_multiprocessing"]))
-@@ -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
-
+- self.add(Extension('_multiprocessing', multiprocessing_srcs,
++ self.add(Extension('_multiprocessing', multiprocessing_srcs, libraries=['pthread'],
+ include_dirs=["Modules/_multiprocessing"]))
+
+ def detect_uuid(self):
diff --git a/external/poky/meta/recipes-devtools/python/python3/0001-test_locale.py-correct-the-test-output-format.patch b/external/poky/meta/recipes-devtools/python/python3/0001-test_locale.py-correct-the-test-output-format.patch
new file mode 100644
index 00000000..35b7e0c4
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/python/python3/0001-test_locale.py-correct-the-test-output-format.patch
@@ -0,0 +1,46 @@
+From b94995e0c694ec9561efec0d1a59b323340e6105 Mon Sep 17 00:00:00 2001
+From: Mingli Yu <mingli.yu@windriver.com>
+Date: Mon, 5 Aug 2019 15:57:39 +0800
+Subject: [PATCH] test_locale.py: correct the test output format
+
+Before this patch:
+ # python3 -m test -v test_locale
+ [snip]
+ test_getsetlocale_issue1813 (test.test_locale.TestMiscellaneous) ... testing with ('tr_TR', 'ISO8859-9') ok
+ [snip]
+
+ After this patch:
+ # python3 -m test -v test_locale
+ [snip]
+ test_getsetlocale_issue1813 (test.test_locale.TestMiscellaneous) ... testing with ('tr_TR', 'ISO8859-9')... ok
+ [snip]
+
+ Make the test ended with "... ok" is common in python
+ unittest world, we should make it keep consistent
+ with other test cases in case it may be ignored to
+ record in the report if we use the common filter
+ "... ok".
+
+Upstream-Status: Submitted [https://github.com/python/cpython/pull/15132]
+
+Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
+---
+ Lib/test/test_locale.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Lib/test/test_locale.py b/Lib/test/test_locale.py
+index e2c2178..558d63c 100644
+--- a/Lib/test/test_locale.py
++++ b/Lib/test/test_locale.py
+@@ -527,7 +527,7 @@ class TestMiscellaneous(unittest.TestCase):
+ self.skipTest('test needs Turkish locale')
+ loc = locale.getlocale(locale.LC_CTYPE)
+ if verbose:
+- print('testing with %a' % (loc,), end=' ', flush=True)
++ print('testing with %a...' % (loc,), end=' ', flush=True)
+ locale.setlocale(locale.LC_CTYPE, loc)
+ self.assertEqual(loc, locale.getlocale(locale.LC_CTYPE))
+
+--
+2.7.4
+
diff --git a/external/poky/meta/recipes-devtools/python/python3/0002-Makefile-add-target-to-split-profile-generation.patch b/external/poky/meta/recipes-devtools/python/python3/0002-Makefile-add-target-to-split-profile-generation.patch
deleted file mode 100644
index 2b4ba316..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/0002-Makefile-add-target-to-split-profile-generation.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From 98586d6dc598e40b8b821b0dde57599e188a7ca4 Mon Sep 17 00:00:00 2001
-From: Anuj Mittal <anuj.mittal@intel.com>
-Date: Tue, 7 Aug 2018 16:43:17 +0800
-Subject: [PATCH 2/2] Makefile: add target to split profile generation
-
-We don't want to have profile task invoked from here and want to use
-qemu-user instead. Split the profile-opt task so qemu can be invoked
-once binaries have been built with instrumentation and then we can go
-ahead and build again using the profile data generated.
-
-Upstream-Status: Inappropriate [OE-specific]
-
-Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
----
- Makefile.pre.in | 6 ++----
- 1 file changed, 2 insertions(+), 4 deletions(-)
-
-diff --git a/Makefile.pre.in b/Makefile.pre.in
-index 84bc3ff..017a2c4 100644
---- a/Makefile.pre.in
-+++ b/Makefile.pre.in
-@@ -469,13 +469,12 @@ profile-opt:
- $(MAKE) profile-removal
- $(MAKE) build_all_generate_profile
- $(MAKE) profile-removal
-- @echo "Running code to generate profile data (this can take a while):"
-- $(MAKE) run_profile_task
-- $(MAKE) build_all_merge_profile
-+
-+clean_and_use_profile:
- @echo "Rebuilding with profile guided optimizations:"
- $(MAKE) clean
- $(MAKE) build_all_use_profile
- $(MAKE) profile-removal
-
- build_all_generate_profile:
- $(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS) $(EXTRA_CFLAGS) $(PGO_PROF_GEN_FLAG) @LTOFLAGS@" LDFLAGS="$(LDFLAGS) $(PGO_PROF_GEN_FLAG) @LTOFLAGS@" LIBS="$(LIBS)"
---
-2.17.1
-
diff --git a/external/poky/meta/recipes-devtools/python/python3/0002-bpo-29136-Add-TLS-1.3-cipher-suites-and-OP_NO_TLSv1_.patch b/external/poky/meta/recipes-devtools/python/python3/0002-bpo-29136-Add-TLS-1.3-cipher-suites-and-OP_NO_TLSv1_.patch
deleted file mode 100644
index d48cad75..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/0002-bpo-29136-Add-TLS-1.3-cipher-suites-and-OP_NO_TLSv1_.patch
+++ /dev/null
@@ -1,227 +0,0 @@
-From e950ea68dab006944af194c9910b8f2341d1437d Mon Sep 17 00:00:00 2001
-From: Christian Heimes <christian@python.org>
-Date: Thu, 7 Sep 2017 20:23:52 -0700
-Subject: [PATCH] bpo-29136: Add TLS 1.3 cipher suites and OP_NO_TLSv1_3
- (GH-1363) (#3444)
-
-* bpo-29136: Add TLS 1.3 support
-
-TLS 1.3 introduces a new, distinct set of cipher suites. The TLS 1.3
-cipher suites don't overlap with cipher suites from TLS 1.2 and earlier.
-Since Python sets its own set of permitted ciphers, TLS 1.3 handshake
-will fail as soon as OpenSSL 1.1.1 is released. Let's enable the common
-AES-GCM and ChaCha20 suites.
-
-Additionally the flag OP_NO_TLSv1_3 is added. It defaults to 0 (no op) with
-OpenSSL prior to 1.1.1. This allows applications to opt-out from TLS 1.3
-now.
-
-Signed-off-by: Christian Heimes <christian@python.org>.
-(cherry picked from commit cb5b68abdeb1b1d56c581d5b4d647018703d61e3)
-
-Upstream-Status: Backport
-[https://github.com/python/cpython/commit/cb5b68abdeb1b1d56c581d5b4d647018703d61e3]
-
-Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
----
- Doc/library/ssl.rst | 21 ++++++++++++++
- Lib/ssl.py | 7 +++++
- Lib/test/test_ssl.py | 29 ++++++++++++++++++-
- .../2017-09-04-16-39-49.bpo-29136.vSn1oR.rst | 1 +
- Modules/_ssl.c | 13 +++++++++
- 5 files changed, 70 insertions(+), 1 deletion(-)
- create mode 100644 Misc/NEWS.d/next/Library/2017-09-04-16-39-49.bpo-29136.vSn1oR.rst
-
-diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst
-index 14f2d68217..29c5e94cf6 100644
---- a/Doc/library/ssl.rst
-+++ b/Doc/library/ssl.rst
-@@ -285,6 +285,11 @@ purposes.
-
- 3DES was dropped from the default cipher string.
-
-+ .. versionchanged:: 3.7
-+
-+ TLS 1.3 cipher suites TLS_AES_128_GCM_SHA256, TLS_AES_256_GCM_SHA384,
-+ and TLS_CHACHA20_POLY1305_SHA256 were added to the default cipher string.
-+
-
- Random generation
- ^^^^^^^^^^^^^^^^^
-@@ -719,6 +724,16 @@ Constants
-
- .. versionadded:: 3.4
-
-+.. data:: OP_NO_TLSv1_3
-+
-+ Prevents a TLSv1.3 connection. This option is only applicable in conjunction
-+ with :const:`PROTOCOL_TLS`. It prevents the peers from choosing TLSv1.3 as
-+ the protocol version. TLS 1.3 is available with OpenSSL 1.1.1 or later.
-+ When Python has been compiled against an older version of OpenSSL, the
-+ flag defaults to *0*.
-+
-+ .. versionadded:: 3.7
-+
- .. data:: OP_CIPHER_SERVER_PREFERENCE
-
- Use the server's cipher ordering preference, rather than the client's.
-@@ -783,6 +798,12 @@ Constants
-
- .. versionadded:: 3.3
-
-+.. data:: HAS_TLSv1_3
-+
-+ Whether the OpenSSL library has built-in support for the TLS 1.3 protocol.
-+
-+ .. versionadded:: 3.7
-+
- .. data:: CHANNEL_BINDING_TYPES
-
- List of supported TLS channel binding types. Strings in this list
-diff --git a/Lib/ssl.py b/Lib/ssl.py
-index 4d302a78fa..f233e72e1f 100644
---- a/Lib/ssl.py
-+++ b/Lib/ssl.py
-@@ -122,6 +122,7 @@ _import_symbols('OP_')
- _import_symbols('ALERT_DESCRIPTION_')
- _import_symbols('SSL_ERROR_')
- _import_symbols('VERIFY_')
-+from _ssl import HAS_SNI, HAS_ECDH, HAS_NPN, HAS_ALPN, HAS_TLSv1_3
-
- from _ssl import HAS_SNI, HAS_ECDH, HAS_NPN, HAS_ALPN
-
-@@ -162,6 +163,7 @@ else:
- # (OpenSSL's default setting is 'DEFAULT:!aNULL:!eNULL')
- # Enable a better set of ciphers by default
- # This list has been explicitly chosen to:
-+# * TLS 1.3 ChaCha20 and AES-GCM cipher suites
- # * Prefer cipher suites that offer perfect forward secrecy (DHE/ECDHE)
- # * Prefer ECDHE over DHE for better performance
- # * Prefer AEAD over CBC for better performance and security
-@@ -173,6 +175,8 @@ else:
- # * Disable NULL authentication, NULL encryption, 3DES and MD5 MACs
- # for security reasons
- _DEFAULT_CIPHERS = (
-+ 'TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:'
-+ 'TLS13-AES-128-GCM-SHA256:'
- 'ECDH+AESGCM:ECDH+CHACHA20:DH+AESGCM:DH+CHACHA20:ECDH+AES256:DH+AES256:'
- 'ECDH+AES128:DH+AES:ECDH+HIGH:DH+HIGH:RSA+AESGCM:RSA+AES:RSA+HIGH:'
- '!aNULL:!eNULL:!MD5:!3DES'
-@@ -180,6 +184,7 @@ _DEFAULT_CIPHERS = (
-
- # Restricted and more secure ciphers for the server side
- # This list has been explicitly chosen to:
-+# * TLS 1.3 ChaCha20 and AES-GCM cipher suites
- # * Prefer cipher suites that offer perfect forward secrecy (DHE/ECDHE)
- # * Prefer ECDHE over DHE for better performance
- # * Prefer AEAD over CBC for better performance and security
-@@ -190,6 +195,8 @@ _DEFAULT_CIPHERS = (
- # * Disable NULL authentication, NULL encryption, MD5 MACs, DSS, RC4, and
- # 3DES for security reasons
- _RESTRICTED_SERVER_CIPHERS = (
-+ 'TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:'
-+ 'TLS13-AES-128-GCM-SHA256:'
- 'ECDH+AESGCM:ECDH+CHACHA20:DH+AESGCM:DH+CHACHA20:ECDH+AES256:DH+AES256:'
- 'ECDH+AES128:DH+AES:ECDH+HIGH:DH+HIGH:RSA+AESGCM:RSA+AES:RSA+HIGH:'
- '!aNULL:!eNULL:!MD5:!DSS:!RC4:!3DES'
-diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
-index f91af7bd05..1acc12ec2d 100644
---- a/Lib/test/test_ssl.py
-+++ b/Lib/test/test_ssl.py
-@@ -150,6 +150,13 @@ class BasicSocketTests(unittest.TestCase):
- ssl.OP_NO_COMPRESSION
- self.assertIn(ssl.HAS_SNI, {True, False})
- self.assertIn(ssl.HAS_ECDH, {True, False})
-+ ssl.OP_NO_SSLv2
-+ ssl.OP_NO_SSLv3
-+ ssl.OP_NO_TLSv1
-+ ssl.OP_NO_TLSv1_3
-+ if ssl.OPENSSL_VERSION_INFO >= (1, 0, 1):
-+ ssl.OP_NO_TLSv1_1
-+ ssl.OP_NO_TLSv1_2
-
- def test_str_for_enums(self):
- # Make sure that the PROTOCOL_* constants have enum-like string
-@@ -3028,12 +3035,33 @@ else:
- self.assertEqual(s.version(), 'TLSv1')
- self.assertIs(s.version(), None)
-
-+ @unittest.skipUnless(ssl.HAS_TLSv1_3,
-+ "test requires TLSv1.3 enabled OpenSSL")
-+ def test_tls1_3(self):
-+ context = ssl.SSLContext(ssl.PROTOCOL_TLS)
-+ context.load_cert_chain(CERTFILE)
-+ # disable all but TLS 1.3
-+ context.options |= (
-+ ssl.OP_NO_TLSv1 | ssl.OP_NO_TLSv1_1 | ssl.OP_NO_TLSv1_2
-+ )
-+ with ThreadedEchoServer(context=context) as server:
-+ with context.wrap_socket(socket.socket()) as s:
-+ s.connect((HOST, server.port))
-+ self.assertIn(s.cipher()[0], [
-+ 'TLS13-AES-256-GCM-SHA384',
-+ 'TLS13-CHACHA20-POLY1305-SHA256',
-+ 'TLS13-AES-128-GCM-SHA256',
-+ ])
-+
- @unittest.skipUnless(ssl.HAS_ECDH, "test requires ECDH-enabled OpenSSL")
- def test_default_ecdh_curve(self):
- # Issue #21015: elliptic curve-based Diffie Hellman key exchange
- # should be enabled by default on SSL contexts.
- context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
- context.load_cert_chain(CERTFILE)
-+ # TLSv1.3 defaults to PFS key agreement and no longer has KEA in
-+ # cipher name.
-+ context.options |= ssl.OP_NO_TLSv1_3
- # Prior to OpenSSL 1.0.0, ECDH ciphers have to be enabled
- # explicitly using the 'ECCdraft' cipher alias. Otherwise,
- # our default cipher list should prefer ECDH-based ciphers
-@@ -3394,7 +3422,6 @@ else:
- s.sendfile(file)
- self.assertEqual(s.recv(1024), TEST_DATA)
-
--
- def test_main(verbose=False):
- if support.verbose:
- import warnings
-diff --git a/Misc/NEWS.d/next/Library/2017-09-04-16-39-49.bpo-29136.vSn1oR.rst b/Misc/NEWS.d/next/Library/2017-09-04-16-39-49.bpo-29136.vSn1oR.rst
-new file mode 100644
-index 0000000000..e76997ef83
---- /dev/null
-+++ b/Misc/NEWS.d/next/Library/2017-09-04-16-39-49.bpo-29136.vSn1oR.rst
-@@ -0,0 +1 @@
-+Add TLS 1.3 cipher suites and OP_NO_TLSv1_3.
-diff --git a/Modules/_ssl.c b/Modules/_ssl.c
-index 0d5c121d2c..c71d89607c 100644
---- a/Modules/_ssl.c
-+++ b/Modules/_ssl.c
-@@ -4842,6 +4842,11 @@ PyInit__ssl(void)
- #if HAVE_TLSv1_2
- PyModule_AddIntConstant(m, "OP_NO_TLSv1_1", SSL_OP_NO_TLSv1_1);
- PyModule_AddIntConstant(m, "OP_NO_TLSv1_2", SSL_OP_NO_TLSv1_2);
-+#endif
-+#ifdef SSL_OP_NO_TLSv1_3
-+ PyModule_AddIntConstant(m, "OP_NO_TLSv1_3", SSL_OP_NO_TLSv1_3);
-+#else
-+ PyModule_AddIntConstant(m, "OP_NO_TLSv1_3", 0);
- #endif
- PyModule_AddIntConstant(m, "OP_CIPHER_SERVER_PREFERENCE",
- SSL_OP_CIPHER_SERVER_PREFERENCE);
-@@ -4890,6 +4895,14 @@ PyInit__ssl(void)
- Py_INCREF(r);
- PyModule_AddObject(m, "HAS_ALPN", r);
-
-+#if defined(TLS1_3_VERSION) && !defined(OPENSSL_NO_TLS1_3)
-+ r = Py_True;
-+#else
-+ r = Py_False;
-+#endif
-+ Py_INCREF(r);
-+ PyModule_AddObject(m, "HAS_TLSv1_3", r);
-+
- /* Mappings for error codes */
- err_codes_to_names = PyDict_New();
- err_names_to_codes = PyDict_New();
---
-2.17.1
-
diff --git a/external/poky/meta/recipes-devtools/python/python3/0003-bpo-32947-Fixes-for-TLS-1.3-and-OpenSSL-1.1.1-GH-876.patch b/external/poky/meta/recipes-devtools/python/python3/0003-bpo-32947-Fixes-for-TLS-1.3-and-OpenSSL-1.1.1-GH-876.patch
deleted file mode 100644
index 56d591d1..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/0003-bpo-32947-Fixes-for-TLS-1.3-and-OpenSSL-1.1.1-GH-876.patch
+++ /dev/null
@@ -1,173 +0,0 @@
-From 170a614904febd14ff6cfd7a75c9bccc114b3948 Mon Sep 17 00:00:00 2001
-From: Christian Heimes <christian@python.org>
-Date: Tue, 14 Aug 2018 16:56:32 +0200
-Subject: [PATCH] bpo-32947: Fixes for TLS 1.3 and OpenSSL 1.1.1 (GH-8761)
-
-Backport of TLS 1.3 related fixes from 3.7.
-
-Misc fixes and workarounds for compatibility with OpenSSL 1.1.1 from git
-master and TLS 1.3 support. With OpenSSL 1.1.1, Python negotiates TLS 1.3 by
-default. Some test cases only apply to TLS 1.2.
-
-OpenSSL 1.1.1 has added a new option OP_ENABLE_MIDDLEBOX_COMPAT for TLS
-1.3. The feature is enabled by default for maximum compatibility with
-broken middle boxes. Users should be able to disable the hack and CPython's test suite needs
-it to verify default options
-
-Signed-off-by: Christian Heimes <christian@python.org>
-
-Upstream-Status: Backport
-[https://github.com/python/cpython/commit/2a4ee8aa01d61b6a9c8e9c65c211e61bdb471826]
-
-Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
----
- Doc/library/ssl.rst | 9 ++++++
- Lib/test/test_asyncio/test_events.py | 6 +++-
- Lib/test/test_ssl.py | 29 +++++++++++++++----
- .../2018-08-14-08-57-01.bpo-32947.mqStVW.rst | 2 ++
- Modules/_ssl.c | 4 +++
- 5 files changed, 44 insertions(+), 6 deletions(-)
- create mode 100644 Misc/NEWS.d/next/Library/2018-08-14-08-57-01.bpo-32947.mqStVW.rst
-
-diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst
-index 29c5e94cf6..f63a3deec5 100644
---- a/Doc/library/ssl.rst
-+++ b/Doc/library/ssl.rst
-@@ -757,6 +757,15 @@ Constants
-
- .. versionadded:: 3.3
-
-+.. data:: OP_ENABLE_MIDDLEBOX_COMPAT
-+
-+ Send dummy Change Cipher Spec (CCS) messages in TLS 1.3 handshake to make
-+ a TLS 1.3 connection look more like a TLS 1.2 connection.
-+
-+ This option is only available with OpenSSL 1.1.1 and later.
-+
-+ .. versionadded:: 3.6.7
-+
- .. data:: OP_NO_COMPRESSION
-
- Disable compression on the SSL channel. This is useful if the application
-diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py
-index 492a84a231..6f208474b9 100644
---- a/Lib/test/test_asyncio/test_events.py
-+++ b/Lib/test/test_asyncio/test_events.py
-@@ -1169,7 +1169,11 @@ class EventLoopTestsMixin:
- self.loop.run_until_complete(f_c)
-
- # close connection
-- proto.transport.close()
-+ # transport may be None with TLS 1.3, because connection is
-+ # interrupted, server is unable to send session tickets, and
-+ # transport is closed.
-+ if proto.transport is not None:
-+ proto.transport.close()
- server.close()
-
- def test_legacy_create_server_ssl_match_failed(self):
-diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
-index 1acc12ec2d..a2e1d32a62 100644
---- a/Lib/test/test_ssl.py
-+++ b/Lib/test/test_ssl.py
-@@ -78,6 +78,7 @@ OP_NO_COMPRESSION = getattr(ssl, "OP_NO_COMPRESSION", 0)
- OP_SINGLE_DH_USE = getattr(ssl, "OP_SINGLE_DH_USE", 0)
- OP_SINGLE_ECDH_USE = getattr(ssl, "OP_SINGLE_ECDH_USE", 0)
- OP_CIPHER_SERVER_PREFERENCE = getattr(ssl, "OP_CIPHER_SERVER_PREFERENCE", 0)
-+OP_ENABLE_MIDDLEBOX_COMPAT = getattr(ssl, "OP_ENABLE_MIDDLEBOX_COMPAT", 0)
-
-
- def handle_error(prefix):
-@@ -155,8 +156,8 @@ class BasicSocketTests(unittest.TestCase):
- ssl.OP_NO_TLSv1
- ssl.OP_NO_TLSv1_3
- if ssl.OPENSSL_VERSION_INFO >= (1, 0, 1):
-- ssl.OP_NO_TLSv1_1
-- ssl.OP_NO_TLSv1_2
-+ ssl.OP_NO_TLSv1_1
-+ ssl.OP_NO_TLSv1_2
-
- def test_str_for_enums(self):
- # Make sure that the PROTOCOL_* constants have enum-like string
-@@ -854,7 +855,8 @@ class ContextTests(unittest.TestCase):
- default = (ssl.OP_ALL | ssl.OP_NO_SSLv2 | ssl.OP_NO_SSLv3)
- # SSLContext also enables these by default
- default |= (OP_NO_COMPRESSION | OP_CIPHER_SERVER_PREFERENCE |
-- OP_SINGLE_DH_USE | OP_SINGLE_ECDH_USE)
-+ OP_SINGLE_DH_USE | OP_SINGLE_ECDH_USE |
-+ OP_ENABLE_MIDDLEBOX_COMPAT)
- self.assertEqual(default, ctx.options)
- ctx.options |= ssl.OP_NO_TLSv1
- self.assertEqual(default | ssl.OP_NO_TLSv1, ctx.options)
-@@ -1860,11 +1862,26 @@ else:
- self.sock, server_side=True)
- self.server.selected_npn_protocols.append(self.sslconn.selected_npn_protocol())
- self.server.selected_alpn_protocols.append(self.sslconn.selected_alpn_protocol())
-- except (ssl.SSLError, ConnectionResetError) as e:
-+ except (ConnectionResetError, BrokenPipeError) as e:
- # We treat ConnectionResetError as though it were an
- # SSLError - OpenSSL on Ubuntu abruptly closes the
- # connection when asked to use an unsupported protocol.
- #
-+ # BrokenPipeError is raised in TLS 1.3 mode, when OpenSSL
-+ # tries to send session tickets after handshake.
-+ # https://github.com/openssl/openssl/issues/6342
-+ self.server.conn_errors.append(str(e))
-+ if self.server.chatty:
-+ handle_error(
-+ "\n server: bad connection attempt from " + repr(
-+ self.addr) + ":\n")
-+ self.running = False
-+ self.close()
-+ return False
-+ except (ssl.SSLError, OSError) as e:
-+ # OSError may occur with wrong protocols, e.g. both
-+ # sides use PROTOCOL_TLS_SERVER.
-+ #
- # XXX Various errors can have happened here, for example
- # a mismatching protocol version, an invalid certificate,
- # or a low-level bug. This should be made more discriminating.
-@@ -2974,7 +2991,7 @@ else:
- # Block on the accept and wait on the connection to close.
- evt.set()
- remote, peer = server.accept()
-- remote.recv(1)
-+ remote.send(remote.recv(4))
-
- t = threading.Thread(target=serve)
- t.start()
-@@ -2982,6 +2999,8 @@ else:
- evt.wait()
- client = context.wrap_socket(socket.socket())
- client.connect((host, port))
-+ client.send(b'data')
-+ client.recv()
- client_addr = client.getsockname()
- client.close()
- t.join()
-diff --git a/Misc/NEWS.d/next/Library/2018-08-14-08-57-01.bpo-32947.mqStVW.rst b/Misc/NEWS.d/next/Library/2018-08-14-08-57-01.bpo-32947.mqStVW.rst
-new file mode 100644
-index 0000000000..28de360c36
---- /dev/null
-+++ b/Misc/NEWS.d/next/Library/2018-08-14-08-57-01.bpo-32947.mqStVW.rst
-@@ -0,0 +1,2 @@
-+Add OP_ENABLE_MIDDLEBOX_COMPAT and test workaround for TLSv1.3 for future
-+compatibility with OpenSSL 1.1.1.
-diff --git a/Modules/_ssl.c b/Modules/_ssl.c
-index c71d89607c..eb123a87ba 100644
---- a/Modules/_ssl.c
-+++ b/Modules/_ssl.c
-@@ -4858,6 +4858,10 @@ PyInit__ssl(void)
- PyModule_AddIntConstant(m, "OP_NO_COMPRESSION",
- SSL_OP_NO_COMPRESSION);
- #endif
-+#ifdef SSL_OP_ENABLE_MIDDLEBOX_COMPAT
-+ PyModule_AddIntConstant(m, "OP_ENABLE_MIDDLEBOX_COMPAT",
-+ SSL_OP_ENABLE_MIDDLEBOX_COMPAT);
-+#endif
-
- #if HAVE_SNI
- r = Py_True;
---
-2.17.1
-
diff --git a/external/poky/meta/recipes-devtools/python/python3/0004-bpo-33570-TLS-1.3-ciphers-for-OpenSSL-1.1.1-GH-6976.patch b/external/poky/meta/recipes-devtools/python/python3/0004-bpo-33570-TLS-1.3-ciphers-for-OpenSSL-1.1.1-GH-6976.patch
deleted file mode 100644
index b97d5501..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/0004-bpo-33570-TLS-1.3-ciphers-for-OpenSSL-1.1.1-GH-6976.patch
+++ /dev/null
@@ -1,110 +0,0 @@
-From 0c9354362bfa5f90fbea8ff8237a1f1f5dba686f Mon Sep 17 00:00:00 2001
-From: Christian Heimes <christian@python.org>
-Date: Wed, 12 Sep 2018 15:20:31 +0800
-Subject: [PATCH] bpo-33570: TLS 1.3 ciphers for OpenSSL 1.1.1 (GH-6976)
-
-Change TLS 1.3 cipher suite settings for compatibility with OpenSSL
-1.1.1-pre6 and newer. OpenSSL 1.1.1 will have TLS 1.3 cipers enabled by
-default.
-
-Also update multissltests and Travis config to test with latest OpenSSL.
-
-Signed-off-by: Christian Heimes <christian@python.org>
-(cherry picked from commit e8eb6cb7920ded66abc5d284319a8539bdc2bae3)
-
-Co-authored-by: Christian Heimes <christian@python.org
-
-Upstream-Status: Backport
-[https://github.com/python/cpython/commit/3e630c541b35c96bfe5619165255e559f577ee71]
-
-Tweaked patch to not take changes for multissltests and Travis config.
-
-Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
----
- Lib/test/test_ssl.py | 51 ++++++++++++++++++++++----------------------
- 1 file changed, 26 insertions(+), 25 deletions(-)
-
-diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
-index a2e1d32a62..c484ead5ff 100644
---- a/Lib/test/test_ssl.py
-+++ b/Lib/test/test_ssl.py
-@@ -3024,17 +3024,21 @@ else:
- sock.do_handshake()
- self.assertEqual(cm.exception.errno, errno.ENOTCONN)
-
-- def test_default_ciphers(self):
-- context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
-- try:
-- # Force a set of weak ciphers on our client context
-- context.set_ciphers("DES")
-- except ssl.SSLError:
-- self.skipTest("no DES cipher available")
-- with ThreadedEchoServer(CERTFILE,
-- ssl_version=ssl.PROTOCOL_SSLv23,
-- chatty=False) as server:
-- with context.wrap_socket(socket.socket()) as s:
-+ def test_no_shared_ciphers(self):
-+ server_context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
-+ server_context.load_cert_chain(SIGNED_CERTFILE)
-+ client_context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
-+ client_context.verify_mode = ssl.CERT_REQUIRED
-+ client_context.check_hostname = True
-+
-+ client_context.set_ciphers("AES128")
-+ server_context.set_ciphers("AES256")
-+ # OpenSSL enables all TLS 1.3 ciphers, enforce TLS 1.2 for test
-+ client_context.options |= ssl.OP_NO_TLSv1_3
-+ with ThreadedEchoServer(context=server_context) as server:
-+ with client_context.wrap_socket(
-+ socket.socket(),
-+ server_hostname="localhost") as s:
- with self.assertRaises(OSError):
- s.connect((HOST, server.port))
- self.assertIn("no shared cipher", str(server.conn_errors[0]))
-@@ -3067,9 +3071,9 @@ else:
- with context.wrap_socket(socket.socket()) as s:
- s.connect((HOST, server.port))
- self.assertIn(s.cipher()[0], [
-- 'TLS13-AES-256-GCM-SHA384',
-- 'TLS13-CHACHA20-POLY1305-SHA256',
-- 'TLS13-AES-128-GCM-SHA256',
-+ 'TLS_AES_256_GCM_SHA384',
-+ 'TLS_CHACHA20_POLY1305_SHA256',
-+ 'TLS_AES_128_GCM_SHA256',
- ])
-
- @unittest.skipUnless(ssl.HAS_ECDH, "test requires ECDH-enabled OpenSSL")
-@@ -3391,22 +3395,19 @@ else:
- client_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
- client_context.verify_mode = ssl.CERT_REQUIRED
- client_context.load_verify_locations(SIGNING_CA)
-- if ssl.OPENSSL_VERSION_INFO >= (1, 0, 2):
-- client_context.set_ciphers("AES128:AES256")
-- server_context.set_ciphers("AES256")
-- alg1 = "AES256"
-- alg2 = "AES-256"
-- else:
-- client_context.set_ciphers("AES:3DES")
-- server_context.set_ciphers("3DES")
-- alg1 = "3DES"
-- alg2 = "DES-CBC3"
-+ client_context.set_ciphers("AES128:AES256")
-+ server_context.set_ciphers("AES256")
-+ expected_algs = [
-+ "AES256", "AES-256",
-+ # TLS 1.3 ciphers are always enabled
-+ "TLS_CHACHA20", "TLS_AES",
-+ ]
-
- stats = server_params_test(client_context, server_context)
- ciphers = stats['server_shared_ciphers'][0]
- self.assertGreater(len(ciphers), 0)
- for name, tls_version, bits in ciphers:
-- if not alg1 in name.split("-") and alg2 not in name:
-+ if not any (alg in name for alg in expected_algs):
- self.fail(name)
-
- def test_read_write_after_close_raises_valuerror(self):
---
-2.17.1
-
diff --git a/external/poky/meta/recipes-devtools/python/python3/0005-bpo-30714-ALPN-changes-for-OpenSSL-1.1.0f-2305.patch b/external/poky/meta/recipes-devtools/python/python3/0005-bpo-30714-ALPN-changes-for-OpenSSL-1.1.0f-2305.patch
deleted file mode 100644
index d6098472..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/0005-bpo-30714-ALPN-changes-for-OpenSSL-1.1.0f-2305.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-From 7b40cb7293cb14e5c7c8ed123efaf9acb33edae2 Mon Sep 17 00:00:00 2001
-From: Christian Heimes <christian@python.org>
-Date: Tue, 15 Aug 2017 10:33:43 +0200
-Subject: [PATCH] bpo-30714: ALPN changes for OpenSSL 1.1.0f (#2305)
-
-OpenSSL 1.1.0 to 1.1.0e aborted the handshake when server and client
-could not agree on a protocol using ALPN. OpenSSL 1.1.0f changed that.
-The most recent version now behaves like OpenSSL 1.0.2 again. The ALPN
-callback can pretend to not been set.
-
-See https://github.com/openssl/openssl/pull/3158 for more details
-
-Signed-off-by: Christian Heimes <christian@python.org>
-
-Upstream-Status: Backport
-[https://github.com/python/cpython/commit/7b40cb7293cb14e5c7c8ed123efaf9acb33edae2]
-
-Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
----
- Doc/library/ssl.rst | 5 +++--
- Lib/test/test_ssl.py | 5 +++--
- .../next/Tests/2017-07-25-15-27-44.bpo-30715.Sp7bTF.rst | 2 ++
- 3 files changed, 8 insertions(+), 4 deletions(-)
- create mode 100644 Misc/NEWS.d/next/Tests/2017-07-25-15-27-44.bpo-30715.Sp7bTF.rst
-
-diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst
-index 729a239a1b..0a09e7e9d4 100644
---- a/Doc/library/ssl.rst
-+++ b/Doc/library/ssl.rst
-@@ -1447,8 +1447,9 @@ to speed up repeated connections from the same clients.
- This method will raise :exc:`NotImplementedError` if :data:`HAS_ALPN` is
- False.
-
-- OpenSSL 1.1.0+ will abort the handshake and raise :exc:`SSLError` when
-- both sides support ALPN but cannot agree on a protocol.
-+ OpenSSL 1.1.0 to 1.1.0e will abort the handshake and raise :exc:`SSLError`
-+ when both sides support ALPN but cannot agree on a protocol. 1.1.0f+
-+ behaves like 1.0.2, :meth:`SSLSocket.selected_alpn_protocol` returns None.
-
- .. versionadded:: 3.5
-
-diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
-index d960d82065..104b7f377a 100644
---- a/Lib/test/test_ssl.py
-+++ b/Lib/test/test_ssl.py
-@@ -3268,8 +3268,9 @@ if _have_threads:
- except ssl.SSLError as e:
- stats = e
-
-- if expected is None and IS_OPENSSL_1_1:
-- # OpenSSL 1.1.0 raises handshake error
-+ if (expected is None and IS_OPENSSL_1_1
-+ and ssl.OPENSSL_VERSION_INFO < (1, 1, 0, 6)):
-+ # OpenSSL 1.1.0 to 1.1.0e raises handshake error
- self.assertIsInstance(stats, ssl.SSLError)
- else:
- msg = "failed trying %s (s) and %s (c).\n" \
-diff --git a/Misc/NEWS.d/next/Tests/2017-07-25-15-27-44.bpo-30715.Sp7bTF.rst b/Misc/NEWS.d/next/Tests/2017-07-25-15-27-44.bpo-30715.Sp7bTF.rst
-new file mode 100644
-index 0000000000..88394e585c
---- /dev/null
-+++ b/Misc/NEWS.d/next/Tests/2017-07-25-15-27-44.bpo-30715.Sp7bTF.rst
-@@ -0,0 +1,2 @@
-+Address ALPN callback changes for OpenSSL 1.1.0f. The latest version behaves
-+like OpenSSL 1.0.2 and no longer aborts handshake.
---
-2.17.1
-
diff --git a/external/poky/meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch b/external/poky/meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch
new file mode 100644
index 00000000..4bd98f62
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/python/python3/0017-setup.py-do-not-report-missing-dependencies-for-disa.patch
@@ -0,0 +1,32 @@
+From a2dd127b4163aff6cc35af0d0251321964232ad4 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Mon, 7 Oct 2019 13:22:14 +0200
+Subject: [PATCH] setup.py: do not report missing dependencies for disabled
+ modules
+
+Reporting those missing dependencies is misleading as the modules would not
+have been built anyway. This particularly matters in oe-core's automated
+build completeness checker which relies on the report.
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ setup.py | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/setup.py b/setup.py
+index 7691258..ec3f2a4 100644
+--- a/setup.py
++++ b/setup.py
+@@ -408,6 +408,10 @@ class PyBuildExt(build_ext):
+ print("%-*s %-*s %-*s" % (longest, e, longest, f,
+ longest, g))
+
++ # There is no need to report missing module dependencies,
++ # if the modules have been disabled in the first place.
++ self.missing = list(set(self.missing) - set(sysconf_dis))
++
+ if self.missing:
+ print()
+ print("Python build finished successfully!")
diff --git a/external/poky/meta/recipes-devtools/python/python3/0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch b/external/poky/meta/recipes-devtools/python/python3/0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch
new file mode 100644
index 00000000..e04a9160
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/python/python3/0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch
@@ -0,0 +1,48 @@
+From 863c09f640a5dfd33ff22915b0d5fee7bc5df70a Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Sun, 16 Feb 2020 17:50:25 +0100
+Subject: [PATCH] configure.ac, setup.py: do not add a curses include path from
+ the host
+
+This leads to host contamination, and particularly can cause
+curses modules to fail at runtime if the host curses is configured
+differently to native curses (observed on current OpenSuse Tumbleweed
+as dnf failures).
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ configure.ac | 6 ------
+ setup.py | 2 --
+ 2 files changed, 8 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 915f475..c911011 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -4828,12 +4828,6 @@ then
+ [Define if you have struct stat.st_mtimensec])
+ fi
+
+-# first curses header check
+-ac_save_cppflags="$CPPFLAGS"
+-if test "$cross_compiling" = no; then
+- CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
+-fi
+-
+ AC_CHECK_HEADERS(curses.h ncurses.h)
+
+ # On Solaris, term.h requires curses.h
+diff --git a/setup.py b/setup.py
+index b0f1541..7208cd0 100644
+--- a/setup.py
++++ b/setup.py
+@@ -973,8 +973,6 @@ class PyBuildExt(build_ext):
+ panel_library = 'panel'
+ if curses_library == 'ncursesw':
+ curses_defines.append(('HAVE_NCURSESW', '1'))
+- if not CROSS_COMPILING:
+- curses_includes.append('/usr/include/ncursesw')
+ # Bug 1464056: If _curses.so links with ncursesw,
+ # _curses_panel.so must link with panelw.
+ panel_library = 'panelw'
diff --git a/external/poky/meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch b/external/poky/meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch
deleted file mode 100644
index fddfd2b2..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch b/external/poky/meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch
deleted file mode 100644
index 6beac7b8..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch b/external/poky/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch
deleted file mode 100644
index b96419a6..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch
+++ /dev/null
@@ -1,92 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch b/external/poky/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
index c53ec0cf..61ac3e71 100644
--- a/external/poky/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
+++ b/external/poky/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
@@ -1,7 +1,7 @@
-From 7630ab22578746d3d790d0598c0d279cf7afed97 Mon Sep 17 00:00:00 2001
+From 251347fc970a397a9cd63ed3f87c5e6c52e15187 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
+Subject: [PATCH] python3: Add target and native recipes
Upstream-Status: Inappropriate [embedded specific]
@@ -14,36 +14,40 @@ Upstream-Status: Inappropriate [embedded specific]
# Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
---
- Lib/distutils/sysconfig.py | 10 ++++++++--
- 1 file changed, 8 insertions(+), 2 deletions(-)
+ Lib/distutils/sysconfig.py | 14 +++++++++++---
+ 1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
-index 573724d..390c485 100644
+index 2df348c..4f8db84 100644
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
-@@ -84,7 +84,9 @@ def get_python_inc(plat_specific=0, prefix=None):
+@@ -96,7 +96,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'] != "":
++ if prefix is None and os.environ.get('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):
+@@ -139,7 +141,13 @@ 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'] != "":
+- if prefix is None:
++ if os.environ.get('STAGING_LIBDIR', ""):
++ lib_basename = os.environ['STAGING_LIBDIR'].split('/')[-1]
++ else:
++ lib_basename = "lib"
++ if prefix is None and os.environ.get('STAGING_LIBDIR', ""):
+ prefix = os.environ['STAGING_LIBDIR'].rstrip(lib_basename)
-+
- if prefix is None:
++ elif 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):
+ else:
+@@ -147,7 +155,7 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
if os.name == "posix":
libpython = os.path.join(prefix,
@@ -52,6 +56,3 @@ index 573724d..390c485 100644
if standard_lib:
return libpython
else:
---
-2.8.0.rc3
-
diff --git a/external/poky/meta/recipes-devtools/python/python3/130-readline-setup.patch b/external/poky/meta/recipes-devtools/python/python3/130-readline-setup.patch
deleted file mode 100644
index c805652d..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/130-readline-setup.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python3/150-fix-setupterm.patch b/external/poky/meta/recipes-devtools/python/python3/150-fix-setupterm.patch
deleted file mode 100644
index 78d7c786..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/150-fix-setupterm.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python3/CVE-2018-14647.patch b/external/poky/meta/recipes-devtools/python/python3/CVE-2018-14647.patch
deleted file mode 100644
index c1f21f82..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/CVE-2018-14647.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-From 610b4b0dbaedd3099ab76acf678e9cc845d99a76 Mon Sep 17 00:00:00 2001
-From: stratakis <cstratak@redhat.com>
-Date: Mon, 25 Feb 2019 22:04:09 +0100
-Subject: [PATCH] [3.5] bpo-34623: Use XML_SetHashSalt in _elementtree (#9933)
-
-* bpo-34623: Use XML_SetHashSalt in _elementtree (GH-9146)
-
-The C accelerated _elementtree module now initializes hash randomization
-salt from _Py_HashSecret instead of libexpat's default CPRNG.
-
-Signed-off-by: Christian Heimes <christian@python.org>
-
-https://bugs.python.org/issue34623
-(cherry picked from commit cb5778f00ce48631c7140f33ba242496aaf7102b)
-
-Co-authored-by: Christian Heimes <christian@python.org>
-
-CVE: CVE-2018-14647
-Upstream-Status: Backport
-[https://github.com/python/cpython/commit/41b48e71ac8a71f56694b548f118bd20ce203410]
-
-Signed-off-by: Dan Tran <dantran@microsoft.com>
----
- Include/pyexpat.h | 4 +++-
- .../next/Security/2018-09-10-16-05-39.bpo-34623.Ua9jMv.rst | 2 ++
- Modules/_elementtree.c | 5 +++++
- Modules/pyexpat.c | 5 +++++
- 4 files changed, 15 insertions(+), 1 deletion(-)
- create mode 100644 Misc/NEWS.d/next/Security/2018-09-10-16-05-39.bpo-34623.Ua9jMv.rst
-
-diff --git a/Include/pyexpat.h b/Include/pyexpat.h
-index 44259bf6d7..07020b5dc9 100644
---- a/Include/pyexpat.h
-+++ b/Include/pyexpat.h
-@@ -3,7 +3,7 @@
-
- /* note: you must import expat.h before importing this module! */
-
--#define PyExpat_CAPI_MAGIC "pyexpat.expat_CAPI 1.0"
-+#define PyExpat_CAPI_MAGIC "pyexpat.expat_CAPI 1.1"
- #define PyExpat_CAPSULE_NAME "pyexpat.expat_CAPI"
-
- struct PyExpat_CAPI
-@@ -48,6 +48,8 @@ struct PyExpat_CAPI
- enum XML_Status (*SetEncoding)(XML_Parser parser, const XML_Char *encoding);
- int (*DefaultUnknownEncodingHandler)(
- void *encodingHandlerData, const XML_Char *name, XML_Encoding *info);
-+ /* might be none for expat < 2.1.0 */
-+ int (*SetHashSalt)(XML_Parser parser, unsigned long hash_salt);
- /* always add new stuff to the end! */
- };
-
-diff --git a/Misc/NEWS.d/next/Security/2018-09-10-16-05-39.bpo-34623.Ua9jMv.rst b/Misc/NEWS.d/next/Security/2018-09-10-16-05-39.bpo-34623.Ua9jMv.rst
-new file mode 100644
-index 0000000000..cbaa4b7506
---- /dev/null
-+++ b/Misc/NEWS.d/next/Security/2018-09-10-16-05-39.bpo-34623.Ua9jMv.rst
-@@ -0,0 +1,2 @@
-+CVE-2018-14647: The C accelerated _elementtree module now initializes hash
-+randomization salt from _Py_HashSecret instead of libexpat's default CSPRNG.
-diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c
-index 5dba9f70a9..90c6daf64a 100644
---- a/Modules/_elementtree.c
-+++ b/Modules/_elementtree.c
-@@ -3282,6 +3282,11 @@ _elementtree_XMLParser___init___impl(XMLParserObject *self, PyObject *html,
- PyErr_NoMemory();
- return -1;
- }
-+ /* expat < 2.1.0 has no XML_SetHashSalt() */
-+ if (EXPAT(SetHashSalt) != NULL) {
-+ EXPAT(SetHashSalt)(self->parser,
-+ (unsigned long)_Py_HashSecret.expat.hashsalt);
-+ }
-
- if (target) {
- Py_INCREF(target);
-diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c
-index adc9b6cde8..948ab1b703 100644
---- a/Modules/pyexpat.c
-+++ b/Modules/pyexpat.c
-@@ -1882,6 +1882,11 @@ MODULE_INITFUNC(void)
- capi.SetStartDoctypeDeclHandler = XML_SetStartDoctypeDeclHandler;
- capi.SetEncoding = XML_SetEncoding;
- capi.DefaultUnknownEncodingHandler = PyUnknownEncodingHandler;
-+#if XML_COMBINED_VERSION >= 20100
-+ capi.SetHashSalt = XML_SetHashSalt;
-+#else
-+ capi.SetHashSalt = NULL;
-+#endif
-
- /* export using capsule */
- capi_object = PyCapsule_New(&capi, PyExpat_CAPSULE_NAME, NULL);
---
-2.22.0.vfs.1.1.57.gbaf16c8
-
diff --git a/external/poky/meta/recipes-devtools/python/python3/CVE-2018-20406.patch b/external/poky/meta/recipes-devtools/python/python3/CVE-2018-20406.patch
deleted file mode 100644
index b69e0c4d..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/CVE-2018-20406.patch
+++ /dev/null
@@ -1,217 +0,0 @@
-From 3c7fd2b2729e3ebcf7877e7a32b3bbabf907a38d Mon Sep 17 00:00:00 2001
-From: Victor Stinner <vstinner@redhat.com>
-Date: Tue, 26 Feb 2019 01:42:39 +0100
-Subject: [PATCH] closes bpo-34656: Avoid relying on signed overflow in _pickle
- memos. (GH-9261) (#11869)
-
-(cherry picked from commit a4ae828ee416a66d8c7bf5ee71d653c2cc6a26dd)
-
-CVE: CVE-2018-20406
-Upstream-Status: Backport
-[https://github.com/python/cpython/commit/ef33dd6036aafbd3f06c1d56e2b1a81dae3da63c]
-
-Signed-off-by: Dan Tran <dantran@microsoft.com>
----
- Modules/_pickle.c | 63 ++++++++++++++++++++++++-----------------------
- 1 file changed, 32 insertions(+), 31 deletions(-)
-
-diff --git a/Modules/_pickle.c b/Modules/_pickle.c
-index 0f62b1c019..fcb9e87899 100644
---- a/Modules/_pickle.c
-+++ b/Modules/_pickle.c
-@@ -527,9 +527,9 @@ typedef struct {
- } PyMemoEntry;
-
- typedef struct {
-- Py_ssize_t mt_mask;
-- Py_ssize_t mt_used;
-- Py_ssize_t mt_allocated;
-+ size_t mt_mask;
-+ size_t mt_used;
-+ size_t mt_allocated;
- PyMemoEntry *mt_table;
- } PyMemoTable;
-
-@@ -573,8 +573,8 @@ typedef struct UnpicklerObject {
- /* The unpickler memo is just an array of PyObject *s. Using a dict
- is unnecessary, since the keys are contiguous ints. */
- PyObject **memo;
-- Py_ssize_t memo_size; /* Capacity of the memo array */
-- Py_ssize_t memo_len; /* Number of objects in the memo */
-+ size_t memo_size; /* Capacity of the memo array */
-+ size_t memo_len; /* Number of objects in the memo */
-
- PyObject *pers_func; /* persistent_load() method, can be NULL. */
-
-@@ -658,7 +658,6 @@ PyMemoTable_New(void)
- static PyMemoTable *
- PyMemoTable_Copy(PyMemoTable *self)
- {
-- Py_ssize_t i;
- PyMemoTable *new = PyMemoTable_New();
- if (new == NULL)
- return NULL;
-@@ -675,7 +674,7 @@ PyMemoTable_Copy(PyMemoTable *self)
- PyErr_NoMemory();
- return NULL;
- }
-- for (i = 0; i < self->mt_allocated; i++) {
-+ for (size_t i = 0; i < self->mt_allocated; i++) {
- Py_XINCREF(self->mt_table[i].me_key);
- }
- memcpy(new->mt_table, self->mt_table,
-@@ -721,7 +720,7 @@ _PyMemoTable_Lookup(PyMemoTable *self, PyObject *key)
- {
- size_t i;
- size_t perturb;
-- size_t mask = (size_t)self->mt_mask;
-+ size_t mask = self->mt_mask;
- PyMemoEntry *table = self->mt_table;
- PyMemoEntry *entry;
- Py_hash_t hash = (Py_hash_t)key >> 3;
-@@ -743,22 +742,24 @@ _PyMemoTable_Lookup(PyMemoTable *self, PyObject *key)
-
- /* Returns -1 on failure, 0 on success. */
- static int
--_PyMemoTable_ResizeTable(PyMemoTable *self, Py_ssize_t min_size)
-+_PyMemoTable_ResizeTable(PyMemoTable *self, size_t min_size)
- {
- PyMemoEntry *oldtable = NULL;
- PyMemoEntry *oldentry, *newentry;
-- Py_ssize_t new_size = MT_MINSIZE;
-- Py_ssize_t to_process;
-+ size_t new_size = MT_MINSIZE;
-+ size_t to_process;
-
- assert(min_size > 0);
-
-- /* Find the smallest valid table size >= min_size. */
-- while (new_size < min_size && new_size > 0)
-- new_size <<= 1;
-- if (new_size <= 0) {
-+ if (min_size > PY_SSIZE_T_MAX) {
- PyErr_NoMemory();
- return -1;
- }
-+
-+ /* Find the smallest valid table size >= min_size. */
-+ while (new_size < min_size) {
-+ new_size <<= 1;
-+ }
- /* new_size needs to be a power of two. */
- assert((new_size & (new_size - 1)) == 0);
-
-@@ -808,6 +809,7 @@ static int
- PyMemoTable_Set(PyMemoTable *self, PyObject *key, Py_ssize_t value)
- {
- PyMemoEntry *entry;
-+ size_t desired_size;
-
- assert(key != NULL);
-
-@@ -831,10 +833,12 @@ PyMemoTable_Set(PyMemoTable *self, PyObject *key, Py_ssize_t value)
- * Very large memo tables (over 50K items) use doubling instead.
- * This may help applications with severe memory constraints.
- */
-- if (!(self->mt_used * 3 >= (self->mt_mask + 1) * 2))
-+ if (SIZE_MAX / 3 >= self->mt_used && self->mt_used * 3 < self->mt_allocated * 2) {
- return 0;
-- return _PyMemoTable_ResizeTable(self,
-- (self->mt_used > 50000 ? 2 : 4) * self->mt_used);
-+ }
-+ // self->mt_used is always < PY_SSIZE_T_MAX, so this can't overflow.
-+ desired_size = (self->mt_used > 50000 ? 2 : 4) * self->mt_used;
-+ return _PyMemoTable_ResizeTable(self, desired_size);
- }
-
- #undef MT_MINSIZE
-@@ -1273,9 +1277,9 @@ _Unpickler_Readline(UnpicklerObject *self, char **result)
- /* Returns -1 (with an exception set) on failure, 0 on success. The memo array
- will be modified in place. */
- static int
--_Unpickler_ResizeMemoList(UnpicklerObject *self, Py_ssize_t new_size)
-+_Unpickler_ResizeMemoList(UnpicklerObject *self, size_t new_size)
- {
-- Py_ssize_t i;
-+ size_t i;
-
- assert(new_size > self->memo_size);
-
-@@ -1292,9 +1296,9 @@ _Unpickler_ResizeMemoList(UnpicklerObject *self, Py_ssize_t new_size)
-
- /* Returns NULL if idx is out of bounds. */
- static PyObject *
--_Unpickler_MemoGet(UnpicklerObject *self, Py_ssize_t idx)
-+_Unpickler_MemoGet(UnpicklerObject *self, size_t idx)
- {
-- if (idx < 0 || idx >= self->memo_size)
-+ if (idx >= self->memo_size)
- return NULL;
-
- return self->memo[idx];
-@@ -1303,7 +1307,7 @@ _Unpickler_MemoGet(UnpicklerObject *self, Py_ssize_t idx)
- /* Returns -1 (with an exception set) on failure, 0 on success.
- This takes its own reference to `value`. */
- static int
--_Unpickler_MemoPut(UnpicklerObject *self, Py_ssize_t idx, PyObject *value)
-+_Unpickler_MemoPut(UnpicklerObject *self, size_t idx, PyObject *value)
- {
- PyObject *old_item;
-
-@@ -4194,14 +4198,13 @@ static PyObject *
- _pickle_PicklerMemoProxy_copy_impl(PicklerMemoProxyObject *self)
- /*[clinic end generated code: output=bb83a919d29225ef input=b73043485ac30b36]*/
- {
-- Py_ssize_t i;
- PyMemoTable *memo;
- PyObject *new_memo = PyDict_New();
- if (new_memo == NULL)
- return NULL;
-
- memo = self->pickler->memo;
-- for (i = 0; i < memo->mt_allocated; ++i) {
-+ for (size_t i = 0; i < memo->mt_allocated; ++i) {
- PyMemoEntry entry = memo->mt_table[i];
- if (entry.me_key != NULL) {
- int status;
-@@ -6620,7 +6623,7 @@ static PyObject *
- _pickle_UnpicklerMemoProxy_copy_impl(UnpicklerMemoProxyObject *self)
- /*[clinic end generated code: output=e12af7e9bc1e4c77 input=97769247ce032c1d]*/
- {
-- Py_ssize_t i;
-+ size_t i;
- PyObject *new_memo = PyDict_New();
- if (new_memo == NULL)
- return NULL;
-@@ -6771,8 +6774,7 @@ static int
- Unpickler_set_memo(UnpicklerObject *self, PyObject *obj)
- {
- PyObject **new_memo;
-- Py_ssize_t new_memo_size = 0;
-- Py_ssize_t i;
-+ size_t new_memo_size = 0;
-
- if (obj == NULL) {
- PyErr_SetString(PyExc_TypeError,
-@@ -6789,7 +6791,7 @@ Unpickler_set_memo(UnpicklerObject *self, PyObject *obj)
- if (new_memo == NULL)
- return -1;
-
-- for (i = 0; i < new_memo_size; i++) {
-+ for (size_t i = 0; i < new_memo_size; i++) {
- Py_XINCREF(unpickler->memo[i]);
- new_memo[i] = unpickler->memo[i];
- }
-@@ -6837,8 +6839,7 @@ Unpickler_set_memo(UnpicklerObject *self, PyObject *obj)
-
- error:
- if (new_memo_size) {
-- i = new_memo_size;
-- while (--i >= 0) {
-+ for (size_t i = new_memo_size - 1; i != SIZE_MAX; i--) {
- Py_XDECREF(new_memo[i]);
- }
- PyMem_FREE(new_memo);
---
-2.22.0.vfs.1.1.57.gbaf16c8
-
diff --git a/external/poky/meta/recipes-devtools/python/python3/CVE-2018-20852.patch b/external/poky/meta/recipes-devtools/python/python3/CVE-2018-20852.patch
deleted file mode 100644
index 82a114f2..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/CVE-2018-20852.patch
+++ /dev/null
@@ -1,129 +0,0 @@
-From 31c16d62fc762ab87e66e7f47e36dbfcfc8b5224 Mon Sep 17 00:00:00 2001
-From: Xtreak <tir.karthi@gmail.com>
-Date: Sun, 17 Mar 2019 05:33:39 +0530
-Subject: [PATCH] [3.5] bpo-35121: prefix dot in domain for proper subdomain
- validation (GH-10258) (#12281)
-
-Don't send cookies of domain A without Domain attribute to domain B when domain A is a suffix match of domain B while using a cookiejar with `http.cookiejar.DefaultCookiePolicy` policy. Patch by Karthikeyan Singaravelan.
-(cherry picked from commit ca7fe5063593958e5efdf90f068582837f07bd14)
-
-Co-authored-by: Xtreak <tir.karthi@gmail.com>
-
-CVE: CVE-2018-20852
-Upstream-Status: Backport
-[https://github.com/python/cpython/commit/4749f1b69000259e23b4cc6f63c542a9bdc62f1b]
-
-Signed-off-by: Dan Tran <dantran@microsoft.com>
----
- Lib/http/cookiejar.py | 13 ++++++--
- Lib/test/test_http_cookiejar.py | 30 +++++++++++++++++++
- .../2018-10-31-15-39-17.bpo-35121.EgHv9k.rst | 4 +++
- 3 files changed, 45 insertions(+), 2 deletions(-)
- create mode 100644 Misc/NEWS.d/next/Security/2018-10-31-15-39-17.bpo-35121.EgHv9k.rst
-
-diff --git a/Lib/http/cookiejar.py b/Lib/http/cookiejar.py
-index 6d4572af03..1cc9378ae4 100644
---- a/Lib/http/cookiejar.py
-+++ b/Lib/http/cookiejar.py
-@@ -1148,6 +1148,11 @@ class DefaultCookiePolicy(CookiePolicy):
- req_host, erhn = eff_request_host(request)
- domain = cookie.domain
-
-+ if domain and not domain.startswith("."):
-+ dotdomain = "." + domain
-+ else:
-+ dotdomain = domain
-+
- # strict check of non-domain cookies: Mozilla does this, MSIE5 doesn't
- if (cookie.version == 0 and
- (self.strict_ns_domain & self.DomainStrictNonDomain) and
-@@ -1160,7 +1165,7 @@ class DefaultCookiePolicy(CookiePolicy):
- _debug(" effective request-host name %s does not domain-match "
- "RFC 2965 cookie domain %s", erhn, domain)
- return False
-- if cookie.version == 0 and not ("."+erhn).endswith(domain):
-+ if cookie.version == 0 and not ("."+erhn).endswith(dotdomain):
- _debug(" request-host %s does not match Netscape cookie domain "
- "%s", req_host, domain)
- return False
-@@ -1174,7 +1179,11 @@ class DefaultCookiePolicy(CookiePolicy):
- req_host = "."+req_host
- if not erhn.startswith("."):
- erhn = "."+erhn
-- if not (req_host.endswith(domain) or erhn.endswith(domain)):
-+ if domain and not domain.startswith("."):
-+ dotdomain = "." + domain
-+ else:
-+ dotdomain = domain
-+ if not (req_host.endswith(dotdomain) or erhn.endswith(dotdomain)):
- #_debug(" request domain %s does not match cookie domain %s",
- # req_host, domain)
- return False
-diff --git a/Lib/test/test_http_cookiejar.py b/Lib/test/test_http_cookiejar.py
-index 49c01ae489..e67e6ae780 100644
---- a/Lib/test/test_http_cookiejar.py
-+++ b/Lib/test/test_http_cookiejar.py
-@@ -417,6 +417,7 @@ class CookieTests(unittest.TestCase):
- ("http://foo.bar.com/", ".foo.bar.com", True),
- ("http://foo.bar.com/", "foo.bar.com", True),
- ("http://foo.bar.com/", ".bar.com", True),
-+ ("http://foo.bar.com/", "bar.com", True),
- ("http://foo.bar.com/", "com", True),
- ("http://foo.com/", "rhubarb.foo.com", False),
- ("http://foo.com/", ".foo.com", True),
-@@ -427,6 +428,8 @@ class CookieTests(unittest.TestCase):
- ("http://foo/", "foo", True),
- ("http://foo/", "foo.local", True),
- ("http://foo/", ".local", True),
-+ ("http://barfoo.com", ".foo.com", False),
-+ ("http://barfoo.com", "foo.com", False),
- ]:
- request = urllib.request.Request(url)
- r = pol.domain_return_ok(domain, request)
-@@ -961,6 +964,33 @@ class CookieTests(unittest.TestCase):
- c.add_cookie_header(req)
- self.assertFalse(req.has_header("Cookie"))
-
-+ c.clear()
-+
-+ pol.set_blocked_domains([])
-+ req = urllib.request.Request("http://acme.com/")
-+ res = FakeResponse(headers, "http://acme.com/")
-+ cookies = c.make_cookies(res, req)
-+ c.extract_cookies(res, req)
-+ self.assertEqual(len(c), 1)
-+
-+ req = urllib.request.Request("http://acme.com/")
-+ c.add_cookie_header(req)
-+ self.assertTrue(req.has_header("Cookie"))
-+
-+ req = urllib.request.Request("http://badacme.com/")
-+ c.add_cookie_header(req)
-+ self.assertFalse(pol.return_ok(cookies[0], req))
-+ self.assertFalse(req.has_header("Cookie"))
-+
-+ p = pol.set_blocked_domains(["acme.com"])
-+ req = urllib.request.Request("http://acme.com/")
-+ c.add_cookie_header(req)
-+ self.assertFalse(req.has_header("Cookie"))
-+
-+ req = urllib.request.Request("http://badacme.com/")
-+ c.add_cookie_header(req)
-+ self.assertFalse(req.has_header("Cookie"))
-+
- def test_secure(self):
- for ns in True, False:
- for whitespace in " ", "":
-diff --git a/Misc/NEWS.d/next/Security/2018-10-31-15-39-17.bpo-35121.EgHv9k.rst b/Misc/NEWS.d/next/Security/2018-10-31-15-39-17.bpo-35121.EgHv9k.rst
-new file mode 100644
-index 0000000000..d2eb8f1f35
---- /dev/null
-+++ b/Misc/NEWS.d/next/Security/2018-10-31-15-39-17.bpo-35121.EgHv9k.rst
-@@ -0,0 +1,4 @@
-+Don't send cookies of domain A without Domain attribute to domain B
-+when domain A is a suffix match of domain B while using a cookiejar
-+with :class:`http.cookiejar.DefaultCookiePolicy` policy. Patch by
-+Karthikeyan Singaravelan.
---
-2.22.0.vfs.1.1.57.gbaf16c8
-
diff --git a/external/poky/meta/recipes-devtools/python/python3/CVE-2019-9636.patch b/external/poky/meta/recipes-devtools/python/python3/CVE-2019-9636.patch
deleted file mode 100644
index ce8eb666..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/CVE-2019-9636.patch
+++ /dev/null
@@ -1,154 +0,0 @@
-From b0305339567b64e07df87620e97e4cb99332aef6 Mon Sep 17 00:00:00 2001
-From: Steve Dower <steve.dower@microsoft.com>
-Date: Sun, 10 Mar 2019 21:59:24 -0700
-Subject: [PATCH] bpo-36216: Add check for characters in netloc that normalize
- to separators (GH-12201) (#12223)
-
-CVE: CVE-2019-9636
-Upstream-Status: Backport
-[https://github.com/python/cpython/commit/c0d95113b070799679bcb9dc49d4960d82e8bb08]
-
-Signed-off-by: Dan Tran <dantran@microsoft.com>
----
- Doc/library/urllib.parse.rst | 18 +++++++++++++++
- Lib/test/test_urlparse.py | 23 +++++++++++++++++++
- Lib/urllib/parse.py | 17 ++++++++++++++
- .../2019-03-06-09-38-40.bpo-36216.6q1m4a.rst | 3 +++
- 4 files changed, 61 insertions(+)
- create mode 100644 Misc/NEWS.d/next/Security/2019-03-06-09-38-40.bpo-36216.6q1m4a.rst
-
-diff --git a/Doc/library/urllib.parse.rst b/Doc/library/urllib.parse.rst
-index 6f722a8897..a4c6b6726e 100644
---- a/Doc/library/urllib.parse.rst
-+++ b/Doc/library/urllib.parse.rst
-@@ -120,6 +120,11 @@ or on combining URL components into a URL string.
- Unmatched square brackets in the :attr:`netloc` attribute will raise a
- :exc:`ValueError`.
-
-+ Characters in the :attr:`netloc` attribute that decompose under NFKC
-+ normalization (as used by the IDNA encoding) into any of ``/``, ``?``,
-+ ``#``, ``@``, or ``:`` will raise a :exc:`ValueError`. If the URL is
-+ decomposed before parsing, no error will be raised.
-+
- .. versionchanged:: 3.2
- Added IPv6 URL parsing capabilities.
-
-@@ -128,6 +133,10 @@ or on combining URL components into a URL string.
- false), in accordance with :rfc:`3986`. Previously, a whitelist of
- schemes that support fragments existed.
-
-+ .. versionchanged:: 3.5.7
-+ Characters that affect netloc parsing under NFKC normalization will
-+ now raise :exc:`ValueError`.
-+
-
- .. function:: parse_qs(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace')
-
-@@ -236,6 +245,15 @@ or on combining URL components into a URL string.
- Unmatched square brackets in the :attr:`netloc` attribute will raise a
- :exc:`ValueError`.
-
-+ Characters in the :attr:`netloc` attribute that decompose under NFKC
-+ normalization (as used by the IDNA encoding) into any of ``/``, ``?``,
-+ ``#``, ``@``, or ``:`` will raise a :exc:`ValueError`. If the URL is
-+ decomposed before parsing, no error will be raised.
-+
-+ .. versionchanged:: 3.5.7
-+ Characters that affect netloc parsing under NFKC normalization will
-+ now raise :exc:`ValueError`.
-+
-
- .. function:: urlunsplit(parts)
-
-diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py
-index e2cf1b7e0f..d0420b0e74 100644
---- a/Lib/test/test_urlparse.py
-+++ b/Lib/test/test_urlparse.py
-@@ -1,3 +1,5 @@
-+import sys
-+import unicodedata
- import unittest
- import urllib.parse
-
-@@ -970,6 +972,27 @@ class UrlParseTestCase(unittest.TestCase):
- expected.append(name)
- self.assertCountEqual(urllib.parse.__all__, expected)
-
-+ def test_urlsplit_normalization(self):
-+ # Certain characters should never occur in the netloc,
-+ # including under normalization.
-+ # Ensure that ALL of them are detected and cause an error
-+ illegal_chars = '/:#?@'
-+ hex_chars = {'{:04X}'.format(ord(c)) for c in illegal_chars}
-+ denorm_chars = [
-+ c for c in map(chr, range(128, sys.maxunicode))
-+ if (hex_chars & set(unicodedata.decomposition(c).split()))
-+ and c not in illegal_chars
-+ ]
-+ # Sanity check that we found at least one such character
-+ self.assertIn('\u2100', denorm_chars)
-+ self.assertIn('\uFF03', denorm_chars)
-+
-+ for scheme in ["http", "https", "ftp"]:
-+ for c in denorm_chars:
-+ url = "{}://netloc{}false.netloc/path".format(scheme, c)
-+ with self.subTest(url=url, char='{:04X}'.format(ord(c))):
-+ with self.assertRaises(ValueError):
-+ urllib.parse.urlsplit(url)
-
- class Utility_Tests(unittest.TestCase):
- """Testcase to test the various utility functions in the urllib."""
-diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py
-index 62e8ddf04b..7ba2b445f5 100644
---- a/Lib/urllib/parse.py
-+++ b/Lib/urllib/parse.py
-@@ -327,6 +327,21 @@ def _splitnetloc(url, start=0):
- delim = min(delim, wdelim) # use earliest delim position
- return url[start:delim], url[delim:] # return (domain, rest)
-
-+def _checknetloc(netloc):
-+ if not netloc or not any(ord(c) > 127 for c in netloc):
-+ return
-+ # looking for characters like \u2100 that expand to 'a/c'
-+ # IDNA uses NFKC equivalence, so normalize for this check
-+ import unicodedata
-+ netloc2 = unicodedata.normalize('NFKC', netloc)
-+ if netloc == netloc2:
-+ return
-+ _, _, netloc = netloc.rpartition('@') # anything to the left of '@' is okay
-+ for c in '/?#@:':
-+ if c in netloc2:
-+ raise ValueError("netloc '" + netloc2 + "' contains invalid " +
-+ "characters under NFKC normalization")
-+
- def urlsplit(url, scheme='', allow_fragments=True):
- """Parse a URL into 5 components:
- <scheme>://<netloc>/<path>?<query>#<fragment>
-@@ -356,6 +371,7 @@ def urlsplit(url, scheme='', allow_fragments=True):
- url, fragment = url.split('#', 1)
- if '?' in url:
- url, query = url.split('?', 1)
-+ _checknetloc(netloc)
- v = SplitResult(scheme, netloc, url, query, fragment)
- _parse_cache[key] = v
- return _coerce_result(v)
-@@ -379,6 +395,7 @@ def urlsplit(url, scheme='', allow_fragments=True):
- url, fragment = url.split('#', 1)
- if '?' in url:
- url, query = url.split('?', 1)
-+ _checknetloc(netloc)
- v = SplitResult(scheme, netloc, url, query, fragment)
- _parse_cache[key] = v
- return _coerce_result(v)
-diff --git a/Misc/NEWS.d/next/Security/2019-03-06-09-38-40.bpo-36216.6q1m4a.rst b/Misc/NEWS.d/next/Security/2019-03-06-09-38-40.bpo-36216.6q1m4a.rst
-new file mode 100644
-index 0000000000..5546394157
---- /dev/null
-+++ b/Misc/NEWS.d/next/Security/2019-03-06-09-38-40.bpo-36216.6q1m4a.rst
-@@ -0,0 +1,3 @@
-+Changes urlsplit() to raise ValueError when the URL contains characters that
-+decompose under IDNA encoding (NFKC-normalization) into characters that
-+affect how the URL is parsed.
---
-2.22.0.vfs.1.1.57.gbaf16c8
-
diff --git a/external/poky/meta/recipes-devtools/python/python3/CVE-2019-9740.patch b/external/poky/meta/recipes-devtools/python/python3/CVE-2019-9740.patch
deleted file mode 100644
index 83709016..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/CVE-2019-9740.patch
+++ /dev/null
@@ -1,155 +0,0 @@
-From afe3a4975cf93c97e5d6eb8800e48f368011d37a Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
-Date: Sun, 14 Jul 2019 11:07:11 +0200
-Subject: [PATCH] bpo-30458: Disallow control chars in http URLs. (GH-12755)
- (#13207)
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Disallow control chars in http URLs in urllib.urlopen. This addresses a potential security problem for applications that do not sanity check their URLs where http request headers could be injected.
-
-Disable https related urllib tests on a build without ssl (GH-13032)
-These tests require an SSL enabled build. Skip these tests when python is built without SSL to fix test failures.
-
-Use http.client.InvalidURL instead of ValueError as the new error case's exception. (GH-13044)
-
-Co-Authored-By: Miro Hrončok <miro@hroncok.cz>
-Upstream-Status: Backport[https://github.com/python/cpython/commit/afe3a4975cf93c97e5d6eb8800e48f368011d37a]
-CVE: CVE-2019-9740
-CVE: CVE-2019-9947
-Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
----
- Lib/http/client.py | 16 ++++++
- Lib/test/test_urllib.py | 55 +++++++++++++++++++
- Lib/test/test_xmlrpc.py | 8 ++-
- .../2019-04-10-08-53-30.bpo-30458.51E-DA.rst | 1 +
- 4 files changed, 79 insertions(+), 1 deletion(-)
- create mode 100644 Misc/NEWS.d/next/Security/2019-04-10-08-53-30.bpo-30458.51E-DA.rst
-
-diff --git a/Lib/http/client.py b/Lib/http/client.py
-index 352c1017adce..76b9be69a374 100644
---- a/Lib/http/client.py
-+++ b/Lib/http/client.py
-@@ -141,6 +141,16 @@
- _is_legal_header_name = re.compile(rb'[^:\s][^:\r\n]*').fullmatch
- _is_illegal_header_value = re.compile(rb'\n(?![ \t])|\r(?![ \t\n])').search
-
-+# These characters are not allowed within HTTP URL paths.
-+# See https://tools.ietf.org/html/rfc3986#section-3.3 and the
-+# https://tools.ietf.org/html/rfc3986#appendix-A pchar definition.
-+# Prevents CVE-2019-9740. Includes control characters such as \r\n.
-+# We don't restrict chars above \x7f as putrequest() limits us to ASCII.
-+_contains_disallowed_url_pchar_re = re.compile('[\x00-\x20\x7f]')
-+# Arguably only these _should_ allowed:
-+# _is_allowed_url_pchars_re = re.compile(r"^[/!$&'()*+,;=:@%a-zA-Z0-9._~-]+$")
-+# We are more lenient for assumed real world compatibility purposes.
-+
- # We always set the Content-Length header for these methods because some
- # servers will otherwise respond with a 411
- _METHODS_EXPECTING_BODY = {'PATCH', 'POST', 'PUT'}
-@@ -978,6 +988,12 @@ def putrequest(self, method, url, skip_host=False,
- self._method = method
- if not url:
- url = '/'
-+ # Prevent CVE-2019-9740.
-+ match = _contains_disallowed_url_pchar_re.search(url)
-+ if match:
-+ raise InvalidURL("URL can't contain control characters. {!r} "
-+ "(found at least {!r})".format(url,
-+ match.group()))
- request = '%s %s %s' % (method, url, self._http_vsn_str)
-
- # Non-ASCII characters should have been eliminated earlier
-diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py
-index 3afb1312de32..1e2c622e29fd 100644
---- a/Lib/test/test_urllib.py
-+++ b/Lib/test/test_urllib.py
-@@ -330,6 +330,61 @@ def test_willclose(self):
- finally:
- self.unfakehttp()
-
-+ @unittest.skipUnless(ssl, "ssl module required")
-+ def test_url_with_control_char_rejected(self):
-+ for char_no in list(range(0, 0x21)) + [0x7f]:
-+ char = chr(char_no)
-+ schemeless_url = "//localhost:7777/test{}/".format(char)
-+ self.fakehttp(b"HTTP/1.1 200 OK\r\n\r\nHello.")
-+ try:
-+ # We explicitly test urllib.request.urlopen() instead of the top
-+ # level 'def urlopen()' function defined in this... (quite ugly)
-+ # test suite. They use different url opening codepaths. Plain
-+ # urlopen uses FancyURLOpener which goes via a codepath that
-+ # calls urllib.parse.quote() on the URL which makes all of the
-+ # above attempts at injection within the url _path_ safe.
-+ escaped_char_repr = repr(char).replace('\\', r'\\')
-+ InvalidURL = http.client.InvalidURL
-+ with self.assertRaisesRegex(
-+ InvalidURL,
-+ "contain control.*{}".format(escaped_char_repr)):
-+ urllib.request.urlopen("http:{}".format(schemeless_url))
-+ with self.assertRaisesRegex(
-+ InvalidURL,
-+ "contain control.*{}".format(escaped_char_repr)):
-+ urllib.request.urlopen("https:{}".format(schemeless_url))
-+ # This code path quotes the URL so there is no injection.
-+ resp = urlopen("http:{}".format(schemeless_url))
-+ self.assertNotIn(char, resp.geturl())
-+ finally:
-+ self.unfakehttp()
-+
-+ @unittest.skipUnless(ssl, "ssl module required")
-+ def test_url_with_newline_header_injection_rejected(self):
-+ self.fakehttp(b"HTTP/1.1 200 OK\r\n\r\nHello.")
-+ host = "localhost:7777?a=1 HTTP/1.1\r\nX-injected: header\r\nTEST: 123"
-+ schemeless_url = "//" + host + ":8080/test/?test=a"
-+ try:
-+ # We explicitly test urllib.request.urlopen() instead of the top
-+ # level 'def urlopen()' function defined in this... (quite ugly)
-+ # test suite. They use different url opening codepaths. Plain
-+ # urlopen uses FancyURLOpener which goes via a codepath that
-+ # calls urllib.parse.quote() on the URL which makes all of the
-+ # above attempts at injection within the url _path_ safe.
-+ InvalidURL = http.client.InvalidURL
-+ with self.assertRaisesRegex(
-+ InvalidURL, r"contain control.*\\r.*(found at least . .)"):
-+ urllib.request.urlopen("http:{}".format(schemeless_url))
-+ with self.assertRaisesRegex(InvalidURL, r"contain control.*\\n"):
-+ urllib.request.urlopen("https:{}".format(schemeless_url))
-+ # This code path quotes the URL so there is no injection.
-+ resp = urlopen("http:{}".format(schemeless_url))
-+ self.assertNotIn(' ', resp.geturl())
-+ self.assertNotIn('\r', resp.geturl())
-+ self.assertNotIn('\n', resp.geturl())
-+ finally:
-+ self.unfakehttp()
-+
- def test_read_0_9(self):
- # "0.9" response accepted (but not "simple responses" without
- # a status line)
-diff --git a/Lib/test/test_xmlrpc.py b/Lib/test/test_xmlrpc.py
-index c2de057ecbfa..99e510fcee86 100644
---- a/Lib/test/test_xmlrpc.py
-+++ b/Lib/test/test_xmlrpc.py
-@@ -896,7 +896,13 @@ def test_unicode_host(self):
- def test_partial_post(self):
- # Check that a partial POST doesn't make the server loop: issue #14001.
- conn = http.client.HTTPConnection(ADDR, PORT)
-- conn.request('POST', '/RPC2 HTTP/1.0\r\nContent-Length: 100\r\n\r\nbye')
-+ conn.send('POST /RPC2 HTTP/1.0\r\n'
-+ 'Content-Length: 100\r\n\r\n'
-+ 'bye HTTP/1.1\r\n'
-+ 'Host: {}:{}\r\n'
-+ 'Accept-Encoding: identity\r\n'
-+ 'Content-Length: 0\r\n\r\n'
-+ .format(ADDR, PORT).encode('ascii'))
- conn.close()
-
- def test_context_manager(self):
-diff --git a/Misc/NEWS.d/next/Security/2019-04-10-08-53-30.bpo-30458.51E-DA.rst b/Misc/NEWS.d/next/Security/2019-04-10-08-53-30.bpo-30458.51E-DA.rst
-new file mode 100644
-index 000000000000..ed8027fb4d64
---- /dev/null
-+++ b/Misc/NEWS.d/next/Security/2019-04-10-08-53-30.bpo-30458.51E-DA.rst
-@@ -0,0 +1 @@
-+Address CVE-2019-9740 by disallowing URL paths with embedded whitespace or control characters through into the underlying http client request. Such potentially malicious header injection URLs now cause an http.client.InvalidURL exception to be raised.
diff --git a/external/poky/meta/recipes-devtools/python/python3/CVE-2020-14422.patch b/external/poky/meta/recipes-devtools/python/python3/CVE-2020-14422.patch
new file mode 100644
index 00000000..6889e46d
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/python/python3/CVE-2020-14422.patch
@@ -0,0 +1,77 @@
+From dc8ce8ead182de46584cc1ed8a8c51d48240cbd5 Mon Sep 17 00:00:00 2001
+From: "Miss Islington (bot)"
+ <31488909+miss-islington@users.noreply.github.com>
+Date: Mon, 29 Jun 2020 11:12:50 -0700
+Subject: [PATCH] bpo-41004: Resolve hash collisions for IPv4Interface and
+ IPv6Interface (GH-21033)
+
+The __hash__() methods of classes IPv4Interface and IPv6Interface had issue
+of generating constant hash values of 32 and 128 respectively causing hash collisions.
+The fix uses the hash() function to generate hash values for the objects
+instead of XOR operation
+(cherry picked from commit b30ee26e366bf509b7538d79bfec6c6d38d53f28)
+
+Co-authored-by: Ravi Teja P <rvteja92@gmail.com>
+
+Upstream-Status: Backport [https://github.com/python/cpython/commit/dc8ce8ead182de46584cc1ed8a8c51d48240cbd5]
+CVE: CVE-2020-14422
+Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
+---
+ Lib/ipaddress.py | 4 ++--
+ Lib/test/test_ipaddress.py | 12 ++++++++++++
+ .../2020-06-29-16-02-29.bpo-41004.ovF0KZ.rst | 1 +
+ 3 files changed, 15 insertions(+), 2 deletions(-)
+ create mode 100644 Misc/NEWS.d/next/Security/2020-06-29-16-02-29.bpo-41004.ovF0KZ.rst
+
+diff --git a/Lib/ipaddress.py b/Lib/ipaddress.py
+index 873c7644081af..a3a04f7f4b309 100644
+--- a/Lib/ipaddress.py
++++ b/Lib/ipaddress.py
+@@ -1370,7 +1370,7 @@ def __lt__(self, other):
+ return False
+
+ def __hash__(self):
+- return self._ip ^ self._prefixlen ^ int(self.network.network_address)
++ return hash((self._ip, self._prefixlen, int(self.network.network_address)))
+
+ __reduce__ = _IPAddressBase.__reduce__
+
+@@ -2017,7 +2017,7 @@ def __lt__(self, other):
+ return False
+
+ def __hash__(self):
+- return self._ip ^ self._prefixlen ^ int(self.network.network_address)
++ return hash((self._ip, self._prefixlen, int(self.network.network_address)))
+
+ __reduce__ = _IPAddressBase.__reduce__
+
+diff --git a/Lib/test/test_ipaddress.py b/Lib/test/test_ipaddress.py
+index de77111705b69..2eba740e5e7a4 100644
+--- a/Lib/test/test_ipaddress.py
++++ b/Lib/test/test_ipaddress.py
+@@ -2053,6 +2053,18 @@ def testsixtofour(self):
+ sixtofouraddr.sixtofour)
+ self.assertFalse(bad_addr.sixtofour)
+
++ # issue41004 Hash collisions in IPv4Interface and IPv6Interface
++ def testV4HashIsNotConstant(self):
++ ipv4_address1 = ipaddress.IPv4Interface("1.2.3.4")
++ ipv4_address2 = ipaddress.IPv4Interface("2.3.4.5")
++ self.assertNotEqual(ipv4_address1.__hash__(), ipv4_address2.__hash__())
++
++ # issue41004 Hash collisions in IPv4Interface and IPv6Interface
++ def testV6HashIsNotConstant(self):
++ ipv6_address1 = ipaddress.IPv6Interface("2001:658:22a:cafe:200:0:0:1")
++ ipv6_address2 = ipaddress.IPv6Interface("2001:658:22a:cafe:200:0:0:2")
++ self.assertNotEqual(ipv6_address1.__hash__(), ipv6_address2.__hash__())
++
+
+ if __name__ == '__main__':
+ unittest.main()
+diff --git a/Misc/NEWS.d/next/Security/2020-06-29-16-02-29.bpo-41004.ovF0KZ.rst b/Misc/NEWS.d/next/Security/2020-06-29-16-02-29.bpo-41004.ovF0KZ.rst
+new file mode 100644
+index 0000000000000..1380b31fbe9f4
+--- /dev/null
++++ b/Misc/NEWS.d/next/Security/2020-06-29-16-02-29.bpo-41004.ovF0KZ.rst
+@@ -0,0 +1 @@
++The __hash__() methods of ipaddress.IPv4Interface and ipaddress.IPv6Interface incorrectly generated constant hash values of 32 and 128 respectively. This resulted in always causing hash collisions. The fix uses hash() to generate hash values for the tuple of (address, mask length, network address).
diff --git a/external/poky/meta/recipes-devtools/python/python3/Use-correct-CFLAGS-for-extensions-when-cross-compili.patch b/external/poky/meta/recipes-devtools/python/python3/Use-correct-CFLAGS-for-extensions-when-cross-compili.patch
deleted file mode 100644
index ae74ef53..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/Use-correct-CFLAGS-for-extensions-when-cross-compili.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From 7fd121bb7d6c25c2e0a1c31cf76fb9bd4a9794de Mon Sep 17 00:00:00 2001
-From: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-Date: Tue, 14 Aug 2018 14:11:35 +0800
-Subject: [PATCH 1/2] Use correct CFLAGS for extensions when cross-compiling
-
-Take PY_CFLAGS_NODIST into account, like in native build. This is needed
-in order to to profile-optimized build. Also, pass EXTRA_CFLAGS to
-profile-optimized build.
-
-Upstream-Status: Pending
-
-Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
----
- Makefile.pre.in | 4 ++--
- setup.py | 3 ++-
- 2 files changed, 4 insertions(+), 3 deletions(-)
-
-diff --git a/Makefile.pre.in b/Makefile.pre.in
-index e2d5d3d..84bc3ff 100644
---- a/Makefile.pre.in
-+++ b/Makefile.pre.in
-@@ -478,7 +478,7 @@ profile-opt:
- $(MAKE) profile-removal
-
- build_all_generate_profile:
-- $(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS) $(PGO_PROF_GEN_FLAG) @LTOFLAGS@" LDFLAGS="$(LDFLAGS) $(PGO_PROF_GEN_FLAG) @LTOFLAGS@" LIBS="$(LIBS)"
-+ $(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS) $(EXTRA_CFLAGS) $(PGO_PROF_GEN_FLAG) @LTOFLAGS@" LDFLAGS="$(LDFLAGS) $(PGO_PROF_GEN_FLAG) @LTOFLAGS@" LIBS="$(LIBS)"
-
- run_profile_task:
- : # FIXME: can't run for a cross build
-@@ -488,7 +488,7 @@ build_all_merge_profile:
- $(LLVM_PROF_MERGER)
-
- build_all_use_profile:
-- $(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS) $(PGO_PROF_USE_FLAG) @LTOFLAGS@" LDFLAGS="$(LDFLAGS) @LTOFLAGS@"
-+ $(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS) $(EXTRA_CFLAGS) $(PGO_PROF_USE_FLAG) @LTOFLAGS@" LDFLAGS="$(LDFLAGS) @LTOFLAGS@"
-
- # Compile and run with gcov
- .PHONY=coverage coverage-lcov coverage-report
-diff --git a/setup.py b/setup.py
-index add3346..65e83b1 100644
---- a/setup.py
-+++ b/setup.py
-@@ -263,7 +263,8 @@ class PyBuildExt(build_ext):
- # compilers
- if compiler is not None:
- if cross_compiling:
-- (ccshared,cflags) = (os.environ.get('CCSHARED') or '', os.environ.get('CFLAGS') or '')
-+ (ccshared,cflags) = (os.environ.get('CCSHARED') or '',
-+ (os.environ.get('CFLAGS') or '') + ' ' + sysconfig.get_config_var('PY_CFLAGS_NODIST'))
- else:
- (ccshared,cflags) = sysconfig.get_config_vars('CCSHARED','CFLAGS')
- args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags
---
-2.17.1
-
diff --git a/external/poky/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch b/external/poky/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch
deleted file mode 100644
index f29ae533..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch b/external/poky/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch
index a3cc48c9..184540e7 100644
--- a/external/poky/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch
+++ b/external/poky/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch
@@ -1,29 +1,31 @@
-_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.
+From ba7202700578d435b07cfdfb7b57e83185752800 Mon Sep 17 00:00:00 2001
+From: Andrei Gherzan <andrei@gherzan.ro>
+Date: Mon, 28 Jan 2019 15:57:54 +0000
+Subject: [PATCH] _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')
+---
+ setup.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index ab18ff0..7691258 100644
+--- a/setup.py
++++ b/setup.py
+@@ -1706,8 +1706,8 @@ class PyBuildExt(build_ext):
+ self.detect_decimal()
+ self.detect_ctypes()
+ self.detect_multiprocessing()
+- if not self.detect_tkinter():
+- self.missing.append('_tkinter')
++# if not self.detect_tkinter():
++# self.missing.append('_tkinter')
+ self.detect_uuid()
## # Uncomment these lines if you want to play with xxmodule.c
- ## ext = Extension('xx', ['xxmodule.c'])
diff --git a/external/poky/meta/recipes-devtools/python/python3/cgi_py.patch b/external/poky/meta/recipes-devtools/python/python3/cgi_py.patch
index de504f9d..6c4ba543 100644
--- a/external/poky/meta/recipes-devtools/python/python3/cgi_py.patch
+++ b/external/poky/meta/recipes-devtools/python/python3/cgi_py.patch
@@ -1,11 +1,20 @@
-Lib/cgi.py: Update the script as mentioned in the comment
+From 62336285cba38017b35cb761c03f0c7e80a671a3 Mon Sep 17 00:00:00 2001
+From: Mark Hatle <mark.hatle@windriver.com>
+Date: Wed, 21 Sep 2011 20:55:33 -0500
+Subject: [PATCH] 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
+---
+ Lib/cgi.py | 11 +----------
+ 1 file changed, 1 insertion(+), 10 deletions(-)
+
+diff --git a/Lib/cgi.py b/Lib/cgi.py
+index 8cf6687..094c7b4 100755
+--- a/Lib/cgi.py
++++ b/Lib/cgi.py
@@ -1,13 +1,4 @@
-#! /usr/local/bin/python
-
diff --git a/external/poky/meta/recipes-devtools/python/python3/check_build_completeness.py b/external/poky/meta/recipes-devtools/python/python3/check_build_completeness.py
new file mode 100755
index 00000000..a1eace3f
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/python/python3/check_build_completeness.py
@@ -0,0 +1,17 @@
+#!/usr/bin/env python3
+import sys
+logfile = open(sys.argv[1]).read()
+
+necessary_bits = logfile.find("The necessary bits to build these optional modules were not found")
+to_find_bits = logfile.find("To find the necessary bits, look in setup.py in detect_modules() for the module's name.")
+if necessary_bits != -1:
+ print("%s" %(logfile[necessary_bits:to_find_bits]))
+
+failed_to_build = logfile.find("Failed to build these modules:")
+if failed_to_build != -1:
+ failed_to_build_end = logfile.find("\n\n", failed_to_build)
+ print("%s" %(logfile[failed_to_build:failed_to_build_end]))
+
+if necessary_bits != -1 or failed_to_build != -1:
+ sys.exit(1)
+
diff --git a/external/poky/meta/recipes-devtools/python/python3/configure.ac-fix-LIBPL.patch b/external/poky/meta/recipes-devtools/python/python3/configure.ac-fix-LIBPL.patch
deleted file mode 100644
index 97214f9a..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/configure.ac-fix-LIBPL.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python3/create_manifest3.py b/external/poky/meta/recipes-devtools/python/python3/create_manifest3.py
index fddb23cd..4da02a29 100644
--- a/external/poky/meta/recipes-devtools/python/python3/create_manifest3.py
+++ b/external/poky/meta/recipes-devtools/python/python3/create_manifest3.py
@@ -22,7 +22,7 @@
#
#
# 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
+# this process, on 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
@@ -36,7 +36,7 @@
# 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>
+# Author: Alejandro Enedino Hernandez Samaniego "aehs29" <aehs29 at gmail dot com>
import sys
@@ -78,9 +78,21 @@ def isCached(item):
else:
return False
+def prepend_comments(comments, json_manifest):
+ with open(json_manifest, 'r+') as manifest:
+ json_contents = manifest.read()
+ manifest.seek(0, 0)
+ manifest.write(comments + json_contents)
+
# Read existing JSON manifest
with open('python3-manifest.json') as manifest:
- old_manifest = json.load(manifest, object_pairs_hook=collections.OrderedDict)
+ # The JSON format doesn't allow comments so we hack the call to keep the comments using a marker
+ manifest_str = manifest.read()
+ json_start = manifest_str.find('# EOC') + 6 # EOC + \n
+ manifest.seek(0)
+ comments = manifest.read(json_start)
+ manifest_str = manifest.read()
+ old_manifest = json.loads(manifest_str, object_pairs_hook=collections.OrderedDict)
#
# First pass to get core-package functionality, because we base everything on the fact that core is actually working
@@ -298,7 +310,13 @@ for pypkg in old_manifest:
pymodule_dep = pymodule_dep.replace(pyversion,'${PYTHON_MAJMIN}')
inFolders = False
for folder in allfolders:
- if folder in pymodule_dep:
+ # The module could have a directory named after it, e.g. xml, if we take out the filename from the path
+ # we'll end up with ${libdir}, and we want ${libdir}/xml
+ if isFolder(pymodule_dep):
+ check_path = pymodule_dep
+ else:
+ check_path = os.path.dirname(pymodule_dep)
+ if folder in check_path :
inFolders = True # Did we find a folder?
folderFound = False # Second flag to break inner for
# Loop only through packages which contain folders
@@ -402,6 +420,8 @@ with open('python3-manifest.json.new','w') as outfile:
json.dump(new_manifest,outfile, indent=4)
outfile.write('\n')
+prepend_comments(comments,'python3-manifest.json.new')
+
if (repeated):
error_msg = '\n\nERROR:\n'
error_msg += 'The following files are repeated (contained in more than one package),\n'
diff --git a/external/poky/meta/recipes-devtools/python/python/add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch b/external/poky/meta/recipes-devtools/python/python3/crosspythonpath.patch
index 32973406..d789ab57 100644
--- a/external/poky/meta/recipes-devtools/python/python/add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch
+++ b/external/poky/meta/recipes-devtools/python/python3/crosspythonpath.patch
@@ -7,22 +7,19 @@ 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
+Credits-to: Mark Hatle <mark.hatle@windriver.com>
+Credits-to: Jackie Huang <jackie.huang@windriver.com>
+Signed-off-by: Ricardo Ribalda <ricardo@ribalda.com>
+diff --git a/configure.ac b/configure.ac
+index 4ab19a6..7036a53 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -76,7 +76,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
+- 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 _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) '$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 _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) '$interp
fi
elif test "$cross_compiling" = maybe; then
AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH])
diff --git a/external/poky/meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch b/external/poky/meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch
deleted file mode 100644
index 0610565d..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python3/float-endian.patch b/external/poky/meta/recipes-devtools/python/python3/float-endian.patch
deleted file mode 100644
index 6ba3f5c2..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/float-endian.patch
+++ /dev/null
@@ -1,212 +0,0 @@
-Python uses AC_RUN_IFELSE to determine the byte order for floats and doubles,
-and falls back onto "I don't know" if it can't run code. This results in
-crippled floating point numbers in Python, and the regression tests fail.
-
-Instead of running code, take a macro from autoconf-archive which compiles C
-with a special double in which has an ASCII representation, and then greps the
-binary to identify the format.
-
-Upstream-Status: Submitted [https://bugs.python.org/issue34585]
-Signed-off-by: Ross Burton <ross.burton@intel.com>
-
-From 50df2a4c3a65ed06322be7c26d42b06ce81730c1 Mon Sep 17 00:00:00 2001
-From: Ross Burton <ross.burton@intel.com>
-Date: Wed, 5 Sep 2018 11:45:52 +0100
-Subject: [PATCH] Don't do runtime test to get float byte order
-
----
- configure.ac | 74 +++++------------------------------
- m4/ax_c_float_words_bigendian.m4 | 83 ++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 92 insertions(+), 65 deletions(-)
- create mode 100644 m4/ax_c_float_words_bigendian.m4
-
-diff --git a/configure.ac b/configure.ac
-index c9b755f0f4..1215969871 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -9,6 +9,8 @@ AC_PREREQ(2.65)
-
- AC_INIT(python, PYTHON_VERSION, https://bugs.python.org/)
-
-+AC_CONFIG_MACRO_DIR(m4)
-+
- AC_SUBST(BASECPPFLAGS)
- if test "$srcdir" != . -a "$srcdir" != "$(pwd)"; then
- # If we're building out-of-tree, we need to make sure the following
-@@ -4128,77 +4130,19 @@ fi
- # * Check for various properties of floating point *
- # **************************************************
-
--AC_MSG_CHECKING(whether C doubles are little-endian IEEE 754 binary64)
--AC_CACHE_VAL(ac_cv_little_endian_double, [
--AC_RUN_IFELSE([AC_LANG_SOURCE([[
--#include <string.h>
--int main() {
-- double x = 9006104071832581.0;
-- if (memcmp(&x, "\x05\x04\x03\x02\x01\xff\x3f\x43", 8) == 0)
-- return 0;
-- else
-- return 1;
--}
--]])],
--[ac_cv_little_endian_double=yes],
--[ac_cv_little_endian_double=no],
--[ac_cv_little_endian_double=no])])
--AC_MSG_RESULT($ac_cv_little_endian_double)
--if test "$ac_cv_little_endian_double" = yes
--then
-- AC_DEFINE(DOUBLE_IS_LITTLE_ENDIAN_IEEE754, 1,
-- [Define if C doubles are 64-bit IEEE 754 binary format, stored
-- with the least significant byte first])
--fi
--
--AC_MSG_CHECKING(whether C doubles are big-endian IEEE 754 binary64)
--AC_CACHE_VAL(ac_cv_big_endian_double, [
--AC_RUN_IFELSE([AC_LANG_SOURCE([[
--#include <string.h>
--int main() {
-- double x = 9006104071832581.0;
-- if (memcmp(&x, "\x43\x3f\xff\x01\x02\x03\x04\x05", 8) == 0)
-- return 0;
-- else
-- return 1;
--}
--]])],
--[ac_cv_big_endian_double=yes],
--[ac_cv_big_endian_double=no],
--[ac_cv_big_endian_double=no])])
--AC_MSG_RESULT($ac_cv_big_endian_double)
--if test "$ac_cv_big_endian_double" = yes
-+AX_C_FLOAT_WORDS_BIGENDIAN
-+if test "$ax_cv_c_float_words_bigendian" = "yes"
- then
- AC_DEFINE(DOUBLE_IS_BIG_ENDIAN_IEEE754, 1,
- [Define if C doubles are 64-bit IEEE 754 binary format, stored
- with the most significant byte first])
--fi
--
--# Some ARM platforms use a mixed-endian representation for doubles.
--# While Python doesn't currently have full support for these platforms
--# (see e.g., issue 1762561), we can at least make sure that float <-> string
--# conversions work.
--AC_MSG_CHECKING(whether C doubles are ARM mixed-endian IEEE 754 binary64)
--AC_CACHE_VAL(ac_cv_mixed_endian_double, [
--AC_RUN_IFELSE([AC_LANG_SOURCE([[
--#include <string.h>
--int main() {
-- double x = 9006104071832581.0;
-- if (memcmp(&x, "\x01\xff\x3f\x43\x05\x04\x03\x02", 8) == 0)
-- return 0;
-- else
-- return 1;
--}
--]])],
--[ac_cv_mixed_endian_double=yes],
--[ac_cv_mixed_endian_double=no],
--[ac_cv_mixed_endian_double=no])])
--AC_MSG_RESULT($ac_cv_mixed_endian_double)
--if test "$ac_cv_mixed_endian_double" = yes
-+elif test "$ax_cv_c_float_words_bigendian" = "no"
- then
-- AC_DEFINE(DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754, 1,
-+ AC_DEFINE(DOUBLE_IS_LITTLE_ENDIAN_IEEE754, 1,
- [Define if C doubles are 64-bit IEEE 754 binary format, stored
-- in ARM mixed-endian order (byte order 45670123)])
-+ with the least significant byte first])
-+else
-+ AC_MSG_ERROR([Cannot identify floating point byte order])
- fi
-
- # The short float repr introduced in Python 3.1 requires the
-diff --git a/m4/ax_c_float_words_bigendian.m4 b/m4/ax_c_float_words_bigendian.m4
-new file mode 100644
-index 0000000000..216b90d803
---- /dev/null
-+++ b/m4/ax_c_float_words_bigendian.m4
-@@ -0,0 +1,83 @@
-+# ===============================================================================
-+# https://www.gnu.org/software/autoconf-archive/ax_c_float_words_bigendian.html
-+# ===============================================================================
-+#
-+# SYNOPSIS
-+#
-+# AX_C_FLOAT_WORDS_BIGENDIAN([ACTION-IF-TRUE], [ACTION-IF-FALSE], [ACTION-IF-UNKNOWN])
-+#
-+# DESCRIPTION
-+#
-+# Checks the ordering of words within a multi-word float. This check is
-+# necessary because on some systems (e.g. certain ARM systems), the float
-+# word ordering can be different from the byte ordering. In a multi-word
-+# float context, "big-endian" implies that the word containing the sign
-+# bit is found in the memory location with the lowest address. This
-+# implementation was inspired by the AC_C_BIGENDIAN macro in autoconf.
-+#
-+# The endianness is detected by first compiling C code that contains a
-+# special double float value, then grepping the resulting object file for
-+# certain strings of ASCII values. The double is specially crafted to have
-+# a binary representation that corresponds with a simple string. In this
-+# implementation, the string "noonsees" was selected because the
-+# individual word values ("noon" and "sees") are palindromes, thus making
-+# this test byte-order agnostic. If grep finds the string "noonsees" in
-+# the object file, the target platform stores float words in big-endian
-+# order. If grep finds "seesnoon", float words are in little-endian order.
-+# If neither value is found, the user is instructed to specify the
-+# ordering.
-+#
-+# LICENSE
-+#
-+# Copyright (c) 2008 Daniel Amelang <dan@amelang.net>
-+#
-+# Copying and distribution of this file, with or without modification, are
-+# permitted in any medium without royalty provided the copyright notice
-+# and this notice are preserved. This file is offered as-is, without any
-+# warranty.
-+
-+#serial 11
-+
-+AC_DEFUN([AX_C_FLOAT_WORDS_BIGENDIAN],
-+ [AC_CACHE_CHECK(whether float word ordering is bigendian,
-+ ax_cv_c_float_words_bigendian, [
-+
-+ax_cv_c_float_words_bigendian=unknown
-+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
-+
-+double d = 90904234967036810337470478905505011476211692735615632014797120844053488865816695273723469097858056257517020191247487429516932130503560650002327564517570778480236724525140520121371739201496540132640109977779420565776568942592.0;
-+
-+]])], [
-+
-+if grep noonsees conftest.$ac_objext >/dev/null ; then
-+ ax_cv_c_float_words_bigendian=yes
-+fi
-+if grep seesnoon conftest.$ac_objext >/dev/null ; then
-+ if test "$ax_cv_c_float_words_bigendian" = unknown; then
-+ ax_cv_c_float_words_bigendian=no
-+ else
-+ ax_cv_c_float_words_bigendian=unknown
-+ fi
-+fi
-+
-+])])
-+
-+case $ax_cv_c_float_words_bigendian in
-+ yes)
-+ m4_default([$1],
-+ [AC_DEFINE([FLOAT_WORDS_BIGENDIAN], 1,
-+ [Define to 1 if your system stores words within floats
-+ with the most significant word first])]) ;;
-+ no)
-+ $2 ;;
-+ *)
-+ m4_default([$3],
-+ [AC_MSG_ERROR([
-+
-+Unknown float word ordering. You need to manually preset
-+ax_cv_c_float_words_bigendian=no (or yes) according to your system.
-+
-+ ])]) ;;
-+esac
-+
-+])# AX_C_FLOAT_WORDS_BIGENDIAN
---
-2.11.0
-
diff --git a/external/poky/meta/recipes-devtools/python/python3/ftplib.patch b/external/poky/meta/recipes-devtools/python/python3/ftplib.patch
deleted file mode 100644
index 49c5b273..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/ftplib.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-Upstream-Status: Backport
-Signed-off-by: Ross Burton <ross.burton@intel.com>
-
-From cabe916dc694997d4892b58986e73a713d5a2f8d Mon Sep 17 00:00:00 2001
-From: "Miss Islington (bot)"
- <31488909+miss-islington@users.noreply.github.com>
-Date: Thu, 16 Aug 2018 15:38:03 -0400
-Subject: [PATCH] [3.6] bpo-34391: Fix ftplib test for TLS 1.3 (GH-8787)
- (#8790)
-
-Read from data socket to avoid "[SSL] shutdown while in init" exception
-during shutdown of the dummy server.
-
-Signed-off-by: Christian Heimes <christian@python.org>
-
-
-<!-- issue-number: [bpo-34391](https://www.bugs.python.org/issue34391) -->
-https://bugs.python.org/issue34391
-<!-- /issue-number -->
-(cherry picked from commit 1590c393360df059160145e7475754427bfc6680)
-
-
-Co-authored-by: Christian Heimes <christian@python.org>
----
- Lib/test/test_ftplib.py | 5 +++++
- Misc/NEWS.d/next/Tests/2018-08-16-18-48-47.bpo-34391.ouNfxC.rst | 1 +
- 2 files changed, 6 insertions(+)
- create mode 100644 Misc/NEWS.d/next/Tests/2018-08-16-18-48-47.bpo-34391.ouNfxC.rst
-
-diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py
-index 44dd73aeca..4ff2f71afb 100644
---- a/Lib/test/test_ftplib.py
-+++ b/Lib/test/test_ftplib.py
-@@ -876,18 +876,23 @@ class TestTLS_FTPClass(TestCase):
- # clear text
- with self.client.transfercmd('list') as sock:
- self.assertNotIsInstance(sock, ssl.SSLSocket)
-+ self.assertEqual(sock.recv(1024), LIST_DATA.encode('ascii'))
- self.assertEqual(self.client.voidresp(), "226 transfer complete")
-
- # secured, after PROT P
- self.client.prot_p()
- with self.client.transfercmd('list') as sock:
- self.assertIsInstance(sock, ssl.SSLSocket)
-+ # consume from SSL socket to finalize handshake and avoid
-+ # "SSLError [SSL] shutdown while in init"
-+ self.assertEqual(sock.recv(1024), LIST_DATA.encode('ascii'))
- self.assertEqual(self.client.voidresp(), "226 transfer complete")
-
- # PROT C is issued, the connection must be in cleartext again
- self.client.prot_c()
- with self.client.transfercmd('list') as sock:
- self.assertNotIsInstance(sock, ssl.SSLSocket)
-+ self.assertEqual(sock.recv(1024), LIST_DATA.encode('ascii'))
- self.assertEqual(self.client.voidresp(), "226 transfer complete")
-
- def test_login(self):
---
-2.11.0
-
diff --git a/external/poky/meta/recipes-devtools/python/python3/host_include_contamination.patch b/external/poky/meta/recipes-devtools/python/python3/host_include_contamination.patch
deleted file mode 100644
index ef2054d9..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/host_include_contamination.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python3/pass-missing-libraries-to-Extension-for-mul.patch b/external/poky/meta/recipes-devtools/python/python3/pass-missing-libraries-to-Extension-for-mul.patch
deleted file mode 100644
index 5c3af6b6..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/pass-missing-libraries-to-Extension-for-mul.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python3/python-3.3-multilib.patch b/external/poky/meta/recipes-devtools/python/python3/python-3.3-multilib.patch
deleted file mode 100644
index cc35dc16..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/python-3.3-multilib.patch
+++ /dev/null
@@ -1,363 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python3/python-config.patch b/external/poky/meta/recipes-devtools/python/python3/python-config.patch
index f23b8b7d..c8a8f3d4 100644
--- a/external/poky/meta/recipes-devtools/python/python3/python-config.patch
+++ b/external/poky/meta/recipes-devtools/python/python3/python-config.patch
@@ -1,4 +1,7 @@
-python-config: Revert to using distutils.sysconfig
+From 07df0ae0d70cba6d1847fe1c24a71063930bec60 Mon Sep 17 00:00:00 2001
+From: Tyler Hall <tylerwhall@gmail.com>
+Date: Sun, 4 May 2014 20:06:43 -0400
+Subject: [PATCH] python-config: Revert to using distutils.sysconfig
The newer sysconfig module shares some code with distutils.sysconfig, but the same modifications as in
@@ -12,11 +15,16 @@ 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 @@
+
+---
+ Misc/python-config.in | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/Misc/python-config.in b/Misc/python-config.in
+index 727c4a8..c702829 100644
+--- a/Misc/python-config.in
++++ b/Misc/python-config.in
+@@ -6,7 +6,7 @@
import getopt
import os
import sys
@@ -24,8 +32,8 @@ Index: Python-3.3.3/Misc/python-config.in
+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:
+ 'ldflags', 'extension-suffix', 'help', 'abiflags', 'configdir',
+@@ -35,14 +35,14 @@ if '--help' in opt_flags:
for opt in opt_flags:
if opt == '--prefix':
diff --git a/external/poky/meta/recipes-devtools/python/python3/python3-manifest.json b/external/poky/meta/recipes-devtools/python/python3/python3-manifest.json
index 5329bf7c..3bcc9b86 100644
--- a/external/poky/meta/recipes-devtools/python/python3/python3-manifest.json
+++ b/external/poky/meta/recipes-devtools/python/python3/python3-manifest.json
@@ -1,3 +1,93 @@
+# DO NOT (entirely) modify this file manually, please read.
+#
+# IMPORTANT NOTE:
+# Please keep in mind that the create_manifest task relies on the fact the the
+# target and native Python packages are the same, and it also needs to be executed
+# with a fully working native package (with all the PACKAGECONFIGs enabled and all
+# and all the modules should be working, check log.do_compile), otherwise the script
+# will fail to find dependencies correctly, this note is valid either if you are
+# upgrading to a new Python version or adding a new package.
+#
+#
+# If you are adding a new package please follow the next steps:
+# How to add a new package:
+# - If a user wants to add a new package all that has to be done is:
+# Modify the python3-manifest.json file, and add the required file(s) to the FILES list,
+# fill up the SUMMARY section as well, the script should handle all the rest.
+#
+# Real example:
+# We want to add a web browser package, including the file webbrowser.py
+# which at the moment is on python3-misc.
+# "webbrowser": {
+# "files": ["${libdir}/python${PYTHON_MAJMIN}/lib-dynload/webbrowser.py"],
+# "rdepends": [],
+# "summary": "Python Web Browser support"}
+#
+# * Note that the rdepends field was left empty
+#
+# We run $ bitbake python3 -c create_manifest and the resulting manifest
+# should be completed after a few seconds, showing something like:
+# "webbrowser": {
+# "files": ["${libdir}/python${PYTHON_MAJMIN}/webbrowser.py"],
+# "rdepends": ["core","fcntl","io","pickle","shell","subprocess"],
+# "summary": "Python Web Browser support"}
+#
+#
+# If you are upgrading Python to a new version please follow the next steps:
+# After each Python upgrade, the create_manifest task should be executed, because we
+# don't control what changes on upstream Python, so, some module dependency
+# might have changed without us realizing it, a certain module can either have
+# more or less dependencies, or could be depending on a new file that was just
+# created on the new release and for obvious reasons we wouldn't have it on our
+# old manifest, all of these issues would cause runtime errors on our system.
+#
+# - Upgrade both the native and target Python packages to a new version
+# - Run the create_manifest task for the target Python package as its shown below:
+#
+# $ bitbake python3 -c create_manifest
+#
+# This will automatically replace your manifest file located under the Python directory
+# with an new one, which contains the new dependencies (if any).
+#
+# Several things could have gone wrong here, I will try to explain a few:
+#
+# a) A new file was introduced on this release, e.g. sha3*.so:
+# The task will check what its needed to import every module, more than one module would
+# would probably depend on sha3*.so, although only one module should contain it.
+#
+# After running the task, the new manifest will have the sha3*.so file on more than one
+# module, you need to manually decide which one of them should get it and delete it from
+# the others, for example sha3*.so should likely be on ${PN}-crypt.
+# Once you have deleted from the others you need to run the create_manifest task again,
+# this will populate the other module's rdepends fields, with ${PN}-crypt and you should be
+# good to go.
+#
+# b) The native package wasn't built correctly and its missing a certain module:
+# As mentioned before, you need to make sure the native package was built with all the modules
+# because it is used as base to build the manifest file, you need to manually check log.do_compile
+# since it won't error out the compile function if its only missing a couple of modules.
+#
+# e.g. missing the _uuid module, log.do_compile would show the following:
+# Python build finished successfully!
+# The necessary bits to build these optional modules were not found:
+# _uuid
+#
+# What will happen here is that the new manifest would not be aware that the _uuid module exists, so
+# not only we won't know of any dependencies to it, but also, the _uuid* files will be packaged on
+# the misc package (which is where any file that doesn't belong anywhere else ends up).
+#
+# This will eventually cause runtime errors on our system if we don't include the misc package on
+# on our image, because the _uuid files will be missing.
+# If we build the _uuid module correctly and run the create_manifest task the _uuid files will be
+# detected correctly along with its dependencies, and we will get a working manifest.
+#
+# This is the reason why it is important to make sure we have a fully working native build,
+# so we can avoid these errors.
+#
+#
+#
+# DO NOT MODIFY THE NEXT LINE!, IT IS USED AS A MARKER FOR THE ACTUAL JSON MANIFEST
+# EOC
{
"tests": {
"summary": "Python test suite",
@@ -19,32 +109,27 @@
"core"
],
"files": [
- "${bindir}/2to3-*",
+ "${bindir}/2to3*",
"${libdir}/python${PYTHON_MAJMIN}/lib2to3"
],
"cached": []
},
"asyncio": {
- "summary": "Python Asynchronous I/",
+ "summary": "Python Asynchronous I/O",
"rdepends": [
- "compression",
"core",
- "crypt",
"io",
"logging",
- "math",
- "multiprocessing",
"netclient",
- "pickle",
- "shell",
+ "numbers",
"stringold",
- "threading",
- "unixadmin"
+ "typing"
],
"files": [
"${libdir}/python${PYTHON_MAJMIN}/asyncio",
"${libdir}/python${PYTHON_MAJMIN}/concurrent",
- "${libdir}/python${PYTHON_MAJMIN}/concurrent/futures"
+ "${libdir}/python${PYTHON_MAJMIN}/concurrent/futures",
+ "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_asyncio.*.so"
],
"cached": []
},
@@ -84,19 +169,7 @@
"compile": {
"summary": "Python bytecode compilation support",
"rdepends": [
- "asyncio",
- "compression",
- "core",
- "crypt",
- "io",
- "logging",
- "math",
- "multiprocessing",
- "pickle",
- "shell",
- "stringold",
- "threading",
- "unixadmin"
+ "core"
],
"files": [
"${libdir}/python${PYTHON_MAJMIN}/compileall.py",
@@ -110,26 +183,15 @@
"compression": {
"summary": "Python high-level compression support",
"rdepends": [
- "core",
- "shell",
- "unixadmin"
+ "core"
],
"files": [
- "${libdir}/python${PYTHON_MAJMIN}/_compression.py",
- "${libdir}/python${PYTHON_MAJMIN}/bz2.py",
"${libdir}/python${PYTHON_MAJMIN}/gzip.py",
- "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_bz2.*.so",
- "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_lzma.*.so",
- "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/zlib.*.so",
- "${libdir}/python${PYTHON_MAJMIN}/lzma.py",
"${libdir}/python${PYTHON_MAJMIN}/tarfile.py",
"${libdir}/python${PYTHON_MAJMIN}/zipfile.py"
],
"cached": [
- "${libdir}/python${PYTHON_MAJMIN}/__pycache__/_compression.*.pyc",
- "${libdir}/python${PYTHON_MAJMIN}/__pycache__/bz2.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/gzip.*.pyc",
- "${libdir}/python${PYTHON_MAJMIN}/__pycache__/lzma.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/tarfile.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/zipfile.*.pyc"
]
@@ -138,8 +200,10 @@
"summary": "Python interpreter and core modules",
"rdepends": [],
"files": [
- "${bindir}/python*[!-config]",
- "${includedir}/python${PYTHON_BINABI}/pyconfig*.h",
+ "${bindir}/python${PYTHON_MAJMIN}",
+ "${bindir}/python${PYTHON_MAJMIN}.real",
+ "${bindir}/python3",
+ "${includedir}/python${PYTHON_MAJMIN}/pyconfig*.h",
"${libdir}/python${PYTHON_MAJMIN}/UserDict.py",
"${libdir}/python${PYTHON_MAJMIN}/UserList.py",
"${libdir}/python${PYTHON_MAJMIN}/UserString.py",
@@ -147,14 +211,16 @@
"${libdir}/python${PYTHON_MAJMIN}/_abcoll.py",
"${libdir}/python${PYTHON_MAJMIN}/_bootlocale.py",
"${libdir}/python${PYTHON_MAJMIN}/_collections_abc.py",
+ "${libdir}/python${PYTHON_MAJMIN}/_compression.py",
"${libdir}/python${PYTHON_MAJMIN}/_markupbase.py",
"${libdir}/python${PYTHON_MAJMIN}/_sitebuiltins.py",
- "${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py",
+ "${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata*.py",
"${libdir}/python${PYTHON_MAJMIN}/_weakrefset.py",
"${libdir}/python${PYTHON_MAJMIN}/abc.py",
"${libdir}/python${PYTHON_MAJMIN}/argparse.py",
"${libdir}/python${PYTHON_MAJMIN}/ast.py",
"${libdir}/python${PYTHON_MAJMIN}/bisect.py",
+ "${libdir}/python${PYTHON_MAJMIN}/bz2.py",
"${libdir}/python${PYTHON_MAJMIN}/code.py",
"${libdir}/python${PYTHON_MAJMIN}/codecs.py",
"${libdir}/python${PYTHON_MAJMIN}/codeop.py",
@@ -171,6 +237,7 @@
"${libdir}/python${PYTHON_MAJMIN}/encodings/latin_1.py",
"${libdir}/python${PYTHON_MAJMIN}/encodings/utf_8.py",
"${libdir}/python${PYTHON_MAJMIN}/enum.py",
+ "${libdir}/python${PYTHON_MAJMIN}/fnmatch.py",
"${libdir}/python${PYTHON_MAJMIN}/functools.py",
"${libdir}/python${PYTHON_MAJMIN}/genericpath.py",
"${libdir}/python${PYTHON_MAJMIN}/getopt.py",
@@ -191,13 +258,16 @@
"${libdir}/python${PYTHON_MAJMIN}/lib-dynload/__pycache__/time.*.so",
"${libdir}/python${PYTHON_MAJMIN}/lib-dynload/__pycache__/xreadlines.*.so",
"${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_bisect.*.so",
+ "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_bz2.*.so",
"${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_csv.*.so",
"${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_heapq.*.so",
+ "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_lzma.*.so",
"${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_opcode.*.so",
"${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_posixsubprocess.*.so",
"${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_struct.*.so",
"${libdir}/python${PYTHON_MAJMIN}/lib-dynload/array.*.so",
"${libdir}/python${PYTHON_MAJMIN}/lib-dynload/binascii.*.so",
+ "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/grp.*.so",
"${libdir}/python${PYTHON_MAJMIN}/lib-dynload/math.*.so",
"${libdir}/python${PYTHON_MAJMIN}/lib-dynload/parser.*.so",
"${libdir}/python${PYTHON_MAJMIN}/lib-dynload/readline.*.so",
@@ -205,19 +275,26 @@
"${libdir}/python${PYTHON_MAJMIN}/lib-dynload/time.*.so",
"${libdir}/python${PYTHON_MAJMIN}/lib-dynload/unicodedata.*.so",
"${libdir}/python${PYTHON_MAJMIN}/lib-dynload/xreadlines.*.so",
+ "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/zlib.*.so",
"${libdir}/python${PYTHON_MAJMIN}/linecache.py",
"${libdir}/python${PYTHON_MAJMIN}/locale.py",
+ "${libdir}/python${PYTHON_MAJMIN}/lzma.py",
"${libdir}/python${PYTHON_MAJMIN}/new.py",
+ "${libdir}/python${PYTHON_MAJMIN}/ntpath.py",
"${libdir}/python${PYTHON_MAJMIN}/opcode.py",
"${libdir}/python${PYTHON_MAJMIN}/operator.py",
"${libdir}/python${PYTHON_MAJMIN}/optparse.py",
"${libdir}/python${PYTHON_MAJMIN}/os.py",
+ "${libdir}/python${PYTHON_MAJMIN}/pathlib.py",
+ "${libdir}/python${PYTHON_MAJMIN}/pkgutil.py",
"${libdir}/python${PYTHON_MAJMIN}/platform.py",
"${libdir}/python${PYTHON_MAJMIN}/posixpath.py",
"${libdir}/python${PYTHON_MAJMIN}/re.py",
"${libdir}/python${PYTHON_MAJMIN}/reprlib.py",
"${libdir}/python${PYTHON_MAJMIN}/rlcompleter.py",
+ "${libdir}/python${PYTHON_MAJMIN}/runpy.py",
"${libdir}/python${PYTHON_MAJMIN}/selectors.py",
+ "${libdir}/python${PYTHON_MAJMIN}/shutil.py",
"${libdir}/python${PYTHON_MAJMIN}/signal.py",
"${libdir}/python${PYTHON_MAJMIN}/site.py",
"${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py",
@@ -237,12 +314,14 @@
"${libdir}/python${PYTHON_MAJMIN}/traceback.py",
"${libdir}/python${PYTHON_MAJMIN}/types.py",
"${libdir}/python${PYTHON_MAJMIN}/warnings.py",
- "${libdir}/python${PYTHON_MAJMIN}/weakref.py"
+ "${libdir}/python${PYTHON_MAJMIN}/weakref.py",
+ "${prefix}/lib/python${PYTHON_MAJMIN}/config*/*[!.a]"
],
"cached": [
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/__future__.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/_bootlocale.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/_collections_abc.*.pyc",
+ "${libdir}/python${PYTHON_MAJMIN}/__pycache__/_compression.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/_markupbase.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/_sitebuiltins.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/_sysconfigdata.*.pyc",
@@ -251,6 +330,7 @@
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/argparse.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/ast.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/bisect.*.pyc",
+ "${libdir}/python${PYTHON_MAJMIN}/__pycache__/bz2.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/code.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/codecs.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/codeop.*.pyc",
@@ -261,6 +341,7 @@
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/csv.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/dis.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/enum.*.pyc",
+ "${libdir}/python${PYTHON_MAJMIN}/__pycache__/fnmatch.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/functools.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/genericpath.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/getopt.*.pyc",
@@ -272,16 +353,22 @@
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/keyword.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/linecache.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/locale.*.pyc",
+ "${libdir}/python${PYTHON_MAJMIN}/__pycache__/lzma.*.pyc",
+ "${libdir}/python${PYTHON_MAJMIN}/__pycache__/ntpath.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/opcode.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/operator.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/optparse.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/os.*.pyc",
+ "${libdir}/python${PYTHON_MAJMIN}/__pycache__/pathlib.*.pyc",
+ "${libdir}/python${PYTHON_MAJMIN}/__pycache__/pkgutil.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/platform.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/posixpath.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/re.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/reprlib.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/rlcompleter.*.pyc",
+ "${libdir}/python${PYTHON_MAJMIN}/__pycache__/runpy.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/selectors.*.pyc",
+ "${libdir}/python${PYTHON_MAJMIN}/__pycache__/shutil.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/signal.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/site.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/sre_compile.*.pyc",
@@ -323,9 +410,13 @@
"files": [
"${libdir}/python${PYTHON_MAJMIN}/crypt.py",
"${libdir}/python${PYTHON_MAJMIN}/hashlib.py",
+ "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_blake2.*.so",
"${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_crypt.*.so",
"${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_hashlib.*.so",
+ "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_md5.*.so",
+ "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_sha1.*.so",
"${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_sha256.*.so",
+ "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_sha3.*.so",
"${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_sha512.*.so"
],
"cached": [
@@ -407,7 +498,7 @@
"files": [
"${base_libdir}/*.a",
"${base_libdir}/*.o",
- "${bindir}/python*-config",
+ "${bindir}/python*-config*",
"${datadir}/aclocal",
"${datadir}/pkgconfig",
"${includedir}",
@@ -415,12 +506,11 @@
"${libdir}/*.la",
"${libdir}/*.o",
"${libdir}/lib*${SOLIBSDEV}",
- "${libdir}/pkgconfig",
- "${libdir}/python${PYTHON_MAJMIN}/config*/Makefile",
- "${libdir}/python${PYTHON_MAJMIN}/config*/Makefile/__pycache__"
+ "${libdir}/pkgconfig"
],
"rdepends": [
- "core"
+ "core",
+ "distutils"
],
"summary": "Python development package"
},
@@ -436,17 +526,13 @@
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/difflib.*.pyc"
]
},
- "distutils-staticdev": {
- "cached": [
- "${libdir}/python${PYTHON_MAJMIN}/config/__pycache__/lib*.a"
- ],
- "files": [
- "${libdir}/python${PYTHON_MAJMIN}/config/lib*.a"
- ],
+ "distutils-windows": {
+ "summary": "Python distribution utilities (Windows installer stubs)",
"rdepends": [
- "distutils"
+ "core"
],
- "summary": "Python distribution utilities (static libraries)"
+ "files": [],
+ "cached": []
},
"distutils": {
"summary": "Python Distribution Utilities",
@@ -461,13 +547,19 @@
"doctest": {
"summary": "Python framework for running examples in docstrings",
"rdepends": [
+ "asyncio",
+ "compression",
"core",
"debugger",
"difflib",
+ "io",
"logging",
+ "netclient",
+ "numbers",
"pprint",
"shell",
"stringold",
+ "typing",
"unittest"
],
"files": [
@@ -561,8 +653,7 @@
"crypt",
"math",
"netclient",
- "shell",
- "unixadmin"
+ "shell"
],
"files": [
"${libdir}/python${PYTHON_MAJMIN}/_pyio.py",
@@ -709,7 +800,6 @@
"profile",
"pydoc",
"resource",
- "runpy",
"shell",
"smtpd",
"sqlite3",
@@ -725,12 +815,17 @@
"xml",
"xmlrpc"
],
+ "rrecommends": [
+ "distutils-windows"
+ ],
"summary": "All Python modules"
},
"multiprocessing": {
"summary": "Python multiprocessing support",
"rdepends": [
- "core"
+ "core",
+ "io",
+ "pickle"
],
"files": [
"${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_multiprocessing.*.so",
@@ -741,18 +836,14 @@
"netclient": {
"summary": "Python Internet Protocol clients",
"rdepends": [
- "compression",
"core",
"crypt",
- "ctypes",
"datetime",
"email",
"io",
"math",
"mime",
- "shell",
- "stringold",
- "unixadmin"
+ "stringold"
],
"files": [
"${libdir}/python${PYTHON_MAJMIN}/base64.py",
@@ -760,6 +851,7 @@
"${libdir}/python${PYTHON_MAJMIN}/hmac.py",
"${libdir}/python${PYTHON_MAJMIN}/http",
"${libdir}/python${PYTHON_MAJMIN}/http/__pycache__",
+ "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_uuid.*.so",
"${libdir}/python${PYTHON_MAJMIN}/mimetypes.py",
"${libdir}/python${PYTHON_MAJMIN}/nntplib.py",
"${libdir}/python${PYTHON_MAJMIN}/poplib.py",
@@ -794,9 +886,7 @@
"math",
"mime",
"netclient",
- "shell",
- "stringold",
- "unixadmin"
+ "stringold"
],
"files": [
"${libdir}/python${PYTHON_MAJMIN}/cgi.py",
@@ -814,13 +904,16 @@
],
"files": [
"${libdir}/python${PYTHON_MAJMIN}/_pydecimal.py",
+ "${libdir}/python${PYTHON_MAJMIN}/contextvars.py",
"${libdir}/python${PYTHON_MAJMIN}/decimal.py",
"${libdir}/python${PYTHON_MAJMIN}/fractions.py",
+ "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_contextvars.*.so",
"${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_decimal.*.so",
"${libdir}/python${PYTHON_MAJMIN}/numbers.py"
],
"cached": [
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/_pydecimal.*.pyc",
+ "${libdir}/python${PYTHON_MAJMIN}/__pycache__/contextvars.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/decimal.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/fractions.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/numbers.*.pyc"
@@ -850,12 +943,8 @@
"rdepends": [
"core"
],
- "files": [
- "${libdir}/python${PYTHON_MAJMIN}/pkgutil.py"
- ],
- "cached": [
- "${libdir}/python${PYTHON_MAJMIN}/__pycache__/pkgutil.*.pyc"
- ]
+ "files": [],
+ "cached": []
},
"plistlib": {
"summary": "Generate and parse Mac OS X .plist files",
@@ -904,8 +993,7 @@
"summary": "Python interactive help support",
"rdepends": [
"core",
- "netclient",
- "pkgutil"
+ "netclient"
],
"files": [
"${bindir}/pydoc*",
@@ -926,40 +1014,22 @@
],
"cached": []
},
- "runpy": {
- "summary": "Python helper for locating/executing scripts in module namespace",
- "rdepends": [
- "core",
- "pkgutil"
- ],
- "files": [
- "${libdir}/python${PYTHON_MAJMIN}/runpy.py"
- ],
- "cached": [
- "${libdir}/python${PYTHON_MAJMIN}/__pycache__/runpy.*.pyc"
- ]
- },
"shell": {
"summary": "Python shell-like functionality",
"rdepends": [
"compression",
"core",
- "stringold",
- "unixadmin"
+ "stringold"
],
"files": [
"${libdir}/python${PYTHON_MAJMIN}/cmd.py",
- "${libdir}/python${PYTHON_MAJMIN}/fnmatch.py",
"${libdir}/python${PYTHON_MAJMIN}/glob.py",
- "${libdir}/python${PYTHON_MAJMIN}/shlex.py",
- "${libdir}/python${PYTHON_MAJMIN}/shutil.py"
+ "${libdir}/python${PYTHON_MAJMIN}/shlex.py"
],
"cached": [
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/cmd.*.pyc",
- "${libdir}/python${PYTHON_MAJMIN}/__pycache__/fnmatch.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/glob.*.pyc",
- "${libdir}/python${PYTHON_MAJMIN}/__pycache__/shlex.*.pyc",
- "${libdir}/python${PYTHON_MAJMIN}/__pycache__/shutil.*.pyc"
+ "${libdir}/python${PYTHON_MAJMIN}/__pycache__/shlex.*.pyc"
]
},
"smtpd": {
@@ -1044,13 +1114,12 @@
"files": [
"${libdir}/python${PYTHON_MAJMIN}/_dummy_thread.py",
"${libdir}/python${PYTHON_MAJMIN}/_threading_local.py",
- "${libdir}/python${PYTHON_MAJMIN}/dummy_threading.py",
+ "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_queue.*.so",
"${libdir}/python${PYTHON_MAJMIN}/queue.py"
],
"cached": [
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/_dummy_thread.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/_threading_local.*.pyc",
- "${libdir}/python${PYTHON_MAJMIN}/__pycache__/dummy_threading.*.pyc",
"${libdir}/python${PYTHON_MAJMIN}/__pycache__/queue.*.pyc"
]
},
@@ -1060,6 +1129,7 @@
"core"
],
"files": [
+ "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter.*.so",
"${libdir}/python${PYTHON_MAJMIN}/tkinter"
],
"cached": []
@@ -1079,12 +1149,17 @@
"unittest": {
"summary": "Python unit testing framework",
"rdepends": [
+ "asyncio",
+ "compression",
"core",
"difflib",
+ "io",
"logging",
+ "netclient",
+ "numbers",
"pprint",
- "shell",
- "stringold"
+ "stringold",
+ "typing"
],
"files": [
"${libdir}/python${PYTHON_MAJMIN}/unittest",
@@ -1101,7 +1176,6 @@
],
"files": [
"${libdir}/python${PYTHON_MAJMIN}/getpass.py",
- "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/grp.*.so",
"${libdir}/python${PYTHON_MAJMIN}/lib-dynload/nis.*.so"
],
"cached": [
@@ -1114,13 +1188,11 @@
"compression",
"core",
"logging",
- "shell",
- "stringold",
- "unixadmin"
+ "stringold"
],
"files": [
- "${libdir}/python${PYTHON_MAJMIN}/venv",
- "${bindir}/pyvenv*"
+ "${bindir}/pyvenv*",
+ "${libdir}/python${PYTHON_MAJMIN}/venv"
],
"cached": []
},
diff --git a/external/poky/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch b/external/poky/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch
deleted file mode 100644
index a4f8bd47..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python3/reformat_sysconfig.py b/external/poky/meta/recipes-devtools/python/python3/reformat_sysconfig.py
new file mode 100644
index 00000000..c4164313
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/python/python3/reformat_sysconfig.py
@@ -0,0 +1,21 @@
+#! /usr/bin/env python3
+#
+# SPDX-License-Identifier: MIT
+#
+# Copyright 2019 by Garmin Ltd. or its subsidiaries
+#
+# A script to reformat python sysconfig
+
+import sys
+import pprint
+l = {}
+g = {}
+with open(sys.argv[1], 'r') as f:
+ exec(f.read(), g, l)
+
+with open(sys.argv[1], 'w') as f:
+ for k in sorted(l.keys()):
+ f.write('%s = ' % k)
+ pprint.pprint(l[k], stream=f, width=sys.maxsize)
+ f.write('\n')
+
diff --git a/external/poky/meta/recipes-devtools/python/python3/regen-all.patch b/external/poky/meta/recipes-devtools/python/python3/regen-all.patch
deleted file mode 100644
index 36b9d9d9..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/regen-all.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python3/run-ptest b/external/poky/meta/recipes-devtools/python/python3/run-ptest
index 3863c6d3..405b07f4 100644
--- a/external/poky/meta/recipes-devtools/python/python3/run-ptest
+++ b/external/poky/meta/recipes-devtools/python/python3/run-ptest
@@ -1,3 +1,3 @@
#!/bin/sh
-python3 -m test -v | 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'
+python3 -m test -v | sed -u -e '/\.\.\. ok/ s/^/PASS: /g' -r -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/external/poky/meta/recipes-devtools/python/python3/setup.py-check-cross_compiling-when-get-FLAGS.patch b/external/poky/meta/recipes-devtools/python/python3/setup.py-check-cross_compiling-when-get-FLAGS.patch
deleted file mode 100644
index fc2e12df..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/setup.py-check-cross_compiling-when-get-FLAGS.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python3/setuptweaks.patch b/external/poky/meta/recipes-devtools/python/python3/setuptweaks.patch
deleted file mode 100644
index 3a91b191..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/setuptweaks.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python3/signal.patch b/external/poky/meta/recipes-devtools/python/python3/signal.patch
deleted file mode 100644
index 534a0977..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/signal.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-Upstream-Status: Backport
-Signed-off-by: Ross Burton <ross.burton@intel.com>
-
-From 4315389df3c4e8c1f94a18ab11a4b234762132b1 Mon Sep 17 00:00:00 2001
-From: Antoine Pitrou <pitrou@free.fr>
-Date: Mon, 23 Apr 2018 22:22:49 +0200
-Subject: [PATCH] [3.6] bpo-33329: Fix multiprocessing regression on newer
- glibcs (GH-6575) (GH-6582)
-
-Starting with glibc 2.27.9000-xxx, sigaddset() can return EINVAL for some
-reserved signal numbers between 1 and NSIG. The `range(1, NSIG)` idiom
-is commonly used to select all signals for blocking with `pthread_sigmask`.
-So we ignore the sigaddset() return value until we expose sigfillset()
-to provide a better idiom.
-(cherry picked from commit 25038ecfb665bef641abf8cb61afff7505b0e008)
----
- .../next/Library/2018-04-23-13-21-39.bpo-33329.lQ-Eod.rst | 1 +
- Modules/signalmodule.c | 14 ++++++++------
- 2 files changed, 9 insertions(+), 6 deletions(-)
- create mode 100644 Misc/NEWS.d/next/Library/2018-04-23-13-21-39.bpo-33329.lQ-Eod.rst
-
-diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
-index e0d06b434d..138e74e8a9 100644
---- a/Modules/signalmodule.c
-+++ b/Modules/signalmodule.c
-@@ -744,7 +744,6 @@ iterable_to_sigset(PyObject *iterable, sigset_t *mask)
- int result = -1;
- PyObject *iterator, *item;
- long signum;
-- int err;
-
- sigemptyset(mask);
-
-@@ -766,11 +765,14 @@ iterable_to_sigset(PyObject *iterable, sigset_t *mask)
- Py_DECREF(item);
- if (signum == -1 && PyErr_Occurred())
- goto error;
-- if (0 < signum && signum < NSIG)
-- err = sigaddset(mask, (int)signum);
-- else
-- err = 1;
-- if (err) {
-+ if (0 < signum && signum < NSIG) {
-+ /* bpo-33329: ignore sigaddset() return value as it can fail
-+ * for some reserved signals, but we want the `range(1, NSIG)`
-+ * idiom to allow selecting all valid signals.
-+ */
-+ (void) sigaddset(mask, (int)signum);
-+ }
-+ else {
- PyErr_Format(PyExc_ValueError,
- "signal number %ld out of range", signum);
- goto error;
---
-2.11.0
-
diff --git a/external/poky/meta/recipes-devtools/python/python3/sitecustomize.py b/external/poky/meta/recipes-devtools/python/python3/sitecustomize.py
deleted file mode 100644
index 4c8b5e2b..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/sitecustomize.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# 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/external/poky/meta/recipes-devtools/python/python3/support_SOURCE_DATE_EPOCH_in_py_compile.patch b/external/poky/meta/recipes-devtools/python/python3/support_SOURCE_DATE_EPOCH_in_py_compile.patch
deleted file mode 100644
index 32ecab9f..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/support_SOURCE_DATE_EPOCH_in_py_compile.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python3/sysconfig.py-add-_PYTHON_PROJECT_SRC.patch b/external/poky/meta/recipes-devtools/python/python3/sysconfig.py-add-_PYTHON_PROJECT_SRC.patch
deleted file mode 100644
index c89d9a3d..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/sysconfig.py-add-_PYTHON_PROJECT_SRC.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python3/sysroot-include-headers.patch b/external/poky/meta/recipes-devtools/python/python3/sysroot-include-headers.patch
deleted file mode 100644
index 785b5567..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/sysroot-include-headers.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python3/tweak-MULTIARCH-for-powerpc-linux-gnuspe.patch b/external/poky/meta/recipes-devtools/python/python3/tweak-MULTIARCH-for-powerpc-linux-gnuspe.patch
deleted file mode 100644
index 8d037278..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/tweak-MULTIARCH-for-powerpc-linux-gnuspe.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python3/unixccompiler.patch b/external/poky/meta/recipes-devtools/python/python3/unixccompiler.patch
deleted file mode 100644
index 3e2b1d1c..00000000
--- a/external/poky/meta/recipes-devtools/python/python3/unixccompiler.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-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/external/poky/meta/recipes-devtools/python/python3_3.5.6.bb b/external/poky/meta/recipes-devtools/python/python3_3.5.6.bb
deleted file mode 100644
index b2f8a3d0..00000000
--- a/external/poky/meta/recipes-devtools/python/python3_3.5.6.bb
+++ /dev/null
@@ -1,333 +0,0 @@
-require recipes-devtools/python/python3.inc
-
-DEPENDS = "python3-native libffi bzip2 gdbm openssl \
- sqlite3 zlib virtual/libintl xz qemu-native \
- qemu-helper-native virtual/crypt"
-
-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://030-fixup-include-dirs.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://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 \
- file://Use-correct-CFLAGS-for-extensions-when-cross-compili.patch \
- file://0002-Makefile-add-target-to-split-profile-generation.patch \
- file://float-endian.patch \
- file://ftplib.patch \
- file://signal.patch \
- file://0001-Issue-28043-SSLContext-has-improved-default-settings.patch \
- file://0002-bpo-29136-Add-TLS-1.3-cipher-suites-and-OP_NO_TLSv1_.patch \
- file://0003-bpo-32947-Fixes-for-TLS-1.3-and-OpenSSL-1.1.1-GH-876.patch \
- file://0004-bpo-33570-TLS-1.3-ciphers-for-OpenSSL-1.1.1-GH-6976.patch \
- file://0005-bpo-30714-ALPN-changes-for-OpenSSL-1.1.0f-2305.patch \
- file://run-ptest \
- file://CVE-2019-9740.patch \
- file://CVE-2018-14647.patch \
- file://CVE-2018-20406.patch \
- file://CVE-2018-20852.patch \
- file://CVE-2019-9636.patch \
- "
-
-inherit multilib_header python3native update-alternatives qemu ptest
-
-MULTILIB_SUFFIX = "${@d.getVar('base_libdir',1).split('/')[-1]}"
-
-ALTERNATIVE_${PN}-dev = "python-config"
-ALTERNATIVE_LINK_NAME[python-config] = "${bindir}/python${PYTHON_BINABI}-config"
-ALTERNATIVE_TARGET[python-config] = "${bindir}/python${PYTHON_BINABI}-config-${MULTILIB_SUFFIX}"
-
-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 \
- ac_cv_working_tzset=yes \
-"
-
-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"
-
-PYTHON3_PROFILE_TASK ?= "./python -m test.regrtest --pgo test_grammar test_opcodes test_dict test_builtin test_exceptions test_types test_support || true"
-
-export CROSS_COMPILE = "${TARGET_PREFIX}"
-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"
-
-PACKAGECONFIG ??= "readline ${@bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'pgo', '', d)}"
-PACKAGECONFIG[readline] = ",,readline"
-# Use profile guided optimisation by running PyBench inside qemu-user
-PACKAGECONFIG[pgo] = "--enable-optimizations"
-
-do_configure_append() {
- rm -f ${S}/Makefile.orig
-}
-
-run_make() {
- oe_runmake PGEN=${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_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
-
- if ${@bb.utils.contains('PACKAGECONFIG', 'pgo', 'true', 'false', d)}; then
- run_make profile-opt
- qemu_binary="${@qemu_wrapper_cmdline(d, '${STAGING_DIR_TARGET}', ['${B}', '${STAGING_DIR_TARGET}/${base_libdir}'])}"
- cat >pgo-wrapper <<EOF
-#!/bin/sh
-cd ${B}
-$qemu_binary "\$@"
-EOF
- chmod +x pgo-wrapper
- bbnote Gathering profiling data
- ./pgo-wrapper ${PYTHON3_PROFILE_TASK}
- bbnote Profiling data gathered, rebuilding
- run_make clean_and_use_profile
- else
- run_make libpython3.so
- run_make
- fi
-}
-
-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
- if ${@bb.utils.contains('PACKAGECONFIG', 'pgo', 'true', 'false', d)}; then
- run_make DESTDIR=${D} LIBDIR=${libdir} build_all_use_profile
- else
- run_make DESTDIR=${D} LIBDIR=${libdir}
- fi
-
- run_make 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} PYTHONHOME='${prefix}' TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo' PYTHONNOUSERSITE='1'
-}
-
-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 -
-
- mv ${PKGD}/${bindir}/python${PYTHON_BINABI}-config ${PKGD}/${bindir}/python${PYTHON_BINABI}-config-${MULTILIB_SUFFIX}
-}
-
-PACKAGES_remove = "${PN}"
-
-# manual dependency additions
-RPROVIDES_${PN}-modules = "${PN}"
-RRECOMMENDS_${PN}-core_append_class-nativesdk = " nativesdk-python3-modules"
-RRECOMMENDS_${PN}-crypt = "openssl ca-certificates"
-
-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}"
-
-# provide python-pyvenv from python3-venv
-RPROVIDES_${PN}-venv += "${PN}-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"
-
-RDEPENDS_${PN}-ptest = "${PN}-modules ${PN}-tests unzip bzip2"
-
-RDEPENDS_${PN}-dev = ""
-
-BBCLASSEXTEND = "nativesdk"
-
-# 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 collections, 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, object_pairs_hook=collections.OrderedDict)
-
- 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)
-
- 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'])
-
- # 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 ${PYTHON_MAJMIN}
- 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/external/poky/meta/recipes-devtools/python/python3_3.8.2.bb b/external/poky/meta/recipes-devtools/python/python3_3.8.2.bb
new file mode 100644
index 00000000..99d9f674
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/python/python3_3.8.2.bb
@@ -0,0 +1,353 @@
+SUMMARY = "The Python Programming Language"
+HOMEPAGE = "http://www.python.org"
+LICENSE = "PSFv2"
+SECTION = "devel/python"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=203a6dbc802ee896020a47161e759642"
+
+SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
+ file://run-ptest \
+ file://create_manifest3.py \
+ file://get_module_deps3.py \
+ file://python3-manifest.json \
+ file://check_build_completeness.py \
+ file://cgi_py.patch \
+ file://0001-Do-not-add-usr-lib-termcap-to-linker-flags-to-avoid-.patch \
+ ${@bb.utils.contains('PACKAGECONFIG', 'tk', '', 'file://avoid_warning_about_tkinter.patch', d)} \
+ file://0001-Do-not-use-the-shell-version-of-python-config-that-w.patch \
+ file://python-config.patch \
+ file://0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch \
+ file://0001-Do-not-hardcode-lib-as-location-for-site-packages-an.patch \
+ file://0001-python3-use-cc_basename-to-replace-CC-for-checking-c.patch \
+ file://0001-Lib-sysconfig.py-fix-another-place-where-lib-is-hard.patch \
+ file://0001-Makefile-fix-Issue36464-parallel-build-race-problem.patch \
+ file://0001-bpo-36852-proper-detection-of-mips-architecture-for-.patch \
+ file://crosspythonpath.patch \
+ file://reformat_sysconfig.py \
+ file://0001-Use-FLAG_REF-always-for-interned-strings.patch \
+ file://0001-test_locale.py-correct-the-test-output-format.patch \
+ file://0017-setup.py-do-not-report-missing-dependencies-for-disa.patch \
+ file://0001-setup.py-pass-missing-libraries-to-Extension-for-mul.patch \
+ file://0001-Makefile-do-not-compile-.pyc-in-parallel.patch \
+ file://0001-configure.ac-fix-LIBPL.patch \
+ file://0001-python3-Do-not-hardcode-lib-for-distutils.patch \
+ file://0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch \
+ file://0001-bpo-39503-CVE-2020-8492-Fix-AbstractBasicAuthHandler.patch \
+ file://CVE-2020-14422.patch \
+ "
+
+SRC_URI_append_class-native = " \
+ file://0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch \
+ file://12-distutils-prefix-is-inside-staging-area.patch \
+ file://0001-Don-t-search-system-for-headers-libraries.patch \
+ "
+
+SRC_URI[md5sum] = "e9d6ebc92183a177b8e8a58cad5b8d67"
+SRC_URI[sha256sum] = "2646e7dc233362f59714c6193017bb2d6f7b38d6ab4a0cb5fbac5c36c4d845df"
+
+# exclude pre-releases for both python 2.x and 3.x
+UPSTREAM_CHECK_REGEX = "[Pp]ython-(?P<pver>\d+(\.\d+)+).tar"
+
+CVE_PRODUCT = "python"
+
+# This is not exploitable when glibc has CVE-2016-10739 fixed.
+CVE_CHECK_WHITELIST += "CVE-2019-18348"
+
+PYTHON_MAJMIN = "3.8"
+
+S = "${WORKDIR}/Python-${PV}"
+
+BBCLASSEXTEND = "native nativesdk"
+
+inherit autotools pkgconfig qemu ptest multilib_header update-alternatives
+
+MULTILIB_SUFFIX = "${@d.getVar('base_libdir',1).split('/')[-1]}"
+
+ALTERNATIVE_${PN}-dev = "python3-config"
+ALTERNATIVE_LINK_NAME[python3-config] = "${bindir}/python${PYTHON_MAJMIN}-config"
+ALTERNATIVE_TARGET[python3-config] = "${bindir}/python${PYTHON_MAJMIN}-config-${MULTILIB_SUFFIX}"
+
+
+DEPENDS = "bzip2-replacement-native libffi bzip2 openssl sqlite3 zlib virtual/libintl xz virtual/crypt util-linux libtirpc libnsl2"
+DEPENDS_append_class-target = " python3-native"
+DEPENDS_append_class-nativesdk = " python3-native"
+
+EXTRA_OECONF = " --without-ensurepip --enable-shared"
+EXTRA_OECONF_append_class-native = " --bindir=${bindir}/${PN}"
+
+export CROSSPYTHONPATH="${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/"
+
+EXTRANATIVEPATH += "python3-native"
+
+CACHED_CONFIGUREVARS = " \
+ ac_cv_file__dev_ptmx=yes \
+ ac_cv_file__dev_ptc=no \
+ ac_cv_working_tzset=yes \
+"
+python() {
+ # PGO currently causes builds to not be reproducible, so disable it for
+ # now. See YOCTO #13407
+ if bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', True, False, d) and d.getVar('BUILD_REPRODUCIBLE_BINARIES') != '1':
+ d.setVar('PACKAGECONFIG_PGO', 'pgo')
+ else:
+ d.setVar('PACKAGECONFIG_PGO', '')
+}
+
+PACKAGECONFIG_class-target ??= "readline ${PACKAGECONFIG_PGO} gdbm"
+PACKAGECONFIG_class-native ??= "readline gdbm"
+PACKAGECONFIG_class-nativesdk ??= "readline gdbm"
+PACKAGECONFIG[readline] = ",,readline"
+# Use profile guided optimisation by running PyBench inside qemu-user
+PACKAGECONFIG[pgo] = "--enable-optimizations,,qemu-native"
+PACKAGECONFIG[tk] = ",,tk"
+PACKAGECONFIG[gdbm] = ",,gdbm"
+
+do_configure_prepend () {
+ mkdir -p ${B}/Modules
+ cat > ${B}/Modules/Setup.local << EOF
+*disabled*
+${@bb.utils.contains('PACKAGECONFIG', 'gdbm', '', '_gdbm _dbm', d)}
+${@bb.utils.contains('PACKAGECONFIG', 'readline', '', 'readline', d)}
+EOF
+}
+
+CPPFLAGS_append = " -I${STAGING_INCDIR}/ncursesw -I${STAGING_INCDIR}/uuid"
+
+EXTRA_OEMAKE = '\
+ STAGING_LIBDIR=${STAGING_LIBDIR} \
+ STAGING_INCDIR=${STAGING_INCDIR} \
+ LIB=${baselib} \
+'
+
+do_compile_prepend_class-target() {
+ if ${@bb.utils.contains('PACKAGECONFIG', 'pgo', 'true', 'false', d)}; then
+ qemu_binary="${@qemu_wrapper_cmdline(d, '${STAGING_DIR_TARGET}', ['${B}', '${STAGING_DIR_TARGET}/${base_libdir}'])}"
+ cat >pgo-wrapper <<EOF
+#!/bin/sh
+cd ${B}
+$qemu_binary "\$@"
+EOF
+ chmod +x pgo-wrapper
+ fi
+}
+
+do_install_prepend() {
+ ${WORKDIR}/check_build_completeness.py ${T}/log.do_compile
+}
+
+do_install_append_class-target() {
+ oe_multilib_header python${PYTHON_MAJMIN}/pyconfig.h
+}
+
+do_install_append_class-native() {
+ # 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
+}
+
+do_install_append() {
+ mkdir -p ${D}${libdir}/python-sysconfigdata
+ sysconfigfile=`find ${D} -name _sysconfig*.py`
+ cp $sysconfigfile ${D}${libdir}/python-sysconfigdata/_sysconfigdata.py
+
+ sed -i \
+ -e "s,^ 'LIBDIR'.*, 'LIBDIR': '${STAGING_LIBDIR}'\,,g" \
+ -e "s,^ 'INCLUDEDIR'.*, 'INCLUDEDIR': '${STAGING_INCDIR}'\,,g" \
+ -e "s,^ 'CONFINCLUDEDIR'.*, 'CONFINCLUDEDIR': '${STAGING_INCDIR}'\,,g" \
+ -e "/^ 'INCLDIRSTOMAKE'/{N; s,/usr/include,${STAGING_INCDIR},g}" \
+ -e "/^ 'INCLUDEPY'/s,/usr/include,${STAGING_INCDIR},g" \
+ ${D}${libdir}/python-sysconfigdata/_sysconfigdata.py
+}
+
+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' PYTHONNOUSERSITE='1'
+}
+
+SSTATE_SCAN_FILES += "Makefile _sysconfigdata.py"
+PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess"
+
+py_package_preprocess () {
+ # 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-${PYTHON_MAJMIN}${PYTHON_ABI}*/Makefile \
+ ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata*.py \
+ ${PKGD}/${bindir}/python${PYTHON_MAJMIN}-config
+
+ # Reformat _sysconfigdata after modifying it so that it remains
+ # reproducible
+ for c in ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata*.py; do
+ python3 ${WORKDIR}/reformat_sysconfig.py $c
+ done
+
+ # Recompile _sysconfigdata after modifying it
+ cd ${PKGD}
+ sysconfigfile=`find . -name _sysconfigdata_*.py`
+ ${STAGING_BINDIR_NATIVE}/python3-native/python3 \
+ -c "from py_compile import compile; compile('$sysconfigfile')"
+ ${STAGING_BINDIR_NATIVE}/python3-native/python3 \
+ -c "from py_compile import compile; compile('$sysconfigfile', optimize=1)"
+ ${STAGING_BINDIR_NATIVE}/python3-native/python3 \
+ -c "from py_compile import compile; compile('$sysconfigfile', optimize=2)"
+ cd -
+
+ mv ${PKGD}/${bindir}/python${PYTHON_MAJMIN}-config ${PKGD}/${bindir}/python${PYTHON_MAJMIN}-config-${MULTILIB_SUFFIX}
+
+ #Remove the unneeded copy of target sysconfig data
+ rm -rf ${PKGD}/${libdir}/python-sysconfigdata
+}
+
+# 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 collections, 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:
+ manifest_str = manifest_file.read()
+ json_start = manifest_str.find('# EOC') + 6
+ manifest_file.seek(json_start)
+ manifest_str = manifest_file.read()
+ python_manifest = json.loads(manifest_str, object_pairs_hook=collections.OrderedDict)
+
+ # First set RPROVIDES for -native case
+ # Hardcoded since it cant be python3-native-foo, should be python3-foo-native
+ pn = 'python3'
+ rprovides = d.getVar('RPROVIDES').split()
+
+ # ${PN}-misc-native is not in the manifest
+ rprovides.append(pn + '-misc-native')
+
+ for key in python_manifest:
+ pypackage = pn + '-' + key + '-native'
+ if pypackage not in rprovides:
+ rprovides.append(pypackage)
+
+ d.setVar('RPROVIDES_class-native', ' '.join(rprovides))
+
+ # Then work on the target
+ 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)
+
+ for value in python_manifest[key]['rdepends']:
+ # Make it work with or without $PN
+ if '${PN}' in value:
+ value=value.split('-', 1)[1]
+ d.appendVar('RDEPENDS_' + pypackage, ' ' + pn + '-' + value)
+
+ for value in python_manifest[key].get('rrecommends', ()):
+ if '${PN}' in value:
+ value=value.split('-', 1)[1]
+ d.appendVar('RRECOMMENDS_' + pypackage, ' ' + pn + '-' + value)
+
+ d.setVar('SUMMARY_' + pypackage, python_manifest[key]['summary'])
+
+ # Prepending so to avoid python-misc getting everything
+ packages = newpackages + packages
+ d.setVar('PACKAGES', ' '.join(packages))
+ d.setVar('ALLOW_EMPTY_${PN}-modules', '1')
+ d.setVar('ALLOW_EMPTY_${PN}-pkgutil', '1')
+}
+
+# Files needed to create a new manifest
+
+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 ${PYTHON_MAJMIN}
+ 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] += "${PN}:do_prepare_recipe_sysroot"
+do_create_manifest[depends] += "${PN}:do_patch"
+
+# manual dependency additions
+RRECOMMENDS_${PN}-core_append_class-nativesdk = " nativesdk-python3-modules"
+RRECOMMENDS_${PN}-crypt_append_class-target = " openssl ca-certificates"
+RRECOMMENDS_${PN}-crypt_append_class-nativesdk = " openssl ca-certificates"
+
+# For historical reasons PN is empty and provided by python3-modules
+FILES_${PN} = ""
+RPROVIDES_${PN}-modules = "${PN}"
+
+FILES_${PN}-pydoc += "${bindir}/pydoc${PYTHON_MAJMIN} ${bindir}/pydoc3"
+FILES_${PN}-idle += "${bindir}/idle3 ${bindir}/idle${PYTHON_MAJMIN}"
+
+# provide python-pyvenv from python3-venv
+RPROVIDES_${PN}-venv += "python3-pyvenv"
+
+# package libpython3
+PACKAGES =+ "libpython3 libpython3-staticdev"
+FILES_libpython3 = "${libdir}/libpython*.so.*"
+FILES_libpython3-staticdev += "${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_MAJMIN}-*/libpython${PYTHON_MAJMIN}.a"
+INSANE_SKIP_${PN}-dev += "dev-elf"
+
+# catch all the rest (unsorted)
+PACKAGES += "${PN}-misc"
+RDEPENDS_${PN}-misc += "python3-core python3-email python3-codecs python3-pydoc python3-pickle python3-audio"
+RDEPENDS_${PN}-modules_append_class-target = " python3-misc"
+RDEPENDS_${PN}-modules_append_class-nativesdk = " python3-misc"
+FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN} ${libdir}/python${PYTHON_MAJMIN}/lib-dynload"
+
+# catch manpage
+PACKAGES += "${PN}-man"
+FILES_${PN}-man = "${datadir}/man"
+
+# See https://bugs.python.org/issue18748 and https://bugs.python.org/issue37395
+RDEPENDS_libpython3_append_libc-glibc = " libgcc"
+RDEPENDS_${PN}-ptest = "${PN}-modules ${PN}-tests unzip bzip2 libgcc tzdata-europe coreutils sed"
+RDEPENDS_${PN}-ptest_append_libc-glibc = " locale-base-tr-tr.iso-8859-9"
+RDEPENDS_${PN}-tkinter += "${@bb.utils.contains('PACKAGECONFIG', 'tk', 'tk tk-lib', '', d)}"
+RDEPENDS_${PN}-dev = ""
+
+RDEPENDS_${PN}-tests_append_class-target = " bash"
+RDEPENDS_${PN}-tests_append_class-nativesdk = " bash"
diff --git a/external/poky/meta/recipes-devtools/python/python_2.7.16.bb b/external/poky/meta/recipes-devtools/python/python_2.7.16.bb
deleted file mode 100644
index 16b17447..00000000
--- a/external/poky/meta/recipes-devtools/python/python_2.7.16.bb
+++ /dev/null
@@ -1,270 +0,0 @@
-require python.inc
-
-DEPENDS = "python-native libffi bzip2 gdbm openssl \
- readline sqlite3 zlib virtual/crypt"
-
-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://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://float-endian.patch \
- file://bpo-35907-cve-2019-9948.patch \
- file://bpo-35907-cve-2019-9948-fix.patch \
- file://bpo-36216-cve-2019-9636.patch \
- file://bpo-36216-cve-2019-9636-fix.patch \
- file://bpo-35121-cve-2018-20852.patch \
- file://bpo-30458-cve-2019-9740.patch \
-"
-
-S = "${WORKDIR}/Python-${PV}"
-
-inherit autotools multilib_header python-dir pythonnative ptest
-
-CONFIGUREOPTS += " --with-system-ffi "
-
-EXTRA_OECONF += "ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=no ac_cv_working_tzset=yes"
-
-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' PYTHONNOUSERSITE='1'
-}
-
-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)
-}
-
-PACKAGES_remove = "${PN}"
-
-# 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 unzip"
-
-# 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)}"
-
-RDEPENDS_${PN}-dev = ""
-
-BBCLASSEXTEND = "nativesdk"
-
-# 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 collections, 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:
- manifest_str = manifest_file.read()
- json_start = manifest_str.find('# EOC') + 6
- manifest_file.seek(json_start)
- manifest_str = manifest_file.read()
- python_manifest = json.loads(manifest_str, object_pairs_hook=collections.OrderedDict)
-
- 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')
-
- 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'])
-
- # 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"