haskellPackages.mkDerivation: small clean up

This commit is contained in:
figsoda 2023-05-31 16:19:37 -04:00
parent 138d6b4463
commit c12654760c

View file

@ -7,7 +7,7 @@ let
isCross = stdenv.buildPlatform != stdenv.hostPlatform; isCross = stdenv.buildPlatform != stdenv.hostPlatform;
inherit (buildPackages) inherit (buildPackages)
fetchurl removeReferencesTo fetchurl removeReferencesTo
pkg-config coreutils gnugrep gnused glibcLocales; pkg-config coreutils gnugrep glibcLocales;
in in
{ pname { pname
@ -246,11 +246,11 @@ let
"--ghc-options=-haddock" "--ghc-options=-haddock"
]; ];
postPhases = optional doInstallIntermediates [ "installIntermediatesPhase" ]; postPhases = optional doInstallIntermediates "installIntermediatesPhase";
setupCompileFlags = [ setupCompileFlags = [
(optionalString (!coreSetup) "-${nativePackageDbFlag}=$setupPackageConfDir") (optionalString (!coreSetup) "-${nativePackageDbFlag}=$setupPackageConfDir")
(optionalString enableParallelBuilding (parallelBuildingFlags)) (optionalString enableParallelBuilding parallelBuildingFlags)
"-threaded" # https://github.com/haskell/cabal/issues/2398 "-threaded" # https://github.com/haskell/cabal/issues/2398
"-rtsopts" # allow us to pass RTS flags to the generated Setup executable "-rtsopts" # allow us to pass RTS flags to the generated Setup executable
]; ];
@ -698,7 +698,7 @@ stdenv.mkDerivation ({
lib.optionals (!isCross) setupHaskellDepends); lib.optionals (!isCross) setupHaskellDepends);
ghcCommandCaps = lib.toUpper ghcCommand'; ghcCommandCaps = lib.toUpper ghcCommand';
in stdenv.mkDerivation ({ in stdenv.mkDerivation {
inherit name shellHook; inherit name shellHook;
depsBuildBuild = lib.optional isCross ghcEnvForBuild; depsBuildBuild = lib.optional isCross ghcEnvForBuild;
@ -718,7 +718,7 @@ stdenv.mkDerivation ({
"NIX_${ghcCommandCaps}_LIBDIR" = if ghc.isHaLVM or false "NIX_${ghcCommandCaps}_LIBDIR" = if ghc.isHaLVM or false
then "${ghcEnv}/lib/HaLVM-${ghc.version}" then "${ghcEnv}/lib/HaLVM-${ghc.version}"
else "${ghcEnv}/${ghcLibdir}"; else "${ghcEnv}/${ghcLibdir}";
}); };
env = envFunc { }; env = envFunc { };