{ appleDerivation, bootstrap_cmds, bison, flex, gnum4, unifdef, perl, python }: appleDerivation { phases = [ "unpackPhase" "patchPhase" "installPhase" ]; buildInputs = [ bootstrap_cmds bison flex gnum4 unifdef perl python ]; patchPhase = '' substituteInPlace Makefile \ --replace "/bin/" "" \ --replace "MAKEJOBS := " '# MAKEJOBS := ' substituteInPlace makedefs/MakeInc.cmd \ --replace "/usr/bin/" "" \ --replace "/bin/" "" \ --replace "-Werror " "" substituteInPlace makedefs/MakeInc.def \ --replace "-c -S -m" "-c -m" substituteInPlace makedefs/MakeInc.top \ --replace "MEMORY_SIZE := " 'MEMORY_SIZE := 1073741824 # ' substituteInPlace libkern/kxld/Makefile \ --replace "-Werror " "" substituteInPlace SETUP/kextsymboltool/Makefile \ --replace "-lstdc++" "-lc++" substituteInPlace libsyscall/xcodescripts/mach_install_mig.sh \ --replace "/usr/include" "/include" \ --replace "/usr/local/include" "/include" \ --replace 'MIG=`' "# " \ --replace 'MIGCC=`' "# " \ --replace " -o 0" "" \ --replace '$SRC/$mig' '-I$DSTROOT/include $SRC/$mig' \ --replace '$SRC/servers/netname.defs' '-I$DSTROOT/include $SRC/servers/netname.defs' \ --replace '$BUILT_PRODUCTS_DIR/mig_hdr' '$BUILT_PRODUCTS_DIR' patchShebangs . ''; installPhase = '' # This is a bit of a hack... mkdir -p sdk/usr/local/libexec cat > sdk/usr/local/libexec/availability.pl <