commit:     d4239fb331007a732aa1bf77b8dfdf8c9030e525
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 10 06:00:18 2025 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Tue Jun 10 06:13:14 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d4239fb3

x11-misc/xkeyboard-config: workaround portage collision issue

Don't really like this, but unless portage either relax its
checks or improve merging process there's probably(?) not a
better option (would still need workaround for old portage
anyway).

Can probably drop this sometime in 2+ years after 2.45 is old
enough, or if the symlink is ever removed.

Unsure if maintainer would rather the workaround done a bit
differently but that can be changed later (just do not want
to leave this broken for longer).

Closes: https://bugs.gentoo.org/957712
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 x11-misc/xkeyboard-config/xkeyboard-config-2.45.ebuild | 16 ++++++++++++++++
 x11-misc/xkeyboard-config/xkeyboard-config-9999.ebuild | 18 +++++++++++++++++-
 2 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/x11-misc/xkeyboard-config/xkeyboard-config-2.45.ebuild 
b/x11-misc/xkeyboard-config/xkeyboard-config-2.45.ebuild
index 4ebef64ae30a..374525fd7ec8 100644
--- a/x11-misc/xkeyboard-config/xkeyboard-config-2.45.ebuild
+++ b/x11-misc/xkeyboard-config/xkeyboard-config-2.45.ebuild
@@ -64,3 +64,19 @@ src_configure() {
        )
        meson_src_configure
 }
+
+src_install() {
+       meson_src_install
+
+       # Workaround for portage's collision checks, see pkg_preinst (bug 
#957712)
+       if has_version "<${CATEGORY}/${PN}-2.45"; then
+               mv "${ED}"/usr/share/X11/xkb{,.workaround} || die
+       fi
+}
+
+pkg_preinst() {
+       if [[ -L ${ED}/usr/share/X11/xkb.workaround ]]; then
+               rm -rf "${EROOT}"/usr/share/X11/xkb || die
+               mv "${ED}"/usr/share/X11/xkb{.workaround,} || die
+       fi
+}

diff --git a/x11-misc/xkeyboard-config/xkeyboard-config-9999.ebuild 
b/x11-misc/xkeyboard-config/xkeyboard-config-9999.ebuild
index d4e67dee2a23..374525fd7ec8 100644
--- a/x11-misc/xkeyboard-config/xkeyboard-config-9999.ebuild
+++ b/x11-misc/xkeyboard-config/xkeyboard-config-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -64,3 +64,19 @@ src_configure() {
        )
        meson_src_configure
 }
+
+src_install() {
+       meson_src_install
+
+       # Workaround for portage's collision checks, see pkg_preinst (bug 
#957712)
+       if has_version "<${CATEGORY}/${PN}-2.45"; then
+               mv "${ED}"/usr/share/X11/xkb{,.workaround} || die
+       fi
+}
+
+pkg_preinst() {
+       if [[ -L ${ED}/usr/share/X11/xkb.workaround ]]; then
+               rm -rf "${EROOT}"/usr/share/X11/xkb || die
+               mv "${ED}"/usr/share/X11/xkb{.workaround,} || die
+       fi
+}

Reply via email to