python/python3: add tk support
v2 cover python/python3: add tk support
PATCH v2 1/7 python: add tk support
From: Mingli Yu <[email protected]>
Add support to enable tk via PACKGECONFIG.
before the patch:
# python Python 2.7.15 (default, Nov 8 2018, 04:53:50) [GCC 8.2.0] on linux2 Type "help", "copyright", "credits" or "license" for more information.
Quoted 1 line
Quoted 1 line
Quoted 1 line
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
Quoted 1 line
Quoted 1 line
Quoted 1 line
After the patch, if enable tk in PACKGECONFIG, then
# 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.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
import Tkinter
--- meta/recipes-devtools/python/python_2.7.15.bb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
meta/recipes-devtools/python/python_2.7.15.bb +7 -1
@@ -21,7 +21,7 @@ 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 \ + ${@bb.utils.contains('PACKAGECONFIG', 'tk', '', 'file://avoid_warning_about_tkinter.patch', d)} \ file://avoid_warning_for_sunos_specific_module.patch \ file://python-2.7.3-remove-bsdb-rpath.patch \ file://run-ptest \
@@ -45,6 +45,7 @@ EXTRA_OECONF += "ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=no" PACKAGECONFIG ??= "bdb" PACKAGECONFIG[bdb] = ",,db" +PACKAGECONFIG[tk] = ",,tk" do_configure_append() { rm -f ${S}/Makefile.orig
@@ -204,6 +205,7 @@ python(){ packages = d.getVar('PACKAGES').split() pn = d.getVar('PN') + pkgconfig = d.getVar('PACKAGECONFIG') newpackages=[]
@@ -219,6 +221,8 @@ python(){ d.setVar('FILES_' + pypackage, '') for value in python_manifest[key]['files']: d.appendVar('FILES_' + pypackage, ' ' + value) + if "tkinter" in pypackage and "tk" in pkgconfig: + d.appendVar('FILES_' + pypackage, ' ' + "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter.so") if include_pycs == '1': if value.endswith('.py'): d.appendVar('FILES_' + pypackage, ' ' + value + 'c')
@@ -228,6 +232,8 @@ python(){ if '${PN}' in value: value=value.split('-')[1] d.appendVar('RDEPENDS_' + pypackage, ' ' + pn + '-' + value) + if "tkinter" in pypackage and "tk" in pkgconfig: + d.appendVar('RDEPENDS_' + pypackage, ' ' + 'tk') d.setVar('SUMMARY_' + pypackage, python_manifest[key]['summary']) # Prepending so to avoid python-misc getting everything
Signature · 1 line
2.7.4
PATCH v3 1/1 python: add tk support
From: Mingli Yu <[email protected]>
Add support to enable tk via PACKGECONFIG.
before the patch:
# python Python 2.7.15 (default, Nov 8 2018, 04:53:50) [GCC 8.2.0] on linux2 Type "help", "copyright", "credits" or "license" for more information.
Quoted 1 line
Quoted 1 line
Quoted 1 line
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
Quoted 1 line
Quoted 1 line
Quoted 1 line
After the patch, if enable tk in PACKGECONFIG, then
# 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.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
import Tkinter
--- meta/recipes-devtools/python/python/python2-manifest.json | 3 ++- meta/recipes-devtools/python/python_2.7.15.bb | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-)
meta/recipes-devtools/python/python/python2-manifest.json +2 -1
@@ -966,6 +966,7 @@ "core" ], "files": [ + "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter.so", "${libdir}/python2.7/lib-tk" ] },
@@ -1043,4 +1044,4 @@ "${libdir}/python2.7/lib-dynload/zlib.so" ] } -} +}
meta/recipes-devtools/python/python_2.7.15.bb +3 -2
@@ -21,7 +21,7 @@ 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 \ + ${@bb.utils.contains('PACKAGECONFIG', 'tk', '', 'file://avoid_warning_about_tkinter.patch', d)} \ file://avoid_warning_for_sunos_specific_module.patch \ file://python-2.7.3-remove-bsdb-rpath.patch \ file://run-ptest \
@@ -45,6 +45,7 @@ EXTRA_OECONF += "ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=no" PACKAGECONFIG ??= "bdb" PACKAGECONFIG[bdb] = ",,db" +PACKAGECONFIG[tk] = ",,tk" do_configure_append() { rm -f ${S}/Makefile.orig
@@ -172,7 +173,7 @@ RDEPENDS_${PN}-modules += "${PN}-misc" # ptest RDEPENDS_${PN}-ptest = "${PN}-modules ${PN}-tests unzip" - +RDEPENDS_${PN}-tkinter += "${@bb.utils.contains('PACKAGECONFIG', 'tk', 'tk', '', d)}" # catch manpage PACKAGES += "${PN}-man" FILES_${PN}-man = "${datadir}/man"
Signature · 1 line
2.7.4
Re: [PATCH v3] python: add tk support
Ping.
Thanks,
Quoted 80 lines · On 2018年11月14日 17:38, [email protected] wrote:
From: Mingli Yu <[email protected]>
Add support to enable tk via PACKGECONFIG.
before the patch:# python Python 2.7.15 (default, Nov 8 2018, 04:53:50) [GCC 8.2.0] on linux2 Type "help", "copyright", "credits" or "license" for more information.Quoted 1 line
Quoted 1 line
Quoted 1 line
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 TkImportError: No module named
_tkinterQuoted 1 line
Quoted 1 line
Quoted 1 line
After the patch, if enable tk in PACKGECONFIG, then
# 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.Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
import Tkinter
Signed-off-by Mingli Yu <[email protected]>--- meta/recipes-devtools/python/python/python2-manifest.json | 3 ++- meta/recipes-devtools/python/python_2.7.15.bb | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-)meta/recipes-devtools/python/python/python2-manifest.json +2
-1@@ -966,6 +966,7 @@ "core" ], "files": [ + "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter.so", "${libdir}/python2.7/lib-tk" ] },@@ -1043,4 +1044,4 @@ "${libdir}/python2.7/lib-dynload/zlib.so" ] } -} +}meta/recipes-devtools/python/python_2.7.15.bb +3
-2@@ -21,7 +21,7 @@ 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 \ + ${@bb.utils.contains('PACKAGECONFIG', 'tk', '', 'file://avoid_warning_about_tkinter.patch', d)} \ file://avoid_warning_for_sunos_specific_module.patch \ file://python-2.7.3-remove-bsdb-rpath.patch \ file://run-ptest \@@ -45,6 +45,7 @@ EXTRA_OECONF += "ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=no" PACKAGECONFIG ??= "bdb" PACKAGECONFIG[bdb] = ",,db" +PACKAGECONFIG[tk] = ",,tk" do_configure_append() { rm -f ${S}/Makefile.orig@@ -172,7 +173,7 @@ RDEPENDS_${PN}-modules += "${PN}-misc" # ptest RDEPENDS_${PN}-ptest = "${PN}-modules ${PN}-tests unzip" - +RDEPENDS_${PN}-tkinter += "${@bb.utils.contains('PACKAGECONFIG', 'tk', 'tk', '', d)}" # catch manpage PACKAGES += "${PN}-man" FILES_${PN}-man = "${datadir}/man"
Re: [PATCH v3] python: add tk support
In reply to [email protected]Ping.
Thanks,
Quoted 80 lines · On 2018年11月14日 17:38, [email protected] wrote:
From: Mingli Yu <[email protected]>
Add support to enable tk via PACKGECONFIG.
before the patch:# python Python 2.7.15 (default, Nov 8 2018, 04:53:50) [GCC 8.2.0] on linux2 Type "help", "copyright", "credits" or "license" for more information.Quoted 1 line
Quoted 1 line
Quoted 1 line
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 TkImportError: No module named
_tkinterQuoted 1 line
Quoted 1 line
Quoted 1 line
After the patch, if enable tk in PACKGECONFIG, then
# 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.Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
import Tkinter
Signed-off-by Mingli Yu <[email protected]>--- meta/recipes-devtools/python/python/python2-manifest.json | 3 ++- meta/recipes-devtools/python/python_2.7.15.bb | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-)meta/recipes-devtools/python/python/python2-manifest.json +2
-1@@ -966,6 +966,7 @@ "core" ], "files": [ + "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter.so", "${libdir}/python2.7/lib-tk" ] },@@ -1043,4 +1044,4 @@ "${libdir}/python2.7/lib-dynload/zlib.so" ] } -} +}meta/recipes-devtools/python/python_2.7.15.bb +3
-2@@ -21,7 +21,7 @@ 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 \ + ${@bb.utils.contains('PACKAGECONFIG', 'tk', '', 'file://avoid_warning_about_tkinter.patch', d)} \ file://avoid_warning_for_sunos_specific_module.patch \ file://python-2.7.3-remove-bsdb-rpath.patch \ file://run-ptest \@@ -45,6 +45,7 @@ EXTRA_OECONF += "ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=no" PACKAGECONFIG ??= "bdb" PACKAGECONFIG[bdb] = ",,db" +PACKAGECONFIG[tk] = ",,tk" do_configure_append() { rm -f ${S}/Makefile.orig@@ -172,7 +173,7 @@ RDEPENDS_${PN}-modules += "${PN}-misc" # ptest RDEPENDS_${PN}-ptest = "${PN}-modules ${PN}-tests unzip" - +RDEPENDS_${PN}-tkinter += "${@bb.utils.contains('PACKAGECONFIG', 'tk', 'tk', '', d)}" # catch manpage PACKAGES += "${PN}-man" FILES_${PN}-man = "${datadir}/man"
PATCH v2 2/7 python3: add tk support
In reply to [email protected]From: Mingli Yu <[email protected]>
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.
Quoted 1 line
Quoted 1 line
Quoted 1 line
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'
Quoted 1 line
Quoted 1 line
Quoted 1 line
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.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
import tkinter
--- meta/recipes-devtools/python/python3_3.5.6.bb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
meta/recipes-devtools/python/python3_3.5.6.bb +7 -1
@@ -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
@@ -270,6 +271,7 @@ python(){ packages = d.getVar('PACKAGES').split() pn = d.getVar('PN') + pkgconfig = d.getVar('PACKAGECONFIG') newpackages=[] for key in python_manifest:
@@ -284,6 +286,8 @@ python(){ d.setVar('FILES_' + pypackage, '') for value in python_manifest[key]['files']: d.appendVar('FILES_' + pypackage, ' ' + value) + if "tkinter" in pypackage and "tk" in pkgconfig: + d.appendVar('FILES_' + pypackage, ' ' + "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter*.so") # Add cached files if include_pycs == '1':
@@ -295,6 +299,8 @@ python(){ if '${PN}' in value: value=value.split('-')[1] d.appendVar('RDEPENDS_' + pypackage, ' ' + pn + '-' + value) + if "tkinter" in pypackage and "tk" in pkgconfig: + d.appendVar('RDEPENDS_' + pypackage, ' ' + 'tk') d.setVar('SUMMARY_' + pypackage, python_manifest[key]['summary']) # Prepending so to avoid python-misc getting everything
Signature · 1 line
2.7.4
Re: [PATCH 2/7] python3: add tk support
meta/recipes-devtools/python/python3_3.5.6.bb python(){
Quoted 4 lines · On Thu, 8 Nov 2018 at 06:09, <[email protected]> wrote:
meta/recipes-devtools/python/python3_3.5.6.bb +4
-0+ if "tkinter" in pypackage and "tk" in pkgconfig: + d.appendVar('FILES_' + pypackage, ' ' + "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter*.so") + if "tkinter" in pypackage and "tk" in pkgconfig: + d.appendVar('RDEPENDS_' + pypackage, ' ' + 'tk')
Why is this here and not in the manifest?
Ross
Re: [PATCH 2/7] python3: add tk support
Quoted 7 lines · Ross
meta/recipes-devtools/python/python3_3.5.6.bb python(){
Quoted 4 lines · On Thu, 8 Nov 2018 at 06:09, <[email protected]> wrote:
meta/recipes-devtools/python/python3_3.5.6.bb +4
-0+ if "tkinter" in pypackage and "tk" in pkgconfig: + d.appendVar('FILES_' + pypackage, ' ' + "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter*.so") + if "tkinter" in pypackage and "tk" in pkgconfig: + d.appendVar('RDEPENDS_' + pypackage, ' ' + 'tk')Why is this here and not in the manifest?
It's because we can optionally enable or disable tk via PACKAGECONFIG, if add it to manifest then we need to always enable tk which is also the implement in v1.
Thanks,
Grace
Quoted 3 lines
Ross
Re: [PATCH 2/7] python3: add tk support
Quoted 5 lines · Mingli
Quoted 1 line
Why is this here and not in the manifest?
It's because we can optionally enable or disable tk via PACKAGECONFIG, if add it to manifest then we need to always enable tk which is also the implement in v1.
Are you sure? As I understand it there won't be any errors if the contents don't exist. And to be honest if there are, then the manifest tooling should handle that neatly without special-casing.
Ross
Re: [PATCH 2/7] python3: add tk support
Quoted 10 lines · Ross
Quoted 5 lines · Mingli
Quoted 1 line
Why is this here and not in the manifest?
It's because we can optionally enable or disable tk via PACKAGECONFIG, if add it to manifest then we need to always enable tk which is also the implement in v1.
Are you sure? As I understand it there won't be any errors if the contents don't exist. And to be honest if there are, then the manifest tooling should handle that neatly without special-casing.
Hi Ross,
Thanks for your feedback!
I didn't quite understand what you mean. As I know, if we add the the setting in manifest as below:
meta/recipes-devtools/python/python3/python3-manifest.json +4 -2
@@ -1056,10 +1056,12 @@ "tkinter": { "summary": "Python Tcl/Tk bindings", "rdepends": [ - "core" + "core", + "tk" ], "files": [ - "${libdir}/python${PYTHON_MAJMIN}/tkinter" + "${libdir}/python${PYTHON_MAJMIN}/tkinter", + "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter*.so" ], "cached": [] },
There comes below error:
ERROR: Nothing RPROVIDES 'python3-tk' (but /mybuild/layers/oe-core/meta/recipes-devtools/python/python3_3.5.6.bb RDEPENDS on or otherwise requires it)
NOTE: Runtime target 'python3-tk' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['python3-tk']
ERROR: Required build target 'python3' has no buildable providers.
Missing or unbuildable dependency chain was: ['python3', 'python3-tk']
That's to say, we still need to add some fix in meta/recipes-devtools/python/python3_3.5.6.bb. If so, it may be flexible and clear to directly to make the implement just as what I send in the RR.
Thanks,
Quoted 3 lines
Ross
Re: [PATCH 2/7] python3: add tk support
Hey Yu,
Quoted 26 lines · Mingli
Quoted 10 lines · Ross
Quoted 5 lines · Mingli
Quoted 1 line
Why is this here and not in the manifest?
It's because we can optionally enable or disable tk via PACKAGECONFIG, if add it to manifest then we need to always enable tk which is also the implement in v1.
Are you sure? As I understand it there won't be any errors if the contents don't exist. And to be honest if there are, then the manifest tooling should handle that neatly without special-casing.
Hi Ross,
Thanks for your feedback!
I didn't quite understand what you mean. As I know, if we add the the setting in manifest as below:
meta/recipes-devtools/python/python3/python3-manifest.json +0
-0@@ -1056,10 +1056,12 @@ "tkinter": { "summary": "Python Tcl/Tk bindings",
Quoted 4 lines
"rdepends": [
- "core"
+ "core",
+ "tk"
This error is happening because you are trying to add python3-tk on RDEPENDS, and that package doesn't exist, when you specify "foo" on the "rdepends" section of the manifest it is translated to ${PN}-foo.
So two things:
1. The manifest can have the _tkinter.*.so on the "files section of tkinter (please note that this is _tkinter.*.so and not _tkinter*.so, the wildcard should be after a "." this is to keep a standard which the tooling can handle more easily.
When the PACKAGECONFIG is enabled, the files for tkinter will be picked up correctly.
2. You should not manually add "rdepends" to the manifest, the tool itself should populate those automatically, this is better because we would avoid this kind of errors.
Please add the package to the manifest, populate the "files" and "summary" section and then run $ bitbake python3 -c create_manifest to populate the rdepends section automatically, also keep in mind that you should run this when the PACKAGECONFIG is enabled for the native package as well (thats how it will pick up the dependencies).
Cheers,
Alejandro
Quoted 23 lines
],
"files": [
- "${libdir}/python${PYTHON_MAJMIN}/tkinter" + "${libdir}/python${PYTHON_MAJMIN}/tkinter",
+ "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter*.so" ],
"cached": []
},There comes below error:
ERROR: Nothing RPROVIDES 'python3-tk' (but /mybuild/layers/oe-core/meta/recipes-devtools/python/python3_3.5.6.bb RDEPENDS on or otherwise requires it)
NOTE: Runtime target 'python3-tk' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['python3-tk']
ERROR: Required build target 'python3' has no buildable providers.
Missing or unbuildable dependency chain was: ['python3', 'python3-tk']That's to say, we still need to add some fix in meta/recipes-devtools/python/python3_3.5.6.bb. If so, it may be flexible and clear to directly to make the implement just as what I send in the RR.
Thanks,
Quoted 3 lines
Ross
Re: [PATCH 2/7] python3: add tk support
Hi Alejandro,
Many thanks for your comments, please check my comments inline.
Quoted 35 lines · Alejandro Hernandez
Hey Yu,
Quoted 31 lines · Mingli
Quoted 11 lines · Ross
Quoted 6 lines · Mingli
Quoted 1 line
Why is this here and not in the manifest?
It's because we can optionally enable or disable tk via PACKAGECONFIG, if add it to manifest then we need to always enable tk which is also the
implement in v1.Are you sure? As I understand it there won't be any errors if the contents don't exist. And to be honest if there are, then the manifest tooling should handle that neatly without special-casing.
Hi Ross,
Thanks for your feedback!
I didn't quite understand what you mean. As I know, if we add the the setting in manifest as below:
diff --gita/meta/recipes-devtools/python/python3/python3-manifest.jsonb/meta/recipes-devtools/python/python3/python3-manifest.jsonindex f922561..09c9199 100644meta/recipes-devtools/python/python3/python3-manifest.json +0
-0@@ -1056,10 +1056,12 @@ "tkinter": { "summary": "Python Tcl/Tk bindings", "rdepends": [
Quoted 8 lines
meta/recipes-devtools/python/python3/python3-manifest.json line 1060
Quoted 3 lines
meta/recipes-devtools/python/python3/python3-manifest.json +2
-1- "core" + "core", + "tk"This error is happening because you are trying to add python3-tk on RDEPENDS, and that package doesn't exist, when you specify "foo" on the "rdepends" section of the manifest it is translated to ${PN}-foo.
Yes, that's why I point out that we need to add extra logic in python3 recipe to make it rdepends on tk after add the logic as below:
meta/recipes-devtools/python/python3/python3-manifest.json +4 -2
@@ -1056,10 +1056,12 @@ "tkinter": { "summary": "Python Tcl/Tk bindings", "rdepends": [ - "core" + "core", + "tk" ], "files": [ - "${libdir}/python${PYTHON_MAJMIN}/tkinter" + "${libdir}/python${PYTHON_MAJMIN}/tkinter", + "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter*.so" ], "cached": [] },
Quoted 7 lines
So two things:
1. The manifest can have the _tkinter.*.so on the "files section of tkinter (please note that this is _tkinter.*.so and not _tkinter*.so, the wildcard should be after a "." this is to keep a standard which the tooling can handle more easily.
Got it, thanks!
Quoted 8 lines
When the PACKAGECONFIG is enabled, the files for tkinter will be picked up correctly.
2. You should not manually add "rdepends" to the manifest, the tool itself should populate those automatically, this is better because we would avoid this kind of errors.
Quoted 5 lines
Please add the package to the manifest, populate the "files" and "summary" section and then run $ bitbake python3 -c
create_manifestto populate the rdepends section automatically, also keep in mind that you should run this when the PACKAGECONFIG is enabled for the native package as well (thats how it will pick up the dependencies).
No new package needed to add to manifest, we only need to update the items for the existed package tkinter and per your suggestion not manually add "rdepends" to the manifest, so I only add files to manifest as below in manifest file,
meta/recipes-devtools/python/python3/python3-manifest.json +0 -0
@@ -1056,10 +1056,12 @@
"tkinter": {
"summary": "Python Tcl/Tk bindings",
"rdepends": [
"core"
],
"files": [
- "${libdir}/python${PYTHON_MAJMIN}/tkinter"
+ "${libdir}/python${PYTHON_MAJMIN}/tkinter",
+ "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter*.so" ],
"cached": []
},
And also the update the python3 recipe,
meta/recipes-devtools/python/python3_3.5.6.bb +0 -0
@@ -78,10 +78,11 @@ 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 ${@bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'pgo', '', d)} tk"
PACKAGECONFIG[readline] = ",,readline"
# Use profile guided optimisation by running PyBench inside qemu-user PACKAGECONFIG[pgo] = "--enable-optimizations"
+PACKAGECONFIG[tk] = ",,tk,tk"
And then I run $ bitbake python3 -c create_manifest, but there is no change in manifest file.
Thanks,
Quoted 36 lines
Cheers,
Alejandro
Quoted 28 lines
meta/recipes-devtools/python/python3/python3-manifest.json +2
-1], "files": [ - "${libdir}/python${PYTHON_MAJMIN}/tkinter" + "${libdir}/python${PYTHON_MAJMIN}/tkinter", + "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter*.so" ], "cached": [] },There comes below error:
ERROR: Nothing RPROVIDES 'python3-tk' (but /mybuild/layers/oe-core/meta/recipes-devtools/python/python3_3.5.6.bb RDEPENDS on or otherwise requires it)
NOTE: Runtime target 'python3-tk' is unbuildable, removing... Missing or unbuildable dependency chain was: ['python3-tk']
ERROR: Required build target 'python3' has no buildable providers. Missing or unbuildable dependency chain was: ['python3', 'python3-tk']That's to say, we still need to add some fix in meta/recipes-devtools/python/python3_3.5.6.bb. If so, it may be flexible and clear to directly to make the implement just as what I send in the RR.
Thanks,
Quoted 3 lines
Ross
Re: [PATCH 2/7] python3: add tk support
Quoted 89 lines · Mingli
Hi Alejandro,
Many thanks for your comments, please check my comments inline.
Quoted 35 lines · Alejandro Hernandez
Hey Yu,
Quoted 31 lines · Mingli
Quoted 11 lines · Ross
Quoted 6 lines · Mingli
Quoted 1 line
Why is this here and not in the manifest?
It's because we can optionally enable or disable tk via PACKAGECONFIG, if add it to manifest then we need to always enable tk which is also the
implement in v1.Are you sure? As I understand it there won't be any errors if the contents don't exist. And to be honest if there are, then the manifest tooling should handle that neatly without special-casing.
Hi Ross,
Thanks for your feedback!
I didn't quite understand what you mean. As I know, if we add the the setting in manifest as below:
diff --gita/meta/recipes-devtools/python/python3/python3-manifest.jsonb/meta/recipes-devtools/python/python3/python3-manifest.jsonindex f922561..09c9199 100644meta/recipes-devtools/python/python3/python3-manifest.json +0
-0@@ -1056,10 +1056,12 @@ "tkinter": { "summary": "Python Tcl/Tk bindings","rdepends": [
Quoted 8 lines
Quoted 3 lines
- "core"
+ "core",
+ "tk"This error is happening because you are trying to add python3-tk on RDEPENDS, and that package doesn't exist, when you specify "foo" on the "rdepends" section of the manifest it is translated to ${PN}-foo.
Yes, that's why I point out that we need to add extra logic in python3 recipe to make it rdepends on tk after add the logic as below:
meta/recipes-devtools/python/python3/python3-manifest.json +0
-0@@ -1056,10 +1056,12 @@ "tkinter": { "summary": "Python Tcl/Tk bindings","rdepends": [
- "core"
+ "core",
+ "tk"
],
"files": [
- "${libdir}/python${PYTHON_MAJMIN}/tkinter" + "${libdir}/python${PYTHON_MAJMIN}/tkinter",
+ "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter*.so" ],
"cached": []
},Quoted 7 lines
So two things:
1. The manifest can have the _tkinter.*.so on the "files section of tkinter (please note that this is _tkinter.*.so and not _tkinter*.so, the wildcard should be after a "." this is to keep a standard which the tooling can handle more easily.
Got it, thanks!
Quoted 8 lines
When the PACKAGECONFIG is enabled, the files for tkinter will be picked up correctly.
2. You should not manually add "rdepends" to the manifest, the tool itself should populate those automatically, this is better because we would avoid this kind of errors.
Quoted 7 lines
Quoted 5 lines
Please add the package to the manifest, populate the "files" and "summary" section and then run $ bitbake python3 -c
create_manifestto populate the rdepends section automatically, also keep in mind that you should run this when the PACKAGECONFIG is enabled for the native package as well (thats how it will pick up the dependencies).No new package needed to add to manifest, we only need to update the items for the existed package tkinter and per your suggestion not manually add "rdepends" to the manifest, so I only add files to manifest as below in manifest file,
My mistake I thought you were adding a new package.
Anyway, as a matter of fact, all you need to do is to add the same PACKAGECONFIG on the python3 native recipe and enable it, once its enabled you can run the create_manifest task and it should automatically generate you a new manifest with the required files (clarifying that it doesnt have to be enabled by default but it has to be enabled on the native package when the create_manifest task is run), meaning that you don't actually need to add the _tkinter.*.so file manually to the manifest, it should be picked up automatically, this is because the create_manifest tool assumes that the python3 and python3-native packages are exact copies of each other.
Regarding the extra logic, I also agree with Ross, and I don't personally like having the extra logic there, either for that package or for handling each package that would need a PACKAGECONFIG, I think using
RDEPENDS_${PN}-tkinter += "${@bb.utils.contains('PACKAGECONFIG', 'tk', 'tk', '', d)}"
should be enough.
Alejandro
Quoted 78 lines
meta/recipes-devtools/python/python3/python3-manifest.json +0
-0@@ -1056,10 +1056,12 @@ "tkinter": { "summary": "Python Tcl/Tk bindings","rdepends": [
"core"
],
"files": [
- "${libdir}/python${PYTHON_MAJMIN}/tkinter"
+ "${libdir}/python${PYTHON_MAJMIN}/tkinter",
+ "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter*.so" ],
"cached": []
},And also the update the python3 recipe,
meta/recipes-devtools/python/python3_3.5.6.bb +0
-0@@ -78,10 +78,11 @@ export CCSHARED = "-fPIC" # Fix cross compilation of different modulesexport 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 ${@bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'pgo', '', d)} tk"
PACKAGECONFIG[readline] = ",,readline"
# Use profile guided optimisation by running PyBench inside qemu-user PACKAGECONFIG[pgo] = "--enable-optimizations" +PACKAGECONFIG[tk] = ",,tk,tk"And then I run $ bitbake python3 -c
create_manifest, but there is no change in manifest file.Thanks,
Quoted 36 lines
Cheers,
Alejandro
Quoted 28 lines
],
"files": [
- "${libdir}/python${PYTHON_MAJMIN}/tkinter" + "${libdir}/python${PYTHON_MAJMIN}/tkinter",
+ "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter*.so" ],
"cached": []
},There comes below error:
ERROR: Nothing RPROVIDES 'python3-tk' (but /mybuild/layers/oe-core/meta/recipes-devtools/python/python3_3.5.6.bb RDEPENDS on or otherwise requires it)
NOTE: Runtime target 'python3-tk' is unbuildable, removing... Missing or unbuildable dependency chain was: ['python3-tk']
ERROR: Required build target 'python3' has no buildable providers. Missing or unbuildable dependency chain was: ['python3', 'python3-tk']That's to say, we still need to add some fix in meta/recipes-devtools/python/python3_3.5.6.bb. If so, it may be flexible and clear to directly to make the implement just as what I send in the RR.
Thanks,
Quoted 3 lines
Ross
Re: [PATCH 2/7] python3: add tk support
Quoted 107 lines · Alejandro Hernandez
Quoted 100 lines · Mingli
Hi Alejandro,
Many thanks for your comments, please check my comments inline.
Quoted 37 lines · Alejandro Hernandez
Hey Yu,
Quoted 33 lines · Mingli
Quoted 10 lines · Ross
Quoted 7 lines · Mingli
Quoted 1 line
Why is this here and not in the manifest?
It's because we can optionally enable or disable tk via PACKAGECONFIG,
if add it to manifest then we need to always enable tk which is also the
implement in v1.Quoted 3 lines
Are you sure? As I understand it there won't be any errors if the contents don't exist. And to be honest if there are, then the manifest tooling should handle that neatly without special-casing.
Hi Ross,
Thanks for your feedback!
I didn't quite understand what you mean. As I know, if we add the the setting in manifest as below:
diff --gita/meta/recipes-devtools/python/python3/python3-manifest.jsonb/meta/recipes-devtools/python/python3/python3-manifest.jsonindex f922561..09c9199 100644meta/recipes-devtools/python/python3/python3-manifest.json +0
-0@@ -1056,10 +1056,12 @@ "tkinter": { "summary": "Python Tcl/Tk bindings", "rdepends": [Quoted 8 lines
meta/recipes-devtools/python/python3/python3-manifest.json line 1060
Quoted 3 lines
meta/recipes-devtools/python/python3/python3-manifest.json +2
-1- "core" + "core", + "tk"This error is happening because you are trying to add python3-tk on RDEPENDS, and that package doesn't exist, when you specify "foo" on the "rdepends" section of the manifest it is translated to ${PN}-foo.
Yes, that's why I point out that we need to add extra logic in python3 recipe to make it rdepends on tk after add the logic as below:
diff --git
a/meta/recipes-devtools/python/python3/python3-manifest.jsonb/meta/recipes-devtools/python/python3/python3-manifest.jsonindex f922561..09c9199 100644meta/recipes-devtools/python/python3/python3-manifest.json +4
-2@@ -1056,10 +1056,12 @@ "tkinter": { "summary": "Python Tcl/Tk bindings", "rdepends": [ - "core" + "core", + "tk" ], "files": [ - "${libdir}/python${PYTHON_MAJMIN}/tkinter" + "${libdir}/python${PYTHON_MAJMIN}/tkinter", + "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter*.so" ], "cached": [] },Quoted 8 lines
So two things:
1. The manifest can have the _tkinter.*.so on the "files section of tkinter (please note that this is _tkinter.*.so and not _tkinter*.so, the wildcard should be after a "." this is to keep a standard which the tooling can handle more easily.
Got it, thanks!
Quoted 8 lines
When the PACKAGECONFIG is enabled, the files for tkinter will be picked up correctly.
2. You should not manually add "rdepends" to the manifest, the tool itself should populate those automatically, this is better because we would avoid this kind of errors.
Quoted 5 lines
Please add the package to the manifest, populate the "files" and "summary" section and then run $ bitbake python3 -c
create_manifestto populate the rdepends section automatically, also keep in mind that you should run this when the PACKAGECONFIG is enabled for the native package as well (thats how it will pick up the dependencies).Quoted 4 lines
No new package needed to add to manifest, we only need to update the items for the existed package tkinter and per your suggestion not manually add "rdepends" to the manifest, so I only add files to manifest as below in manifest file,
Quoted 4 lines
My mistake I thought you were adding a new package.
Anyway, as a matter of fact, all you need to do is to add the same PACKAGECONFIG on the python3 native recipe and enable it, once its
Many thanks for Alejandro's hints!
I still failed to let the files(_tkinter.*.so) automatically added to manifest though I run $ bitbake python3 -c create_manifest altogether with below logic. Could you help to take a look is there anything I miss?
$ git diff
meta/recipes-devtools/python/python3-native_3.5.6.bb +2 -0
@@ -28,6 +28,8 @@ 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 ??= "tkinter" +PACKAGECONFIG[tkinter] = ",,tk,tk" EXTRANATIVEPATH += "bzip2-native" DEPENDS = "openssl-native bzip2-replacement-native zlib-native
readline-native sqlite3-native gdbm-native"
meta/recipes-devtools/python/python3_3.5.6.bb +0 -0
@@ -78,10 +78,11 @@ 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 ${@bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'pgo', '', d)} tkinter"
PACKAGECONFIG[readline] = ",,readline"
# Use profile guided optimisation by running PyBench inside qemu-user
PACKAGECONFIG[pgo] = "--enable-optimizations"
+PACKAGECONFIG[tkinter] = ",,tk,tk"
do_configure_append() {
rm -f ${S}/Makefile.origThanks,
Quoted 107 lines
enabled you can run the
create_manifesttask and it should automatically generate you a new manifest with the required files (clarifying that it doesnt have to be enabled by default but it has to be enabled on the native package when thecreate_manifesttask is run), meaning that you don't actually need to add the _tkinter.*.so file manually to the manifest, it should be picked up automatically, this is because thecreate_manifesttool assumes that the python3 and python3-native packages are exact copies of each other.Regarding the extra logic, I also agree with Ross, and I don't personally like having the extra logic there, either for that package or for handling each package that would need a PACKAGECONFIG, I think using
RDEPENDS_${PN}-tkinter += "${@bb.utils.contains('PACKAGECONFIG', 'tk', 'tk', '', d)}"
should be enough.
Alejandro
Quoted 84 lines
diff --git
a/meta/recipes-devtools/python/python3/python3-manifest.jsonb/meta/recipes-devtools/python/python3/python3-manifest.jsonindex f922561..09c9199 100644meta/recipes-devtools/python/python3/python3-manifest.json +0
-0@@ -1056,10 +1056,12 @@ "tkinter": { "summary": "Python Tcl/Tk bindings","rdepends": [
"core"],
"files": [
- "${libdir}/python${PYTHON_MAJMIN}/tkinter"
+ "${libdir}/python${PYTHON_MAJMIN}/tkinter",
+ "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter*.so" ],
"cached": []
},And also the update the python3 recipe,
meta/recipes-devtools/python/python3_3.5.6.bb +0
-0@@ -78,10 +78,11 @@ 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 ${@bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'pgo', '', d)} tk"
PACKAGECONFIG[readline] = ",,readline"
# Use profile guided optimisation by running PyBench inside qemu-user PACKAGECONFIG[pgo] = "--enable-optimizations"
+PACKAGECONFIG[tk] = ",,tk,tk"And then I run $ bitbake python3 -c
create_manifest, but there is no change in manifest file.Thanks,
Quoted 36 lines
Cheers,
Alejandro
Quoted 28 lines
meta/recipes-devtools/python/python3/python3-manifest.json +2
-1], "files": [ - "${libdir}/python${PYTHON_MAJMIN}/tkinter" + "${libdir}/python${PYTHON_MAJMIN}/tkinter", + "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter*.so" ], "cached": [] },There comes below error:
ERROR: Nothing RPROVIDES 'python3-tk' (but /mybuild/layers/oe-core/meta/recipes-devtools/python/python3_3.5.6.bb RDEPENDS on or otherwise requires it)
NOTE: Runtime target 'python3-tk' is unbuildable, removing... Missing or unbuildable dependency chain was: ['python3-tk']
ERROR: Required build target 'python3' has no buildable providers. Missing or unbuildable dependency chain was: ['python3', 'python3-tk']That's to say, we still need to add some fix in meta/recipes-devtools/python/python3_3.5.6.bb. If so, it may be flexible and clear to directly to make the implement just as what I send in the RR.
Thanks,
Quoted 3 lines
Ross
Re: [PATCH 2/7] python3: add tk support
Quoted 129 lines · Mingli
Quoted 107 lines · Alejandro Hernandez
Quoted 100 lines · Mingli
Hi Alejandro,
Many thanks for your comments, please check my comments inline.
Quoted 37 lines · Alejandro Hernandez
Hey Yu,
Quoted 33 lines · Mingli
Quoted 10 lines · Ross
Quoted 7 lines · Mingli
Quoted 1 line
Why is this here and not in the manifest?
It's because we can optionally enable or disable tk via PACKAGECONFIG,
if add it to manifest then we need to always enable tk which is also the
implement in v1.Quoted 3 lines
Are you sure? As I understand it there won't be any errors if the contents don't exist. And to be honest if there are, then the manifest tooling should handle that neatly without special-casing.
Hi Ross,
Thanks for your feedback!
I didn't quite understand what you mean. As I know, if we add the the setting in manifest as below:
diff --gita/meta/recipes-devtools/python/python3/python3-manifest.jsonb/meta/recipes-devtools/python/python3/python3-manifest.jsonindex f922561..09c9199 100644meta/recipes-devtools/python/python3/python3-manifest.json +0
-0@@ -1056,10 +1056,12 @@ "tkinter": { "summary": "Python Tcl/Tk bindings","rdepends": [
Quoted 8 lines
Quoted 3 lines
- "core"
+ "core",
+ "tk"This error is happening because you are trying to add python3-tk on RDEPENDS, and that package doesn't exist, when you specify "foo" on the "rdepends" section of the manifest it is translated to ${PN}-foo.
Yes, that's why I point out that we need to add extra logic in python3 recipe to make it rdepends on tk after add the logic as below:
diff --git
a/meta/recipes-devtools/python/python3/python3-manifest.jsonb/meta/recipes-devtools/python/python3/python3-manifest.jsonindex f922561..09c9199 100644meta/recipes-devtools/python/python3/python3-manifest.json +0
-0@@ -1056,10 +1056,12 @@ "tkinter": { "summary": "Python Tcl/Tk bindings","rdepends": [
- "core"
+ "core",
+ "tk"
],
"files": [
- "${libdir}/python${PYTHON_MAJMIN}/tkinter" + "${libdir}/python${PYTHON_MAJMIN}/tkinter",
+ "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter*.so" ],
"cached": []
},Quoted 7 lines
So two things:
1. The manifest can have the _tkinter.*.so on the "files section of tkinter (please note that this is _tkinter.*.so and not _tkinter*.so, the wildcard should be after a "." this is to keep a standard which the tooling can handle more easily.
Got it, thanks!
Quoted 8 lines
When the PACKAGECONFIG is enabled, the files for tkinter will be picked up correctly.
2. You should not manually add "rdepends" to the manifest, the tool itself should populate those automatically, this is better because we would avoid this kind of errors.
Quoted 5 lines
Please add the package to the manifest, populate the "files" and "summary" section and then run $ bitbake python3 -c
create_manifestto populate the rdepends section automatically, also keep in mind that you should run this when the PACKAGECONFIG is enabled for the native package as well (thats how it will pick up the dependencies).Quoted 4 lines
No new package needed to add to manifest, we only need to update the items for the existed package tkinter and per your suggestion not manually add "rdepends" to the manifest, so I only add files to manifest as below in manifest file,
Quoted 4 lines
My mistake I thought you were adding a new package.
Anyway, as a matter of fact, all you need to do is to add the same PACKAGECONFIG on the python3 native recipe and enable it, once its
Many thanks for Alejandro's hints!
I still failed to let the
files(_tkinter.*.so)automatically added to manifest though I run $ bitbake python3 -ccreate_manifestaltogether with below logic. Could you help to take a look is there anything I miss?$ git diffmeta/recipes-devtools/python/python3-native_3.5.6.bb +0
-0@@ -28,6 +28,8 @@ 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 \"
meta/recipes-devtools/python/python3-native_3.5.6.bb file://0003-bpo-32947-Fixes-for-TLS-1.3-and-OpenSSL-1.1.1-GH-876.patch \ · line 32
Quoted 2 lines
meta/recipes-devtools/python/python3-native_3.5.6.bb +2
-0+PACKAGECONFIG ??= "tkinter" +PACKAGECONFIG[tkinter] = ",,tk,tk"
Wouldn't you have to DEPEND on tk-native here?
I believe that might be the issue, you can check if the _tkinter.*.so file is generated from the native build (basically if its not generated, its impossible for the create_manifest task to pick it up).
$ find python3-native/3.5.6-r1.0/image/ | grep _tkinter.*.so
If you can confirm that it is generated but the create_manifest task isn't picking it up we can keep debugging, but first lets check if its there.
Cheers,
Alejandro
Quoted 136 lines
EXTRANATIVEPATH += "bzip2-native"
DEPENDS = "openssl-native bzip2-replacement-native zlib-native readline-native sqlite3-native gdbm-native"meta/recipes-devtools/python/python3_3.5.6.bb +0
-0@@ -78,10 +78,11 @@ export CCSHARED = "-fPIC" # Fix cross compilation of different modulesexport 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 ${@bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'pgo', '', d)} tkinter" PACKAGECONFIG[readline] = ",,readline"
# Use profile guided optimisation by running PyBench inside qemu-user PACKAGECONFIG[pgo] = "--enable-optimizations" +PACKAGECONFIG[tkinter] = ",,tk,tk"do_configure_append() {
rm -f ${S}/Makefile.origThanks,
Quoted 108 lines
enabled you can run the
create_manifesttask and it should automatically generate you a new manifest with the required files (clarifying that it doesnt have to be enabled by default but it has to be enabled on the native package when thecreate_manifesttask is run), meaning that you don't actually need to add the _tkinter.*.so file manually to the manifest, it should be picked up automatically, this is because thecreate_manifesttool assumes that the python3 and python3-native packages are exact copies of each other.Regarding the extra logic, I also agree with Ross, and I don't personally like having the extra logic there, either for that package or for handling each package that would need a PACKAGECONFIG, I think using
RDEPENDS_${PN}-tkinter += "${@bb.utils.contains('PACKAGECONFIG', 'tk', 'tk', '', d)}"
should be enough.
Alejandro
Quoted 85 lines
diff --git
a/meta/recipes-devtools/python/python3/python3-manifest.jsonb/meta/recipes-devtools/python/python3/python3-manifest.jsonindex f922561..09c9199 100644meta/recipes-devtools/python/python3/python3-manifest.json +0
-0@@ -1056,10 +1056,12 @@ "tkinter": { "summary": "Python Tcl/Tk bindings","rdepends": [
"core"
],
"files": [
- "${libdir}/python${PYTHON_MAJMIN}/tkinter"
+ "${libdir}/python${PYTHON_MAJMIN}/tkinter",
+ "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter*.so" ],
"cached": []
},And also the update the python3 recipe,
meta/recipes-devtools/python/python3_3.5.6.bb +0
-0@@ -78,10 +78,11 @@ export CCSHARED = "-fPIC" # Fix cross compilation of different modulesexport 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 ${@bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'pgo', '', d)} tk"
PACKAGECONFIG[readline] = ",,readline"
# Use profile guided optimisation by running PyBench inside qemu-user PACKAGECONFIG[pgo] = "--enable-optimizations" +PACKAGECONFIG[tk] = ",,tk,tk"And then I run $ bitbake python3 -c
create_manifest, but there is no change in manifest file.Thanks,
Quoted 36 lines
Cheers,
Alejandro
Quoted 28 lines
],
"files": [
- "${libdir}/python${PYTHON_MAJMIN}/tkinter" + "${libdir}/python${PYTHON_MAJMIN}/tkinter",
+ "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter*.so" ],
"cached": []
},There comes below error:
ERROR: Nothing RPROVIDES 'python3-tk' (but /mybuild/layers/oe-core/meta/recipes-devtools/python/python3_3.5.6.bb RDEPENDS on or otherwise requires it)
NOTE: Runtime target 'python3-tk' is unbuildable, removing... Missing or unbuildable dependency chain was: ['python3-tk']
ERROR: Required build target 'python3' has no buildable providers. Missing or unbuildable dependency chain was: ['python3', 'python3-tk']That's to say, we still need to add some fix in meta/recipes-devtools/python/python3_3.5.6.bb. If so, it may be flexible and clear to directly to make the implement just as what I send in the RR.
Thanks,
Quoted 3 lines
Ross
Re: [PATCH 2/7] python3: add tk support
Quoted 128 lines · Alejandro Hernandez
Quoted 127 lines · Mingli
Quoted 113 lines · Alejandro Hernandez
Quoted 106 lines · Mingli
Hi Alejandro,
Many thanks for your comments, please check my comments inline.
Quoted 39 lines · Alejandro Hernandez
Hey Yu,
Quoted 35 lines · Mingli
Quoted 11 lines · Ross
Quoted 8 lines · Mingli
Quoted 1 line
Why is this here and not in the manifest?
It's because we can optionally enable or disable tk via PACKAGECONFIG,
if add it to manifest then we need to always enable tk which is also
the
implement in v1.Quoted 3 lines
Are you sure? As I understand it there won't be any errors if the contents don't exist. And to be honest if there are, then the manifest tooling should handle that neatly without special-casing.
Hi Ross,
Thanks for your feedback!
I didn't quite understand what you mean. As I know, if we add the the setting in manifest as below:
diff --gita/meta/recipes-devtools/python/python3/python3-manifest.jsonb/meta/recipes-devtools/python/python3/python3-manifest.jsonindex f922561..09c9199 100644meta/recipes-devtools/python/python3/python3-manifest.json +0
-1@@ -1056,10 +1056,12 @@ "tkinter": { "summary": "Python Tcl/Tk bindings", "rdepends": [ - "core"Quoted 8 lines
meta/recipes-devtools/python/python3/python3-manifest.json line 1060
Quoted 2 lines
meta/recipes-devtools/python/python3/python3-manifest.json +2
-0+ "core", + "tk"This error is happening because you are trying to add python3-tk on RDEPENDS, and that package doesn't exist, when you specify "foo" on the
"rdepends" section of the manifest it is translated to ${PN}-foo.Yes, that's why I point out that we need to add extra logic in python3 recipe to make it rdepends on tk after add the logic as below:
diff --git
a/meta/recipes-devtools/python/python3/python3-manifest.jsonb/meta/recipes-devtools/python/python3/python3-manifest.jsonindex f922561..09c9199 100644meta/recipes-devtools/python/python3/python3-manifest.json +4
-2@@ -1056,10 +1056,12 @@ "tkinter": { "summary": "Python Tcl/Tk bindings", "rdepends": [ - "core" + "core", + "tk" ], "files": [ - "${libdir}/python${PYTHON_MAJMIN}/tkinter" + "${libdir}/python${PYTHON_MAJMIN}/tkinter", + "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter*.so" ], "cached": [] },Quoted 9 lines
So two things:
1. The manifest can have the _tkinter.*.so on the "files section of tkinter (please note that this is _tkinter.*.so and not _tkinter*.so, the wildcard should be after a "." this is to keep a standard which the
tooling can handle more easily.Got it, thanks!
Quoted 9 lines
When the PACKAGECONFIG is enabled, the files for tkinter will be picked
up correctly.2. You should not manually add "rdepends" to the manifest, the tool itself should populate those automatically, this is better because we would avoid this kind of errors.
Quoted 7 lines
Please add the package to the manifest, populate the "files" and "summary" section and then run $ bitbake python3 -c
create_manifestto populate the rdepends section automatically, also keep in mind that you
should run this when the PACKAGECONFIG is enabled for the native package
as well (thats how it will pick up the dependencies).Quoted 4 lines
No new package needed to add to manifest, we only need to update the items for the existed package tkinter and per your suggestion not manually add "rdepends" to the manifest, so I only add files to manifest as below in manifest file,
Quoted 4 lines
My mistake I thought you were adding a new package.
Anyway, as a matter of fact, all you need to do is to add the same PACKAGECONFIG on the python3 native recipe and enable it, once its
Many thanks for Alejandro's hints!
I still failed to let the
files(_tkinter.*.so)automatically added to manifest though I run $ bitbake python3 -ccreate_manifestaltogether with below logic. Could you help to take a look is there anything I miss?
Quoted 15 lines
meta/recipes-devtools/python/python3-native_3.5.6.bb line 33
Quoted 13 lines
$ git diffmeta/recipes-devtools/python/python3-native_3.5.6.bb +2
-0@@ -28,6 +28,8 @@ 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 ??= "tkinter" +PACKAGECONFIG[tkinter] = ",,tk,tk"Wouldn't you have to DEPEND on tk-native here?
Yes, it should be tk-native.
Thanks very much for your guide!
I finally succeeded to let _tkinter.*.so automatically added to manifest.
I run $ bitbake python3 -c create_manifest altogether with below logic:
$ git diff
meta/recipes-devtools/python/python3-native_3.5.6.bb +3 -1
@@ -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,8 @@ 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" +PACKAGECONFIG[tk] = ",,tk-native" EXTRANATIVEPATH += "bzip2-native" DEPENDS = "openssl-native bzip2-replacement-native zlib-native
readline-native sqlite3-native gdbm-native"
I will resend V3 for python tkinter support.
Thanks,
Quoted 160 lines
I believe that might be the issue, you can check if the _tkinter.*.so file is generated from the native build (basically if its not generated, its impossible for the
create_manifesttask to pick it up).$ find python3-native/3.5.6-r1.0/image/ | grep _tkinter.*.soIf you can confirm that it is generated but the
create_manifesttask isn't picking it up we can keep debugging, but first lets check if its there.Cheers,
Alejandro
Quoted 141 lines
meta/recipes-devtools/python/python3-native_3.5.6.bb +0
-0EXTRANATIVEPATH += "bzip2-native" DEPENDS = "openssl-native bzip2-replacement-native zlib-nativereadline-native sqlite3-native gdbm-native"
meta/recipes-devtools/python/python3_3.5.6.bb +0
-0@@ -78,10 +78,11 @@ 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 ${@bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'pgo', '', d)} tkinter"
PACKAGECONFIG[readline] = ",,readline"
# Use profile guided optimisation by running PyBench inside qemu-user PACKAGECONFIG[pgo] = "--enable-optimizations"
+PACKAGECONFIG[tkinter] = ",,tk,tk"do_configure_append() { rm -f ${S}/Makefile.origThanks,
Quoted 109 lines
enabled you can run the
create_manifesttask and it should automatically generate you a new manifest with the required files (clarifying that it doesnt have to be enabled by default but it has to be enabled on the native package when thecreate_manifesttask is run), meaning that you don't actually need to add the _tkinter.*.so file manually to the manifest, it should be picked up automatically, this is because thecreate_manifesttool assumes that the python3 and python3-native packages are exact copies of each other.Regarding the extra logic, I also agree with Ross, and I don't personally like having the extra logic there, either for that package or for handling each package that would need a PACKAGECONFIG, I think using
RDEPENDS_${PN}-tkinter += "${@bb.utils.contains('PACKAGECONFIG', 'tk', 'tk', '', d)}"
should be enough.
Alejandro
Quoted 86 lines
diff --git
a/meta/recipes-devtools/python/python3/python3-manifest.jsonb/meta/recipes-devtools/python/python3/python3-manifest.jsonindex f922561..09c9199 100644meta/recipes-devtools/python/python3/python3-manifest.json +0
-0@@ -1056,10 +1056,12 @@ "tkinter": { "summary": "Python Tcl/Tk bindings","rdepends": [
"core"],
"files": [
- "${libdir}/python${PYTHON_MAJMIN}/tkinter"
+ "${libdir}/python${PYTHON_MAJMIN}/tkinter",
+ "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter*.so" ],
"cached": []
},And also the update the python3 recipe,
meta/recipes-devtools/python/python3_3.5.6.bb +0
-0@@ -78,10 +78,11 @@ 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 ${@bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'pgo', '', d)} tk"
PACKAGECONFIG[readline] = ",,readline"
# Use profile guided optimisation by running PyBench inside qemu-user PACKAGECONFIG[pgo] = "--enable-optimizations"
+PACKAGECONFIG[tk] = ",,tk,tk"And then I run $ bitbake python3 -c
create_manifest, but there is no change in manifest file.Thanks,
Quoted 37 lines
Cheers,
Alejandro
Quoted 29 lines
meta/recipes-devtools/python/python3/python3-manifest.json +2
-1], "files": [ - "${libdir}/python${PYTHON_MAJMIN}/tkinter" + "${libdir}/python${PYTHON_MAJMIN}/tkinter", + "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter*.so" ], "cached": [] },There comes below error:
ERROR: Nothing RPROVIDES 'python3-tk' (but /mybuild/layers/oe-core/meta/recipes-devtools/python/python3_3.5.6.bb RDEPENDS on or otherwise requires it)
NOTE: Runtime target 'python3-tk' is unbuildable, removing... Missing or unbuildable dependency chain was: ['python3-tk']
ERROR: Required build target 'python3' has no buildable providers. Missing or unbuildable dependency chain was: ['python3', 'python3-tk']That's to say, we still need to add some fix in meta/recipes-devtools/python/python3_3.5.6.bb. If so, it may be flexible and clear to directly to make the implement just as what I send in the RR.
Thanks,
Quoted 3 lines
Ross
PATCH v2 1/1 python3: add tk support
In reply to [email protected]From: Mingli Yu <[email protected]>
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.
Quoted 1 line
Quoted 1 line
Quoted 1 line
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'
Quoted 1 line
Quoted 1 line
Quoted 1 line
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.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
import tkinter
--- meta/recipes-devtools/python/python3-native_3.5.6.bb | 3 ++- meta/recipes-devtools/python/python3/python3-manifest.json | 1 + meta/recipes-devtools/python/python3_3.5.6.bb | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-)
meta/recipes-devtools/python/python3-native_3.5.6.bb +2 -1
@@ -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"
meta/recipes-devtools/python/python3/python3-manifest.json +1 -0
@@ -1060,6 +1060,7 @@ "core" ], "files": [ + "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter.*.so", "${libdir}/python${PYTHON_MAJMIN}/tkinter" ], "cached": []
meta/recipes-devtools/python/python3_3.5.6.bb +3 -2
@@ -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"
Signature · 1 line
2.7.4
Re: [PATCH v2] python3: add tk support
Ping.
Thanks,
Quoted 95 lines · On 2018年11月14日 17:36, [email protected] wrote:
From: Mingli Yu <[email protected]>
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.Quoted 1 line
Quoted 1 line
Quoted 1 line
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 TkImportError: No module named '
_tkinter'Quoted 1 line
Quoted 1 line
Quoted 1 line
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.Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
import tkinter
Signed-off-by Mingli Yu <[email protected]>--- meta/recipes-devtools/python/python3-native_3.5.6.bb | 3 ++- meta/recipes-devtools/python/python3/python3-manifest.json | 1 + meta/recipes-devtools/python/python3_3.5.6.bb | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-)meta/recipes-devtools/python/python3-native_3.5.6.bb +2
-1@@ -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"meta/recipes-devtools/python/python3/python3-manifest.json +1
-0@@ -1060,6 +1060,7 @@ "core" ], "files": [ + "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter.*.so", "${libdir}/python${PYTHON_MAJMIN}/tkinter" ], "cached": []meta/recipes-devtools/python/python3_3.5.6.bb +3
-2@@ -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"
Re: [PATCH v2] python3: add tk support
In reply to [email protected]Ping.
Thanks,
Quoted 95 lines · On 2018年11月14日 17:36, [email protected] wrote:
From: Mingli Yu <[email protected]>
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.Quoted 1 line
Quoted 1 line
Quoted 1 line
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 TkImportError: No module named '
_tkinter'Quoted 1 line
Quoted 1 line
Quoted 1 line
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.Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
import tkinter
Signed-off-by Mingli Yu <[email protected]>--- meta/recipes-devtools/python/python3-native_3.5.6.bb | 3 ++- meta/recipes-devtools/python/python3/python3-manifest.json | 1 + meta/recipes-devtools/python/python3_3.5.6.bb | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-)meta/recipes-devtools/python/python3-native_3.5.6.bb +2
-1@@ -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"meta/recipes-devtools/python/python3/python3-manifest.json +1
-0@@ -1060,6 +1060,7 @@ "core" ], "files": [ + "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter.*.so", "${libdir}/python${PYTHON_MAJMIN}/tkinter" ], "cached": []meta/recipes-devtools/python/python3_3.5.6.bb +3
-2@@ -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"
Re: [PATCH v2] python3: add tk support
Quoted 3 lines · Mingli
Ping.
Thanks,
Why are you sending ping requests for both v2 and v3 of the same patch?
Cheers,
Richard
Re: [PATCH v2] python3: add tk support
Quoted 7 lines · On Fri, 2018-11-23 at 11:03 +0000, [email protected] wrote:
Quoted 3 lines · Mingli
Ping.
Thanks,
Why are you sending ping requests for both v2 and v3 of the same patch?
Sorry, I understand now, there is a patch for python2 and a patch for python3 which are at differing versions. Too many similar but different numbers!
Cheers,
Richard
PATCH v2 3/7 libxt: extend to nativesdk
In reply to [email protected]From: Mingli Yu <[email protected]>
After enable tk via PACKAGECONFIG for python3,
there comes below error:
Missing or unbuildable dependency chain was: ['buildtools-tarball', 'nativesdk-python3-pytz', 'nativesdk-python3', 'nativesdk-tk', 'nativesdk-libxt']
Extend libxt to nativesdk to fix this issue.
--- meta/recipes-graphics/xorg-lib/libxt_1.1.5.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-graphics/xorg-lib/libxt_1.1.5.bb +1 -1
@@ -27,7 +27,7 @@ SRC_URI += "file://libxt_fix_for_x32.patch \ file://0001-libXt-util-don-t-link-makestrs-with-target-cflags.patch \ " -BBCLASSEXTEND = "native" +BBCLASSEXTEND = "native nativesdk" EXTRA_OECONF += "--disable-xkb"
Signature · 1 line
2.7.4
PATCH v2 4/7 libxft: extend to nativesdk
In reply to [email protected]From: Mingli Yu <[email protected]>
After enable tk via PACKAGECONFIG for python3,
there comes below error:
Missing or unbuildable dependency chain was: ['buildtools-tarball', 'nativesdk-python3-testtools', 'nativesdk-python3-pbr', 'nativesdk-python3', 'nativesdk-tk', 'nativesdk-xft']
Extend libxft to nativesdk to fix this issue as
PROVIDES = "xft" in libxft recipe.
--- meta/recipes-graphics/xorg-lib/libxft_2.3.2.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-graphics/xorg-lib/libxft_2.3.2.bb +1 -1
@@ -25,7 +25,7 @@ SRC_URI[sha256sum] = "f5a3c824761df351ca91827ac221090943ef28b248573486050de89f4b XORG_PN = "libXft" -BBCLASSEXTEND = "native" +BBCLASSEXTEND = "native nativesdk" python () { if d.getVar('DEBIAN_NAMES'):
Signature · 1 line
2.7.4
PATCH v2 5/7 fontconfig: extend to nativesdk
In reply to [email protected]From: Mingli Yu <[email protected]>
After enable tk via PACKAGECONFIG for python3,
there comes below error:
Missing or unbuildable dependency chain was: ['nativesdk-packagegroup-sdk-host', 'nativesdk-opkg', 'nativesdk-libsolv', 'nativesdk-rpm', 'nativesdk-python3', 'nativesdk-tk', 'nativesdk-xft', 'nativesdk-fontconfig']
Extend fontconfig to nativesdk to fix this issue.
--- meta/recipes-graphics/fontconfig/fontconfig_2.12.6.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-graphics/fontconfig/fontconfig_2.12.6.bb +1 -1
@@ -61,4 +61,4 @@ FONTCONFIG_FONT_DIRS ?= "no" EXTRA_OECONF = " --disable-docs --with-default-fonts=${datadir}/fonts --with-cache-dir=${FONTCONFIG_CACHE_DIR} --with-add-fonts=${FONTCONFIG_FONT_DIRS}" -BBCLASSEXTEND = "native" +BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.7.4
PATCH v2 6/7 libsm: extend to nativesdk
In reply to [email protected]From: Mingli Yu <[email protected]>
After enable tk via PACKAGECONFIG for python3,
there comes below error:
Missing or unbuildable dependency chain was: ['buildtools-tarball', 'nativesdk-python3-testtools', 'nativesdk-python3-pbr', 'nativesdk-python3', 'nativesdk-tk', 'nativesdk-libxt', 'nativesdk-libsm']
Extend libsm to nativesdk to fix this issue.
--- meta/recipes-graphics/xorg-lib/libsm_1.2.2.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-graphics/xorg-lib/libsm_1.2.2.bb +1 -1
@@ -22,7 +22,7 @@ PE = "1" XORG_PN = "libSM" -BBCLASSEXTEND = "native" +BBCLASSEXTEND = "native nativesdk" SRC_URI[md5sum] = "499a7773c65aba513609fe651853c5f3" SRC_URI[sha256sum] = "0baca8c9f5d934450a70896c4ad38d06475521255ca63b717a6510fdb6e287bd"
Signature · 1 line
2.7.4
PATCH v2 7/7 libice: extend to nativesdk
In reply to [email protected]From: Mingli Yu <[email protected]>
After enable tk via PACKAGECONFIG for python3,
there comes below error:
Missing or unbuildable dependency chain was: ['buildtools-tarball', 'nativesdk-python3-git', 'nativesdk-python3-gitdb', 'nativesdk-python3-async', 'nativesdk-python3', 'nativesdk-tk', 'nativesdk-libxt', 'nativesdk-libsm', 'nativesdk-libice']
Extend libice to nativesdk to fix this issue.
--- meta/recipes-graphics/xorg-lib/libice_1.0.9.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-graphics/xorg-lib/libice_1.0.9.bb +1 -1
@@ -18,7 +18,7 @@ PE = "1" XORG_PN = "libICE" -BBCLASSEXTEND = "native" +BBCLASSEXTEND = "native nativesdk" SRC_URI[md5sum] = "addfb1e897ca8079531669c7c7711726" SRC_URI[sha256sum] = "8f7032f2c1c64352b5423f6b48a8ebdc339cc63064af34d66a6c9aa79759e202"
Signature · 1 line
2.7.4
v2 cover python/python3: add tk support
In reply to [email protected]Changed in v2:
1, add support for tk via PACKAGECONFIG, and tk is disabled by default.
2, add tk support also for python3.