From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#49271: 28.0.50: native-comp: Signing macOS self-contained .app bundle fails due to new *.eln location Date: Wed, 30 Jun 2021 20:05:50 +0100 Message-ID: References: <83zgv7mtly.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="1jQ6yaDFItKq7seQ" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11954"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 49271@debbugs.gnu.org To: Jim Myhrberg Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 30 21:07:15 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lyfYI-0002yX-Sr for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 30 Jun 2021 21:07:15 +0200 Original-Received: from localhost ([::1]:38514 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lyfYH-0005AV-QK for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 30 Jun 2021 15:07:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53060) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lyfY6-00058i-Hu for bug-gnu-emacs@gnu.org; Wed, 30 Jun 2021 15:07:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47189) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lyfY6-00058g-AB for bug-gnu-emacs@gnu.org; Wed, 30 Jun 2021 15:07:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lyfY6-0002Pb-1w for bug-gnu-emacs@gnu.org; Wed, 30 Jun 2021 15:07:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 30 Jun 2021 19:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49271 X-GNU-PR-Package: emacs Original-Received: via spool by 49271-submit@debbugs.gnu.org id=B49271.16250799669203 (code B ref 49271); Wed, 30 Jun 2021 19:07:02 +0000 Original-Received: (at 49271) by debbugs.gnu.org; 30 Jun 2021 19:06:06 +0000 Original-Received: from localhost ([127.0.0.1]:58735 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyfXC-0002ON-6l for submit@debbugs.gnu.org; Wed, 30 Jun 2021 15:06:06 -0400 Original-Received: from outbound.soverin.net ([116.202.126.228]:36137) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyfX6-0002Nm-JQ for 49271@debbugs.gnu.org; Wed, 30 Jun 2021 15:06:04 -0400 Original-Received: from smtp.soverin.net (unknown [10.10.3.24]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by outbound.soverin.net (Postfix) with ESMTPS id 6EBB12FC; Wed, 30 Jun 2021 19:05:54 +0000 (UTC) Original-Received: from smtp.soverin.net (smtp.soverin.net [159.69.232.138]) by soverin.net DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin; t=1625079953; bh=eXhD80qaMSvIxQKxBfk8kkiEQ+seK1170Rap93OQONc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hmTXlbByOxzP7RNxTTox9Ipao5ItKr2ANohYQXXd2TVUIltDE9XP9kGNdJo/1Wow8 f6aOIY15FNTteyUL6XXOdUPo2PkArnMgRIUkaBaKM2IlxncuRJk2cDDd5urAyXg4Ry qZ6jdJdXR8UXWrJ/qU9fBjDwkD5g6XG4aZu4rUaT8eEt7veE279mBP3Zzeh+6HbQBP EHfSqsDQhSDB8pCJnjKo7auQS16tM8BuD7LJfFsOgmrXCUup0Ms+IR7aVJJJCQyMrU kavxLvsOImgjZwruvnBztQupTmww8oDraps8vUyE0KkFJba1RuiOHHjAU3W1j+c8uN SSMaIK65VbOSQ== Original-Received: by breton.holly.idiocy.org (Postfix, from userid 501) id C86A6202CDB125; Wed, 30 Jun 2021 20:05:50 +0100 (BST) Mail-Followup-To: Alan Third , Jim Myhrberg , Eli Zaretskii , 49271@debbugs.gnu.org Content-Disposition: inline In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:209229 Archived-At: --1jQ6yaDFItKq7seQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Jun 30, 2021 at 02:10:53PM +0100, Jim Myhrberg wrote: > > Also, I'd obviously be more than happy to help with testing any > further changes to eln file locations and related things :) Please try the attached patch. Eli, is this an acceptable way of modifying a lisp string, or is there a better way? I considered just removing the version since it doesn't matter much for the app bundle, but then I realised that would also remove it in the eln cache in .emacs.d, which isn't ideal, so I ended up replacing the dots with underscores. -- Alan Third --1jQ6yaDFItKq7seQ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="0001-Fix-NS-self-contained-eln-location-bug-49271.patch" >From 2d408e5db6f4d111bdf687eea939b0897dad58cd Mon Sep 17 00:00:00 2001 From: Alan Third Date: Wed, 30 Jun 2021 19:58:13 +0100 Subject: [PATCH] Fix NS self contained eln location (bug#49271) * 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 | 2 +- configure.ac | 4 ++-- src/comp.c | 20 +++++++++++++++++++- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/Makefile.in b/Makefile.in index 8fccdf7580..8c14c5cc7d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -333,7 +333,7 @@ BIN_DESTDIR= 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 diff --git a/configure.ac b/configure.ac index 6e2cda947a..c924634d5b 100644 --- a/configure.ac +++ b/configure.ac @@ -1895,7 +1895,7 @@ AC_DEFUN 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 @@ AC_DEFUN 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 diff --git a/src/comp.c b/src/comp.c index ea05952627..ac77ae704d 100644 --- a/src/comp.c +++ b/src/comp.c @@ -744,8 +744,26 @@ 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. */ + + char *str = xstrdup (SSDATA(version)); + + for (ptrdiff_t c = 0 ; c < SBYTES (version) ; c++) + if (*(str + c) == '.') + *(str + c) = '_'; + + version = build_string (str); + xfree (str); +#endif + Vcomp_native_version_dir = - concat3 (Vemacs_version, build_string ("-"), Vcomp_abi_hash); + concat3 (version, build_string ("-"), Vcomp_abi_hash); } static void -- 2.29.2 --1jQ6yaDFItKq7seQ--