kde-apps/ktp-l10n: Migrate to L10N
authorMichał Górny <mgorny@gentoo.org>
Sat, 2 Jul 2016 12:54:39 +0000 (14:54 +0200)
committerMichał Górny <mgorny@gentoo.org>
Sun, 3 Jul 2016 16:08:35 +0000 (18:08 +0200)
kde-apps/ktp-l10n/ktp-l10n-15.12.3.ebuild
kde-apps/ktp-l10n/ktp-l10n-16.04.2.ebuild

index 48c9d6bb7aaa9ffc27897e2933bdf8fe7ed7843c..7cc85eb820c341ba433c1cdb8942b9c41c12c492 100644 (file)
@@ -42,8 +42,8 @@ URI_BASE="${SRC_URI/-${PV}.tar.xz/}"
 SRC_URI=""
 
 for MY_LANG in ${MY_LANGS} ; do
-       IUSE="${IUSE} linguas_${MY_LANG}"
-       SRC_URI="${SRC_URI} linguas_${MY_LANG}? ( ${URI_BASE/ktp/kde}/kde-l10n-${MY_LANG}-${PV}.tar.xz )"
+       IUSE="${IUSE} l10n_${MY_LANG/[@_]/-}"
+       SRC_URI="${SRC_URI} l10n_${MY_LANG/[@_]/-}? ( ${URI_BASE/ktp/kde}/kde-l10n-${MY_LANG}-${PV}.tar.xz )"
 done
 
 S="${WORKDIR}"
@@ -51,12 +51,10 @@ S="${WORKDIR}"
 src_unpack() {
        if [[ -z ${A} ]]; then
                elog
-               elog "You either have the LINGUAS variable unset, or it only"
-               elog "contains languages not supported by ${P}."
-               elog "You won't have any additional language support."
+               elog "None of the requested L10N are supported by ${P}."
                elog
                elog "${P} supports these language codes:"
-               elog "${MY_LANGS}"
+               elog "${MY_LANGS//[@_]/-}"
                elog
        fi
 
@@ -67,9 +65,9 @@ src_prepare() {
        default
 
        local LNG DIR
-       # add all linguas to cmake
+       # add all l10n to cmake
        if [[ -n ${A} ]]; then
-               for LNG in ${LINGUAS}; do
+               for LNG in ${MY_LANGS}; do
                        DIR="kde-l10n-${LNG}-${PV}"
                        SDIR="${S}/${DIR}/5/${LNG}"
                        if [[ -d "${DIR}" ]] ; then
index edb09319b22dbf6bf7e5d30f9c3337cd08007d99..e662e14a9a1276b17a8bb5437d10a342e2e786a3 100644 (file)
@@ -35,12 +35,12 @@ MY_LANGS="ar ast bg bs ca ca@valencia cs da de el en_GB eo es et eu fa fi fr ga
 gl he hi hr hu ia id is it ja kk km ko lt lv mr nb nds nl nn pa pl pt pt_BR ro
 ru sk sl sr sv tr ug uk wa zh_CN zh_TW"
 
-IUSE="$(printf 'linguas_%s ' ${MY_LANGS})"
+IUSE="$(printf 'l10n_%s ' ${MY_LANGS//[@_]/-})"
 
 URI_BASE="${SRC_URI/-${PV}.tar.xz/}"
 SRC_URI=""
 for MY_LANG in ${MY_LANGS} ; do
-       SRC_URI="${SRC_URI} linguas_${MY_LANG}? ( ${URI_BASE/ktp/kde}/kde-l10n-${MY_LANG}-${PV}.tar.xz )"
+       SRC_URI="${SRC_URI} l10n_${MY_LANG/[@_]/-}? ( ${URI_BASE/ktp/kde}/kde-l10n-${MY_LANG}-${PV}.tar.xz )"
 done
 
 S="${WORKDIR}"
@@ -48,12 +48,10 @@ S="${WORKDIR}"
 pkg_setup() {
        if [[ -z ${A} ]]; then
                elog
-               elog "You either have the LINGUAS variable unset, or it only"
-               elog "contains languages not supported by ${P}."
-               elog "You won't have any additional language support."
+               elog "None of the requested L10N are supported by ${P}."
                elog
                elog "${P} supports these language codes:"
-               elog "${MY_LANGS}"
+               elog "${MY_LANGS//[@_]/-}"
                elog
        fi
        [[ -n ${A} ]] && kde5_pkg_setup
@@ -71,7 +69,7 @@ src_prepare() {
        default
        [[ -n ${A} ]] || return
 
-       # add all linguas to cmake
+       # add all l10n to cmake
        cat <<-EOF > CMakeLists.txt || die
 project(kdepim-l10n)
 cmake_minimum_required(VERSION 2.8.12)
@@ -91,7 +89,7 @@ EOF
 
        # Remove everything except kdenetwork/ktp translations
        local LNG DIR
-       for LNG in ${LINGUAS}; do
+       for LNG in ${MY_LANGS}; do
                DIR="kde-l10n-${LNG}-${PV}"
                SDIR="${S}/${DIR}/5/${LNG}"
                if [[ -d "${DIR}" ]] ; then