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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 1A75D15852A for ; Thu, 15 Aug 2024 17:48:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 77432E29C3; Thu, 15 Aug 2024 17:48:11 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5200AE29C3 for ; Thu, 15 Aug 2024 17:48:11 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 828DE342FF9 for ; Thu, 15 Aug 2024 17:48:10 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9449E1EF5 for ; Thu, 15 Aug 2024 17:48:07 +0000 (UTC) From: "Andreas Sturmlechner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andreas Sturmlechner" Message-ID: <1723744010.882d006f2a945587d25fc5e5b8cc520febfe7e9f.asturm@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/ecm.eclass X-VCS-Directories: eclass/ X-VCS-Committer: asturm X-VCS-Committer-Name: Andreas Sturmlechner X-VCS-Revision: 882d006f2a945587d25fc5e5b8cc520febfe7e9f X-VCS-Branch: master Date: Thu, 15 Aug 2024 17:48:07 +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-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 2474c94f-dd44-41c3-bdbf-f4e532015faa X-Archives-Hash: 9687c9451bf59e342f12b84314e546e6 commit: 882d006f2a945587d25fc5e5b8cc520febfe7e9f Author: Andreas Sturmlechner gentoo org> AuthorDate: Tue Aug 13 20:39:06 2024 +0000 Commit: Andreas Sturmlechner gentoo org> CommitDate: Thu Aug 15 17:46:50 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=882d006f ecm.eclass: For kde.org projects, try to rename metainfo file real hard - detect if we are inheriting kde.org.eclass - detect if package name is not the same as upstream name (KDE_ORG_NAME) - iterate through "${ED}"/usr/share/metainfo/ - if file contains KDE_ORG_NAME or similar, rename that to ${PN}${SLOT/0*/} - otherwise, prepend "${PN}${SLOT/0*/}-" after ^org.kde. Notably, this does not (yet?) trigger if a package ${PN} == ${KDE_ORG_NAME} but different SLOTs. Should we just do that all the time? Signed-off-by: Andreas Sturmlechner gentoo.org> eclass/ecm.eclass | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/eclass/ecm.eclass b/eclass/ecm.eclass index 3d3b9328269d..c8731b8c0cff 100644 --- a/eclass/ecm.eclass +++ b/eclass/ecm.eclass @@ -649,6 +649,9 @@ ecm_src_test() { # Wrapper for cmake_src_install. Drops executable bit from .desktop files # installed inside /usr/share/applications. This is set by cmake when install() # is called in PROGRAM form, as seen in many kde.org projects. +# In case kde.org.eclass is detected, in case KDE_ORG_NAME != PN, tries real +# hard to detect, then rename, metainfo.xml appdata files to something unique +# including SLOT if else than "0" (basically KDE_ORG_NAME -> PN+SLOT). ecm_src_install() { debug-print-function ${FUNCNAME} "$@" @@ -664,6 +667,33 @@ ecm_src_install() { fi done fi + + mv_metainfo() { + if [[ -f ${1} ]]; then + mv -v ${1} ${1/${2}/${3}} || die + fi + } + + if [[ -n ${_KDE_ORG_ECLASS} && -d "${ED}"/usr/share/metainfo/ ]]; then + if [[ ${KDE_ORG_NAME} != ${PN} ]]; then + local ecm_metainfo + pushd "${ED}"/usr/share/metainfo/ > /dev/null || die + for ecm_metainfo in find * -type f -iname "*metainfo.xml"; do + case ${ecm_metainfo} in + *${KDE_ORG_NAME}*) + mv_metainfo ${ecm_metainfo} ${KDE_ORG_NAME} ${PN}${SLOT/0*/} + ;; + *${KDE_ORG_NAME/-/_}*) + mv_metainfo ${ecm_metainfo} ${KDE_ORG_NAME/-/_} ${PN}${SLOT/0*/} + ;; + org.kde.*) + mv_metainfo ${ecm_metainfo} "org.kde." "org.kde.${PN}${SLOT/0*/}-" + ;; + esac + done + popd > /dev/null || die + fi + fi } # @FUNCTION: ecm_pkg_preinst