pkgs/build-support/cabal: unconditionally set $LANG to "en_US.UTF-8" during Haskell builds

Haskell tools like Haddock require a locale to be configured, so do some
regression test suites.
This commit is contained in:
Peter Simons 2013-08-31 11:00:08 +02:00
parent 98fcc2f746
commit bf3b9ccee3
2 changed files with 7 additions and 6 deletions

View file

@ -1,6 +1,6 @@
# generic builder for Cabal packages
{ stdenv, fetchurl, lib, pkgconfig, ghc, Cabal, jailbreakCabal
{ stdenv, fetchurl, lib, pkgconfig, ghc, Cabal, jailbreakCabal, glibcLocales
, enableLibraryProfiling ? false
, enableCheckPhase ? true
}:
@ -112,6 +112,10 @@ assert enableCheckPhase -> stdenv.lib.versionOlder "7" ghc.ghcVersion;
(stdenv.lib.enableFeature self.enableSplitObjs "split-objs")
] ++ stdenv.lib.optional (stdenv.lib.versionOlder "7" ghc.ghcVersion) (stdenv.lib.enableFeature self.doCheck "tests");
# GHC needs the locale configured during the Haddock phase.
LANG = "en_US.UTF-8";
LOCALE_ARCHIVE = lib.optionalString stdenv.isLinux "${glibcLocales}/lib/locale/locale-archive";
# compiles Setup and configures
configurePhase = ''
eval "$preConfigure"
@ -150,11 +154,7 @@ assert enableCheckPhase -> stdenv.lib.versionOlder "7" ghc.ghcVersion;
./Setup build
export GHC_PACKAGE_PATH=$(${ghc.GHCPackages})
if [ -z "$noHaddock" ]; then
export LANG="en_US.UTF-8"
./Setup haddock
unset LANG
fi
test -n "$noHaddock" || ./Setup haddock
eval "$postBuild"
'';

View file

@ -105,6 +105,7 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
cabal = callPackage ../build-support/cabal {
enableLibraryProfiling = enableLibraryProfiling;
enableCheckPhase = pkgs.stdenv.lib.versionOlder "7.4" self.ghc.ghcVersion;
glibcLocales = if pkgs.stdenv.isLinux then pkgs.glibcLocales else null;
};
# A variant of the cabal build driver that disables unit testing.