on e94de40 help sign in
53 lines 1.3 kB history raw
1{ pkgs, compiler-nix-name }:
3with pkgs;
4with stdenv.lib;
6let
7 project = haskell-nix.cabalProject' {
8 inherit compiler-nix-name;
9 src = pkgs.haskell-nix.haskellLib.cleanGit { src = ../..; name = "setup-deps"; subDir = "test/setup-deps"; };
10 modules = [{
11 # Package has no exposed modules which causes
12 # haddock: No input file(s)
13 packages.bytestring-builder.doHaddock = false;
14 }
15 { reinstallableLibGhc = true; } ];
16 };
18 packages = project.hsPkgs;
19in recurseIntoAttrs (if stdenv.buildPlatform != stdenv.hostPlatform
20 then
21 let skip = pkgs.runCommand "skip-test-setup-deps" {} ''
22 echo "Skipping setup-deps test when cross compiling as it needs the ghc lib" >& 2
23 touch $out
24 '';
25 in {
26 ifdInputs = { plan-nix = skip; };
27 run = skip;
28 }
29 else {
30 ifdInputs = {
31 inherit (project) plan-nix;
32 };
33 run = pkgs.stdenv.mkDerivation {
34 name = "setup-deps-test";
36 buildCommand = ''
37 exe="${packages.pkg.components.exes.pkg}/bin/pkg"
39 printf "checking whether executable runs... " >& 2
40 $exe
42 touch $out
43 '';
45 meta.platforms = platforms.unix;
46 meta.disabled = stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWindows;
48 passthru = {
49 # Attributes used for debugging with nix repl
50 inherit project packages;
51 };
52 };
53})