summary refs log tree commit diff
path: root/pkgs/applications/editors/emacs/generic.nix
diff options
context:
space:
mode:
authoradisbladis <adisbladis@gmail.com>2021-02-25 11:38:20 +0200
committeradisbladis <adisbladis@gmail.com>2021-02-25 12:40:37 +0200
commit44131d7fc36f93f09e71724890f3d3df6b2101eb (patch)
treee52b235c240a36d18ce4157a4a7ae368240b3cd2 /pkgs/applications/editors/emacs/generic.nix
parent73487ea05e6bfe88717ccab2284588571b020004 (diff)
downloadnixpkgs-44131d7fc36f93f09e71724890f3d3df6b2101eb.tar
nixpkgs-44131d7fc36f93f09e71724890f3d3df6b2101eb.tar.gz
nixpkgs-44131d7fc36f93f09e71724890f3d3df6b2101eb.tar.bz2
nixpkgs-44131d7fc36f93f09e71724890f3d3df6b2101eb.tar.lz
nixpkgs-44131d7fc36f93f09e71724890f3d3df6b2101eb.tar.xz
nixpkgs-44131d7fc36f93f09e71724890f3d3df6b2101eb.tar.zst
nixpkgs-44131d7fc36f93f09e71724890f3d3df6b2101eb.zip
emacs: Remove clean-env patch and use substituteInPlace
This approach applies to _all_ RUN_TEMACS calls and successfully removes -dev paths from the closure and reduces the closure size from ~1.4G to just under ~464M.

It's also less brittle than having in-tree patches.
Diffstat (limited to 'pkgs/applications/editors/emacs/generic.nix')
-rw-r--r--pkgs/applications/editors/emacs/generic.nix6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkgs/applications/editors/emacs/generic.nix b/pkgs/applications/editors/emacs/generic.nix
index 70e253dd6df..12c3c57bbec 100644
--- a/pkgs/applications/editors/emacs/generic.nix
+++ b/pkgs/applications/editors/emacs/generic.nix
@@ -63,6 +63,12 @@ let emacs = stdenv.mkDerivation (lib.optionalAttrs nativeComp {
       rm -fr .git
     '')
 
+    # Reduce closure size by cleaning the environment of the emacs dumper
+    ''
+      substituteInPlace src/Makefile.in \
+        --replace 'RUN_TEMACS = ./temacs' 'RUN_TEMACS = env -i ./temacs'
+    ''
+
     ''
     substituteInPlace lisp/international/mule-cmds.el \
       --replace /usr/share/locale ${gettext}/share/locale