From patchwork Sun Dec 30 22:54:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Martin X-Patchwork-Id: 208806 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 9F5942C00AE for ; Mon, 31 Dec 2012 09:55:33 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id D1498101561; Sun, 30 Dec 2012 22:55:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WS8jJbIcErJr; Sun, 30 Dec 2012 22:55:16 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 21AB1101904; Sun, 30 Dec 2012 22:54:49 +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 D88BC8F74B for ; Sun, 30 Dec 2012 22:54:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id EB0B181697 for ; Sun, 30 Dec 2012 22:54:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rkqNQhLq5T2W for ; Sun, 30 Dec 2012 22:54:42 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-we0-f181.google.com (mail-we0-f181.google.com [74.125.82.181]) by whitealder.osuosl.org (Postfix) with ESMTPS id 8A05481695 for ; Sun, 30 Dec 2012 22:54:42 +0000 (UTC) Received: by mail-we0-f181.google.com with SMTP id t11so5660967wey.12 for ; Sun, 30 Dec 2012 14:54:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:in-reply-to:references; bh=h39bAGshMum1liESnplzUgHkmQMcXNdiFHSI7jMfGok=; b=uFZqcGhgtKZ3WOrS44IFLlGUxLSpxX12Y9jV+ElTXjMHyy19IwRYN9pnVU3AMWPwPS UClJbdPlgsG4Avf6zPLCX7UF5jgscf7LOkg0OyyOALlFDXFFzkYaYzBeIgVEFnrB5jXK up/VJnfgwrbp6B1JMox+xCsxhz3/YnRtVb1qmGIlxNWGSfInoI2QF91X9Jvjf5t+Yq4p q+sNIFR+eGcRVPS5duRPftxdfW7Yt9jo49aTmFDBC3ddGOh/ZJgatwPHchTSxErtbBFo sXyD8FbOK/E0Ukk6wZLqrR99gC8J6XNwC9qowRbjyrkK3HFGb76Us9jFgfdt4caHCQpI hhTw== X-Received: by 10.194.118.229 with SMTP id kp5mr62464783wjb.2.1356908080949; Sun, 30 Dec 2012 14:54:40 -0800 (PST) Received: from localhost.localdomain (ANantes-557-1-155-237.w2-1.abo.wanadoo.fr. [2.1.170.237]) by mx.google.com with ESMTPS id g2sm66911211wiy.0.2012.12.30.14.54.36 (version=SSLv3 cipher=OTHER); Sun, 30 Dec 2012 14:54:36 -0800 (PST) From: Samuel Martin To: buildroot@busybox.net Date: Sun, 30 Dec 2012 23:54:15 +0100 Message-Id: <8de478e5aa4b0f15008159ea3ad238605e5ffe0e.1356907750.git.s.martin49@gmail.com> X-Mailer: git-send-email 1.8.0.3 In-Reply-To: References: In-Reply-To: References: Subject: [Buildroot] [PATCH 8/8] manual: add host python2 dependency section 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 Signed-off-by: Samuel Martin --- docs/manual/adding-packages-tips.txt | 38 ++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/docs/manual/adding-packages-tips.txt b/docs/manual/adding-packages-tips.txt index acdee40..4a971cb 100644 --- a/docs/manual/adding-packages-tips.txt +++ b/docs/manual/adding-packages-tips.txt @@ -62,3 +62,41 @@ FOO_SITE = http://github.com///tarball/ Note that the name of the tarball is the default +foo-1234567.tar.gz+ so it is not necessary to specify it in the +.mk+ file. + +[[python2-and-package-build-env]] +Host python2 dependency and package environment +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Some packages provide some python scripts as part of their +build/install system. + +Unfortunately, those python scripts are not always python3-friendly. +So, a python2 interpreter on the host system is a prerequisite for +those packages. Besides, their build system may call them invoking ++python ...+ which have bad consequences if the +python+ +command does not exist or if it call a python3 interperter instead of +a python2 one. + +Buildroot provides a way to handle this case, without requiring to +patch anything in the package sources. + +* add +host-python2-if-needed+ to the +*_DEPENDENCIES+ list; +* make sure the +PATH+ environment variable contains + +$(HOST_DIR)/usr/bin+. + +.Notes +- This is automatic if the package relies on the _autotools_ or + _cmake_ infrastructure and does not need to override some of the + configure, build or install commands. +- Otherwise (i.e. the package uses the _generic_ infrastructure or + overrides some of the configure, build or install commands), you + should ensure +PATH=$(HOST_PATH)+ or +PATH=$(TARGET_PATH)+ to + overridden commands. +- The +PATH+ environment variable is correctly set in the variables + +TARGET_CONFIGURE_OPTS+ or +TARGET_MAKE_ENV+ as well as in their + +HOST+ variants. +- For package relying on http://www.scons.org[Scons] build system, + it should depend on +host-scons+ and use the +$(SCONS)+ variable. + This will automatically take care of the host python2 dependency + since http://www.scons.org[Scons] does not support python3 yet + (see http://www.scons.org/doc/production/HTML/scons-user/c95.html#AEN102).