diff options
author | Andreas Sturmlechner <asturm@gentoo.org> | 2024-12-13 00:08:35 +0100 |
---|---|---|
committer | Andreas Sturmlechner <asturm@gentoo.org> | 2024-12-16 23:27:21 +0100 |
commit | 9343624aef84ec9ef469bc567df37d5f347db3e7 (patch) | |
tree | e14a8997aaf66b3d711460bfe020acf9edb3e4f2 /eclass | |
parent | ecm.eclass: Force ECM_NONGUI=true on CATEGORY=kde-frameworks (diff) | |
download | gentoo-9343624aef84ec9ef469bc567df37d5f347db3e7.tar.gz gentoo-9343624aef84ec9ef469bc567df37d5f347db3e7.tar.bz2 gentoo-9343624aef84ec9ef469bc567df37d5f347db3e7.zip |
ecm.eclass: Unexporting phase functions run by xdg.eclass
Starts with consumers requesting >=KFMIN-6.9.0.
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/ecm.eclass | 57 |
1 files changed, 35 insertions, 22 deletions
diff --git a/eclass/ecm.eclass b/eclass/ecm.eclass index 56d3664d2c73..643ae2857bee 100644 --- a/eclass/ecm.eclass +++ b/eclass/ecm.eclass @@ -46,17 +46,13 @@ fi # @DESCRIPTION: # By default, for all CATEGORIES except kde-frameworks, assume we are building # a GUI application. Add dependency on kde-frameworks/breeze-icons or -# kde-frameworks/oxygen-icons and run the xdg.eclass routines for pkg_preinst, -# pkg_postinst and pkg_postrm. If set to "true", do nothing. +# kde-frameworks/oxygen-icons. With KFMIN lower than 6.9.0, inherit xdg.eclass, +# run pkg_preinst, pkg_postinst and pkg_postrm. If set to "true", do nothing. : "${ECM_NONGUI:=false}" if [[ ${CATEGORY} == kde-frameworks ]]; then ECM_NONGUI=true fi -if [[ ${ECM_NONGUI} = false ]] ; then - inherit xdg -fi - # @ECLASS_VARIABLE: ECM_KDEINSTALLDIRS # @DESCRIPTION: # Assume the package is using KDEInstallDirs macro and switch @@ -180,6 +176,10 @@ if [[ ${CATEGORY} = kde-frameworks ]]; then fi : "${KFMIN:=5.116.0}" +if ver_test ${KFMIN} -lt 6.9 && [[ ${ECM_NONGUI} == false ]]; then + inherit xdg +fi + # @ECLASS_VARIABLE: _KFSLOT # @INTERNAL # @DESCRIPTION: @@ -759,46 +759,59 @@ ecm_src_install() { done } +if [[ ${EAPI} == 8 ]]; then +# @FUNCTION: _ecm_nongui_deprecated +# @INTERNAL +# @DESCRIPTION: +# Carryall for ecm_pkg_preinst, ecm_pkg_postinst and ecm_pkg_postrm. +_ecm_nongui_deprecated() { + if ver_test ${KFMIN} -ge 6.9; then + eqawarn "QA notice: ecm_pkg_${1} has become a no-op." + eqawarn "It is no longer being exported with KFMIN >=6.9.0." + else + case ${ECM_NONGUI} in + false) xdg_pkg_${1} ;; + *) ;; + esac + fi +} + # @FUNCTION: ecm_pkg_preinst # @DESCRIPTION: # Sets up environment variables required in ecm_pkg_postinst. +# Phase function is only exported if KFMIN is <6.9.0. ecm_pkg_preinst() { debug-print-function ${FUNCNAME} "$@" - - case ${ECM_NONGUI} in - false) xdg_pkg_preinst ;; - *) ;; - esac + _ecm_nongui_deprecated preinst } # @FUNCTION: ecm_pkg_postinst # @DESCRIPTION: # Updates the various XDG caches (icon, desktop, mime) if necessary. +# Phase function is only exported if KFMIN is <6.9.0. ecm_pkg_postinst() { debug-print-function ${FUNCNAME} "$@" - - case ${ECM_NONGUI} in - false) xdg_pkg_postinst ;; - *) ;; - esac + _ecm_nongui_deprecated postinst } # @FUNCTION: ecm_pkg_postrm # @DESCRIPTION: # Updates the various XDG caches (icon, desktop, mime) if necessary. +# Phase function is only exported if KFMIN is <6.9.0. ecm_pkg_postrm() { debug-print-function ${FUNCNAME} "$@" - - case ${ECM_NONGUI} in - false) xdg_pkg_postrm ;; - *) ;; - esac + _ecm_nongui_deprecated postrm } +fi + +fi +if ver_test ${KFMIN} -lt 6.9; then + EXPORT_FUNCTIONS pkg_preinst pkg_postinst pkg_postrm fi if [[ -v ${KDE_GCC_MINIMAL} ]]; then EXPORT_FUNCTIONS pkg_pretend fi -EXPORT_FUNCTIONS pkg_setup src_prepare src_configure src_test src_install pkg_preinst pkg_postinst pkg_postrm +EXPORT_FUNCTIONS pkg_setup src_prepare src_configure src_test src_install |