Merge pull request #114335 from adisbladis/emacs-pdump-clean-env

emacs: Remove clean-env patch and use substituteInPlace
This commit is contained in:
adisbladis 2021-02-25 13:09:04 +02:00 committed by GitHub
commit 629d61247c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 35 deletions

View File

@ -2,7 +2,6 @@ import ./generic.nix (rec {
version = "26.3";
sha256 = "119ldpk7sgn9jlpyngv5y4z3i7bb8q3xp4p0qqi7i5nq39syd42d";
patches = [
./clean-env-26.patch
./tramp-detect-wrapped-gvfsd-26.patch
];
})

View File

@ -2,7 +2,6 @@ import ./generic.nix (rec {
version = "27.1";
sha256 = "0h9f2wpmp6rb5rfwvqwv1ia1nw86h74p7hnz3vb3gjazj67i4k2a";
patches = [
./clean-env.patch
./tramp-detect-wrapped-gvfsd.patch
];
})

View File

@ -1,15 +0,0 @@
Dump temacs in an empty environment to prevent -dev paths from ending
up in the dumped image.
diff --git a/src/Makefile.in b/src/Makefile.in
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -535,7 +535,7 @@ ifeq ($(CANNOT_DUMP),yes)
ln -f temacs$(EXEEXT) $@
else
unset EMACS_HEAP_EXEC; \
- LC_ALL=C $(RUN_TEMACS) -batch $(BUILD_DETAILS) -l loadup dump
+ env -i LC_ALL=C $(RUN_TEMACS) -batch $(BUILD_DETAILS) -l loadup dump
ifneq ($(PAXCTL_dumped),)
$(PAXCTL_dumped) $@
endif

View File

@ -1,16 +0,0 @@
Dump temacs in an empty environment to prevent -dev paths from ending
up in the dumped image.
diff --git a/src/Makefile.in b/src/Makefile.in
index fd05a45df5..13f529c253 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -570,7 +570,7 @@ emacs$(EXEEXT): temacs$(EXEEXT) \
lisp.mk $(etc)/DOC $(lisp) \
$(lispsource)/international/charprop.el ${charsets}
ifeq ($(DUMPING),unexec)
- LC_ALL=C $(RUN_TEMACS) -batch $(BUILD_DETAILS) -l loadup --temacs=dump
+ env -i LC_ALL=C $(RUN_TEMACS) -batch $(BUILD_DETAILS) -l loadup --temacs=dump
ifneq ($(PAXCTL_dumped),)
$(PAXCTL_dumped) emacs$(EXEEXT)
endif

View File

@ -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

View File

@ -26,8 +26,6 @@ stdenv.mkDerivation rec {
sha256 = "0f2wzdw2a3ac581322b2y79rlj3c9f33ddrq9allj97r1si6v5xk";
};
patches = [ ./clean-env.patch ];
enableParallelBuilding = true;
nativeBuildInputs = [ pkg-config autoconf automake ];
@ -57,6 +55,11 @@ stdenv.mkDerivation rec {
# Fix sandbox impurities.
substituteInPlace Makefile.in --replace '/bin/pwd' 'pwd'
substituteInPlace lib-src/Makefile.in --replace '/bin/pwd' 'pwd'
# Reduce closure size by cleaning the environment of the emacs dumper
substituteInPlace src/Makefile.in \
--replace 'RUN_TEMACS = ./temacs' 'RUN_TEMACS = env -i ./temacs'
'';
configureFlags = [