ecm.eclass
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.
Exported Phases
- 
            
pkg_setup - 
            
pkg_postrm - 
            
pkg_preinst - 
            
pkg_postinst - 
            
src_compile - 
            
src_test - 
            
src_install - 
            
src_prepare - 
            
src_configure - 
            
pkg_pretend 
Functions
- ecm_punt_kf_module <modulename>
 - 
            
Removes a Frameworks (KF - matching any single-digit version) module from a
find_packagecall with multiple components. - ecm_punt_qt_module <modulename>
 - 
            
Removes a Qt (matching any single-digit version) module from a
find_packagecall with multiple components. - ecm_punt_bogus_dep <dependency> or <prefix> <dependency>
 - 
            
Removes a specified dependency from a
find_packagecall, optionally supports prefix forfind_packagewith multiple components. - ecm_pkg_pretend
 - 
            
Checks if the active compiler meets the minimum version requirements. phase function is only exported if
KDE_GCC_MINIMALis defined. - ecm_pkg_setup
 - 
            
Checks if the active compiler meets the minimum version requirements.
 - ecm_src_prepare
 - 
            
Wrapper for
cmake_src_preparewith lots of extra logic for magic handling of linguas, tests, handbook etc. - ecm_src_configure
 - 
            
Wrapper for
cmake_src_configurewith 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_testwith extra logic for magic handling of dbus and virtualx. - ecm_src_install
 - 
            
Wrapper for
cmake_src_install. Drops executable bit from.desktopfiles installed inside/usr/share/applications. This is set by cmake wheninstall()is called inPROGRAMform, as seen in many kde.org projects. - ecm_pkg_preinst
 - 
            
Sets up environment variables required in
ecm_pkg_postinst. - ecm_pkg_postinst
 - 
            
Updates the various XDG caches (icon, desktop, mime) if necessary.
 - ecm_pkg_postrm
 - 
            
Updates the various XDG caches (icon, desktop, mime) if necessary.
 
Variables
- VIRTUALX_REQUIRED ?= manual
 - 
            
For proper description see
virtualx.eclassmanpage. Here we redefine default value to be manual, if your package needsvirtualxfor tests you should proceed with settingVIRTUALX_REQUIRED=test. - ECM_NONGUI
 - 
            
By default, for all CATEGORIES except
kde-frameworks, assume we are building a GUI application. Add dependency onkde-frameworks/breeze-iconsorkde-frameworks/oxygen-iconsand run thexdg.eclassroutines forpkg_preinst,pkg_postinstandpkg_postrm. If set totrue, do nothing. - ECM_KDEINSTALLDIRS ?= true
 - 
            
Assume the package is using
KDEInstallDirsmacro and switchKDE_INSTALL_USE_QT_SYS_PATHStoON. If set tofalse, do nothing. - ECM_DEBUG ?= true
 - 
            
Add
debugtoIUSE. If!debug, add-DQT_NO_DEBUGtoCPPFLAGS. If set tofalse, do nothing. - ECM_DESIGNERPLUGIN ?= false
 - 
            
If set to
true, adddesignertoIUSEto toggle build of designer plugins and add the necessaryBDEPEND. If set tofalse, do nothing. - ECM_EXAMPLES ?= false
 - 
            
By default unconditionally ignore a top-level examples subdirectory. If set to
true, addexamplestoIUSEto toggle adding that subdirectory. - ECM_HANDBOOK ?= false
 - 
            
Will accept
true,false,optional,forceoptional. If set tofalse, do nothing.Otherwise, add
+handbooktoIUSE, add the appropriate dependency, and letKF5DocToolsgenerate and install the handbook from docbook file(s) found inECM_HANDBOOK_DIR. However if!handbook, disable build ofECM_HANDBOOK_DIRinCMakeLists.txt.If set to
optional, build with-DCMAKE_DISABLE_FIND_PACKAGE_KF5DocTools=ONwhen!handbook. In case package requiresKF5KDELibs4Support, see next: If set toforceoptional, remove aKF5DocToolsdependency from the rootCMakeLists.txtin addition to the above. - ECM_HANDBOOK_DIR ?= doc
 - 
            
Specifies the directory containing the docbook file(s) relative to
${S}to be processed byKF5DocTools(kdoctools_install). - ECM_PO_DIRS ?= "po poqm"
 - 
            
Specifies directories of
l10nfiles relative to${S}to be processed byKF5I18n(ki18n_install). IfIUSE nlsexists and is disabled then disable build of these directories inCMakeLists.txt. - ECM_QTHELP
 - 
            
Default value for all CATEGORIES except
kde-frameworksisfalse. If set totrue, adddoctoIUSE, add the appropriate dependency, let-DBUILD_QCH=ONgenerate and install Qt compressed help files whenUSE=doc. If set tofalse, do nothing. - ECM_TEST
 - 
            
Will accept
true,false,optional,forceoptional,forceoptional-recursive.Default value is
false, except forCATEGORY=kde-frameworkswhere it is set totrue. If set tofalse, do nothing.For any other value, add
testtoIUSEandDEPENDondev-qt/qttest:5. If set tooptional, build with-DCMAKE_DISABLE_FIND_PACKAGE_Qt5Test=ONwhenUSE=!test.If set to
forceoptional, puntQt5Testdependency and ignoreautotests,test,testssubdirs from top-levelCMakeLists.txtwhenUSE=!test.If set to
forceoptional-recursive, puntQt5Testdependencies and makeautotest(s),unittest(s)andtest(s)subdirs from anyCMakeLists.txtin${S}and below conditional onBUILD_TESTINGwhenUSE=!test. This is always meant as a short-term fix and creates${T}/${P}-tests-optional.patchto refine and submit upstream. - KFMIN
 - 
            
Minimum version of Frameworks to require. Default value for kde-frameworks is
${PV}and 5.64.0 baseline for everything else. This is not going to be changed unless we also bump EAPI, which usually implies (rev-)bumping. Version will later be used to differentiate between KF5/Qt5 and KF6/Qt6. - KDE_GCC_MINIMAL
 - 
            
Minimum version of active GCC to require. This is checked in
ecm_pkg_pretendandecm_pkg_setup. 
Reporting Bugs
Please report bugs via https://bugs.gentoo.org/