gecko-dev/build/moz.configure/update-programs.configure

137 строки
3.8 KiB
Python

# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Updater
# ==============================================================
@depends(build_project)
def updater_default(build_project):
return build_project != "mobile/android"
option(
"--enable-updater",
default=updater_default,
help="{Enable|Disable} building the updater",
)
set_config("MOZ_UPDATER", True, when="--enable-updater")
set_define("MOZ_UPDATER", True, when="--enable-updater")
# Updates that do not verify signatures
# ==============================================================
option(
"--enable-unverified-updates",
default=False,
help="Enable application update without verifying MAR or updater binary signatures",
)
@depends("--enable-unverified-updates", "--enable-compile-environment")
def disable_unverified_updates(unverified_updates, compile_environment):
if unverified_updates:
if not compile_environment:
die("--enable-unverified-updates requires --enable-compile-environment")
return not unverified_updates
set_define(
"MOZ_VERIFY_MAR_SIGNATURE",
depends_if(disable_unverified_updates)(lambda _: True),
)
set_config(
"MOZ_VERIFY_MAR_SIGNATURE",
True,
depends_if(disable_unverified_updates)(lambda _: True),
)
set_config(
"DISABLE_UPDATER_AUTHENTICODE_CHECK",
True,
depends_if("--enable-unverified-updates")(lambda _: True),
)
# Maintenance service (Windows only)
# ==============================================================
option(
"--enable-maintenance-service",
when=target_is_windows,
default=target_is_windows,
help="{Enable|Disable} building of maintenance service",
)
set_define(
"MOZ_MAINTENANCE_SERVICE",
depends_if("--enable-maintenance-service", when=target_is_windows)(lambda _: True),
)
set_config(
"MOZ_MAINTENANCE_SERVICE",
depends_if("--enable-maintenance-service", when=target_is_windows)(lambda _: True),
)
# Update agent (currently Windows and macOS only)
# This is an independent task that runs on a schedule to
# check for, download, and install updates.
# ==============================================================
@depends("--enable-backgroundtasks", build_project)
def update_agent_default(backgroundtasks, build_project):
return bool(backgroundtasks) and build_project == "browser"
option(
"--disable-update-agent",
when=target_is_windows | target_is_osx,
default=update_agent_default,
help="{Enable|Disable} building update agent",
)
set_config(
"MOZ_UPDATE_AGENT",
depends_if("--enable-update-agent", when=target_is_windows | target_is_osx)(
lambda _: True
),
)
@depends(
"--enable-update-agent",
"--enable-backgroundtasks",
when=target_is_windows | target_is_osx,
)
def check_update_agent(update_agent, backgroundtasks):
if update_agent and not backgroundtasks:
die("--enable-backgroundtasks is required to --enable-update-agent")
return update_agent
# Enable or disable the default browser agent, which monitors the user's default
# browser setting on Windows.
# ==============================================================================
@depends(target, build_project)
def default_browser_agent_default(target, build_project):
return target.os == "WINNT" and build_project == "browser"
option(
"--enable-default-browser-agent",
default=default_browser_agent_default,
help="{Enable|Disable} building the default browser agent",
)
@depends("--enable-default-browser-agent", when=target_is_windows)
def default_agent_flag(enabled):
if enabled:
return True
set_config("MOZ_DEFAULT_BROWSER_AGENT", default_agent_flag)