diff --git a/pkgs/applications/editors/emacs/make-emacs.nix b/pkgs/applications/editors/emacs/make-emacs.nix index 4f6fbd9a55c5f..b789f54fa80b8 100644 --- a/pkgs/applications/editors/emacs/make-emacs.nix +++ b/pkgs/applications/editors/emacs/make-emacs.nix @@ -29,7 +29,6 @@ gtk3-x11, harfbuzz, imagemagick, - jansson, libXaw, libXcursor, libXft, @@ -82,21 +81,20 @@ withGTK3 ? withPgtk && !noGui, withGlibNetworking ? withPgtk || withGTK3 || (withX && withXwidgets), withGpm ? stdenv.hostPlatform.isLinux, - withImageMagick ? lib.versionOlder version "27" && (withX || withNS), - # Emacs 30+ has native JSON support - withJansson ? lib.versionOlder version "30", + # https://github.com/emacs-mirror/emacs/blob/master/etc/NEWS.27#L140-L142 + withImageMagick ? false, withMailutils ? true, withMotif ? false, withNS ? stdenv.hostPlatform.isDarwin && !(variant == "macport" || noGui), withPgtk ? false, withSelinux ? stdenv.hostPlatform.isLinux, - withSQLite3 ? lib.versionAtLeast version "29", + withSQLite3 ? true, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd, withToolkitScrollBars ? true, - withTreeSitter ? lib.versionAtLeast version "29", - withWebP ? lib.versionAtLeast version "29", + withTreeSitter ? true, + withWebP ? true, withX ? !(stdenv.hostPlatform.isDarwin || noGui || withPgtk), - withXinput2 ? withX && lib.versionAtLeast version "29", + withXinput2 ? withX && true, withXwidgets ? !stdenv.hostPlatform.isDarwin && !noGui @@ -143,6 +141,7 @@ assert noGui -> !(withX || withGTK3 || withNS || variant == "macport"); assert withAcl -> stdenv.hostPlatform.isLinux; assert withAlsaLib -> stdenv.hostPlatform.isLinux; 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); @@ -183,39 +182,29 @@ mkDerivation (finalAttrs: { patches = patches fetchpatch ++ lib.optionals withNativeCompilation [ - (replaceVars - ( - if lib.versionOlder finalAttrs.version "29" then - ./native-comp-driver-options-28.patch - else if lib.versionOlder finalAttrs.version "30" then - ./native-comp-driver-options.patch - else - ./native-comp-driver-options-30.patch - ) - { - backendPath = ( - lib.concatStringsSep " " ( - builtins.map (x: ''"-B${x}"'') ( - [ - # Paths necessary so the JIT compiler finds its libraries: - "${lib.getLib libgccjit}/lib" - ] - ++ libGccJitLibraryPaths - ++ [ - # Executable paths necessary for compilation (ld, as): - "${lib.getBin stdenv.cc.cc}/bin" - "${lib.getBin stdenv.cc.bintools}/bin" - "${lib.getBin stdenv.cc.bintools.bintools}/bin" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # The linker needs to know where to find libSystem on Darwin. - "${apple-sdk.sdkroot}/usr/lib" - ] - ) + (replaceVars ./native-comp-driver-options-30.patch { + backendPath = ( + lib.concatStringsSep " " ( + builtins.map (x: ''"-B${x}"'') ( + [ + # Paths necessary so the JIT compiler finds its libraries: + "${lib.getLib libgccjit}/lib" + ] + ++ libGccJitLibraryPaths + ++ [ + # Executable paths necessary for compilation (ld, as): + "${lib.getBin stdenv.cc.cc}/bin" + "${lib.getBin stdenv.cc.bintools}/bin" + "${lib.getBin stdenv.cc.bintools.bintools}/bin" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # The linker needs to know where to find libSystem on Darwin. + "${apple-sdk.sdkroot}/usr/lib" + ] ) - ); - } - ) + ) + ); + }) ]; postPatch = lib.concatStringsSep "\n" [ @@ -283,9 +272,6 @@ mkDerivation (finalAttrs: { gnutls (lib.getDev harfbuzz) ] - ++ lib.optionals withJansson [ - jansson - ] ++ [ libxml2 ncurses diff --git a/pkgs/applications/editors/emacs/native-comp-driver-options-28.patch b/pkgs/applications/editors/emacs/native-comp-driver-options-28.patch deleted file mode 100644 index 98c6da305145d..0000000000000 --- a/pkgs/applications/editors/emacs/native-comp-driver-options-28.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el -index a5ab12ae38..e33e71cb55 100644 ---- a/lisp/emacs-lisp/comp.el -+++ b/lisp/emacs-lisp/comp.el -@@ -178,7 +178,7 @@ native-comp-compiler-options - :type '(repeat string) - :version "28.1") - --(defcustom native-comp-driver-options nil -+(defcustom native-comp-driver-options '(@backendPath@) - "Options passed verbatim to the native compiler's back-end driver. - Note that not all options are meaningful; typically only the options - affecting the assembler and linker are likely to be useful. --- -2.37.3 - diff --git a/pkgs/applications/editors/emacs/native-comp-driver-options.patch b/pkgs/applications/editors/emacs/native-comp-driver-options.patch deleted file mode 100644 index 58eee35aed0af..0000000000000 --- a/pkgs/applications/editors/emacs/native-comp-driver-options.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el -index 2c9b79334b..50c6b5ac85 100644 ---- a/lisp/emacs-lisp/comp.el -+++ b/lisp/emacs-lisp/comp.el -@@ -178,8 +178,9 @@ native-comp-compiler-options - :type '(repeat string) - :version "28.1") - --(defcustom native-comp-driver-options (when (eq system-type 'darwin) -- '("-Wl,-w")) -+(defcustom native-comp-driver-options (append (when (eq system-type 'darwin) -+ '("-Wl,-w")) -+ '(@backendPath@)) - "Options passed verbatim to the native compiler's back-end driver. - Note that not all options are meaningful; typically only the options - affecting the assembler and linker are likely to be useful. --- -2.37.3 -