From 5e8a857310a580d6f7a3d56ec99295792143d496 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Fri, 6 May 2022 10:53:39 -0400 Subject: [PATCH] ncurses: Fix building against ucrt --- pkgs/development/libraries/ncurses/default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix index 2740b95986c..a661f5f216c 100644 --- a/pkgs/development/libraries/ncurses/default.nix +++ b/pkgs/development/libraries/ncurses/default.nix @@ -46,7 +46,13 @@ stdenv.mkDerivation rec { ]; # Only the C compiler, and explicitly not C++ compiler needs this flag on solaris: - CFLAGS = lib.optionalString stdenv.isSunOS "-D_XOPEN_SOURCE_EXTENDED"; + CFLAGS = + # Only the C compiler, and explicitly not C++ compiler needs this flag on solaris: + /**/ if stdenv.isSunOS then "-D_XOPEN_SOURCE_EXTENDED" + # ucrt doesn't support X_OK to access() without this flag + else if stdenv.hostPlatform.libc == "ucrt" then "-D__USE_MINGW_ACCESS" + else ""; + depsBuildBuild = [ buildPackages.stdenv.cc