]> code.ossystems Code Review - openembedded-core.git/commitdiff
python3: add tk support
authorMingli Yu <Mingli.Yu@windriver.com>
Wed, 14 Nov 2018 09:36:11 +0000 (17:36 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 23 Nov 2018 23:32:10 +0000 (23:32 +0000)
Add support to enable tk via PACKAGECONFIG.
before this patch:
 # python3
 Python 3.5.6 (default, Nov  8 2018, 04:53:45)
 [GCC 8.2.0] on linux
 Type "help", "copyright", "credits" or "license" for more information.
 >>> import tkinter
 Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python3.5/tkinter/__init__.py", line 35, in <module>
    import _tkinter # If this fails your Python may not be configured for Tk
 ImportError: No module named '_tkinter'
 >>>

After this patch, if enable tk in PACKAGECONFIG, then
 # python3
 Python 3.5.6 (default, Nov  8 2018, 03:15:52)
 [GCC 8.2.0] on linux
 Type "help", "copyright", "credits" or "license" for more information.
 >>> import tkinter
 >>>

Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/python/python3-native_3.5.6.bb
meta/recipes-devtools/python/python3/python3-manifest.json
meta/recipes-devtools/python/python3_3.5.6.bb

index d5953cf4bbec7dcdea45780a0886eae5b4241cb3..1e98c036c39014219773f9637c4ee0acb2bdc6a6 100644 (file)
@@ -12,7 +12,7 @@ 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 \
+${@bb.utils.contains('PACKAGECONFIG', 'tk', '', 'file://avoid_warning_about_tkinter.patch', d)} \
 file://0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch \
 file://sysroot-include-headers.patch \
 file://unixccompiler.patch \
@@ -28,6 +28,7 @@ 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 \
 "
+PACKAGECONFIG[tk] = ",,tk-native"
 
 EXTRANATIVEPATH += "bzip2-native"
 DEPENDS = "openssl-native bzip2-replacement-native zlib-native readline-native sqlite3-native gdbm-native"
index 5329bf7c579b55a9b65a48960d66c37c35fb49d0..617256a3e04e05849820b099a6b07181e09ce6bb 100644 (file)
             "core"
         ],
         "files": [
+            "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter.*.so",
             "${libdir}/python${PYTHON_MAJMIN}/tkinter"
         ],
         "cached": []
index 5408e3f9fcf9f944197903f91ca881c0d13e9eb5..25c47b6192ab6f980c013ad03dcc31126412a472 100644 (file)
@@ -21,7 +21,7 @@ ${DISTRO_SRC_URI} \
 
 SRC_URI += "\
             file://03-fix-tkinter-detection.patch \
-            file://avoid_warning_about_tkinter.patch \
+            ${@bb.utils.contains('PACKAGECONFIG', 'tk', '', 'file://avoid_warning_about_tkinter.patch', d)} \
             file://cgi_py.patch \
             file://host_include_contamination.patch \
             file://python-3.3-multilib.patch \
@@ -82,6 +82,7 @@ PACKAGECONFIG ??= "readline ${@bb.utils.contains('MACHINE_FEATURES', 'qemu-userm
 PACKAGECONFIG[readline] = ",,readline"
 # Use profile guided optimisation by running PyBench inside qemu-user
 PACKAGECONFIG[pgo] = "--enable-optimizations"
+PACKAGECONFIG[tk] = ",,tk"
 
 do_configure_append() {
        rm -f ${S}/Makefile.orig
@@ -246,7 +247,7 @@ PACKAGES += "${PN}-man"
 FILES_${PN}-man = "${datadir}/man"
 
 RDEPENDS_${PN}-ptest = "${PN}-modules ${PN}-tests unzip bzip2"
-
+RDEPENDS_${PN}-tkinter += "${@bb.utils.contains('PACKAGECONFIG', 'tk', 'tk', '', d)}"
 RDEPENDS_${PN}-dev = ""
 
 BBCLASSEXTEND = "nativesdk"