@@ -314,14 +314,17 @@ in {
314314 rootAndSubDir = src: rec {
315315 subDir = src.origSubDir or "";
316316 root =
317− # Use `cleanSourceWith` to make sure the `filter` is still used
318− if src ? origSrc && src ? filter && subDir != ""
319− then haskellLib.cleanSourceWith {
320− name = src.name or "source" + "-root";
321− src = src.origSrc;
322− # Not passing src.origSubDir so that the result points `origSrc`
323− inherit (src) filter;
324− }
325− else src.origSrc or src;
317+ if subDir == ""
318+ then src # if there was no subdir use the original src
319+ else
320+ # Use `cleanSourceWith` to make sure the `filter` is still used
321+ if src ? origSrc && src ? filter
322+ then haskellLib.cleanSourceWith {
323+ name = src.name or "source" + "-root";
324+ src = src.origSrc;
325+ # Not passing src.origSubDir so that the result points `origSrc`
326+ inherit (src) filter;
327+ }
328+ else src.origSrc or src; # If there is a subDir and origSrc (but no filter) use origSrc
326329 };
327330}