diff --git a/pkgs/applications/editors/emacs/default.nix b/pkgs/applications/editors/emacs/default.nix index 295579c7c085..2c7253ffb7b7 100644 --- a/pkgs/applications/editors/emacs/default.nix +++ b/pkgs/applications/editors/emacs/default.nix @@ -13,10 +13,24 @@ lib.makeScope pkgs.newScope ( inherit lib; inherit (pkgs) fetchFromGitHub - fetchzip + fetchgit ; }; + 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 { @@ -31,11 +45,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..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, @@ -66,7 +65,7 @@ # Boolean flags withNativeCompilation ? stdenv.buildPlatform.canExecute stdenv.hostPlatform, noGui ? false, - srcRepo ? false, + srcRepo ? true, withAcl ? false, withAlsaLib ? false, withAthena ? false, @@ -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 diff --git a/pkgs/applications/editors/emacs/sources.nix b/pkgs/applications/editors/emacs/sources.nix index fb9d9697cd85..e173831d0903 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" = ( @@ -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}; @@ -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 b4c2070d4c75..a880fea0db60 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8924,6 +8924,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