From 44c848bc0230252290495b10ac7f03a77f8a949c Mon Sep 17 00:00:00 2001 From: Malte Brandy Date: Tue, 9 Aug 2022 01:00:20 +0200 Subject: [PATCH] haskell.compilers.ghc941: 9.4.0.20220721 -> 9.4.1 Co-authored-by: sternenseemann --- pkgs/development/compilers/ghc/9.4.1.nix | 31 ++++++------------- ...1-fix-bootstrapping-with-profiling-2.patch | 18 +++++++++++ 2 files changed, 27 insertions(+), 22 deletions(-) create mode 100644 pkgs/development/compilers/ghc/ghc-9.4.1-fix-bootstrapping-with-profiling-2.patch diff --git a/pkgs/development/compilers/ghc/9.4.1.nix b/pkgs/development/compilers/ghc/9.4.1.nix index e24f9fbb3767..ff7695427dde 100644 --- a/pkgs/development/compilers/ghc/9.4.1.nix +++ b/pkgs/development/compilers/ghc/9.4.1.nix @@ -177,32 +177,27 @@ assert buildTargetLlvmPackages.llvm == llvmPackages.llvm; assert stdenv.targetPlatform.isDarwin -> buildTargetLlvmPackages.clang == llvmPackages.clang; stdenv.mkDerivation (rec { - version = "9.4.0.20220721"; + version = "9.4.1"; pname = "${targetPrefix}ghc${variantSuffix}"; src = fetchurl { - url = "https://downloads.haskell.org/ghc/9.4.1-rc1/ghc-${version}-src.tar.xz"; - sha256 = "bca8c52f76d8747a66291181de2de7bdf9ff80093808fe39bf5cbff0f116c426"; + url = "https://downloads.haskell.org/ghc/${version}/ghc-${version}-src.tar.xz"; + sha256 = "sha256-y/7UZAvfAl4zulVDPa+M32mPTgSZrnqADd5EqC5zluM="; }; enableParallelBuilding = true; outputs = [ "out" "doc" ]; + patches = [ - # fix hyperlinked haddock sources: https://github.com/haskell/haddock/pull/1482 + # add missing profiling targets in make build system (fetchpatch { - url = "https://patch-diff.githubusercontent.com/raw/haskell/haddock/pull/1482.patch"; - sha256 = "sha256-8w8QUCsODaTvknCDGgTfFNZa8ZmvIKaKS+2ZJZ9foYk="; - extraPrefix = "utils/haddock/"; - stripLen = 1; - }) - # fix race condition in make build system - (fetchpatch { - name = "ghc-hs-boot-copying-fix.patch"; - url = "https://gitlab.haskell.org/ghc/ghc/-/commit/4f17eff0cbd125eca55b68f4927befdd45008eb6.diff"; - sha256 = "0anq3w9z9mhxb0wx6rvxac3n7rl3apcma9zk3r9zz9hj9v7vkqzx"; + name = "ghc-9.4.1-fix-bootstrapping-with-profiling-1.patch"; + url = "https://gitlab.haskell.org/ghc/ghc/-/commit/47b4fea08bd0ef1476b8d134c7baf06157fe5fa5.diff"; + sha256 = "sha256-oYQWg9cK0RNL9I+kap8KER+iiKim73zG6URQs8BeAXU="; }) + ./ghc-9.4.1-fix-bootstrapping-with-profiling-2.patch ]; postPatch = "patchShebangs ."; @@ -240,14 +235,6 @@ stdenv.mkDerivation (rec { '' + '' echo -n "${buildMK}" > mk/build.mk - # GHC 9.4.1-rc1 tarball is not properly prepared, also the boot script has been renamed - # https://gitlab.haskell.org/ghc/ghc/-/issues/21626#note_444654 - # TODO(@sternenseemann): make source-dist rules include all boot-generated files - ./boot.source - - # Too restrictive upper bound on Cabal the make build system chokes on - # XXX(@sternenseemann): this should be upstreamed - substituteInPlace utils/ghc-cabal/ghc-cabal.cabal --replace "3.8" "3.9" sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure '' + lib.optionalString (stdenv.isLinux && hostPlatform.libc == "glibc") '' diff --git a/pkgs/development/compilers/ghc/ghc-9.4.1-fix-bootstrapping-with-profiling-2.patch b/pkgs/development/compilers/ghc/ghc-9.4.1-fix-bootstrapping-with-profiling-2.patch new file mode 100644 index 000000000000..e10fb5cb280d --- /dev/null +++ b/pkgs/development/compilers/ghc/ghc-9.4.1-fix-bootstrapping-with-profiling-2.patch @@ -0,0 +1,18 @@ +diff --git a/ghc.mk b/ghc.mk +index dd65e7adfe..b91af56078 100644 +--- a/ghc.mk ++++ b/ghc.mk +@@ -509,11 +509,13 @@ libraries/containers/containers/dist-install/build/Data/IntMap/Internal.o: libra + libraries/containers/containers/dist-install/build/Data/Graph.o: libraries/template-haskell/dist-install/build/Language/Haskell/TH/Lib/Internal.hi + libraries/containers/containers/dist-install/build/Data/Set/Internal.o: libraries/template-haskell/dist-install/build/Language/Haskell/TH/Lib/Internal.hi + libraries/containers/containers/dist-install/build/Data/IntSet/Internal.o: libraries/template-haskell/dist-install/build/Language/Haskell/TH/Lib/Internal.hi ++libraries/containers/containers/dist-install/build/Data/Sequence/Internal.o: libraries/template-haskell/dist-install/build/Language/Haskell/TH/Lib/Internal.hi + + libraries/containers/containers/dist-install/build/Data/IntMap/Internal.p_o: libraries/template-haskell/dist-install/build/Language/Haskell/TH/Lib/Internal.p_hi + libraries/containers/containers/dist-install/build/Data/Graph.p_o: libraries/template-haskell/dist-install/build/Language/Haskell/TH/Lib/Internal.p_hi + libraries/containers/containers/dist-install/build/Data/Set/Internal.p_o: libraries/template-haskell/dist-install/build/Language/Haskell/TH/Lib/Internal.p_hi + libraries/containers/containers/dist-install/build/Data/IntSet/Internal.p_o: libraries/template-haskell/dist-install/build/Language/Haskell/TH/Lib/Internal.p_hi ++libraries/containers/containers/dist-install/build/Data/Sequence/Internal.p_o: libraries/template-haskell/dist-install/build/Language/Haskell/TH/Lib/Internal.p_hi + + ifeq "$(BIGNUM_BACKEND)" "gmp" + GMP_ENABLED = YES