libedit: manually define __STDC_ISO_10646__ to fix the build issue against musl

Musl is ISO 10646 compliant but doesn't define __STDC_ISO_10646__ we need to do it ourselves.
This commit is contained in:
Sameer Rahmani 2023-11-26 13:27:24 +00:00
parent 993f056be6
commit cb202d19e4
No known key found for this signature in database
GPG Key ID: B0A4AF28AB9FD90B

View File

@ -14,6 +14,17 @@ stdenv.mkDerivation rec {
# Have `configure' avoid `/usr/bin/nroff' in non-chroot builds.
# NROFF = "${groff}/bin/nroff";
# GCC automatically include `stdc-predefs.h` while Clang does not do
# this by default. While Musl is ISO 10646 compliant, doesn't define
# __STDC_ISO_10646__. This definition is in `stdc-predefs.h` that's
# why libedit builds just fine with GCC and Musl.
# There is a DR to fix this issue with Clang which is not merged
# yet.
# https://reviews.llvm.org/D137043
NIX_CFLAGS_COMPILE = lib.optional
(stdenv.targetPlatform.isMusl && stdenv.cc.isClang)
"-D__STDC_ISO_10646__=201103L";
patches = [ ./01-cygwin.patch ];
propagatedBuildInputs = [ ncurses ];