diff --git a/seamonkey-GNUmakefile b/seamonkey-GNUmakefile index 8e1e9e7..324fe24 100644 --- a/seamonkey-GNUmakefile +++ b/seamonkey-GNUmakefile @@ -25,7 +25,7 @@ # make locales # # to provide all the shipped locales (will appear in a form of langpack extensions). -# If irc and/or calendar included, they will be prepared properly. +# If irc and/or calendar are built, their data will be included too. # (See below for more details about locales target). # @@ -91,18 +91,15 @@ distclean: clean # LOCALES # # +# The target `locales' creates all the needed langpacks. +# # By default, all available locales will be used. You can change it # by overriding SHIPPED_LOCALES variable on the command line. # -# The target `locales' performs all the needed work. It depends on -# `locales-all' and `repacks'. First builds all needed langpacks, -# second checks whether irc and/or calendar extensions are built -# and prepares them by required additional locales. -# -# Some internal targets might be useful too, fe. `make locale-LANG' -# to create one (or several) langpack separately. +# Additionally, you can use `make locale-LANG' to create one (or several) +# langpack separately. # -# For example, to build all with `fr' and 'it' only, use: +# For example, to build `fr' and 'it' only, use: # # make locales SHIPPED_LOCALES="fr it" # @@ -110,7 +107,7 @@ distclean: clean # # make locale-ru # -# Use `clear-locales' and `clear-repacks' for clearing. +# Use `clear-locales' for clearing. # # # NOTE! NOTE! NOTE! @@ -120,7 +117,7 @@ distclean: clean # It is better to use `-j1' explicitly (`make -j1 locales') to avoid issues. # -.PHONY: locales locales-all repacks clear-locales clear-repacks dictionaries clear-dictionaries +.PHONY: locales clear-locales dictionaries clear-dictionaries drop_extra := $(if $(or $(filter Windows_NT,$(OS)),$(filter-out Darwin,$(shell uname))),ja-JP-mac,ja) @@ -128,7 +125,7 @@ drop_extra := $(if $(or $(filter Windows_NT,$(OS)),$(filter-out Darwin,$(shell u SHIPPED_LOCALES := $(shell while read loc rest; do echo $$loc; done > $@/chrome/$*.manifest ; \ + done < $$manifest ; \ + done + + sed 's,$*/locale/$*,chrome/&,' $@/chrome/$*.manifest | sort > $@/chrome.manifest + rm -f $@/chrome/$*.manifest # Spanish locales other than es-ES are from Latam, where the es-AR langpack is most preferred - [ $* = es-AR ] && find $@ -name "*.manifest" -exec sed -i '/^locale/ s/es-AR/es-*/' {} \; || : + [ $* = es-AR ] && sed -i '/^locale/ s/es-AR/es-*/' $@/chrome.manifest || : locale-%: REL_NAME = extensions/langpack-$*@seamonkey.mozilla.org.xpi @@ -160,7 +172,7 @@ locale-%: manifest_entry = @RESPATH@/$(REL_NAME) locale-%: $(stage)-% $(PACKAGE_MANIFEST) rm -f $(DEST_NAME) - cd $<; zip -0 -D -X $(DEST_NAME) chrome.manifest install.rdf chrome/$*.manifest + cd $<; zip -0 -D -X $(DEST_NAME) chrome.manifest install.rdf cd $<; zip -g -r -9 -D -X $(DEST_NAME) chrome/$* fgrep $(manifest_entry) $(PACKAGE_MANIFEST) || echo $(manifest_entry) >>$(PACKAGE_MANIFEST) @@ -170,72 +182,11 @@ clear-locales: rm -f $(OBJDIR)/dist/bin/extensions/langpack-*@seamonkey.mozilla.org.xpi -# -# REPACKS -# - -ext_dir := $(OBJDIR)/dist/bin/extensions - -CAL_NAME = {e2fda1a4-762b-4020-b5ad-a41df1933103} -IRC_NAME = {59c81df5-4b7a-477b-912d-4e0fdf64e5f2} - -repack-$(CAL_NAME): LOCALE_PATH = $(OBJDIR)/dist/xpi-stage/locale-*/extensions/$(CAL_NAME) -repack-$(CAL_NAME): MANIFEST_FILE = chrome.manifest - -repack-$(IRC_NAME): LOCALE_PATH = $(OBJDIR)/dist/xpi-stage/chatzilla-* -repack-$(IRC_NAME): MANIFEST_FILE = chrome/chatzilla.manifest - -repack-%: tmp_dir = $(OBJDIR)/tmp-$* -repack-%: all_manifests = $(foreach loc,$(SHIPPED_LOCALES),$(subst *,$(loc),$(LOCALE_PATH)/$(MANIFEST_FILE))) - -repack-cal: repack-$(CAL_NAME) -repack-irc: repack-$(IRC_NAME) - - -define _ADD_LOCALE -while read line; \ -do \ - [ "$${line#locale}" = "$$line" ] && continue; \ - tar -C $(dir $(manifest)) -chf - $${line##* } | tar -C $(dir $(tmp_dir)/$(MANIFEST_FILE)) -xf -; \ - echo $$line >>$(tmp_dir)/$(MANIFEST_FILE); \ -done < $(manifest) - -endef # do not remove the blank line! - - -repack-%: $(ext_dir)/%.xpi $(SHIPPED_LOCALES:%=$(stage)-%) - mkdir $(tmp_dir) - cd $(tmp_dir); unzip $< - - $(foreach manifest,$(wildcard $(all_manifests)),$(_ADD_LOCALE)) - mf=$(tmp_dir)/$(MANIFEST_FILE); sort $$mf >$$mf.new && mv -f $$mf.new $$mf - - [ -f $<.orig ] && rm -f $< || mv -f $< $<.orig - cd $(tmp_dir); zip -r -9 -D -X $< . - rm -rf $(tmp_dir) - - -clear-repacks: - for ext in $(CAL_NAME) $(IRC_NAME); \ - do \ - [ -f $(ext_dir)/$$ext.xpi.orig ] && mv -f $(ext_dir)/$$ext.xpi.orig $(ext_dir)/$$ext.xpi || : ; \ - done - - -ext_deps := $(patsubst $(ext_dir)/%.xpi,repack-%,$(wildcard $(ext_dir)/$(CAL_NAME).xpi $(ext_dir)/$(IRC_NAME).xpi)) -ext_deps := $(strip $(ext_deps)) - -repacks: $(ext_deps) - - -locales: locales-all repacks - - # # Dictionaries # # It is better to use system dictionaries, specifying directory path for them -# by "spellchecker.dictionary_path" preference (or even use symlink if possible). +# by "spellchecker.dictionary_path" preference (or even use symlink when possible). # DICT_DEST := $(OBJDIR)/dist/bin/dictionaries diff --git a/seamonkey-rustc-bootstrap.patch b/seamonkey-rustc-bootstrap.patch new file mode 100644 index 0000000..18e66bd --- /dev/null +++ b/seamonkey-rustc-bootstrap.patch @@ -0,0 +1,55 @@ +# HG changeset patch +# User Mike Hommey +# Date 1613598448 0 +# Node ID b182a3466285a41aa7393af0359eeee16be1350a +# Parent 83d58b5de13b57d482f6e5e3744c98ca96b6669c +Bug 1670538 - Use an allow-list in RUSTC_BOOTSTRAP for rustc >= 1.50.0. r=firefox-build-system-reviewers,andi,sheehan,mhentges + +While we could change qcms, encoding_rs and packed_simd to not emit +RUSTC_BOOTSTRAP on newer versions of rust, like we do for gkrust-shared, +it's not worth the effort (especially for those that are vendored). + +Differential Revision: https://phabricator.services.mozilla.com/D105423 + +diff --git a/config/rules.mk b/config/rules.mk +--- a/config/rules.mk ++++ b/config/rules.mk +@@ -866,6 +866,17 @@ + endif + endif + ++ifndef RUSTC_BOOTSTRAP ++ifeq (,$(filter 1.47.% 1.48.% 1.49.%,$(RUSTC_VERSION))) ++# RUSTC_BOOTSTRAP := gkrust_shared,qcms for later ++RUSTC_BOOTSTRAP := gkrust_shared ++ifdef MOZ_RUST_SIMD ++RUSTC_BOOTSTRAP := $(RUSTC_BOOTSTRAP),encoding_rs,packed_simd ++endif ++export RUSTC_BOOTSTRAP ++endif ++endif ++ + rustflags_override = RUSTFLAGS='$(MOZ_RUST_DEFAULT_FLAGS) $(RUSTFLAGS)' + + ifdef MOZ_MSVCBITS +diff --git a/toolkit/library/rust/shared/build.rs.1670538.later b/toolkit/library/rust/shared/build.rs.1670538.later +new file mode 100644 +--- /dev/null ++++ b/toolkit/library/rust/shared/build.rs.1670538.later +@@ -0,0 +1,16 @@ ++--- build.rs +++++ build.rs ++@@ -17,12 +17,12 @@ fn main() { ++ } else if std::env::var("MOZ_AUTOMATION").is_ok() { ++ panic!("Builds on automation must use a version of rust for which we know how to hook OOM: want < {}, have {}", ++ max_oom_hook_version, ver); ++ } ++ ++ // This is a rather awful thing to do, but we're only doing it on ++ // versions of rustc that are not going to change the unstable APIs ++ // we use from under us, all being already released or beta. ++- if bootstrap { +++ if bootstrap && ver < Version::parse("1.50.0").unwrap() { ++ println!("cargo:rustc-env=RUSTC_BOOTSTRAP=1"); ++ } ++ } diff --git a/seamonkey-websocketloop.patch b/seamonkey-websocketloop.patch new file mode 100644 index 0000000..4246a20 --- /dev/null +++ b/seamonkey-websocketloop.patch @@ -0,0 +1,104 @@ +# HG changeset patch +# User Dmitry Butskoy +# Date 1619303931 -7200 +# Parent f113610c2ced0b266dbad3626b7f43580d412d15 +Bug 1633339 - Fix infinite loop when network changes and e10s is disabled. r=frg a=frg + +diff --git a/netwerk/protocol/websocket/WebSocketChannel.cpp b/netwerk/protocol/websocket/WebSocketChannel.cpp +--- a/netwerk/protocol/websocket/WebSocketChannel.cpp ++++ b/netwerk/protocol/websocket/WebSocketChannel.cpp +@@ -1265,52 +1265,54 @@ WebSocketChannel::Observe(nsISupports *s + if (!mSocketThread) { + // there has not been an asyncopen yet on the object and then we need + // no ping. + LOG(("WebSocket: early object, no ping needed")); + } else { + // Next we check mDataStarted, which we need to do on mTargetThread. + if (!IsOnTargetThread()) { + mTargetThread->Dispatch( +- NewRunnableMethod("net::WebSocketChannel::OnNetworkChanged", ++ NewRunnableMethod("net::WebSocketChannel::OnNetworkChangedTargetThread", + this, +- &WebSocketChannel::OnNetworkChanged), ++ &WebSocketChannel::OnNetworkChangedTargetThread), + NS_DISPATCH_NORMAL); + } else { +- nsresult rv = OnNetworkChanged(); ++ nsresult rv = OnNetworkChangedTargetThread(); + if (NS_FAILED(rv)) { +- LOG(("WebSocket: OnNetworkChanged failed (%08" PRIx32 ")", ++ LOG(("WebSocket: OnNetworkChangedTargetThread failed (%08" PRIx32 ")", + static_cast(rv))); + } + } + } + } + } + + return NS_OK; + } + + nsresult ++WebSocketChannel::OnNetworkChangedTargetThread() ++{ ++ LOG(("WebSocketChannel::OnNetworkChangedTargetThread() - on target thread %p", this)); ++ ++ if (!mDataStarted) { ++ LOG(("WebSocket: data not started yet, no ping needed")); ++ return NS_OK; ++ } ++ ++ return mSocketThread->Dispatch( ++ NewRunnableMethod("net::WebSocketChannel::OnNetworkChanged", ++ this, ++ &WebSocketChannel::OnNetworkChanged), ++ NS_DISPATCH_NORMAL); ++} ++ ++nsresult + WebSocketChannel::OnNetworkChanged() + { +- if (IsOnTargetThread()) { +- LOG(("WebSocketChannel::OnNetworkChanged() - on target thread %p", this)); +- +- if (!mDataStarted) { +- LOG(("WebSocket: data not started yet, no ping needed")); +- return NS_OK; +- } +- +- return mSocketThread->Dispatch( +- NewRunnableMethod("net::WebSocketChannel::OnNetworkChanged", +- this, +- &WebSocketChannel::OnNetworkChanged), +- NS_DISPATCH_NORMAL); +- } +- + MOZ_ASSERT(OnSocketThread(), "not on socket thread"); + + LOG(("WebSocketChannel::OnNetworkChanged() - on socket thread %p", this)); + + if (mPingOutstanding) { + // If there's an outstanding ping that's expected to get a pong back + // we let that do its thing. + LOG(("WebSocket: pong already pending")); +diff --git a/netwerk/protocol/websocket/WebSocketChannel.h b/netwerk/protocol/websocket/WebSocketChannel.h +--- a/netwerk/protocol/websocket/WebSocketChannel.h ++++ b/netwerk/protocol/websocket/WebSocketChannel.h +@@ -146,16 +146,17 @@ private: + + void EnqueueOutgoingMessage(nsDeque &aQueue, OutboundMessage *aMsg); + + void PrimeNewOutgoingMessage(); + void DeleteCurrentOutGoingMessage(); + void GeneratePong(uint8_t *payload, uint32_t len); + void GeneratePing(); + ++ MOZ_MUST_USE nsresult OnNetworkChangedTargetThread(); + MOZ_MUST_USE nsresult OnNetworkChanged(); + MOZ_MUST_USE nsresult StartPinging(); + + void BeginOpen(bool aCalledFromAdmissionManager); + void BeginOpenInternal(); + MOZ_MUST_USE nsresult HandleExtensions(); + MOZ_MUST_USE nsresult SetupRequest(); + MOZ_MUST_USE nsresult ApplyForAdmission(); diff --git a/seamonkey.changes b/seamonkey.changes index a4fe4bc..cf5bfc5 100644 --- a/seamonkey.changes +++ b/seamonkey.changes @@ -1,5 +1,37 @@ ------------------------------------------------------------------- -Mon Apr 27 11:54:30 UTC 2021 - Tristan Miller +Tue May 18 07:04:59 UTC 2021 - Tristan Miller + +- add patch seamonkey-rustc-bootstrap.patch adapted from + https://bugzilla.mozilla.org/show_bug.cgi?id=1710154 to enable + compilation with rust >= 1.50.0 + +------------------------------------------------------------------- +Tue May 05 18:36:24 UTC 2021 - Tristan Miller + +- update GNU Makefile from upstream + https://bugzilla.mozilla.org/show_bug.cgi?id=1692516#c8 -- besides + some general improvements, this Makefile now allows the language + packs for the bundled extensions to be split off again if desired + (though our spec file does not yet take advantage of this) + +------------------------------------------------------------------- +Tue May 04 08:19:42 UTC 2021 - Tristan Miller + +- use system libraries for bz2, webp, and icu to reduce package size + and because this is probably more secure (since our own libraries + are probably updated more often than the ones bundled with + SeaMonkey) + +------------------------------------------------------------------- +Wed Apr 28 07:59:04 UTC 2021 - Tristan Miller + +- add upstream patch seamonkey-websocketloop.patch from + https://bugzilla.mozilla.org/attachment.cgi?id=9218795&action=diff + to solve critical performance issue + https://bugzilla.mozilla.org/show_bug.cgi?id=1633339 + +------------------------------------------------------------------- +Tue Apr 27 11:54:30 UTC 2021 - Tristan Miller - requested inclusion in Leap 15.2: https://bugzilla.opensuse.org/show_bug.cgi?id=1185349 diff --git a/seamonkey.spec b/seamonkey.spec index 2d6c908..b008491 100644 --- a/seamonkey.spec +++ b/seamonkey.spec @@ -25,10 +25,18 @@ BuildRequires: dbus-1-glib-devel BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: hunspell-devel +# Using system AV1 decoder depends on pending patch from +# https://bugzilla.mozilla.org/show_bug.cgi?id=1559213 +#BuildRequires: dav1d5-devel BuildRequires: libidl-devel BuildRequires: libiw-devel BuildRequires: libnotify-devel BuildRequires: libproxy-devel +#BuildRequires: libvpx-devel # Compile errors with 1.10.0 +%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150200 && 0%{?is_opensuse} +BuildRequires: libwebp-devel >= 1.0.0 +BuildRequires: libicu-devel >= 63.1 +%endif BuildRequires: makeinfo BuildRequires: memory-constraints BuildRequires: python-devel @@ -78,6 +86,8 @@ Patch2: mozilla-language.patch Patch3: mozilla-ntlm-full-path.patch Patch4: seamonkey-lto.patch Patch5: seamonkey-man-page.patch +Patch6: seamonkey-websocketloop.patch +Patch7: seamonkey-rustc-bootstrap.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build PreReq: /bin/sh coreutils Provides: seamonkey-mail = %{version} @@ -210,6 +220,8 @@ cp %{SOURCE12} GNUmakefile %patch3 -p2 %patch4 -p2 %patch5 -p0 +%patch6 -p1 +%patch7 -p1 cat << EOF > .mozconfig mk_add_options MOZILLA_OFFICIAL=1 @@ -235,11 +247,24 @@ ac_add_options --disable-elf-hack %endif ac_add_options --disable-debug + ac_add_options --with-system-nspr ac_add_options --with-system-nss ac_add_options --with-system-zlib +ac_add_options --with-system-bz2 +%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150200 && 0%{?is_opensuse} +ac_add_options --with-system-webp +ac_add_options --with-system-icu +%endif -# Mozilla's internal JPEG library is used, probably because of the "turbo" patches +# Compile errors with system libvpx-1.10.0 +#ac_add_options --with-system-libvpx + +# Using system AV1 decoder depends on pending patch from +# https://bugzilla.mozilla.org/show_bug.cgi?id=1559213 +# ac_add_options --with-system-av1 + +# Mozilla's internal JPEG library is used because of the "turbo" patches # that make it more efficient than the stock system libjpeg: # https://bugzilla.mozilla.org/show_bug.cgi?id=573948 #ac_add_options --with-system-jpeg