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