From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 756641382DE for ; Sun, 3 Jul 2016 16:09:05 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B2372E09B3; Sun, 3 Jul 2016 16:09:02 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 2F1C0E09A9 for ; Sun, 3 Jul 2016 16:09:01 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2C3C3340D80 for ; Sun, 3 Jul 2016 16:09:00 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 307AF2443 for ; Sun, 3 Jul 2016 16:08:56 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1467562115.4cd5b18679a3e4bcb1049c4213fca6570639851a.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/kde4-base.eclass eclass/kde4-functions.eclass X-VCS-Directories: eclass/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 4cd5b18679a3e4bcb1049c4213fca6570639851a X-VCS-Branch: master Date: Sun, 3 Jul 2016 16:08:56 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 6553258f-b6b7-422a-8674-e3bd076cf398 X-Archives-Hash: 09127d068c4a094a4abdafe4f77c15ff commit: 4cd5b18679a3e4bcb1049c4213fca6570639851a Author: Michał Górny gentoo org> AuthorDate: Thu Jun 30 17:26:21 2016 +0000 Commit: Michał Górny gentoo org> CommitDate: Sun Jul 3 16:08:35 2016 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4cd5b186 kde4-*.eclass: Migrate to L10N flags eclass/kde4-base.eclass | 4 ++-- eclass/kde4-functions.eclass | 43 +++++++++++++++++++++++++++---------------- 2 files changed, 29 insertions(+), 18 deletions(-) diff --git a/eclass/kde4-base.eclass b/eclass/kde4-base.eclass index b6ee447..6f71dea 100644 --- a/eclass/kde4-base.eclass +++ b/eclass/kde4-base.eclass @@ -333,13 +333,13 @@ fi # add a dependency over kde4-l10n if [[ ${KDEBASE} != "kde-base" && -n ${KDE_LINGUAS} ]]; then - for _lingua in ${KDE_LINGUAS}; do + for _lingua in $(kde4_lingua_to_l10n ${KDE_LINGUAS}); do # if our package has linguas, pull in kde4-l10n with selected lingua enabled, # but only for selected ones. # this can't be done on one line because if user doesn't use any localisation # then he is probably not interested in kde4-l10n at all. kderdepend+=" - linguas_${_lingua}? ( $(add_kdeapps_dep kde4-l10n "linguas_${_lingua}(+)") ) + l10n_${_lingua}? ( $(add_kdeapps_dep kde4-l10n "l10n_${_lingua}(+)") ) " done unset _lingua diff --git a/eclass/kde4-functions.eclass b/eclass/kde4-functions.eclass index 8c2fa4a..a600d55 100644 --- a/eclass/kde4-functions.eclass +++ b/eclass/kde4-functions.eclass @@ -76,6 +76,27 @@ case ${KDE_SCM} in *) die "KDE_SCM: ${KDE_SCM} is not supported" ;; esac +# @FUNCTION: kde4_lingua_to_l10n +# @USAGE: ... +# @INTERNAL +# @DESCRIPTION: +# Output l10n flag name(s) (without prefix(es)) appropriate for given KDE +# locale(s). +kde4_lingua_to_l10n() { + local l + for l; do + case ${l} in + ca@valencia) echo ca-valencia;; + sr@ijekavian) echo sr-ijekavsk;; + sr@ijekavianlatin) echo sr-Latn-ijekavsk;; + sr@latin|sr@Latn) echo sr-Latn;; + uz@cyrillic) echo uz-Cyrl;; + *@*) die "${FUNCNAME}: Unhandled KDE_LINGUAS: ${l}";; + *) echo "${l/_/-}";; + esac + done +} + # @ECLASS-VARIABLE: KDE_LINGUAS # @DESCRIPTION: # This is a whitespace-separated list of translations this ebuild supports. @@ -86,8 +107,8 @@ esac # # Example: KDE_LINGUAS="de en_GB nl" if [[ ${KDE_BUILD_TYPE} != live || -n ${KDE_LINGUAS_LIVE_OVERRIDE} ]]; then - for _lingua in ${KDE_LINGUAS}; do - IUSE="${IUSE} linguas_${_lingua}" + for _lingua in $(kde4_lingua_to_l10n ${KDE_LINGUAS}); do + IUSE="${IUSE} l10n_${_lingua}" done fi @@ -139,7 +160,7 @@ comment_all_add_subdirectory() { # @FUNCTION: enable_selected_linguas # @DESCRIPTION: -# Enable translations based on LINGUAS settings and translations supported by +# Enable translations based on L10N settings and translations supported by # the package (see KDE_LINGUAS). By default, translations are found in "${S}"/po # but this default can be overridden by defining KDE_LINGUAS_DIR. enable_selected_linguas() { @@ -147,11 +168,6 @@ enable_selected_linguas() { local x - # if there is no linguas defined we enable everything - if ! $(env | grep -q "^LINGUAS="); then - return 0 - fi - # @ECLASS-VARIABLE: KDE_LINGUAS_DIR # @DESCRIPTION: # Specified folder where application translations are located. @@ -171,7 +187,7 @@ enable_selected_linguas() { # @FUNCTION: enable_selected_doc_linguas # @DESCRIPTION: -# Enable only selected linguas enabled doc folders. +# Enable only selected L10N enabled doc folders. enable_selected_doc_linguas() { debug-print-function ${FUNCNAME} "$@" @@ -195,11 +211,6 @@ enable_selected_doc_linguas() { -e "/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${handbookdir}[[:space:]]*)/s/^/#DONOTCOMPILE /" \ -i CMakeLists.txt || die 'failed to comment out all handbooks' else - # if there is no linguas defined we enable everything (i.e. comment out nothing) - if ! $(env | grep -q "^LINGUAS="); then - return 0 - fi - # Disable subdirectories recursively comment_all_add_subdirectory "${handbookdir}" @@ -213,7 +224,7 @@ enable_selected_doc_linguas() { # Add requested translations local lingua for lingua in en ${KDE_LINGUAS}; do - if [[ ${lingua} = en ]] || use linguas_${lingua}; then + if [[ ${lingua} = en ]] || use "l10n_$(kde4_lingua_to_l10n "${lingua}")"; then if [[ -d ${handbookdir}/${translationdir//%lingua/${lingua}} ]]; then sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${translationdir//%lingua/${lingua}}/s/^#DONOTCOMPILE //" \ -e "/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${translationdir//%lingua/${lingua}}/s/^#DONOTCOMPILE //" \ @@ -376,7 +387,7 @@ _enable_selected_linguas_dir() { done for lingua in ${KDE_LINGUAS}; do - if use linguas_${lingua} ; then + if use "l10n_$(kde4_lingua_to_l10n ${lingua})" ; then if [[ -d ${lingua} ]]; then linguas="${linguas} ${lingua}" sed -e "/add_subdirectory([[:space:]]*${lingua}[[:space:]]*)[[:space:]]*$/ s/^#DONOTCOMPILE //" \