llvmPackages_13.lld: add postPatch to fix Darwin build

This commit is contained in:
Divam 2021-09-23 09:17:31 +09:00
parent 20291381c1
commit d32e0e6b1b

View File

@ -18,6 +18,14 @@ stdenv.mkDerivation rec {
./gnu-install-dirs.patch
];
# On Darwin the llvm-config is perhaps not working fine as the
# LLVM_MAIN_SRC_DIR is not getting set correctly, and the build fails as the
# include path is not correct.
postPatch = lib.optionalString stdenv.isDarwin ''
substituteInPlace MachO/CMakeLists.txt --replace \
'(''${LLVM_MAIN_SRC_DIR}/' '(../'
'';
nativeBuildInputs = [ cmake ];
buildInputs = [ libllvm libxml2 ];