From 4a2ad8134b8b40f198c71f7d8d84467d250cd714 Mon Sep 17 00:00:00 2001 From: Jasi Date: Thu, 28 Aug 2025 03:27:51 +0800 Subject: [PATCH] emacs: replace fetchFromSavannah with mirror This commit re-apply a019344338d84d8e6a79ab0a5a1ede443234e331 with fixes and minor improvements. Refs: #427024 #435964 Co-authored-by: Lin Jian --- pkgs/applications/editors/emacs/default.nix | 2 +- pkgs/applications/editors/emacs/make-emacs.nix | 7 ++++++- pkgs/applications/editors/emacs/sources.nix | 12 ++++++------ 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/pkgs/applications/editors/emacs/default.nix b/pkgs/applications/editors/emacs/default.nix index cc604b222f32..1ac714c15575 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) fetchFromBitbucket - fetchFromSavannah + fetchzip ; }; diff --git a/pkgs/applications/editors/emacs/make-emacs.nix b/pkgs/applications/editors/emacs/make-emacs.nix index e088d9610b70..b9f75464c793 100644 --- a/pkgs/applications/editors/emacs/make-emacs.nix +++ b/pkgs/applications/editors/emacs/make-emacs.nix @@ -69,7 +69,7 @@ # Boolean flags withNativeCompilation ? stdenv.buildPlatform.canExecute stdenv.hostPlatform, noGui ? false, - srcRepo ? true, + srcRepo ? false, withAcl ? false, withAlsaLib ? false, withAthena ? false, @@ -204,6 +204,11 @@ mkDerivation (finalAttrs: { rm -fr .git '') + # See: https://github.com/NixOS/nixpkgs/issues/170426 + (lib.optionalString (!srcRepo) '' + find . -type f \( -name "*.elc" -o -name "*loaddefs.el" \) -exec rm {} \; + '') + # Add the name of the wrapped gvfsd # This used to be carried as a patch but it often got out of sync with # upstream and was hard to maintain for emacs-overlay. diff --git a/pkgs/applications/editors/emacs/sources.nix b/pkgs/applications/editors/emacs/sources.nix index c706d8ecc276..d3fb3da3b599 100644 --- a/pkgs/applications/editors/emacs/sources.nix +++ b/pkgs/applications/editors/emacs/sources.nix @@ -1,7 +1,7 @@ { lib, fetchFromBitbucket, - fetchFromSavannah, + fetchzip, }: let @@ -26,9 +26,9 @@ let src = { "mainline" = ( - fetchFromSavannah { - repo = "emacs"; - inherit rev hash; + fetchzip { + url = "mirror://gnu/emacs/${rev}.tar.xz"; + inherit hash; } ); "macport" = ( @@ -107,8 +107,8 @@ in pname = "emacs"; version = "30.2"; variant = "mainline"; - rev = "30.2"; - hash = "sha256-3Lfb3HqdlXqSnwJfxe7npa4GGR9djldy8bKRpkQCdSA="; + rev = "emacs-30.2"; + hash = "sha256-W2eZ+cNQhi/fMeRkwOqSKU7Vzvp43WUOpiwaLLNEXtg="; patches = fetchpatch: [ (builtins.path { name = "inhibit-lexical-cookie-warning-67916.patch";