Skip to content

Commit

Permalink
ghc865-binary: Build with ncurses6. Fixes musl build error.
Browse files Browse the repository at this point in the history
As proposed on NixOS#85924 (comment)
  • Loading branch information
nh2 committed Jul 27, 2020
1 parent c83e133 commit d7f663f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pkgs/development/compilers/ghc/8.6.5-binary.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ stdenv
, fetchurl, perl, gcc
, ncurses5, gmp, glibc, libiconv
, ncurses6, gmp, glibc, libiconv
, llvmPackages
}:

Expand All @@ -11,7 +11,7 @@ let
useLLVM = !stdenv.targetPlatform.isx86;

libPath = stdenv.lib.makeLibraryPath ([
ncurses5 gmp
ncurses6 gmp
] ++ stdenv.lib.optional (stdenv.hostPlatform.isDarwin) libiconv);

libEnvVar = stdenv.lib.optionalString stdenv.hostPlatform.isDarwin "DY"
Expand All @@ -38,8 +38,12 @@ stdenv.mkDerivation rec {
sha256 = "1p2h29qghql19ajk755xa0yxkn85slbds8m9n5196ris743vkp8w";
};
x86_64-linux = {
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-deb9-linux.tar.xz";
sha256 = "1pqlx6rdjs2110g0y1i9f8x18lmdizibjqd15f5xahcz39hgaxdw";
# We use the `fedora27`-targeted bindist instead of the `deb9` one because
# it expects the `ncurses` ABI 6 instead of 5, as 5 made a problem, see:
# https://github.com/NixOS/nixpkgs/issues/85924#issuecomment-640277067
# TODO: Update the other `-linux` bindists accordingly and test them.
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-fedora27-linux.tar.xz";
sha256 = "18dlqm5d028fqh6ghzn7pgjspr5smw030jjzl3kq6q1kmwzbay6g";
};
aarch64-linux = {
url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-aarch64-ubuntu18.04-linux.tar.xz";
Expand Down Expand Up @@ -90,7 +94,6 @@ stdenv.mkDerivation rec {
stdenv.lib.optionalString stdenv.isLinux ''
find . -type f -perm -0100 -exec patchelf \
--replace-needed libncurses${stdenv.lib.optionalString stdenv.is64bit "w"}.so.5 libncurses.so \
--replace-needed libtinfo.so libtinfo.so.5 \
--interpreter ${glibcDynLinker} {} \;
sed -i "s|/usr/bin/perl|perl\x00 |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2
Expand Down

0 comments on commit d7f663f

Please sign in to comment.