haskell.compiler.ghc865Binary: add powerpc64le bootstrap

This commit is contained in:
Adam Joseph 2022-07-01 11:05:30 +00:00 committed by GitHub
parent f6b27dacd6
commit 86c7c0917f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 3 deletions

View File

@ -12,7 +12,8 @@ assert stdenv.targetPlatform == stdenv.hostPlatform;
let
useLLVM = !stdenv.targetPlatform.isx86;
useNcurses6 = stdenv.hostPlatform.system == "x86_64-linux";
useNcurses6 = stdenv.hostPlatform.system == "x86_64-linux"
|| (with stdenv.hostPlatform; isPower64 && isLittleEndian);
ourNcurses = if useNcurses6 then ncurses6 else ncurses5;
@ -73,6 +74,10 @@ stdenv.mkDerivation rec {
url = "${downloadsUrl}/${version}/ghc-${version}-x86_64-apple-darwin.tar.xz";
sha256 = "0s9188vhhgf23q3rjarwhbr524z6h2qga5xaaa2pma03sfqvvhfz";
};
powerpc64le-linux = {
url = "https://downloads.haskell.org/~ghc/${version}/ghc-${version}-powerpc64le-fedora29-linux.tar.xz";
sha256 = "sha256-tWSsJdPVrCiqDyIKzpBt5DaXb3b6j951tCya584kWs4=";
};
}.${stdenv.hostPlatform.system}
or (throw "cannot bootstrap GHC on this platform"));
@ -211,7 +216,7 @@ stdenv.mkDerivation rec {
meta = rec {
license = lib.licenses.bsd3;
platforms = ["x86_64-linux" "i686-linux" "x86_64-darwin"];
platforms = ["x86_64-linux" "i686-linux" "x86_64-darwin" "powerpc64le-linux" ];
# build segfaults, use ghc8102Binary which has proper musl support instead
broken = stdenv.hostPlatform.isMusl;
maintainers = with lib.maintainers; [

View File

@ -108,6 +108,9 @@ in {
# Musl bindists do not exist for ghc 8.6.5, so we use 8.10.* for them
if stdenv.isAarch64 || stdenv.isAarch32 then
packages.ghc8107BinaryMinimal
else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
# to my (@a-m-joseph) knowledge there are no newer official binaries for this platform
packages.ghc865Binary
else
packages.ghc8107Binary;
inherit (buildPackages.python3Packages) sphinx;
@ -124,6 +127,8 @@ in {
# the oldest ghc with aarch64-darwin support is 8.10.5
if stdenv.isAarch64 || stdenv.isAarch32 then
packages.ghc8107BinaryMinimal
else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
packages.ghc8107
else
packages.ghc8107Binary;
inherit (buildPackages.python3Packages) sphinx;
@ -136,6 +141,8 @@ in {
# aarch64 ghc8107Binary exceeds max output size on hydra
if stdenv.isAarch64 || stdenv.isAarch32 then
packages.ghc8107BinaryMinimal
else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
packages.ghc8107
else
packages.ghc8107Binary;
inherit (buildPackages.python3Packages) sphinx;
@ -147,7 +154,11 @@ in {
llvmPackages = pkgs.llvmPackages_12;
};
ghcHEAD = callPackage ../development/compilers/ghc/head.nix {
bootPkgs = packages.ghc8107Binary;
bootPkgs =
if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then
packages.ghc8107
else
packages.ghc8107Binary;
inherit (buildPackages.python3Packages) sphinx;
# Need to use apple's patched xattr until
# https://github.com/xattr/xattr/issues/44 and