From patchwork Thu Feb 13 20:49:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 320179 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 436BC2C0082 for ; Fri, 14 Feb 2014 08:05:54 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id EFC1A8C24C; Thu, 13 Feb 2014 21:05:52 +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 3uZ8qj4EKNnI; Thu, 13 Feb 2014 21:05:48 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id A95D08C8A0; Thu, 13 Feb 2014 21:05:39 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 4219A1CE951 for ; Thu, 13 Feb 2014 21:05:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 381748C863 for ; Thu, 13 Feb 2014 21:05:29 +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 aOpF+c3x0N6S for ; Thu, 13 Feb 2014 21:05:28 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (top.free-electrons.com [176.31.233.9]) by whitealder.osuosl.org (Postfix) with ESMTP id 199548C85E for ; Thu, 13 Feb 2014 21:05:28 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 106) id 5ECAC87B; Thu, 13 Feb 2014 22:05:36 +0100 (CET) Received: from localhost (AToulouse-651-1-98-40.w109-222.abo.wanadoo.fr [109.222.65.40]) by mail.free-electrons.com (Postfix) with ESMTPSA id 259F2819 for ; Thu, 13 Feb 2014 22:05:36 +0100 (CET) From: Thomas Petazzoni To: buildroot@uclibc.org Date: Thu, 13 Feb 2014 21:49:05 +0100 Message-Id: <1392324555-29246-17-git-send-email-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1392324555-29246-1-git-send-email-thomas.petazzoni@free-electrons.com> References: <1392324555-29246-1-git-send-email-thomas.petazzoni@free-electrons.com> Subject: [Buildroot] [PATCHv1 16/26] package: add python3 support in the package infrastructure X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net This commit improves the Python package infrastructure to allow Python packages to be built with Python 3. The changes are fairly simple: * Use either PYTHON_PATH or PYTHON3_PATH as the PYTHONPATH depending on which Python is used. * Depend on host-python or host-python3 and python or python3 depending on which Python is used. Signed-off-by: Thomas Petazzoni --- package/pkg-python.mk | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package/pkg-python.mk b/package/pkg-python.mk index c4bbb37..a265862 100644 --- a/package/pkg-python.mk +++ b/package/pkg-python.mk @@ -27,7 +27,7 @@ PKG_PYTHON_DISTUTILS_ENV = \ CFLAGS="$(TARGET_CFLAGS)" \ LDFLAGS="$(TARGET_LDFLAGS)" \ LDSHARED="$(TARGET_CROSS)gcc -shared" \ - PYTHONPATH="$(PYTHON_PATH)" \ + PYTHONPATH="$(if $(BR2_PACKAGE_PYTHON3),$(PYTHON3_PATH),$(PYTHON_PATH))" \ _python_sysroot=$(STAGING_DIR) \ _python_prefix=/usr \ _python_exec_prefix=/usr @@ -48,7 +48,7 @@ HOST_PKG_PYTHON_DISTUTILS_INSTALL_OPT = \ # Target setuptools-based packages PKG_PYTHON_SETUPTOOLS_ENV = \ PATH="$(TARGET_PATH)" \ - PYTHONPATH="$(PYTHON_PATH)" \ + PYTHONPATH="$(if $(BR2_PACKAGE_PYTHON3),$(PYTHON3_PATH),$(PYTHON_PATH))" \ _python_sysroot=$(STAGING_DIR) \ _python_prefix=/usr \ _python_exec_prefix=/usr @@ -138,16 +138,16 @@ endif # depending on the package characteristics, and shouldn't be derived # automatically from the dependencies of the corresponding target # package. -$(2)_DEPENDENCIES ?= $(filter-out host-python host-python-setuptools $(1),$(patsubst host-host-%,host-%,$(addprefix host-,$($(3)_DEPENDENCIES)))) +$(2)_DEPENDENCIES ?= $(filter-out host-python host-python3 host-python-setuptools $(1),$(patsubst host-host-%,host-%,$(addprefix host-,$($(3)_DEPENDENCIES)))) # Target packages need both the python interpreter on the target (for # runtime) and the python interpreter on the host (for # compilation). However, host packages only need the python # interpreter on the host. ifeq ($(4),target) -$(2)_DEPENDENCIES += host-python python +$(2)_DEPENDENCIES += $(if $(BR2_PACKAGE_PYTHON3),host-python3 python3,host-python python) else -$(2)_DEPENDENCIES += host-python +$(2)_DEPENDENCIES += $(if $(BR2_PACKAGE_PYTHON3),host-python3,host-python) endif # Setuptools based packages will need host-python-setuptools (both