Skip to content

Commit 65472c0

Browse files
Try #1641:
2 parents cc0642c + a39ad04 commit 65472c0

File tree

175 files changed

+17076
-8284
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

175 files changed

+17076
-8284
lines changed

builder/comp-builder.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ let
239239
(lib.concatMap (c: if c.isHaskell or false
240240
then builtins.attrValues (c.components.exes or {})
241241
else [c]) build-tools) ++
242-
lib.optional (pkgconfig != []) buildPackages.pkgconfig;
242+
lib.optional (pkgconfig != []) buildPackages.cabalPkgConfigWrapper;
243243

244244
# Unfortunately, we need to wrap ghc commands for cabal builds to
245245
# work in the nix-shell. See ../doc/removing-with-package-wrapper.md.

builder/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ let
1717
# in the native case, it would be the same in the cross case however
1818
# we *really* want to build the Setup.hs on the build machine and not
1919
# have the stdenv confuse it with the target/host env.
20-
inherit (buildPackages) stdenv pkgconfig;
20+
inherit (buildPackages) stdenv;
2121
inherit buildPackages;
2222
inherit haskellLib nonReinstallablePkgs makeSetupConfigFiles;
2323
};

builder/hspkg-builder.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ let
5353
||
5454
# These are the dependencies of `Cabal`
5555
!builtins.elem package.identifier.name
56-
["nix-tools" "alex" "happy" "hscolour" "Cabal" "bytestring" "aeson" "time"
56+
["nix-tools" "alex" "happy" "hscolour" "Cabal" "Cabal-syntax" "bytestring" "aeson" "time"
5757
"filepath" "base-compat-batteries" "base-compat" "unix" "directory" "transformers"
5858
"containers" "binary" "mtl" "text" "process" "parsec"];
5959

builder/setup-builder.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ pkgs, stdenv, lib, buildPackages, haskellLib, ghc, nonReinstallablePkgs, hsPkgs, makeSetupConfigFiles, pkgconfig }@defaults:
1+
{ pkgs, stdenv, lib, buildPackages, haskellLib, ghc, nonReinstallablePkgs, hsPkgs, makeSetupConfigFiles }@defaults:
22

33
let self =
44
{ component, package, name, src, enableDWARF ? false, flags ? {}, revision ? null, patches ? [], defaultSetupSrc
@@ -38,7 +38,7 @@ let
3838
(lib.concatMap (c: if c.isHaskell or false
3939
then builtins.attrValues (c.components.exes or {})
4040
else [c]) component.build-tools) ++
41-
lib.optional (component.pkgconfig != []) pkgconfig;
41+
lib.optional (component.pkgconfig != []) buildPackages.cabalPkgConfigWrapper;
4242

4343
drv =
4444
stdenv.mkDerivation ({

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ in
6666
# any plutus-apps input being used for a
6767
# package.
6868
, evalPackages
69+
, pkgconfigSelector ? (_: [])
6970
, ...
7071
}@args:
7172

@@ -167,6 +168,8 @@ let
167168

168169
index-state-pinned = index-state != null || cabalProjectIndexState != null;
169170

171+
pkgconfPkgs = import ./pkgconf-nixpkgs-map.nix pkgs;
172+
170173
in
171174
assert (if index-state-found == null
172175
then throw "No index state passed and none found in ${cabalProjectFileName}" else true);
@@ -329,14 +332,14 @@ let
329332
# when `checkMaterialization` is set.
330333
dummy-ghc-data =
331334
let
332-
materialized = ../materialized/dummy-ghc + "/${ghc.targetPrefix}${ghc.name}-${pkgs.stdenv.buildPlatform.system}";
335+
materialized = ../materialized/dummy-ghc + "/${ghc.targetPrefix}${ghc.name}-${pkgs.stdenv.buildPlatform.system}"
336+
+ pkgs.lib.optionalString (builtins.compareVersions ghc.version "8.10" < 0 && ghc.targetPrefix == "" && builtins.compareVersions pkgs.lib.version "22.05" < 0) "-old";
333337
in pkgs.haskell-nix.materialize ({
334338
sha256 = null;
335339
sha256Arg = "sha256";
336340
materialized = if __pathExists materialized
337341
then materialized
338-
else __trace ("WARNING: No materialized dummy-ghc-data for "
339-
+ "${ghc.targetPrefix}${ghc.name}-${pkgs.stdenv.buildPlatform.system}.")
342+
else __trace "WARNING: No materialized dummy-ghc-data. mkdir ${toString materialized}"
340343
null;
341344
reasonNotSafe = null;
342345
} // pkgs.lib.optionalAttrs (checkMaterialization != null) {
@@ -463,7 +466,10 @@ let
463466
} // pkgs.lib.optionalAttrs (checkMaterialization != null) {
464467
inherit checkMaterialization;
465468
}) (evalPackages.runCommand (nameAndSuffix "plan-to-nix-pkgs") {
466-
nativeBuildInputs = [ nix-tools dummy-ghc dummy-ghc-pkg cabal-install evalPackages.rsync evalPackages.gitMinimal ];
469+
nativeBuildInputs = [ nix-tools dummy-ghc dummy-ghc-pkg cabal-install evalPackages.rsync evalPackages.gitMinimal evalPackages.pkgconfig ];
470+
# We only need the `.dev` derivation (if there is one), since it will have
471+
# the pkgconfig files needed by cabal.
472+
buildInputs = map pkgs.lib.getDev (builtins.concatLists (pkgconfigSelector pkgconfPkgs));
467473
# Needed or stack-to-nix will die on unicode inputs
468474
LOCALE_ARCHIVE = pkgs.lib.optionalString (evalPackages.stdenv.buildPlatform.libc == "glibc") "${evalPackages.glibcLocales}/lib/locale/locale-archive";
469475
LANG = "en_US.UTF-8";

lib/ghcjs-project.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
if (builtins.compareVersions ghcjsVersion "8.10.0.0" >= 0)
4040
then pkgs.haskell-nix.tool compiler-nix-name "cabal" {
4141
index-state = pkgs.haskell-nix.internalHackageIndexState;
42-
version = "3.6.2.0";
42+
version = "3.8.1.0";
4343
materialized = ../materialized/ghcjs/cabal + "/${compiler-nix-name}";
4444
}
4545
else pkgs.haskell-nix.tool compiler-nix-name "cabal" {
@@ -48,7 +48,7 @@
4848
# Cabal 3.2.1.0 no longer supports he mix of `cabal-version`,
4949
# lack of `custom-setup` and `v1-install` used by ghcjs boot.
5050
cabalProjectLocal = ''
51-
constraints: Cabal <3.2.1.0
51+
constraints: Cabal <3.2.1.0, Cabal-syntax <0
5252
'';
5353
materialized = ../materialized/ghcjs/cabal + "/${compiler-nix-name}";
5454
}

materialized/dummy-ghc/aarch64-unknown-linux-gnu-aarch64-unknown-linux-gnu-ghc-8.10.5-x86_64-linux/ghc-pkg/dump-global

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

materialized/dummy-ghc/aarch64-unknown-linux-gnu-aarch64-unknown-linux-gnu-ghc-8.10.5-x86_64-linux/ghc/info

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

materialized/dummy-ghc/aarch64-unknown-linux-gnu-aarch64-unknown-linux-gnu-ghc-8.10.6-x86_64-linux/ghc-pkg/dump-global

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

materialized/dummy-ghc/aarch64-unknown-linux-gnu-aarch64-unknown-linux-gnu-ghc-8.10.6-x86_64-linux/ghc/info

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

materialized/dummy-ghc/aarch64-unknown-linux-gnu-aarch64-unknown-linux-gnu-ghc-8.10.7-x86_64-linux/ghc-pkg/dump-global

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

materialized/dummy-ghc/aarch64-unknown-linux-gnu-aarch64-unknown-linux-gnu-ghc-8.10.7-x86_64-linux/ghc/info

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

materialized/dummy-ghc/aarch64-unknown-linux-gnu-aarch64-unknown-linux-gnu-ghc-8.8.4-x86_64-linux/ghc-pkg/dump-global

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

materialized/dummy-ghc/aarch64-unknown-linux-gnu-aarch64-unknown-linux-gnu-ghc-8.8.4-x86_64-linux/ghc/info

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)