summary refs log tree commit diff
path: root/gnu/packages
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/emacs.scm3
-rw-r--r--gnu/packages/patches/emacs-exec-path.patch18
2 files changed, 20 insertions, 1 deletions
diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index d680f2b951..c7f91843bd 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -64,7 +64,8 @@
                                  version ".tar.xz"))
              (sha256
               (base32
-               "0kn3rzm91qiswi0cql89kbv6mqn27rwsyjfb8xmwy9m5s8fxfiyx"))))
+               "0kn3rzm91qiswi0cql89kbv6mqn27rwsyjfb8xmwy9m5s8fxfiyx"))
+             (patches (list (search-patch "emacs-exec-path.patch")))))
     (build-system glib-or-gtk-build-system)
     (arguments
      '(#:phases (alist-cons-before
diff --git a/gnu/packages/patches/emacs-exec-path.patch b/gnu/packages/patches/emacs-exec-path.patch
new file mode 100644
index 0000000000..884fa94a64
--- /dev/null
+++ b/gnu/packages/patches/emacs-exec-path.patch
@@ -0,0 +1,18 @@
+Do not capture the build-time value of $PATH in the 'emacs' executable
+since this can noticeably increase the size of the closure of Emacs
+with things like GCC being referenced.
+
+--- a/lisp/loadup.el
++++ b/lisp/loadup.el
+@@ -64,6 +64,11 @@
+ 			    (expand-file-name "textmodes" dir)
+ 			    (expand-file-name "vc" dir)))))
+ 
++;; Reset 'exec-path' so we don't capture the build-time $PATH in the
++;; 'emacs' executable.
++(setq-default exec-path nil)
++(setq exec-path nil)
++
+ (if (eq t purify-flag)
+     ;; Hash consing saved around 11% of pure space in my tests.
+     (setq purify-flag (make-hash-table :test 'equal :size 70000)))