aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrea Corallo2020-09-21 21:07:04 +0200
committerAndrea Corallo2020-09-22 09:52:40 +0200
commit5297288a38944a8727f6f6613836034b439b202d (patch)
tree591f4c9536d14b4e730bad7b0d7bd9028c29a20e
parent5b41545f1be367837d9ac717ea67fba19a4c24d4 (diff)
downloademacs-5297288a38944a8727f6f6613836034b439b202d.tar.gz
emacs-5297288a38944a8727f6f6613836034b439b202d.zip
* 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.
-rw-r--r--src/comp.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/src/comp.c b/src/comp.c
index 15d85d30fcb..f831b09ab1d 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'. */)
4054 4054
4055 if (NILP (loadsearch_re_list)) 4055 if (NILP (loadsearch_re_list))
4056 { 4056 {
4057 Lisp_Object loadsearch_list = 4057 Lisp_Object sys_rx;
4058 Fcons (build_string (PATH_DUMPLOADSEARCH), 4058#ifdef __APPLE__
4059 Fcons (build_string (PATH_LOADSEARCH), Qnil)); 4059 /* On MacOS we relax the match on PATH_LOADSEARCH making
4060 FOR_EACH_TAIL (loadsearch_list) 4060 everything before ".app/" a wildcard. This to obtain a
4061 loadsearch_re_list = 4061 self-contained Emacs.app (bug#43532). */
4062 Fcons (Fregexp_quote (XCAR (loadsearch_list)), loadsearch_re_list); 4062 char *c;
4063 if ((c = strstr (PATH_LOADSEARCH, ".app/")))
4064 sys_rx =
4065 concat2 (build_string ("\\`[[:ascii:]]+"),
4066 Fregexp_quote (build_string (c)));
4067 else
4068 sys_rx = Fregexp_quote (build_string (PATH_LOADSEARCH));
4069#else
4070 sys_rx = Fregexp_quote (build_string (PATH_LOADSEARCH));
4071#endif
4072 loadsearch_re_list =
4073 list2 (Fregexp_quote (sys_rx),
4074 Fregexp_quote (build_string (PATH_DUMPLOADSEARCH)));
4063 } 4075 }
4064 Lisp_Object loadsearch_res = loadsearch_re_list; 4076
4065 FOR_EACH_TAIL (loadsearch_res) 4077 Lisp_Object lds_re_tail = loadsearch_re_list;
4078 FOR_EACH_TAIL (lds_re_tail)
4066 { 4079 {
4067 Lisp_Object match_idx = 4080 Lisp_Object match_idx =
4068 Fstring_match (XCAR (loadsearch_res), filename, Qnil); 4081 Fstring_match (XCAR (lds_re_tail), filename, Qnil);
4069 if (EQ (match_idx, make_fixnum (0))) 4082 if (EQ (match_idx, make_fixnum (0)))
4070 { 4083 {
4071 filename = 4084 filename =