From 88f8639b690acafec78f665172934aca50b45c6b Mon Sep 17 00:00:00 2001 From: Andreas Sturmlechner Date: Fri, 6 Dec 2024 19:46:07 +0100 Subject: ecm.eclass: Add ECM_PYTHON_BINDINGS to (so far only) disable those See also: https://invent.kde.org/teams/goals/streamlined-application-development-experience/-/issues/9 Signed-off-by: Andreas Sturmlechner --- eclass/ecm.eclass | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'eclass') diff --git a/eclass/ecm.eclass b/eclass/ecm.eclass index e6d1bf9c40a8..21e2330ac34d 100644 --- a/eclass/ecm.eclass +++ b/eclass/ecm.eclass @@ -116,6 +116,14 @@ else ECM_PO_DIRS=( po poqm ) fi +# @ECLASS_VARIABLE: ECM_PYTHON_BINDINGS +# @DESCRIPTION: +# Default value is "false", which means do nothing. +# If set to "off", pass -DBUILD_PYTHON_BINDINGS=OFF to mycmakeargs, and also +# disable cmake finding Python3, PySide6 and Shiboken6 to make it quiet. +# No other value is implemented as python bindings are not supported in Gentoo. +: "${ECM_PYTHON_BINDINGS:=false}" + # @ECLASS_VARIABLE: ECM_QTHELP # @DEFAULT_UNSET # @DESCRIPTION: @@ -254,6 +262,15 @@ case ${ECM_HANDBOOK} in ;; esac +case ${ECM_PYTHON_BINDINGS} in + off|false) ;; + true) ;& # TODO if you really really want + *) + eerror "Unknown value for \${ECM_PYTHON_BINDINGS}" + die "Value ${ECM_PYTHON_BINDINGS} is not supported" + ;; +esac + case ${ECM_QTHELP} in true) IUSE+=" doc" @@ -610,6 +627,13 @@ ecm_src_configure() { cmakeargs+=( -DBUILD_DESIGNERPLUGIN=$(usex designer) ) fi + if [[ ${ECM_PYTHON_BINDINGS} == off ]]; then + cmakeargs+=( + -DBUILD_PYTHON_BINDINGS=OFF + -DCMAKE_DISABLE_FIND_PACKAGE_{Python3,PySide6,Shiboken6}=ON + ) + fi + if [[ ${ECM_QTHELP} = true ]]; then cmakeargs+=( -DBUILD_QCH=$(usex doc) ) fi -- cgit v1.2.3-65-gdbad