about summary refs log tree commit diff
path: root/pkgs/test/haskell/cabalSdist/default.nix
blob: 1031e51e4f1412a9e42b16d939198a3817e166ca (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{ lib, haskellPackages, runCommand }:

let
  localRaw = haskellPackages.callPackage ./local/generated.nix {};
in
lib.recurseIntoAttrs rec {

  helloFromCabalSdist = haskellPackages.buildFromCabalSdist haskellPackages.hello;

  # A more complicated example with a cabal hook.
  hercules-ci-cnix-store = haskellPackages.buildFromCabalSdist haskellPackages.hercules-ci-cnix-store;

  localFromCabalSdist = haskellPackages.buildFromCabalSdist localRaw;

  assumptionLocalHasDirectReference = runCommand "localHasDirectReference" {
    drvPath = builtins.unsafeDiscardOutputDependency localRaw.drvPath;
  } ''
    grep ${./local} $drvPath >/dev/null
    touch $out
  '';

  localHasNoDirectReference = runCommand "localHasNoDirectReference" {
    drvPath = builtins.unsafeDiscardOutputDependency localFromCabalSdist.drvPath;
  } ''
    grep -v ${./local} $drvPath >/dev/null
    touch $out
  '';
}