From 70e6eb9ec8d548b836f8dedbf63d86a6bd737dc3 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 16 Mar 2022 16:52:01 +0100 Subject: [PATCH] haskellPackages.stack: Patch for new Cabal --- .../haskell-modules/configuration-common.nix | 23 +++++++++++-------- pkgs/top-level/all-packages.nix | 5 +--- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index 37fcfd775807..02f181ecae79 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -1021,17 +1021,22 @@ self: super: { })); ormolu = generateOptparseApplicativeCompletion "ormolu" super.ormolu; - # Currently only builds with GHC-8.10.7 and old aeson: - # https://github.com/commercialhaskell/stack/issues/5670 - # https://github.com/commercialhaskell/stack/issues/5558 stack = generateOptparseApplicativeCompletion "stack" - (super.stack.overrideScope (self: super: { - # pantry-0.5.2.1 requires aeson < 2. - aeson = self.aeson_1_5_6_0; - # stack-2.7.3 requires old version of pantry. - pantry = self.pantry_0_5_2_1; - })); + (doJailbreak # for Cabal constraint added on hackage + (appendPatch + (pkgs.fetchpatch { + # https://github.com/commercialhaskell/stack/pull/5559 + # When removing, also remove doJailbreak. + name = "stack-pull-5559.patch"; + url = "https://github.com/hercules-ci/stack/compare/v2.7.5...brandon-leapyear/chinn/cabal-0.patch"; + sha256 = "sha256-OXmdGgQ2KSKtQKOK6eePLgvUOTlzac544HQYKJpcjnU="; + }) + (super.stack.overrideScope (self: super: { + # stack 2.7.5 requires aeson <= 1.6. + aeson = self.aeson_1_5_6_0; + })) + )); # Too strict version bound on hashable-time. # Tests require newer package version. diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 828caab9b6af..605c06713c92 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12536,10 +12536,7 @@ with pkgs; cabal-install = haskell.lib.compose.justStaticExecutables haskellPackages.cabal-install; - # stack doesn't build with ghc902 (Cabal-3.4) yet: - # https://github.com/commercialhaskell/stack/issues/5670 - # https://github.com/commercialhaskell/stack/issues/5558 - stack = haskell.lib.compose.justStaticExecutables haskell.packages.ghc8107.stack; + stack = haskell.lib.compose.justStaticExecutables haskellPackages.stack; hlint = haskell.lib.compose.justStaticExecutables haskellPackages.hlint;