--- /usr/portage/app-office/libreoffice/libreoffice-25.2.6.2.ebuild	2025-09-03 10:41:45.000000000 -0600
+++ libreoffice-25.2.6.2.ebuild	2025-09-16 21:54:45.000000000 -0600
@@ -91,7 +91,7 @@
 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? (
@@ -427,6 +430,8 @@
 		-e '/CppunitTest_sw_layoutwriter/d' \
 		-e '/CppunitTest_sw_uiwriter/d' \
 		sw/Module_sw.mk || die
+	# Fails w/ 25.2.6.2 on amd64
+	sed -i -e '/CppunitTest_vcl_png_test/d'  vcl/Module_vcl.mk || die
 }
 
 src_configure() {
@@ -617,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[@]}"
 }
