9999999-port1860654-suite-bustage.patch 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. # HG changeset patch
  2. # User Bill Gianopoulos <wgianopoulos@gmail.com>
  3. # Date 1722127270 0
  4. Bug 9999999 - Port bug 1860654 to suite.
  5. Bug 1860654 - Support Rust for Thunderbird development
  6. diff --git a/suite/Makefile.in b/suite/Makefile.in
  7. --- a/suite/Makefile.in
  8. +++ b/suite/Makefile.in
  9. @@ -18,8 +18,18 @@ endif
  10. # it's not right for anything else. So we correct platform.ini here.
  11. MOZ_REV=$(shell hg -R "$(topsrcdir)" parent --template="{node}" 2>/dev/null)
  12. libs:: $(DIST)/bin/platform.ini
  13. sed -e "s/^\(SourceStamp=\).*/\1$(MOZ_REV)/" $(DIST)/bin/platform.ini \
  14. > $(DIST)/bin/platform.ini~
  15. mv -f $(DIST)/bin/platform.ini~ $(DIST)/bin/platform.ini
  16. +
  17. +
  18. +vendored-rust-check:
  19. +ifdef MOZ_THUNDERBIRD_RUST
  20. + @echo "Checking vendored Rust libs"
  21. + $(PYTHON3) $(commtopsrcdir)/python/rocbuild/rocbuild/rust.py verify_vendored_dependencies
  22. +endif
  23. +
  24. +export:: vendored-rust-check
  25. +
  26. diff --git a/suite/moz.build b/suite/moz.build
  27. --- a/suite/moz.build
  28. +++ b/suite/moz.build
  29. @@ -16,16 +16,24 @@ DIRS += [
  30. "extensions",
  31. "locales",
  32. "mailnews",
  33. "modules",
  34. "themes/classic",
  35. "themes/modern",
  36. ]
  37. +if CONFIG["MOZ_THUNDERBIRD_RUST"]:
  38. + DEFINES["MOZ_THUNDERBIRD_RUST"] = 1
  39. +
  40. +if CONFIG["MOZ_OVERRIDE_GKRUST"]:
  41. + DIRS += [
  42. + "../rust",
  43. + ]
  44. +
  45. if CONFIG['MOZ_IRC']:
  46. DIRS += ['chatzilla']
  47. if CONFIG["MAKENSISU"]:
  48. DIRS += ["installer/windows"]
  49. if CONFIG["MOZ_BUNDLED_FONTS"]:
  50. DIRS += ["/browser/fonts"]
  51. diff --git a/suite/moz.configure b/suite/moz.configure
  52. --- a/suite/moz.configure
  53. +++ b/suite/moz.configure
  54. @@ -74,16 +74,38 @@ set_defconf("SEAMONKEY_VERSION", seamonk
  55. set_defconf("SEAMONKEY_VERSION_DISPLAY", seamonkey_version.version_display)
  56. # Currently not set in suite comm-central
  57. # set_defconf("MOZ_PKG_VERSION", seamonkey_version.version_package)
  58. imply_option("MOZ_PLACES", True)
  59. imply_option("MOZ_SERVICES_SYNC", False)
  60. +# Thunderbird Rust code is now the default
  61. +option("--disable-thunderbird-rust", help="Enable Rust support within Thunderbird")
  62. +
  63. +set_config("MOZ_THUNDERBIRD_RUST", True, when="--enable-thunderbird-rust")
  64. +set_define("MOZ_THUNDERBIRD_RUST", True, when="--enable-thunderbird-rust")
  65. +set_config("MOZ_OVERRIDE_GKRUST", True, when="--enable-thunderbird-rust")
  66. +
  67. +
  68. +@depends("--enable-thunderbird-rust")
  69. +def moz_override_cargo_config(enable_rust):
  70. + rust_override = "comm/rust/.cargo/config.toml.in"
  71. + if enable_rust:
  72. + log.info(f"Using {rust_override} for Rust code.")
  73. + return rust_override
  74. +
  75. +
  76. +set_config(
  77. + "MOZ_OVERRIDE_CARGO_CONFIG",
  78. + moz_override_cargo_config,
  79. + when="--enable-thunderbird-rust",
  80. +)
  81. +
  82. # Building extensions is disabled by default.
  83. # =========================================================
  84. # = ChatZilla extension
  85. # =========================================================
  86. option(
  87. "--enable-irc", default=False, help="Enable building of the ChatZilla IRC extension"
  88. )