]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix NS self contained eln location (bug#49271)
authorAlan Third <alan@idiocy.org>
Wed, 30 Jun 2021 18:58:13 +0000 (19:58 +0100)
committerAlan Third <alan@idiocy.org>
Thu, 1 Jul 2021 19:41:58 +0000 (20:41 +0100)
* Makefile.in:
* configure.ac: Change eln file install location to
Contents/Frameworks.
* src/comp.c (hash_native_abi): Replace dots with underscores in the
eln install location as the macOS code-signing tool won't sign the
files if the parent directories have dots.

Makefile.in
configure.ac
src/comp.c

index 8fccdf7580a8322bc71c4fa8e07808ab1d3f101b..8c14c5cc7dbe1ea7cde0009cb9ab1b3fa28d1d86 100644 (file)
@@ -333,7 +333,7 @@ BIN_DESTDIR='$(DESTDIR)${bindir}/'
 ELN_DESTDIR = $(DESTDIR)${libdir}/emacs/${version}/
 else
 BIN_DESTDIR='${ns_appbindir}/'
-ELN_DESTDIR = ${ns_applibdir}/emacs/${version}/
+ELN_DESTDIR = ${ns_applibdir}/
 endif
 
 all: ${SUBDIR} info
index 6e2cda947ae4b94eb22113d0046e5a815e2f1093..c924634d5b1eca06414c0e7c1ffc893a5560a93b 100644 (file)
@@ -1895,7 +1895,7 @@ if test "${with_ns}" != no; then
      ns_appdir=`pwd`/nextstep/Emacs.app
      ns_appbindir=${ns_appdir}/Contents/MacOS
      ns_applibexecdir=${ns_appdir}/Contents/MacOS/libexec
-     ns_applibdir=${ns_appdir}/Contents/MacOS/lib
+     ns_applibdir=${ns_appdir}/Contents/Frameworks
      ns_appresdir=${ns_appdir}/Contents/Resources
      ns_appsrc=Cocoa/Emacs.base
      ns_fontfile=macfont.o
@@ -1954,7 +1954,7 @@ fail;
      ns_appdir=`pwd`/nextstep/Emacs.app
      ns_appbindir=${ns_appdir}
      ns_applibexecdir=${ns_appdir}/libexec
-     ns_applibdir=${ns_appdir}/lib
+     ns_applibdir=${ns_appdir}/Frameworks
      ns_appresdir=${ns_appdir}/Resources
      ns_appsrc=GNUstep/Emacs.base
      ns_fontfile=nsfont.o
index ea05952627430f3cfc2fa6f043f0ba73edd70e61..c380346482721ceb539828f4762391a308987447 100644 (file)
@@ -744,8 +744,34 @@ hash_native_abi (void)
                        Vsystem_configuration_options),
               Fmapconcat (intern_c_string ("comp--subr-signature"),
                           Vcomp_subr_list, build_string (""))));
+
+  Lisp_Object version = Vemacs_version;
+
+#ifdef NS_SELF_CONTAINED
+  /* MacOS self contained app bundles do not like having dots in the
+     directory names under the Contents/Frameworks directory, so
+     convert them to underscores.  */
+  version = STRING_MULTIBYTE (Vemacs_version)
+    ? make_uninit_multibyte_string (SCHARS (Vemacs_version),
+                                   SBYTES (Vemacs_version))
+    : make_uninit_string (SBYTES (Vemacs_version));
+
+  const unsigned char *from = SDATA (Vemacs_version);
+  unsigned char *to = SDATA (version);
+
+  while (from < SDATA (Vemacs_version) + SBYTES (Vemacs_version))
+    {
+      unsigned char c = *from++;
+
+      if (c == '.')
+       c = '_';
+
+      *to++ = c;
+    }
+#endif
+
   Vcomp_native_version_dir =
-    concat3 (Vemacs_version, build_string ("-"), Vcomp_abi_hash);
+    concat3 (version, build_string ("-"), Vcomp_abi_hash);
 }
 
 static void