diff --git a/pkgs/development/haskell-modules/configuration-ghc-9.4.x.nix b/pkgs/development/haskell-modules/configuration-ghc-9.4.x.nix index 99369274debf..1261719185e3 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-9.4.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-9.4.x.nix @@ -208,4 +208,9 @@ in { # the GHC 9.6 configuration may need similar overrides eventually. X11-xft = __CabalEagerPkgConfigWorkaround super.X11-xft; + # The gtk2hs setup hook provided by this package lacks the ppOrdering field that + # recent versions of Cabal require. This leads to builds like cairo and glib + # failing during the Setup.hs phase: https://github.com/gtk2hs/gtk2hs/issues/323. + gtk2hs-buildtools = appendPatch ./patches/gtk2hs-buildtools-fix-ghc-9.4.x.patch super.gtk2hs-buildtools; + } diff --git a/pkgs/development/haskell-modules/lib/compose.nix b/pkgs/development/haskell-modules/lib/compose.nix index 647e95211f1c..fa6d2a20a9a2 100644 --- a/pkgs/development/haskell-modules/lib/compose.nix +++ b/pkgs/development/haskell-modules/lib/compose.nix @@ -494,7 +494,7 @@ rec { if !lib.isDerivation drv then [ ] else [ { key = drv.outPath; val = drv; } ] - ) val.buildInputs or [ ]; + ) (val.buildInputs or [ ] ++ val.propagatedBuildInputs or [ ]); } ); in diff --git a/pkgs/development/haskell-modules/patches/gtk2hs-buildtools-fix-ghc-9.4.x.patch b/pkgs/development/haskell-modules/patches/gtk2hs-buildtools-fix-ghc-9.4.x.patch new file mode 100644 index 000000000000..948a0366ca4e --- /dev/null +++ b/pkgs/development/haskell-modules/patches/gtk2hs-buildtools-fix-ghc-9.4.x.patch @@ -0,0 +1,12 @@ +diff --git a/src/Gtk2HsSetup.hs b/src/Gtk2HsSetup.hs +index 598048f..b652b76 100644 +--- a/src/Gtk2HsSetup.hs ++++ b/src/Gtk2HsSetup.hs +@@ -300,6 +300,7 @@ ourC2hs :: BuildInfo -> LocalBuildInfo -> PreProcessor + ourC2hs bi lbi = PreProcessor { + #endif + platformIndependent = False, ++ ppOrdering = (\ _ _ ms -> return ms), + runPreProcessor = runC2HS bi lbi + } +