Skip to content

Commit 7600b7f

Browse files
committed
Fixes for GHC HEAD
1 parent 2f22c31 commit 7600b7f

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

lib/load-cabal-plan.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ in {
9292
} // pkgs.lib.optionalAttrs (p.pkg-src.type or "" == "source-repo") {
9393
# Replace the source repository packages with versions created when
9494
# parsing the `cabal.project` file.
95-
src = pkgs.lib.lists.elemAt callProjectResults.sourceRepos (pkgs.lib.strings.toInt p.pkg-src.source-repo.location) + "/${p.pkg-src.source-repo.subdir}";
95+
src = pkgs.lib.lists.elemAt callProjectResults.sourceRepos (pkgs.lib.strings.toInt p.pkg-src.source-repo.location)
96+
+ pkgs.lib.optionalString (p.pkg-src.source-repo.subdir != ".") "/${p.pkg-src.source-repo.subdir}";
9697
} // pkgs.lib.optionalAttrs (cabal2nix ? package-description-override && p.pkg-version == cabal2nix.package.identifier.version) {
9798
# Use the `.cabal` file from the `Cabal2Nix` if it for the matching
9899
# version of the package (the one in the plan).

test/cabal.project.local

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ allow-newer: hsc2hs:*
1414
if impl(ghc >=9.10.1)
1515
extra-packages: process
1616

17+
if impl(ghc >=9.11)
18+
source-repository-package
19+
type: git
20+
location: https://github.com/hamishmack/extra.git
21+
tag: 3cced868b7f270acb90b7064d34e2d4c5952ca48
22+
--sha256: sha256-e2JHNRvkpws18dWmc+RUPWEESX+LV9W0u25dCG2e8ws=
23+
1724
repository head.hackage.ghc.haskell.org
1825
url: https://ghc.gitlab.haskell.org/head.hackage/
1926
secure: True
@@ -22,7 +29,7 @@ repository head.hackage.ghc.haskell.org
2229
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
2330
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
2431
7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
25-
--sha256: sha256-yyYXGnFwUr6MaUEXz6odRv+IJMCmAZioN5dz3LbY1n4=
32+
--sha256: sha256-Z4NrYC11bsuJp4IPy6cRoFQ03wLAPEaejM9Y52n4EHk=
2633

2734
repository ghcjs-overlay
2835
url: https://raw.githubusercontent.com/input-output-hk/hackage-overlay-ghcjs/d37efd733666d090bf1c83bf7d5f9cb71b1dacc1

test/call-cabal-project-to-nix/default.nix

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ stdenv, lib, buildPackages, mkCabalProjectPkgSet, callCabalProjectToNix, importAndFilterProject, recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name, evalPackages }:
1+
{ stdenv, lib, buildPackages, mkCabalProjectPkgSet, callCabalProjectToNix, loadCabalPlan, recurseIntoAttrs, haskellLib, testSrc, compiler-nix-name, evalPackages }:
22

33
with lib;
44

@@ -15,11 +15,16 @@ let
1515
'';
1616
};
1717
pkgSet = mkCabalProjectPkgSet {
18-
plan-pkgs = importAndFilterProject {
19-
inherit (callProjectResults) projectNix sourceRepos src;
18+
plan-pkgs = loadCabalPlan {
19+
inherit callProjectResults;
20+
selectedCompiler = buildPackages.haskell-nix.compiler.${compiler-nix-name};
2021
};
22+
inherit compiler-nix-name;
2123
inherit (callProjectResults) extra-hackages;
22-
modules = [{ inherit evalPackages; }];
24+
modules = [{
25+
inherit evalPackages;
26+
compiler.nix-name = compiler-nix-name;
27+
}];
2328
};
2429
packages = pkgSet.config.hsPkgs;
2530

0 commit comments

Comments
 (0)