From patchwork Sat Feb 22 18:54:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Kuhls X-Patchwork-Id: 1242549 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=t-online.de Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48PyFK6fS8z9sPK for ; Sun, 23 Feb 2020 05:55:17 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 64BFB84DFE; Sat, 22 Feb 2020 18:55:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kzkNu3LxL+6K; Sat, 22 Feb 2020 18:55:11 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 7B85F836A5; Sat, 22 Feb 2020 18:55:11 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 86FEE1BF377 for ; Sat, 22 Feb 2020 18:55:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 835E92040C for ; Sat, 22 Feb 2020 18:55:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SSJCmFVGdS7D for ; Sat, 22 Feb 2020 18:55:08 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mailout06.t-online.de (mailout06.t-online.de [194.25.134.19]) by silver.osuosl.org (Postfix) with ESMTPS id 1787320432 for ; Sat, 22 Feb 2020 18:55:07 +0000 (UTC) Received: from fwd38.aul.t-online.de (fwd38.aul.t-online.de [172.20.26.138]) by mailout06.t-online.de (Postfix) with SMTP id 84C1F40C468C; Sat, 22 Feb 2020 19:55:05 +0100 (CET) Received: from fli4l.lan.fli4l (r44zpEZV8hQsvcCvrSorCyVpI13Fueh68K+RrK4fNVKyd5kwZGDlAOSf0Z8ZIbzQhx@[91.58.6.230]) by fwd38.t-online.de with (TLSv1:ECDHE-RSA-AES256-SHA encrypted) esmtp id 1j5ZvZ-2BVoJc0; Sat, 22 Feb 2020 19:55:01 +0100 Received: from mahler.lan.fli4l ([192.168.1.1]:50844) by fli4l.lan.fli4l with esmtp (Exim 4.92.3) (envelope-from ) id 1j5ZvY-0007ka-Bn; Sat, 22 Feb 2020 19:55:00 +0100 From: Bernd Kuhls To: buildroot@buildroot.org Date: Sat, 22 Feb 2020 19:54:59 +0100 Message-Id: <20200222185500.221018-1-bernd.kuhls@t-online.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-ID: r44zpEZV8hQsvcCvrSorCyVpI13Fueh68K+RrK4fNVKyd5kwZGDlAOSf0Z8ZIbzQhx X-TOI-MSGID: e95a3189-1a58-46ea-b111-e394340fe710 Subject: [Buildroot] [PATCH 1/2] package/python: add optional support for lib2to3 X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , Asaf Kahlon , Maxime Hadjinlian Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Kodi is in transition to support python3 instead of python2: https://kodi.wiki/view/General_information_about_migration_to_Python_3 "For Kodi 18 (Leia), only addons that are compatible with both Python 2 and 3 will be accepted to the official addon repository." Some of these addons depend on the Kodi addon script.module.future to provide support for both python versions. The script.module.future addon contains python-future: https://kodi.wiki/view/General_information_about_migration_to_Python_3#Future which in turn needs lib2to3 to be included in the target build of python2: http://python-future.org/automatic_conversion.html Kodi addons depending on the script.module.future addon are crashing on buildroot due to lib2to3 missing in the build. LibreELEC added lib2to3 to python2 to fix the problem: https://forum.libreelec.tv/thread/21239-lib2to3-pgen2-parse-missing/ https://github.com/LibreELEC/LibreELEC.tv/pull/4147 This patch provides the Config.in option to be used by Kodi. Signed-off-by: Bernd Kuhls --- package/python/Config.in | 5 +++++ package/python/python.mk | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/package/python/Config.in b/package/python/Config.in index a7f16450e3..bded00c9e8 100644 --- a/package/python/Config.in +++ b/package/python/Config.in @@ -39,6 +39,11 @@ menu "core python modules" comment "The following modules are unusual or require extra libraries" +config BR2_PACKAGE_PYTHON_2TO3 + bool "2to3 module" + help + code translation from python 2 to 3 + config BR2_PACKAGE_PYTHON_BZIP2 bool "bzip2 module" select BR2_PACKAGE_BZIP2 diff --git a/package/python/python.mk b/package/python/python.mk index 1c393b255d..f9d5619612 100644 --- a/package/python/python.mk +++ b/package/python/python.mk @@ -118,6 +118,12 @@ HOST_PYTHON_CONF_OPTS += --enable-unicode=ucs4 PYTHON_CONF_OPTS += --enable-unicode=ucs4 endif +ifeq ($(BR2_PACKAGE_PYTHON_2TO3),y) +PYTHON_CONF_OPTS += --enable-lib2to3 +else +PYTHON_CONF_OPTS += --disable-lib2to3 +endif + ifeq ($(BR2_PACKAGE_PYTHON_BZIP2),y) PYTHON_DEPENDENCIES += bzip2 else @@ -165,7 +171,6 @@ PYTHON_CONF_OPTS += \ --with-system-ffi \ --disable-pydoc \ --disable-test-modules \ - --disable-lib2to3 \ --disable-gdbm \ --disable-tk \ --disable-nis \