The long awaited pure gtk implementation was recently merged into master. I'm 95% sure just adding the `--with-pgtk` flag will add it. From skimming through configure.ac, it looks like the pgtk flag autuomatically enables `--with-x-toolkit=gtk3`, so I think it would possible to add `myconf += " (use_with pgtk)"` right after the gtk3 is selected without making any compicated logic changes. Also, I've been running a version of 29.0.9999 that I customized to add the pgtk flag for a few weeks without any issues, if that counts for anything.
Unfortunately it is more complicated. pgtk is chosen at the "window system" level, as another case in addition to X11 and aqua. Dependencies also change, i.e. with pure gtk most (all?) of the X11 ones can be dropped. Not entirely sure yet how to handle this (if it was trivial it would be in the tree already). One possibility would be to enable X11, pgtk, and aqua with USE="X", USE="gtk -X", and USE="aqua" respectively. (This will make the "gui" flag pretty much redundant, so we may even drop it.)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9be8b8749d0f24885ab167cef881dba5b885a233 commit 9be8b8749d0f24885ab167cef881dba5b885a233 Author: Ulrich Müller <ulm@gentoo.org> AuthorDate: 2022-01-15 17:45:55 +0000 Commit: Ulrich Müller <ulm@gentoo.org> CommitDate: 2022-01-15 17:46:47 +0000 app-editors/emacs: Support pure GTK Emacs 29 will support window systems X11, pure GTK (without X11), or Nextstep (Aqua/Cocoa). The ebuild selects these as follows: "aqua" -> Nextstep "gtk -X" -> pure GTK otherwise -> X11 Closes: https://bugs.gentoo.org/831154 Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Ulrich Müller <ulm@gentoo.org> app-editors/emacs/emacs-29.0.9999.ebuild | 134 ++++++++++++++++++++----------- 1 file changed, 87 insertions(+), 47 deletions(-)