Revision control

Copy as Markdown

Other Tools

# -*- Mode: python; c-basic-offset: 4; 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/.
set_config("MOZ_THUNDERBIRD", True)
set_define("MOZ_THUNDERBIRD", True)
imply_option("MOZ_APP_BASENAME", "Thunderbird")
set_config("MOZ_APPUPDATE_HOST", "aus.thunderbird.net")
imply_option("--enable-default-browser-agent", False)
imply_option("MOZ_REQUIRE_SIGNING", False)
@depends(milestone)
def enable_sync(milestone):
return milestone.is_nightly
imply_option("MOZ_SERVICES_SYNC", True, when=enable_sync)
imply_option("NSS_EXTRA_SYMBOLS_FILE", "../comm/mailnews/nss-extra.symbols")
imply_option("MOZ_APP_ID", "{3550f703-e582-4d05-9a08-453d09bdfdc6}")
imply_option("MOZ_APP_VENDOR", "Mozilla")
imply_option("BROWSER_CHROME_URL", "chrome://messenger/content/extensionPopup.xhtml")
# Include the DevTools client, not just the server (which is the default)
imply_option("MOZ_DEVTOOLS", "all")
@depends(target_is_windows, target_has_linux_kernel)
def bundled_fonts(is_windows, is_linux):
if is_windows or is_linux:
return True
set_config("MOZ_BUNDLED_FONTS", bundled_fonts)
add_old_configure_assignment("MOZ_BUNDLED_FONTS", bundled_fonts)
@depends(build_environment, "--help")
@imports(_from="os.path", _import="join")
def commtopsrcdir(build_env, _):
topsrcdir = build_env.topsrcdir
return join(topsrcdir, "comm")
add_old_configure_assignment("commtopsrcdir", commtopsrcdir)
set_config("commtopsrcdir", commtopsrcdir)
imply_option("MOZ_PLACES", True)
imply_option("MOZ_SERVICES_HEALTHREPORT", True)
imply_option("MOZ_DEDICATED_PROFILES", True)
imply_option("MOZ_BLOCK_PROFILE_DOWNGRADE", True)
imply_option("MOZ_PROFILE_MIGRATOR", True)
with only_when(target_has_linux_kernel & compile_environment):
option(env="MOZ_NO_PIE_COMPAT", help="Enable non-PIE wrapper")
set_config("MOZ_NO_PIE_COMPAT", depends_if("MOZ_NO_PIE_COMPAT")(lambda _: True))
@depends("MOZ_AUTOMATION", target)
@imports(_from="os", _import="environ")
def pkg_libotr(automation, target):
if target.os == "WINNT" and target.cpu == "aarch64":
return
if automation:
fetch_dir = environ.get("MOZ_FETCHES_DIR", None)
if fetch_dir:
log.info("Including libotr from {}".format(fetch_dir))
return fetch_dir
log.info("TB_LIBOTR_PREBUILT is set, but MOZ_FETCHES_DIR is invalid.")
set_config("TB_LIBOTR_PREBUILT", pkg_libotr)
set_config(
"MOZ_GLEAN_EXTRA_METRICS_FILES",
[
"comm/mail/metrics.yaml",
"comm/mail/components/addrbook/metrics.yaml",
"comm/mail/components/cloudfile/metrics.yaml",
"comm/mail/components/compose/metrics.yaml",
"comm/mail/components/inappnotifications/metrics.yaml",
"comm/calendar/metrics.yaml",
],
)
# set_config("MOZ_GLEAN_EXTRA_PINGS_FILES", ["comm/mail/pings.yaml"])
set_config("MOZ_GLEAN_EXTRA_TAGS_FILES", ["comm/mail/tags.yaml"])
include("../build/moz.configure/gecko_source.configure")
include("../mailnews/moz.configure")
imply_option("--enable-app-system-headers", True)
@depends(milestone, update_channel)
@imports("re")
def thunderbird_official_branding(milestone, update_channel):
rv = "nightly"
if update_channel in (
"release",
"esr",
): # No separate "esr" branding, use same as release
rv = "thunderbird"
elif update_channel == "beta":
rv = "tb_beta"
elif update_channel == "default": # For distros that want official branding but updates
version_display = milestone.app_version_display
m = re.search(r"([ab])\d+", version_display)
if m: # Alpha or beta, alpha will fall back to nightly
if m.group(1) == "b":
rv = "tb_beta"
else: # Release
rv = "thunderbird"
log.info(f"Thunderbird official branding set to '{rv}'.")
return rv
set_config("THUNDERBIRD_OFFICIAL_BRANDING", thunderbird_official_branding)
add_old_configure_assignment("THUNDERBIRD_OFFICIAL_BRANDING", thunderbird_official_branding)
# Thunderbird Rust code is now the default
option("--disable-thunderbird-rust", help="Enable Rust support within Thunderbird")
set_config("MOZ_THUNDERBIRD_RUST", True, when="--enable-thunderbird-rust")
set_define("MOZ_THUNDERBIRD_RUST", True, when="--enable-thunderbird-rust")
set_config("MOZ_OVERRIDE_GKRUST", True, when="--enable-thunderbird-rust")
@depends("--enable-thunderbird-rust")
def moz_override_cargo_config(enable_rust):
rust_override = "comm/rust/.cargo/config.toml.in"
if enable_rust:
log.info(f"Using {rust_override} for Rust code.")
return rust_override
set_config(
"MOZ_OVERRIDE_CARGO_CONFIG",
moz_override_cargo_config,
when="--enable-thunderbird-rust",
)
include("../../toolkit/moz.configure")