mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-15 13:37:21 +03:00
Merge pull request #15989 from mboes/stack-builder-tweaks
haskell.lib.buildStackProject: allow passing in a custom GHC version.
This commit is contained in:
commit
52edff8689
@ -378,6 +378,23 @@ special options turned on:
|
||||
buildInputs = [ R zeromq zlib ];
|
||||
}
|
||||
|
||||
You can select a particular GHC version to compile with by setting the
|
||||
`ghc` attribute as an argument to `buildStackProject`. Better yet, let
|
||||
Stack choose what GHC version it wants based on the snapshot specified
|
||||
in `stack.yaml` (only works with Stack >= 1.1.3):
|
||||
|
||||
{nixpkgs ? import <nixpkgs> { }, ghc ? nixpkgs.ghc}
|
||||
|
||||
with nixpkgs;
|
||||
|
||||
let R = pkgs.R.override { enableStrictBarrier = true; };
|
||||
in
|
||||
haskell.lib.buildStackProject {
|
||||
name = "HaskellR";
|
||||
buildInputs = [ R zeromq zlib ];
|
||||
inherit ghc;
|
||||
}
|
||||
|
||||
[stack-nix-doc]: http://docs.haskellstack.org/en/stable/nix_integration.html
|
||||
|
||||
### How to create ad hoc environments for `nix-shell`
|
||||
|
@ -4,7 +4,8 @@ with stdenv.lib;
|
||||
|
||||
{ buildInputs ? []
|
||||
, extraArgs ? []
|
||||
, LD_LIBRARY_PATH ? ""
|
||||
, LD_LIBRARY_PATH ? []
|
||||
, ghc ? ghc
|
||||
, ...
|
||||
}@args:
|
||||
|
||||
@ -22,7 +23,7 @@ stdenv.mkDerivation (args // {
|
||||
extraArgs;
|
||||
|
||||
# XXX: workaround for https://ghc.haskell.org/trac/ghc/ticket/11042.
|
||||
LD_LIBRARY_PATH = "${makeLibraryPath buildInputs}:${LD_LIBRARY_PATH}";
|
||||
LD_LIBRARY_PATH = makeLibraryPath (LD_LIBRARY_PATH ++ buildInputs);
|
||||
|
||||
preferLocalBuild = true;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user