anchor.diff:  , title ? null
   }:
   
  -assert release -> codeSignIdentity != null && certificateFile != null && certificatePassword != null && provisioningProfile != null;
  +assert release -> codeSignIdentity != null && certificateFile != null && certificatePassword != null && provisioningProfile != null && signMethod != null;
   assert enableWirelessDistribution -> installURL != null && bundleId != null && version != null && title != null;
   
   let
  
positive.code:     # Do the building
      export LD=clang # To avoid problem with -isysroot parameter that is unrecognized by the stock ld. Comparison with an impure build shows that it uses clang instead. Ugly, but it works
  
      xcodebuild -target ${_target} -configuration ${_configuration} ${stdenv.lib.optionalString (scheme != null) "-scheme ${scheme}"} -sdk ${_sdk} TARGETED_DEVICE_FAMILY="1, 2" ONLY_ACTIVE_ARCH=NO CONFIGURATION_TEMP_DIR=$TMPDIR CONFIGURATION_BUILD_DIR=$out ${if generateXCArchive then "archive" else ""} ${xcodeFlags} ${if release then ''"CODE_SIGN_IDENTITY=${codeSignIdentity}" PROVISIONING_PROFILE=$PROVISIONING_PROFILE OTHER_CODE_SIGN_FLAGS="--keychain $HOME/Library/Keychains/$keychainName-db"'' else ""}
  
      ${stdenv.lib.optionalString release ''
        ${stdenv.lib.optionalString generateIPA ''
          # Produce an IPA file
          xcrun -sdk iphoneos PackageApplication -v $out/*.app -o "$out/${name}.ipa"
          
          # Add IPA to Hydra build products
          mkdir -p $out/nix-support
          echo "file binary-dist \"$(echo $out/*.ipa)\"" > $out/nix-support/hydra-build-products
  
negative.code: , certificateFile ? null
  , certificatePassword ? null
  , provisioningProfile ? null
  , signMethod ? null
  , generateIPA ? false
  , generateXCArchive ? false
  , enableWirelessDistribution ? false
  