From de44764f21a454d4543a8539b6fd45576984f0fe Mon Sep 17 00:00:00 2001 From: Alexandre Esteves Date: Wed, 18 Feb 2026 02:43:28 +0000 Subject: [PATCH 1/2] haskellPackages.basement: fix on ghcjs --- .../haskell-modules/configuration-common.nix | 7 +++---- .../haskell-modules/patches/basement-ghcjs.patch | 11 +++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 pkgs/development/haskell-modules/patches/basement-ghcjs.patch diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index 662c682aaf17..3cb4d376fb13 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -494,6 +494,7 @@ with haskellLib; jpeg-turbo = dontCheck super.jpeg-turbo; JuicyPixels-jpeg-turbo = dontCheck super.JuicyPixels-jpeg-turbo; + # Repo is archived, package is abandoned: https://github.com/haskell-foundation/foundation basement = appendPatches [ # Fixes compilation for basement on i686 # https://github.com/haskell-foundation/foundation/pull/573 @@ -503,10 +504,8 @@ with haskellLib; sha256 = "17kz8glfim29vyhj8idw8bdh3id5sl9zaq18zzih3schfvyjppj7"; stripLen = 1; }) - - # Fixes compilation on windows - # Repo is archived, package is abandoned: https://github.com/haskell-foundation/foundation - ./patches/basement-add-cast.patch + ./patches/basement-add-cast.patch # Fixes compilation on windows + ./patches/basement-ghcjs.patch # Fixes compilation on ghcjs ] super.basement; diff --git a/pkgs/development/haskell-modules/patches/basement-ghcjs.patch b/pkgs/development/haskell-modules/patches/basement-ghcjs.patch new file mode 100644 index 000000000000..aa858a9c9b48 --- /dev/null +++ b/pkgs/development/haskell-modules/patches/basement-ghcjs.patch @@ -0,0 +1,11 @@ +diff --git a/basement.cabal b/basement.cabal +index f85f617..1484ad7 100644 +--- a/basement.cabal ++++ b/basement.cabal +@@ -156,4 +156,5 @@ library + else + cpp-options: -DARCH_IS_UNKNOWN_ENDIAN + include-dirs: cbits +- c-sources: cbits/foundation_mem.c ++ if !os(ghcjs) ++ c-sources: cbits/foundation_mem.c From 5bda4227ab5cafaf6e56665c8b007f03c19aad76 Mon Sep 17 00:00:00 2001 From: Alexandre Esteves Date: Wed, 18 Feb 2026 02:43:38 +0000 Subject: [PATCH 2/2] haskellPackages.foundation: fix on ghcjs --- .../haskell-modules/configuration-common.nix | 4 ++++ .../haskell-modules/patches/foundation-ghcjs.patch | 14 ++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 pkgs/development/haskell-modules/patches/foundation-ghcjs.patch diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index 3cb4d376fb13..eadc97a06776 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -509,6 +509,10 @@ with haskellLib; ] super.basement; + # Repo is archived, package is abandoned: https://github.com/haskell-foundation/foundation + # Fixes compilation on ghcjs + foundation = appendPatch ./patches/foundation-ghcjs.patch super.foundation; + # Fixes compilation of memory with GHC >= 9.4 on 32bit platforms # https://github.com/vincenthz/hs-memory/pull/99 memory = appendPatches [ diff --git a/pkgs/development/haskell-modules/patches/foundation-ghcjs.patch b/pkgs/development/haskell-modules/patches/foundation-ghcjs.patch new file mode 100644 index 000000000000..1b2cd33d63ab --- /dev/null +++ b/pkgs/development/haskell-modules/patches/foundation-ghcjs.patch @@ -0,0 +1,14 @@ +diff --git a/foundation.cabal b/foundation.cabal +index d33d874..654488b 100644 +--- a/foundation.cabal ++++ b/foundation.cabal +@@ -169,7 +169,8 @@ library + Foundation.System.Bindings.Hs + + include-dirs: cbits +- c-sources: cbits/foundation_random.c ++ if !os(ghcjs) ++ c-sources: cbits/foundation_random.c + cbits/foundation_network.c + cbits/foundation_time.c + cbits/foundation_utf8.c