on e94de40 help sign in
57 lines 1.7 kB history raw
1{ stdenv, haskellPackages, snapshots, recurseIntoAttrs, runCommand, testSrc }:
3with stdenv.lib;
5let
6 env = snapshots."lts-14.13".ghcWithHoogle
7 (ps: with ps; [ conduit conduit-extra resourcet ]);
9in recurseIntoAttrs (if stdenv.hostPlatform.isWindows
10 then
11 let skip = runCommand "skip-test-snapshot" {} ''
12 echo "Skipping snapshot test on windows as does not work yet" >& 2
13 touch $out
14 '';
15 in {
16 env = skip;
17 run = skip;
18 }
19 else {
20 inherit env;
21 run = stdenv.mkDerivation {
22 name = "shell-for-test";
24 buildCommand = if stdenv.hostPlatform.isWindows
25 then ''
26 printf "snapshot test is not working yet for windows. skipping. " >& 2
27 touch $out
28 ''
29 else ''
30 ########################################################################
31 # test single component from haskellPackages
33 printf "checking that the latest LTS snapshot has the lens package...\n" >& 2
34 test -d ${haskellPackages.lens.components.library}
36 ########################################################################
37 # test snapshot ghcWithHoogle
39 printf "checking that the ghcWithPackages env has the package...\n" >& 2
40 ${env}/bin/${env.targetPrefix}ghc-pkg list | grep conduit
42 ''
43 # Hoogle support is currently disabled in cross compiler shells
44 + (optionalString (!stdenv.hostPlatform.isAarch32 && !stdenv.hostPlatform.isAarch64) ''
45 printf "checking that the ghcWithPackages env has a hoogle index...\n" >& 2
46 ${env}/bin/hoogle search Conduit --count=100 | grep ConduitT
47 '') +''
49 touch $out
50 '';
52 meta.platforms = platforms.all;
53 passthru = {
54 inherit env;
55 };
56 };
57})