on iko/ghcjs-patch-master help sign in
Fix `cabalProject { src = ./.; }` (#751)
a2bc3dbMoritz Angermann
lib/call-cabal-project-to-nix.nix+3−3
@@ -80,9 +80,9 @@ let
80 maybeCleanedSource =
80 maybeCleanedSource =
81 if haskellLib.canCleanSource src
81 if haskellLib.canCleanSource src
82 then (haskellLib.cleanSourceWith {
82 then (haskellLib.cleanSourceWith {
83− name = src.name + "-root-cabal-files";
83+ name = if name != null then "${name}-root-cabal-files" else "source-root-cabal-files";
84− src = src.origSrc;
84+ src = src.origSrc or src;
85− filter = path: type: src.filter path type && (
85+ filter = path: type: (!(src ? filter) || src.filter path type) && (
86 type == "directory" ||
86 type == "directory" ||
87 pkgs.lib.any (i: (pkgs.lib.hasSuffix i path)) [ ".cabal" "package.yaml" ]); })
87 pkgs.lib.any (i: (pkgs.lib.hasSuffix i path)) [ ".cabal" "package.yaml" ]); })
88 else src.origSrc or src;
88 else src.origSrc or src;
lib/import-and-filter-project.nix+2−2
@@ -9,9 +9,9 @@ let
9 srcRoot =
9 srcRoot =
10 if haskellLib.canCleanSource src
10 if haskellLib.canCleanSource src
11 then haskellLib.cleanSourceWith {
11 then haskellLib.cleanSourceWith {
12− name = src.name + "-root";
12+ name = if src ? name then "${src.name}-root" else "source-root";
13 src = src.origSrc or src;
13 src = src.origSrc or src;
14− inherit (src) filter;
14+ filter = src.filter or (_: _: true);
15 }
15 }
16 else src.origSrc or src;
16 else src.origSrc or src;
17 # The sub directory containing the cabal.project or stack.yaml file
17 # The sub directory containing the cabal.project or stack.yaml file