From e2bd5c51f29f96466f82932ccf4be955cd73ba2f Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 18 Feb 2016 20:14:57 +0200 Subject: [PATCH] Build and install only selected localizations. Use in Gentoo. --HG-- branch : develop --- .../valentina-0.0.0(template_stable).ebuild | 20 +++++++--- ...tina-0.0.0_alpha(template_unstable).ebuild | 19 ++++++--- src/app/translations.pri | 39 +++++++++++-------- 3 files changed, 49 insertions(+), 29 deletions(-) diff --git a/dist/ebuild/valentina-0.0.0(template_stable).ebuild b/dist/ebuild/valentina-0.0.0(template_stable).ebuild index a72bbbb0b..a9970c59e 100644 --- a/dist/ebuild/valentina-0.0.0(template_stable).ebuild +++ b/dist/ebuild/valentina-0.0.0(template_stable).ebuild @@ -14,11 +14,11 @@ LICENSE="GPL-3" SLOT="1" KEYWORDS="~amd64 ~x86" -LANGS="ru_RU uk_UA de_DE cs_CZ he_IL fr_FR it_IT nl_NL id_ID es_ES fi_FI en_US en_CA en_IN ro_RO" -for X in ${LANGS} ; do - if [[ ${X} != "en" ]]; then - IUSE="${IUSE} linguas_${X}" - fi +# en_IN not supported in Gentoo so not added here +LANGS="ru_RU uk_UA de_DE cs_CZ he_IL fr_FR it_IT nl_NL id_ID es_ES fi_FI en_US en_CA ro_RO" + +for LANG in ${LANGS}; do + IUSE="${IUSE} linguas_${LANG}" done CDEPEND=" @@ -39,7 +39,15 @@ DEPEND="${CDEPEND} S=${WORKDIR}/dismine-${PN}-44d43351cb59 src_configure() { - eqmake5 CONFIG+=no_ccache CONFIG+=noDebugSymbols Valentina.pro -r + local locales="" + + for LANG in ${LANGS}; do + if use linguas_${LANG}; then + locales="${locales} ${LANG}" + fi + done + + eqmake5 LOCALES="${locales}" CONFIG+=no_ccache CONFIG+=noDebugSymbols Valentina.pro -r } src_install() { diff --git a/dist/ebuild/valentina-0.0.0_alpha(template_unstable).ebuild b/dist/ebuild/valentina-0.0.0_alpha(template_unstable).ebuild index 15eaadf3c..ddd9512c8 100644 --- a/dist/ebuild/valentina-0.0.0_alpha(template_unstable).ebuild +++ b/dist/ebuild/valentina-0.0.0_alpha(template_unstable).ebuild @@ -16,11 +16,11 @@ LICENSE="GPL-3" SLOT="1" KEYWORDS="~amd64 ~x86" -LANGS="ru_RU uk_UA de_DE cs_CZ he_IL fr_FR it_IT nl_NL id_ID es_ES fi_FI en_US en_CA en_IN ro_RO zh_CN" -for X in ${LANGS} ; do - if [[ ${X} != "en" ]]; then - IUSE="${IUSE} linguas_${X}" - fi +# en_IN not supported in Gentoo so not added here +LANGS="ru_RU uk_UA de_DE cs_CZ he_IL fr_FR it_IT nl_NL id_ID es_ES fi_FI en_US en_CA ro_RO zh_CN" + +for LANG in ${LANGS}; do + IUSE="${IUSE} linguas_${LANG}" done CDEPEND=" @@ -39,7 +39,14 @@ DEPEND="${CDEPEND} dev-util/ccache" src_configure() { - eqmake5 Valentina.pro -r + local locales="" + + for LANG in ${LANGS}; do + if use linguas_${LANG}; then + locales="${locales} ${LANG}" + fi + done + eqmake5 LOCALES="${locales}" Valentina.pro -r } src_install() { diff --git a/src/app/translations.pri b/src/app/translations.pri index 16f2e73d0..b37203494 100755 --- a/src/app/translations.pri +++ b/src/app/translations.pri @@ -9,23 +9,28 @@ PMSYSTEMS += \ p0 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 p16 p17 p18 p19 p20 p21 p22 p23 p24 p25 p26 p27 p28 p29 p30 \ p31 p32 p33 p34 p35 p36 p37 p38 p39 p40 p41 p42 p43 p44 p45 p46 p47 p48 p49 p50 p51 p52 p53 p54 p998 -LANGUAGES += \ - ru_RU \ - uk_UA \ - de_DE \ - cs_CZ \ - he_IL \ - fr_FR \ - it_IT \ - nl_NL \ - id_ID \ - es_ES \ - fi_FI \ - en_US \ - en_CA \ - en_IN \ - ro_RO \ - zh_CN +# An example of using LOCALES="de_DE nl_NL" +isEmpty(LOCALES){ + LANGUAGES += \ + ru_RU \ + uk_UA \ + de_DE \ + cs_CZ \ + he_IL \ + fr_FR \ + it_IT \ + nl_NL \ + id_ID \ + es_ES \ + fi_FI \ + en_US \ + en_CA \ + en_IN \ + ro_RO \ + zh_CN +} else { + LANGUAGES = $${LOCALES} +} for(lang, LANGUAGES) { INSTALL_TRANSLATIONS += $${TRANSLATIONS_PATH}/valentina_$${lang}.qm