From b2b6246ed8ede6b4e5601554dcf28b2fc9854ed8 Mon Sep 17 00:00:00 2001 From: Alexandre Esteves Date: Sat, 17 Jan 2026 20:37:18 +0000 Subject: [PATCH] haskellPackages.basement: apply patch for integer cast MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes error: Size.hsc:126:30: error: initialization of ‘long long int’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion] --- .../haskell-modules/configuration-common.nix | 9 +++++++-- .../haskell-modules/patches/basement-add-cast.patch | 13 +++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 pkgs/development/haskell-modules/patches/basement-add-cast.patch diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index db12a16ec412..ac1c26e53817 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -494,15 +494,20 @@ with haskellLib; jpeg-turbo = dontCheck super.jpeg-turbo; JuicyPixels-jpeg-turbo = dontCheck super.JuicyPixels-jpeg-turbo; - # Fixes compilation for basement on i686 - # https://github.com/haskell-foundation/foundation/pull/573 basement = appendPatches [ + # Fixes compilation for basement on i686 + # https://github.com/haskell-foundation/foundation/pull/573 (fetchpatch { name = "basement-i686-ghc-9.4.patch"; url = "https://github.com/haskell-foundation/foundation/pull/573/commits/38be2c93acb6f459d24ed6c626981c35ccf44095.patch"; 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 + ] super.basement; # Fixes compilation of memory with GHC >= 9.4 on 32bit platforms diff --git a/pkgs/development/haskell-modules/patches/basement-add-cast.patch b/pkgs/development/haskell-modules/patches/basement-add-cast.patch new file mode 100644 index 000000000000..1dd4fb559989 --- /dev/null +++ b/pkgs/development/haskell-modules/patches/basement-add-cast.patch @@ -0,0 +1,13 @@ +diff --git a/Basement/Terminal/Size.hsc b/Basement/Terminal/Size.hsc +index 62c315e..4bfe0ad 100644 +--- a/Basement/Terminal/Size.hsc ++++ b/Basement/Terminal/Size.hsc +@@ -121,7 +121,7 @@ instance Storable ConsoleScreenBufferInfo where + #{poke CONSOLE_SCREEN_BUFFER_INFO, dwMaximumWindowSize} ptr m + + invalidHandleValue :: IntPtr +-invalidHandleValue = #{const INVALID_HANDLE_VALUE} ++invalidHandleValue = IntPtr $ #{const (long long int)INVALID_HANDLE_VALUE} + + stdOutputHandle :: CULong + stdOutputHandle = #{const STD_OUTPUT_HANDLE}