From 09c8e8a3f11dafd9c4cf7d1e3d77ab1d2421db99 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Wed, 1 Jun 2022 19:42:29 +0200 Subject: [PATCH] haskellPackages.purescript*: disable on hydra if broken To make this logic less cluttered, implement the broken/dontDistribute logic in a single function that can be reused for all purescript-related packages. --- .../haskell-modules/configuration-common.nix | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index f707979b323b..d852f058f233 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -2610,6 +2610,12 @@ self: super: { # https://github.com/erikd/language-javascript/issues/131 language-javascript = self.language-javascript_0_7_0_0; }; + + # Doesn't support GHC >= 9.0 (something related to instance resolution and TH) + purescriptBrokenFlag = drv: + if lib.versionAtLeast self.ghc.version "9.0" + then dontDistribute (markBroken drv) + else drv; in { purescript = lib.pipe @@ -2625,19 +2631,13 @@ in { doJailbreak # Generate shell completions (generateOptparseApplicativeCompletion "purs") - # Doesn't support GHC >= 9.0 (something related to instance resolution and TH) - (if lib.versionAtLeast self.ghc.version "9.0" then markBroken else lib.id) + + purescriptBrokenFlag ]; - purescript-cst = overrideCabal (_: { - # Doesn't support GHC >= 9.0, see purescript - broken = lib.versionAtLeast self.ghc.version "9.0"; - }) (super.purescript-cst.overrideScope purescriptOverlay); + purescript-cst = purescriptBrokenFlag (super.purescript-cst.overrideScope purescriptOverlay); - purescript-ast = overrideCabal (_: { - # Doesn't support GHC >= 9.0, see purescript - broken = lib.versionAtLeast self.ghc.version "9.0"; - }) (super.purescript-ast.overrideScope purescriptOverlay); + purescript-ast = purescriptBrokenFlag (super.purescript-ast.overrideScope purescriptOverlay); purenix = super.purenix.overrideScope purescriptOverlay; })