From 2b03957f90dc4c5ae3df044aaacbe95143b4591d Mon Sep 17 00:00:00 2001 From: Sam James Date: Sat, 14 Dec 2024 17:32:36 +0000 Subject: [PATCH] dev-build/cmake: add warning on bad /etc/*-release files Prompted by (yet another) post on this, see https://forums.gentoo.org/viewtopic-t-1170229.html. Bug: https://bugs.gentoo.org/599684 Bug: https://bugs.gentoo.org/753581 Signed-off-by: Sam James --- dev-build/cmake/cmake-3.31.2.ebuild | 11 +++++++++++ dev-build/cmake/cmake-9999.ebuild | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/dev-build/cmake/cmake-3.31.2.ebuild b/dev-build/cmake/cmake-3.31.2.ebuild index e9982cd799b4f..77333d9623b15 100644 --- a/dev-build/cmake/cmake-3.31.2.ebuild +++ b/dev-build/cmake/cmake-3.31.2.ebuild @@ -277,6 +277,17 @@ src_install() { } pkg_postinst() { + if [[ -z ${EPREFIX} ]] ; then + local file + # See bug #599684 and bug #753581 (at least) + for file in /etc/arch-release /etc/redhat-release /etc/debian_version ; do + eerror "Errant ${file} found!" + eerror "The presence of these files is known to confuse CMake's" + eerror "library path logic. Please (re)move this file:" + eerror " mv ${file} ${file}.bak" + done + fi + if use gui; then xdg_icon_cache_update xdg_desktop_database_update diff --git a/dev-build/cmake/cmake-9999.ebuild b/dev-build/cmake/cmake-9999.ebuild index 57684e5cd2298..214e75342d3c6 100644 --- a/dev-build/cmake/cmake-9999.ebuild +++ b/dev-build/cmake/cmake-9999.ebuild @@ -278,6 +278,17 @@ src_install() { } pkg_postinst() { + if [[ -z ${EPREFIX} ]] ; then + local file + # See bug #599684 and bug #753581 (at least) + for file in /etc/arch-release /etc/redhat-release /etc/debian_version ; do + eerror "Errant ${file} found!" + eerror "The presence of these files is known to confuse CMake's" + eerror "library path logic. Please (re)move this file:" + eerror " mv ${file} ${file}.bak" + done + fi + if use gui; then xdg_icon_cache_update xdg_desktop_database_update