From patchwork Sun Feb 2 12:11:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas De Schampheleire X-Patchwork-Id: 315997 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 399FA2C009B for ; Sun, 2 Feb 2014 23:11:47 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 9CE3893A4A; Sun, 2 Feb 2014 12:11:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sWZIjURYrlzt; Sun, 2 Feb 2014 12:11:43 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id D9E2593A4B; Sun, 2 Feb 2014 12:11:42 +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 986F61C20E9 for ; Sun, 2 Feb 2014 12:11:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 9189D8B158 for ; Sun, 2 Feb 2014 12:11:39 +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 Mu3NdZQE6HkB for ; Sun, 2 Feb 2014 12:11:39 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wg0-f49.google.com (mail-wg0-f49.google.com [74.125.82.49]) by whitealder.osuosl.org (Postfix) with ESMTPS id C6F4B83A32 for ; Sun, 2 Feb 2014 12:11:38 +0000 (UTC) Received: by mail-wg0-f49.google.com with SMTP id a1so10636723wgh.28 for ; Sun, 02 Feb 2014 04:11:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:content-transfer-encoding:subject :message-id:in-reply-to:references:user-agent:date:from:to; bh=/KIvTPn2MumeAC4I2XS/USmzHSOCbfqDSKw3fIcW+Us=; b=H+4Faa+weMYlccF/00jOBlg3Mqoz9XxpPwI01M0QlJTNW+4kgYcX/FHqurTj63b/oz 3YW0y9QJUk2CMx+WJ98RQprSaG6TV1Yod58l3PnZo5B2CKRW8Z/x3rtq4vlmPzbkHHd6 n0/FPd8k9iWNguk+pl35YqA7rdQqa/B2xJWfOoVGsX8g4Cc1iBSUVuNAkk/MqvQ4ezJx Ian+l5K+9VFhARf8OZ0dbmrsnxoO+tZ3i8gmXvVAr4HcPZJxyVP8p/k1gznqRFPakXRr Tv448yBVJWYqSCeoVCvoCvEcWeAbzXI+jdMG9BnbDiH+KKP3tExlIM5fjcZZldP/1CyQ q5CA== X-Received: by 10.180.149.206 with SMTP id uc14mr5386351wib.10.1391343097277; Sun, 02 Feb 2014 04:11:37 -0800 (PST) Received: from [127.0.1.1] (d54C62EEB.access.telenet.be. [84.198.46.235]) by mx.google.com with ESMTPSA id ea4sm15523490wib.7.2014.02.02.04.11.35 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 02 Feb 2014 04:11:36 -0800 (PST) MIME-Version: 1.0 X-Mercurial-Node: 6e353a0a1ef0fcc27294253734805a2c2bfb0b84 Message-Id: <6e353a0a1ef0fcc27294.1391343078@argentina> In-Reply-To: References: User-Agent: Mercurial-patchbomb/2.2.2 Date: Sun, 02 Feb 2014 13:11:18 +0100 From: Thomas De Schampheleire To: buildroot@busybox.net Subject: [Buildroot] [PATCH 3 of 9] manual: explain how to express Python dependencies 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: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net As discussed on the mailing list [1] [2], there are basically three cases in which a package may need to depend on the Python interpreter. This patch clarifies what to add in Config.in in these three cases. Signed-off-by: Thomas De Schampheleire [1] http://lists.busybox.net/pipermail/buildroot/2013-December/085324.html [2] http://lists.busybox.net/pipermail/buildroot/2014-January/086396.html --- docs/manual/adding-packages-dependencies.txt | 43 ++++++++++++++++++++++++ 1 files changed, 43 insertions(+), 0 deletions(-) diff --git a/docs/manual/adding-packages-dependencies.txt b/docs/manual/adding-packages-dependencies.txt --- a/docs/manual/adding-packages-dependencies.txt +++ b/docs/manual/adding-packages-dependencies.txt @@ -236,3 +236,46 @@ management, use this format: -------------------------- foo needs udev /dev management and a toolchain w/ featA, featB, featC -------------------------- + +Dependencies on the Python interpreter +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +How to depend on the Python interpreter depends on the type of package. + +If the package is _a Python module_, it should use +depends on +BR2_PACKAGE_PYTHON+. There shouldn't be any comment making this +dependency explicit to the user, as it should be obvious that Python +modules require Python to be enabled. + +If the package is _a regular (non-Python) package that requires Python_ +to function properly, it should use +select BR2_PACKAGE_PYTHON+. The +reasoning here is that it is not user-friendly to require the user to +enable Python prior to being able to enable this package, since the +Python dependency is not obvious. As in the previous case, there +shouldn't be any comment mentioning this Python dependency. However, +the regular rules for propagating package dependencies when selecting +a package still apply: you'll need to add +depends on+ statements for +Python's dependencies, and you'll need to add an appropriate comment, +as explained in xref:dependencies-target-toolchain-options[]. + +If the package is _a regular (non-Python) package that has an optional +Python dependency_ (for example because it provides optional Python +bindings), this should be handled transparently in the +.mk+ file of +the package. If Python is enabled, the optional support should be +enabled as well. If Python is disabled, then so should the optional +support. In this case, there is nothing added in the +Config.in+ +file. A typical construct in the +.mk+ file is: +-------------------------- + ifeq ($(BR2_PACKAGE_PYTHON),y) + LIBFOO_CONF_OPT += --with-python-support + LIBFOO_DEPENDENCIES += python + else + LIBFOO_CONF_OPT += --without-python-support + endif +-------------------------- + +Exceptions to this last rule can be made if the optional support has a +large impact that is not acceptable for all users, unless explicitly +requested. In this case, add an explicit config option to the ++Config.in+ file to enable the optional Python support. This option +should use +depends on BR2_PACKAGE_PYTHON+. Again, there shouldn't be +any comment mentioning this dependency.