From 9604b7fb093f9b63e68b53077d55573b5800eaa4 Mon Sep 17 00:00:00 2001 From: Andreas Sturmlechner Date: Thu, 7 Jan 2016 18:40:12 +0100 Subject: [PATCH] kde5-functions.eclass: Introduce add_qt_dep for consistent Qt version deps _add_kdecategory_dep -> _add_category_dep --- eclass/kde5-functions.eclass | 37 ++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/eclass/kde5-functions.eclass b/eclass/kde5-functions.eclass index cf1d9fb3d0d3..74a3e2447f07 100644 --- a/eclass/kde5-functions.eclass +++ b/eclass/kde5-functions.eclass @@ -93,11 +93,12 @@ _check_gcc_version() { fi } -# @FUNCTION: _add_kdecategory_dep +# @FUNCTION: _add_category_dep # @INTERNAL # @DESCRIPTION: -# Implementation of add_plasma_dep and add_frameworks_dep. -_add_kdecategory_dep() { +# Implementation of add_plasma_dep, add_frameworks_dep, add_kdeapps_dep, +# and finally, add_qt_dep. +_add_category_dep() { debug-print-function ${FUNCNAME} "$@" local category=${1} @@ -145,7 +146,7 @@ add_frameworks_dep() { version=${FRAMEWORKS_MINIMAL} fi - _add_kdecategory_dep kde-frameworks "${1}" "${2}" "${version}" + _add_category_dep kde-frameworks "${1}" "${2}" "${version}" } # @FUNCTION: add_plasma_dep @@ -171,7 +172,7 @@ add_plasma_dep() { version=${PLASMA_MINIMAL} fi - _add_kdecategory_dep kde-plasma "${1}" "${2}" "${version}" + _add_category_dep kde-plasma "${1}" "${2}" "${version}" } # @FUNCTION: add_kdeapps_dep @@ -202,7 +203,31 @@ add_kdeapps_dep() { fi fi - _add_kdecategory_dep kde-apps "${1}" "${2}" "${version}" + _add_category_dep kde-apps "${1}" "${2}" "${version}" +} + +# @FUNCTION: add_qt_dep +# @USAGE: [USE flags] [minimum version] +# @DESCRIPTION: +# Create proper dependency for dev-qt/ dependencies. +# This takes 1 to 3 arguments. The first being the package name, the optional +# second is additional USE flags to append, and the optional third is the +# version to use instead of the automatic version (use sparingly). +# The output of this should be added directly to DEPEND/RDEPEND, and may be +# wrapped in a USE conditional (but not an || conditional without an extra set +# of parentheses). +add_qt_dep() { + debug-print-function ${FUNCNAME} "$@" + + local version + + if [[ -n ${3} ]]; then + version=${3} + elif [[ -z "${version}" ]] ; then + version=${QT_MINIMAL} + fi + + _add_category_dep dev-qt "${1}" "${2}" "${version}" } # @FUNCTION: get_kde_version -- 2.26.2