Skip to content

Commit

Permalink
Fix buildStackProject in nix-build
Browse files Browse the repository at this point in the history
  • Loading branch information
ElvishJerricco authored and domenkozar committed Nov 1, 2017
1 parent a7d25d4 commit daf7868
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pkgs/development/haskell-modules/generic-stack-builder.nix
@@ -1,20 +1,22 @@
{ stdenv, ghc, pkgconfig, glibcLocales, cacert }@depArgs:
{ stdenv, ghc, pkgconfig, glibcLocales, cacert, stack }@depArgs:

with stdenv.lib;

{ buildInputs ? []
, extraArgs ? []
, LD_LIBRARY_PATH ? []
, ghc ? depArgs.ghc
, stack ? depArgs.stack
, ...
}@args:

stdenv.mkDerivation (args // {
let stackCmd = "stack --internal-re-exec-version=${stack.version}";
in stdenv.mkDerivation (args // {

buildInputs =
buildInputs ++
optional stdenv.isLinux glibcLocales ++
[ ghc pkgconfig ];
[ ghc pkgconfig stack ];

STACK_PLATFORM_VARIANT="nix";
STACK_IN_NIX_SHELL=1;
Expand All @@ -39,13 +41,13 @@ stdenv.mkDerivation (args // {
export STACK_ROOT=$NIX_BUILD_TOP/.stack
'';

buildPhase = args.buildPhase or "stack build";
buildPhase = args.buildPhase or "${stackCmd} build";

checkPhase = args.checkPhase or "stack test";
checkPhase = args.checkPhase or "${stackCmd} test";

doCheck = args.doCheck or true;

installPhase = args.installPhase or ''
stack --local-bin-path=$out/bin build --copy-bins
${stackCmd} --local-bin-path=$out/bin build --copy-bins
'';
})

0 comments on commit daf7868

Please sign in to comment.