From 604adf973a514f8fc8dc550ebd884ae5ce9a6e82 Mon Sep 17 00:00:00 2001 From: Joseph Mingrone Date: Tue, 23 Apr 2024 14:11:39 -0300 Subject: [PATCH] Emacs: Add new wayland flavor Emacs requires mutually exclusive build parameters depending on whether the user is running under X11 or Wayland. Rather than require either set of users to build a custom package, create a new wayland flavor, and use default options appropriate for users running under X. PR: 278167 Reviewed by: ashish, jbeich Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D44917 --- Mk/Uses/emacs.mk | 2 +- editors/emacs/Makefile | 31 ++++++++++++++++++++----------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/Mk/Uses/emacs.mk b/Mk/Uses/emacs.mk index d601390f0569..8161e980491b 100644 --- a/Mk/Uses/emacs.mk +++ b/Mk/Uses/emacs.mk @@ -79,7 +79,7 @@ _EMACS_RUN_DEP= yes # Only set FLAVORS when... . if defined(_EMACS_RUN_DEP) && !defined(_EMACS_NOFLAVORS) -FLAVORS= full canna nox devel_full devel_nox +FLAVORS= full canna nox wayland devel_full devel_nox # Sort the default to be first . if defined(EMACS_DEFAULT) FLAVORS:= ${EMACS_DEFAULT} ${FLAVORS:N${EMACS_DEFAULT}} diff --git a/editors/emacs/Makefile b/editors/emacs/Makefile index c360b176d7e5..ce8aaac2ea4f 100644 --- a/editors/emacs/Makefile +++ b/editors/emacs/Makefile @@ -1,6 +1,6 @@ PORTNAME= emacs DISTVERSION= 29.3 -PORTREVISION= 1 +PORTREVISION= 2 PORTEPOCH= 3 CATEGORIES= editors MASTER_SITES= GNU @@ -15,20 +15,23 @@ COMMENT= GNU editing macros ${COMMENT_${FLAVOR}} WWW= https://www.gnu.org/software/emacs/ COMMENT_nox= (No X flavor) COMMENT_canna= (Canna Japanese input flavor) +COMMENT_wayland= (Wayland flavor) LICENSE= GPLv3+ LICENSE_FILE= ${WRKSRC}/COPYING LIB_DEPENDS= libgmp.so:math/gmp -FLAVORS= full canna nox +FLAVORS= full canna nox wayland canna_PKGNAMESUFFIX= -canna canna_LIB_DEPENDS= libcanna.so:japanese/canna-lib -canna_CONFLICTS_INSTALL= emacs emacs-nox +canna_CONFLICTS_INSTALL= emacs emacs-nox emacs-wayland canna_DESCR= ${.CURDIR}/pkg-descr-canna -full_CONFLICTS_INSTALL= emacs-canna emacs-nox +full_CONFLICTS_INSTALL= emacs-canna emacs-nox emacs-wayland nox_PKGNAMESUFFIX= -nox -nox_CONFLICTS_INSTALL= emacs emacs-canna +nox_CONFLICTS_INSTALL= emacs emacs-canna emacs-wayland +wayland_PKGNAMESUFFIX= -wayland +wayland_CONFLICTS_INSTALL= emacs emacs-canna emacs-nox USES= cpe gmake localbase:ldflags ncurses pkgconfig tar:xz CPE_VENDOR= gnu @@ -42,8 +45,7 @@ CONFIGURE_ARGS= --disable-build-details \ --without-selinux .if ${FLAVOR:U} == canna CONFIGURE_ARGS+= --with-canna -.endif -.if ${FLAVOR:U} == nox +.elif ${FLAVOR:U} == nox CONFIGURE_ARGS+= --with-sound=no \ --with-x-toolkit=no \ --without-cairo \ @@ -66,6 +68,8 @@ CONFIGURE_ARGS+= --with-sound=no \ --without-xim \ --without-xpm \ --without-xwidgets +.elif ${FLAVOR:U} == wayland +CONFIGURE_ARGS+= --without-x .else CONFIGURE_ARGS+= --with-x .endif @@ -102,16 +106,21 @@ OPTIONS_DEFINE= ACL DBUS GNUTLS GSETTINGS HARFBUZZ JSON LCMS2 \ XFT XIM XML XWIDGETS OPTIONS_DEFAULT= ACL CAIRO DBUS GIF GNUTLS GSETTINGS GTK3 \ HARFBUZZ JPEG JSON KQUEUE LCMS2 MAILUTILS \ - MODULES OSS SCROLLBARS SOURCES SQLITE3 SVG \ - THREADS TIFF TREESITTER WEBP XML + MODULES OSS PNG SCROLLBARS SOURCES SQLITE3 SVG \ + THREADS TIFF TREESITTER WEBP XIM XML OPTIONS_GROUP= GRAPHICS OPTIONS_GROUP_GRAPHICS= CAIRO GIF JPEG MAGICK PNG SVG TIFF WEBP XPM OPTIONS_RADIO= FILENOTIFY SOUND X11TOOLKIT OPTIONS_RADIO_FILENOTIFY= GFILE KQUEUE OPTIONS_RADIO_SOUND= ALSA OSS OPTIONS_RADIO_X11TOOLKIT= GTK2 GTK3 MOTIF XAW XAW3D -.if ${FLAVOR:U} == nox -OPTIONS_EXCLUDE= ALSA CAIRO DBUS GFILE GIF GSETTINGS GTK2 GTK3 \ +.if ${FLAVOR:U} == wayland +OPTIONS_EXCLUDE+= GTK2 MOTIF XAW XAW3D XIM ${PGTK_PREVENTS} \ + ${PGTK_IMPLIES:@i@${${i}_PREVENTS}@} +OPTIONS_SLAVE+= PGTK ${PGTK_IMPLIES} \ + ${PGTK_IMPLIES:@i@${${i}_IMPLIES}@} +.elif ${FLAVOR:U} == nox +OPTIONS_EXCLUDE+= ALSA CAIRO DBUS GFILE GIF GSETTINGS GTK2 GTK3 \ HARFBUZZ JPEG LCMS2 M17N MAGICK MOTIF OSS OTF \ PGTK PNG SCROLLBARS SVG TIFF WEBP XAW XAW3D XFT \ XIM XPM XWIDGETS