Unverified Commit 475f17b8 authored by Randy Eckenrode's avatar Randy Eckenrode
Browse files

apple-sdk: link CUPS headers into the sysroot

Not having the CUPS headers in the sysroot causes problems for Swift’s
module importer when it tries to import AppKit, which depends on CUPS
headers. The module importer is effectively an unwrapped Clang, so the
headers need to be symlinked there instead of just propagated.
parent 2ea12938
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -56,16 +56,19 @@ self: super: {
      darwin.libsbuf
      # Shipped with the SDK only as a library with no headers
      (lib.getLib darwin.libutil)
      # Required by some SDK headers
      cupsHeaders
    ]
    # x86_64-darwin links the object files from Csu when targeting very old releases
    ++ lib.optionals stdenvNoCC.hostPlatform.isx86_64 [ darwin.Csu ];

  # The Darwin module for Swift requires certain headers to be included in the SDK (and not just be propagated).
  buildPhase = super.buildPhase or "" + ''
    for header in '${lib.getDev libiconv}/include/'* '${lib.getDev ncurses}/include/'*; do
    for header in '${lib.getDev libiconv}/include/'* '${lib.getDev ncurses}/include/'* '${cupsHeaders}/include/'*; do
      ln -s "$header" "usr/include/$(basename "$header")"
    done
  '';

  # Exported to allow the headers to pass the requisites check in the stdenv bootstrap.
  passthru = (super.passthru or { }) // {
    cups-headers = cupsHeaders;
  };
}
+1 −0
Original line number Diff line number Diff line
@@ -1121,6 +1121,7 @@ assert bootstrapTools.passthru.isFromBootstrapFiles or false; # sanity check
            with prevStage;
            [
              apple-sdk
              apple-sdk.cups-headers
              bashNonInteractive
              bzip2.bin
              bzip2.out