From e233468d9fa78b1f34e4da3447c5bb7d5d67e2ab Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Wed, 6 Jul 2022 21:41:24 +0200 Subject: [PATCH] haskellPackages.purescript: adjust for 0.15.4 0.15.4 supports GHC 9.0 and aeson 2.0, as well as the latest bower-json version, but the purescript-{a,c}st packages don't sadly. --- .../haskell-modules/configuration-common.nix | 28 +++++++++++-------- pkgs/top-level/release-haskell.nix | 3 -- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index 27f354122b61..7d6e8c3d4231 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -2556,9 +2556,6 @@ self: super: { # dependencies to avoid version mismatches in their dependency closure. # TODO(@cdepillabout): maybe unify with the spago overlay in configuration-nix.nix? purescriptOverlay = self: super: { - # Purescript targets Stackage LTS 18, so we need to downgrade a few things - aeson = self.aeson_1_5_6_0; - bower-json = self.bower-json_1_0_0_1; # As of 2021-11-08, the latest release of `language-javascript` is 0.7.1.0, # but it has a problem with parsing the `async` keyword. It doesn't allow # `async` to be used as an object key: @@ -2566,11 +2563,20 @@ self: super: { language-javascript = self.language-javascript_0_7_0_0; }; - # Doesn't support GHC >= 9.0 (something related to instance resolution and TH) - purescriptBrokenFlag = drv: + # Don't support GHC >= 9.0 yet and need aeson 1.5.* + purescriptStOverride = drv: + let + overlayed = drv.overrideScope ( + lib.composeExtensions + purescriptOverlay + (self: super: { + aeson = self.aeson_1_5_6_0; + }) + ); + in if lib.versionAtLeast self.ghc.version "9.0" - then dontDistribute (markBroken drv) - else drv; + then dontDistribute (markBroken overlayed) + else overlayed; in { purescript = lib.pipe @@ -2586,13 +2592,11 @@ in { doJailbreak # Generate shell completions (generateOptparseApplicativeCompletion "purs") - - purescriptBrokenFlag ]; - purescript-cst = purescriptBrokenFlag (super.purescript-cst.overrideScope purescriptOverlay); + purescript-cst = purescriptStOverride super.purescript-cst; - purescript-ast = purescriptBrokenFlag (super.purescript-ast.overrideScope purescriptOverlay); + purescript-ast = purescriptStOverride super.purescript-ast; - purenix = super.purenix.overrideScope purescriptOverlay; + purenix = purescriptStOverride super.purenix; }) diff --git a/pkgs/top-level/release-haskell.nix b/pkgs/top-level/release-haskell.nix index 0777b448d5b4..0d4100c25c13 100644 --- a/pkgs/top-level/release-haskell.nix +++ b/pkgs/top-level/release-haskell.nix @@ -381,9 +381,6 @@ let compilerNames.ghc902 compilerNames.ghc923 ]; - purescript = [ - compilerNames.ghc8107 - ]; purescript-cst = [ compilerNames.ghc8107 ];