depot/third_party/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/libdispatch/default.nix
Default email 8ac5e011d6 Project import generated by Copybara.
GitOrigin-RevId: 2c3273caa153ee8eb5786bc8141b85b859e7efd7
2020-04-24 19:36:52 -04:00

25 lines
783 B
Nix

{ appleDerivation }:
appleDerivation {
dontConfigure = true;
dontBuild = true;
installPhase = ''
mkdir -p $out/include/dispatch $out/include/os
# Move these headers so CF can find <os/voucher_private.h>
mv private/voucher*.h $out/include/os
cp -r private/*.h $out/include/dispatch
cp -r dispatch/*.h $out/include/dispatch
cp -r os/object*.h $out/include/os
# gcc compatability. Source: https://stackoverflow.com/a/28014302/3714556
substituteInPlace $out/include/dispatch/object.h \
--replace 'typedef void (^dispatch_block_t)(void);' \
'#ifdef __clang__
typedef void (^dispatch_block_t)(void);
#else
typedef void* dispatch_block_t;
#endif'
'';
}