From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail5.wrs.com (mail5.windriver.com [192.103.53.11]) by mail.openembedded.org (Postfix) with ESMTP id 817806C0E0 for ; Mon, 19 Nov 2018 01:35:21 +0000 (UTC) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail5.wrs.com (8.15.2/8.15.2) with ESMTPS id wAJ1Y1FX013269 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Sun, 18 Nov 2018 17:34:12 -0800 Received: from [128.224.163.157] (128.224.163.157) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 18 Nov 2018 17:33:51 -0800 To: , , , , , References: <1541657297-30997-3-git-send-email-mingli.yu@windriver.com> <1542188171-116604-1-git-send-email-mingli.yu@windriver.com> From: "Yu, Mingli" Message-ID: <5BF2129D.4090004@windriver.com> Date: Mon, 19 Nov 2018 09:32:13 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <1542188171-116604-1-git-send-email-mingli.yu@windriver.com> X-Originating-IP: [128.224.163.157] Subject: Re: [PATCH v2] python3: add tk support X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 01:35:21 -0000 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit Ping. Thanks, On 2018年11月14日 17:36, mingli.yu@windriver.com wrote: > From: Mingli Yu > > 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 "", line 1, in > File "/usr/lib64/python3.5/tkinter/__init__.py", line 35, in > 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 > --- > 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(-) > > diff --git a/meta/recipes-devtools/python/python3-native_3.5.6.bb b/meta/recipes-devtools/python/python3-native_3.5.6.bb > index d5953cf..1e98c03 100644 > --- a/meta/recipes-devtools/python/python3-native_3.5.6.bb > +++ b/meta/recipes-devtools/python/python3-native_3.5.6.bb > @@ -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" > diff --git a/meta/recipes-devtools/python/python3/python3-manifest.json b/meta/recipes-devtools/python/python3/python3-manifest.json > index 5329bf7..617256a 100644 > --- a/meta/recipes-devtools/python/python3/python3-manifest.json > +++ b/meta/recipes-devtools/python/python3/python3-manifest.json > @@ -1060,6 +1060,7 @@ > "core" > ], > "files": [ > + "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter.*.so", > "${libdir}/python${PYTHON_MAJMIN}/tkinter" > ], > "cached": [] > diff --git a/meta/recipes-devtools/python/python3_3.5.6.bb b/meta/recipes-devtools/python/python3_3.5.6.bb > index 31f8ead..5c80421 100644 > --- a/meta/recipes-devtools/python/python3_3.5.6.bb > +++ b/meta/recipes-devtools/python/python3_3.5.6.bb > @@ -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" >