@@ -6,6 +6,7 @@
66, bash
77
88, libiconv ? null, ncurses
9+, glibcLocales ? null
910
1011, # GHC can be built with system libffi or a bundled one.
1112 libffi ? null
@@ -109,6 +110,9 @@ stdenv.mkDerivation (rec {
109110
110111 postPatch = "patchShebangs .";
111112
113+ # GHC needs the locale configured during the Haddock phase.
114+ LANG = "en_US.UTF-8";
115+
112116 # GHC is a bit confused on its cross terminology.
113117 preConfigure = ''
114118 for env in $(env | grep '^TARGET_' | sed -E 's|\+?=.*||'); do
@@ -129,6 +133,8 @@ stdenv.mkDerivation (rec {
129133
130134 echo -n "${buildMK}" > mk/build.mk
131135 sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
136+ '' + stdenv.lib.optionalString (stdenv.isLinux) ''
137+ export LOCALE_ARCHIVE="${glibcLocales}/lib/locale/locale-archive"
132138 '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
133139 export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}"
134140 '' + stdenv.lib.optionalString stdenv.isDarwin ''