diff options
author | Gregory M. Tuner <gmt@be-evil.net> | 2013-12-26 17:19:30 -0800 |
---|---|---|
committer | Gregory M. Tuner <gmt@be-evil.net> | 2013-12-26 17:19:30 -0800 |
commit | 8443592c9abf394f7c4ce67869250a9c4ef14d03 (patch) | |
tree | 3a5173dbe1341ab224d63d5d6096c63b07a129b2 /eclass/qt4-build-multilib.eclass | |
parent | dev-libs/gmp: handle variable lifetimes in a consistent manner (diff) | |
download | gmt-8443592c9abf394f7c4ce67869250a9c4ef14d03.tar.gz gmt-8443592c9abf394f7c4ce67869250a9c4ef14d03.tar.bz2 gmt-8443592c9abf394f7c4ce67869250a9c4ef14d03.zip |
eclass/qt4-build-multilib: "per-abi" consistency patch
Rename some qt4 ehook events for consistency and add ehooks
for various methods that never got them in the first place.
Also implement a hook adapter to fire best_abi events.
Signed-off-by: Gregory M. Tuner <gmt@be-evil.net>
Diffstat (limited to 'eclass/qt4-build-multilib.eclass')
-rw-r--r-- | eclass/qt4-build-multilib.eclass | 114 |
1 files changed, 75 insertions, 39 deletions
diff --git a/eclass/qt4-build-multilib.eclass b/eclass/qt4-build-multilib.eclass index 098c148..105267e 100644 --- a/eclass/qt4-build-multilib.eclass +++ b/eclass/qt4-build-multilib.eclass @@ -26,7 +26,9 @@ inherit qt4-build multilib-build ehooker # Sets up PATH and LD_LIBRARY_PATH. qt4-build-multilib_pkg_setup() { debug-print-function "${FUNCNAME}" "$@" - qt4-build_pkg_setup "$@" + ehook_fire qt4-build-multilib-global-pre_pkg_setup && \ + qt4-build_pkg_setup "$@" + ehook_fire qt4-build-multilib-global-post_pkg_setup -u } # @ECLASS-VARIABLE: QT4_EXTRACT_DIRECTORIES @@ -46,9 +48,26 @@ qt4-build-multilib_pkg_setup() { # Unpacks the sources. qt4-build-multilib_src_unpack() { debug-print-function "${FUNCNAME}" "$@" - qt4-build_src_unpack "$@" + ehook_fire qt4-build-multilib-global-pre_src_unpack && \ + qt4-build_src_unpack "$@" + ehook_fire qt4-build-multilib-global-post_src_unpack -u } +# implement qt4-build-multilib-best-abi-{pre,post}_src_* ehooks +# by implementing a hook-adapter for the per-abi ehooks +_qt4-build-multilib_best_abi_hook_demux() { + local hookname="${1/-per-abi-/-best-abi-}" + multilib_is_best_abi && { ehook-fire "${hookname}" ; return $? ; } + return 0 +} +if [[ ${_QT4_BUILD_MULTILIB_HOOK_DEMUX_REGISTERED} ]] ; then + for _qwerpoiuqwerpoiu in qt4-build-multilib-per-abi-{pre,post}_src_{prepare,configure,compile,test,install} ; do + ehook ${_qwerpoiuqwerpoiu} _qt4-build-multilib_best_abi_hook_demux + done + _QT4_BUILD_MULTILIB_HOOK_DEMUX_REGISTERED=yes + unset _qwerpoiuqwerpoiu +fi + # @ECLASS-VARIABLE: PATCHES # @DEFAULT_UNSET # @DESCRIPTION: @@ -75,21 +94,9 @@ qt4-build-multilib_src_prepare() { [[ -n ${PATCHES[@]} ]] && epatch "${PATCHES[@]}" declare -a PATCHES=( ) - # sadly, qt4-build simply isn't designed for out-of-tree - # builds, even though qt does support them according to - # the website. Even if it did, there are so many - # ABI-specific hacks injected during qt4-build_src_prepare - # that we would have to do both qt4-build_src_prepare and - # qt4-build_src_configure in the qt4-build-multilib_src_configure - # step to make it work. What really needs to happen, I suppose, - # is a full reimplementation here in qt4-build-multilib that - # does not rely on qt4-build. However, to get the ball rolling, - # we follow the path of least resistance, for now... - multilib_copy_sources - _qt4-build-multilib_src_prepare_hookwrap() { local S="${BUILD_DIR}" - if ehook_fire qt4-build-multilib-pre_src_prepare ; then + if ehook_fire qt4-build-multilib-per-abi-pre_src_prepare ; then qt4-build_src_prepare "$@" @@ -103,11 +110,26 @@ PKG_CONFIG_PATH='${EPREFIX}/usr/share/pkgconfig'\n" \ -i configure \ || die "sed SYSTEM_VARIABLES (round II) failed" fi - ehook_fire qt4-build-multilib-post_src_prepare -u + ehook_fire qt4-build-multilib-per-abi-post_src_prepare -u } - multilib_parallel_foreach_abi run_in_build_dir \ - _qt4-build-multilib_src_prepare_hookwrap "$@" + if ehook_fire qt4-build-multilib-global-pre_src_prepare ; then + # sadly, qt4-build simply isn't designed for out-of-tree + # builds, even though qt does support them according to + # the website. Even if it did, there are so many + # ABI-specific hacks injected during qt4-build_src_prepare + # that we would have to do both qt4-build_src_prepare and + # qt4-build_src_configure in the qt4-build-multilib_src_configure + # step to make it work. What really needs to happen, I suppose, + # is a full reimplementation here in qt4-build-multilib that + # does not rely on qt4-build. However, to get the ball rolling, + # we follow the path of least resistance, for now... + multilib_copy_sources + + multilib_parallel_foreach_abi run_in_build_dir \ + _qt4-build-multilib_src_prepare_hookwrap "$@" + fi + ehook_fire qt4-build-multilib-global-post_src_prepare -u } # @FUNCTION: qt4-build-multilib_src_configure @@ -134,13 +156,15 @@ qt4-build-multilib_src_configure() { _qt4_get_libdir_subst_myconf local S="${BUILD_DIR}" - ehook_fire qt4-build-multilib-pre_src_configure && \ + ehook_fire qt4-build-multilib-per-abi-pre_src_configure && \ qt4-build_src_configure "$@" - ehook_fire qt4-build-multilib-post_src_configure -u + ehook_fire qt4-build-multilib-per-abi-post_src_configure -u } - multilib_parallel_foreach_abi run_in_build_dir \ - _qt4-build-multilib_src_configure_hookwrap "$@" + ehook_fire qt4-build-multilib-global-pre_src_configure && \ + multilib_parallel_foreach_abi run_in_build_dir \ + _qt4-build-multilib_src_configure_hookwrap "$@" + ehook_fire qt4-build-multilib-global-post_src_configure -u } # @FUNCTION: qt4-build-multilib_src_compile @@ -152,13 +176,15 @@ qt4-build-multilib_src_compile() { _qt4-build-multilib_src_compile_hookwrap() { debug-print-function "${FUNCNAME}" "$@" local S="${BUILD_DIR}" - ehook_fire qt4-build-multilib-pre_src_compile && \ + ehook_fire qt4-build-multilib-per-abi-pre_src_compile && \ qt4-build_src_compile "$@" - ehook_fire qt4-build-multilib-post_src_compile -u + ehook_fire qt4-build-multilib-per-abi-post_src_compile -u } - multilib_parallel_foreach_abi run_in_build_dir \ - _qt4-build-multilib_src_compile_hookwrap "$@" + ehook_fire qt4-build-multilib-global-pre_src_compile && \ + multilib_parallel_foreach_abi run_in_build_dir \ + _qt4-build-multilib_src_compile_hookwrap "$@" + ehook_fire qt4-build-multilib-global-post_src_compile -u } # @FUNCTION: qt4-build-multilib_src_test @@ -170,13 +196,15 @@ qt4-build-multilib_src_test() { _qt4-build-multilib_src_test_hookwrap() { debug-print-function "${FUNCNAME}" "$@" local S="${BUILD_DIR}" - ehook_fire qt4-build-multilib-pre_src_test && \ + ehook_fire qt4-build-multilib-per-abi-pre_src_test && \ qt4-build_src_test "$@" - ehook_fire qt4-build-multilib-post_src_test -u + ehook_fire qt4-build-multilib-per-abi-post_src_test -u } - - multilib_parallel_foreach_abi run_in_build_dir \ - qt4-build-multilib_src_test_hookwrap "$@" + + ehook_fire qt4-build-multilib-global-pre_src_test && \ + multilib_parallel_foreach_abi run_in_build_dir \ + qt4-build-multilib_src_test_hookwrap "$@" + ehook_fire qt4-build-multilib-global-post_src_test -u } # @FUNCTION: qt4-build-multilib_src_install @@ -188,7 +216,7 @@ qt4-build-multilib_src_install() { _qt4-build-multilib_secure_install() { debug-print-function "${FUNCNAME}" "$@" local S="${BUILD_DIR}" - if ehook_fire qt4-build-multilib-pre_src_install ; then + if ehook_fire qt4-build-multilib-per-abi-pre_src_install ; then # kludge: other ABI's leave this file around and it gets # appended to and then installed, leading to a header- @@ -201,7 +229,7 @@ qt4-build-multilib_src_install() { qt4-build_src_install "${@}" fi - ehook_fire qt4-build-multilib-post_src_install -u + ehook_fire qt4-build-multilib-per-abi-post_src_install -u # Do multilib magic only when >1 ABI is used. if [[ ${#MULTIBUILD_VARIANTS[@]} -gt 1 ]]; then multilib_prepare_wrappers @@ -209,10 +237,14 @@ qt4-build-multilib_src_install() { multilib_check_headers fi } - multilib_foreach_abi run_in_build_dir \ - _qt4-build-multilib_secure_install "$@" - # merge the wrappers - multilib_install_wrappers + + if ehook_fire qt4-build-multilib-global-pre_src_install ; then + multilib_foreach_abi run_in_build_dir \ + _qt4-build-multilib_secure_install "$@" + # merge the wrappers + multilib_install_wrappers + fi + ehook_fire qt4-build-multilib-global-post_src_install -u } # @FUNCTION: qt4-build-multilib_pkg_postinst @@ -220,7 +252,9 @@ qt4-build-multilib_src_install() { # Regenerate configuration when the package is installed. qt4-build-multilib_pkg_postinst() { debug-print-function "${FUNCNAME}" "$@" - qt4-build_pkg_postinst "$@" + ehook_fire qt4-build-multilib-global-pre_pkg_postinst && \ + qt4-build_pkg_postinst "$@" + ehook_fire qt4-build-multilib-global-post_pkg_postinst -u } # @FUNCTION: qt4-build-multilib_pkg_postrm @@ -228,7 +262,9 @@ qt4-build-multilib_pkg_postinst() { # Regenerate configuration when the package is completely removed. qt4-build-multilib_pkg_postrm() { debug-print-function "${FUNCNAME}" "$@" - qt4-build_pkg_postrm "$@" + ehook_fire qt4-build-multilib-global-pre_pkg_postinst && \ + qt4-build_pkg_postrm "$@" + ehook_fire qt4-build-multilib-global-post_pkg_postrm -u } EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_postrm pkg_postinst |