public inbox for gentoo-python@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-python@lists.gentoo.org
Cc: python@gentoo.org, "Michał Górny" <mgorny@gentoo.org>
Subject: [gentoo-python] [PATCH] Introduce DISTUTILS_COMMON_ARGS, for global scope.
Date: Sun,  3 Feb 2013 01:18:47 +0100	[thread overview]
Message-ID: <1359850727-23680-1-git-send-email-mgorny@gentoo.org> (raw)

Just an idea to have a properly uppercase variable for options which
shall be set for all phases, rather than transitive mydistutilsargs.

Use cases: numpy, wxpython, most of the ebuilds using
DISTUTILS_GLOBAL_OPTIONS.
---
 gx86/eclass/distutils-r1.eclass | 30 +++++++++++++++++++++++-------
 1 file changed, 23 insertions(+), 7 deletions(-)

diff --git a/gx86/eclass/distutils-r1.eclass b/gx86/eclass/distutils-r1.eclass
index 27730f5..32e3670 100644
--- a/gx86/eclass/distutils-r1.eclass
+++ b/gx86/eclass/distutils-r1.eclass
@@ -184,15 +184,29 @@ fi
 # This variable can be used to disable the afore-mentioned feature
 # in case it causes issues with the package.
 
-# @ECLASS-VARIABLE: mydistutilsargs
+# @ECLASS-VARIABLE: DISTUTILS_COMMON_ARGS
 # @DEFAULT_UNSET
 # @DESCRIPTION:
-# An array containing options to be passed to setup.py.
+# An array containing options to be passed to setup.py. For use
+# in global scope.
 #
 # Example:
 # @CODE
 # python_configure_all() {
-# 	mydistutilsargs=( --enable-my-hidden-option )
+# 	DISTUTILS_COMMON_ARGS=( --enable-my-hidden-option )
+# }
+# @CODE
+
+# @ECLASS-VARIABLE: mydistutilsargs
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# An array containing options to be passed to setup.py. For use
+# in local scope.
+#
+# Example:
+# @CODE
+# python_compile() {
+# 	local mydistutilsargs=( build_bar )
 # }
 # @CODE
 
@@ -201,9 +215,10 @@ fi
 # @DESCRIPTION:
 # Run the setup.py using currently selected Python interpreter
 # (if ${PYTHON} is set; fallback 'python' otherwise). The setup.py will
-# be passed default ${mydistutilsargs[@]}, then any parameters passed
-# to this command and optionally a standard option set (e.g. the build
-# directory in an ebuild using out-of-source builds).
+# be passed ${DISTUTILS_COMMON_ARGS[@]}, then ${mydistutilsargs[@]},
+# the parameters passed to this command and optionally a standard option
+# set (e.g. the build directory in an ebuild using out-of-source
+# builds).
 #
 # This command dies on failure.
 esetup.py() {
@@ -226,7 +241,8 @@ esetup.py() {
 	fi
 
 	set -- "${PYTHON:-python}" setup.py \
-		"${mydistutilsargs[@]}" "${@}" "${add_args[@]}"
+		"${DISTUTILS_COMMON_ARGS[@]}" "${mydistutilsargs[@]}" \
+		"${@}" "${add_args[@]}"
 
 	echo "${@}" >&2
 	"${@}" || die
-- 
1.8.1.2



                 reply	other threads:[~2013-02-03  0:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1359850727-23680-1-git-send-email-mgorny@gentoo.org \
    --to=mgorny@gentoo.org \
    --cc=gentoo-python@lists.gentoo.org \
    --cc=python@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox