ecm.eclass

Name

ecm.eclass -- 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 three upstream release groups (Frameworks, Plasma, Gear) but also for any other package that follows similar conventions.

This eclass unconditionally inherits cmake.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.

Supported EAPIs

8

Transitively Provided Eclasses

  • cmake

  • virtualx

Exported Phases

  • src_compile

  • src_test

  • src_install

  • src_prepare

  • src_configure

Functions

ecm_punt_kf_module <modulename>

Removes a Frameworks (KF - matching any single-digit version) module from a find_package call with multiple components.

ecm_punt_qt_module <modulename>

Removes a Qt (matching any single-digit version) module from a find_package call with multiple components.

ecm_punt_bogus_dep <dependency> or <prefix> <dependency>

Removes a specified dependency from a find_package call, optionally supports prefix for find_package with multiple components.

ecm_punt_po_install

Disables handling of po subdirectories, typically when the package is outsourcing common files to a ${PN}-common split package.

ecm_pkg_pretend

Checks if the active compiler meets the minimum version requirements. Phase function is only exported if KFMIN is <6.9.0 and KDE_GCC_MINIMAL is defined.

ecm_pkg_setup

Checks if the active compiler meets the minimum version requirements. Phase function is only exported if KFMIN is <6.9.0.

ecm_src_prepare

Wrapper for cmake_src_prepare with lots of extra logic for magic handling of linguas, tests, handbook etc.

ecm_src_configure

Wrapper for cmake_src_configure with extra logic for magic handling of handbook, tests etc.

ecm_src_compile

Wrapper for cmake_src_compile. Currently doesn't do anything extra, but is included as part of the API just in case it's needed in the future.

ecm_src_test

Wrapper for cmake_src_test with extra logic for magic handling of dbus and virtualx.

ecm_src_install

Wrapper for cmake_src_install. Drops executable bit from .desktop files installed inside /usr/share/applications. This is set by cmake when install() is called in PROGRAM form, as seen in many kde.org projects. In case kde.org.eclass is detected, in case KDE_ORG_NAME != PN, tries real hard to detect, then rename, metainfo.xml appdata files to something unique including SLOT if else than "0" (basically KDE_ORG_NAME -> PN+SLOT).

ecm_pkg_preinst

Sets up environment variables required in ecm_pkg_postinst. Phase function is only exported if KFMIN is <6.9.0.

ecm_pkg_postinst

Updates the various XDG caches (icon, desktop, mime) if necessary. Phase function is only exported if KFMIN is <6.9.0.

ecm_pkg_postrm

Updates the various XDG caches (icon, desktop, mime) if necessary. Phase function is only exported if KFMIN is <6.9.0.

Variables

CMAKE_ECM_MODE = true

For proper description see cmake.eclass manpage.

VIRTUALX_REQUIRED

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.

ECM_NONGUI

By default, for all CATEGORIES except kde-frameworks, set to "false", which assumes we are building a GUI application, and depend on breeze-icons or oxygen-icons. If set to "true", do nothing.

ECM_DEBUG

Add "debug" to IUSE. If !debug, add -DQT_NO_DEBUG to CPPFLAGS. If set to "false", do nothing.

ECM_DESIGNERPLUGIN

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_EXAMPLES

By default unconditionally ignore a top-level examples subdirectory. If set to "true", add "examples" to IUSE to toggle adding that subdirectory.

ECM_HANDBOOK

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 KF6DocTools 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_KF6DocTools=ON when !handbook. If set to "forceoptional", remove a KF6DocTools dependency from the root CMakeLists.txt in addition to the above.

ECM_HANDBOOK_DIR

Specifies the directory containing the docbook file(s) relative to ${S} to be processed by KF6DocTools (kdoctools_install).

ECM_PO_DIRS (SET BEFORE INHERIT)

Specifies directories of l10n files relative to ${S} to be processed by KF6I18n (ki18n_install). If IUSE nls exists and is disabled then disable build of these directories in CMakeLists.txt.

ECM_PYTHON_BINDINGS

Default value is "false", which means do nothing. If set to "off", pass -DBUILD_PYTHON_BINDINGS=OFF to mycmakeargs. No other value is implemented as python bindings are not supported in Gentoo.

ECM_QTHELP

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.

ECM_REMOVE_FROM_INSTALL

Array of <paths> to remove from install image.

ECM_TEST

Will accept "true", "false" or "forceoptional". Default value is "false", except for CATEGORY=kde-frameworks where it is set to "true". If set to "false", do nothing. For any other value, add "test" to IUSE. If set to "forceoptional", ignore "appiumtests", "autotests", "test", "tests" subdirs from root CMakeLists.txt when USE=!test.

KFMIN (SET BEFORE INHERIT)

Minimum version of Frameworks to require. Default value for kde-frameworks is ${PV} and 6.22.0 baseline for everything else. KF5 is unsupported.

KDE_GCC_MINIMAL

Minimum version of active GCC to require. This is checked in ecm_pkg_pretend and ecm_pkg_setup.

Maintainers

kde@gentoo.org

Reporting Bugs

Please report bugs via https://bugs.gentoo.org/