diff options
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/Manifest.gz | bin | 37646 -> 37641 bytes | |||
-rw-r--r-- | eclass/go-module.eclass | 44 | ||||
-rw-r--r-- | eclass/kde.org.eclass | 2 | ||||
-rw-r--r-- | eclass/qmake-utils.eclass | 59 |
4 files changed, 76 insertions, 29 deletions
diff --git a/eclass/Manifest.gz b/eclass/Manifest.gz Binary files differindex dcb7302303a0..ba5f6e871eae 100644 --- a/eclass/Manifest.gz +++ b/eclass/Manifest.gz diff --git a/eclass/go-module.eclass b/eclass/go-module.eclass index f97b69f591c8..6c58d7f26f07 100644 --- a/eclass/go-module.eclass +++ b/eclass/go-module.eclass @@ -262,7 +262,22 @@ go-module_set_globals() { continue fi - _dir=$(_go-module_gomod_encode "${module}") + # Encode the name(path) of a Golang module in the format expected by Goproxy. + # Upper letters are replaced by their lowercase version with a '!' prefix. + # The transformed result of 'module' is stored in the '_dir' variable. + # + ## Python: + # return re.sub('([A-Z]{1})', r'!\1', s).lower() + ## Sed: + ## This uses GNU Sed extension \l to downcase the match + # echo "${module}" |sed 's,[A-Z],!\l&,g' + local re _dir lower + _dir="${module}" + re='(.*)([A-Z])(.*)' + while [[ ${_dir} =~ ${re} ]]; do + lower='!'"${BASH_REMATCH[2],}" + _dir="${BASH_REMATCH[1]}${lower}${BASH_REMATCH[3]}" + done for _ext in "${exts[@]}" ; do # Relative URI within a GOPROXY for a file @@ -496,33 +511,6 @@ go-module_live_vendor() { popd >& /dev/null || die } -# @FUNCTION: _go-module_gomod_encode -# @DEPRECATED: none -# @DESCRIPTION: -# Encode the name(path) of a Golang module in the format expected by Goproxy. -# -# Upper letters are replaced by their lowercase version with a '!' prefix. -# -_go-module_gomod_encode() { - ## Python: - # return re.sub('([A-Z]{1})', r'!\1', s).lower() - - ## Sed: - ## This uses GNU Sed extension \l to downcase the match - #echo "${module}" |sed 's,[A-Z],!\l&,g' - # - # Bash variant: - debug-print-function "${FUNCNAME}" "$@" - #local re input lower - re='(.*)([A-Z])(.*)' - input="${1}" - while [[ ${input} =~ ${re} ]]; do - lower='!'"${BASH_REMATCH[2],}" - input="${BASH_REMATCH[1]}${lower}${BASH_REMATCH[3]}" - done - echo "${input}" -} - fi if [[ ! ${GO_OPTIONAL} ]]; then diff --git a/eclass/kde.org.eclass b/eclass/kde.org.eclass index 88040026ecae..c972c12ab8a5 100644 --- a/eclass/kde.org.eclass +++ b/eclass/kde.org.eclass @@ -161,7 +161,7 @@ case ${KDE_BUILD_TYPE} in EGIT_MIRROR=${EGIT_MIRROR:=https://invent.kde.org/${KDE_ORG_CATEGORY}} EGIT_REPO_URI="${EGIT_MIRROR}/${EGIT_REPONAME:=$KDE_ORG_NAME}.git" - if [[ ${PV} == 5.??.?.9999 && ${CATEGORY} == dev-qt ]]; then + if [[ ${PV} == 5.15.*.9999 && ${CATEGORY} == dev-qt ]]; then EGIT_BRANCH="kde/$(ver_cut 1-2)" fi ;; diff --git a/eclass/qmake-utils.eclass b/eclass/qmake-utils.eclass index 88755ab7aa8a..5c5fa8dcb047 100644 --- a/eclass/qmake-utils.eclass +++ b/eclass/qmake-utils.eclass @@ -155,4 +155,63 @@ qt6_get_plugindir() { echo $(qt6_get_libdir)/qt6/plugins } +# @FUNCTION: qt6_get_qmake_args +# @DESCRIPTION: +# Echoes a multi-line string containing arguments to pass to qmake. +qt6_get_qmake_args() { + cat <<-EOF + QMAKE_AR="$(tc-getAR) cqs" + QMAKE_CC="$(tc-getCC)" + QMAKE_LINK_C="$(tc-getCC)" + QMAKE_LINK_C_SHLIB="$(tc-getCC)" + QMAKE_CXX="$(tc-getCXX)" + QMAKE_LINK="$(tc-getCXX)" + QMAKE_LINK_SHLIB="$(tc-getCXX)" + QMAKE_OBJCOPY="$(tc-getOBJCOPY)" + QMAKE_RANLIB= + QMAKE_STRIP= + QMAKE_CFLAGS="${CFLAGS}" + QMAKE_CFLAGS_RELEASE= + QMAKE_CFLAGS_DEBUG= + QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO= + QMAKE_CXXFLAGS="${CXXFLAGS}" + QMAKE_CXXFLAGS_RELEASE= + QMAKE_CXXFLAGS_DEBUG= + QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO= + QMAKE_LFLAGS="${LDFLAGS}" + QMAKE_LFLAGS_RELEASE= + QMAKE_LFLAGS_DEBUG= + QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO= + EOF +} + +# @FUNCTION: eqmake6 +# @USAGE: [arguments for qmake] +# @DESCRIPTION: +# Wrapper for Qt6's qmake. All arguments are passed to qmake. +# +# For recursive build systems, i.e. those based on the subdirs template, +# you should run eqmake6 on the top-level project file only, unless you +# have a valid reason to do otherwise. During the building, qmake will +# be automatically re-invoked with the right arguments on every directory +# specified inside the top-level project file. +eqmake6() { + debug-print-function ${FUNCNAME} "$@" + + ebegin "Running qmake" + + local -a args + mapfile -t args <<<"$(qt6_get_qmake_args)" + # NB: we're passing literal quotes in but qmake doesn't seem to mind + "$(qt6_get_bindir)"/qmake -makefile "${args[@]}" "$@" + + if ! eend $? ; then + echo + eerror "Running qmake has failed! (see above for details)" + eerror "This shouldn't happen - please send a bug report to https://bugs.gentoo.org/" + echo + die "eqmake6 failed" + fi +} + fi |