Skip to content

Commit d39a985

Browse files
authored
Fix terminfo dep in dummy ghc for haskeline (#2360)
* Fix terminfo dep in dummy ghc for haskeline The dependency is missed because a `terminfo` cabal flag is used. * Also fix Win32:filepath
1 parent 091ca38 commit d39a985

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

compiler/ghc/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ haskell-nix.haskellLib.makeCompilerDeps (stdenv.mkDerivation (rec {
668668
'';
669669

670670
passthru = {
671-
inherit bootPkgs targetPrefix libDir llvmPackages enableShared useLLVM hadrian hadrianProject;
671+
inherit bootPkgs targetPrefix libDir llvmPackages enableShared enableTerminfo useLLVM hadrian hadrianProject;
672672

673673
# Our Cabal compiler name
674674
haskellCompilerName = "ghc-${version}";

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,17 @@ let
540540
''}
541541
${pkgs.lib.optionalString (!pkgs.stdenv.targetPlatform.isWindows) ''
542542
deps+=" $(jq -r '.components.lib."build-depends"[]|select(._if.not.os == "windows")|._then[]|.package' $json_cabal_file)"
543-
''}
543+
''
544+
# Fix problem with `haskeline` using a `terminfo` flag
545+
# For haskell-nix ghc we can use ghc.enableTerminfo to get the flag setting
546+
+ pkgs.lib.optionalString (name == "haskeline" && !pkgs.stdenv.targetPlatform.isWindows && ghc.enableTerminfo or true) ''
547+
deps+=" terminfo"
548+
''
549+
# Similar issue for Win32:filepath build-depends (hidden behind `if impl(ghc >= 8.0)`)
550+
+ pkgs.lib.optionalString (name == "Win32" && pkgs.stdenv.targetPlatform.isWindows) ''
551+
deps+=" filepath"
552+
''
553+
}
544554
DEPS_${varname name}="$(tr '\n' ' ' <<< "$deps")"
545555
VER_${varname name}="$(jq -r '.version' $json_cabal_file)"
546556
PKGS+=" ${name}"

0 commit comments

Comments
 (0)