diff options
author | Liliana Marie Prikler <[email protected]> | 2024-12-08 18:30:54 +0100 |
---|---|---|
committer | Liliana Marie Prikler <[email protected]> | 2025-01-19 13:06:08 +0100 |
commit | 8f799ca8cee42a7be289022489d6ec08e329dac5 (patch) | |
tree | 13458fa441455021e30151faafafc61660403bee /gnu/packages/patches | |
parent | 71db233a7d2b5a25ece95853616f4c63a8158175 (diff) |
gnu: emacs: Pin natively compiled packages.
* gnu/packages/patches/emacs-native-comp-pin-packages.patch: New patch.
* gnu/local.mk (dist_patch_DATA): Register it here.
* gnu/packages/emacs.scm (emacs)[source]: Use it here.
[#:phases]: Remove ‘disable-native-compilation’.
Fixes: Emacs native-comp collisions <https://issues.guix.gnu.org/67292>
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r-- | gnu/packages/patches/emacs-native-comp-pin-packages.patch | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/gnu/packages/patches/emacs-native-comp-pin-packages.patch b/gnu/packages/patches/emacs-native-comp-pin-packages.patch new file mode 100644 index 0000000000..dc328f03a8 --- /dev/null +++ b/gnu/packages/patches/emacs-native-comp-pin-packages.patch @@ -0,0 +1,39 @@ +Index: emacs-29.4/src/lread.c +=================================================================== +--- emacs-29.4.orig/src/lread.c ++++ emacs-29.4/src/lread.c +@@ -1668,9 +1668,34 @@ directories, make sure the PREDICATE fun + + #ifdef HAVE_NATIVE_COMP + static bool ++permit_swap_for_eln (Lisp_Object src_name, Lisp_Object eln_name) ++{ ++ char *src = SSDATA (src_name), *eln = SSDATA (eln_name); ++ size_t eln_ln = strlen (eln); ++ ++ while (*src && *eln && *src == *eln) ++ { ++ ++src; ++eln; --eln_ln; ++ } ++ ++ /* After stripping common prefixes, the first directory should be ++ * "lib/" (inside the Guix store) or "native-lisp" (inside Emacs build). ++ * Alternatively, if eln contains "eln-cache", it's likely the user's ++ * cache, which we will also permit. */ ++ ++ return ++ (eln_ln > 4 && !strncmp (eln, "lib/", 4)) || ++ (eln_ln > 12 && !strncmp (eln, "native-lisp/", 12)) || ++ strstr (eln, "eln-cache") != NULL; ++} ++ ++static bool + maybe_swap_for_eln1 (Lisp_Object src_name, Lisp_Object eln_name, + Lisp_Object *filename, int *fd, struct timespec mtime) + { ++ if (!permit_swap_for_eln (src_name, eln_name)) ++ return false; ++ + struct stat eln_st; + int eln_fd = emacs_open (SSDATA (ENCODE_FILE (eln_name)), O_RDONLY, 0); + |