diff --git a/pkgs/build-support/emacs/wrapper.nix b/pkgs/build-support/emacs/wrapper.nix index d61f6967c4b8..edbe3ed97173 100644 --- a/pkgs/build-support/emacs/wrapper.nix +++ b/pkgs/build-support/emacs/wrapper.nix @@ -135,16 +135,10 @@ runCommand ''} } - siteAutoloads="$out/share/emacs/site-lisp/nix-generated-autoload.el" - touch $siteAutoloads - # Iterate over the array of inputs (avoiding nix's own interpolation) for pkg in "''${requires[@]}"; do linkEmacsPackage $pkg - find $pkg -name "*-autoloads.el" \ - -exec echo \(load \"{}\" \'noerror \'nomessage\) \; >> $siteAutoloads done - echo "(provide 'nix-generated-autoload)" >> $siteAutoloads siteStart="$out/share/emacs/site-lisp/site-start.el" siteStartByteCompiled="$siteStart"c @@ -180,12 +174,12 @@ runCommand > "$subdirs" # Byte-compiling improves start-up time only slightly, but costs nothing. - $emacs/bin/emacs --batch -f batch-byte-compile "$siteStart" "$subdirs" "$siteAutoloads" + $emacs/bin/emacs --batch -f batch-byte-compile "$siteStart" "$subdirs" ${optionalString nativeComp '' $emacs/bin/emacs --batch \ --eval "(add-to-list 'native-comp-eln-load-path \"$out/share/emacs/native-lisp/\")" \ - -f batch-native-compile "$siteStart" "$subdirs" "$siteAutoloads" + -f batch-native-compile "$siteStart" "$subdirs" ''} ''; @@ -197,18 +191,12 @@ runCommand # Wrap emacs and friends so they find our site-start.el before the original. for prog in $emacs/bin/*; do # */ local progname=$(basename "$prog") - local autoloadExpression="" rm -f "$out/bin/$progname" - if [[ $progname == emacs ]]; then - # progs other than "emacs" do not understand the `-l` switches - autoloadExpression="-l cl-loaddefs -l nix-generated-autoload" - fi substitute ${./wrapper.sh} $out/bin/$progname \ --subst-var-by bash ${emacs.stdenv.shell} \ --subst-var-by wrapperSiteLisp "$deps/share/emacs/site-lisp" \ --subst-var-by wrapperSiteLispNative "$deps/share/emacs/native-lisp:" \ - --subst-var autoloadExpression \ --subst-var prog chmod +x $out/bin/$progname done @@ -228,7 +216,6 @@ runCommand --subst-var-by bash ${emacs.stdenv.shell} \ --subst-var-by wrapperSiteLisp "$deps/share/emacs/site-lisp" \ --subst-var-by wrapperSiteLispNative "$deps/share/emacs/native-lisp:" \ - --subst-var-by autoloadExpression "-l cl-loaddefs -l nix-generated-autoload" \ --subst-var-by prog "$emacs/Applications/Emacs.app/Contents/MacOS/Emacs" chmod +x $out/Applications/Emacs.app/Contents/MacOS/Emacs fi diff --git a/pkgs/build-support/emacs/wrapper.sh b/pkgs/build-support/emacs/wrapper.sh index 16da2a9f6495..e8eecb8c8696 100644 --- a/pkgs/build-support/emacs/wrapper.sh +++ b/pkgs/build-support/emacs/wrapper.sh @@ -44,4 +44,4 @@ export emacsWithPackages_siteLisp=@wrapperSiteLisp@ export EMACSNATIVELOADPATH="${newNativeLoadPath[*]}" export emacsWithPackages_siteLispNative=@wrapperSiteLispNative@ -exec @prog@ @autoloadExpression@ "$@" +exec @prog@ "$@"