llvmPackages_11.libcxx: backport block.h fix from llvm12

As a concrete example, this fixes graphviz compilation:

* https://gitlab.com/graphviz/graphviz/-/issues/1785
This commit is contained in:
Ivan Babrou 2021-02-27 15:09:52 -08:00
parent 70e35bbfde
commit d85965dcf5

View file

@ -1,4 +1,4 @@
{ lib, stdenv, fetch, cmake, python3, libcxxabi, llvm, fixDarwinDylibNames, version
{ lib, stdenv, fetch, fetchpatch, cmake, python3, libcxxabi, llvm, fixDarwinDylibNames, version
, enableShared ? !stdenv.hostPlatform.isStatic
}:
@ -15,7 +15,14 @@ stdenv.mkDerivation {
mv llvm-* llvm
'';
patches = lib.optional stdenv.hostPlatform.isMusl ../../libcxx-0001-musl-hacks.patch;
patches = [
(fetchpatch {
# Backported from LLVM 12, avoids clashes with commonly used "block.h" header.
url = "https://github.com/llvm/llvm-project/commit/19bc9ea480b60b607a3e303f20c7a3a2ea553369.patch";
sha256 = "sha256-aWa66ogmPkG0xHzSfcpD0qZyZQcNKwLV44js4eiun78=";
stripLen = 1;
})
] ++ lib.optional stdenv.hostPlatform.isMusl ../../libcxx-0001-musl-hacks.patch;
preConfigure = lib.optionalString stdenv.hostPlatform.isMusl ''
patchShebangs utils/cat_files.py