{ lib, stdenvNoCC, appleDerivation', gnused, python3, unifdef, }: appleDerivation' stdenvNoCC { nativeBuildInputs = [ unifdef ]; patches = [ ./0001-Support-setting-an-upper-bound-on-versions.patch ]; buildPhase = '' runHook preBuild declare -a unifdef_sources=( os_availability.modulemap os_availability_private.modulemap AvailabilityPrivate.modulemap ) unifdef -x2 -UBUILD_FOR_DRIVERKIT -m $(for x in "''${unifdef_sources[@]}"; do echo templates/$x; done) runHook postBuild ''; installPhase = '' runHook preInstall mkdir -p "$out/bin" "$out/libexec" "$out/share/availability" cp -r availability.dsl templates "$out/share/availability/" substitute availability "$out/libexec/availability" \ --replace-fail '/usr/bin/env python3' '${lib.getBin python3}/bin/python3' \ --replace-fail 'f"{os.path.abspath(os.path.dirname(sys.argv[0]))}/' "\"$out/share/availability/" chmod a+x "$out/libexec/availability" cat <