From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id A9323138593 for ; Sun, 20 Jan 2013 10:17:47 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3322221C0FA; Sun, 20 Jan 2013 10:17:47 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 6E87721C0FA for ; Sun, 20 Jan 2013 10:17:46 +0000 (UTC) Received: from pomiocik.lan (213-238-105-25.adsl.inetia.pl [213.238.105.25]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id D7C7A33D884; Sun, 20 Jan 2013 10:17:43 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-python@lists.gentoo.org Cc: python@gentoo.org, maksbotan@gentoo.org, sterkrig@myopera.com, =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-python] [PATCH 1/3] Support making distutils-r1 deps and phases optional. Date: Sun, 20 Jan 2013 11:18:12 +0100 Message-Id: <1358677094-20652-1-git-send-email-mgorny@gentoo.org> X-Mailer: git-send-email 1.8.1.1 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Discussions centering around the Python ecosystem in Gentoo Linux X-BeenThere: gentoo-python@gentoo.org X-BeenThere: gentoo-python@lists.gentoo.org X-Archives-Salt: b9b6affa-9c09-433f-8525-3faa7008d2e8 X-Archives-Hash: 67e1f696ce09cd09227b5ac30eb215b9 If a particular package uses distutils part only conditionally (e.g. with USE=python), you can do something like: DISTUTILS_OPTIONAL=1 RDEPEND="python? ( ${PYTHON_DEPS} )" src_compile() { cd python; use python && distutils-r1_src_compile; } src_test() { cd python; use python && distutils-r1_src_test; } src_install() { cd python; use python && distutils-r1_src_install; } --- gx86/eclass/distutils-r1.eclass | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/gx86/eclass/distutils-r1.eclass b/gx86/eclass/distutils-r1.eclass index 6a062ae..80734c5 100644 --- a/gx86/eclass/distutils-r1.eclass +++ b/gx86/eclass/distutils-r1.eclass @@ -54,18 +54,34 @@ case "${EAPI:-0}" in ;; esac +# @ECLASS-VARIABLE: DISTUTILS_OPTIONAL +# @DEFAULT_UNSET +# @DESCRIPTION: +# If set to a non-null value, distutils part in the ebuild will +# be considered optional. No dependencies will be added and no phase +# functions will be exported. +# +# If you enable DISTUTILS_OPTIONAL, you have to set proper dependencies +# for your package (using ${PYTHON_DEPS}) and to either call +# distutils-r1 default phase functions or call the build system +# manually. + if [[ ! ${_DISTUTILS_R1} ]]; then inherit eutils multiprocessing python-r1 fi -EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install +if [[ ! ${DISTUTILS_OPTIONAL} ]]; then + EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install +fi if [[ ! ${_DISTUTILS_R1} ]]; then -RDEPEND=${PYTHON_DEPS} -DEPEND=${PYTHON_DEPS} +if [[ ! ${DISTUTILS_OPTIONAL} ]]; then + RDEPEND=${PYTHON_DEPS} + DEPEND=${PYTHON_DEPS} +fi # @ECLASS-VARIABLE: DISTUTILS_JOBS # @DEFAULT_UNSET -- 1.8.1.1