on iko/ghcjs-patch-master help sign in
Fix `cabalProject { src = ./.; }` (#751)
commita2bc3db0f1f570e47092a4b46f68ed43ac94bd40 authorMoritz Angermann <moritz.angermann@gmail.com> dateTue 7 Jul 2020, 14:22 (6 years ago) parent18e2d61
2 files changed+5−5
lib/call-cabal-project-to-nix.nix+3−3 lib/import-and-filter-project.nix+2−2
lib/call-cabal-project-to-nix.nix+3−3
@@ -80,9 +80,9 @@ let
8080 maybeCleanedSource =
8181 if haskellLib.canCleanSource src
8282 then (haskellLib.cleanSourceWith {
83− name = src.name + "-root-cabal-files";
84− src = src.origSrc;
85− filter = path: type: src.filter path type && (
83+ name = if name != null then "${name}-root-cabal-files" else "source-root-cabal-files";
84+ src = src.origSrc or src;
85+ filter = path: type: (!(src ? filter) || src.filter path type) && (
8686 type == "directory" ||
8787 pkgs.lib.any (i: (pkgs.lib.hasSuffix i path)) [ ".cabal" "package.yaml" ]); })
8888 else src.origSrc or src;
lib/import-and-filter-project.nix+2−2
@@ -9,9 +9,9 @@ let
99 srcRoot =
1010 if haskellLib.canCleanSource src
1111 then haskellLib.cleanSourceWith {
12− name = src.name + "-root";
12+ name = if src ? name then "${src.name}-root" else "source-root";
1313 src = src.origSrc or src;
14− inherit (src) filter;
14+ filter = src.filter or (_: _: true);
1515 }
1616 else src.origSrc or src;
1717 # The sub directory containing the cabal.project or stack.yaml file