1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
10 DESCRIPTION="KDE PIM internationalization package"
11 HOMEPAGE="http://l10n.kde.org"
14 $(add_frameworks_dep ki18n)
15 dev-qt/linguist-tools:5
19 !<kde-apps/kde-l10n-15.08.0-r1
20 !<kde-apps/kde4-l10n-4.14.3-r1
24 KEYWORDS="~amd64 ~x86"
27 # /usr/portage/distfiles $ ls -1 kde-l10n-*-${PV}.* |sed -e 's:-${PV}.tar.xz::' -e 's:kde-l10n-::' |tr '\n' ' '
28 MY_LANGS="ar bg bs ca ca@valencia cs da de el en_GB eo es et eu fa fi fr ga gl
29 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
30 sk sl sr sv tr ug uk wa zh_CN zh_TW"
32 PIM_L10N="kdepim kdepimlibs kdepim-runtime pim"
34 URI_BASE="${SRC_URI/-${PV}.tar.xz/}"
37 for MY_LANG in ${MY_LANGS} ; do
38 IUSE="${IUSE} linguas_${MY_LANG}"
39 SRC_URI="${SRC_URI} linguas_${MY_LANG}? ( ${URI_BASE/kdepim/kde}/kde-l10n-${MY_LANG}-${PV}.tar.xz )"
45 if [[ -z ${A} ]]; then
47 elog "You either have the LINGUAS variable unset, or it only"
48 elog "contains languages not supported by ${P}."
49 elog "You won't have any additional language support."
51 elog "${P} supports these language codes:"
56 [[ -n ${A} ]] && unpack ${A}
61 # add all linguas to cmake
62 if [[ -n ${A} ]]; then
63 for LNG in ${LINGUAS}; do
64 DIR="kde-l10n-${LNG}-${PV}"
65 SDIR="${S}/${DIR}/5/${LNG}"
66 if [[ -d "${DIR}" ]] ; then
67 echo "add_subdirectory( ${DIR} )" >> "${S}"/CMakeLists.txt
69 # Drop KDE4-based part
70 sed -e '/add_subdirectory(4)/ s/^/#/'\
71 -i "${S}"/${DIR}/CMakeLists.txt || die
73 # Remove everything except kdepim, kdepimlibs, kdepim-runtime and pim
74 for SUBDIR in data docs messages scripts ; do
75 if [[ -d "${SDIR}/${SUBDIR}" ]] ; then
76 einfo " ${SUBDIR} subdirectory"
77 echo > "${SDIR}/${SUBDIR}/CMakeLists.txt"
78 for pim in ${PIM_L10N}; do
79 [[ -d "${SDIR}/${SUBDIR}/${pim}" ]] && \
80 ( echo "add_subdirectory(${pim})" >> "${SDIR}/${SUBDIR}/CMakeLists.txt" )
85 # In some cases we may have sub-lingua subdirs, e.g. sr :(
86 for XSUBDIR in "${SDIR}/${LNG}"@* ; do
87 XLNG=$(echo ${XSUBDIR}|sed -e 's:^.*/::')
88 if [[ -d "${XSUBDIR}" ]] ; then
89 einfo " ${XLNG} variant"
90 # remove everything except kdepim and kdepim-runtime
91 for SUBDIR in data docs messages scripts ; do
92 if [[ -d "${XSUBDIR}/${SUBDIR}" ]] ; then
93 einfo " ${SUBDIR} subdirectory"
94 echo > "${XSUBDIR}/${SUBDIR}/CMakeLists.txt"
95 for pim in ${PIM_L10N}; do
96 [[ -d "${XSUBDIR}/${SUBDIR}/${pim}" ]] && \
97 ( echo "add_subdirectory(${pim})" >> "${XSUBDIR}/${SUBDIR}/CMakeLists.txt" )
105 sed -e '/KF5DocTools/ s/ REQUIRED//'\
106 -i "${SDIR}"/CMakeLists.txt || die
107 if ! use handbook ; then
108 sed -e '/add_subdirectory(docs)/ s/^/#/'\
109 -i "${SDIR}"/CMakeLists.txt || die
112 # Fix broken LINGUAS=sr (KDE4 leftover)
113 if [[ ${LNG} = "sr" ]] ; then
114 sed -e '/add_subdirectory(lokalize)/ s/^/#/'\
115 -i "${SDIR}"/data/kdesdk/CMakeLists.txt || die
124 $(cmake-utils_use_find_package handbook KF5DocTools)
126 [[ -n ${A} ]] && kde5_src_configure
130 [[ -n ${A} ]] && kde5_src_compile
134 [[ -n ${A} ]] && kde5_src_test
138 [[ -n ${A} ]] && kde5_src_install