summary refs log blame commit diff
path: root/pkgs/os-specific/darwin/usr-include/default.nix
blob: 26b60ea44f5d72ea766b23209031b6c9464de948 (plain) (tree)
1
2
3
4
5
6
7
                      




                                                                             
                                                                              












                                                                                            
 
                                        
 
{lib, 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 macOS 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
  '';

  meta.platforms = lib.platforms.darwin;
}