1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
4 # @ECLASS: multilib-minimal.eclass
6 # Multilib team <multilib@gentoo.org>
7 # @SUPPORTED_EAPIS: 4 5 6 7
8 # @BLURB: wrapper for multilib builds providing convenient multilib_src_* functions
11 # src_configure, src_compile, src_test and src_install are exported.
13 # Use multilib_src_* instead of src_* which runs this phase for
16 # multilib-minimal should _always_ go last in inherit order!
18 # If you want to use in-source builds, then you must run
19 # multilib_copy_sources at the end of src_prepare!
20 # Also make sure to set correct variables such as
23 # If you need generic install rules, use multilib_src_install_all function.
26 # EAPI=4 is required for meaningful MULTILIB_USEDEP.
29 *) die "EAPI=${EAPI} is not supported" ;;
33 [[ ${EAPI} == [45] ]] && inherit eutils
34 inherit multilib-build
36 EXPORT_FUNCTIONS src_configure src_compile src_test src_install
39 multilib-minimal_src_configure() {
40 debug-print-function ${FUNCNAME} "$@"
42 multilib-minimal_abi_src_configure() {
43 debug-print-function ${FUNCNAME} "$@"
45 mkdir -p "${BUILD_DIR}" || die
46 pushd "${BUILD_DIR}" >/dev/null || die
47 if declare -f multilib_src_configure >/dev/null ; then
48 multilib_src_configure
52 popd >/dev/null || die
55 multilib_foreach_abi multilib-minimal_abi_src_configure
58 multilib-minimal_src_compile() {
59 debug-print-function ${FUNCNAME} "$@"
61 multilib-minimal_abi_src_compile() {
62 debug-print-function ${FUNCNAME} "$@"
64 pushd "${BUILD_DIR}" >/dev/null || die
65 if declare -f multilib_src_compile >/dev/null ; then
70 popd >/dev/null || die
73 multilib_foreach_abi multilib-minimal_abi_src_compile
76 multilib-minimal_src_test() {
77 debug-print-function ${FUNCNAME} "$@"
79 multilib-minimal_abi_src_test() {
80 debug-print-function ${FUNCNAME} "$@"
82 pushd "${BUILD_DIR}" >/dev/null || die
83 if declare -f multilib_src_test >/dev/null ; then
88 popd >/dev/null || die
91 multilib_foreach_abi multilib-minimal_abi_src_test
94 multilib-minimal_src_install() {
95 debug-print-function ${FUNCNAME} "$@"
97 multilib-minimal_abi_src_install() {
98 debug-print-function ${FUNCNAME} "$@"
100 pushd "${BUILD_DIR}" >/dev/null || die
101 if declare -f multilib_src_install >/dev/null ; then
104 # default_src_install will not work here as it will
105 # break handling of DOCS wrt #468092
106 # so we split up the emake and doc-install part
107 # this is synced with __eapi4_src_install
108 if [[ -f Makefile || -f GNUmakefile || -f makefile ]] ; then
109 emake DESTDIR="${D}" install
113 multilib_prepare_wrappers
114 multilib_check_headers
115 popd >/dev/null || die
117 multilib_foreach_abi multilib-minimal_abi_src_install
118 multilib_install_wrappers
120 if declare -f multilib_src_install_all >/dev/null ; then
121 multilib_src_install_all