Skip to content

Commit 63d5c43

Browse files
committed
Fix cabal-project-nix-path test
1 parent 7c56d2b commit 63d5c43

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

test/cabal-project-nix-path/default.nix

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
{ lib, cabalProject', tool, recurseIntoAttrs, testSrc, compiler-nix-name, evalPackages }:
22
let
3+
# Kind of round about way of getting the source for the hello package from hackage
4+
# so we can use it in this test.
5+
hello-src = evalPackages.runCommand "hello-src" { nativeBuildInputs = [ evalPackages.gnutar ]; } ''
6+
mkdir -p $out
7+
tar -xzf ${(tool compiler-nix-name "hello" { inherit evalPackages; }).src} -C $out
8+
mv $out/hello-*/* $out
9+
'';
310
project = cabalProject' {
411
name = "cabal-project-nix-path";
512
inherit compiler-nix-name evalPackages;
613
src = testSrc "cabal-project-nix-path";
714
cabalProject = ''
8-
packages: ${(tool compiler-nix-name "hello" { inherit evalPackages; }).project.args.src}
15+
packages: ${hello-src}
916
'';
1017
};
1118
# The same but with source in a subdir of the store path
1219
projectSubDir = project.appendModule {
1320
cabalProject = lib.mkForce ''
14-
packages: ${evalPackages.runCommand "hello-src" {} "mkdir -p $out && cp -r ${(tool compiler-nix-name "hello" { inherit evalPackages; }).project.args.src} $out/subdir"}/subdir
21+
packages: ${evalPackages.runCommand "hello-src-in-subdir" {} "mkdir -p $out && cp -r ${hello-src} $out/subdir"}/subdir
1522
'';
1623
};
1724

0 commit comments

Comments
 (0)