From 5d04bbf0ae7a1dc01a290916603b997cdc91d320 Mon Sep 17 00:00:00 2001 From: Alexandre Esteves Date: Thu, 30 Jan 2025 19:13:10 +0000 Subject: [PATCH 1/2] haskellPackages.reflex-dom: override or jailbreak deps on GHC 9.12 --- .../configuration-ghc-9.12.x.nix | 28 ++++++++++++++++++- .../configuration-ghcjs-9.x.nix | 13 +++++++-- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/pkgs/development/haskell-modules/configuration-ghc-9.12.x.nix b/pkgs/development/haskell-modules/configuration-ghc-9.12.x.nix index 6506e980aa5a..702b210ead9f 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-9.12.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-9.12.x.nix @@ -1,12 +1,29 @@ { pkgs, haskellLib }: +self: super: + let inherit (pkgs) lib; + + versionAtMost = a: b: lib.versionAtLeast b a; + + warnVersion = + predicate: ver: pkg: + let + pname = pkg.pname; + in + lib.warnIf (predicate ver + super.${pname}.version + ) "override for haskell.packages.ghc912.${pname} may no longer be needed" pkg; + + warnAfterVersion = warnVersion lib.versionOlder; + warnFromVersion = warnVersion versionAtMost; + in with haskellLib; -self: super: { +{ llvmPackages = lib.dontRecurseIntoAttrs self.ghc.llvmPackages; # Disable GHC core libraries @@ -58,6 +75,12 @@ self: super: { xhtml = null; doctest = self.doctest_0_23_0; + + constraints-extras = warnFromVersion "0.4.0.2" (doDistribute self.constraints-extras_0_4_0_2); + dependent-sum-template = warnFromVersion "0.2.0.2" ( + doDistribute self.dependent-sum-template_0_2_0_2 + ); + haskell-src-meta = warnFromVersion "0.8.15" (doDistribute self.haskell-src-meta_0_8_15); htree = doDistribute self.htree_0_2_0_0; tagged = doDistribute self.tagged_0_8_9; time-compat = doDistribute (doJailbreak self.time-compat_1_9_8); # too strict lower bound on QuickCheck @@ -83,4 +106,7 @@ self: super: { export alex_datadir="$(pwd)/data" ''; }) super.alex; + + # https://github.com/sjakobi/newtype-generics/pull/28/files + newtype-generics = warnAfterVersion "0.6.2" (doJailbreak super.newtype-generics); } diff --git a/pkgs/development/haskell-modules/configuration-ghcjs-9.x.nix b/pkgs/development/haskell-modules/configuration-ghcjs-9.x.nix index f4f88d4a4e51..b9d5a072a95d 100644 --- a/pkgs/development/haskell-modules/configuration-ghcjs-9.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghcjs-9.x.nix @@ -1,5 +1,9 @@ { pkgs, haskellLib }: +let + inherit (pkgs) lib; +in + with haskellLib; # cabal2nix doesn't properly add dependencies conditional on arch(javascript) @@ -27,7 +31,10 @@ with haskellLib; patch = haskellLib.disableParallelBuilding super.patch; reflex-dom-core = haskellLib.disableParallelBuilding super.reflex-dom-core; - reflex-dom = super.reflex-dom.override (drv: { - jsaddle-webkit2gtk = null; - }); + reflex-dom = + lib.warn "reflex-dom builds with JS backend but it is missing fixes for working at runtime" + super.reflex-dom.override + (drv: { + jsaddle-webkit2gtk = null; + }); }) From 4f6d1dd754b97c13db840105b84219ea12a3f88c Mon Sep 17 00:00:00 2001 From: Alexandre Esteves Date: Sun, 9 Feb 2025 22:12:25 +0000 Subject: [PATCH 2/2] haskellPackages: add miso/reflex-dom ghcjs 9.12 to release-haskell --- pkgs/top-level/release-haskell.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/top-level/release-haskell.nix b/pkgs/top-level/release-haskell.nix index 4c44d6624fd3..111fbacd3553 100644 --- a/pkgs/top-level/release-haskell.nix +++ b/pkgs/top-level/release-haskell.nix @@ -504,6 +504,16 @@ let ; }; + haskell.packages.ghc912 = { + inherit (packagePlatforms pkgs.pkgsCross.ghcjs.haskell.packages.ghc912) + ghc + hello + microlens + miso + reflex-dom + ; + }; + haskell.packages.ghcHEAD = { inherit (packagePlatforms pkgs.pkgsCross.ghcjs.haskell.packages.ghcHEAD) ghc