public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH 1/3] multibuild: introduce generic multibuild_copy_sources.
@ 2013-03-06 14:25 Michał Górny
  2013-03-06 14:25 ` [gentoo-dev] [PATCH 2/3] python-r1: use multibuild_copy_sources Michał Górny
  2013-03-06 14:25 ` [gentoo-dev] [PATCH 3/3] multilib-build: introduce multilib_copy_sources Michał Górny
  0 siblings, 2 replies; 3+ messages in thread
From: Michał Górny @ 2013-03-06 14:25 UTC (permalink / raw
  To: gentoo-dev; +Cc: python, Michał Górny

The new function can be used to create per-variant copies of source
trees. Code based on python_copy_sources from python-r1.
---
 gx86/eclass/multibuild.eclass | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/gx86/eclass/multibuild.eclass b/gx86/eclass/multibuild.eclass
index 8ccd3b6..65f3926 100644
--- a/gx86/eclass/multibuild.eclass
+++ b/gx86/eclass/multibuild.eclass
@@ -205,6 +205,27 @@ multibuild_for_best_variant() {
 	multibuild_foreach_variant "${@}"
 }
 
+# @FUNCTION: multibuild_copy_sources
+# @DESCRIPTION:
+# Create per-variant copies of source tree. The source tree is assumed
+# to be in ${BUILD_DIR}, or ${S} if the former is unset. The copies will
+# be placed in directories matching BUILD_DIRs used by
+# multibuild_foreach().
+multibuild_copy_sources() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	local _MULTIBUILD_INITIAL_BUILD_DIR=${BUILD_DIR:-${S}}
+
+	einfo "Will copy sources from ${_MULTIBUILD_INITIAL_BUILD_DIR}"
+
+	_multibuild_create_source_copy() {
+		einfo "${impl}: copying to ${BUILD_DIR}"
+		cp -pr "${_MULTIBUILD_INITIAL_BUILD_DIR}" "${BUILD_DIR}" || die
+	}
+
+	multibuild_foreach_variant _multibuild_create_source_copy
+}
+
 # @FUNCTION: run_in_build_dir
 # @USAGE: <argv>...
 # @DESCRIPTION:
-- 
1.8.1.5



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-dev] [PATCH 2/3] python-r1: use multibuild_copy_sources.
  2013-03-06 14:25 [gentoo-dev] [PATCH 1/3] multibuild: introduce generic multibuild_copy_sources Michał Górny
@ 2013-03-06 14:25 ` Michał Górny
  2013-03-06 14:25 ` [gentoo-dev] [PATCH 3/3] multilib-build: introduce multilib_copy_sources Michał Górny
  1 sibling, 0 replies; 3+ messages in thread
From: Michał Górny @ 2013-03-06 14:25 UTC (permalink / raw
  To: gentoo-dev; +Cc: python, Michał Górny

---
 gx86/eclass/python-r1.eclass | 30 +++++++++---------------------
 1 file changed, 9 insertions(+), 21 deletions(-)

diff --git a/gx86/eclass/python-r1.eclass b/gx86/eclass/python-r1.eclass
index 934f32d..36b20dc 100644
--- a/gx86/eclass/python-r1.eclass
+++ b/gx86/eclass/python-r1.eclass
@@ -348,34 +348,22 @@ python_gen_cond_dep() {
 
 # @FUNCTION: python_copy_sources
 # @DESCRIPTION:
-# Create a single copy of the package sources (${S}) for each enabled
-# Python implementation.
+# Create a single copy of the package sources for each enabled Python
+# implementation.
 #
-# The sources are always copied from S to implementation-specific build
-# directories respecting BUILD_DIR.
+# The sources are always copied from initial BUILD_DIR (or S if unset)
+# to implementation-specific build directory matching BUILD_DIR used by
+# python_foreach_abi().
 python_copy_sources() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	_python_validate_useflags
+	_python_check_USE_PYTHON
 
-	local impl
-	local bdir=${BUILD_DIR:-${S}}
-
-	debug-print "${FUNCNAME}: bdir = ${bdir}"
-	einfo "Will copy sources from ${S}"
-	# the order is irrelevant here
-	for impl in "${PYTHON_COMPAT[@]}"; do
-		_python_impl_supported "${impl}" || continue
-
-		if use "python_targets_${impl}"
-		then
-			local BUILD_DIR=${bdir%%/}-${impl}
+	local MULTIBUILD_VARIANTS
+	_python_obtain_impls
 
-			einfo "${impl}: copying to ${BUILD_DIR}"
-			debug-print "${FUNCNAME}: [${impl}] cp ${S} => ${BUILD_DIR}"
-			cp -pr "${S}" "${BUILD_DIR}" || die
-		fi
-	done
+	multibuild_copy_sources
 }
 
 # @FUNCTION: _python_check_USE_PYTHON
-- 
1.8.1.5



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-dev] [PATCH 3/3] multilib-build: introduce multilib_copy_sources.
  2013-03-06 14:25 [gentoo-dev] [PATCH 1/3] multibuild: introduce generic multibuild_copy_sources Michał Górny
  2013-03-06 14:25 ` [gentoo-dev] [PATCH 2/3] python-r1: use multibuild_copy_sources Michał Górny
@ 2013-03-06 14:25 ` Michał Górny
  1 sibling, 0 replies; 3+ messages in thread
From: Michał Górny @ 2013-03-06 14:25 UTC (permalink / raw
  To: gentoo-dev; +Cc: python, Michał Górny

---
 gx86/eclass/multilib-build.eclass | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/gx86/eclass/multilib-build.eclass b/gx86/eclass/multilib-build.eclass
index c29b5df..66fb5a6 100644
--- a/gx86/eclass/multilib-build.eclass
+++ b/gx86/eclass/multilib-build.eclass
@@ -190,5 +190,19 @@ multilib_check_headers() {
 	fi
 }
 
+# @FUNCTION: multilib_copy_sources
+# @DESCRIPTION:
+# Create a single copy of the package sources for each enabled ABI.
+#
+# The sources are always copied from initial BUILD_DIR (or S if unset)
+# to ABI-specific build directory matching BUILD_DIR used by
+# multilib_foreach_abi().
+multilib_copy_sources() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	local MULTIBUILD_VARIANTS=( $(multilib_get_enabled_abis) )
+	multibuild_copy_sources
+}
+
 _MULTILIB_BUILD=1
 fi
-- 
1.8.1.5



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-03-06 14:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-06 14:25 [gentoo-dev] [PATCH 1/3] multibuild: introduce generic multibuild_copy_sources Michał Górny
2013-03-06 14:25 ` [gentoo-dev] [PATCH 2/3] python-r1: use multibuild_copy_sources Michał Górny
2013-03-06 14:25 ` [gentoo-dev] [PATCH 3/3] multilib-build: introduce multilib_copy_sources Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox