diff --git a/pkgs/applications/editors/emacs/default.nix b/pkgs/applications/editors/emacs/default.nix index e36142b300dd7..1ac714c155750 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 + fetchzip ; }; diff --git a/pkgs/applications/editors/emacs/make-emacs.nix b/pkgs/applications/editors/emacs/make-emacs.nix index be728c1a3a1a7..b9f75464c7936 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 ? false, withAcl ? false, withAlsaLib ? false, withAthena ? false, @@ -199,11 +200,14 @@ mkDerivation (finalAttrs: { ]; postPatch = lib.concatStringsSep "\n" [ + (lib.optionalString srcRepo '' + 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 @@ -248,6 +252,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 38864a90e2215..d3fb3da3b5996 100644 --- a/pkgs/applications/editors/emacs/sources.nix +++ b/pkgs/applications/editors/emacs/sources.nix @@ -1,7 +1,7 @@ { lib, fetchFromBitbucket, - fetchurl, + fetchzip, }: let @@ -26,8 +26,8 @@ let src = { "mainline" = ( - fetchurl { - url = "mirror://gnu/emacs/emacs-${rev}.tar.xz"; + fetchzip { + url = "mirror://gnu/emacs/${rev}.tar.xz"; inherit hash; } ); @@ -107,8 +107,8 @@ in pname = "emacs"; version = "30.2"; variant = "mainline"; - rev = "30.2"; - hash = "sha256-s/NvGKbdJxVxM3AWYlfeL64B+dOM/oeM7Zsebe1b79k="; + rev = "emacs-30.2"; + hash = "sha256-W2eZ+cNQhi/fMeRkwOqSKU7Vzvp43WUOpiwaLLNEXtg="; patches = fetchpatch: [ (builtins.path { name = "inhibit-lexical-cookie-warning-67916.patch";