summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
Diffstat (limited to 'eclass')
-rw-r--r--eclass/kde5.eclass49
1 files changed, 40 insertions, 9 deletions
diff --git a/eclass/kde5.eclass b/eclass/kde5.eclass
index f9045670cc3..900cf3ef2dd 100644
--- a/eclass/kde5.eclass
+++ b/eclass/kde5.eclass
@@ -70,6 +70,17 @@ fi
# generate and install KDE handbook.
KDE_HANDBOOK="${KDE_HANDBOOK:-false}"
+# @ECLASS-VARIABLE: KDE_NLS
+# @DESCRIPTION:
+# If set to "false", do nothing.
+# Otherwise, add "nls" to IUSE, generate and install translations based on
+# the LINGUAS environment variable.
+if [[ ${CATEGORY} = kde-frameworks ]]; then
+ : ${KDE_NLS:=true}
+else
+ : ${KDE_NLS:=false}
+fi
+
# @ECLASS-VARIABLE: KDE_TEST
# @DESCRIPTION:
# If set to "false", do nothing.
@@ -134,6 +145,13 @@ case ${KDE_HANDBOOK} in
;;
esac
+case ${KDE_NLS} in
+ false) ;;
+ *)
+ IUSE+=" nls"
+ ;;
+esac
+
case ${KDE_TEST} in
false) ;;
*)
@@ -245,26 +263,39 @@ kde5_src_unpack() {
kde5_src_prepare() {
debug-print-function ${FUNCNAME} "$@"
+ # only build examples when required
+ if ! in_iuse examples || ! use examples ; then
+ comment_add_subdirectory examples
+ fi
+
+ # only enable handbook when required
+ if ! use_if_iuse handbook ; then
+ comment_add_subdirectory doc
+ fi
+
+ # enable only the requested translations
+ # when required
+ if use_if_iuse nls ; then
+ for lang in $(ls po) ; do
+ if ! has ${lang} ${LINGUAS} ; then
+ rm -r po/${lang}
+ fi
+ done
+ else
+ rm -r po
+ fi
+
# in frameworks, tests = manual tests so never
# build them
if [[ ${CATEGORY} = kde-frameworks ]]; then
comment_add_subdirectory tests
fi
- # only build examples when required
- if ! in_iuse examples || ! use examples ; then
- comment_add_subdirectory examples
- fi
-
# only build unit tests when required
if ! in_iuse test || ! use test ; then
comment_add_subdirectory autotests
fi
- # only enable handbook when required
- if ! use_if_iuse handbook ; then
- comment_add_subdirectory doc
- fi
cmake-utils_src_prepare
}