1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
8 # @BLURB: Support eclass for KDE 5-related packages.
10 # The kde5.eclass provides support for building KDE 5-related packages.
12 if [[ -z ${_KDE5_ECLASS} ]]; then
15 # @ECLASS-VARIABLE: VIRTUALX_REQUIRED
17 # For proper description see virtualx.eclass manpage.
18 # Here we redefine default value to be manual, if your package needs virtualx
19 # for tests you should proceed with setting VIRTUALX_REQUIRED=test.
20 : ${VIRTUALX_REQUIRED:=manual}
22 inherit cmake-utils eutils flag-o-matic gnome2-utils kde5-functions versionator virtualx xdg
24 if [[ ${KDE_BUILD_TYPE} = live ]]; then
26 git) inherit git-r3 ;;
30 if [[ -v KDE_GCC_MINIMAL ]]; then
31 EXPORT_FUNCTIONS pkg_pretend
34 EXPORT_FUNCTIONS pkg_setup pkg_nofetch src_unpack src_prepare src_configure src_compile src_test src_install pkg_preinst pkg_postinst pkg_postrm
36 # @ECLASS-VARIABLE: KDE_AUTODEPS
38 # If set to "false", do nothing.
39 # For any other value, add a dependency on dev-qt/qtcore:5 and kde-frameworks/extra-cmake-modules:5.
40 : ${KDE_AUTODEPS:=true}
42 # @ECLASS-VARIABLE: KDE_BLOCK_SLOT4
44 # This variable is used when KDE_AUTODEPS is set.
45 # If set to "true", add RDEPEND block on kde-apps/${PN}:4
46 : ${KDE_BLOCK_SLOT4:=true}
48 # @ECLASS-VARIABLE: KDE_DEBUG
50 # If set to "false", unconditionally build with -DNDEBUG.
51 # Otherwise, add debug to IUSE to control building with that flag.
54 # @ECLASS-VARIABLE: KDE_DESIGNERPLUGIN
56 # If set to "false", do nothing.
57 # Otherwise, add "designer" to IUSE to toggle build of designer plugins
58 # and add the necessary DEPENDs.
59 : ${KDE_DESIGNERPLUGIN:=false}
61 # @ECLASS-VARIABLE: KDE_EXAMPLES
63 # If set to "false", unconditionally ignore a top-level examples subdirectory.
64 # Otherwise, add "examples" to IUSE to toggle adding that subdirectory.
65 : ${KDE_EXAMPLES:=false}
67 # @ECLASS-VARIABLE: KDE_HANDBOOK
69 # If set to "false", do nothing.
70 # Otherwise, add "+handbook" to IUSE, add the appropriate dependency, and
71 # generate and install KDE handbook.
72 # If set to "optional", config with -DCMAKE_DISABLE_FIND_PACKAGE_KF5DocTools=ON
73 # when USE=!handbook. In case package requires KF5KDELibs4Support, see next:
74 # If set to "forceoptional", remove a KF5DocTools dependency from the root
75 # CMakeLists.txt in addition to the above.
76 : ${KDE_HANDBOOK:=false}
78 # @ECLASS-VARIABLE: KDE_DOC_DIR
80 # Defaults to "doc". Otherwise, use alternative KDE handbook path.
83 # @ECLASS-VARIABLE: KDE_TEST
85 # If set to "false", do nothing.
86 # For any other value, add test to IUSE and add a dependency on dev-qt/qttest:5.
87 # If set to "optional", configure with -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Test=ON
89 # If set to "forceoptional", remove a Qt5Test dependency and comment test
90 # subdirs from the root CMakeLists.txt in addition to the above.
91 # If set to "forceoptional-recursive", remove a Qt5Test dependency and comment
92 # test subdirs from *any* CMakeLists.txt in addition to the above.
93 if [[ ${CATEGORY} = kde-frameworks ]]; then
99 # @ECLASS-VARIABLE: KDE_L10N
101 # This is an array of translations this ebuild supports. These translations
102 # are automatically added to IUSE.
103 if [[ ${KDEBASE} = kdel10n ]]; then
104 if [[ -n ${KDE_L10N} ]]; then
105 IUSE="${IUSE} $(printf 'l10n_%s ' ${KDE_L10N[@]})"
109 # @ECLASS-VARIABLE: KDE_SELINUX_MODULE
111 # If set to "none", do nothing.
112 # For any other value, add selinux to IUSE, and depending on that useflag
113 # add a dependency on sec-policy/selinux-${KDE_SELINUX_MODULE} to (R)DEPEND.
114 : ${KDE_SELINUX_MODULE:=none}
116 # @ECLASS-VARIABLE: KDE_UNRELEASED
119 # An array of $CATEGORY-$PV pairs of packages that are unreleased upstream.
120 # Any package matching this will have fetch restriction enabled, and receive
121 # a proper error message via pkg_nofetch.
124 if [[ ${KDEBASE} = kdevelop ]]; then
125 HOMEPAGE="https://www.kdevelop.org/"
126 elif [[ ${KDEBASE} = kdel10n ]]; then
127 HOMEPAGE="http://l10n.kde.org"
128 elif [[ ${KMNAME} = kdepim ]]; then
129 HOMEPAGE="https://www.kde.org/applications/office/kontact/"
131 HOMEPAGE="https://www.kde.org/"
136 if [[ ${CATEGORY} = kde-frameworks ]]; then
137 SLOT=5/$(get_version_component_range 1-2)
142 case ${KDE_AUTODEPS} in
145 if [[ ${KDE_BUILD_TYPE} = live ]]; then
148 FRAMEWORKS_MINIMAL=9999
151 FRAMEWORKS_MINIMAL=9999
157 if [[ ${CATEGORY} = kde-plasma && ${FRAMEWORKS_MINIMAL} != 9999 ]]; then
158 if ! [[ $(get_version_component_range 2) -le 8 && $(get_version_component_range 3) -lt 50 ]]; then
159 FRAMEWORKS_MINIMAL=5.27.0
163 if [[ ${CATEGORY} = kde-apps ]]; then
164 local vcr2=$((10#$(get_version_component_range 2)))
165 if ! [[ $(get_version_component_range 1) -le 16 && ${vcr2} -lt 9 ]]; then
166 FRAMEWORKS_MINIMAL=5.28.0
171 DEPEND+=" $(add_frameworks_dep extra-cmake-modules)"
172 RDEPEND+=" >=kde-frameworks/kf-env-3"
173 COMMONDEPEND+=" $(add_qt_dep qtcore)"
175 if [[ ${CATEGORY} = kde-frameworks || ${CATEGORY} = kde-plasma && ${PN} != polkit-kde-agent ]]; then
176 RDEPEND+=" !<kde-apps/kde4-l10n-15.12.3-r1"
179 if [[ ${KDE_BLOCK_SLOT4} = true && ${CATEGORY} = kde-apps ]]; then
180 RDEPEND+=" !kde-apps/${PN}:4"
192 case ${KDE_DESIGNERPLUGIN} in
196 DEPEND+=" designer? (
197 $(add_frameworks_dep kdesignerplugin)
198 $(add_qt_dep designer)
203 case ${KDE_EXAMPLES} in
210 case ${KDE_HANDBOOK} in
214 DEPEND+=" handbook? ( $(add_frameworks_dep kdoctools) )"
222 DEPEND+=" test? ( $(add_qt_dep qttest) )"
226 case ${KDE_SELINUX_MODULE} in
230 RDEPEND+=" selinux? ( sec-policy/selinux-${KDE_SELINUX_MODULE} )"
234 DEPEND+=" ${COMMONDEPEND} dev-util/desktop-file-utils"
235 RDEPEND+=" ${COMMONDEPEND}"
238 if [[ -n ${KMNAME} && ${KMNAME} != ${PN} && ${KDE_BUILD_TYPE} = release ]]; then
239 S=${WORKDIR}/${KMNAME}-${PV}
242 # FIXME: Drop this when kdepim-16.08.x is no more
243 if [[ -n ${KMNAME} && ${KMNAME} != ${PN} && ${KMNAME} = kdepim ]]; then
247 if [[ -n ${KDEBASE} && ${KDEBASE} = kdevelop && ${KDE_BUILD_TYPE} = release ]]; then
248 if [[ -n ${KMNAME} ]]; then
249 S=${WORKDIR}/${KMNAME}-${PV%.0} # kdevelop missing trailing .0 in first release
251 S=${WORKDIR}/${PN}-${PV%.0} # kdevelop missing trailing .0 in first release
255 _kde_is_unreleased() {
257 for pair in "${KDE_UNRELEASED[@]}" ; do
258 if [[ "${pair}" = "${CATEGORY}-${PV}" ]]; then
266 # Determine fetch location for released tarballs
267 _calculate_src_uri() {
268 debug-print-function ${FUNCNAME} "$@"
272 if [[ -n ${KMNAME} ]]; then
285 _kmname="portingAids/${_kmname}"
289 DEPEND+=" app-arch/xz-utils"
294 ??.?.[6-9]? | ??.??.[6-9]? )
295 SRC_URI="mirror://kde/unstable/applications/${PV}/src/${_kmname}-${PV}.tar.xz"
299 SRC_URI="mirror://kde/stable/applications/${PV}/src/${_kmname}-${PV}.tar.xz" ;;
303 SRC_URI="mirror://kde/stable/frameworks/${PV%.*}/${_kmname}-${PV}.tar.xz" ;;
305 local plasmapv=$(get_version_component_range 1-3)
309 # Plasma 5 beta releases
310 SRC_URI="mirror://kde/unstable/plasma/${plasmapv}/${_kmname}-${PV}.tar.xz"
314 # Plasma 5 stable releases
315 SRC_URI="mirror://kde/stable/plasma/${plasmapv}/${_kmname}-${PV}.tar.xz" ;;
320 if [[ -z ${SRC_URI} && -n ${KDEBASE} ]] ; then
326 _kdebase=${KDEBASE} ;;
330 SRC_URI="mirror://kde/unstable/${_kdebase}/${PV}/src/${_kmname}-${PV}.tar.xz"
334 SRC_URI="mirror://kde/stable/${_kdebase}/${PV}/src/${_kmname}-${PV%.0}.tar.xz" ;;
339 if [[ ${KDEBASE} = kdel10n ]] ; then
340 local uri_base="${SRC_URI/${_kmname}-${PV}.tar.xz/}kde-l10n/kde-l10n"
342 for my_l10n in ${KDE_L10N[@]} ; do
344 sr | sr-ijekavsk | sr-Latn-ijekavsk | sr-Latn)
345 SRC_URI="${SRC_URI} l10n_${my_l10n}? ( ${uri_base}-sr-${PV}.tar.xz )"
348 SRC_URI="${SRC_URI} l10n_${my_l10n}? ( ${uri_base}-$(kde_l10n2lingua ${my_l10n})-${PV}.tar.xz )"
354 if _kde_is_unreleased ; then
359 # Determine fetch location for live sources
360 _calculate_live_repo() {
361 debug-print-function ${FUNCNAME} "$@"
367 # @ECLASS-VARIABLE: EGIT_MIRROR
369 # This variable allows easy overriding of default kde mirror service
370 # (anongit) with anything else you might want to use.
371 EGIT_MIRROR=${EGIT_MIRROR:=https://anongit.kde.org}
375 # @ECLASS-VARIABLE: EGIT_REPONAME
377 # This variable allows overriding of default repository
378 # name. Specify only if this differ from PN and KMNAME.
379 if [[ -n ${EGIT_REPONAME} ]]; then
380 # the repository and kmname different
381 _kmname=${EGIT_REPONAME}
382 elif [[ -n ${KMNAME} ]]; then
388 if [[ ${PV} == ??.??.49.9999 && ${CATEGORY} = kde-apps ]]; then
389 EGIT_BRANCH="Applications/$(get_version_component_range 1-2)"
392 if [[ ${PV} != 9999 && ${CATEGORY} = kde-plasma ]]; then
393 EGIT_BRANCH="Plasma/$(get_version_component_range 1-2)"
396 EGIT_REPO_URI="${EGIT_MIRROR}/${_kmname}"
401 case ${KDE_BUILD_TYPE} in
402 live) _calculate_live_repo ;;
403 *) _calculate_src_uri ;;
406 debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}"
408 # @FUNCTION: kde5_pkg_pretend
410 # Do some basic settings
412 debug-print-function ${FUNCNAME} "$@"
416 # @FUNCTION: kde5_pkg_setup
418 # Do some basic settings
420 debug-print-function ${FUNCNAME} "$@"
424 # @FUNCTION: kde5_pkg_nofetch
426 # Display package publication status
428 if ! _kde_is_unreleased ; then
432 eerror " _ _ _ _ ____ _____ _ _____ _ ____ _____ ____ "
433 eerror "| | | | \ | | _ \| ____| | | ____| / \ / ___|| ____| _ \ "
434 eerror "| | | | \| | |_) | _| | | | _| / _ \ \___ \| _| | | | |"
435 eerror "| |_| | |\ | _ <| |___| |___| |___ / ___ \ ___) | |___| |_| |"
436 eerror " \___/|_| \_|_| \_\_____|_____|_____/_/ \_\____/|_____|____/ "
438 eerror " ____ _ ____ _ __ _ ____ _____ "
439 eerror "| _ \ / \ / ___| |/ / / \ / ___| ____|"
440 eerror "| |_) / _ \| | | ' / / _ \| | _| _| "
441 eerror "| __/ ___ \ |___| . \ / ___ \ |_| | |___ "
442 eerror "|_| /_/ \_\____|_|\_\/_/ \_\____|_____|"
444 eerror "${CATEGORY}/${P} has not been released to the public yet"
445 eerror "and is only available to packagers right now."
447 eerror "This is not a bug. Please do not file bugs or contact upstream about this."
449 eerror "Please consult the upstream release schedule to see when this "
450 eerror "package is scheduled to be released:"
451 eerror "https://community.kde.org/Schedules"
454 # @FUNCTION: kde5_src_unpack
456 # Function for unpacking KDE 5.
458 debug-print-function ${FUNCNAME} "$@"
460 if [[ ${KDE_BUILD_TYPE} = live ]]; then
466 elif [[ ${KDEBASE} = kdel10n ]]; then
468 [[ ${PN} = kde4-l10n ]] && l10npart=4
469 mkdir -p "${S}" || die "Failed to create source dir ${S}"
471 for my_tar in ${A}; do
472 tar -xpf "${DISTDIR}/${my_tar}" --xz \
473 "${my_tar/.tar.xz/}/CMakeLists.txt" "${my_tar/.tar.xz/}/${l10npart}" 2> /dev/null ||
474 elog "${my_tar}: tar extract command failed at least partially - continuing"
481 # @FUNCTION: kde5_src_prepare
483 # Function for preparing the KDE 5 sources.
485 debug-print-function ${FUNCNAME} "$@"
487 if [[ ${KDEBASE} = kdel10n ]]; then
489 [[ ${PN} = kde4-l10n ]] && l10npart=4
490 # move known variant subdirs to root dir, currently sr@*
491 use_if_iuse l10n_sr-ijekavsk && _l10n_variant_subdir2root sr-ijekavsk sr
492 use_if_iuse l10n_sr-Latn-ijekavsk && _l10n_variant_subdir2root sr-Latn-ijekavsk sr
493 use_if_iuse l10n_sr-Latn && _l10n_variant_subdir2root sr-Latn sr
494 if use_if_iuse l10n_sr; then
495 rm -rf kde-l10n-sr-${PV}/${l10npart}/sr/sr@* || die "Failed to cleanup L10N=sr"
496 _l10n_variant_subdir_buster sr
497 elif [[ -d kde-l10n-sr-${PV} ]]; then
498 # having any variant selected means parent lingua will be unpacked as well
499 rm -r kde-l10n-sr-${PV} || die "Failed to remove sr parent lingua"
502 # add all l10n directories to cmake
503 cat <<-EOF > CMakeLists.txt || die
505 cmake_minimum_required(VERSION 2.8.12)
506 $(printf "add_subdirectory( %s )\n" \
507 `find . -mindepth 1 -maxdepth 1 -type d | sed -e "s:^\./::"`)
510 # for KF5: drop KDE4-based part; for KDE4: drop KF5-based part
512 5) find -maxdepth 2 -type f -name CMakeLists.txt -exec \
513 sed -i -e "/add_subdirectory(4)/ s/^/#DONT/" {} + || die ;;
514 4) find -maxdepth 2 -type f -name CMakeLists.txt -exec \
515 sed -i -e "/add_subdirectory(5)/ s/^/#DONT/" {} + || die ;;
519 cmake-utils_src_prepare
521 # only build examples when required
522 if ! use_if_iuse examples || ! use examples ; then
523 cmake_comment_add_subdirectory examples
526 # only enable handbook when required
527 if ! use_if_iuse handbook ; then
528 cmake_comment_add_subdirectory ${KDE_DOC_DIR}
530 if [[ ${KDE_HANDBOOK} = forceoptional ]] ; then
531 punt_bogus_dep KF5 DocTools
535 # drop translations when nls is not wanted
536 if [[ -d po ]] && in_iuse nls && ! use nls ; then
540 # enable only the requested translations
542 if [[ -d po && -v LINGUAS ]] ; then
543 pushd po > /dev/null || die
546 if [[ -d ${lang} ]] && ! has ${lang} ${LINGUAS} ; then
548 if [[ -e CMakeLists.txt ]] ; then
549 cmake_comment_add_subdirectory ${lang}
551 elif [[ -f ${lang} ]] && ! has ${lang/.po/} ${LINGUAS} ; then
552 if [[ ${lang} != CMakeLists.txt && ${lang} != ${PN}.pot ]] ; then
557 popd > /dev/null || die
560 if [[ ${KDE_BUILD_TYPE} = release && ${CATEGORY} != kde-apps ]] ; then
561 if [[ ${KDE_HANDBOOK} != false && -d ${KDE_DOC_DIR} && -v LINGUAS ]] ; then
562 pushd ${KDE_DOC_DIR} > /dev/null || die
565 if ! has ${lang} ${LINGUAS} ; then
566 cmake_comment_add_subdirectory ${lang}
569 popd > /dev/null || die
573 # in frameworks, tests = manual tests so never build them
574 if [[ ${CATEGORY} = kde-frameworks ]] && [[ ${PN} != extra-cmake-modules ]]; then
575 cmake_comment_add_subdirectory tests
578 # only build unit tests when required
579 if ! use_if_iuse test ; then
580 if [[ ${KDE_TEST} = forceoptional ]] ; then
581 punt_bogus_dep Qt5 Test
582 # if forceoptional, also cover non-kde categories
583 cmake_comment_add_subdirectory autotests test tests
584 elif [[ ${KDE_TEST} = forceoptional-recursive ]] ; then
585 punt_bogus_dep Qt5 Test
587 for d in $(find . -type d -name "autotests" -or -name "tests" -or -name "test" -or -name "unittests"); do
588 pushd ${d%/*} > /dev/null || die
589 punt_bogus_dep Qt5 Test
590 cmake_comment_add_subdirectory autotests test tests
591 popd > /dev/null || die
593 elif [[ ${CATEGORY} = kde-frameworks || ${CATEGORY} = kde-plasma || ${CATEGORY} = kde-apps ]] ; then
594 cmake_comment_add_subdirectory autotests test tests
599 # @FUNCTION: kde5_src_configure
601 # Function for configuring the build of KDE 5.
602 kde5_src_configure() {
603 debug-print-function ${FUNCNAME} "$@"
605 # we rely on cmake-utils.eclass to append -DNDEBUG too
606 if ! use_if_iuse debug; then
607 append-cppflags -DQT_NO_DEBUG
612 if ! use_if_iuse test ; then
613 cmakeargs+=( -DBUILD_TESTING=OFF )
615 if [[ ${KDE_TEST} = optional ]] ; then
616 cmakeargs+=( -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Test=ON )
620 if ! use_if_iuse handbook && [[ ${KDE_HANDBOOK} = optional ]] ; then
621 cmakeargs+=( -DCMAKE_DISABLE_FIND_PACKAGE_KF5DocTools=ON )
624 if ! use_if_iuse designer && [[ ${KDE_DESIGNERPLUGIN} != false ]] ; then
625 cmakeargs+=( -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Designer=ON )
628 # install mkspecs in the same directory as qt stuff
629 cmakeargs+=(-DKDE_INSTALL_USE_QT_SYS_PATHS=ON)
631 # allow the ebuild to override what we set here
632 mycmakeargs=("${cmakeargs[@]}" "${mycmakeargs[@]}")
634 cmake-utils_src_configure
637 # @FUNCTION: kde5_src_compile
639 # Function for compiling KDE 5.
641 debug-print-function ${FUNCNAME} "$@"
643 cmake-utils_src_compile "$@"
646 # @FUNCTION: kde5_src_test
648 # Function for testing KDE 5.
650 debug-print-function ${FUNCNAME} "$@"
653 if [[ -n "${VIRTUALDBUS_TEST}" ]]; then
654 export $(dbus-launch)
660 # When run as normal user during ebuild development with the ebuild command, the
661 # kde tests tend to access the session DBUS. This however is not possible in a real
662 # emerge or on the tinderbox.
663 # > make sure it does not happen, so bad tests can be recognized and disabled
664 unset DBUS_SESSION_BUS_ADDRESS DBUS_SESSION_BUS_PID
666 if [[ ${VIRTUALX_REQUIRED} = always || ${VIRTUALX_REQUIRED} = test ]]; then
672 if [[ -n "${DBUS_SESSION_BUS_PID}" ]] ; then
673 kill ${DBUS_SESSION_BUS_PID}
677 # @FUNCTION: kde5_src_install
679 # Function for installing KDE 5.
681 debug-print-function ${FUNCNAME} "$@"
683 cmake-utils_src_install
685 # We don't want ${PREFIX}/share/doc/HTML to be compressed,
686 # because then khelpcenter can't find the docs
687 if [[ -d ${ED}/${PREFIX}/share/doc/HTML ]]; then
688 docompress -x ${PREFIX}/share/doc/HTML
692 # @FUNCTION: kde5_pkg_preinst
694 # Function storing icon caches
696 debug-print-function ${FUNCNAME} "$@"
702 # @FUNCTION: kde5_pkg_postinst
704 # Function to rebuild the KDE System Configuration Cache after an application has been installed.
705 kde5_pkg_postinst() {
706 debug-print-function ${FUNCNAME} "$@"
708 gnome2_icon_cache_update
711 if [[ -z ${I_KNOW_WHAT_I_AM_DOING} ]]; then
712 if [[ ${KDE_BUILD_TYPE} = live ]]; then
714 einfo "WARNING! This is an experimental live ebuild of ${CATEGORY}/${PN}"
715 einfo "Use it at your own risk."
716 einfo "Do _NOT_ file bugs at bugs.gentoo.org because of this ebuild!"
718 # for kf5-based applications tell user that he SHOULD NOT be using kde-base/plasma-workspace
719 if [[ ${KDEBASE} != kde-base || ${CATEGORY} = kde-apps ]] && \
720 has_version 'kde-base/plasma-workspace'; then
722 ewarn "WARNING! Your system configuration still contains \"kde-base/plasma-workspace\","
723 ewarn "indicating a Plasma 4 setup. With this setting you are unsupported by KDE team."
724 ewarn "Please consider upgrading to Plasma 5."
729 # @FUNCTION: kde5_pkg_postrm
731 # Function to rebuild the KDE System Configuration Cache after an application has been removed.
733 debug-print-function ${FUNCNAME} "$@"
735 gnome2_icon_cache_update
739 _l10n_variant_subdir2root() {
741 [[ ${PN} = kde4-l10n ]] && l10npart=4
742 local lingua=$(kde_l10n2lingua ${1})
743 local src=kde-l10n-${2}-${PV}
744 local dest=kde-l10n-${lingua}-${PV}/${l10npart}
746 # create variant rootdir structure from parent lingua and adapt it
747 mkdir -p ${dest} || die "Failed to create ${dest}"
748 mv ${src}/${l10npart}/${2}/${lingua} ${dest}/${lingua} || die "Failed to create ${dest}/${lingua}"
749 cp -f ${src}/CMakeLists.txt kde-l10n-${lingua}-${PV} || die "Failed to prepare L10N=${1} subdir"
750 echo "add_subdirectory(${lingua})" > ${dest}/CMakeLists.txt ||
751 die "Failed to prepare ${dest}/CMakeLists.txt"
752 cp -f ${src}/${l10npart}/${2}/CMakeLists.txt ${dest}/${lingua} ||
753 die "Failed to create ${dest}/${lingua}/CMakeLists.txt"
754 sed -e "s/${2}/${lingua}/" -i ${dest}/${lingua}/CMakeLists.txt ||
755 die "Failed to prepare ${dest}/${lingua}/CMakeLists.txt"
757 _l10n_variant_subdir_buster ${1}
760 _l10n_variant_subdir_buster() {
762 [[ ${PN} = kde4-l10n ]] && l10npart=4
763 local dir=kde-l10n-$(kde_l10n2lingua ${1})-${PV}/${l10npart}/$(kde_l10n2lingua ${1})
766 5) sed -e "/^add_subdirectory(/d" -i ${dir}/CMakeLists.txt || die "Failed to cleanup ${dir} subdir" ;;
767 4) sed -e "/^macro.*subdirectory(/d" -i ${dir}/CMakeLists.txt || die "Failed to cleanup ${dir} subdir" ;;
770 for subdir in $(find ${dir} -mindepth 1 -maxdepth 1 -type d | sed -e "s:^\./::"); do
771 echo "add_subdirectory(${subdir##*/})" >> ${dir}/CMakeLists.txt