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:
parent
98fcc2f746
commit
bf3b9ccee3
@ -1,6 +1,6 @@
|
|||||||
# generic builder for Cabal packages
|
# generic builder for Cabal packages
|
||||||
|
|
||||||
{ stdenv, fetchurl, lib, pkgconfig, ghc, Cabal, jailbreakCabal
|
{ stdenv, fetchurl, lib, pkgconfig, ghc, Cabal, jailbreakCabal, glibcLocales
|
||||||
, enableLibraryProfiling ? false
|
, enableLibraryProfiling ? false
|
||||||
, enableCheckPhase ? true
|
, enableCheckPhase ? true
|
||||||
}:
|
}:
|
||||||
@ -112,6 +112,10 @@ assert enableCheckPhase -> stdenv.lib.versionOlder "7" ghc.ghcVersion;
|
|||||||
(stdenv.lib.enableFeature self.enableSplitObjs "split-objs")
|
(stdenv.lib.enableFeature self.enableSplitObjs "split-objs")
|
||||||
] ++ stdenv.lib.optional (stdenv.lib.versionOlder "7" ghc.ghcVersion) (stdenv.lib.enableFeature self.doCheck "tests");
|
] ++ 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
|
# compiles Setup and configures
|
||||||
configurePhase = ''
|
configurePhase = ''
|
||||||
eval "$preConfigure"
|
eval "$preConfigure"
|
||||||
@ -150,11 +154,7 @@ assert enableCheckPhase -> stdenv.lib.versionOlder "7" ghc.ghcVersion;
|
|||||||
./Setup build
|
./Setup build
|
||||||
|
|
||||||
export GHC_PACKAGE_PATH=$(${ghc.GHCPackages})
|
export GHC_PACKAGE_PATH=$(${ghc.GHCPackages})
|
||||||
if [ -z "$noHaddock" ]; then
|
test -n "$noHaddock" || ./Setup haddock
|
||||||
export LANG="en_US.UTF-8"
|
|
||||||
./Setup haddock
|
|
||||||
unset LANG
|
|
||||||
fi
|
|
||||||
|
|
||||||
eval "$postBuild"
|
eval "$postBuild"
|
||||||
'';
|
'';
|
||||||
|
@ -105,6 +105,7 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
|
|||||||
cabal = callPackage ../build-support/cabal {
|
cabal = callPackage ../build-support/cabal {
|
||||||
enableLibraryProfiling = enableLibraryProfiling;
|
enableLibraryProfiling = enableLibraryProfiling;
|
||||||
enableCheckPhase = pkgs.stdenv.lib.versionOlder "7.4" self.ghc.ghcVersion;
|
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.
|
# A variant of the cabal build driver that disables unit testing.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user