From 3d52d43dd983a2e0d966cb55b84d6dd66a16bf12 Mon Sep 17 00:00:00 2001 From: Moritz Drexl Date: Sat, 16 Dec 2017 12:21:46 +0100 Subject: [PATCH] emacs: enable vfork on darwin Issue described here: https://lists.gnu.org/archive/html/bug-gnu-emacs/2017-04/msg00201.html In particular fixes lagging magit, as described here: https://magit.vc/manual/magit/MacOS-Performance.html The .patch file is taken from the reference there. The fix is in Emacs master, so this patch should be removed when switching to Emacs 26.1. --- pkgs/applications/editors/emacs/default.nix | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/editors/emacs/default.nix b/pkgs/applications/editors/emacs/default.nix index af3298a5883..f87cc72f2f2 100644 --- a/pkgs/applications/editors/emacs/default.nix +++ b/pkgs/applications/editors/emacs/default.nix @@ -36,9 +36,19 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - patches = - [ ./clean-env.patch ] - ++ lib.optional stdenv.isDarwin ./at-fdcwd.patch; + patches = [ + ./clean-env.patch + ] ++ lib.optionals stdenv.isDarwin [ + ./at-fdcwd.patch + + # Backport of the fix to + # https://lists.gnu.org/archive/html/bug-gnu-emacs/2017-04/msg00201.html + # Should be removed when switching to Emacs 26.1 + (fetchurl { + url = "https://gist.githubusercontent.com/aaronjensen/f45894ddf431ecbff78b1bcf533d3e6b/raw/6a5cd7f57341aba673234348d8b0d2e776f86719/Emacs-25-OS-X-use-vfork.patch"; + sha256 = "1nlsxiaynswqhy99jf4mw9x0sndhwcrwy8713kq1l3xqv9dbrzgj"; + }) + ]; nativeBuildInputs = [ pkgconfig ] ++ lib.optionals srcRepo [ autoconf automake texinfo ]