diff --git a/pkgs/applications/editors/emacs/default.nix b/pkgs/applications/editors/emacs/default.nix index e36142b300dd..cc604b222f32 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 - fetchurl + fetchFromSavannah ; }; diff --git a/pkgs/applications/editors/emacs/make-emacs.nix b/pkgs/applications/editors/emacs/make-emacs.nix index be728c1a3a1a..e088d9610b70 100644 --- a/pkgs/applications/editors/emacs/make-emacs.nix +++ b/pkgs/applications/editors/emacs/make-emacs.nix @@ -69,6 +69,7 @@ # Boolean flags withNativeCompilation ? stdenv.buildPlatform.canExecute stdenv.hostPlatform, noGui ? false, + srcRepo ? true, withAcl ? false, withAlsaLib ? false, withAthena ? false, @@ -199,11 +200,9 @@ mkDerivation (finalAttrs: { ]; postPatch = lib.concatStringsSep "\n" [ - - # See: https://github.com/NixOS/nixpkgs/issues/170426 - '' - find . -type f \( -name "*.elc" -o -name "*loaddefs.el" \) -exec rm {} \; - '' + (lib.optionalString srcRepo '' + rm -fr .git + '') # Add the name of the wrapped gvfsd # This used to be carried as a patch but it often got out of sync with @@ -248,6 +247,11 @@ mkDerivation (finalAttrs: { nativeBuildInputs = [ makeWrapper pkg-config + ] + ++ lib.optionals (variant == "macport") [ + texinfo + ] + ++ lib.optionals srcRepo [ autoreconfHook texinfo ] diff --git a/pkgs/applications/editors/emacs/sources.nix b/pkgs/applications/editors/emacs/sources.nix index 38864a90e221..c706d8ecc276 100644 --- a/pkgs/applications/editors/emacs/sources.nix +++ b/pkgs/applications/editors/emacs/sources.nix @@ -1,7 +1,7 @@ { lib, fetchFromBitbucket, - fetchurl, + fetchFromSavannah, }: let @@ -26,9 +26,9 @@ let src = { "mainline" = ( - fetchurl { - url = "mirror://gnu/emacs/emacs-${rev}.tar.xz"; - inherit hash; + fetchFromSavannah { + repo = "emacs"; + inherit rev hash; } ); "macport" = ( @@ -108,7 +108,7 @@ in version = "30.2"; variant = "mainline"; rev = "30.2"; - hash = "sha256-s/NvGKbdJxVxM3AWYlfeL64B+dOM/oeM7Zsebe1b79k="; + hash = "sha256-3Lfb3HqdlXqSnwJfxe7npa4GGR9djldy8bKRpkQCdSA="; patches = fetchpatch: [ (builtins.path { name = "inhibit-lexical-cookie-warning-67916.patch";