From 9a658d340fc6fe2cfaa47309e216fab8235445a9 Mon Sep 17 00:00:00 2001
From: Charles Strahan <charles.c.strahan@gmail.com>
Date: Tue, 5 May 2015 20:43:47 -0400
Subject: [PATCH] ghc-7.10.1: fix user pkg db location for GHCJS

This cherry picks the commit referenced on the associated trac ticket:
https://ghc.haskell.org/trac/ghc/ticket/10232
---
 pkgs/development/compilers/ghc/7.10.1.nix | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/pkgs/development/compilers/ghc/7.10.1.nix b/pkgs/development/compilers/ghc/7.10.1.nix
index 5bec1fa3f559..4eb4a501e4e3 100644
--- a/pkgs/development/compilers/ghc/7.10.1.nix
+++ b/pkgs/development/compilers/ghc/7.10.1.nix
@@ -35,6 +35,15 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
+  patches = [
+    # Fix user pkg db location for GHCJS: 
+    # https://ghc.haskell.org/trac/ghc/ticket/10232
+    (fetchpatch {
+      url = "https://git.haskell.org/ghc.git/patch/c46e4b184e0abc158ad8f1eff6b3f0421acaf984";
+      sha256 = "0fkdyqd4bqp742rydwmqq8d2n7gf61bgdhaiw8xf7jy0ix7lr60w";
+    })
+  ];
+
   postPatch = ''
     pushd libraries/Cabal
     patch -p1 < ${cabalPatch}