Bug 1904139 - Don't re-initialize platform font list from GetDefaultFont. r=jfkthame
[gecko.git] / build / moz.configure / update-programs.configure
blob17db0b7a200577735a5049c7f9be75b315edae50
1 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
2 # vim: set filetype=python:
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 # Updater
9 # ==============================================================
10 @depends(build_project, target)
11 def updater_default(build_project, target):
12     if build_project == "tools/update-programs":
13         return True
14     return build_project != "mobile/android" and target.os != "iOS"
17 option(
18     "--enable-updater",
19     default=updater_default,
20     help="{Enable|Disable} building the updater",
23 set_config("MOZ_UPDATER", True, when="--enable-updater")
24 set_define("MOZ_UPDATER", True, when="--enable-updater")
26 # Updates that do not verify signatures
27 # ==============================================================
29 option(
30     "--enable-unverified-updates",
31     default=False,
32     help="Enable application update without verifying MAR or updater binary signatures",
36 @depends("--enable-unverified-updates", "--enable-compile-environment")
37 def disable_unverified_updates(unverified_updates, compile_environment):
38     if unverified_updates:
39         if not compile_environment:
40             die("--enable-unverified-updates requires --enable-compile-environment")
41     return not unverified_updates
44 set_define(
45     "MOZ_VERIFY_MAR_SIGNATURE",
46     depends_if(disable_unverified_updates)(lambda _: True),
48 set_config(
49     "MOZ_VERIFY_MAR_SIGNATURE",
50     True,
51     depends_if(disable_unverified_updates)(lambda _: True),
54 set_config(
55     "DISABLE_UPDATER_AUTHENTICODE_CHECK",
56     True,
57     depends_if("--enable-unverified-updates")(lambda _: True),
60 # Use NSS for MAR signatures even on platforms where system libraries are
61 # supported (currently Windows and macOS).
62 # ==============================================================
64 can_toggle_nss_mar = target_is_windows | target_is_osx
66 option(
67     "--enable-nss-mar",
68     when=can_toggle_nss_mar,
69     help="Enable using NSS to check MAR signatures instead of system crypto.",
73 @depends(
74     depends("--enable-nss-mar", when=can_toggle_nss_mar)(lambda x: x),
75     can_toggle_nss_mar,
77 def enable_nss_mar(enabled, can_toggle_nss_mar):
78     return enabled or not can_toggle_nss_mar
81 set_config("MOZ_USE_NSS_FOR_MAR", True, when=enable_nss_mar)
83 # Maintenance service (Windows only)
84 # ==============================================================
87 @depends("--enable-updater")
88 def maintenance_service_default(updater):
89     return bool(updater)
92 option(
93     "--enable-maintenance-service",
94     when=target_is_windows,
95     default=maintenance_service_default,
96     help="{Enable|Disable} building of maintenance service",
99 set_define(
100     "MOZ_MAINTENANCE_SERVICE",
101     depends_if("--enable-maintenance-service", when=target_is_windows)(lambda _: True),
103 set_config(
104     "MOZ_MAINTENANCE_SERVICE",
105     depends_if("--enable-maintenance-service", when=target_is_windows)(lambda _: True),
109 @depends("--enable-maintenance-service", "--enable-updater", when=target_is_windows)
110 def check_maintenance_service(mainteance_service, updater):
111     if mainteance_service and not updater:
112         die("--enable-updater is required to --enable-maintenance-service")
113     return mainteance_service
116 # Update agent (currently Windows and macOS only)
117 # This is an independent task that runs on a schedule to
118 # check for, download, and install updates.
119 # ==============================================================
122 @depends("--enable-backgroundtasks", "--enable-updater", build_project)
123 def update_agent_default(backgroundtasks, updater, build_project):
124     return bool(backgroundtasks) and bool(updater) and build_project == "browser"
127 option(
128     "--disable-update-agent",
129     when=target_is_windows | target_is_osx,
130     default=update_agent_default,
131     help="{Enable|Disable} building update agent",
134 set_config(
135     "MOZ_UPDATE_AGENT",
136     depends_if("--enable-update-agent", when=target_is_windows | target_is_osx)(
137         lambda _: True
138     ),
142 @depends(
143     "--enable-update-agent",
144     "--enable-backgroundtasks",
145     "--enable-updater",
146     when=target_is_windows | target_is_osx,
148 def check_update_agent(update_agent, backgroundtasks, updater):
149     if update_agent and not backgroundtasks:
150         die("--enable-backgroundtasks is required to --enable-update-agent")
151     if update_agent and not updater:
152         die("--enable-updater is required to --enable-update-agent")
153     return update_agent
156 # Enable or disable the default browser agent, which monitors the user's default
157 # browser setting on Windows.
158 # ==============================================================================
161 @depends(target, build_project)
162 def default_browser_agent_default(target, build_project):
163     return target.os == "WINNT" and build_project == "browser"
166 option(
167     "--enable-default-browser-agent",
168     default=default_browser_agent_default,
169     help="{Enable|Disable} building the default browser agent",
173 @depends("--enable-default-browser-agent", when=target_is_windows)
174 def default_agent_flag(enabled):
175     if enabled:
176         return True
179 set_config("MOZ_DEFAULT_BROWSER_AGENT", default_agent_flag)
182 # Enable or disable the notification server, which allows Windows native
183 # notifications to persist when the application is not running and relaunch as
184 # necessary.
185 # ==============================================================================
186 @depends(target, build_project)
187 def notification_server_default(target, build_project):
188     return target.os == "WINNT" and build_project in (
189         "browser",
190         "comm/mail",
191     )
194 option(
195     "--disable-notification-server",
196     when=notification_server_default,
197     help="Disable building the notification server",
200 set_config("MOZ_NOTIFICATION_SERVER", True, when="--enable-notification-server")