Skip to content

Commit

Permalink
Merge pull request #56 from cdepillabout/fix-git-extra-deps-subdirs
Browse files Browse the repository at this point in the history
Improve handling of subdirs for git extra-deps
  • Loading branch information
cdepillabout authored Nov 11, 2024
2 parents 6b74b4c + efe66e0 commit 72742cc
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions nix/build-support/stacklock2nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ let
extraGitDep =
let
srcName = haskPkgLock.name + "-git-repo";
rawSrc = builtins.fetchGit {
src = builtins.fetchGit {
url = haskPkgLock.git;
name = srcName;
rev = haskPkgLock.commit;
Expand All @@ -392,19 +392,18 @@ let
# does this by default.
submodules = true;
};
src =
extraCabal2nixOptions =
if haskPkgLock ? "subdir" then
runCommand (srcName + "-get-subdir-" + haskPkgLock.subdir) {} ''
cp -r "${rawSrc}/${haskPkgLock.subdir}" "$out"
''
"--subpath ${haskPkgLock.subdir}"
else
rawSrc;
"";
in {
name = haskPkgLock.name;
value =
hfinal.callCabal2nix
hfinal.callCabal2nixWithOptions
haskPkgLock.name
src
extraCabal2nixOptions
(getAdditionalCabal2nixArgs haskPkgLock.name haskPkgLock.version);
};

Expand Down

0 comments on commit 72742cc

Please sign in to comment.