# 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_NAME", "thunderbird") set_config("MOZ_APPUPDATE_HOST", "aus.thunderbird.net") imply_option("--enable-default-browser-agent", False) imply_option("MOZ_REQUIRE_SIGNING", False) imply_option("--enable-unverified-updates", False, when=target_is_windows & ~have_64_bit) @depends(milestone) def enable_sync(milestone): # Sync is disabled, even in Daily, until we get working servers again. # return milestone.is_nightly return False imply_option("MOZ_SERVICES_SYNC", True, when=enable_sync) set_define("MOZ_SERVICES_SYNC", True, when=enable_sync) # Add Thunderbird-specific error definitions. imply_option("MOZ_EXTRA_ERROR_DEFINITIONS", "../../comm/mail/errors.json") 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) @depends(build_environment, "--help") @imports(_from="os.path", _import="join") def commtopsrcdir(build_env, _): topsrcdir = build_env.topsrcdir return join(topsrcdir, "comm") 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", "comm/mailnews/protocols/exchange/metrics.yaml", ], ) # set_config("MOZ_GLEAN_EXTRA_PINGS_FILES", ["comm/mail/pings.yaml"]) set_config("MOZ_GLEAN_EXTRA_TAGS_FILES", ["comm/mail/tags.yaml"]) set_config( "MOZ_GLEAN_INTERESTING_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", "comm/mailnews/protocols/exchange/metrics.yaml", "modules/libpref/metrics.yaml", "parser/htmlparser/metrics.yaml", # NOTE: test_pkcs11_module.js will fail without this. # The pkcs11 runs before serverknobs can be applied. "security/manager/ssl/metrics.yaml", "toolkit/content/metrics.yaml", "toolkit/components/crashes/metrics.yaml", "toolkit/components/passwordmgr/metrics.yaml", "toolkit/components/pdfjs/metrics.yaml", # Could be useful, but fails "Sorry, Glean found some glinter nits". # "toolkit/components/startup/metrics.yaml", "toolkit/crashreporter/crashping/pings.yaml", "toolkit/mozapps/defaultagent/metrics.yaml", "toolkit/mozapps/extensions/metrics.yaml", "toolkit/mozapps/update/metrics.yaml", # NOTE: BackgroundTask_shouldprocessupdates.sys.mjs will fail without this # It doesn't consider itself to be in automation, and is also # collecting metrics too early, in XRE_mainStartup. "toolkit/mozapps/update/shared_metrics.yaml", # Could be useful, but fails "Sorry, Glean found some glinter nits". # "toolkit/profile/metrics.yaml", "toolkit/xre/metrics.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 @depends(thunderbird_official_branding) def thunderbird_official_branding_directory(thunderbird_official_branding): return f"comm/mail/branding/{thunderbird_official_branding}" # This is disabled in favor of MOZ_OFFICIAL_BRANDING_DIRECTORY being defined in # confvars.h, as MSIX repackaging does not support reading values from # moz.configure. # imply_option( # "MOZ_OFFICIAL_BRANDING_DIRECTORY", # thunderbird_official_branding_directory, # reason=thunderbird_official_branding, # ) # Override Firefox's Cargo workspace with our own. set_config("MOZ_OVERRIDE_GKRUST", True) set_config( "MOZ_OVERRIDE_CARGO_CONFIG", "comm/rust/.cargo/config.toml.in", ) # Build with (but not necessarily use) the new database. set_config("MOZ_PANORAMA", True, when=milestone.is_nightly) set_define("MOZ_PANORAMA", True, when=milestone.is_nightly) # Build with (but not necessarily use) the child-process message display. set_config("MOZ_REMOTE_READER", True, when=milestone.is_nightly) set_define("MOZ_REMOTE_READER", True, when=milestone.is_nightly) include("../../toolkit/moz.configure") # Bug 2062895: Remove when landing on m-c happens # Thunderbird Enterprise # ============================================================== option( "--enable-enterprise", default=False, help="Build with enterprise support", ) @depends("--enable-enterprise") def enable_enterprise(value): if value: return True set_config("MOZ_ENTERPRISE", enable_enterprise) set_define("MOZ_ENTERPRISE", enable_enterprise) default_enterprise_console = dependable( "FIREFOX_ENTERPRISE_GENERIC" ) option( "--with-enterprise-console-url", nargs=1, default=default_enterprise_console, help="Enterprise console address the built application points at", when=enable_enterprise, ) @depends( "--with-enterprise-console-url", default_enterprise_console, when=enable_enterprise ) def enterprise_console_url(value, default_url): # --without-enterprise-console-url or an empty value falls back to the default. url = value[0] if value and value[0] else default_url if not any( [ url.startswith("https://"), url.startswith("http://"), url == "FIREFOX_ENTERPRISE_GENERIC", ] ): die( "--with-enterprise-console-url must be a http(s):// URL, got %s", url, ) # The value is interpolated into a JS string literal in thunderbird.cfg. if any(c in url for c in '"\\\n\r'): die( "--with-enterprise-console-url must not contain quotes, backslashes or " "newlines" ) return url set_config("MOZ_ENTERPRISE_CONSOLE_URL", enterprise_console_url) # Clear the default value to avoid mozilla.com url compiled into product imply_option("--with-crashreporter-url", "", when="--enable-enterprise") # Bug 2062895: Remove when landing on m-c happens (end) @depends("--enable-enterprise", "--enable-project") def thunderbird_enterprise(enterprise, project): return enterprise and project[0] == "comm/mail" # MOZ_APP_BASENAME: Typically stays consistent for multiple branded # versions of a given application (e.g. Daily and Thunderbird both use # "Thunderbird"), but may vary for full rebrandings. Used # for application.ini's "Name" field, which controls profile location in # the absence of a "Profile" field, and various system # integration hooks (Unix remoting, Windows MessageWindow name, etc.) imply_option("MOZ_APP_BASENAME", "Thunderbird", when=~thunderbird_enterprise) # MOZ_APP_PROFILE: When set, used for application.ini's # "Profile" field, which controls profile location. imply_option("MOZ_APP_PROFILE", "Thunderbird", when=(target_is_windows | target_is_osx) & ~thunderbird_enterprise) imply_option("MOZ_APP_PROFILE", "thunderbird", when=~target_is_windows & ~target_is_osx & ~thunderbird_enterprise) imply_option("MOZ_APP_PROFILE", "ThunderbirdEnterprise", when=(target_is_windows | target_is_osx) & thunderbird_enterprise) imply_option("MOZ_APP_PROFILE", "thunderbirdenterprise", when=~target_is_windows & ~target_is_osx & thunderbird_enterprise) imply_option("--with-app-basename", "ThunderbirdEnterprise", when=thunderbird_enterprise) imply_option("--with-app-name", "thunderbird", when=thunderbird_enterprise) imply_option( "--with-branding", "comm/mail/branding/enterprise", when=thunderbird_enterprise ) imply_option("MOZ_APP_UA_NAME", "Firefox", when=thunderbird_enterprise)