2016-03-11 22:04:59 +03:00
|
|
|
# -*- 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/.
|
|
|
|
|
2020-10-30 21:28:33 +03:00
|
|
|
set_config("MOZ_THUNDERBIRD", True)
|
|
|
|
set_define("MOZ_THUNDERBIRD", True)
|
2018-01-01 01:40:15 +03:00
|
|
|
|
2020-10-30 21:28:33 +03:00
|
|
|
imply_option("MOZ_APP_BASENAME", "Thunderbird")
|
|
|
|
set_config("MOZ_APPUPDATE_HOST", "aus.thunderbird.net")
|
|
|
|
|
|
|
|
imply_option("--enable-default-browser-agent", False)
|
2021-09-04 00:22:27 +03:00
|
|
|
imply_option("MOZ_REQUIRE_SIGNING", False)
|
2022-08-08 01:25:43 +03:00
|
|
|
imply_option("MOZ_SERVICES_SYNC", True)
|
2024-06-20 12:08:11 +03:00
|
|
|
imply_option("NSS_EXTRA_SYMBOLS_FILE", "../comm/mailnews/nss-extra.symbols")
|
2020-04-24 01:55:06 +03:00
|
|
|
|
2024-06-15 03:23:01 +03:00
|
|
|
imply_option("MOZ_APP_ID", "{3550f703-e582-4d05-9a08-453d09bdfdc6}")
|
2024-06-15 03:23:01 +03:00
|
|
|
imply_option("MOZ_APP_VENDOR", "Mozilla")
|
2024-06-17 01:52:06 +03:00
|
|
|
imply_option("BROWSER_CHROME_URL", "chrome://messenger/content/extensionPopup.xhtml")
|
2024-06-17 01:52:06 +03:00
|
|
|
# Include the DevTools client, not just the server (which is the default)
|
|
|
|
imply_option("MOZ_DEVTOOLS", "all")
|
|
|
|
|
2020-08-18 23:05:28 +03:00
|
|
|
|
2022-11-25 02:47:46 +03:00
|
|
|
@depends(target_is_windows, target_has_linux_kernel)
|
2018-10-10 21:36:41 +03:00
|
|
|
def bundled_fonts(is_windows, is_linux):
|
|
|
|
if is_windows or is_linux:
|
|
|
|
return True
|
2018-01-01 01:37:40 +03:00
|
|
|
|
2018-10-10 21:36:41 +03:00
|
|
|
|
2020-10-30 21:28:33 +03:00
|
|
|
set_config("MOZ_BUNDLED_FONTS", bundled_fonts)
|
|
|
|
add_old_configure_assignment("MOZ_BUNDLED_FONTS", bundled_fonts)
|
|
|
|
|
|
|
|
|
2021-12-24 13:49:27 +03:00
|
|
|
@depends(build_environment, "--help")
|
2023-02-15 22:52:11 +03:00
|
|
|
@imports(_from="os.path", _import="join")
|
|
|
|
def commtopsrcdir(build_env, _):
|
2018-10-10 21:36:41 +03:00
|
|
|
topsrcdir = build_env.topsrcdir
|
2023-02-15 22:52:11 +03:00
|
|
|
return join(topsrcdir, "comm")
|
2018-10-10 21:36:41 +03:00
|
|
|
|
2020-10-30 21:28:33 +03:00
|
|
|
|
2023-02-15 22:52:11 +03:00
|
|
|
add_old_configure_assignment("commtopsrcdir", commtopsrcdir)
|
|
|
|
set_config("commtopsrcdir", commtopsrcdir)
|
2017-11-18 20:24:42 +03:00
|
|
|
|
2017-10-17 22:33:35 +03:00
|
|
|
|
2020-10-30 21:28:33 +03:00
|
|
|
imply_option("MOZ_PLACES", True)
|
|
|
|
imply_option("MOZ_SERVICES_HEALTHREPORT", True)
|
|
|
|
imply_option("MOZ_DEDICATED_PROFILES", True)
|
|
|
|
imply_option("MOZ_BLOCK_PROFILE_DOWNGRADE", True)
|
2024-06-17 01:52:07 +03:00
|
|
|
imply_option("MOZ_PROFILE_MIGRATOR", True)
|
2017-11-18 20:24:42 +03:00
|
|
|
|
2022-11-25 02:47:46 +03:00
|
|
|
with only_when(target_has_linux_kernel & compile_environment):
|
2020-10-30 21:28:33 +03:00
|
|
|
option(env="MOZ_NO_PIE_COMPAT", help="Enable non-PIE wrapper")
|
2019-04-19 20:11:50 +03:00
|
|
|
|
2020-10-30 21:28:33 +03:00
|
|
|
set_config("MOZ_NO_PIE_COMPAT", depends_if("MOZ_NO_PIE_COMPAT")(lambda _: True))
|
2019-04-19 20:11:50 +03:00
|
|
|
|
2020-01-24 01:20:44 +03:00
|
|
|
|
2024-07-31 01:58:13 +03:00
|
|
|
@depends("MOZ_AUTOMATION", target)
|
2020-10-30 21:28:33 +03:00
|
|
|
@imports(_from="os", _import="environ")
|
2024-07-31 01:58:13 +03:00
|
|
|
def pkg_libotr(automation, target):
|
|
|
|
if target.os == "WINNT" and target.cpu == "aarch64":
|
|
|
|
return
|
2020-01-24 01:20:44 +03:00
|
|
|
if automation:
|
2020-10-30 21:28:33 +03:00
|
|
|
fetch_dir = environ.get("MOZ_FETCHES_DIR", None)
|
2020-01-24 01:20:44 +03:00
|
|
|
if fetch_dir:
|
2020-10-30 21:28:33 +03:00
|
|
|
log.info("Including libotr from {}".format(fetch_dir))
|
2022-05-02 13:30:35 +03:00
|
|
|
return fetch_dir
|
2020-01-24 01:20:44 +03:00
|
|
|
|
2020-10-30 21:28:33 +03:00
|
|
|
log.info("TB_LIBOTR_PREBUILT is set, but MOZ_FETCHES_DIR is invalid.")
|
|
|
|
|
2020-01-24 01:20:44 +03:00
|
|
|
|
2020-10-30 21:28:33 +03:00
|
|
|
set_config("TB_LIBOTR_PREBUILT", pkg_libotr)
|
2020-01-24 01:20:44 +03:00
|
|
|
|
2024-07-20 13:38:18 +03:00
|
|
|
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/calendar/metrics.yaml",
|
|
|
|
],
|
|
|
|
)
|
2024-06-19 10:18:01 +03:00
|
|
|
# set_config("MOZ_GLEAN_EXTRA_PINGS_FILES", ["comm/mail/pings.yaml"])
|
|
|
|
set_config("MOZ_GLEAN_EXTRA_TAGS_FILES", ["comm/mail/tags.yaml"])
|
|
|
|
|
2020-10-30 21:28:33 +03:00
|
|
|
include("../build/moz.configure/gecko_source.configure")
|
Bug 1507754 - Check source repositories and changesets during configure. r=darktrojan
PACKAGERS: if you update application.ini, platform.ini, or source-repo.h
in some way during your process, you might need to change something.
Make sure that the source repositories for both Mozilla and Comm can be found
during mach configure and abort if they cannot.
For Taskcluster builds, there are various environment variables that can be
relied upon.
Local builds present a challenge. Chances are those variables are not set.
I came up with a set of checks and keep trying until something works.
For comm-* code:
- Look for MOZ_SOURCE_REPO and MOZ_SOURCE_CHANGESET environment vars. This
is counter-intuitive, but it's the current status-quo for Taskcluster
builds. Those variables are set to the comm values.
- Next, try use the Mercurial source checkout itself. Uses the same technique
as Mozilla code does in build/variables.py.
- Last, try to use a file named "sourcestamp.txt". That file is part of
our source tar files that get built for releases.
- Finally, if those MOZ_SOURCE environment variables were not set, set them.
This is needed because old-configure will look for them and set buildconfig
variables with them when it runs later during the configure process.
- Additionally, set MOZ_COMM_SOURCE_REPO and MOZ_COMM_SOURCE_CHANGESET in
buildconfig. Code in the comm- tree should prefer those values over the
generic MOZ_SOURCE_* values that the Mozilla code will look at.
For the Gecko/Mozilla source repository information, it's almost the same
process.
- Check for GECKO_SOURCE_REPO and GECKO_SOURCE_REV environment variables first.
Taskcluster sets these based on comm/.gecko_rev.yml.
- Next, try comm/.gecko_rev.yml itself. PyYAML is not required as the file is
pretty simple to parse. Release builds are pinned to a specific revision hash,
so we can use that. Builds from comm-central pin to "default" though, so
next try running "hg id" in $topsrcdir to get the revision hash.
- If for some reason there's no .gecko_rev.yml and it's not a Mercurial checkout,
try the sourcestamp.txt file.
- Set MOZ_GECKO_SOURCE_REPO and MOZ_GECKO_SOURCE_CHANGESET in buildconfig.
mach configure should fail if any one of those values cannot be determined.
The error message will suggest setting the environment variables; ideally
that is not necessary.
--HG--
extra : rebase_source : 0f17f25956c679f63b775b15d5a0f0726bb659cb
2019-08-27 04:20:54 +03:00
|
|
|
|
2020-10-30 21:28:33 +03:00
|
|
|
include("../mailnews/moz.configure")
|
2019-09-14 01:52:41 +03:00
|
|
|
|
2020-10-30 21:28:33 +03:00
|
|
|
imply_option("--enable-app-system-headers", True)
|
2023-10-23 16:34:38 +03:00
|
|
|
|
|
|
|
|
|
|
|
@depends(milestone, update_channel)
|
|
|
|
@imports("re")
|
|
|
|
def thunderbird_official_branding(milestone, update_channel):
|
|
|
|
rv = "nightly"
|
2024-07-20 13:38:18 +03:00
|
|
|
if update_channel in (
|
|
|
|
"release",
|
|
|
|
"esr",
|
|
|
|
): # No separate "esr" branding, use same as release
|
2023-10-23 16:34:38 +03:00
|
|
|
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)
|
2023-12-05 00:55:52 +03:00
|
|
|
if m: # Alpha or beta, alpha will fall back to nightly
|
2023-10-23 16:34:38 +03:00
|
|
|
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)
|
|
|
|
|
2024-05-30 17:52:04 +03:00
|
|
|
# Thunderbird Rust code is now the default
|
|
|
|
option("--disable-thunderbird-rust", help="Enable Rust support within Thunderbird")
|
|
|
|
|
2024-01-02 21:22:46 +03:00
|
|
|
set_config("MOZ_THUNDERBIRD_RUST", True, when="--enable-thunderbird-rust")
|
2024-03-27 00:42:55 +03:00
|
|
|
set_define("MOZ_THUNDERBIRD_RUST", True, when="--enable-thunderbird-rust")
|
2023-12-01 15:15:13 +03:00
|
|
|
set_config("MOZ_OVERRIDE_GKRUST", True, when="--enable-thunderbird-rust")
|
2024-05-30 17:52:04 +03:00
|
|
|
|
|
|
|
|
|
|
|
@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
|
|
|
|
|
|
|
|
|
2023-12-01 15:15:13 +03:00
|
|
|
set_config(
|
2024-07-20 13:38:18 +03:00
|
|
|
"MOZ_OVERRIDE_CARGO_CONFIG",
|
|
|
|
moz_override_cargo_config,
|
|
|
|
when="--enable-thunderbird-rust",
|
2023-12-01 15:15:13 +03:00
|
|
|
)
|
2023-10-23 16:34:38 +03:00
|
|
|
|
2020-10-30 21:28:33 +03:00
|
|
|
include("../../toolkit/moz.configure")
|