xcbuild: fix darwin build

Bumping the MacOS target version to 10.12 signalled xcbuild that
libcompression is available on Darwin, but libcompression is not
OSS (even though an LZFSE reference implementation is), and it is not
part of a framework for us to make impure, so this patch disables it.
This commit is contained in:
Jason Felice 2019-08-07 11:22:18 -04:00
parent b044b6814f
commit 80112a6f2a

View file

@ -36,10 +36,15 @@ in stdenv.mkDerivation rec {
cp -r --no-preserve=all ${linenoise} ThirdParty/linenoise
'';
# Avoid a glibc >= 2.25 deprecation warning that gets fatal via -Werror.
postPatch = stdenv.lib.optionalString (!stdenv.isDarwin) ''
# 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
'' + stdenv.lib.optionalString stdenv.isDarwin ''
# Apple Open Sourced LZFSE, but not libcompression, and it isn't
# part of an impure framework we can add
sed '/#define HAVE_LIBCOMPRESSION 1/d' \
-i Libraries/libcar/Sources/Rendition.cpp
'';
enableParallelBuilding = true;