kde-plasma/breeze-gtk: x86 stable wrt bug #613144
[gentoo.git] / eclass / multilib-minimal.eclass
1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 # @ECLASS: multilib-minimal.eclass
5 # @MAINTAINER:
6 # Multilib team <multilib@gentoo.org>
7 # @BLURB: wrapper for multilib builds providing convenient multilib_src_* functions
8 # @DESCRIPTION:
9 #
10 # src_configure, src_compile, src_test and src_install are exported.
11 #
12 # Use multilib_src_* instead of src_* which runs this phase for
13 # all enabled ABIs.
14 #
15 # multilib-minimal should _always_ go last in inherit order!
16 #
17 # If you want to use in-source builds, then you must run
18 # multilib_copy_sources at the end of src_prepare!
19 # Also make sure to set correct variables such as
20 # ECONF_SOURCE=${S}
21 #
22 # If you need generic install rules, use multilib_src_install_all function.
23
24
25 # EAPI=4 is required for meaningful MULTILIB_USEDEP.
26 case ${EAPI:-0} in
27         4|5|6) ;;
28         *) die "EAPI=${EAPI} is not supported" ;;
29 esac
30
31
32 [[ ${EAPI} == [45] ]] && inherit eutils
33 inherit multilib-build
34
35 EXPORT_FUNCTIONS src_configure src_compile src_test src_install
36
37
38 multilib-minimal_src_configure() {
39         debug-print-function ${FUNCNAME} "$@"
40
41         multilib-minimal_abi_src_configure() {
42                 debug-print-function ${FUNCNAME} "$@"
43
44                 mkdir -p "${BUILD_DIR}" || die
45                 pushd "${BUILD_DIR}" >/dev/null || die
46                 if declare -f multilib_src_configure >/dev/null ; then
47                         multilib_src_configure
48                 else
49                         default_src_configure
50                 fi
51                 popd >/dev/null || die
52         }
53
54         multilib_foreach_abi multilib-minimal_abi_src_configure
55 }
56
57 multilib-minimal_src_compile() {
58         debug-print-function ${FUNCNAME} "$@"
59
60         multilib-minimal_abi_src_compile() {
61                 debug-print-function ${FUNCNAME} "$@"
62
63                 pushd "${BUILD_DIR}" >/dev/null || die
64                 if declare -f multilib_src_compile >/dev/null ; then
65                         multilib_src_compile
66                 else
67                         default_src_compile
68                 fi
69                 popd >/dev/null || die
70         }
71
72         multilib_foreach_abi multilib-minimal_abi_src_compile
73 }
74
75 multilib-minimal_src_test() {
76         debug-print-function ${FUNCNAME} "$@"
77
78         multilib-minimal_abi_src_test() {
79                 debug-print-function ${FUNCNAME} "$@"
80
81                 pushd "${BUILD_DIR}" >/dev/null || die
82                 if declare -f multilib_src_test >/dev/null ; then
83                         multilib_src_test
84                 else
85                         default_src_test
86                 fi
87                 popd >/dev/null || die
88         }
89
90         multilib_foreach_abi multilib-minimal_abi_src_test
91 }
92
93 multilib-minimal_src_install() {
94         debug-print-function ${FUNCNAME} "$@"
95
96         multilib-minimal_abi_src_install() {
97                 debug-print-function ${FUNCNAME} "$@"
98
99                 pushd "${BUILD_DIR}" >/dev/null || die
100                 if declare -f multilib_src_install >/dev/null ; then
101                         multilib_src_install
102                 else
103                         # default_src_install will not work here as it will
104                         # break handling of DOCS wrt #468092
105                         # so we split up the emake and doc-install part
106                         # this is synced with __eapi4_src_install
107                         if [[ -f Makefile || -f GNUmakefile || -f makefile ]] ; then
108                                 emake DESTDIR="${D}" install
109                         fi
110                 fi
111
112                 multilib_prepare_wrappers
113                 multilib_check_headers
114                 popd >/dev/null || die
115         }
116         multilib_foreach_abi multilib-minimal_abi_src_install
117         multilib_install_wrappers
118
119         if declare -f multilib_src_install_all >/dev/null ; then
120                 multilib_src_install_all
121         else
122                 einstalldocs
123         fi
124 }