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"
17 !<kde-apps/kde-l10n-15.08.0-r1
18 !<kde-apps/kde4-l10n-4.14.3-r1
22 KEYWORDS="~amd64 ~x86"
25 # /usr/portage/distfiles $ ls -1 kde-l10n-*-${PV}.* |sed -e 's:-${PV}.tar.xz::' -e 's:kde-l10n-::' |tr '\n' ' '
26 MY_LANGS="ar bg bs ca ca@valencia cs da de el en_GB eo es et eu fa fi fr ga gl
27 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
28 sk sl sr sv tr ug uk wa zh_CN zh_TW"
30 PIM_L10N="kdepim kdepimlibs kdepim-runtime pim"
32 URI_BASE="${SRC_URI/-${PV}.tar.xz/}"
35 for MY_LANG in ${MY_LANGS} ; do
36 IUSE="${IUSE} linguas_${MY_LANG}"
37 SRC_URI="${SRC_URI} linguas_${MY_LANG}? ( ${URI_BASE/kdepim/kde}/kde-l10n-${MY_LANG}-${PV}.tar.xz )"
43 if [[ -z ${A} ]]; then
45 elog "You either have the LINGUAS variable unset, or it only"
46 elog "contains languages not supported by ${P}."
47 elog "You won't have any additional language support."
49 elog "${P} supports these language codes:"
54 [[ -n ${A} ]] && unpack ${A}
59 # add all linguas to cmake
60 if [[ -n ${A} ]]; then
61 for LNG in ${LINGUAS}; do
62 DIR="kde-l10n-${LNG}-${PV}"
63 SDIR="${S}/${DIR}/5/${LNG}"
64 if [[ -d "${DIR}" ]] ; then
65 echo "add_subdirectory( ${DIR} )" >> "${S}"/CMakeLists.txt
67 # Drop KDE4-based part
68 sed -e '/add_subdirectory(4)/ s/^/#/'\
69 -i "${S}"/${DIR}/CMakeLists.txt || die
71 # Remove everything except kdepim, kdepimlibs, kdepim-runtime and pim
72 for SUBDIR in data docs messages scripts ; do
73 if [[ -d "${SDIR}/${SUBDIR}" ]] ; then
74 einfo " ${SUBDIR} subdirectory"
75 echo > "${SDIR}/${SUBDIR}/CMakeLists.txt"
76 for pim in ${PIM_L10N}; do
77 [[ -d "${SDIR}/${SUBDIR}/${pim}" ]] && \
78 ( echo "add_subdirectory(${pim})" >> "${SDIR}/${SUBDIR}/CMakeLists.txt" )
83 # In some cases we may have sub-lingua subdirs, e.g. sr :(
84 for XSUBDIR in "${SDIR}/${LNG}"@* ; do
85 XLNG=$(echo ${XSUBDIR}|sed -e 's:^.*/::')
86 if [[ -d "${XSUBDIR}" ]] ; then
87 einfo " ${XLNG} variant"
88 # remove everything except kdepim and kdepim-runtime
89 for SUBDIR in data docs messages scripts ; do
90 if [[ -d "${XSUBDIR}/${SUBDIR}" ]] ; then
91 einfo " ${SUBDIR} subdirectory"
92 echo > "${XSUBDIR}/${SUBDIR}/CMakeLists.txt"
93 for pim in ${PIM_L10N}; do
94 [[ -d "${XSUBDIR}/${SUBDIR}/${pim}" ]] && \
95 ( echo "add_subdirectory(${pim})" >> "${XSUBDIR}/${SUBDIR}/CMakeLists.txt" )
103 sed -e '/KF5DocTools/ s/ REQUIRED//'\
104 -i "${SDIR}"/CMakeLists.txt || die
105 if ! use handbook ; then
106 sed -e '/add_subdirectory(docs)/ s/^/#/'\
107 -i "${SDIR}"/CMakeLists.txt || die
110 # Fix broken LINGUAS=sr (KDE4 leftover)
111 if [[ ${LNG} = "sr" ]] ; then
112 sed -e '/add_subdirectory(lokalize)/ s/^/#/'\
113 -i "${SDIR}"/data/kdesdk/CMakeLists.txt || die
122 $(cmake-utils_use_find_package handbook KF5DocTools)
124 [[ -n ${A} ]] && kde5_src_configure
128 [[ -n ${A} ]] && kde5_src_compile
132 [[ -n ${A} ]] && kde5_src_test
136 [[ -n ${A} ]] && kde5_src_install