From 939d6be93d011a3cb5bc4c8341a7853d7aacb833 Mon Sep 17 00:00:00 2001 From: Aaron Madlon-Kay Date: Wed, 3 Jun 2026 09:45:02 +0900 Subject: [PATCH] emacs{,-app}{,-devel}: fix etags-program-name for all cases See https://trac.macports.org/ticket/72136 --- editors/emacs/Portfile | 23 +++++++---------------- editors/emacs/files/site-start-app.el | 2 ++ editors/emacs/files/site-start.el | 3 +++ 3 files changed, 12 insertions(+), 16 deletions(-) create mode 100644 editors/emacs/files/site-start.el diff --git a/editors/emacs/Portfile b/editors/emacs/Portfile index 8361d4ff537..74db4df227b 100644 --- a/editors/emacs/Portfile +++ b/editors/emacs/Portfile @@ -92,21 +92,6 @@ depends_lib-append port:gmp \ compiler.blacklist-append *gcc-4.0 *gcc-4.2 -post-patch { - if {$subport eq $name || $subport eq "emacs-devel"} { - # Make etags-program-name match the etags binary, which we - # rename to etags-emacs in post-destroot to avoid conflicts - # with xemacs. See https://trac.macports.org/ticket/72136. - reinplace -E {s|(Vetags_program_name = build[a-z_]*_string )\("etags"\)|\1("etags-emacs")|} \ - ${worksrcpath}/src/callproc.c - if {[catch {exec grep -qF {("etags-emacs")} ${worksrcpath}/src/callproc.c}]} { - return -code error "Failed to patch etags-program-name in src/callproc.c;\ - upstream source may have changed. See\ - https://trac.macports.org/ticket/72136" - } - } -} - post-destroot { xinstall -d ${destroot}${prefix}/share/emacs/${version}/leim delete ${destroot}${prefix}/bin/ctags @@ -116,6 +101,10 @@ post-destroot { # avoid conflicts with xemacs move ${destroot}${prefix}/bin/etags ${destroot}${prefix}/bin/etags-emacs move ${destroot}${prefix}/share/man/man1/etags.1.gz ${destroot}${prefix}/share/man/man1/etags-emacs.1.gz + + file mkdir ${destroot}${prefix}/share/emacs/site-lisp + file copy ${filespath}/site-start.el \ + ${destroot}${prefix}/share/emacs/site-lisp/site-start.el } } @@ -139,7 +128,7 @@ platform darwin { if {$subport eq $name || $subport eq "emacs-app"} { version 30.2 - revision 10 + revision 11 checksums rmd160 fefdd3fcd453d733114f609a3e122b2529cc7410 \ sha256 1d79a4ba4d6596f302a7146843fe59cf5caec798190bcc07c907e7ba244b076d \ size 83059014 @@ -292,6 +281,8 @@ if {$subport eq "emacs-app" || $subport eq "emacs-app-devel"} { ${destroot}${applications_dir}/Emacs.app/Contents/Resources/site-lisp/site-start.el reinplace "s|__PREFIX__|${prefix}|g" \ ${destroot}${applications_dir}/Emacs.app/Contents/Resources/site-lisp/site-start.el + reinplace "s|__APPLICATIONS_DIR__|${applications_dir}|g" \ + ${destroot}${applications_dir}/Emacs.app/Contents/Resources/site-lisp/site-start.el } variant imagemagick description {Use ImageMagick} { diff --git a/editors/emacs/files/site-start-app.el b/editors/emacs/files/site-start-app.el index 1b9752f0c2e..0becabe3c08 100644 --- a/editors/emacs/files/site-start-app.el +++ b/editors/emacs/files/site-start-app.el @@ -16,3 +16,5 @@ ;; Use the OS X Emoji font for Emoticons (when (fboundp 'set-fontset-font) (set-fontset-font t 'emoji '("Apple Color Emoji" . "iso10646-1") nil 'prepend)) + +(setq etags-program-name "__APPLICATIONS_DIR__/Emacs.app/Contents/MacOS/bin/etags") diff --git a/editors/emacs/files/site-start.el b/editors/emacs/files/site-start.el new file mode 100644 index 00000000000..9efa13a8582 --- /dev/null +++ b/editors/emacs/files/site-start.el @@ -0,0 +1,3 @@ +;; -*- lexical-binding: t; -*- + +(setq etags-program-name "etags-emacs")