From 993a4bbf26bc8209701f520fd4cb5f60c669cd1a Mon Sep 17 00:00:00 2001 From: TANIGUCHI Masaya Date: Fri, 5 Sep 2025 22:27:37 +0900 Subject: [PATCH] emacs: enable xwidgets support on Darwin (#434941) --- pkgs/applications/editors/emacs/make-emacs.nix | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/editors/emacs/make-emacs.nix b/pkgs/applications/editors/emacs/make-emacs.nix index cc5df12f973e..e3a882b1afb1 100644 --- a/pkgs/applications/editors/emacs/make-emacs.nix +++ b/pkgs/applications/editors/emacs/make-emacs.nix @@ -95,10 +95,11 @@ withX ? !(stdenv.hostPlatform.isDarwin || noGui || withPgtk), withXinput2 ? withX, withXwidgets ? - !stdenv.hostPlatform.isDarwin - && !noGui - && (withGTK3 || withPgtk) - && (lib.versionOlder version "30"), # XXX: upstream bug 66068 precludes newer versions of webkit2gtk (https://lists.gnu.org/archive/html/bug-gnu-emacs/2024-09/msg00695.html) + !noGui + && (withGTK3 || withPgtk || withNS || variant == "macport") + && (stdenv.hostPlatform.isDarwin || lib.versionOlder version "30"), + # XXX: - upstream bug 66068 precludes newer versions of webkit2gtk (https://lists.gnu.org/archive/html/bug-gnu-emacs/2024-09/msg00695.html) + # XXX: - Apple_SDK WebKit is compatible with Emacs. withSmallJaDic ? false, withCompressInstall ? true, @@ -128,7 +129,8 @@ assert withGpm -> stdenv.hostPlatform.isLinux; assert withImageMagick -> (withX || withNS); assert withNS -> stdenv.hostPlatform.isDarwin && !(withX || variant == "macport"); assert withPgtk -> withGTK3 && !withX; -assert withXwidgets -> !noGui && (withGTK3 || withPgtk); +assert withXwidgets -> !noGui && (withGTK3 || withPgtk || withNS || variant == "macport"); +# XXX: The upstream --with-xwidgets flag is enabled only when Emacs is built with GTK3 or with Cocoa (including the withNS and macport variant). let libGccJitLibraryPaths = [ @@ -348,7 +350,7 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optionals withXinput2 [ libXi ] - ++ lib.optionals withXwidgets [ + ++ lib.optionals (withXwidgets && stdenv.hostPlatform.isLinux) [ webkitgtk_4_0 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [