From 13388a66ebda71f9c31825675c16de282657840d Mon Sep 17 00:00:00 2001 From: Jon Hermansen Date: Sat, 31 Jan 2026 13:19:02 -0500 Subject: [PATCH] ncurses: disable C++ bindings for static FreeBSD cross builds The static FreeBSD cross stdenv has libc++ headers searched after C library headers, causing libc++'s `#include_next` mechanism to fail. libc++'s includes expecting its own wrapper, but finds the C library's header directly and errors out. The C++ bindings (libncurses++) are optional and not needed by any current consumers of ncurses-static (readline, bash-interactive). --- pkgs/development/libraries/ncurses/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix index 42f603449222..d21cc0bc195e 100644 --- a/pkgs/development/libraries/ncurses/default.nix +++ b/pkgs/development/libraries/ncurses/default.nix @@ -8,7 +8,11 @@ pkg-config, abiVersion ? "6", enableStatic ? stdenv.hostPlatform.isStatic, - withCxx ? !stdenv.hostPlatform.useAndroidPrebuilt, + # Disabled for static FreeBSD: libc++ headers come after C library headers, + # breaking C++ compilation. No current consumers need the C++ bindings. + withCxx ? + !stdenv.hostPlatform.useAndroidPrebuilt + && !(stdenv.hostPlatform.isFreeBSD && stdenv.hostPlatform.isStatic), mouseSupport ? false, gpm, withTermlib ? false,