mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-27 22:03:54 +03:00
ghcWithPackages: Fix cross, and avoid needless C compiler
This commit is contained in:
parent
bc066466fb
commit
5e31e828f8
@ -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;
|
||||||
|
@ -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"
|
||||||
|
Loading…
Reference in New Issue
Block a user