Skip to content

Instantly share code, notes, and snippets.

@landonf
Last active September 24, 2020 18:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save landonf/551a64223ef18742e3cb0e0c2a1b20dd to your computer and use it in GitHub Desktop.
Save landonf/551a64223ef18742e3cb0e0c2a1b20dd to your computer and use it in GitHub Desktop.
From fa2732b0fc67cdd1a1b2c67e0ce3c0f1df3f705f Mon Sep 17 00:00:00 2001
From: Landon Fuller <landonf@macports.org>
Date: Tue, 1 Sep 2020 10:05:00 -0600
Subject: [PATCH 01/14] emacs-devel: add experimental native_comp variant
emacs-devel: add workaround to fix handling of next-read-file-uses-dialog-p when using +native_comp
---
editors/emacs/Portfile | 20 +++++++++++++++++++
.../files/patch-Makefile.in-native_comp.diff | 12 +++++++++++
...ive-comp-next-read-file-uses-dialog-p.diff | 13 ++++++++++++
3 files changed, 45 insertions(+)
create mode 100644 editors/emacs/files/patch-Makefile.in-native_comp.diff
create mode 100644 editors/emacs/files/patch-native-comp-next-read-file-uses-dialog-p.diff
diff --git a/editors/emacs/Portfile b/editors/emacs/Portfile
index 94a714a3520..ee4aa324cf3 100644
--- a/editors/emacs/Portfile
+++ b/editors/emacs/Portfile
@@ -102,6 +102,26 @@ if {$subport eq "emacs-devel" || $subport eq "emacs-app-devel"} {
git.url https://github.com/emacs-mirror/emacs.git
git.branch 2a47ef86e95fad1dcc14a02e7471ba5d9cad4b9b
+ variant native_comp {
+ git.branch f0f8d7b82492e741950c363a03b886965c91b1b0
+
+ patchfiles-append patch-Makefile.in-native_comp.diff \
+ patch-native-comp-next-read-file-uses-dialog-p.diff
+
+ configure.args-append --with-nativecomp
+ configure.cppflags-append -I${prefix}/include/gcc10
+ configure.ldflags-append -L${prefix}/lib/gcc10
+
+ depends_lib-append port:gcc10
+
+ if {$subport eq "emacs-app-devel"} {
+ post-patch {
+ reinplace {s|^ELN_DESTDIR =.*|ELN_DESTDIR="${ns_appbindir}/../"|g} \
+ Makefile.in
+ }
+ }
+ }
+
pre-configure {
system -W ${worksrcpath} "sh ./autogen.sh"
}
diff --git a/editors/emacs/files/patch-Makefile.in-native_comp.diff b/editors/emacs/files/patch-Makefile.in-native_comp.diff
new file mode 100644
index 00000000000..06375552c68
--- /dev/null
+++ b/editors/emacs/files/patch-Makefile.in-native_comp.diff
@@ -0,0 +1,12 @@
+--- Makefile.in.orig 2020-08-31 17:06:50.000000000 -0600
++++ Makefile.in 2020-08-31 17:07:13.000000000 -0600
+@@ -760,7 +760,8 @@
+ ### Install native compiled Lisp files.
+ install-eln:
+ ifeq ($(HAVE_NATIVE_COMP),yes)
+- find eln-cache -type f -exec ${INSTALL_DATA} -D "{}" "$(ELN_DESTDIR){}" \;
++ find eln-cache -type d -not -empty -exec ${INSTALL} -d "{}" "$(ELN_DESTDIR){}" \;
++ find eln-cache -type f -exec ${INSTALL_DATA} "{}" "$(ELN_DESTDIR){}" \;
+ endif
+
+ ### Build Emacs and install it, stripping binaries while installing them.
diff --git a/editors/emacs/files/patch-native-comp-next-read-file-uses-dialog-p.diff b/editors/emacs/files/patch-native-comp-next-read-file-uses-dialog-p.diff
new file mode 100644
index 00000000000..4e432af9355
--- /dev/null
+++ b/editors/emacs/files/patch-native-comp-next-read-file-uses-dialog-p.diff
@@ -0,0 +1,13 @@
+diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
+index 3176351b37..c07e4d7bf6 100644
+--- lisp/emacs-lisp/comp.el
++++ lisp/emacs-lisp/comp.el
+@@ -98,7 +98,7 @@ Skip if any is matching."
+ macroexpand scroll-down scroll-up narrow-to-region widen rename-buffer
+ make-indirect-buffer delete-file top-level abort-recursive-edit
+ ;; For user convenience
+- yes-or-no-p
++ yes-or-no-p read-file-name-default dired-read-dir-and-switches next-read-file-uses-dialog-p
+ ;; Make the Evil happy :/
+ read-key-sequence select-window set-window-buffer split-window-internal
+ use-global-map use-local-map)
--
2.28.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment