commit:     6784708d340a364ea695a4d26f9d2858e92ff34e
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 23 17:06:17 2018 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Thu Aug 23 17:08:37 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6784708d

app-editors/emacs: Reorganise gtk* flags.

As discussed with leio in #gentoo-dev and in #gentoo-qa.
- USE="gtk -gtk2" for GTK+ version 3,
- USE="gtk gtk2" for GTK+ version 2,
- USE="-gtk" for no GTK+ (the "gtk2" flag has no effect).

Package-Manager: Portage-2.3.48, Repoman-2.3.10

 app-editors/emacs/emacs-24.5-r6.ebuild             |  8 ++--
 app-editors/emacs/emacs-25.3-r5.ebuild             | 16 +++-----
 .../{emacs-25.3-r5.ebuild => emacs-26.1-r2.ebuild} | 47 ++++++++++++++--------
 app-editors/emacs/metadata.xml                     |  2 +
 4 files changed, 42 insertions(+), 31 deletions(-)

diff --git a/app-editors/emacs/emacs-24.5-r6.ebuild 
b/app-editors/emacs/emacs-24.5-r6.ebuild
index 60e4ab07cbd..3babea9437c 100644
--- a/app-editors/emacs/emacs-24.5-r6.ebuild
+++ b/app-editors/emacs/emacs-24.5-r6.ebuild
@@ -13,7 +13,7 @@ SRC_URI="mirror://gnu/emacs/${P}.tar.xz
 LICENSE="GPL-3+ FDL-1.3+ BSD HPND MIT W3C unicode PSF-2"
 SLOT="24"
 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 
~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
-IUSE="acl alsa aqua athena dbus games gconf gfile gif gpm gsettings gtk +gtk3 
gzip-el imagemagick +inotify jpeg kerberos libxml2 livecd m17n-lib motif png 
selinux sound source ssl svg tiff toolkit-scroll-bars wide-int X Xaw3d xft +xpm 
zlib"
+IUSE="acl alsa aqua athena dbus games gconf gfile gif gpm gsettings gtk gtk2 
gzip-el imagemagick +inotify jpeg kerberos libxml2 livecd m17n-lib motif png 
selinux sound source ssl svg tiff toolkit-scroll-bars wide-int X Xaw3d xft +xpm 
zlib"
 REQUIRED_USE="?? ( aqua X )"
 
 RDEPEND="sys-libs/ncurses:0=
@@ -58,8 +58,8 @@ RDEPEND="sys-libs/ncurses:0=
                        )
                )
                gtk? (
-                       gtk3? ( x11-libs/gtk+:3 )
-                       !gtk3? ( x11-libs/gtk+:2 )
+                       gtk2? ( x11-libs/gtk+:2 )
+                       !gtk2? ( x11-libs/gtk+:3 )
                )
                !gtk? (
                        motif? (
@@ -175,7 +175,7 @@ src_configure() {
                                recommended that you compile Emacs with the 
Athena/Lucid or the
                                Motif toolkit instead.
                        EOF
-                       myconf+=" --with-x-toolkit=$(usex gtk3 gtk3 gtk2)"
+                       myconf+=" --with-x-toolkit=$(usex gtk2 gtk2 gtk3)"
                        for f in motif Xaw3d athena; do
                                use ${f} && ewarn \
                                        "USE flag \"${f}\" has no effect if 
\"gtk\" is set."

diff --git a/app-editors/emacs/emacs-25.3-r5.ebuild 
b/app-editors/emacs/emacs-25.3-r5.ebuild
index 7d43a6b1ab3..ad5be25089c 100644
--- a/app-editors/emacs/emacs-25.3-r5.ebuild
+++ b/app-editors/emacs/emacs-25.3-r5.ebuild
@@ -13,7 +13,7 @@ SRC_URI="mirror://gnu/emacs/${P}.tar.xz
 LICENSE="GPL-3+ FDL-1.3+ BSD HPND MIT W3C unicode PSF-2"
 SLOT="25"
 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~sh 
~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos 
~x86-macos"
-IUSE="acl alsa aqua athena cairo dbus dynamic-loading games gconf gfile gif 
gpm gsettings gtk +gtk3 gzip-el imagemagick +inotify jpeg kerberos libxml2 
livecd m17n-lib motif png selinux sound source ssl svg tiff toolkit-scroll-bars 
wide-int X Xaw3d xft +xpm zlib"
+IUSE="acl alsa aqua athena cairo dbus dynamic-loading games gconf gfile gif 
gpm gsettings gtk gtk2 gzip-el imagemagick +inotify jpeg kerberos libxml2 
livecd m17n-lib motif png selinux sound source ssl svg tiff toolkit-scroll-bars 
wide-int X Xaw3d xft +xpm zlib"
 REQUIRED_USE="?? ( aqua X )"
 
 RDEPEND="sys-libs/ncurses:0=
@@ -61,8 +61,8 @@ RDEPEND="sys-libs/ncurses:0=
                        )
                )
                gtk? (
-                       gtk3? ( x11-libs/gtk+:3 )
-                       !gtk3? ( x11-libs/gtk+:2 )
+                       gtk2? ( x11-libs/gtk+:2 )
+                       !gtk2? ( x11-libs/gtk+:3 )
                )
                !gtk? (
                        motif? (
@@ -181,12 +181,8 @@ src_configure() {
                                recommended that you compile Emacs with the 
Athena/Lucid or the
                                Motif toolkit instead.
                        EOF
-                       #if use xwidgets; then
-                       #       myconf+=" --with-x-toolkit=gtk3 --with-xwidgets"
-                       #else
-                               myconf+=" --with-x-toolkit=$(usex gtk3 gtk3 
gtk2)"
-                               myconf+=" --without-xwidgets"
-                       #fi
+                       myconf+=" --with-x-toolkit=$(usex gtk2 gtk2 gtk3)"
+                       myconf+=" --without-xwidgets"
                        for f in motif Xaw3d athena; do
                                use ${f} && ewarn \
                                        "USE flag \"${f}\" has no effect if 
\"gtk\" is set."
@@ -205,8 +201,6 @@ src_configure() {
                        einfo "Configuring to build with no toolkit"
                        myconf+=" --with-x-toolkit=no"
                fi
-               #! use gtk && use xwidgets && ewarn \
-               #       "USE flag \"xwidgets\" has no effect if \"gtk\" is not 
set."
        elif use aqua; then
                einfo "Configuring to build with Nextstep (Cocoa) support"
                myconf+=" --with-ns --disable-ns-self-contained"

diff --git a/app-editors/emacs/emacs-25.3-r5.ebuild 
b/app-editors/emacs/emacs-26.1-r2.ebuild
similarity index 89%
copy from app-editors/emacs/emacs-25.3-r5.ebuild
copy to app-editors/emacs/emacs-26.1-r2.ebuild
index 7d43a6b1ab3..123cb6e277c 100644
--- a/app-editors/emacs/emacs-25.3-r5.ebuild
+++ b/app-editors/emacs/emacs-26.1-r2.ebuild
@@ -11,24 +11,27 @@ SRC_URI="mirror://gnu/emacs/${P}.tar.xz
        https://dev.gentoo.org/~ulm/emacs/${P}-patches-1.tar.xz";
 
 LICENSE="GPL-3+ FDL-1.3+ BSD HPND MIT W3C unicode PSF-2"
-SLOT="25"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~sh 
~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos 
~x86-macos"
-IUSE="acl alsa aqua athena cairo dbus dynamic-loading games gconf gfile gif 
gpm gsettings gtk +gtk3 gzip-el imagemagick +inotify jpeg kerberos libxml2 
livecd m17n-lib motif png selinux sound source ssl svg tiff toolkit-scroll-bars 
wide-int X Xaw3d xft +xpm zlib"
+SLOT="26"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc 
~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos 
~x86-macos"
+IUSE="acl alsa aqua athena cairo dbus dynamic-loading games gconf gfile gif 
gpm gsettings gtk gtk2 gzip-el imagemagick +inotify jpeg kerberos lcms libxml2 
livecd m17n-lib mailutils motif png selinux sound source ssl svg systemd 
+threads tiff toolkit-scroll-bars wide-int X Xaw3d xft +xpm xwidgets zlib"
 REQUIRED_USE="?? ( aqua X )"
 
 RDEPEND="sys-libs/ncurses:0=
        >=app-eselect/eselect-emacs-1.16
        >=app-emacs/emacs-common-gentoo-1.5[games?,X?]
-       net-libs/liblockfile
        acl? ( virtual/acl )
        alsa? ( media-libs/alsa-lib )
        dbus? ( sys-apps/dbus )
        gpm? ( sys-libs/gpm )
        !inotify? ( gfile? ( >=dev-libs/glib-2.28.6 ) )
        kerberos? ( virtual/krb5 )
+       lcms? ( media-libs/lcms:2 )
        libxml2? ( >=dev-libs/libxml2-2.2.0 )
+       mailutils? ( net-mail/mailutils[clients] )
+       !mailutils? ( net-libs/liblockfile )
        selinux? ( sys-libs/libselinux )
        ssl? ( net-libs/gnutls:0= )
+       systemd? ( sys-apps/systemd )
        zlib? ( sys-libs/zlib )
        X? (
                x11-libs/libICE
@@ -61,8 +64,14 @@ RDEPEND="sys-libs/ncurses:0=
                        )
                )
                gtk? (
-                       gtk3? ( x11-libs/gtk+:3 )
-                       !gtk3? ( x11-libs/gtk+:2 )
+                       gtk2? ( x11-libs/gtk+:2 )
+                       !gtk2? (
+                               x11-libs/gtk+:3
+                               xwidgets? (
+                                       net-libs/webkit-gtk:4=
+                                       x11-libs/libXcomposite
+                               )
+                       )
                )
                !gtk? (
                        motif? (
@@ -113,7 +122,6 @@ src_prepare() {
                || die "unable to sed ctags.1"
 
        #AT_M4DIR=m4 eautoreconf
-       #touch src/stamp-h.in || die
 }
 
 src_configure() {
@@ -181,12 +189,13 @@ src_configure() {
                                recommended that you compile Emacs with the 
Athena/Lucid or the
                                Motif toolkit instead.
                        EOF
-                       #if use xwidgets; then
-                       #       myconf+=" --with-x-toolkit=gtk3 --with-xwidgets"
-                       #else
-                               myconf+=" --with-x-toolkit=$(usex gtk3 gtk3 
gtk2)"
-                               myconf+=" --without-xwidgets"
-                       #fi
+                       if use gtk2; then
+                               myconf+=" --with-x-toolkit=gtk2 
--without-xwidgets"
+                               use xwidgets && ewarn \
+                                       "USE flag \"xwidgets\" has no effect if 
\"gtk2\" is set."
+                       else
+                               myconf+=" --with-x-toolkit=gtk3 $(use_with 
xwidgets)"
+                       fi
                        for f in motif Xaw3d athena; do
                                use ${f} && ewarn \
                                        "USE flag \"${f}\" has no effect if 
\"gtk\" is set."
@@ -205,8 +214,8 @@ src_configure() {
                        einfo "Configuring to build with no toolkit"
                        myconf+=" --with-x-toolkit=no"
                fi
-               #! use gtk && use xwidgets && ewarn \
-               #       "USE flag \"xwidgets\" has no effect if \"gtk\" is not 
set."
+               ! use gtk && use xwidgets && ewarn \
+                       "USE flag \"xwidgets\" has no effect if \"gtk\" is not 
set."
        elif use aqua; then
                einfo "Configuring to build with Nextstep (Cocoa) support"
                myconf+=" --with-ns --disable-ns-self-contained"
@@ -220,18 +229,23 @@ src_configure() {
                --infodir="${EPREFIX}"/usr/share/info/${EMACS_SUFFIX} \
                --localstatedir="${EPREFIX}"/var \
                
--enable-locallisppath="${EPREFIX}/etc/emacs:${EPREFIX}${SITELISP}" \
-               --with-gameuser=":gamestat" \
                --without-compress-install \
                --without-hesiod \
+               --without-pop \
                --with-file-notification=$(usev inotify || usev gfile || echo 
no) \
                $(use_enable acl) \
                $(use_with dbus) \
                $(use_with dynamic-loading modules) \
+               $(use_with games gameuser ":gamestat") \
                $(use_with gpm) \
                $(use_with kerberos) $(use_with kerberos kerberos5) \
+               $(use_with lcms lcms2) \
                $(use_with libxml2 xml2) \
+               $(use_with mailutils) \
                $(use_with selinux) \
                $(use_with ssl gnutls) \
+               $(use_with systemd libsystemd) \
+               $(use_with threads) \
                $(use_with wide-int) \
                $(use_with zlib) \
                ${myconf}
@@ -259,6 +273,7 @@ src_install () {
        # avoid collision between slots, see bug #169033 e.g.
        rm "${ED}"/usr/share/emacs/site-lisp/subdirs.el
        rm -rf "${ED}"/usr/share/{appdata,applications,icons}
+       rm -rf "${ED}/usr/$(get_libdir)"
        rm -rf "${ED}"/var
 
        # remove unused <version>/site-lisp dir

diff --git a/app-editors/emacs/metadata.xml b/app-editors/emacs/metadata.xml
index b3f71c734b1..c03b6b3d083 100644
--- a/app-editors/emacs/metadata.xml
+++ b/app-editors/emacs/metadata.xml
@@ -31,6 +31,8 @@
     notification</flag>
   <flag name="gsettings">Use gsettings (<pkg>dev-libs/glib</pkg>) to read the
     system font name</flag>
+  <flag name="gtk2">Prefer version 2 of the GIMP Toolkit to version 3
+    (<pkg>x11-libs/gtk+</pkg>)</flag>
   <flag name="gtk3">Prefer version 3 of the GIMP Toolkit to version 2
     (<pkg>x11-libs/gtk+</pkg>)</flag>
   <flag name="gzip-el">Compress bundled Emacs Lisp source</flag>

Reply via email to