{ appleDerivation, lib, bootstrap_cmds, bison, flex , gnum4, unifdef, perl, python3 , headersOnly ? true }: appleDerivation ({ nativeBuildInputs = [ bootstrap_cmds bison flex gnum4 unifdef perl python3 ]; patches = [ ./python3.patch ]; postPatch = '' 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 . ''; PLATFORM = "MacOSX"; SDKVERSION = "10.11"; CC = "cc"; CXX = "c++"; MIG = "mig"; MIGCOM = "migcom"; STRIP = "strip"; NM = "nm"; UNIFDEF = "unifdef"; DSYMUTIL = "dsymutil"; HOST_OS_VERSION = "10.10"; HOST_CC = "cc"; HOST_FLEX = "flex"; HOST_BISON = "bison"; HOST_GM4 = "m4"; MIGCC = "cc"; ARCHS = "x86_64"; NIX_CFLAGS_COMPILE = "-Wno-error"; preBuild = '' # This is a bit of a hack... mkdir -p sdk/usr/local/libexec cat > sdk/usr/local/libexec/availability.pl <