diff options
author | Andreas Sturmlechner <asturm@gentoo.org> | 2024-08-11 23:38:25 +0200 |
---|---|---|
committer | Andreas Sturmlechner <asturm@gentoo.org> | 2024-08-21 23:07:42 +0200 |
commit | 5ef231336f33159d8f0876e9ff6da71fc514faef (patch) | |
tree | 089b1a6934b87c3847aef6b8b259af737379f77b /eclass | |
parent | ecm.eclass: Add ecm_punt_po_install() (diff) | |
download | gentoo-5ef231336f33159d8f0876e9ff6da71fc514faef.tar.gz gentoo-5ef231336f33159d8f0876e9ff6da71fc514faef.tar.bz2 gentoo-5ef231336f33159d8f0876e9ff6da71fc514faef.zip |
ecm.eclass: Add ECM_HANDBOOK="forceoff"
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/ecm.eclass | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/eclass/ecm.eclass b/eclass/ecm.eclass index 5876e464c8d8..a7e4b24fa585 100644 --- a/eclass/ecm.eclass +++ b/eclass/ecm.eclass @@ -84,8 +84,8 @@ fi # @ECLASS_VARIABLE: ECM_HANDBOOK # @DESCRIPTION: -# Will accept "true", "false", "optional", "forceoptional". If set to "false", -# do nothing. +# Will accept "true", "false", "optional", "forceoptional", "forceoff". +# If set to "false" (default), do nothing. # Otherwise, add "+handbook" to IUSE, add the appropriate dependency, and let # KF${_KFSLOT}DocTools generate and install the handbook from docbook file(s) # found in ECM_HANDBOOK_DIR. However if !handbook, disable build of @@ -233,7 +233,7 @@ case ${ECM_HANDBOOK} in IUSE+=" +handbook" BDEPEND+=" handbook? ( >=kde-frameworks/kdoctools-${KFMIN}:${_KFSLOT} )" ;; - false) ;; + false|forceoff) ;; *) eerror "Unknown value for \${ECM_HANDBOOK}" die "Value ${ECM_HANDBOOK} is not supported" @@ -446,13 +446,22 @@ ecm_punt_bogus_dep() { fi } +# @FUNCTION: _ecm_punt_kdoctools_install +# @INTERNAL +# @DESCRIPTION: +# Disables kdoctools_install(po) call. +_ecm_punt_kdoctools_install() { + sed -e "s/^ *kdoctools_install.*(po.*)/#& # disabled by ecm.eclass/" \ + -i CMakeLists.txt || die +} + # @FUNCTION: ecm_punt_po_install # @DESCRIPTION: -# Disables handling of a po subdirectory, typically when the package +# Disables handling of po subdirectories, typically when the package # is outsourcing common files to a ${PN}-common split package. ecm_punt_po_install() { - sed -e "s/^ki18n_install.*(po.*)/#& # disabled by ecm.eclass/" \ - -e "s/^kdoctools_install.*(po.*)/#& # disabled by ecm.eclass/" \ + _ecm_punt_kdoctools_install + sed -e "s/^ *ki18n_install.*(po.*)/#& # disabled by ecm.eclass/" \ -i CMakeLists.txt || die } @@ -488,13 +497,16 @@ ecm_src_prepare() { fi # only enable handbook when required - if in_iuse handbook && ! use handbook ; then + if [[ ${ECM_HANDBOOK} == forceoff ]] || + { [[ ${ECM_HANDBOOK} = forceoptional ]] && in_iuse handbook && ! use handbook; } + then + ecm_punt_kf_module DocTools + _ecm_punt_kdoctools_install + fi + if [[ ${ECM_HANDBOOK} == forceoff ]] || + { in_iuse handbook && ! use handbook; } + then cmake_comment_add_subdirectory ${ECM_HANDBOOK_DIR} - - if [[ ${ECM_HANDBOOK} = forceoptional ]] ; then - ecm_punt_kf_module DocTools - sed -i -e "/kdoctools_install/I s/^/#DONT/" CMakeLists.txt || die - fi fi # drop translations when nls is not wanted |