mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2025-02-07 11:29:59 +01:00
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>
This commit is contained in:
parent
bd24a13c57
commit
dbc4a98cfa
3 changed files with 41 additions and 10 deletions
|
@ -1213,6 +1213,7 @@ dist_patch_DATA = \
|
||||||
%D%/packages/patches/emacs-lispy-fix-thread-last-test.patch \
|
%D%/packages/patches/emacs-lispy-fix-thread-last-test.patch \
|
||||||
%D%/packages/patches/emacs-native-comp-driver-options.patch \
|
%D%/packages/patches/emacs-native-comp-driver-options.patch \
|
||||||
%D%/packages/patches/emacs-native-comp-fix-filenames.patch \
|
%D%/packages/patches/emacs-native-comp-fix-filenames.patch \
|
||||||
|
%D%/packages/patches/emacs-native-comp-pin-packages.patch \
|
||||||
%D%/packages/patches/emacs-next-exec-path.patch \
|
%D%/packages/patches/emacs-next-exec-path.patch \
|
||||||
%D%/packages/patches/emacs-next-native-comp-driver-options.patch \
|
%D%/packages/patches/emacs-next-native-comp-driver-options.patch \
|
||||||
%D%/packages/patches/emacs-pasp-mode-quote-file-names.patch \
|
%D%/packages/patches/emacs-pasp-mode-quote-file-names.patch \
|
||||||
|
|
|
@ -117,6 +117,7 @@
|
||||||
"emacs-fix-scheme-indent-function.patch"
|
"emacs-fix-scheme-indent-function.patch"
|
||||||
"emacs-native-comp-driver-options.patch"
|
"emacs-native-comp-driver-options.patch"
|
||||||
"emacs-native-comp-fix-filenames.patch"
|
"emacs-native-comp-fix-filenames.patch"
|
||||||
|
"emacs-native-comp-pin-packages.patch"
|
||||||
"emacs-pgtk-super-key-fix.patch"))
|
"emacs-pgtk-super-key-fix.patch"))
|
||||||
(modules '((guix build utils)))
|
(modules '((guix build utils)))
|
||||||
(snippet
|
(snippet
|
||||||
|
@ -233,16 +234,6 @@
|
||||||
(("\\(tramp-compat-process-running-p \"(.*)\"\\)" all process)
|
(("\\(tramp-compat-process-running-p \"(.*)\"\\)" all process)
|
||||||
(format #f "(or ~a (tramp-compat-process-running-p ~s))"
|
(format #f "(or ~a (tramp-compat-process-running-p ~s))"
|
||||||
all (string-append "." process "-real"))))))
|
all (string-append "." process "-real"))))))
|
||||||
(add-after 'unpack 'disable-native-compilation
|
|
||||||
(lambda _
|
|
||||||
;; Temporary workaround to prevent the behaviour discussed in
|
|
||||||
;; <https://issues.guix.gnu.org/72333>.
|
|
||||||
;; Please remove once the native-compilation for Emacs packages
|
|
||||||
;; is fully supported.
|
|
||||||
(substitute* "lisp/transient.el"
|
|
||||||
((";; End:")
|
|
||||||
";; no-native-compile: t
|
|
||||||
;; End:"))))
|
|
||||||
(add-before 'configure 'fix-/bin/pwd
|
(add-before 'configure 'fix-/bin/pwd
|
||||||
(lambda _
|
(lambda _
|
||||||
;; Use `pwd', not `/bin/pwd'.
|
;; Use `pwd', not `/bin/pwd'.
|
||||||
|
|
39
gnu/packages/patches/emacs-native-comp-pin-packages.patch
Normal file
39
gnu/packages/patches/emacs-native-comp-pin-packages.patch
Normal file
|
@ -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);
|
||||||
|
|
Loading…
Add table
Reference in a new issue