From f2d4a74f95343ad87fac5d44136d1d65adae037b Mon Sep 17 00:00:00 2001 From: Lin Jian Date: Mon, 26 Feb 2024 00:35:04 +0800 Subject: [PATCH 1/2] emacs.pkgs.seq: stop shadowing it magit requires[1] seq 2.24. seq from GNU Elpa satisfies that. However, it is shadowed by the Emacs builtin one to workaround an old bug[2] and the version of the builtin seq in Emacs 28 is only 2.23. So magit is broken for Emacs 28 which is the default one in NixOS 23.11 and available in the unstable branch. This patch fixes magit by stopping shadowing seq from GNU Elpa since that old bug[2] is not relevant now. Fixes https://github.com/NixOS/nixpkgs/issues/272019. [1]: https://github.com/magit/magit/blob/f4ff817cb2a48f0f7887050c3be469c03a059567/lisp/magit.el#L27 [2]: https://github.com/NixOS/nixpkgs/pull/74936 (cherry picked from commit 7374ffe8f734d5bc288dfb960c8df57c1a4f53d4) --- .../editors/emacs/elisp-packages/elpa-packages.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkgs/applications/editors/emacs/elisp-packages/elpa-packages.nix b/pkgs/applications/editors/emacs/elisp-packages/elpa-packages.nix index 2a6cb016cdc8a1..639efa99cd6122 100644 --- a/pkgs/applications/editors/emacs/elisp-packages/elpa-packages.nix +++ b/pkgs/applications/editors/emacs/elisp-packages/elpa-packages.nix @@ -63,9 +63,6 @@ self: let cl-print = null; # builtin tle = null; # builtin advice = null; # builtin - seq = if lib.versionAtLeast self.emacs.version "27" - then null - else super.seq; # Compilation instructions for the Ada executables: # https://www.nongnu.org/ada-mode/ ada-mode = super.ada-mode.overrideAttrs (old: { From bd1acf93d9fdea739d424da7985fe01434636f52 Mon Sep 17 00:00:00 2001 From: Lin Jian Date: Mon, 26 Feb 2024 02:06:59 +0800 Subject: [PATCH 2/2] emacs.pkgs.seq: fix build (cherry picked from commit a9cfbfda7f3354200dba03a2f122a20f50784601) --- .../emacs/elisp-packages/elpa-devel-packages.nix | 12 ++++++++++++ .../editors/emacs/elisp-packages/elpa-packages.nix | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/pkgs/applications/editors/emacs/elisp-packages/elpa-devel-packages.nix b/pkgs/applications/editors/emacs/elisp-packages/elpa-devel-packages.nix index ff5cce83103e5c..da7d44d6798a45 100644 --- a/pkgs/applications/editors/emacs/elisp-packages/elpa-devel-packages.nix +++ b/pkgs/applications/editors/emacs/elisp-packages/elpa-devel-packages.nix @@ -79,6 +79,18 @@ self: let rm $outd/xapian-lite.cc $outd/emacs-module.h $outd/emacs-module-prelude.h $outd/demo.gif $outd/Makefile ''; }); + + # native compilation for tests/seq-tests.el never ends + # delete tests/seq-tests.el to workaround this + seq = super.seq.overrideAttrs (old: { + dontUnpack = false; + postUnpack = (old.postUnpack or "") + "\n" + '' + local content_directory=$(echo seq-*) + rm --verbose $content_directory/tests/seq-tests.el + src=$PWD/$content_directory.tar + tar --create --verbose --file=$src $content_directory + ''; + }); }; elpaDevelPackages = super // overrides; diff --git a/pkgs/applications/editors/emacs/elisp-packages/elpa-packages.nix b/pkgs/applications/editors/emacs/elisp-packages/elpa-packages.nix index 639efa99cd6122..ac7e775f673036 100644 --- a/pkgs/applications/editors/emacs/elisp-packages/elpa-packages.nix +++ b/pkgs/applications/editors/emacs/elisp-packages/elpa-packages.nix @@ -171,6 +171,18 @@ self: let ''; }); + # native compilation for tests/seq-tests.el never ends + # delete tests/seq-tests.el to workaround this + seq = super.seq.overrideAttrs (old: { + dontUnpack = false; + postUnpack = (old.postUnpack or "") + "\n" + '' + local content_directory=$(echo seq-*) + rm --verbose $content_directory/tests/seq-tests.el + src=$PWD/$content_directory.tar + tar --create --verbose --file=$src $content_directory + ''; + }); + };