From f796d89fa0a7850b98720bfa309df386f0a21e95 Mon Sep 17 00:00:00 2001 From: pancho horrillo Date: Fri, 5 Jun 2026 22:52:46 +0200 Subject: [PATCH 1/4] emacs: fix changelog URL for mainline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Point URL to savannah’s cgit, the canonical source. - Select tag instead of release branch, which is more precise. Compare the differences: bad (branch, intermediate state pre-30.3): https://www.gnu.org/savannah-checkouts/gnu/emacs/news/NEWS.30.2 good (tag, precisely the state we are shipping): https://cgit.git.savannah.gnu.org/cgit/emacs.git/plain/etc/NEWS?h=emacs-30.2 --- pkgs/applications/editors/emacs/sources.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/editors/emacs/sources.nix b/pkgs/applications/editors/emacs/sources.nix index fb9d9697cd85..750a9a44e528 100644 --- a/pkgs/applications/editors/emacs/sources.nix +++ b/pkgs/applications/editors/emacs/sources.nix @@ -74,7 +74,7 @@ let ''; changelog = { - "mainline" = "https://www.gnu.org/savannah-checkouts/gnu/emacs/news/NEWS.${version}"; + "mainline" = "https://cgit.git.savannah.gnu.org/cgit/emacs.git/plain/etc/NEWS?h=${rev}"; "macport" = "https://github.com/jdtsmith/emacs-mac/blob/${rev}/NEWS-mac"; } .${variant}; From 04b2b5057bc33fa78cfc19a7fb414d84a622384d Mon Sep 17 00:00:00 2001 From: pancho horrillo Date: Fri, 5 Jun 2026 23:09:35 +0200 Subject: [PATCH 2/4] =?UTF-8?q?emacs:=20refactor:=20fetchzip=E2=86=92fetch?= =?UTF-8?q?git?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In preparation for fetching pre-releases, which are not available in the standard GNU mirrors, just in the ‘alpha’ ones. srcRepo has been flipped, since repo states do not include the autoconf/automake generated files of the release tarballs. emacs-macport, which was already built from repo sources, had to enable srcRepo, which the flip makes it redundant, and hence is gone. --- pkgs/applications/editors/emacs/default.nix | 9 ++------- pkgs/applications/editors/emacs/make-emacs.nix | 2 +- pkgs/applications/editors/emacs/sources.nix | 8 ++++---- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/pkgs/applications/editors/emacs/default.nix b/pkgs/applications/editors/emacs/default.nix index 295579c7c085..fce218118a52 100644 --- a/pkgs/applications/editors/emacs/default.nix +++ b/pkgs/applications/editors/emacs/default.nix @@ -13,7 +13,7 @@ lib.makeScope pkgs.newScope ( inherit lib; inherit (pkgs) fetchFromGitHub - fetchzip + fetchgit ; }; @@ -31,11 +31,6 @@ lib.makeScope pkgs.newScope ( withPgtk = true; }; - emacs30-macport = callPackage (self.sources.emacs30-macport) ( - inheritedArgs - // { - srcRepo = true; - } - ); + emacs30-macport = callPackage (self.sources.emacs30-macport) inheritedArgs; } ) diff --git a/pkgs/applications/editors/emacs/make-emacs.nix b/pkgs/applications/editors/emacs/make-emacs.nix index 8a39e96f900e..62c411aa1440 100644 --- a/pkgs/applications/editors/emacs/make-emacs.nix +++ b/pkgs/applications/editors/emacs/make-emacs.nix @@ -66,7 +66,7 @@ # Boolean flags withNativeCompilation ? stdenv.buildPlatform.canExecute stdenv.hostPlatform, noGui ? false, - srcRepo ? false, + srcRepo ? true, withAcl ? false, withAlsaLib ? false, withAthena ? false, diff --git a/pkgs/applications/editors/emacs/sources.nix b/pkgs/applications/editors/emacs/sources.nix index 750a9a44e528..663394e6a5ba 100644 --- a/pkgs/applications/editors/emacs/sources.nix +++ b/pkgs/applications/editors/emacs/sources.nix @@ -1,7 +1,7 @@ { lib, fetchFromGitHub, - fetchzip, + fetchgit, }: let @@ -26,9 +26,9 @@ let src = { "mainline" = ( - fetchzip { - url = "mirror://gnu/emacs/${rev}.tar.xz"; - inherit hash; + fetchgit { + url = "https://https.git.savannah.gnu.org/git/emacs.git"; + inherit rev hash; } ); "macport" = ( From b95e7291f5f8d5c12479009fb271188000e7ac5c Mon Sep 17 00:00:00 2001 From: pancho horrillo Date: Fri, 5 Jun 2026 23:15:16 +0200 Subject: [PATCH 3/4] emacs31: init See the announcement here: https://lists.gnu.org/archive/html/emacs-devel/2026-06/msg00118.html Co-authored-by: LIN, Jian --- pkgs/applications/editors/emacs/default.nix | 14 ++++++++++++++ pkgs/applications/editors/emacs/sources.nix | 8 ++++++++ pkgs/top-level/all-packages.nix | 5 +++++ 3 files changed, 27 insertions(+) diff --git a/pkgs/applications/editors/emacs/default.nix b/pkgs/applications/editors/emacs/default.nix index fce218118a52..2c7253ffb7b7 100644 --- a/pkgs/applications/editors/emacs/default.nix +++ b/pkgs/applications/editors/emacs/default.nix @@ -17,6 +17,20 @@ lib.makeScope pkgs.newScope ( ; }; + emacs31 = callPackage (self.sources.emacs31) inheritedArgs; + + emacs31-gtk3 = self.emacs31.override { + withGTK3 = true; + }; + + emacs31-nox = self.emacs31.override { + noGui = true; + }; + + emacs31-pgtk = self.emacs31.override { + withPgtk = true; + }; + emacs30 = callPackage (self.sources.emacs30) inheritedArgs; emacs30-gtk3 = self.emacs30.override { diff --git a/pkgs/applications/editors/emacs/sources.nix b/pkgs/applications/editors/emacs/sources.nix index 663394e6a5ba..e173831d0903 100644 --- a/pkgs/applications/editors/emacs/sources.nix +++ b/pkgs/applications/editors/emacs/sources.nix @@ -105,6 +105,14 @@ let }; in { + emacs31 = import ./make-emacs.nix (mkArgs { + pname = "emacs"; + version = "31.0.90"; + variant = "mainline"; + rev = "emacs-31.0.90"; + hash = "sha256-Rzlnn+NKQ+jICXLNop27RnVInq79myn4hueJieDO2Ck="; + }); + emacs30 = import ./make-emacs.nix (mkArgs { pname = "emacs"; version = "30.2"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8c8357525f19..55cf78ba8b1c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8928,6 +8928,11 @@ with pkgs; electrum-ltc = libsForQt5.callPackage ../applications/misc/electrum/ltc.nix { }; inherit (recurseIntoAttrs (callPackage ../applications/editors/emacs { })) + emacs31 + emacs31-gtk3 + emacs31-nox + emacs31-pgtk + emacs30 emacs30-gtk3 emacs30-nox From 57b71d2781b218ccd04680196b5878d4a0ce8780 Mon Sep 17 00:00:00 2001 From: pancho horrillo Date: Fri, 5 Jun 2026 23:19:10 +0200 Subject: [PATCH 4/4] emacs: drop stale dependency jansson Emacs 30+ has native JSON support, and Emacs 29 was dropped from nixpkgs some time ago. --- pkgs/applications/editors/emacs/make-emacs.nix | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pkgs/applications/editors/emacs/make-emacs.nix b/pkgs/applications/editors/emacs/make-emacs.nix index 62c411aa1440..22246f9fe962 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, @@ -80,8 +79,6 @@ withGpm ? stdenv.hostPlatform.isLinux, # https://github.com/emacs-mirror/emacs/blob/emacs-27.2/etc/NEWS#L118-L120 withImageMagick ? false, - # Emacs 30+ has native JSON support - withJansson ? lib.versionOlder version "30", withMailutils ? true, withMotif ? false, withNS ? stdenv.hostPlatform.isDarwin && !(variant == "macport" || noGui), @@ -256,9 +253,6 @@ stdenv.mkDerivation (finalAttrs: { gnutls (lib.getDev harfbuzz) ] - ++ lib.optionals withJansson [ - jansson - ] ++ [ libxml2 ncurses