From 7a39d563510701275472b1656b92eed590a040d5 Mon Sep 17 00:00:00 2001 From: ohfp <1813007-ohfp@users.noreply.gitlab.com> Date: Wed, 24 Mar 2021 10:59:27 +0100 Subject: [PATCH] v87.0-1 --- .../armhf-reduce-linker-memory-use.patch | 23 +- deb_patches/build-with-libstdc++-7.patch | 10 +- deb_patches/python3-remove-fstrings.patch | 2 +- scripts/3_Configure_Source_Code.sh | 3 + scripts/4_Build_Binary_Tarball.sh | 2 +- scripts/5_Configure_Binary_Tarball.sh | 2 +- unity-menubar.patch | 213 +++++++++++++----- 7 files changed, 177 insertions(+), 78 deletions(-) diff --git a/deb_patches/armhf-reduce-linker-memory-use.patch b/deb_patches/armhf-reduce-linker-memory-use.patch index 24b3a35..3baaecb 100644 --- a/deb_patches/armhf-reduce-linker-memory-use.patch +++ b/deb_patches/armhf-reduce-linker-memory-use.patch @@ -5,23 +5,24 @@ Author: Olivier Tilloy --- a/build/moz.configure/toolchain.configure +++ b/build/moz.configure/toolchain.configure -@@ -2056,15 +2056,16 @@ def select_linker(linker, c_compiler, de +@@ -2418,8 +2418,8 @@ set_config("LINKER_KIND", select_linker.KIND) --@depends_if(select_linker, macos_sdk) --def linker_ldflags(linker, macos_sdk): -+@depends_if(select_linker, macos_sdk, host) -+def linker_ldflags(linker, macos_sdk, host): +-@depends_if(select_linker, macos_sdk, sysroot_path, multiarch_dir) +-def linker_ldflags(linker, macos_sdk, sysroot_path, multiarch_dir): ++@depends_if(select_linker, macos_sdk, sysroot_path, multiarch_dir, host) ++def linker_ldflags(linker, macos_sdk, sysroot_path, multiarch_dir, host): flags = list((linker and linker.LINKER_FLAG) or []) if macos_sdk: if linker and linker.KIND == "ld64": - flags.append("-Wl,-syslibroot,%s" % macos_sdk) +@@ -2427,6 +2427,9 @@ else: flags.append("-Wl,--sysroot=%s" % macos_sdk) -- -+ elif host.cpu == "arm": + ++ if host.cpu == "arm": + flags.append("-Wl,--no-keep-memory") - return flags - - ++ + if sysroot_path and multiarch_dir: + # Non-Debian-patched binutils linkers (both BFD and gold) don't lookup + # in multi-arch directories. diff --git a/deb_patches/build-with-libstdc++-7.patch b/deb_patches/build-with-libstdc++-7.patch index fbd1531..5e8ea58 100644 --- a/deb_patches/build-with-libstdc++-7.patch +++ b/deb_patches/build-with-libstdc++-7.patch @@ -24,13 +24,13 @@ Bug-Ubuntu: https://launchpad.net/bugs/1856861 def preprocess_option(compiler): # The uses of PREPROCESS_OPTION depend on the spacing for -o/-Fi. @@ -2137,6 +2142,7 @@ def linker_ldflags(linker, macos_sdk, ho - flags.append("-Wl,--sysroot=%s" % macos_sdk) - elif host.cpu == "arm": + if host.cpu == "arm": flags.append("-Wl,--no-keep-memory") + + flags.append("-static-libstdc++") - return flags - - + if sysroot_path and multiarch_dir: + # Non-Debian-patched binutils linkers (both BFD and gold) don't lookup + # in multi-arch directories. --- a/servo/components/style/build_gecko.rs +++ b/servo/components/style/build_gecko.rs @@ -149,6 +149,8 @@ impl BuilderExt for Builder { diff --git a/deb_patches/python3-remove-fstrings.patch b/deb_patches/python3-remove-fstrings.patch index bf6d6f1..7ef3694 100644 --- a/deb_patches/python3-remove-fstrings.patch +++ b/deb_patches/python3-remove-fstrings.patch @@ -418,7 +418,7 @@ Author: Olivier Tilloy + return "{}.{}".format(category, util.camelize(metric_name)) - def type_name(type): + def type_name(obj): --- a/toolkit/components/glean/build_scripts/glean_parser_ext/rust.py Tue Nov 17 21:27:44 2020 +0000 +++ b/toolkit/components/glean/build_scripts/glean_parser_ext/rust.py Wed Nov 18 10:51:04 2020 +0100 @@ -175,7 +175,7 @@ diff --git a/scripts/3_Configure_Source_Code.sh b/scripts/3_Configure_Source_Code.sh index 27611eb..a1e9430 100755 --- a/scripts/3_Configure_Source_Code.sh +++ b/scripts/3_Configure_Source_Code.sh @@ -133,6 +133,9 @@ patch -p1 -i ${CI_PROJECT_DIR}/remove_addons.patch # Adapted from https://github.com/WesleyBranton/userChrome.css-Customizations patch -p1 -i ${CI_PROJECT_DIR}/megabar.patch +# remove mozilla vpn ads +patch -p1 -i ${CI_PROJECT_DIR}/mozilla-vpn-ad.patch + # Debian patch to enable global menubar if [[ ! -z "${GLOBAL_MENUBAR}" ]];then patch -p1 -i ${CI_PROJECT_DIR}/unity-menubar.patch diff --git a/scripts/4_Build_Binary_Tarball.sh b/scripts/4_Build_Binary_Tarball.sh index 105e6b6..f284f37 100755 --- a/scripts/4_Build_Binary_Tarball.sh +++ b/scripts/4_Build_Binary_Tarball.sh @@ -66,7 +66,7 @@ rm -f mozconfig # source /root/.cargo/env # install cbindgen -cargo install --version 0.17.0 cbindgen +cargo install --version 0.18.0 cbindgen if [[ $CARCH == 'aarch64' ]]; then diff --git a/scripts/5_Configure_Binary_Tarball.sh b/scripts/5_Configure_Binary_Tarball.sh index 646c4ef..023cea2 100755 --- a/scripts/5_Configure_Binary_Tarball.sh +++ b/scripts/5_Configure_Binary_Tarball.sh @@ -11,7 +11,7 @@ LAUNCHER_SCRIPT=$3; CI_PROJECT_DIR=${CI_PROJECT_DIR:-$(realpath $(dirname $0)/../)} _SCRIPT_FOLDER=$(realpath $(dirname $0)); _EXTRACTED_TARBALL_FOLDER=$_SCRIPT_FOLDER/librewolf; -_SETTINGS_COMMIT=2c49a15866dbfd235c988925d5fc26485b65edc1 +_SETTINGS_COMMIT=241e6f4d73e6f2de37537cf4473612ae9f8ad81e _SETTINGS_REPO='https://gitlab.com/librewolf-community/settings.git'; # Extracts the binary tarball diff --git a/unity-menubar.patch b/unity-menubar.patch index 7e6104b..5833857 100644 --- a/unity-menubar.patch +++ b/unity-menubar.patch @@ -14,7 +14,7 @@ --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js -@@ -6274,11 +6274,18 @@ function onViewToolbarsPopupShowing(aEve +@@ -6231,11 +6231,18 @@ function onViewToolbarsPopupShowing(aEve MozXULElement.insertFTLIfNeeded("browser/toolbarContextMenu.ftl"); let firstMenuItem = aInsertPoint || popup.firstElementChild; let toolbarNodes = gNavToolbox.querySelectorAll("toolbar"); @@ -98,7 +98,7 @@ "components.conf", --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js -@@ -312,6 +312,9 @@ pref("dom.mouseevent.click.hack.use_lega +@@ -305,6 +305,9 @@ pref("dom.mouseevent.click.hack.use_lega // Fastback caching - if this pref is negative, then we calculate the number // of content viewers to cache based on the amount of available memory. pref("browser.sessionhistory.max_total_viewers", -1); @@ -110,7 +110,7 @@ --- a/toolkit/content/xul.css +++ b/toolkit/content/xul.css -@@ -216,6 +216,13 @@ toolbar[type="menubar"] { +@@ -221,6 +221,13 @@ toolbar[type="menubar"] { } %endif @@ -126,7 +126,24 @@ } --- a/widget/gtk/moz.build +++ b/widget/gtk/moz.build -@@ -59,6 +59,15 @@ UNIFIED_SOURCES += [ +@@ -33,11 +33,16 @@ EXPORTS += [ + + EXPORTS.mozilla += ["WidgetUtilsGtk.h"] + ++EXPORTS.mozilla.widget += [ ++ "NativeMenuSupport.h", ++] ++ + UNIFIED_SOURCES += [ + "IMContextWrapper.cpp", + "MozContainer.cpp", + "MPRISServiceHandler.cpp", + "NativeKeyBindings.cpp", ++ "NativeMenuSupport.cpp", + "nsAppShell.cpp", + "nsBidiKeyboard.cpp", + "nsColorPicker.cpp", +@@ -59,6 +64,15 @@ UNIFIED_SOURCES += [ SOURCES += [ "MediaKeysEventSourceFactory.cpp", @@ -142,7 +159,7 @@ "nsWindow.cpp", # conflicts with X11 headers "WaylandVsyncSource.cpp", # conflicts with X11 headers ] -@@ -139,6 +148,7 @@ LOCAL_INCLUDES += [ +@@ -139,6 +153,7 @@ LOCAL_INCLUDES += [ "/layout/base", "/layout/forms", "/layout/generic", @@ -3204,7 +3221,7 @@ + } + + const nsStyleList *list = aComputedStyle->StyleList(); -+ imageRequest = list->GetListStyleImage(); ++ imageRequest = list->mListStyleImage.GetImageRequest(); + if (imageRequest) { + imageRequest->GetURI(getter_AddRefs(uri)); + auto& rect = list->mImageRegion.AsRect(); @@ -4476,7 +4493,7 @@ +#endif /* __nsNativeMenuDocListener_h__ */ --- /dev/null +++ b/widget/gtk/nsNativeMenuService.cpp -@@ -0,0 +1,504 @@ +@@ -0,0 +1,478 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* vim:expandtab:shiftwidth=4:tabstop=4: + */ @@ -4514,32 +4531,6 @@ +extern PangoLayout* gPangoLayout; +extern nsNativeMenuDocListenerTArray* gPendingListeners; + -+#if not GLIB_CHECK_VERSION(2,26,0) -+enum GBusType { -+ G_BUS_TYPE_STARTER = -1, -+ G_BUS_TYPE_NONE = 0, -+ G_BUS_TYPE_SYSTEM = 1, -+ G_BUS_TYPE_SESSION = 2 -+}; -+ -+enum GDBusProxyFlags { -+ G_DBUS_PROXY_FLAGS_NONE = 0, -+ G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES = 1 << 0, -+ G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS = 1 << 1, -+ G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START = 1 << 2, -+ G_DBUS_PROXY_FLAGS_GET_INVALIDATED_PROPERTIES = 1 << 3 -+}; -+ -+enum GDBusCallFlags { -+ G_DBUS_CALL_FLAGS_NONE = 0, -+ G_DBUS_CALL_FLAGS_NO_AUTO_START = 1 << 0 -+}; -+ -+typedef _GDBusInterfaceInfo GDBusInterfaceInfo; -+typedef _GDBusProxy GDBusProxy; -+typedef _GVariant GVariant; -+#endif -+ +#undef g_dbus_proxy_new_for_bus +#undef g_dbus_proxy_new_for_bus_finish +#undef g_dbus_proxy_call @@ -4983,7 +4974,7 @@ +} --- /dev/null +++ b/widget/gtk/nsNativeMenuService.h -@@ -0,0 +1,84 @@ +@@ -0,0 +1,85 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* vim:expandtab:shiftwidth=4:tabstop=4: + */ @@ -5007,8 +4998,9 @@ +class nsMenuBar; + +/* -+ * The main native menu service singleton. nsWebShellWindow calls in to this when -+ * a new top level window is created. ++ * The main native menu service singleton. ++ * NativeMenuSupport::CreateNativeMenuBar calls in to this when a new top level ++ * window is created. + * + * Menubars are owned by their nsWindow. This service holds a weak reference to + * each menubar for the purpose of re-registering them with the shell if it @@ -5070,7 +5062,7 @@ +#endif /* __nsNativeMenuService_h__ */ --- a/widget/gtk/nsWindow.cpp +++ b/widget/gtk/nsWindow.cpp -@@ -6148,6 +6148,10 @@ void nsWindow::HideWindowChrome(bool aSh +@@ -6386,6 +6386,10 @@ void nsWindow::HideWindowChrome(bool aSh SetWindowDecoration(aShouldHide ? eBorderStyle_none : mBorderStyle); } @@ -5092,7 +5084,7 @@ #undef LOG #ifdef MOZ_LOGGING -@@ -177,6 +179,8 @@ class nsWindow final : public nsBaseWidg +@@ -182,6 +184,8 @@ class nsWindow final : public nsBaseWidg nsIScreen* aTargetScreen = nullptr) override; virtual void HideWindowChrome(bool aShouldHide) override; @@ -5101,8 +5093,8 @@ /** * GetLastUserInputTime returns a timestamp for the most recent user input * event. This is intended for pointer grab requests (including drags). -@@ -703,6 +707,8 @@ class nsWindow final : public nsBaseWidg - static CSDSupportLevel sCSDSupportLevel; +@@ -719,6 +723,8 @@ class nsWindow final : public nsBaseWidg + static GtkWindowDecoration sGtkWindowDecoration; static bool sTransparentMainWindow; + @@ -5110,21 +5102,6 @@ }; #endif /* __nsWindow_h__ */ ---- a/widget/moz.build -+++ b/widget/moz.build -@@ -68,9 +68,9 @@ elif toolkit == "cocoa": - "nsITouchBarInput.idl", - "nsITouchBarUpdater.idl", - ] -- EXPORTS += [ -- "nsINativeMenuService.h", -- ] -+ -+if toolkit in ("cocoa", "gtk"): -+ EXPORTS += ["nsINativeMenuService.h"] - - TEST_DIRS += ["tests", "tests/gtest"] - --- /dev/null +++ b/xpcom/ds/NativeMenuAtoms.py @@ -0,0 +1,9 @@ @@ -5147,7 +5124,7 @@ import sys # Static atom definitions, used to generate nsGkAtomList.h. -@@ -2562,7 +2563,7 @@ STATIC_ATOMS = [ +@@ -2508,7 +2509,7 @@ STATIC_ATOMS = [ InheritingAnonBoxAtom("AnonBox_mozSVGForeignContent", ":-moz-svg-foreign-content"), InheritingAnonBoxAtom("AnonBox_mozSVGText", ":-moz-svg-text"), # END ATOMS @@ -5163,7 +5140,7 @@ 'processes': ProcessSelector.MAIN_PROCESS_ONLY, }, + { -+ 'cid': '{0B3FE5AA-BC72-4303-85AE-76365DF1251D}', ++ 'cid': '{0b3fe5aa-bc72-4303-85ae-76365df1251d}', + 'contract_ids': ['@mozilla.org/widget/nativemenuservice;1'], + 'singleton': True, + 'type': 'nsNativeMenuService', @@ -5175,12 +5152,130 @@ if defined('MOZ_X11'): --- a/xpfe/appshell/AppWindow.cpp +++ b/xpfe/appshell/AppWindow.cpp -@@ -76,7 +76,7 @@ +@@ -79,7 +79,7 @@ #include "mozilla/dom/DocumentL10n.h" -#ifdef XP_MACOSX +#if defined(XP_MACOSX) || defined(MOZ_WIDGET_GTK) - # include "nsINativeMenuService.h" + # include "mozilla/widget/NativeMenuSupport.h" # define USE_NATIVE_MENUS #endif +--- /dev/null ++++ b/widget/gtk/NativeMenuSupport.cpp +@@ -0,0 +1,25 @@ ++/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ ++/* 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/. */ ++ ++#include "mozilla/widget/NativeMenuSupport.h" ++ ++#include "MainThreadUtils.h" ++#include "nsINativeMenuService.h" ++ ++namespace mozilla::widget { ++ ++void NativeMenuSupport::CreateNativeMenuBar(nsIWidget* aParent, dom::Element* aMenuBarElement) { ++ MOZ_RELEASE_ASSERT(NS_IsMainThread(), "Attempting to create native menu bar on wrong thread!"); ++ ++ nsCOMPtr nms = ++ do_GetService("@mozilla.org/widget/nativemenuservice;1"); ++ if (!nms) { ++ return; ++ } ++ ++ nms->CreateNativeMenuBar(aParent, aMenuBarElement); ++} ++ ++} // namespace mozilla::widget +--- /dev/null ++++ b/widget/gtk/NativeMenuSupport.h +@@ -0,0 +1,31 @@ ++/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ ++/* 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/. */ ++ ++#ifndef mozilla_widget_NativeMenuSupport_h ++#define mozilla_widget_NativeMenuSupport_h ++ ++class nsIWidget; ++ ++namespace mozilla { ++ ++namespace dom { ++class Element; ++} ++ ++namespace widget { ++ ++class NativeMenuSupport final { ++public: ++ // Given a top-level window widget and a menu bar DOM node, sets up native ++ // menus. Once created, native menus are controlled via the DOM, including ++ // destruction. ++ static void CreateNativeMenuBar(nsIWidget* aParent, ++ dom::Element* aMenuBarElement); ++}; ++ ++} // namespace widget ++} // namespace mozilla ++ ++#endif // mozilla_widget_NativeMenuSupport_h +--- a/widget/moz.build ++++ b/widget/moz.build +@@ -145,6 +145,11 @@ EXPORTS += [ + "PuppetWidget.h", + ] + ++if toolkit == "gtk": ++ EXPORTS += [ ++ "nsINativeMenuService.h", ++ ] ++ + EXPORTS.mozilla += [ + "BasicEvents.h", + "CommandList.h", +--- /dev/null ++++ b/widget/nsINativeMenuService.h +@@ -0,0 +1,39 @@ ++/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ ++/* 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/. */ ++ ++#ifndef nsINativeMenuService_h_ ++#define nsINativeMenuService_h_ ++ ++#include "nsISupports.h" ++ ++class nsIWidget; ++class nsIContent; ++namespace mozilla { ++namespace dom { ++class Element; ++} ++} // namespace mozilla ++ ++// {90DF88F9-F084-4EF3-829A-49496E636DED} ++#define NS_INATIVEMENUSERVICE_IID \ ++ { \ ++ 0x90DF88F9, 0xF084, 0x4EF3, { \ ++ 0x82, 0x9A, 0x49, 0x49, 0x6E, 0x63, 0x6D, 0xED \ ++ } \ ++ } ++ ++class nsINativeMenuService : public nsISupports { ++ public: ++ NS_DECLARE_STATIC_IID_ACCESSOR(NS_INATIVEMENUSERVICE_IID) ++ // Given a top-level window widget and a menu bar DOM node, sets up native ++ // menus. Once created, native menus are controlled via the DOM, including ++ // destruction. ++ NS_IMETHOD CreateNativeMenuBar(nsIWidget* aParent, ++ mozilla::dom::Element* aMenuBarNode) = 0; ++}; ++ ++NS_DEFINE_STATIC_IID_ACCESSOR(nsINativeMenuService, NS_INATIVEMENUSERVICE_IID) ++ ++#endif // nsINativeMenuService_h_