From fc4cfafbb4c8553d3f19887016f97e057ec13412 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Thu, 24 Nov 2022 03:34:56 +0100 Subject: [PATCH] haskellPackages.type-errors: apply upstream patch for 9.2 --- .../haskell-modules/configuration-common.nix | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index 0212fd97e30b..849f88a1e019 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -60,6 +60,46 @@ self: super: { ghc-datasize = disableLibraryProfiling super.ghc-datasize; ghc-vis = disableLibraryProfiling super.ghc-vis; + # Patch for GHC 9.2 and jailbreak for doctest + # https://github.com/isovector/type-errors/pull/5#issuecomment-1325866252 + # https://github.com/isovector/type-errors/issues/6 + type-errors = assert super.type-errors.version == "0.2.0.0"; overrideCabal (drv: { + jailbreak = true; + + # Allow picking patches from the repository that don't apply on the revisions + revision = null; + editedCabalFile = null; + + patches = drv.patches or [] ++ [ + # Recreate a bunch of changes that would otherwise be done by revisions + (fetchpatch { + name = "haskell-type-errors-bounds-update-1.patch"; + url = "https://github.com/isovector/type-errors/commit/5717d158cf6652364ae1729c06b9a0d4bbb55abb.patch"; + sha256 = "040mcyz1bibq682wpanynwfffh923m6g13728v204ygsbvgaqswy"; + excludes = [ "**.yaml*" ]; + }) + (fetchpatch { + name = "haskell-type-errors-bounds-update-2.patch"; + url = "https://github.com/isovector/type-errors/commit/f15ed756d85aaa42df73de49eba4b47b877f4d0d.patch"; + sha256 = "0mpwpk65agzfnisnwhf818gjxahyhbglhmfkb5cdz5qnqn8x7qqx"; + excludes = [ "**.yaml" ]; + }) + (fetchpatch { + name = "haskell-type-errors-bounds-update-3.patch"; + url = "https://github.com/isovector/type-errors/commit/c73bd09eb7d1a7a6b5c61bd640c983496d0a9f83.patch"; + sha256 = "0g76ihkgip3f0lkg7pdcd12sb8v48fhrwxg4vxhiq2zaphzk7p65"; + excludes = [ "**.yaml" ]; + }) + # Finally, apply unreleased change adding support for 9.2 + (fetchpatch { + name = "haskell-type-errors-ghc-9.2.patch"; + url = "https://github.com/isovector/type-errors/commit/ceb6088a1a59d65f72915e8afd534993bb827d96.patch"; + sha256 = "0vzwfrh5pl3yz6ng499h7w3ff2xb8qsipl8p3xa2mz38w1brb9gz"; + }) + ]; + # jailbreak = true; + }) super.type-errors; + # Patch providing GHC9 compat, can be removed once the following gets released: # > https://github.com/adinapoli/snaplet-purescript/pull/25 snaplet-purescript = appendPatch (fetchpatch {