From 177e7d4a786bfbdc748c1a93e0576988ac2e2f26 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 21 Apr 2025 12:38:48 -0400 Subject: [PATCH] readline: Fix MinGW Build This is needed to cross-compile Nix itself, among other things. The need for change I assume stems from toolchains / newer versions of C becoming more strict. --- pkgs/development/libraries/readline/8.2.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/development/libraries/readline/8.2.nix b/pkgs/development/libraries/readline/8.2.nix index b7663a066ee6..40dd19969edd 100644 --- a/pkgs/development/libraries/readline/8.2.nix +++ b/pkgs/development/libraries/readline/8.2.nix @@ -79,6 +79,14 @@ stdenv.mkDerivation rec { }) ]; + # Make mingw-w64 provide a dummy alarm() function + # + # Method borrowed from + # https://github.com/msys2/MINGW-packages/commit/35830ab27e5ed35c2a8d486961ab607109f5af50 + # + # `null` is used to avoid mass rebuild, will fix on staging. + CFLAGS = if !stdenv.hostPlatform.isMinGW then null else "-D__USE_MINGW_ALARM -D_POSIX"; + # This install error is caused by a very old libtool. We can't autoreconfHook this package, # so this is the best we've got! postInstall = lib.optionalString stdenv.hostPlatform.isOpenBSD ''