public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH cmake-multilib] Use multilib-minimal phase functions.
@ 2014-04-30 18:14 Michał Górny
  2014-05-09 10:49 ` Michał Górny
  0 siblings, 1 reply; 2+ messages in thread
From: Michał Górny @ 2014-04-30 18:14 UTC (permalink / raw
  To: gentoo-dev; +Cc: multilib, kde, Michał Górny

The goal is to make overriding parts of build process easy. Before,
the eclass called cmake-utils directly via multilib_foreach_abi,
therefore user overriding a phase function needed to call
multilib_foreach_abi himself, and likely define another function with
the details.

With multilib-minimal around, the eclass just provides a 'default'
implementation of particular multilib_src_*() phases. If user needs to
override one of them, he can just create his own multilib_src_*()
function without worrying about fine details.

Another advantage is that we get rid of the duplicate wrapper calling
code, keeping it all in multilib-minimal.

The new code should retain compatibility with existing ebuilds. I will
do a complete test run before committing.
---
 eclass/cmake-multilib.eclass | 56 +++++++++++++++++++++++++++-----------------
 1 file changed, 35 insertions(+), 21 deletions(-)

diff --git a/eclass/cmake-multilib.eclass b/eclass/cmake-multilib.eclass
index e7c9059..8461f42 100644
--- a/eclass/cmake-multilib.eclass
+++ b/eclass/cmake-multilib.eclass
@@ -9,16 +9,15 @@
 # Author: Michał Górny <mgorny@gentoo.org>
 # @BLURB: cmake-utils wrapper for multilib builds
 # @DESCRIPTION:
-# The cmake-multilib.eclass is a cmake-utils.eclass(5) wrapper
-# introducing support for building for more than one ABI (multilib).
+# The cmake-multilib.eclass provides a glue between cmake-utils.eclass(5)
+# and multilib-minimal.eclass(5), aiming to provide a convenient way
+# to build packages using cmake for multiple ABIs.
 #
-# Inheriting this eclass sets IUSE and exports cmake-utils phase
-# function wrappers which build the package for each supported ABI
-# if the appropriate flag is enabled.
-#
-# Note that the multilib support requires out-of-source builds to be
-# enabled. Thus, it is impossible to use CMAKE_IN_SOURCE_BUILD with
-# it.
+# Inheriting this eclass sets IUSE and exports default multilib_src_*()
+# sub-phases that call cmake-utils phase functions for each ABI enabled.
+# The multilib_src_*() functions can be defined in ebuild just like
+# in multilib-minimal, yet they ought to call appropriate cmake-utils
+# phase rather than 'default'.
 
 # EAPI=5 is required for meaningful MULTILIB_USEDEP.
 case ${EAPI:-0} in
@@ -30,31 +29,46 @@ if [[ ${CMAKE_IN_SOURCE_BUILD} ]]; then
 	die "${ECLASS}: multilib support requires out-of-source builds."
 fi
 
-inherit cmake-utils multilib-build
+inherit cmake-utils multilib-minimal
 
 EXPORT_FUNCTIONS src_configure src_compile src_test src_install
 
 cmake-multilib_src_configure() {
-	multilib_parallel_foreach_abi cmake-utils_src_configure "${@}"
+	local _cmake_args=( "${@}" )
+
+	multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+	cmake-utils_src_configure "${_cmake_args[@]}"
 }
 
 cmake-multilib_src_compile() {
-	multilib_foreach_abi cmake-utils_src_compile "${@}"
+	local _cmake_args=( "${@}" )
+
+	multilib-minimal_src_compile
+}
+
+multilib_src_compile() {
+	cmake-utils_src_compile "${_cmake_args[@]}"
 }
 
 cmake-multilib_src_test() {
-	multilib_foreach_abi cmake-utils_src_test "${@}"
+	local _cmake_args=( "${@}" )
+
+	multilib-minimal_src_test
+}
+
+multilib_src_test() {
+	cmake-utils_src_test "${_cmake_args[@]}"
 }
 
 cmake-multilib_src_install() {
-	cmake-multilib_secure_install() {
-		cmake-utils_src_install "${@}"
+	local _cmake_args=( "${@}" )
 
-		multilib_prepare_wrappers
-		# Make sure all headers are the same for each ABI.
-		multilib_check_headers
-	}
+	multilib-minimal_src_install
+}
 
-	multilib_foreach_abi cmake-multilib_secure_install "${@}"
-	multilib_install_wrappers
+multilib_src_install() {
+	cmake-utils_src_install "${_cmake_args[@]}"
 }
-- 
1.9.2



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

* Re: [gentoo-dev] [PATCH cmake-multilib] Use multilib-minimal phase functions.
  2014-04-30 18:14 [gentoo-dev] [PATCH cmake-multilib] Use multilib-minimal phase functions Michał Górny
@ 2014-05-09 10:49 ` Michał Górny
  0 siblings, 0 replies; 2+ messages in thread
From: Michał Górny @ 2014-05-09 10:49 UTC (permalink / raw
  To: gentoo-dev; +Cc: multilib, kde

[-- Attachment #1: Type: text/plain, Size: 422 bytes --]

Dnia 2014-04-30, o godz. 20:14:35
Michał Górny <mgorny@gentoo.org> napisał(a):

> The goal is to make overriding parts of build process easy. Before,
> the eclass called cmake-utils directly via multilib_foreach_abi,
> therefore user overriding a phase function needed to call
> multilib_foreach_abi himself, and likely define another function with
> the details.

Committed.

-- 
Best regards,
Michał Górny

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 966 bytes --]

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

end of thread, other threads:[~2014-05-09 10:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-30 18:14 [gentoo-dev] [PATCH cmake-multilib] Use multilib-minimal phase functions Michał Górny
2014-05-09 10:49 ` 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