Skip to content

Commit bf06758

Browse files
committed
More fixes
1 parent f7f06b3 commit bf06758

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

lib/call-cabal-project-to-nix.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ let
677677
# proper relative paths.
678678
(cd $out${subDir'} && plan-to-nix --full ${if ignorePackageYaml then "--ignore-package-yaml" else ""} --plan-json $tmp${subDir'}/dist-newstyle/cache/plan.json -o .)
679679
680-
substituteInPlace $tmp${subDir'}/dist-newstyle/cache/plan.json --replace "$out" ""
680+
substituteInPlace $tmp${subDir'}/dist-newstyle/cache/plan.json --replace "$out" "."
681681
substituteInPlace $tmp${subDir'}/dist-newstyle/cache/plan.json --replace "$CABAL_DIR" ""
682682
683683
# Replace the /nix/store paths to minimal git repos with indexes (that will work with materialization).

overlays/haskell.nix

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -713,8 +713,9 @@ final: prev: {
713713
} // {
714714
flags = p.flags;
715715
components = getComponents cabal2nix.components hsPkgs p;
716-
package = cabal2nix.package // {
716+
package = cabal2nix.package // final.lib.optionalAttrs (p.type != "pre-existing") {
717717
identifier = { name = p.pkg-name; version = p.pkg-version; };
718+
} // {
718719
isProject = false;
719720
setup-depends = map (lookupDependency hsPkgs.pkgsBuildBuild) (p.components.setup.depends or []);
720721
# TODO = map (lookupExeDependency hsPkgs.pkgsBuildBuild) (p.components.setup.exe-depends or []);
@@ -736,9 +737,10 @@ final: prev: {
736737
in builtins.removeAttrs cabal2nix ["src"] // final.lib.optionalAttrs (p ? pkg-src-sha256) {
737738
sha256 = p.pkg-src-sha256;
738739
} // final.lib.optionalAttrs (p.pkg-src.type or "" == "local") {
739-
src = if final.lib.hasPrefix "/" p.pkg-src.path && !final.lib.hasPrefix "${callProjectResults.src.origSubDir or ""}/." p.pkg-src.path
740+
src = if final.lib.hasPrefix "/" p.pkg-src.path
740741
then p.pkg-src.path
741-
else callProjectResults.src + final.lib.removePrefix "${callProjectResults.src.origSubDir or ""}/." p.pkg-src.path;
742+
else callProjectResults.src + final.lib.removePrefix ".${callProjectResults.src.origSubDir or ""}"
743+
(final.lib.removePrefix ".${callProjectResults.src.origSubDir or ""}/." p.pkg-src.path);
742744
} // {
743745
flags = p.flags;
744746
components = getComponents cabal2nix.components hsPkgs p;

0 commit comments

Comments
 (0)