[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scratch/native-comp-macos-43532 53d8419: * Fix MacOS Emacs.app installat
From: |
Andrea Corallo |
Subject: |
scratch/native-comp-macos-43532 53d8419: * Fix MacOS Emacs.app installation (bug#43532) |
Date: |
Mon, 21 Sep 2020 15:34:19 -0400 (EDT) |
branch: scratch/native-comp-macos-43532
commit 53d8419fb4d30e4537f714e2bc0facf2d93693cd
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..6d6f64d 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_DUMPLOADSEARCH making
+ everything before "/Emacs.app/" a wildcard. This to obtain a
+ self-contained Emacs.app (bug#43532). */
+ char *c;
+ if ((c = strstr (PATH_DUMPLOADSEARCH, "/Emacs.app/")))
+ sys_rx =
+ concat2 (build_string ("\\`[[:ascii:]]+"),
+ Fregexp_quote (build_string (c)));
+ else
+ sys_rx = Fregexp_quote (build_string (PATH_DUMPLOADSEARCH));
+#else
+ sys_rx = Fregexp_quote (build_string (PATH_DUMPLOADSEARCH));
+#endif
+ loadsearch_re_list =
+ list2 (Fregexp_quote (sys_rx),
+ Fregexp_quote (build_string (PATH_LOADSEARCH)));
}
- 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 =