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 B87DB138227 for ; Tue, 1 Jan 2013 16:57:47 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AA928E056C; Tue, 1 Jan 2013 16:57:41 +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 BBA33E056C for ; Tue, 1 Jan 2013 16:57:40 +0000 (UTC) Received: from pomiocik.lan (213-238-105-58.adsl.inetia.pl [213.238.105.58]) (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 B83DE33D95D; Tue, 1 Jan 2013 16:57:37 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-python@lists.gentoo.org Cc: python@gentoo.org, =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-python] [PATCH] Support overriding job-count for distutils-r1 multiprocessing. Date: Tue, 1 Jan 2013 17:57:48 +0100 Message-Id: <1357059468-27708-1-git-send-email-mgorny@gentoo.org> X-Mailer: git-send-email 1.8.0.2 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: 850c7c69-699c-4798-9528-9cb599fcbda3 X-Archives-Hash: 571c4d37fe7cf8dd4d1d22a4d328e60e --- gx86/eclass/distutils-r1.eclass | 44 ++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/gx86/eclass/distutils-r1.eclass b/gx86/eclass/distutils-r1.eclass index e288c2c..3312505 100644 --- a/gx86/eclass/distutils-r1.eclass +++ b/gx86/eclass/distutils-r1.eclass @@ -68,6 +68,14 @@ if [[ ! ${_DISTUTILS_R1} ]]; then RDEPEND=${PYTHON_DEPS} DEPEND=${PYTHON_DEPS} +# @ECLASS-VARIABLE: DISTUTILS_JOBS +# @DEFAULT_UNSET +# @DECRIPTION: +# The number of parallel jobs to run for distutils-r1 parallel builds. +# If unset, the job-count in ${MAKEOPTS} will be used. +# +# This variable is intended to be set in make.conf. + # @ECLASS-VARIABLE: PATCHES # @DEFAULT_UNSET # @DESCRIPTION: @@ -144,15 +152,6 @@ DEPEND=${PYTHON_DEPS} # This variable can be used to disable the afore-mentioned feature # in case it causes issues with the package. -# -# If in-source builds are used, the eclass will create a copy of package -# sources for each Python implementation in python_prepare_all(), -# and work on that copy afterwards. -# -# If out-of-source builds are used, the eclass will instead work -# on the sources directly, prepending setup.py arguments with -# 'build --build-base ${BUILD_DIR}' to enforce keeping & using built -# files in the specific root. # @ECLASS-VARIABLE: mydistutilsargs # @DEFAULT_UNSET # @DESCRIPTION: @@ -425,6 +424,23 @@ _distutils-r1_run_common_phase() { "${@}" } +# @FUNCTION: _distutils-r1_multijob_init +# @INTERNAL +# @DESCRIPTION: +# Init multijob, taking the job-count from ${DISTUTILS_JOBS}. +_distutils-r1_multijob_init() { + debug-print-function ${FUNCNAME} "${@}" + + local opts + if [[ ${DISTUTILS_JOBS} ]]; then + opts=-j${DISTUTILS_JOBS} + else + opts=${MAKEOPTS} + fi + + multijob_init "${opts}" +} + distutils-r1_src_prepare() { debug-print-function ${FUNCNAME} "${@}" @@ -435,7 +451,7 @@ distutils-r1_src_prepare() { distutils-r1_python_prepare_all fi - multijob_init + _distutils-r1_multijob_init if declare -f python_prepare >/dev/null; then python_foreach_impl distutils-r1_run_phase python_prepare else @@ -445,7 +461,7 @@ distutils-r1_src_prepare() { } distutils-r1_src_configure() { - multijob_init + _distutils-r1_multijob_init if declare -f python_configure >/dev/null; then python_foreach_impl distutils-r1_run_phase python_configure else @@ -461,7 +477,7 @@ distutils-r1_src_configure() { distutils-r1_src_compile() { debug-print-function ${FUNCNAME} "${@}" - multijob_init + _distutils-r1_multijob_init if declare -f python_compile >/dev/null; then python_foreach_impl distutils-r1_run_phase python_compile else @@ -477,7 +493,7 @@ distutils-r1_src_compile() { distutils-r1_src_test() { debug-print-function ${FUNCNAME} "${@}" - multijob_init + _distutils-r1_multijob_init if declare -f python_test >/dev/null; then python_foreach_impl distutils-r1_run_phase python_test else @@ -493,7 +509,7 @@ distutils-r1_src_test() { distutils-r1_src_install() { debug-print-function ${FUNCNAME} "${@}" - multijob_init + _distutils-r1_multijob_init if declare -f python_install >/dev/null; then python_foreach_impl distutils-r1_run_phase python_install else -- 1.8.0.2