diff options
| author | Andreas Sturmlechner <asturm@gentoo.org> | 2024-12-13 00:08:35 +0100 |
|---|---|---|
| committer | Andreas Sturmlechner <asturm@gentoo.org> | 2024-12-14 22:32:35 +0100 |
| commit | 67b745829deb9b52ba81bc4aa38316026699866d (patch) | |
| tree | 0232389454b8717387d171b34ba9cc5dc6721473 /eclass | |
| parent | 48b7f12f876ed43257b8e74358945983a566e1de (diff) | |
| download | kde-67b745829deb9b52ba81bc4aa38316026699866d.tar.gz kde-67b745829deb9b52ba81bc4aa38316026699866d.tar.bz2 kde-67b745829deb9b52ba81bc4aa38316026699866d.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 d15cf81087b..7c0ba85b03a 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 |
