nix-helpers: f611b8c9e11ad78f4f1de9c2abda81979b5b05a8
1: { fail, hello, mupdf, runCommand, without }:
2:
3: with builtins;
4: with rec {
5: go = { label, pkg, toRemove }:
6: runCommand "can-remove-${label}" {
7: buildInputs = [ fail ];
8: p = without pkg toRemove;
9: } ''
10: [[ -e "$p" ]] || fail "Dir '$p' not found"
11: ${concatStringsSep "\n"
12: (map (p: ''[[ -e "$p/${p}" ]] && fail "Didn't remove '$p/${p}'"'')
13: toRemove)}
14: mkdir "$out"
15: '';
16: }; {
17: canRemoveSimple = go {
18: label = "simple-package";
19: pkg = hello;
20: toRemove = [ "bin/hello" ];
21: };
22:
23: canRemoveMultiOutput = go {
24: label = "multi-output-derivation";
25: pkg = mupdf;
26: toRemove = [ "bin/mupdf-gl" "bin/mupdf-x11-curl" ];
27: };
28: }
Generated by git2html.