[PATCH 1/3] qt-utils.eclass: Introduce new "qt_"-prefixed query functions
Andreas Sturmlechner <[email protected]> Wed, 08 Jul 2026 21:48:35 +0200
| Newsgroups | gmane.linux.gentoo.devel |
|---|---|
| Message-ID | <[email protected]> |
--nextPartCdJ_-CLvR_CQlH0ijQauLQ Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8"; protected-headers="v1" From: Andreas Sturmlechner <[email protected]> To: [email protected], [email protected] Date: Wed, 08 Jul 2026 21:48:35 +0200 Message-ID: <[email protected]> MIME-Version: 1.0 Consistently *don't* prepend EPREFIX or similar to paths in these functions New function qt_get_archdatadir, which echoes /usr/$(get_libdir)/qt<qt_maj_ver> Signed-off-by: Andreas Sturmlechner <[email protected]> --- eclass/qt-utils.eclass | 77 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 72 insertions(+), 5 deletions(-) diff --git a/eclass/qt-utils.eclass b/eclass/qt-utils.eclass index e340d76329f0..97de2a4ca741 100644 --- a/eclass/qt-utils.eclass +++ b/eclass/qt-utils.eclass @@ -22,19 +22,86 @@ case ${EAPI} in *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac +# @FUNCTION: _qt_get_check_func_call +# @INTERNAL +# @DESCRIPTION: +# Checks parameters for validity. +_qt_get_check_func_call() { + [[ -z ${1} ]] && die "${FUNCNAME[1]}: must be passed exactly one argument" + case "${1}" in + 6) ;; + *) die "${FUNCNAME[1]}: Qt ${1} is not supported" ;; + esac +} + +# @FUNCTION: qt_get_archdatadir +# @USAGE: <qt_maj_ver> +# @DESCRIPTION: +# Echoes the base directory beneath which Qt binaries, modules, plugins, ... +# are installed. +qt_get_archdatadir() { + _qt_get_check_func_call "$@" + echo "/usr/$(get_libdir)/qt${1}" +} + +# @FUNCTION: qt_get_bindir +# @USAGE: <qt_maj_ver> +# @DESCRIPTION: +# Echoes the directory where Qt binaries are installed. +qt_get_bindir() { + _qt_get_check_func_call "$@" + echo "$(qt_get_archdatadir 6)/bin" +} + +# @FUNCTION: qt_get_headerdir +# @USAGE: <qt_maj_ver> +# @DESCRIPTION: +# Echoes the directory where Qt headers are installed. +qt_get_headerdir() { + _qt_get_check_func_call "$@" + echo "/usr/include/qt${1}" +} + +# @FUNCTION: qt_get_libexecdir +# @USAGE: <qt_maj_ver> +# @DESCRIPTION: +# Echoes the directory where Qt libexec bins are installed. +qt_get_libexecdir() { + _qt_get_check_func_call "$@" + echo "$(qt_get_archdatadir 6)/libexec" +} + +# @FUNCTION: qt_get_mkspecsdir +# @USAGE: <qt_maj_ver> +# @DESCRIPTION: +# Echoes the directory where Qt mkspecs are installed. +qt_get_mkspecsdir() { + _qt_get_check_func_call "$@" + echo "$(qt_get_archdatadir 6)/mkspecs" +} + +# @FUNCTION: qt_get_plugindir +# @USAGE: <qt_maj_ver> +# @DESCRIPTION: +# Echoes the directory where Qt plugins are installed. +qt_get_plugindir() { + _qt_get_check_func_call "$@" + echo "$(qt_get_archdatadir 6)/plugins" +} + # @FUNCTION: qt6_get_bindir # @DESCRIPTION: # Echoes the directory where Qt6 binaries are installed. # EPREFIX is already prepended to the returned path. qt6_get_bindir() { - echo "${EPREFIX}$(qt6_get_libdir)/qt6/bin" + qt_get_bindir 6 } # @FUNCTION: qt6_get_headerdir # @DESCRIPTION: # Echoes the directory where Qt6 headers are installed. qt6_get_headerdir() { - echo "/usr/include/qt6" + qt_get_headerdir 6 } # @FUNCTION: qt6_get_libdir @@ -48,21 +115,21 @@ qt6_get_libdir() { # @DESCRIPTION: # Echoes the directory where Qt6 libexec bins are installed. qt6_get_libexecdir() { - echo "$(qt6_get_libdir)/qt6/libexec" + qt_get_libexecdir 6 } # @FUNCTION: qt6_get_mkspecsdir # @DESCRIPTION: # Echoes the directory where Qt6 mkspecs are installed. qt6_get_mkspecsdir() { - echo "$(qt6_get_libdir)/qt6/mkspecs" + qt_get_mkspecsdir 6 } # @FUNCTION: qt6_get_plugindir # @DESCRIPTION: # Echoes the directory where Qt6 plugins are installed. qt6_get_plugindir() { - echo "$(qt6_get_libdir)/qt6/plugins" + qt_get_plugindir 6 } fi -- 2.55.0 --nextPartCdJ_-CLvR_CQlH0ijQauLQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIvBAABCgCZFiEE34gXUSooizdYNDu3S5FW4z0PgBkFAmpOqZMbFIAAAAAABAAO bWFudTIsMi41KzEuMTIsMiwyXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25z Lm9wZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRERjg4MTc1MTJBMjg4QjM3NTgzNDNC Qjc0QjkxNTZFMzNEMEY4MDE5AAoJEEuRVuM9D4AZ4zoL/jD1XRk+c8P1qNX/T4zY t9PcziNfFpr+nSN4gh3MFRad9axiS0yCC9M6p4GOsxjEr7ksdvp+9md3i79z10B6 qXKQkcHTegfYMIDJTfdsL+w9rriPogoF7jKa9RLKmwtX3t+/NVih+8x/Wqeuvy36 ivcEsemg2u0KX1web/UCO775OmXL5AzDwgSFZMHrgmDeNPHBQjaGfd9Uk6YKnncQ lKd4fZDzkhtEewOAQsCoPilC8drqBbVPvAtkNFqwY6XAfJ0NzxIF0QDX53pWYlFF yctGnAWnnI3QePUES64ZP6Eg1CU6Rn/Loi7hLJGrLj7zDcGMIAaSMMFa+NFSeXXa tsGNQbRRMlhIcmGAlxW5nYw8sGez+nFiVCS2J01IVZMn9Y2Cl9jJYaR5gW6EaTaV KnKGAjGEWrEByWndDpymhPFfftv7js+WfMFJ5IDcLLkyVBT++5kbZDnvPSRtBkW2 ASwWriLc+v2lqRYAk5dg65iT5aXvwwdFRX61ZKf9csD5LA== =hQRk -----END PGP SIGNATURE----- --nextPartCdJ_-CLvR_CQlH0ijQauLQ--