From: <mingli.yu@windriver.com>
To: <richard.purdie@linuxfoundation.org>,
<openembedded-core@lists.openembedded.org>
Subject: [PATCH 2/2] python: add tk support
Date: Thu, 25 Oct 2018 16:39:19 +0800 [thread overview]
Message-ID: <1540456759-247805-3-git-send-email-mingli.yu@windriver.com> (raw)
In-Reply-To: <1540456759-247805-1-git-send-email-mingli.yu@windriver.com>
From: Mingli Yu <Mingli.Yu@windriver.com>
Enable tk to add tk support for python.
before the patch:
# python
Python 2.7.15 (default, Oct 25 2018, 08:12:45)
[GCC 8.2.0] on linux2
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/python2.7/lib-tk/Tkinter.py", line 39, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ImportError: No module named _tkinter
>>>
after the patch:
# python
Python 2.7.15 (default, Oct 25 2018, 08:12:45)
[GCC 8.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Tkinter
>>>
Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
---
.../python/avoid_warning_about_tkinter.patch | 29 ----------------------
.../python/python/python2-manifest.json | 8 +++---
meta/recipes-devtools/python/python_2.7.15.bb | 8 +++---
3 files changed, 10 insertions(+), 35 deletions(-)
delete mode 100644 meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patch
diff --git a/meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patch b/meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patch
deleted file mode 100644
index 287095f..0000000
--- a/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/meta/recipes-devtools/python/python/python2-manifest.json b/meta/recipes-devtools/python/python/python2-manifest.json
index 260fa6f..7b49e94 100644
--- a/meta/recipes-devtools/python/python/python2-manifest.json
+++ b/meta/recipes-devtools/python/python/python2-manifest.json
@@ -963,10 +963,12 @@
"tkinter": {
"summary": "Python Tcl/Tk bindings",
"rdepends": [
- "core"
+ "core",
+ "tk"
],
"files": [
- "${libdir}/python2.7/lib-tk"
+ "${libdir}/python2.7/lib-tk",
+ "${libdir}/python2.7/lib-dynload/_tkinter.so"
]
},
"unittest": {
@@ -1043,4 +1045,4 @@
"${libdir}/python2.7/lib-dynload/zlib.so"
]
}
-}
\ No newline at end of file
+}
diff --git a/meta/recipes-devtools/python/python_2.7.15.bb b/meta/recipes-devtools/python/python_2.7.15.bb
index dd969d8..a6ecbb9 100644
--- a/meta/recipes-devtools/python/python_2.7.15.bb
+++ b/meta/recipes-devtools/python/python_2.7.15.bb
@@ -1,6 +1,6 @@
require python.inc
-DEPENDS = "python-native libffi bzip2 gdbm openssl \
+DEPENDS = "python-native libffi bzip2 gdbm openssl tk \
readline sqlite3 zlib virtual/crypt"
PR = "${INC_PR}"
@@ -21,7 +21,6 @@ SRC_URI += "\
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 \
@@ -227,7 +226,10 @@ python(){
# Make it work with or without $PN
if '${PN}' in value:
value=value.split('-')[1]
- d.appendVar('RDEPENDS_' + pypackage, ' ' + pn + '-' + value)
+ if "tkinter" in pypackage and value == "tk":
+ d.appendVar('RDEPENDS_' + pypackage, ' ' + value)
+ else:
+ d.appendVar('RDEPENDS_' + pypackage, ' ' + pn + '-' + value)
d.setVar('SUMMARY_' + pypackage, python_manifest[key]['summary'])
# Prepending so to avoid python-misc getting everything
--
2.7.4
next prev parent reply other threads:[~2018-10-25 8:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-25 8:39 [PATCH 0/2] python: add tk support mingli.yu
2018-10-25 8:39 ` [PATCH 1/2] tk: add new recipe(move from meta-oe) mingli.yu
2018-10-25 8:39 ` mingli.yu [this message]
2018-10-25 9:08 ` ✗ patchtest: failure for python: add tk support Patchwork
2018-10-29 12:51 ` [PATCH 0/2] " Burton, Ross
2018-10-30 4:52 ` Randy MacLeod
2018-10-30 11:11 ` Burton, Ross
2018-11-05 9:29 ` Yu, Mingli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1540456759-247805-3-git-send-email-mingli.yu@windriver.com \
--to=mingli.yu@windriver.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=richard.purdie@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox