nixpkgs/pkgs/os-specific/darwin/usr-include/default.nix
Matthew Bauer 8610a34474
gcc: use special native system headers for darwin
Darwin systems need to be able to find CoreFoundation headers as well as
libc headers. Somehow, gcc doesn't accept any "framework" parameters
that would normally be used to include CoreFoundation in this
situation.

HACK: Instead, this adds a derivation that combines the two. The result
works but probably not a good long term solution.

ALTERNATIVES: Maybe sending patches in to GCC to allow
"native-system-framework" configure flag to get this found.
2016-09-15 17:58:09 -05:00

22 lines
592 B
Nix

{stdenv, darwin}:
/*
* This is needed to build GCC on Darwin.
*
* These are the collection of headers that would normally be available under
* /usr/include in OS X machines with command line tools installed. They need
* to be in one folder for gcc to use them correctly.
*/
stdenv.mkDerivation {
name = "darwin-usr-include";
buildInputs = [ darwin.CF stdenv.libc ];
buildCommand = ''
mkdir -p $out
cd $out
ln -sf ${stdenv.libc}/include/* .
mkdir CoreFoundation
ln -sf ${darwin.CF}/Library/Frameworks/CoreFoundation.framework/Headers/* CoreFoundation
'';
}