emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

scratch/native-comp-macos-43532 5297288: * Fix MacOS Emacs.app installat


From: Andrea Corallo
Subject: scratch/native-comp-macos-43532 5297288: * Fix MacOS Emacs.app installation (bug#43532)
Date: Tue, 22 Sep 2020 03:55:40 -0400 (EDT)

branch: scratch/native-comp-macos-43532
commit 5297288a38944a8727f6f6613836034b439b202d
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>

    * Fix MacOS Emacs.app installation (bug#43532)
    
        * src/comp.c (Fcomp_el_to_eln_filename): Adapt the filename
        hashing algorithm to allow for producing a MacOS self-contained
        Emacs.app.
---
 src/comp.c | 31 ++++++++++++++++++++++---------
 1 file changed, 22 insertions(+), 9 deletions(-)

diff --git a/src/comp.c b/src/comp.c
index 15d85d3..f831b09 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -4054,18 +4054,31 @@ If BASE-DIR is nil use the first entry in 
`comp-eln-load-path'.  */)
 
   if (NILP (loadsearch_re_list))
     {
-      Lisp_Object loadsearch_list =
-       Fcons (build_string (PATH_DUMPLOADSEARCH),
-              Fcons (build_string (PATH_LOADSEARCH), Qnil));
-      FOR_EACH_TAIL (loadsearch_list)
-       loadsearch_re_list =
-         Fcons (Fregexp_quote (XCAR (loadsearch_list)), loadsearch_re_list);
+      Lisp_Object sys_rx;
+#ifdef __APPLE__
+      /* On MacOS we relax the match on PATH_LOADSEARCH making
+        everything before ".app/" a wildcard.  This to obtain a
+        self-contained Emacs.app (bug#43532).  */
+      char *c;
+      if ((c = strstr (PATH_LOADSEARCH, ".app/")))
+       sys_rx =
+         concat2 (build_string ("\\`[[:ascii:]]+"),
+                  Fregexp_quote (build_string (c)));
+      else
+       sys_rx = Fregexp_quote (build_string (PATH_LOADSEARCH));
+#else
+      sys_rx = Fregexp_quote (build_string (PATH_LOADSEARCH));
+#endif
+      loadsearch_re_list =
+       list2 (Fregexp_quote (sys_rx),
+              Fregexp_quote (build_string (PATH_DUMPLOADSEARCH)));
     }
-  Lisp_Object loadsearch_res = loadsearch_re_list;
-  FOR_EACH_TAIL (loadsearch_res)
+
+  Lisp_Object lds_re_tail = loadsearch_re_list;
+  FOR_EACH_TAIL (lds_re_tail)
     {
       Lisp_Object match_idx =
-       Fstring_match (XCAR (loadsearch_res), filename, Qnil);
+       Fstring_match (XCAR (lds_re_tail), filename, Qnil);
       if (EQ (match_idx, make_fixnum (0)))
        {
          filename =



reply via email to

[Prev in Thread] Current Thread [Next in Thread]