From 95cc144a5fbc955b84125ac64b12238eee1eb54f Mon Sep 17 00:00:00 2001
From: Ivan Solyankin <vanzef@gmail.com>
Date: Thu, 17 Jan 2019 19:15:35 +0300
Subject: [PATCH] emacsPackagesNg.racer-mode: fix default value for
 RUST_SRC_PATH

---
 pkgs/applications/editors/emacs-modes/melpa-packages.nix | 7 +++++++
 pkgs/top-level/all-packages.nix                          | 3 ++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/pkgs/applications/editors/emacs-modes/melpa-packages.nix b/pkgs/applications/editors/emacs-modes/melpa-packages.nix
index b95a944e612b..401affbfb717 100644
--- a/pkgs/applications/editors/emacs-modes/melpa-packages.nix
+++ b/pkgs/applications/editors/emacs-modes/melpa-packages.nix
@@ -207,6 +207,13 @@ self:
       # upstream issue: missing file header
       qiita = markBroken super.qiita;
 
+      racer = super.racer.overrideAttrs (attrs: {
+        postPatch = attrs.postPatch or "" + ''
+          substituteInPlace racer.el \
+            --replace /usr/local/src/rust/src ${external.rustPlatform.rustcSrc}
+        '';
+      });
+
       # upstream issue: missing file footer
       seoul256-theme = markBroken super.seoul256-theme;
 
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 2bcb2803c0eb..490bff21f471 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -16853,7 +16853,8 @@ in
       inherit (haskellPackages) ghc-mod structured-haskell-mode Agda hindent;
       inherit (pythonPackages) elpy;
       inherit
-        autoconf automake git libffi libpng pkgconfig poppler rtags w3m zlib;
+        autoconf automake git libffi libpng pkgconfig poppler rtags w3m zlib
+        substituteAll rustPlatform;
     };
   };