/[gentoo-x86]/eclass/cmake-multilib.eclass
Gentoo

Diff of /eclass/cmake-multilib.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.6 Revision 1.7
1# Copyright 1999-2014 Gentoo Foundation 1# Copyright 1999-2014 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/cmake-multilib.eclass,v 1.6 2014/04/29 20:54:54 mgorny Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/cmake-multilib.eclass,v 1.7 2014/05/09 10:48:59 mgorny Exp $
4 4
5# @ECLASS: cmake-multilib.eclass 5# @ECLASS: cmake-multilib.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# gx86-multilib team <multilib@gentoo.org> 7# gx86-multilib team <multilib@gentoo.org>
8# @AUTHOR: 8# @AUTHOR:
9# Author: Michał Górny <mgorny@gentoo.org> 9# Author: Michał Górny <mgorny@gentoo.org>
10# @BLURB: cmake-utils wrapper for multilib builds 10# @BLURB: cmake-utils wrapper for multilib builds
11# @DESCRIPTION: 11# @DESCRIPTION:
12# The cmake-multilib.eclass is a cmake-utils.eclass(5) wrapper 12# The cmake-multilib.eclass provides a glue between cmake-utils.eclass(5)
13# introducing support for building for more than one ABI (multilib). 13# and multilib-minimal.eclass(5), aiming to provide a convenient way
14# to build packages using cmake for multiple ABIs.
14# 15#
15# Inheriting this eclass sets IUSE and exports cmake-utils phase 16# Inheriting this eclass sets IUSE and exports default multilib_src_*()
16# function wrappers which build the package for each supported ABI 17# sub-phases that call cmake-utils phase functions for each ABI enabled.
17# if the appropriate flag is enabled. 18# The multilib_src_*() functions can be defined in ebuild just like
18# 19# in multilib-minimal, yet they ought to call appropriate cmake-utils
19# Note that the multilib support requires out-of-source builds to be 20# phase rather than 'default'.
20# enabled. Thus, it is impossible to use CMAKE_IN_SOURCE_BUILD with
21# it.
22 21
23# EAPI=5 is required for meaningful MULTILIB_USEDEP. 22# EAPI=5 is required for meaningful MULTILIB_USEDEP.
24case ${EAPI:-0} in 23case ${EAPI:-0} in
25 5) ;; 24 5) ;;
26 *) die "EAPI=${EAPI} is not supported" ;; 25 *) die "EAPI=${EAPI} is not supported" ;;
28 27
29if [[ ${CMAKE_IN_SOURCE_BUILD} ]]; then 28if [[ ${CMAKE_IN_SOURCE_BUILD} ]]; then
30 die "${ECLASS}: multilib support requires out-of-source builds." 29 die "${ECLASS}: multilib support requires out-of-source builds."
31fi 30fi
32 31
33inherit cmake-utils multilib-build 32inherit cmake-utils multilib-minimal
34 33
35EXPORT_FUNCTIONS src_configure src_compile src_test src_install 34EXPORT_FUNCTIONS src_configure src_compile src_test src_install
36 35
37cmake-multilib_src_configure() { 36cmake-multilib_src_configure() {
38 multilib_parallel_foreach_abi cmake-utils_src_configure "${@}" 37 local _cmake_args=( "${@}" )
38
39 multilib-minimal_src_configure
40}
41
42multilib_src_configure() {
43 cmake-utils_src_configure "${_cmake_args[@]}"
39} 44}
40 45
41cmake-multilib_src_compile() { 46cmake-multilib_src_compile() {
42 multilib_foreach_abi cmake-utils_src_compile "${@}" 47 local _cmake_args=( "${@}" )
48
49 multilib-minimal_src_compile
50}
51
52multilib_src_compile() {
53 cmake-utils_src_compile "${_cmake_args[@]}"
43} 54}
44 55
45cmake-multilib_src_test() { 56cmake-multilib_src_test() {
46 multilib_foreach_abi cmake-utils_src_test "${@}" 57 local _cmake_args=( "${@}" )
58
59 multilib-minimal_src_test
60}
61
62multilib_src_test() {
63 cmake-utils_src_test "${_cmake_args[@]}"
47} 64}
48 65
49cmake-multilib_src_install() { 66cmake-multilib_src_install() {
50 cmake-multilib_secure_install() { 67 local _cmake_args=( "${@}" )
51 cmake-utils_src_install "${@}"
52 68
53 multilib_prepare_wrappers 69 multilib-minimal_src_install
54 # Make sure all headers are the same for each ABI. 70}
55 multilib_check_headers
56 }
57 71
58 multilib_foreach_abi cmake-multilib_secure_install "${@}" 72multilib_src_install() {
59 multilib_install_wrappers 73 cmake-utils_src_install "${_cmake_args[@]}"
60} 74}

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

  ViewVC Help
Powered by ViewVC 1.1.20