commit:     9be8b8749d0f24885ab167cef881dba5b885a233
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 15 17:45:55 2022 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sat Jan 15 17:46:47 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9be8b874

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 <AT> gentoo.org>

 app-editors/emacs/emacs-29.0.9999.ebuild | 134 ++++++++++++++++++++-----------
 1 file changed, 87 insertions(+), 47 deletions(-)

diff --git a/app-editors/emacs/emacs-29.0.9999.ebuild 
b/app-editors/emacs/emacs-29.0.9999.ebuild
index d1f2256d067f..69582b7f2ff4 100644
--- a/app-editors/emacs/emacs-29.0.9999.ebuild
+++ b/app-editors/emacs/emacs-29.0.9999.ebuild
@@ -40,9 +40,59 @@ DESCRIPTION="The extensible, customizable, self-documenting 
real-time display ed
 HOMEPAGE="https://www.gnu.org/software/emacs/";
 
 LICENSE="GPL-3+ FDL-1.3+ BSD HPND MIT W3C unicode PSF-2"
-IUSE="acl alsa aqua athena cairo dbus dynamic-loading games gconf gfile gif 
+gmp gpm gsettings gtk gui gzip-el harfbuzz imagemagick +inotify jit jpeg json 
kerberos lcms libxml2 livecd m17n-lib mailutils motif png selinux sound source 
ssl svg systemd +threads tiff toolkit-scroll-bars webp wide-int Xaw3d xft +xpm 
xwidgets zlib"
+IUSE="acl alsa aqua athena cairo dbus dynamic-loading games gconf gfile gif 
+gmp gpm gsettings gtk gui gzip-el harfbuzz imagemagick +inotify jit jpeg json 
kerberos lcms libxml2 livecd m17n-lib mailutils motif png selinux sound source 
ssl svg systemd +threads tiff toolkit-scroll-bars webp wide-int +X Xaw3d xft 
+xpm xwidgets zlib"
 RESTRICT="test"
 
+X_DEPEND="x11-libs/libICE
+       x11-libs/libSM
+       x11-libs/libX11
+       x11-libs/libXext
+       x11-libs/libXfixes
+       x11-libs/libXinerama
+       x11-libs/libXrandr
+       x11-libs/libxcb
+       x11-misc/xbitmaps
+       xpm? ( x11-libs/libXpm )
+       xft? (
+               media-libs/fontconfig
+               media-libs/freetype
+               x11-libs/libXft
+               x11-libs/libXrender
+               cairo? ( >=x11-libs/cairo-1.12.18 )
+               harfbuzz? ( media-libs/harfbuzz:0= )
+               m17n-lib? (
+                       >=dev-libs/libotf-0.9.4
+                       >=dev-libs/m17n-lib-1.5.1
+               )
+       )
+       gtk? (
+               x11-libs/gtk+:3
+               xwidgets? (
+                       net-libs/webkit-gtk:4=
+                       x11-libs/libXcomposite
+               )
+       )
+       !gtk? (
+               motif? (
+                       >=x11-libs/motif-2.3:0
+                       x11-libs/libXpm
+                       x11-libs/libXmu
+                       x11-libs/libXt
+               )
+               !motif? (
+                       Xaw3d? (
+                               x11-libs/libXaw3d
+                               x11-libs/libXmu
+                               x11-libs/libXt
+                       )
+                       !Xaw3d? ( athena? (
+                               x11-libs/libXaw
+                               x11-libs/libXmu
+                               x11-libs/libXt
+                       ) )
+               )
+       )"
+
 RDEPEND="app-emacs/emacs-common[games?,gui(-)?]
        sys-libs/ncurses:0=
        acl? ( virtual/acl )
@@ -72,62 +122,30 @@ RDEPEND="app-emacs/emacs-common[games?,gui(-)?]
                webp? ( media-libs/libwebp:0= )
                imagemagick? ( >=media-gfx/imagemagick-6.6.2:0= )
                !aqua? (
-                       x11-libs/libICE
-                       x11-libs/libSM
-                       x11-libs/libX11
-                       x11-libs/libXext
-                       x11-libs/libXfixes
-                       x11-libs/libXinerama
-                       x11-libs/libXrandr
-                       x11-libs/libxcb
-                       x11-misc/xbitmaps
                        gconf? ( >=gnome-base/gconf-2.26.2 )
                        gsettings? ( >=dev-libs/glib-2.28.6 )
-                       xpm? ( x11-libs/libXpm )
-                       xft? (
+                       gtk? ( !X? (
                                media-libs/fontconfig
                                media-libs/freetype
-                               x11-libs/libXft
-                               x11-libs/libXrender
-                               cairo? ( >=x11-libs/cairo-1.12.18 )
+                               >=x11-libs/cairo-1.12.18
+                               x11-libs/gtk+:3
                                harfbuzz? ( media-libs/harfbuzz:0= )
                                m17n-lib? (
                                        >=dev-libs/libotf-0.9.4
                                        >=dev-libs/m17n-lib-1.5.1
                                )
-                       )
-                       gtk? (
-                               x11-libs/gtk+:3
-                               xwidgets? (
-                                       net-libs/webkit-gtk:4=
-                                       x11-libs/libXcomposite
-                               )
-                       )
-                       !gtk? (
-                               motif? (
-                                       >=x11-libs/motif-2.3:0
-                                       x11-libs/libXpm
-                                       x11-libs/libXmu
-                                       x11-libs/libXt
-                               )
-                               !motif? (
-                                       Xaw3d? (
-                                               x11-libs/libXaw3d
-                                               x11-libs/libXmu
-                                               x11-libs/libXt
-                                       )
-                                       !Xaw3d? ( athena? (
-                                               x11-libs/libXaw
-                                               x11-libs/libXmu
-                                               x11-libs/libXt
-                                       ) )
-                               )
-                       )
+                               xwidgets? ( net-libs/webkit-gtk:4= )
+                       ) )
+                       !gtk? ( ${X_DEPEND} )
+                       X? ( ${X_DEPEND} )
                )
        )"
 
 DEPEND="${RDEPEND}
-       gui? ( !aqua? ( x11-base/xorg-proto ) )"
+       gui? ( !aqua? (
+               !gtk? ( x11-base/xorg-proto )
+               X? ( x11-base/xorg-proto )
+       ) )"
 
 BDEPEND="sys-apps/texinfo
        virtual/pkgconfig
@@ -192,15 +210,37 @@ src_configure() {
                myconf+=" --with-sound=$(usex sound oss)"
        fi
 
+       # Emacs supports these window systems:
+       # X11, pure GTK (without X11), or Nextstep (Aqua/Cocoa).
+       # General GUI support is enabled by the "gui" USE flag, then
+       # the window system is selected as follows:
+       #   "aqua" -> Nextstep
+       #   "gtk -X" -> pure GTK
+       #   otherwise -> X11
+       # For X11 there is the further choice of toolkits GTK, Motif,
+       # Athena (Lucid), or no toolkit. They are enabled (in order of
+       # preference) with the "gtk", "motif", "Xaw3d", and "athena" flags.
+
        if ! use gui; then
                einfo "Configuring to build without window system support"
-               myconf+=" --without-x --without-ns"
+               myconf+=" --without-x --without-pgtk --without-ns"
        elif use aqua; then
                einfo "Configuring to build with Nextstep (Macintosh Cocoa) 
support"
                myconf+=" --with-ns --disable-ns-self-contained"
-               myconf+=" --without-x"
+               myconf+=" --without-x --without-pgtk"
+       elif use gtk || ! use X; then
+               einfo "Configuring to build with pure GTK (without X11) support"
+               myconf+=" --with-pgtk --without-x --without-ns"
+               myconf+=" $(use_with gconf)"
+               myconf+=" $(use_with gsettings)"
+               myconf+=" $(use_with toolkit-scroll-bars)"
+               myconf+=" $(use_with harfbuzz)"
+               myconf+=" $(use_with m17n-lib libotf)"
+               myconf+=" $(use_with m17n-lib m17n-flt)"
+               myconf+=" $(use_with xwidgets)"
        else
-               myconf+=" --with-x --without-ns"
+               # X11
+               myconf+=" --with-x --without-pgtk --without-ns"
                myconf+=" $(use_with gconf)"
                myconf+=" $(use_with gsettings)"
                myconf+=" $(use_with toolkit-scroll-bars)"

Reply via email to