xcbuild: fix gcc-13 build failure

Without the change build fais on `master as
https://hydra.nixos.org/build/249027078:

    /build/source/Libraries/libutil/Headers/libutil/Permissions.h:23:18: error: 'uint8_t' does not name a type
       23 |     using Base = uint8_t;
          |                  ^~~~~~~
This commit is contained in:
Sergei Trofimovich 2024-02-11 12:16:32 +00:00
parent d7c8d1d842
commit 2e4073c0c6

View file

@ -39,6 +39,12 @@ in stdenv.mkDerivation {
'';
postPatch = lib.optionalString (!stdenv.isDarwin) ''
# Fix build on gcc-13 due to missing includes
sed -e '1i #include <cstdint>' -i \
Libraries/libutil/Headers/libutil/Permissions.h \
Libraries/pbxbuild/Headers/pbxbuild/Tool/AuxiliaryFile.h \
Libraries/pbxbuild/Headers/pbxbuild/Tool/Invocation.h
# Avoid a glibc >= 2.25 deprecation warning that gets fatal via -Werror.
sed 1i'#include <sys/sysmacros.h>' \
-i Libraries/xcassets/Headers/xcassets/Slot/SystemVersion.h