Skip to content

Commit

Permalink
darwin."10.13.6.xnu: Use --replace-fail
Browse files Browse the repository at this point in the history
  • Loading branch information
toonn committed Jun 19, 2024
1 parent 756a13b commit c4d18c2
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions pkgs/os-specific/darwin/apple-source-releases/xnu/10.13.6.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,40 +19,41 @@ appleDerivation' (if headersOnly then stdenvNoCC else stdenv) (

postPatch = ''
substituteInPlace Makefile \
--replace "/bin/" "" \
--replace "MAKEJOBS := " '# MAKEJOBS := '
--replace-fail "/bin/" "" \
--replace-fail "MAKEJOBS := " '# MAKEJOBS := '
substituteInPlace makedefs/MakeInc.cmd \
--replace "/usr/bin/" "" \
--replace "/bin/" ""
--replace-fail "/usr/bin/" "" \
--replace-fail "/bin/" ""
substituteInPlace makedefs/MakeInc.def \
--replace "-c -S -m" "-c -m"
--replace-fail "-c -S -m" "-c -m"
substituteInPlace makedefs/MakeInc.top \
--replace "MEMORY_SIZE := " 'MEMORY_SIZE := 1073741824 # '
--replace-fail "MEMORY_SIZE := " 'MEMORY_SIZE := 1073741824 # '
substituteInPlace libkern/kxld/Makefile \
--replace "-Werror " ""
--replace-fail "-Werror " ""
substituteInPlace SETUP/kextsymboltool/Makefile \
--replace "-lstdc++" "-lc++ -lc++abi"
--replace-fail "-lstdc++" "-lc++ -lc++abi"
substituteInPlace libsyscall/xcodescripts/mach_install_mig.sh \
--replace "/usr/include" "/include" \
--replace 'MIG=`' "# " \
--replace 'MIGCC=`' "# " \
--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'
--replace-fail "/usr/include" "/include" \
--replace-fail 'MIG=`' "# " \
--replace-fail 'MIGCC=`' "# " \
--replace-fail '$SRC/$mig' '-I$DSTROOT/include $SRC/$mig' \
--replace-fail '$SRC/servers/netname.defs' \
'-I$DSTROOT/include $SRC/servers/netname.defs' \
--replace-fail '$BUILT_PRODUCTS_DIR/mig_hdr' '$BUILT_PRODUCTS_DIR'
patchShebangs .
'' + lib.optionalString stdenv.isAarch64 ''
# iig is closed-sourced, we don't have it
# create an empty file to the header instead
# this line becomes: echo "" > $@; echo --header ...
substituteInPlace iokit/DriverKit/Makefile \
--replace '--def $<' '> $@; echo'
--replace-fail '--def $<' '> $@; echo'
'';

PLATFORM = "MacOSX";
Expand Down

0 comments on commit c4d18c2

Please sign in to comment.