public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [RFC] multilib-build.eclass for multilib building helpers
@ 2013-01-26 12:06 Michał Górny
  2013-01-26 12:06 ` [gentoo-dev] [PATCH 1/2] Split up a common eclass for multilib builds Michał Górny
  2013-01-26 12:06 ` [gentoo-dev] [PATCH 2/2] Use multilib-build eclass-provided functions Michał Górny
  0 siblings, 2 replies; 3+ messages in thread
From: Michał Górny @ 2013-01-26 12:06 UTC (permalink / raw
  To: gentoo-dev

Hello,

As spoken earlier, I have split out a set of common functions
from autotools-multilib to multilib-build eclass. The new eclass
provides:

- IUSE for multilib setup,

- MULTILIB_USEDEP for creating deps,

- multilib_foreach_abi() and multilib_parallel_foreach_abi() to run
  commands iterating over ABIs.



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

* [gentoo-dev] [PATCH 1/2] Split up a common eclass for multilib builds.
  2013-01-26 12:06 [gentoo-dev] [RFC] multilib-build.eclass for multilib building helpers Michał Górny
@ 2013-01-26 12:06 ` Michał Górny
  2013-01-26 12:06 ` [gentoo-dev] [PATCH 2/2] Use multilib-build eclass-provided functions Michał Górny
  1 sibling, 0 replies; 3+ messages in thread
From: Michał Górny @ 2013-01-26 12:06 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

The eclass does:

- export proper USE flags to control the built ABIs,

- provide MULTILIB_USEDEP to write proper USE dependencies,

- provide utility functions to run commands for each ABI.
---
 gx86/eclass/multilib-build.eclass | 103 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 103 insertions(+)
 create mode 100644 gx86/eclass/multilib-build.eclass

diff --git a/gx86/eclass/multilib-build.eclass b/gx86/eclass/multilib-build.eclass
new file mode 100644
index 0000000..d8bd5ab
--- /dev/null
+++ b/gx86/eclass/multilib-build.eclass
@@ -0,0 +1,103 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/eclass/autotools-multilib.eclass,v 1.7 2013/01/26 11:39:41 mgorny Exp $
+
+# @ECLASS: multilib-build.eclass
+# @MAINTAINER:
+# Michał Górny <mgorny@gentoo.org>
+# @BLURB: flags and utility functions for building multilib packages
+# @DESCRIPTION:
+# The multilib-build.eclass exports USE flags and utility functions
+# necessary to build packages for multilib in a clean and uniform
+# manner.
+#
+# Please note that dependency specifications for multilib-capable
+# dependencies shall use the USE dependency string in ${MULTILIB_USEDEP}
+# to properly request multilib enabled.
+
+if [[ ! ${_MULTILIB_BUILD} ]]; then
+
+# EAPI=5 is required for meaningful MULTILIB_USEDEP.
+case ${EAPI:-0} in
+	5) ;;
+	*) die "EAPI=${EAPI} is not supported" ;;
+esac
+
+inherit multilib multiprocessing
+
+IUSE=multilib
+
+# @ECLASS-VARIABLE: MULTILIB_USEDEP
+# @DESCRIPTION:
+# The USE-dependency to be used on dependencies (libraries) needing
+# to support multilib as well.
+#
+# Example use:
+# @CODE
+# RDEPEND="dev-libs/libfoo[${MULTILIB_USEDEP}]
+#	net-libs/libbar[ssl,${MULTILIB_USEDEP}]"
+# @CODE
+MULTILIB_USEDEP='multilib(-)?'
+
+# @FUNCTION: multilib_foreach_abi
+# @USAGE: <argv>...
+# @DESCRIPTION:
+# If multilib support is enabled, sets the toolchain up for each
+# supported ABI along with the ABI variable and correct BUILD_DIR,
+# and runs the given commands with them.
+#
+# If multilib support is disabled, it just runs the commands. No setup
+# is done.
+multilib_foreach_abi() {
+	local initial_dir=${BUILD_DIR:-${S}}
+
+	if use multilib; then
+		local ABI
+		for ABI in $(get_all_abis); do
+			multilib_toolchain_setup "${ABI}"
+			BUILD_DIR=${initial_dir%%/}-${ABI} "${@}"
+		done
+	else
+		"${@}"
+	fi
+}
+
+# @FUNCTION: multilib_parallel_foreach_abi
+# @USAGE: <argv>...
+# @DESCRIPTION:
+# If multilib support is enabled, sets the toolchain up for each
+# supported ABI along with the ABI variable and correct BUILD_DIR,
+# and runs the given commands with them. The commands are run
+# in parallel with number of jobs being determined from MAKEOPTS.
+#
+# If multilib support is disabled, it just runs the commands. No setup
+# is done.
+#
+# Useful for running configure scripts.
+multilib_parallel_foreach_abi() {
+	local initial_dir=${BUILD_DIR:-${S}}
+
+	if use multilib; then
+		multijob_init
+
+		local ABI
+		for ABI in $(get_all_abis); do
+			(
+				multijob_child_init
+
+				multilib_toolchain_setup "${ABI}"
+				BUILD_DIR=${initial_dir%%/}-${ABI}
+				"${@}"
+			) &
+
+			multijob_post_fork
+		done
+
+		multijob_finish
+	else
+		"${@}"
+	fi
+}
+
+_MULTILIB_BUILD=1
+fi
-- 
1.8.1.1



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

* [gentoo-dev] [PATCH 2/2] Use multilib-build eclass-provided functions.
  2013-01-26 12:06 [gentoo-dev] [RFC] multilib-build.eclass for multilib building helpers Michał Górny
  2013-01-26 12:06 ` [gentoo-dev] [PATCH 1/2] Split up a common eclass for multilib builds Michał Górny
@ 2013-01-26 12:06 ` Michał Górny
  1 sibling, 0 replies; 3+ messages in thread
From: Michał Górny @ 2013-01-26 12:06 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

I have decided to remove autotools-multilib_* utility functions
completely since the sole consumer of the eclass does not use it.
---
 gx86/eclass/autotools-multilib.eclass | 84 +++--------------------------------
 1 file changed, 5 insertions(+), 79 deletions(-)

diff --git a/gx86/eclass/autotools-multilib.eclass b/gx86/eclass/autotools-multilib.eclass
index 90f7bee..010c856 100644
--- a/gx86/eclass/autotools-multilib.eclass
+++ b/gx86/eclass/autotools-multilib.eclass
@@ -29,96 +29,22 @@ if [[ ${AUTOTOOLS_IN_SOURCE_BUILD} ]]; then
 	die "${ECLASS}: multilib support requires out-of-source builds."
 fi
 
-inherit autotools-utils multilib multiprocessing
+inherit autotools-utils multilib-build
 
 EXPORT_FUNCTIONS src_configure src_compile src_test src_install
 
-IUSE=multilib
-
-# @ECLASS-VARIABLE: MULTILIB_USEDEP
-# @DESCRIPTION:
-# The USE-dependency to be used on dependencies (libraries) needing
-# to support multilib as well.
-#
-# Example use:
-# @CODE
-# RDEPEND="dev-libs/libfoo[${MULTILIB_USEDEP}]
-#	net-libs/libbar[ssl,${MULTILIB_USEDEP}]"
-# @CODE
-MULTILIB_USEDEP='multilib(-)?'
-
-# @FUNCTION: autotools-multilib_foreach_abi
-# @USAGE: argv...
-# @DESCRIPTION:
-# If multilib support is enabled, sets the toolchain up for each
-# supported ABI along with the ABI variable and correct BUILD_DIR,
-# and runs the given commands with them.
-#
-# If multilib support is disabled, it just runs the commands. No setup
-# is done.
-autotools-multilib_foreach_abi() {
-	local initial_dir=${BUILD_DIR:-${S}}
-
-	if use multilib; then
-		local ABI
-		for ABI in $(get_all_abis); do
-			multilib_toolchain_setup "${ABI}"
-			BUILD_DIR=${initial_dir%%/}-${ABI} "${@}"
-		done
-	else
-		"${@}"
-	fi
-}
-
-# @FUNCTION: autotools-multilib_parallel_foreach_abi
-# @USAGE: argv...
-# @DESCRIPTION:
-# If multilib support is enabled, sets the toolchain up for each
-# supported ABI along with the ABI variable and correct BUILD_DIR,
-# and runs the given commands with them. The commands are run
-# in parallel with number of jobs being determined from MAKEOPTS.
-#
-# If multilib support is disabled, it just runs the commands. No setup
-# is done.
-#
-# Useful for running configure scripts.
-autotools-multilib_parallel_foreach_abi() {
-	local initial_dir=${BUILD_DIR:-${S}}
-
-	if use multilib; then
-		multijob_init
-
-		local ABI
-		for ABI in $(get_all_abis); do
-			(
-				multijob_child_init
-
-				multilib_toolchain_setup "${ABI}"
-				BUILD_DIR=${initial_dir%%/}-${ABI}
-				"${@}"
-			) &
-
-			multijob_post_fork
-		done
-
-		multijob_finish
-	else
-		"${@}"
-	fi
-}
-
 autotools-multilib_src_configure() {
-	autotools-multilib_parallel_foreach_abi autotools-utils_src_configure
+	multilib_parallel_foreach_abi autotools-utils_src_configure
 }
 
 autotools-multilib_src_compile() {
-	autotools-multilib_foreach_abi autotools-utils_src_compile
+	multilib_foreach_abi autotools-utils_src_compile
 }
 
 autotools-multilib_src_test() {
-	autotools-multilib_foreach_abi autotools-utils_src_test
+	multilib_foreach_abi autotools-utils_src_test
 }
 
 autotools-multilib_src_install() {
-	autotools-multilib_foreach_abi autotools-utils_src_install
+	multilib_foreach_abi autotools-utils_src_install
 }
-- 
1.8.1.1



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

end of thread, other threads:[~2013-01-26 12:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-26 12:06 [gentoo-dev] [RFC] multilib-build.eclass for multilib building helpers Michał Górny
2013-01-26 12:06 ` [gentoo-dev] [PATCH 1/2] Split up a common eclass for multilib builds Michał Górny
2013-01-26 12:06 ` [gentoo-dev] [PATCH 2/2] Use multilib-build eclass-provided functions 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