--- /usr/portage/app-office/libreoffice/libreoffice-25.2.5.2.ebuild	2025-08-10 13:11:22.000000000 -0600
+++ libreoffice-25.2.5.2.ebuild	2025-08-16 17:42:41.000000000 -0600
@@ -85,13 +85,13 @@
 SLOT="0"
 
 [[ ${MY_PV} == *9999* ]] || \
-KEYWORDS="amd64 ~arm arm64 ~loong ppc64 ~riscv ~x86 ~amd64-linux"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ppc64 ~riscv ~x86 ~amd64-linux"
 
 # Extensions that need extra work:
 LO_EXTS="nlpsolver scripting-beanshell scripting-javascript wiki-publisher"
 
 IUSE="accessibility base bluetooth +branding coinmp +cups custom-cflags +dbus debug eds
-googledrive gstreamer +gtk3 gtk4 kde ldap +mariadb odk pdfimport postgres qt6 test valgrind vulkan
+googledrive gstreamer +gtk3 gtk4 kde ldap +mariadb odk pdfimport postgres qt6 test valgrind vulkan wayland
 $(printf 'libreoffice_extensions_%s ' ${LO_EXTS})"
 
 REQUIRED_USE="${PYTHON_REQUIRED_USE}
@@ -102,6 +102,7 @@
 	libreoffice_extensions_scripting-beanshell? ( java )
 	libreoffice_extensions_scripting-javascript? ( java )
 	libreoffice_extensions_wiki-publisher? ( java )
+	wayland? ( || ( gtk3 gtk4 ) )
 "
 
 RESTRICT="!test? ( test )"
@@ -198,7 +199,8 @@
 		dev-libs/glib:2
 		gnome-base/dconf
 		media-libs/mesa[egl(+)]
-		x11-libs/gtk+:3[wayland,X]
+		wayland? ( x11-libs/gtk+:3[X,wayland] )
+		!wayland? ( x11-libs/gtk+:3[X] )
 		x11-libs/pango
 	)
 	gtk4? (
@@ -206,7 +208,8 @@
 		dev-libs/glib:2
 		gnome-base/dconf
 		media-libs/mesa[egl(+)]
-		gui-libs/gtk:4[wayland,X]
+		wayland? ( gui-libs/gtk:4[X,wayland] )
+		!wayland? ( gui-libs/gtk:4[X] )
 		x11-libs/pango
 	)
 	kde? (
@@ -426,6 +429,9 @@
 		-e '/CppunitTest_sw_layoutwriter/d' \
 		-e '/CppunitTest_sw_uiwriter/d' \
 		sw/Module_sw.mk || die
+	# Fails w/ 25.2.5.2 on amd64
+	sed -i -e '/CppunitTest_vcl_png_test/d'  vcl/Module_vcl.mk || die
+	sed -i -e '/CppunitTest_sw_unowriter/d'  sw/Module_sw.mk || die
 }
 
 src_configure() {
@@ -616,6 +622,10 @@
 
 	tc-is-lto && myeconfargs+=( --enable-lto )
 
+	# defang automagic dependencies
+	#use X || append-flags -DGENTOO_GTK_HIDE_X11
+	use wayland || append-flags -DGENTOO_GTK_HIDE_WAYLAND
+
 	MARIADBCONFIG="$(type -p $(usex mariadb mariadb mysql)_config)" \
 	econf "${myeconfargs[@]}"
 }
