Re: [gentoo-dev] [PATCH v2 1/3] ecm.eclass: New eclass
> > --- /dev/null > +++ b/eclass/ecm.eclass > @@ -0,0 +1,639 @@ > +# Copyright 1999-2019 Gentoo Authors > +# Distributed under the terms of the GNU General Public License v2 > + > +# @ECLASS: ecm.eclass > +# @MAINTAINER: > +# k...@gentoo.org > +# @SUPPORTED_EAPIS: 7 > +# @BLURB: Support eclass for packages that use KDE Frameworks with ECM. > +# @DESCRIPTION: > +# This eclass is intended to streamline the creation of ebuilds for packages > +# that use cmake and KDE Frameworks' extra-cmake-modules, thereby following > +# some of their packaging conventions. It is primarily intended for the tree s/tree/three/ > +# upstream release groups (Frameworks, Plasma, Applications) but also for any > +# other package that follows similar conventions. > +# > +# This eclass unconditionally inherits cmake-utils.eclass and all its public > +# variables and helper functions (not phase functions) may be considered as > part > +# of this eclass's API. > +# > +# This eclass's phase functions are not intended to be mixed and matched, so > if > +# any phase functions are overridden the version here should also be called. > +# > +# Porting from kde5.class > +# - Convert all add_*_dep dependency functions to regular dependencies > +# - Manually set LICENSE > +# - Manually set SLOT > +# - Rename vars and function names as needed, see kde5.eclass PORTING > comments > +# - Instead of FRAMEWORKS_MINIMAL, define KFMIN in ebuilds and use it for > deps > + > +if [[ -z ${_ECM_UTILS_ECLASS} ]]; then > +_ECM_UTILS_ECLASS=1 > + > +# @ECLASS-VARIABLE: VIRTUALX_REQUIRED > +# @DESCRIPTION: > +# For proper description see virtualx.eclass manpage. > +# Here we redefine default value to be manual, if your package needs virtualx > +# for tests you should proceed with setting VIRTUALX_REQUIRED=test. > +: ${VIRTUALX_REQUIRED:=manual} > + > +inherit cmake-utils flag-o-matic toolchain-funcs virtualx xdg > + > +case ${EAPI} in > + 7) ;; > + *) die "EAPI=${EAPI:-0} is not supported" ;; > +esac > + > +if [[ -v KDE_GCC_MINIMAL ]]; then > + EXPORT_FUNCTIONS pkg_pretend > +fi > + > +EXPORT_FUNCTIONS pkg_setup src_prepare src_configure src_test pkg_preinst > pkg_postinst pkg_postrm > + > +# @ECLASS-VARIABLE: ECM_KDEINSTALLDIRS > +# @DESCRIPTION: > +# Assume the package is using KDEInstallDirs macro and switch > +# KDE_INSTALL_USE_QT_SYS_PATHS to ON. If set to "false", do nothing. > +: ${ECM_KDEINSTALLDIRS:=true} > + > +# @ECLASS-VARIABLE: ECM_NONGUI > +# @DEFAULT_UNSET > +# @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. > +if [[ ${CATEGORY} = kde-frameworks ]]; then > + : ${ECM_NONGUI:=true} > +fi > +: ${ECM_NONGUI:=false} > + > +# @ECLASS-VARIABLE: ECM_DEBUG > +# @DESCRIPTION: > +# Add "debug" to IUSE. If !debug, add -DNDEBUG (via > cmake-utils_src_configure) > +# and -DQT_NO_DEBUG to CPPFLAGS. If set to "false", do nothing. > +: ${ECM_DEBUG:=true} > + > +# @ECLASS-VARIABLE: ECM_DESIGNERPLUGIN > +# @DESCRIPTION: > +# If set to "true", add "designer" to IUSE to toggle build of designer > plugins > +# and add the necessary BDEPEND. If set to "false", do nothing. > +: ${ECM_DESIGNERPLUGIN:=false} > + > +# @ECLASS-VARIABLE: ECM_EXAMPLES > +# @DESCRIPTION: > +# By default unconditionally ignore a top-level examples subdirectory. > +# If set to "true", add "examples" to IUSE to toggle adding that > subdirectory. > +: ${ECM_EXAMPLES:=false} > + > +# @ECLASS-VARIABLE: ECM_HANDBOOK > +# @DESCRIPTION: > +# Will accept "true", "false", "optional", "forceoptional". If set to > "false", > +# do nothing. > +# Otherwise, add "+handbook" to IUSE, add the appropriate dependency, and let > +# KF5DocTools generate and install the handbook from docbook file(s) found in > +# ECM_HANDBOOK_DIR. However if !handbook, disable build of ECM_HANDBOOK_DIR > +# in CMakeLists.txt. > +# If set to "optional", build with > -DCMAKE_DISABLE_FIND_PACKAGE_KF5DocTools=ON > +# when !handbook. In case package requires KF5KDELibs4Support, see next: > +# If set to "forceoptional", remove a KF5DocTools dependency from the root > +# CMakeLists.txt in addition to the above. > +: ${ECM_HANDBOOK:=false} > + > +# @ECLASS-VARIABLE: ECM_HANDBOOK_DIR > +# @DESCRIPTION: > +# Specifies the directory containing the docbook file(s) relative to ${S} to > +# be processed by KF5DocTools (kdoctools_install). > +: ${ECM_HANDBOOK_DIR:=doc} > + > +# @ECLASS-VARIABLE: ECM_PO_DIRS > +# @DESCRIPTION: > +# Specifies directories of l10n files relative to ${S} to be processed by > +# KF5I18n (ki18n_install). If IUSE nls exists and is disabled then disable > +# build of these directories in CMakeLists.txt. > +: ${ECM_PO_DIRS:="po poqm"} > + > +# @ECLASS-VARIABLE: ECM_QTHELP > +# @DEFAULT_UNSET > +# @DESCRIPTION: > +# Default value for all CATEGOR
Re: [gentoo-dev] [PATCH v2 1/3] ecm.eclass: New eclass
--- /dev/null +++ b/eclass/ecm.eclass @@ -0,0 +1,639 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: ecm.eclass +# @MAINTAINER: +# k...@gentoo.org +# @SUPPORTED_EAPIS: 7 +# @BLURB: Support eclass for packages that use KDE Frameworks with ECM. +# @DESCRIPTION: +# This eclass is intended to streamline the creation of ebuilds for packages +# that use cmake and KDE Frameworks' extra-cmake-modules, thereby following +# some of their packaging conventions. It is primarily intended for the tree +# upstream release groups (Frameworks, Plasma, Applications) but also for any +# other package that follows similar conventions. +# +# This eclass unconditionally inherits cmake-utils.eclass and all its public +# variables and helper functions (not phase functions) may be considered as part +# of this eclass's API. +# +# This eclass's phase functions are not intended to be mixed and matched, so if +# any phase functions are overridden the version here should also be called. +# +# Porting from kde5.class +# - Convert all add_*_dep dependency functions to regular dependencies +# - Manually set LICENSE +# - Manually set SLOT +# - Rename vars and function names as needed, see kde5.eclass PORTING comments +# - Instead of FRAMEWORKS_MINIMAL, define KFMIN in ebuilds and use it for deps + +if [[ -z ${_ECM_UTILS_ECLASS} ]]; then +_ECM_UTILS_ECLASS=1 + +# @ECLASS-VARIABLE: VIRTUALX_REQUIRED +# @DESCRIPTION: +# For proper description see virtualx.eclass manpage. +# Here we redefine default value to be manual, if your package needs virtualx +# for tests you should proceed with setting VIRTUALX_REQUIRED=test. +: ${VIRTUALX_REQUIRED:=manual} + +inherit cmake-utils flag-o-matic toolchain-funcs virtualx xdg + +case ${EAPI} in + 7) ;; + *) die "EAPI=${EAPI:-0} is not supported" ;; +esac + +if [[ -v KDE_GCC_MINIMAL ]]; then + EXPORT_FUNCTIONS pkg_pretend +fi + +EXPORT_FUNCTIONS pkg_setup src_prepare src_configure src_test pkg_preinst pkg_postinst pkg_postrm + +# @ECLASS-VARIABLE: ECM_KDEINSTALLDIRS +# @DESCRIPTION: +# Assume the package is using KDEInstallDirs macro and switch +# KDE_INSTALL_USE_QT_SYS_PATHS to ON. If set to "false", do nothing. +: ${ECM_KDEINSTALLDIRS:=true} + +# @ECLASS-VARIABLE: ECM_NONGUI +# @DEFAULT_UNSET +# @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. +if [[ ${CATEGORY} = kde-frameworks ]]; then + : ${ECM_NONGUI:=true} +fi +: ${ECM_NONGUI:=false} + +# @ECLASS-VARIABLE: ECM_DEBUG +# @DESCRIPTION: +# Add "debug" to IUSE. If !debug, add -DNDEBUG (via cmake-utils_src_configure) +# and -DQT_NO_DEBUG to CPPFLAGS. If set to "false", do nothing. +: ${ECM_DEBUG:=true} + +# @ECLASS-VARIABLE: ECM_DESIGNERPLUGIN +# @DESCRIPTION: +# If set to "true", add "designer" to IUSE to toggle build of designer plugins +# and add the necessary BDEPEND. If set to "false", do nothing. +: ${ECM_DESIGNERPLUGIN:=false} + +# @ECLASS-VARIABLE: ECM_EXAMPLES +# @DESCRIPTION: +# By default unconditionally ignore a top-level examples subdirectory. +# If set to "true", add "examples" to IUSE to toggle adding that subdirectory. +: ${ECM_EXAMPLES:=false} + +# @ECLASS-VARIABLE: ECM_HANDBOOK +# @DESCRIPTION: +# Will accept "true", "false", "optional", "forceoptional". If set to "false", +# do nothing. +# Otherwise, add "+handbook" to IUSE, add the appropriate dependency, and let +# KF5DocTools generate and install the handbook from docbook file(s) found in +# ECM_HANDBOOK_DIR. However if !handbook, disable build of ECM_HANDBOOK_DIR +# in CMakeLists.txt. +# If set to "optional", build with -DCMAKE_DISABLE_FIND_PACKAGE_KF5DocTools=ON +# when !handbook. In case package requires KF5KDELibs4Support, see next: +# If set to "forceoptional", remove a KF5DocTools dependency from the root +# CMakeLists.txt in addition to the above. +: ${ECM_HANDBOOK:=false} + +# @ECLASS-VARIABLE: ECM_HANDBOOK_DIR +# @DESCRIPTION: +# Specifies the directory containing the docbook file(s) relative to ${S} to +# be processed by KF5DocTools (kdoctools_install). +: ${ECM_HANDBOOK_DIR:=doc} + +# @ECLASS-VARIABLE: ECM_PO_DIRS +# @DESCRIPTION: +# Specifies directories of l10n files relative to ${S} to be processed by +# KF5I18n (ki18n_install). If IUSE nls exists and is disabled then disable +# build of these directories in CMakeLists.txt. +: ${ECM_PO_DIRS:="po poqm"} + +# @ECLASS-VARIABLE: ECM_QTHELP +# @DEFAULT_UNSET +# @DESCRIPTION: +# Default value for all CATEGORIES except kde-frameworks is "false". +# If set to "true", add "doc" to IUSE, add the appropriate dependency, let +# -DBUILD_QCH=ON generate and install Qt compressed help files when USE=doc. +# If set to "false", do nothing. +if [[ ${CATEGORY} = kde-frameworks ]]; then +