on e94de40 help sign in
37 lines 1.0 kB history raw
1{ stdenv, stackProject', recurseIntoAttrs, haskellLib, testSrc }:
3with stdenv.lib;
5let
6 project = stackProject' {
7 src = testSrc "ghc-options";
8 };
9 packages = project.hsPkgs;
11 # Get the names of all packages. This is a test to see
12 # whether there is a broken "$locals" package present.
13 hasIdentifier = p: p != null && p ? identifier;
14 packageNames = mapAttrsToList (name: p: p.identifier.name) (filterAttrs (name: hasIdentifier) packages);
16in recurseIntoAttrs {
17 ifdInputs = {
18 inherit (project) stack-nix;
19 };
20 run = stdenv.mkDerivation {
21 name = "callStackToNix-test";
23 buildCommand = ''
24 printf "checking whether executable runs... " >& 2
25 cat ${haskellLib.check packages.test-ghc-options.components.exes.test-ghc-options-exe}/test-stdout
27 echo '${concatStringsSep " " packageNames}' > $out
28 '';
30 meta.platforms = platforms.all;
32 passthru = {
33 # Attributes used for debugging with nix repl
34 inherit project packages;
35 };
36 };