releases-comm-central/mail/moz.configure

127 строки
4.4 KiB
Plaintext
Исходник Обычный вид История

# -*- 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)
imply_option("MOZ_SERVICES_SYNC", True)
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")
@imports(_from="os", _import="environ")
def pkg_libotr(automation):
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"])
# 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")
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
include("../mailnews/moz.configure")
imply_option("--enable-app-system-headers", True)
Bug 1845794 - Create a "beta" branding directory. r=dandarnell#!thunderbird-build-system-reviewers,#thunderbird-reviewers This patch covers the non-image assets for "tb_beta" branding. Differential Revision: https://phabricator.services.mozilla.com/D186655 --HG-- rename : mail/branding/thunderbird/pref/thunderbird-branding.js => mail/branding/include/release-prefs.js rename : mail/branding/thunderbird/LICENSE => mail/branding/tb_beta/LICENSE rename : mail/branding/thunderbird/branding.nsi => mail/branding/tb_beta/branding.nsi rename : mail/branding/thunderbird/configure.sh => mail/branding/tb_beta/configure.sh rename : mail/branding/thunderbird/jar.mn => mail/branding/tb_beta/jar.mn rename : mail/branding/thunderbird/locales/Makefile.in => mail/branding/tb_beta/locales/Makefile.in rename : mail/branding/thunderbird/locales/en-US/brand.dtd => mail/branding/tb_beta/locales/en-US/brand.dtd rename : mail/branding/thunderbird/locales/en-US/brand.ftl => mail/branding/tb_beta/locales/en-US/brand.ftl rename : mail/branding/thunderbird/locales/en-US/brand.properties => mail/branding/tb_beta/locales/en-US/brand.properties rename : mail/branding/thunderbird/locales/jar.mn => mail/branding/tb_beta/locales/jar.mn rename : mail/branding/thunderbird/locales/moz.build => mail/branding/tb_beta/locales/moz.build rename : mail/branding/thunderbird/moz.build => mail/branding/tb_beta/moz.build rename : mail/branding/thunderbird/pref/thunderbird-branding.js => mail/branding/tb_beta/pref/thunderbird-branding.js rename : mail/branding/thunderbird/thunderbird.VisualElementsManifest.xml => mail/branding/tb_beta/thunderbird.VisualElementsManifest.xml extra : moz-landing-system : lando
2023-10-23 16:34:38 +03:00
@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
Bug 1845794 - Create a "beta" branding directory. r=dandarnell#!thunderbird-build-system-reviewers,#thunderbird-reviewers This patch covers the non-image assets for "tb_beta" branding. Differential Revision: https://phabricator.services.mozilla.com/D186655 --HG-- rename : mail/branding/thunderbird/pref/thunderbird-branding.js => mail/branding/include/release-prefs.js rename : mail/branding/thunderbird/LICENSE => mail/branding/tb_beta/LICENSE rename : mail/branding/thunderbird/branding.nsi => mail/branding/tb_beta/branding.nsi rename : mail/branding/thunderbird/configure.sh => mail/branding/tb_beta/configure.sh rename : mail/branding/thunderbird/jar.mn => mail/branding/tb_beta/jar.mn rename : mail/branding/thunderbird/locales/Makefile.in => mail/branding/tb_beta/locales/Makefile.in rename : mail/branding/thunderbird/locales/en-US/brand.dtd => mail/branding/tb_beta/locales/en-US/brand.dtd rename : mail/branding/thunderbird/locales/en-US/brand.ftl => mail/branding/tb_beta/locales/en-US/brand.ftl rename : mail/branding/thunderbird/locales/en-US/brand.properties => mail/branding/tb_beta/locales/en-US/brand.properties rename : mail/branding/thunderbird/locales/jar.mn => mail/branding/tb_beta/locales/jar.mn rename : mail/branding/thunderbird/locales/moz.build => mail/branding/tb_beta/locales/moz.build rename : mail/branding/thunderbird/moz.build => mail/branding/tb_beta/moz.build rename : mail/branding/thunderbird/pref/thunderbird-branding.js => mail/branding/tb_beta/pref/thunderbird-branding.js rename : mail/branding/thunderbird/thunderbird.VisualElementsManifest.xml => mail/branding/tb_beta/thunderbird.VisualElementsManifest.xml extra : moz-landing-system : lando
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)
if m: # Alpha or beta, alpha will fall back to nightly
Bug 1845794 - Create a "beta" branding directory. r=dandarnell#!thunderbird-build-system-reviewers,#thunderbird-reviewers This patch covers the non-image assets for "tb_beta" branding. Differential Revision: https://phabricator.services.mozilla.com/D186655 --HG-- rename : mail/branding/thunderbird/pref/thunderbird-branding.js => mail/branding/include/release-prefs.js rename : mail/branding/thunderbird/LICENSE => mail/branding/tb_beta/LICENSE rename : mail/branding/thunderbird/branding.nsi => mail/branding/tb_beta/branding.nsi rename : mail/branding/thunderbird/configure.sh => mail/branding/tb_beta/configure.sh rename : mail/branding/thunderbird/jar.mn => mail/branding/tb_beta/jar.mn rename : mail/branding/thunderbird/locales/Makefile.in => mail/branding/tb_beta/locales/Makefile.in rename : mail/branding/thunderbird/locales/en-US/brand.dtd => mail/branding/tb_beta/locales/en-US/brand.dtd rename : mail/branding/thunderbird/locales/en-US/brand.ftl => mail/branding/tb_beta/locales/en-US/brand.ftl rename : mail/branding/thunderbird/locales/en-US/brand.properties => mail/branding/tb_beta/locales/en-US/brand.properties rename : mail/branding/thunderbird/locales/jar.mn => mail/branding/tb_beta/locales/jar.mn rename : mail/branding/thunderbird/locales/moz.build => mail/branding/tb_beta/locales/moz.build rename : mail/branding/thunderbird/moz.build => mail/branding/tb_beta/moz.build rename : mail/branding/thunderbird/pref/thunderbird-branding.js => mail/branding/tb_beta/pref/thunderbird-branding.js rename : mail/branding/thunderbird/thunderbird.VisualElementsManifest.xml => mail/branding/tb_beta/thunderbird.VisualElementsManifest.xml extra : moz-landing-system : lando
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)
# 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"
)
Bug 1845794 - Create a "beta" branding directory. r=dandarnell#!thunderbird-build-system-reviewers,#thunderbird-reviewers This patch covers the non-image assets for "tb_beta" branding. Differential Revision: https://phabricator.services.mozilla.com/D186655 --HG-- rename : mail/branding/thunderbird/pref/thunderbird-branding.js => mail/branding/include/release-prefs.js rename : mail/branding/thunderbird/LICENSE => mail/branding/tb_beta/LICENSE rename : mail/branding/thunderbird/branding.nsi => mail/branding/tb_beta/branding.nsi rename : mail/branding/thunderbird/configure.sh => mail/branding/tb_beta/configure.sh rename : mail/branding/thunderbird/jar.mn => mail/branding/tb_beta/jar.mn rename : mail/branding/thunderbird/locales/Makefile.in => mail/branding/tb_beta/locales/Makefile.in rename : mail/branding/thunderbird/locales/en-US/brand.dtd => mail/branding/tb_beta/locales/en-US/brand.dtd rename : mail/branding/thunderbird/locales/en-US/brand.ftl => mail/branding/tb_beta/locales/en-US/brand.ftl rename : mail/branding/thunderbird/locales/en-US/brand.properties => mail/branding/tb_beta/locales/en-US/brand.properties rename : mail/branding/thunderbird/locales/jar.mn => mail/branding/tb_beta/locales/jar.mn rename : mail/branding/thunderbird/locales/moz.build => mail/branding/tb_beta/locales/moz.build rename : mail/branding/thunderbird/moz.build => mail/branding/tb_beta/moz.build rename : mail/branding/thunderbird/pref/thunderbird-branding.js => mail/branding/tb_beta/pref/thunderbird-branding.js rename : mail/branding/thunderbird/thunderbird.VisualElementsManifest.xml => mail/branding/tb_beta/thunderbird.VisualElementsManifest.xml extra : moz-landing-system : lando
2023-10-23 16:34:38 +03:00
include("../../toolkit/moz.configure")