linux-headers: Fix Darwin cross build

Carefully fake cc-version and cc-fullversion to avoid needing a compiler
for the kernel itself to build the headers.

For some reason, doing `make install_headers` twice, first without
INSTALL_HDR_PATH=$out then with, is neccessary to get this to work.
This commit is contained in:
Daiderd Jordan
2018-01-26 23:40:40 +01:00
committed by John Ericson
parent 88cd633ea4
commit ab6bbdd5cd
4 changed files with 82 additions and 7 deletions

View File

@@ -133,7 +133,9 @@ stdenv.mkDerivation ({
depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ bison ];
buildInputs = lib.optionals withGd [ gd libpng ];
# TODO make linuxHeaders unconditional next mass rebuild
buildInputs = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) linuxHeaders
++ lib.optionals withGd [ gd libpng ];
# Needed to install share/zoneinfo/zone.tab. Set to impure /bin/sh to
# prevent a retained dependency on the bootstrap tools in the stdenv-linux