From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 5CDC2138306 for ; Wed, 13 Jul 2016 18:23:40 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6F95F21C25F; Wed, 13 Jul 2016 18:23:37 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 9A9CE21C25F for ; Wed, 13 Jul 2016 18:23:36 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8B8CB340CF2 for ; Wed, 13 Jul 2016 18:23:35 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id ABDB82452 for ; Wed, 13 Jul 2016 18:23:31 +0000 (UTC) From: "Johannes Huber" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Johannes Huber" Message-ID: <1468434112.887c2ec6d8ca7ddf7cb39ffa320043747e9add2e.johu@gentoo> Subject: [gentoo-commits] proj/kde:master commit in: eclass/ X-VCS-Repository: proj/kde X-VCS-Files: eclass/kde5.eclass X-VCS-Directories: eclass/ X-VCS-Committer: johu X-VCS-Committer-Name: Johannes Huber X-VCS-Revision: 887c2ec6d8ca7ddf7cb39ffa320043747e9add2e X-VCS-Branch: master Date: Wed, 13 Jul 2016 18:23:31 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 10ea27fe-c70a-4345-801f-23a2d1b0a55f X-Archives-Hash: 379a3409ac3f524541f76c019d119486 commit: 887c2ec6d8ca7ddf7cb39ffa320043747e9add2e Author: Andreas Sturmlechner gmail com> AuthorDate: Sun Jul 10 18:06:59 2016 +0000 Commit: Johannes Huber gentoo org> CommitDate: Wed Jul 13 18:21:52 2016 +0000 URL: https://gitweb.gentoo.org/proj/kde.git/commit/?id=887c2ec6 kde5.eclass: Prepare for re-use of code w/ kde4-l10n Signed-off-by: Johannes Huber gentoo.org> eclass/kde5.eclass | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/eclass/kde5.eclass b/eclass/kde5.eclass index 763029c..8e6a6f1 100644 --- a/eclass/kde5.eclass +++ b/eclass/kde5.eclass @@ -471,11 +471,13 @@ kde5_src_unpack() { ;; esac elif [[ ${KDEBASE} = kdel10n ]]; then + local l10npart=5 + [[ ${PN} = kde4-l10n ]] && l10npart=4 mkdir -p "${S}" || die "Failed to create source dir ${S}" cd "${S}" for my_tar in ${A}; do tar -xpf "${DISTDIR}/${my_tar}" --xz \ - "${my_tar/.tar.xz/}/CMakeLists.txt" "${my_tar/.tar.xz/}/5" 2> /dev/null || + "${my_tar/.tar.xz/}/CMakeLists.txt" "${my_tar/.tar.xz/}/${l10npart}" 2> /dev/null || elog "${my_tar}: tar extract command failed at least partially - continuing" done else @@ -490,12 +492,14 @@ kde5_src_prepare() { debug-print-function ${FUNCNAME} "$@" if [[ ${KDEBASE} = kdel10n ]]; then + local l10npart=5 + [[ ${PN} = kde4-l10n ]] && l10npart=4 # move known variant subdirs to root dir, currently sr@* use_if_iuse l10n_sr-ijekavsk && _l10n_variant_subdir2root sr-ijekavsk sr use_if_iuse l10n_sr-Latn-ijekavsk && _l10n_variant_subdir2root sr-Latn-ijekavsk sr use_if_iuse l10n_sr-Latn && _l10n_variant_subdir2root sr-Latn sr if use_if_iuse l10n_sr; then - rm -rf kde-l10n-sr-${PV}/5/sr/sr@* || die "Failed to cleanup L10N=sr" + rm -rf kde-l10n-sr-${PV}/${l10npart}/sr/sr@* || die "Failed to cleanup L10N=sr" _l10n_variant_subdir_buster sr elif [[ -d kde-l10n-sr-${PV} ]]; then # having any variant selected means parent lingua will be unpacked as well @@ -510,9 +514,13 @@ $(printf "add_subdirectory( %s )\n" \ `find . -mindepth 1 -maxdepth 1 -type d | sed -e "s:^\./::"`) EOF - # drop KDE4-based part - find -maxdepth 2 -type f -name CMakeLists.txt -exec \ - sed -i -e "/add_subdirectory(4)/ s/^/#DONT/" {} + || die + # for KF5: drop KDE4-based part; for KDE4: drop KF5-based part + case ${l10npart} in + 5) find -maxdepth 2 -type f -name CMakeLists.txt -exec \ + sed -i -e "/add_subdirectory(4)/ s/^/#DONT/" {} + || die ;; + 4) find -maxdepth 2 -type f -name CMakeLists.txt -exec \ + sed -i -e "/add_subdirectory(5)/ s/^/#DONT/" {} + || die ;; + esac fi cmake-utils_src_prepare @@ -791,17 +799,19 @@ kde5_pkg_postrm() { } _l10n_variant_subdir2root() { + local l10npart=5 + [[ ${PN} = kde4-l10n ]] && l10npart=4 local lingua=$(kde_l10n2lingua ${1}) local src=kde-l10n-${2}-${PV} - local dest=kde-l10n-${lingua}-${PV}/5 + local dest=kde-l10n-${lingua}-${PV}/${l10npart} # create variant rootdir structure from parent lingua and adapt it mkdir -p ${dest} || die "Failed to create ${dest}" - mv ${src}/5/${2}/${lingua} ${dest}/${lingua} || die "Failed to create ${dest}/${lingua}" + mv ${src}/${l10npart}/${2}/${lingua} ${dest}/${lingua} || die "Failed to create ${dest}/${lingua}" cp -f ${src}/CMakeLists.txt kde-l10n-${lingua}-${PV} || die "Failed to prepare L10N=${1} subdir" echo "add_subdirectory(${lingua})" > ${dest}/CMakeLists.txt || die "Failed to prepare ${dest}/CMakeLists.txt" - cp -f ${src}/5/${2}/CMakeLists.txt ${dest}/${lingua} || + cp -f ${src}/${l10npart}/${2}/CMakeLists.txt ${dest}/${lingua} || die "Failed to create ${dest}/${lingua}/CMakeLists.txt" sed -e "s/${2}/${lingua}/" -i ${dest}/${lingua}/CMakeLists.txt || die "Failed to prepare ${dest}/${lingua}/CMakeLists.txt" @@ -810,9 +820,14 @@ _l10n_variant_subdir2root() { } _l10n_variant_subdir_buster() { - local dir=kde-l10n-$(kde_l10n2lingua ${1})-${PV}/5/$(kde_l10n2lingua ${1}) + local l10npart=5 + [[ ${PN} = kde4-l10n ]] && l10npart=4 + local dir=kde-l10n-$(kde_l10n2lingua ${1})-${PV}/${l10npart}/$(kde_l10n2lingua ${1}) - sed -e "/^add_subdirectory(/d" -i ${dir}/CMakeLists.txt || die "Failed to cleanup ${dir} subdir" + case ${l10npart} in + 5) sed -e "/^add_subdirectory(/d" -i ${dir}/CMakeLists.txt || die "Failed to cleanup ${dir} subdir" ;; + 4) sed -e "/^macro.*subdirectory(/d" -i ${dir}/CMakeLists.txt || die "Failed to cleanup ${dir} subdir" ;; + esac for subdir in $(find ${dir} -mindepth 1 -maxdepth 1 -type d | sed -e "s:^\./::"); do echo "add_subdirectory(${subdir##*/})" >> ${dir}/CMakeLists.txt