ghcWithPackages: Fix cross, and avoid needless C compiler

This commit is contained in:
John Ericson 2018-01-02 23:39:28 -05:00
parent bc066466fb
commit 5e31e828f8
2 changed files with 4 additions and 4 deletions

View File

@ -100,7 +100,7 @@ let
defaultScope = mkScope self;
callPackage = drv: args: callPackageWithScope defaultScope drv args;
withPackages = packages: callPackage ./with-packages-wrapper.nix {
withPackages = packages: buildPackages.callPackage ./with-packages-wrapper.nix {
inherit (self) llvmPackages;
haskellPackages = self;
inherit packages;

View File

@ -1,4 +1,4 @@
{ stdenv, lib, ghc, llvmPackages, packages, symlinkJoin, makeWrapper
{ lib, targetPlatform, ghc, llvmPackages, packages, symlinkJoin, makeWrapper
, ignoreCollisions ? false, withLLVM ? false
, postBuild ? ""
, haskellPackages
@ -48,7 +48,7 @@ let
# https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/code-generators.html
llvm = lib.makeBinPath
([ llvmPackages.llvm ]
++ lib.optional stdenv.isDarwin llvmPackages.clang);
++ lib.optional targetPlatform.isDarwin llvmPackages.clang);
in
if paths == [] && !withLLVM then ghc else
symlinkJoin {
@ -98,7 +98,7 @@ symlinkJoin {
makeWrapper ${ghc}/bin/$prg $out/bin/$prg --add-flags "${packageDBFlag}=${packageCfgDir}"
fi
done
'' + (lib.optionalString stdenv.isDarwin ''
'' + (lib.optionalString targetPlatform.isDarwin ''
# Work around a linker limit in macOS Sierra (see generic-builder.nix):
local packageConfDir="$out/lib/${ghc.name}/package.conf.d";
local dynamicLinksDir="$out/lib/links"