nixpkgs/pkgs/build-support/emacs
Lin Jian ee46aa8a13
melpaBuild: allow nix unstable version format
Before, an unstable version of melpaBuild has to be in MELPA format,
which has some disadvantages:
- existing update scripts cannot be reused[1]
- it causes inconsistence.

This patch fixes that by allowing an unstable version to be in Nix
format.

We heuristically detect if it is an unstable version in Nix format.
If so, we convert it to MELPA format.

This does not bring evaluation performance overhead.  Here is my
benchmark result using hyperfine-1.18.0 and nix-2.18.1.

Without this patch:

Benchmark 1: NIXPKGS_ALLOW_BROKEN=1 nix eval --include nixpkgs=$PWD --file . emacs.pkgs.melpaPackages --apply 'pkgSet: map (drv: drv.drvPath) (builtins.filter (p: p.type or null == "derivation") (builtins.attrValues pkgSet))' --no-eval-cache >/dev/null
  Time (mean ± σ):      9.126 s ±  0.048 s    [User: 6.531 s, System: 0.997 s]
  Range (min … max):    9.056 s …  9.186 s    10 runs

With this patch applied:

Benchmark 1: NIXPKGS_ALLOW_BROKEN=1 nix eval --include nixpkgs=$PWD --file . emacs.pkgs.melpaPackages --apply 'pkgSet: map (drv: drv.drvPath) (builtins.filter (p: p.type or null == "derivation") (builtins.attrValues pkgSet))' --no-eval-cache >/dev/null
  Time (mean ± σ):      9.124 s ±  0.057 s    [User: 6.522 s, System: 1.011 s]
  Range (min … max):    9.040 s …  9.220 s    10 runs

[1]: 177c9eddad/pkgs/applications/editors/emacs/elisp-packages/manual-packages/lsp-bridge/default.nix (L93-L108)
2024-06-03 05:29:23 +08:00
..
buffer.nix nixBufferBuilders: Don't assume the user has used eshell 2023-08-18 04:49:33 -04:00
elpa2nix.el
elpa.nix build-support/emacs: refactor 2023-12-29 02:38:57 +13:00
emacs-funcs.sh
generic.nix build-support/emacs: refactor 2023-12-29 02:38:57 +13:00
melpa2nix.el ReApply PR #276943: "melpa2nix: update to work with Emacs HEAD" 2023-12-29 14:00:46 +01:00
melpa.nix melpaBuild: allow nix unstable version format 2024-06-03 05:29:23 +08:00
mk-wrapper-subdirs.el
package-build-dont-use-mtime.patch ReApply PR #276943: "melpa2nix: update to work with Emacs HEAD" 2023-12-29 14:00:46 +01:00
trivial.nix build-support/emacs: refactor 2023-12-29 02:38:57 +13:00
wrapper.nix emacs: remove backwards-compatibility aliases 2023-11-22 09:25:50 -03:00
wrapper.sh emacsWithPackages: add a note for EMACSNATIVELOADPATH 2023-08-25 17:42:21 +00:00