diff --git a/0001-GLIBCXX-fix-for-GCC-12.patch b/0001-GLIBCXX-fix-for-GCC-12.patch new file mode 100644 index 0000000000000000000000000000000000000000..37d6f500bf03dd5e01060dd117630f69e8d2693d --- /dev/null +++ b/0001-GLIBCXX-fix-for-GCC-12.patch @@ -0,0 +1,44 @@ +From efd5bc0715e5477318be95a76811cda0a89e8289 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= +Date: Fri, 4 Mar 2022 12:00:26 +0100 +Subject: [PATCH] GLIBCXX fix for GCC 12? + +--- + build/unix/stdc++compat/stdc++compat.cpp | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/build/unix/stdc++compat/stdc++compat.cpp b/build/unix/stdc++compat/stdc++compat.cpp +index 0180f6bcfa998..8d7a542ff11f0 100644 +--- a/build/unix/stdc++compat/stdc++compat.cpp ++++ b/build/unix/stdc++compat/stdc++compat.cpp +@@ -24,6 +24,7 @@ + GLIBCXX_3.4.27 is from gcc 10 + GLIBCXX_3.4.28 is from gcc 10 + GLIBCXX_3.4.29 is from gcc 11 ++ GLIBCXX_3.4.30 is from gcc 12 + + This file adds the necessary compatibility tricks to avoid symbols with + version GLIBCXX_3.4.20 and bigger, keeping binary compatibility with +@@ -69,6 +70,19 @@ void __attribute__((weak)) __throw_bad_array_new_length() { MOZ_CRASH(); } + } // namespace std + #endif + ++#if _GLIBCXX_RELEASE >= 12 ++namespace std { ++ ++/* This avoids the GLIBCXX_3.4.30 symbol version. */ ++void __attribute__((weak)) ++__glibcxx_assert_fail(const char* __file, int __line, const char* __function, ++ const char* __condition) { ++ MOZ_CRASH(); ++} ++ ++} // namespace std ++#endif ++ + /* While we generally don't build with exceptions, we have some host tools + * that do use them. libstdc++ from GCC 5.0 added exception constructors with + * char const* argument. Older versions only have a constructor with +-- +2.35.1 + diff --git a/D173814.diff b/D173814.diff new file mode 100644 index 0000000000000000000000000000000000000000..91898aad2a9254b844f20ec63a276589a273f256 --- /dev/null +++ b/D173814.diff @@ -0,0 +1,82 @@ +diff --git a/widget/gtk/MozContainerWayland.h b/widget/gtk/MozContainerWayland.h +--- a/widget/gtk/MozContainerWayland.h ++++ b/widget/gtk/MozContainerWayland.h +@@ -83,10 +83,13 @@ + nsIntSize aSize, + int scale); + void moz_container_wayland_set_scale_factor(MozContainer* container); + void moz_container_wayland_set_scale_factor_locked( + const mozilla::MutexAutoLock& aProofOfLock, MozContainer* container); ++bool moz_container_wayland_size_matches_scale_factor_locked( ++ const mozilla::MutexAutoLock& aProofOfLock, MozContainer* container, ++ int aWidth, int aHeight); + + void moz_container_wayland_add_initial_draw_callback_locked( + MozContainer* container, const std::function& initial_draw_cb); + void moz_container_wayland_add_or_fire_initial_draw_callback( + MozContainer* container, const std::function& initial_draw_cb); +diff --git a/widget/gtk/MozContainerWayland.cpp b/widget/gtk/MozContainerWayland.cpp +--- a/widget/gtk/MozContainerWayland.cpp ++++ b/widget/gtk/MozContainerWayland.cpp +@@ -595,10 +595,17 @@ + if (container->wl_container.surface) { + moz_container_wayland_set_scale_factor_locked(lock, container); + } + } + ++bool moz_container_wayland_size_matches_scale_factor_locked( ++ const MutexAutoLock& aProofOfLock, MozContainer* container, int aWidth, ++ int aHeight) { ++ return aWidth % container->wl_container.buffer_scale == 0 && ++ aHeight % container->wl_container.buffer_scale == 0; ++} ++ + static bool moz_container_wayland_surface_create_locked( + const MutexAutoLock& aProofOfLock, MozContainer* container) { + MozContainerWayland* wl_container = &container->wl_container; + + LOGWAYLAND("%s [%p]\n", __FUNCTION__, +diff --git a/widget/gtk/WindowSurfaceWaylandMultiBuffer.cpp b/widget/gtk/WindowSurfaceWaylandMultiBuffer.cpp +--- a/widget/gtk/WindowSurfaceWaylandMultiBuffer.cpp ++++ b/widget/gtk/WindowSurfaceWaylandMultiBuffer.cpp +@@ -283,12 +283,12 @@ + return; + } + mFrameInProcess = false; + + MozContainer* container = mWindow->GetMozContainer(); +- MozContainerSurfaceLock lock(container); +- struct wl_surface* waylandSurface = lock.GetSurface(); ++ MozContainerSurfaceLock MozContainerLock(container); ++ struct wl_surface* waylandSurface = MozContainerLock.GetSurface(); + if (!waylandSurface) { + LOGWAYLAND( + "WindowSurfaceWaylandMB::Commit [%p] frame queued: can't lock " + "wl_surface\n", + (void*)mWindow.get()); +@@ -317,12 +317,23 @@ + LayoutDeviceIntRect r = iter.Get(); + wl_surface_damage_buffer(waylandSurface, r.x, r.y, r.width, r.height); + } + } + ++ // aProofOfLock is a kind of substitution of MozContainerSurfaceLock. ++ // MozContainer is locked but MozContainerSurfaceLock doen't convert to ++ // MutexAutoLock& so we use aProofOfLock here. + moz_container_wayland_set_scale_factor_locked(aProofOfLock, container); +- mInProgressBuffer->AttachAndCommit(waylandSurface); ++ ++ // It's possible that scale factor changed between Lock() and Commit() ++ // but window size is the same. ++ // Don't attach such buffer as it may have incorrect size, ++ // we'll paint new content soon. ++ if (moz_container_wayland_size_matches_scale_factor_locked( ++ aProofOfLock, container, mWindowSize.width, mWindowSize.height)) { ++ mInProgressBuffer->AttachAndCommit(waylandSurface); ++ } + + mInProgressBuffer->ResetBufferAge(); + mFrontBuffer = mInProgressBuffer; + mFrontBufferInvalidRegion = aInvalidRegion; + mInProgressBuffer = nullptr; + diff --git a/build-aarch64-skia.patch b/build-aarch64-skia.patch new file mode 100644 index 0000000000000000000000000000000000000000..a63e3e812bd1fd722ab7b35883c7b2f0ad6afb07 --- /dev/null +++ b/build-aarch64-skia.patch @@ -0,0 +1,45 @@ +diff -up firefox-72.0/gfx/skia/skia/include/private/SkHalf.h.aarch64-skia firefox-72.0/gfx/skia/skia/include/private/SkHalf.h +--- firefox-72.0/gfx/skia/skia/include/private/SkHalf.h.aarch64-skia 2020-01-02 22:33:02.000000000 +0100 ++++ firefox-72.0/gfx/skia/skia/include/private/SkHalf.h 2020-01-03 09:00:37.537296105 +0100 +@@ -40,7 +40,7 @@ static inline Sk4h SkFloatToHalf_finite_ + + static inline Sk4f SkHalfToFloat_finite_ftz(uint64_t rgba) { + Sk4h hs = Sk4h::Load(&rgba); +-#if !defined(SKNX_NO_SIMD) && defined(SK_CPU_ARM64) ++#if 0 // !defined(SKNX_NO_SIMD) && defined(SK_CPU_ARM64) + float32x4_t fs; + asm ("fcvtl %[fs].4s, %[hs].4h \n" // vcvt_f32_f16(...) + : [fs] "=w" (fs) // =w: write-only NEON register +@@ -62,7 +62,7 @@ static inline Sk4f SkHalfToFloat_finite_ + } + + static inline Sk4h SkFloatToHalf_finite_ftz(const Sk4f& fs) { +-#if !defined(SKNX_NO_SIMD) && defined(SK_CPU_ARM64) ++#if 0 // !defined(SKNX_NO_SIMD) && defined(SK_CPU_ARM64) + float32x4_t vec = fs.fVec; + asm ("fcvtn %[vec].4h, %[vec].4s \n" // vcvt_f16_f32(vec) + : [vec] "+w" (vec)); // +w: read-write NEON register +diff -up firefox-72.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h.aarch64-skia firefox-72.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h +--- firefox-72.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h.aarch64-skia 2020-01-03 09:00:37.538296107 +0100 ++++ firefox-72.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h 2020-01-03 10:11:41.259219508 +0100 +@@ -1087,7 +1087,7 @@ SI F from_half(U16 h) { + } + + SI U16 to_half(F f) { +-#if defined(JUMPER_IS_NEON) && defined(SK_CPU_ARM64) \ ++#if 0 //defined(JUMPER_IS_NEON) && defined(SK_CPU_ARM64) \ + && !defined(SK_BUILD_FOR_GOOGLE3) // Temporary workaround for some Google3 builds. + return vcvt_f16_f32(f); + +diff -up firefox-72.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h.aarch64-skia firefox-72.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h +--- firefox-72.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h.aarch64-skia 2020-01-03 09:00:37.538296107 +0100 ++++ firefox-72.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h 2020-01-03 10:11:53.513250979 +0100 +@@ -183,8 +183,6 @@ SI F F_from_Half(U16 half) { + SI U16 Half_from_F(F f) { + #if defined(USING_NEON_FP16) + return bit_pun(f); +-#elif defined(USING_NEON_F16C) +- return (U16)vcvt_f16_f32(f); + #elif defined(USING_AVX512F) + return (U16)_mm512_cvtps_ph((__m512 )f, _MM_FROUND_CUR_DIRECTION ); + #elif defined(USING_AVX_F16C) diff --git a/build-arm-libaom.patch b/build-arm-libaom.patch new file mode 100644 index 0000000000000000000000000000000000000000..985f01d1507eeecab5ce654ec538e2b7b24e4630 --- /dev/null +++ b/build-arm-libaom.patch @@ -0,0 +1,12 @@ +diff -up firefox-73.0/media/libaom/moz.build.old firefox-73.0/media/libaom/moz.build +--- firefox-73.0/media/libaom/moz.build.old 2020-02-07 23:13:28.000000000 +0200 ++++ firefox-73.0/media/libaom/moz.build 2020-02-17 10:30:08.509805092 +0200 +@@ -55,7 +55,7 @@ elif CONFIG['CPU_ARCH'] == 'arm': + + for f in SOURCES: + if f.endswith('neon.c'): +- SOURCES[f].flags += CONFIG['VPX_ASFLAGS'] ++ SOURCES[f].flags += CONFIG['NEON_FLAGS'] + + if CONFIG['OS_TARGET'] == 'Android': + # For cpu-features.h diff --git a/build-arm-libopus.patch b/build-arm-libopus.patch new file mode 100644 index 0000000000000000000000000000000000000000..1b3f31b58d8a40aab231709d2325fcfd224633b9 --- /dev/null +++ b/build-arm-libopus.patch @@ -0,0 +1,12 @@ +diff -up firefox-66.0/media/libopus/silk/arm/arm_silk_map.c.old firefox-66.0/media/libopus/silk/arm/arm_silk_map.c +--- firefox-66.0/media/libopus/silk/arm/arm_silk_map.c.old 2019-03-12 21:07:35.356677522 +0100 ++++ firefox-66.0/media/libopus/silk/arm/arm_silk_map.c 2019-03-12 21:07:42.937693394 +0100 +@@ -28,7 +28,7 @@ POSSIBILITY OF SUCH DAMAGE. + # include "config.h" + #endif + +-#include "main_FIX.h" ++#include "fixed/main_FIX.h" + #include "NSQ.h" + #include "SigProc_FIX.h" + diff --git a/cookie b/cookie new file mode 100644 index 0000000000000000000000000000000000000000..0c40e74b0e1f63fc2887ec7731f1a446f1a1b726 --- /dev/null +++ b/cookie @@ -0,0 +1,5 @@ +# Netscape HTTP Cookie File +# http://curl.haxx.se/docs/http-cookies.html +# This file was generated by libcurl! Edit at your own risk. + +#HttpOnly_60.205.253.201 FALSE / FALSE 0 session .eJwlyzsOgDAIANC7MDuAlH68jAHaxslPopPx7sa4v3eDXucyr9vqDSYQF7Ys3MeKxRUlYgimpQR10m4w_H7b9bi-gO65p6qZc2IPiZgi4UiJmmExgecFviocdw.ZEIA0Q.iS1iDTyqnZuKAQviDxmeblV1SNs diff --git a/disable-openh264-download.patch b/disable-openh264-download.patch new file mode 100644 index 0000000000000000000000000000000000000000..01fa2da94d5b848914f8dbcf0fb5e04d69ac019e --- /dev/null +++ b/disable-openh264-download.patch @@ -0,0 +1,38 @@ +diff -up firefox-81.0/toolkit/modules/GMPInstallManager.sys.mjs.old firefox-81.0/toolkit/modules/GMPInstallManager.sys.mjs +--- firefox-81.0/toolkit/modules/GMPInstallManager.sys.mjs.old 2020-09-25 10:39:04.769458703 +0200 ++++ firefox-81.0/toolkit/modules/GMPInstallManager.sys.mjs 2020-09-25 10:39:22.038504747 +0200 +@@ -54,10 +54,6 @@ function getScopedLogger(prefix) { + + const LOCAL_GMP_SOURCES = [ + { +- id: "gmp-gmpopenh264", +- src: "chrome://global/content/gmp-sources/openh264.json", +- }, +- { + id: "gmp-widevinecdm", + src: "chrome://global/content/gmp-sources/widevinecdm.json", + }, +diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn +--- a/toolkit/content/jar.mn ++++ b/toolkit/content/jar.mn +@@ -108,7 +108,6 @@ toolkit.jar: + #ifdef XP_MACOSX + content/global/macWindowMenu.js + #endif +- content/global/gmp-sources/openh264.json (gmp-sources/openh264.json) + content/global/gmp-sources/widevinecdm.json (gmp-sources/widevinecdm.json) + + # Third party files +diff --git a/toolkit/modules/GMPInstallManager.sys.mjs b/toolkit/modules/GMPInstallManager.sys.mjs +--- a/toolkit/modules/GMPInstallManager.sys.mjs ++++ b/toolkit/modules/GMPInstallManager.sys.mjs +@@ -238,6 +234,9 @@ GMPInstallManager.prototype = { + * downloaderr, verifyerr or previouserrorencountered + */ + installAddon(gmpAddon) { ++ if (gmpAddon.isOpenH264) { ++ return Promise.reject({ type: "disabled" }); ++ } + if (this._deferred) { + let log = getScopedLogger("GMPInstallManager.installAddon"); + log.error("previous error encountered"); diff --git a/distribution.ini b/distribution.ini new file mode 100644 index 0000000000000000000000000000000000000000..11f1f96d5696592ba20b88bd8521e20f2e659d8c --- /dev/null +++ b/distribution.ini @@ -0,0 +1,9 @@ +[Global] +id=fedora +version=1.0 +about=Mozilla Firefox for Fedora + +[Preferences] +app.distributor=fedora +app.distributor.channel=fedora +app.partner.fedora=fedora diff --git a/download b/download new file mode 100644 index 0000000000000000000000000000000000000000..545ace86f324c6c0d0d357ca0a44b829b11491d8 --- /dev/null +++ b/download @@ -0,0 +1,4 @@ +a8bc903efd31842c81523319c6205a1d firefox-112.0.1.source.tar.xz +d476a335bb5c077d51d40cbe20a92f92 cbindgen-vendor.tar.xz +6e1faf84cdd8942e752f88f61278af23 firefox-langpacks-112.0.1-20230417.tar.xz +c397dc2d33e0f9be52d9b860ca75644b mochitest-python.tar.gz diff --git a/firefox-112.0-commasplit.patch b/firefox-112.0-commasplit.patch new file mode 100644 index 0000000000000000000000000000000000000000..a56aec4108ddebcc7e8dc56ce39674b17b1257ea --- /dev/null +++ b/firefox-112.0-commasplit.patch @@ -0,0 +1,76 @@ +--- firefox-111.0.1/build/moz.configure/rust.configure 2023-03-21 06:16:03.000000000 -0700 ++++ firefox-111.0.1/build/moz.configure/rust.configure.new 2023-04-05 08:57:29.403219120 -0700 +@@ -593,7 +593,7 @@ + + # ============================================================== + +-option(env="RUSTFLAGS", nargs=1, help="Rust compiler flags") ++option(env="RUSTFLAGS", nargs=1, help="Rust compiler flags", comma_split=False) + set_config("RUSTFLAGS", depends("RUSTFLAGS")(lambda flags: flags)) + + +--- firefox-111.0.1/python/mozbuild/mozbuild/configure/options.py 2023-03-21 06:16:09.000000000 -0700 ++++ firefox-111.0.1/python/mozbuild/mozbuild/configure/options.py.new 2023-04-05 08:57:31.270193468 -0700 +@@ -191,6 +191,10 @@ + to instantiate an option indirectly. Set this to a positive integer to + force the script to look into a deeper stack frame when inferring the + `category`. ++ - `comma_split` specifies whether the value string should be split on ++ commas. The default is True. Setting it False is necessary for things ++ like compiler flags which should be a single string that may contain ++ commas. + """ + + __slots__ = ( +@@ -205,6 +209,7 @@ + "possible_origins", + "category", + "define_depth", ++ "comma_split", + ) + + def __init__( +@@ -218,6 +223,7 @@ + category=None, + help=None, + define_depth=0, ++ comma_split=True, + ): + if not name and not env: + raise InvalidOptionError( +@@ -335,9 +341,10 @@ + self.choices = choices + self.help = help + self.category = category or _infer_option_category(define_depth) ++ self.comma_split = comma_split + + @staticmethod +- def split_option(option): ++ def split_option(option, comma_split=True): + """Split a flag or variable into a prefix, a name and values + + Variables come in the form NAME=values (no prefix). +@@ -350,7 +357,13 @@ + + elements = option.split("=", 1) + name = elements[0] +- values = tuple(elements[1].split(",")) if len(elements) == 2 else () ++ if len(elements) == 2: ++ if comma_split: ++ values = tuple(elements[1].split(",")) ++ else: ++ values = (elements[1],) ++ else: ++ values = () + if name.startswith("--"): + name = name[2:] + if not name.islower(): +@@ -426,7 +439,7 @@ + % (option, origin, ", ".join(self.possible_origins)) + ) + +- prefix, name, values = self.split_option(option) ++ prefix, name, values = self.split_option(option, self.comma_split) + option = self._join_option(prefix, name) + + assert name in (self.name, self.env) diff --git a/firefox-anolis-default-prefs.js b/firefox-anolis-default-prefs.js new file mode 100644 index 0000000000000000000000000000000000000000..7a133c86171bf59840e936154fc53d09df323a48 --- /dev/null +++ b/firefox-anolis-default-prefs.js @@ -0,0 +1,31 @@ +pref("app.update.auto", false); +pref("app.update.enabled", false); +pref("app.update.autoInstallEnabled", false); +pref("general.smoothScroll", true); +pref("intl.locale.requested", ""); +pref("toolkit.storage.synchronous", 0); +pref("toolkit.networkmanager.disable", false); +pref("offline.autoDetect", true); +pref("browser.backspace_action", 2); +pref("browser.display.use_system_colors", true); +pref("browser.download.folderList", 1); +pref("browser.link.open_external", 3); +pref("browser.shell.checkDefaultBrowser", false); +pref("network.manage-offline-status", true); +pref("extensions.shownSelectionUI", true); +pref("ui.SpellCheckerUnderlineStyle", 1); +pref("startup.homepage_override_url", ""); +pref("browser.startup.homepage", "data:text/plain,browser.startup.homepage=https://https://openanolis.cn//"); +pref("browser.newtabpage.pinned", '[{"url":"https://https://openanolis.cn//","title":"OpenAnolis - Start Page"}]'); +pref("media.gmp-gmpopenh264.provider.enabled",false); +pref("media.gmp-gmpopenh264.autoupdate",false); +pref("media.gmp-gmpopenh264.enabled",false); +pref("media.gmp.decoder.enabled", true); +pref("plugins.notifyMissingFlash", false); +pref("browser.display.use_system_colors", false); +pref("network.negotiate-auth.trusted-uris", "https://"); +pref("spellchecker.dictionary_path","/usr/share/hunspell"); +pref("network.trr.mode", 5); +pref("browser.policies.perUserDir", true); +pref("browser.gnome-search-provider.enabled",true); +pref("media.navigator.mediadatadecoder_vpx_enabled", true); diff --git a/firefox-enable-addons.patch b/firefox-enable-addons.patch new file mode 100644 index 0000000000000000000000000000000000000000..15d0707cf01087cdee72c53a637c950f11c1d45b --- /dev/null +++ b/firefox-enable-addons.patch @@ -0,0 +1,13 @@ +diff -up firefox-55.0/browser/app/profile/firefox.js.addons firefox-55.0/browser/app/profile/firefox.js +--- firefox-55.0/browser/app/profile/firefox.js.addons 2017-08-02 10:58:30.566363833 +0200 ++++ firefox-55.0/browser/app/profile/firefox.js 2017-08-02 10:59:15.377216959 +0200 +@@ -65,7 +65,8 @@ pref("extensions.systemAddon.update.url" + + // Disable add-ons that are not installed by the user in all scopes by default. + // See the SCOPE constants in AddonManager.jsm for values to use here. +-pref("extensions.autoDisableScopes", 15); ++pref("extensions.autoDisableScopes", 0); ++pref("extensions.showMismatchUI", false); + // Scopes to scan for changes at startup. + pref("extensions.startupScanScopes", 0); + diff --git a/firefox-enable-vaapi.patch b/firefox-enable-vaapi.patch new file mode 100644 index 0000000000000000000000000000000000000000..dbe92bc2e21a3479b300394ca39e91203a1a592d --- /dev/null +++ b/firefox-enable-vaapi.patch @@ -0,0 +1,18 @@ +diff -up firefox-112.0/widget/gtk/GfxInfo.cpp.firefox-enable-vaapi firefox-112.0/widget/gtk/GfxInfo.cpp +--- firefox-112.0/widget/gtk/GfxInfo.cpp.firefox-enable-vaapi 2023-04-05 11:10:14.156695694 +0200 ++++ firefox-112.0/widget/gtk/GfxInfo.cpp 2023-04-05 11:11:40.697665718 +0200 +@@ -810,14 +810,6 @@ const nsTArray& GfxInfo:: + nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_COMPARISON_IGNORED, + V(0, 0, 0, 0), "FEATURE_HARDWARE_VIDEO_DECODING_NO_LINUX_AMD", ""); + +- // Disable on Release/late Beta +-#if !defined(EARLY_BETA_OR_EARLIER) +- APPEND_TO_DRIVER_BLOCKLIST(OperatingSystem::Linux, DeviceFamily::All, +- nsIGfxInfo::FEATURE_HARDWARE_VIDEO_DECODING, +- nsIGfxInfo::FEATURE_BLOCKED_DEVICE, +- DRIVER_COMPARISON_IGNORED, V(0, 0, 0, 0), +- "FEATURE_HARDWARE_VIDEO_DECODING_DISABLE", ""); +-#endif + //////////////////////////////////// + // FEATURE_HW_DECODED_VIDEO_ZERO_COPY - ALLOWLIST + APPEND_TO_DRIVER_BLOCKLIST2(OperatingSystem::Linux, DeviceFamily::All, diff --git a/firefox-gcc-13-build.patch b/firefox-gcc-13-build.patch new file mode 100644 index 0000000000000000000000000000000000000000..8512b767a4eb706aafc6fe3cfab2d0cdb550df02 --- /dev/null +++ b/firefox-gcc-13-build.patch @@ -0,0 +1,24 @@ +--- firefox-109.0.1/gfx/2d/Rect.h.old 2023-02-07 09:44:24.946279843 +0100 ++++ firefox-109.0.1/gfx/2d/Rect.h 2023-02-07 09:44:47.969032049 +0100 +@@ -324,8 +324,8 @@ IntRectTyped RoundedToInt(const R + + template + bool RectIsInt32Safe(const RectTyped& aRect) { +- float min = (float)std::numeric_limits::min(); +- float max = (float)std::numeric_limits::max(); ++ float min = (float)std::numeric_limits::min(); ++ float max = (float)std::numeric_limits::max(); + return aRect.x > min && aRect.y > min && aRect.width < max && + aRect.height < max && aRect.XMost() < max && aRect.YMost() < max; + } +diff -up firefox-109.0.1/toolkit/components/telemetry/pingsender/pingsender.cpp.old firefox-109.0.1/toolkit/components/telemetry/pingsender/pingsender.cpp +--- firefox-109.0.1/toolkit/components/telemetry/pingsender/pingsender.cpp.old 2023-02-07 11:03:41.788720090 +0100 ++++ firefox-109.0.1/toolkit/components/telemetry/pingsender/pingsender.cpp 2023-02-07 11:04:29.195345659 +0100 +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include + + #include + diff --git a/firefox-gcc-build.patch b/firefox-gcc-build.patch new file mode 100644 index 0000000000000000000000000000000000000000..55017adfdd6c73a5b676e4d06a73ea857c57d9c7 --- /dev/null +++ b/firefox-gcc-build.patch @@ -0,0 +1,38 @@ +--- firefox-80.0.1/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h 2020-08-31 10:04:19.000000000 -0400 ++++ firefox-80.0.1/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h 2020-09-12 07:24:35.298931628 -0400 +@@ -1962,7 +1962,7 @@ struct kernel_statfs { + LSS_ENTRYPOINT \ + "pop %%ebx" \ + args \ +- : "esp", "memory"); \ ++ : "memory"); \ + LSS_RETURN(type,__res) + #undef _syscall0 + #define _syscall0(type,name) \ +@@ -2019,7 +2019,7 @@ struct kernel_statfs { + : "i" (__NR_##name), "ri" ((long)(arg1)), \ + "c" ((long)(arg2)), "d" ((long)(arg3)), \ + "S" ((long)(arg4)), "D" ((long)(arg5)) \ +- : "esp", "memory"); \ ++ : "memory"); \ + LSS_RETURN(type,__res); \ + } + #undef _syscall6 +@@ -2041,7 +2041,7 @@ struct kernel_statfs { + : "i" (__NR_##name), "0" ((long)(&__s)), \ + "c" ((long)(arg2)), "d" ((long)(arg3)), \ + "S" ((long)(arg4)), "D" ((long)(arg5)) \ +- : "esp", "memory"); \ ++ : "memory"); \ + LSS_RETURN(type,__res); \ + } + LSS_INLINE int LSS_NAME(clone)(int (*fn)(void *), void *child_stack, +@@ -2127,7 +2127,7 @@ struct kernel_statfs { + : "0"(-EINVAL), "i"(__NR_clone), + "m"(fn), "m"(child_stack), "m"(flags), "m"(arg), + "m"(parent_tidptr), "m"(newtls), "m"(child_tidptr) +- : "esp", "memory", "ecx", "edx", "esi", "edi"); ++ : "memory", "ecx", "edx", "esi", "edi"); + LSS_RETURN(int, __res); + } + diff --git a/firefox-i686-build.patch b/firefox-i686-build.patch new file mode 100644 index 0000000000000000000000000000000000000000..320199fa9b2962cb9840a5d8d7e038c12477c519 --- /dev/null +++ b/firefox-i686-build.patch @@ -0,0 +1,12 @@ +diff -up firefox-105.0/mozglue/misc/SIMD_avx2.cpp.old firefox-105.0/mozglue/misc/SIMD_avx2.cpp +--- firefox-105.0/mozglue/misc/SIMD_avx2.cpp.old 2022-09-22 21:35:07.006221995 +0200 ++++ firefox-105.0/mozglue/misc/SIMD_avx2.cpp 2022-09-22 21:36:12.972480517 +0200 +@@ -55,7 +55,7 @@ __m256i CmpEq256(__m256i a, __m256i b) { + return _mm256_cmpeq_epi64(a, b); + } + +-# if defined(__GNUC__) && !defined(__clang__) ++# if 0 + + // See the comment in SIMD.cpp over Load32BitsIntoXMM. This is just adapted + // from that workaround. Testing this, it also yields the correct instructions diff --git a/firefox-mozconfig b/firefox-mozconfig new file mode 100644 index 0000000000000000000000000000000000000000..af5d664fca5d818d43ba77ccf08d9981e2bb698c --- /dev/null +++ b/firefox-mozconfig @@ -0,0 +1,26 @@ +. $topsrcdir/browser/config/mozconfig + +ac_add_options --with-system-zlib +ac_add_options --disable-strip +ac_add_options --enable-necko-wifi +ac_add_options --disable-updater +ac_add_options --enable-chrome-format=omni +ac_add_options --enable-pulseaudio +ac_add_options --enable-av1 +ac_add_options --without-system-icu +ac_add_options --enable-release +ac_add_options --update-channel=release +ac_add_options --allow-addon-sideload +ac_add_options --with-system-fdk-aac +ac_add_options --enable-js-shell +ac_add_options --with-unsigned-addon-scopes=app,system +ac_add_options --without-sysroot +ac_add_options --without-wasm-sandboxed-libraries +ac_add_options --enable-libproxy + +export BUILD_OFFICIAL=1 +export MOZILLA_OFFICIAL=1 +export MOZ_TELEMETRY_REPORTING=1 +mk_add_options BUILD_OFFICIAL=1 +mk_add_options MOZILLA_OFFICIAL=1 +mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir diff --git a/firefox-nss-addon-hack.patch b/firefox-nss-addon-hack.patch new file mode 100644 index 0000000000000000000000000000000000000000..0322707726f9037f08c8c867e229252fd77efb13 --- /dev/null +++ b/firefox-nss-addon-hack.patch @@ -0,0 +1,19 @@ +diff -up firefox-84.0.2/security/certverifier/NSSCertDBTrustDomain.cpp.nss-hack firefox-84.0.2/security/certverifier/NSSCertDBTrustDomain.cpp +--- firefox-84.0.2/security/certverifier/NSSCertDBTrustDomain.cpp.nss-hack 2021-01-11 12:12:02.585514543 +0100 ++++ firefox-84.0.2/security/certverifier/NSSCertDBTrustDomain.cpp 2021-01-11 12:47:50.345984582 +0100 +@@ -1619,6 +1619,15 @@ SECStatus InitializeNSS(const nsACString + return srv; + } + ++ /* Sets the NSS_USE_ALG_IN_ANY_SIGNATURE bit. ++ * does not change NSS_USE_ALG_IN_CERT_SIGNATURE, ++ * so policy will still disable use of sha1 in ++ * certificate related signature processing. */ ++ srv = NSS_SetAlgorithmPolicy(SEC_OID_SHA1, NSS_USE_ALG_IN_ANY_SIGNATURE, 0); ++ if (srv != SECSuccess) { ++ NS_WARNING("Unable to use SHA1 for Add-ons, expect broken/disabled Add-ons. See https://bugzilla.redhat.com/show_bug.cgi?id=1908018 for details."); ++ } ++ + if (nssDbConfig == NSSDBConfig::ReadWrite) { + UniquePK11SlotInfo slot(PK11_GetInternalKeySlot()); + if (!slot) { diff --git a/firefox-search-provider.ini b/firefox-search-provider.ini new file mode 100644 index 0000000000000000000000000000000000000000..3868e3d528d3cf72c26a69a912d789c2b865a7db --- /dev/null +++ b/firefox-search-provider.ini @@ -0,0 +1,5 @@ +[Shell Search Provider] +DesktopId=firefox.desktop +BusName=org.mozilla.Firefox.SearchProvider +ObjectPath=/org/mozilla/Firefox/SearchProvider +Version=2 diff --git a/firefox-symbolic.svg b/firefox-symbolic.svg new file mode 100644 index 0000000000000000000000000000000000000000..8ecd135c0e710ec0f69b864ac5d813dbc2ccae68 --- /dev/null +++ b/firefox-symbolic.svg @@ -0,0 +1,3 @@ + + + diff --git a/firefox-tests-xpcshell-freeze.patch b/firefox-tests-xpcshell-freeze.patch new file mode 100644 index 0000000000000000000000000000000000000000..111541797028ec20465fa0d2876dca70ee5db6cf --- /dev/null +++ b/firefox-tests-xpcshell-freeze.patch @@ -0,0 +1,14 @@ +diff -up firefox-88.0/testing/xpcshell/runxpcshelltests.py.old firefox-88.0/testing/xpcshell/runxpcshelltests.py +--- firefox-88.0/testing/xpcshell/runxpcshelltests.py.old 2021-04-30 10:45:14.466616224 +0200 ++++ firefox-88.0/testing/xpcshell/runxpcshelltests.py 2021-04-30 10:45:21.339525085 +0200 +@@ -1382,8 +1382,8 @@ class XPCShellTests(object): + self.log.info("Process %s" % label) + self.log.info(msg) + +- dumpOutput(proc.stdout, "stdout") +- dumpOutput(proc.stderr, "stderr") ++ #dumpOutput(proc.stdout, "stdout") ++ #dumpOutput(proc.stderr, "stderr") + self.nodeProc = {} + + def startHttp3Server(self): diff --git a/firefox-wayland.desktop b/firefox-wayland.desktop new file mode 100644 index 0000000000000000000000000000000000000000..cd2dd61c24685759fa9e87f7dd24a598c8ace8ab --- /dev/null +++ b/firefox-wayland.desktop @@ -0,0 +1,235 @@ +[Desktop Entry] +Version=1.0 +Name=Firefox on Wayland +GenericName=Web Browser +Comment=Browse the Web +Exec=firefox-wayland --name firefox-wayland %u +Icon=firefox +Terminal=false +Type=Application +MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https; +StartupNotify=true +Categories=Network;WebBrowser; +Keywords=web;browser;internet; +Actions=new-window;new-private-window;profile-manager-window; + +[Desktop Action new-window] +Name=Open a New Window +Name[ach]=Dirica manyen +Name[af]=Nuwe venster +Name[an]=Nueva finestra +Name[ar]=نافذة جديدة +Name[as]=নতুন উইন্ডো +Name[ast]=Ventana nueva +Name[az]=Yeni Pəncərə +Name[be]=Новае акно +Name[bg]=Нов прозорец +Name[bn_BD]=নতুন উইন্ডো (N) +Name[bn_IN]=নতুন উইন্ডো +Name[br]=Prenestr nevez +Name[brx]=गोदान उइन्ड'(N) +Name[bs]=Novi prozor +Name[ca]=Finestra nova +Name[cak]=K'ak'a' tzuwäch +Name[cs]=Nové okno +Name[cy]=Ffenestr Newydd +Name[da]=Nyt vindue +Name[de]=Neues Fenster +Name[dsb]=Nowe wokno +Name[el]=Νέο παράθυρο +Name[en_GB]=New Window +Name[en_US]=New Window +Name[en_ZA]=New Window +Name[eo]=Nova fenestro +Name[es_AR]=Nueva ventana +Name[es_CL]=Nueva ventana +Name[es_ES]=Nueva ventana +Name[es_MX]=Nueva ventana +Name[et]=Uus aken +Name[eu]=Leiho berria +Name[fa]=پنجره جدید‌ +Name[ff]=Henorde Hesere +Name[fi]=Uusi ikkuna +Name[fr]=Nouvelle fenêtre +Name[fy_NL]=Nij finster +Name[ga_IE]=Fuinneog Nua +Name[gd]=Uinneag ùr +Name[gl]=Nova xanela +Name[gn]=Ovetã pyahu +Name[gu_IN]=નવી વિન્ડો +Name[he]=חלון חדש +Name[hi_IN]=नया विंडो +Name[hr]=Novi prozor +Name[hsb]=Nowe wokno +Name[hu]=Új ablak +Name[hy_AM]=Նոր Պատուհան +Name[id]=Jendela Baru +Name[is]=Nýr gluggi +Name[it]=Nuova finestra +Name[ja]=新しいウィンドウ +Name[ja_JP-mac]=新規ウインドウ +Name[ka]=ახალი ფანჯარა +Name[kk]=Жаңа терезе +Name[km]=បង្អួច​​​ថ្មី +Name[kn]=ಹೊಸ ಕಿಟಕಿ +Name[ko]=새 창 +Name[kok]=नवें जनेल +Name[ks]=نئئ وِنڈو +Name[lij]=Neuvo barcon +Name[lo]=ຫນ້າຕ່າງໃຫມ່ +Name[lt]=Naujas langas +Name[ltg]=Jauns lūgs +Name[lv]=Jauns logs +Name[mai]=नव विंडो +Name[mk]=Нов прозорец +Name[ml]=പുതിയ ജാലകം +Name[mr]=नवीन पटल +Name[ms]=Tetingkap Baru +Name[my]=ဝင်းဒိုးအသစ် +Name[nb_NO]=Nytt vindu +Name[ne_NP]=नयाँ सञ्झ्याल +Name[nl]=Nieuw venster +Name[nn_NO]=Nytt vindauge +Name[or]=ନୂତନ ୱିଣ୍ଡୋ +Name[pa_IN]=ਨਵੀਂ ਵਿੰਡੋ +Name[pl]=Nowe okno +Name[pt_BR]=Nova janela +Name[pt_PT]=Nova janela +Name[rm]=Nova fanestra +Name[ro]=Fereastră nouă +Name[ru]=Новое окно +Name[sat]=नावा विंडो (N) +Name[si]=නව කවුළුවක් +Name[sk]=Nové okno +Name[sl]=Novo okno +Name[son]=Zanfun taaga +Name[sq]=Dritare e Re +Name[sr]=Нови прозор +Name[sv_SE]=Nytt fönster +Name[ta]=புதிய சாளரம் +Name[te]=కొత్త విండో +Name[th]=หน้าต่างใหม่ +Name[tr]=Yeni pencere +Name[tsz]=Eraatarakua jimpani +Name[uk]=Нове вікно +Name[ur]=نیا دریچہ +Name[uz]=Yangi oyna +Name[vi]=Cửa sổ mới +Name[wo]=Palanteer bu bees +Name[xh]=Ifestile entsha +Name[zh_CN]=新建窗口 +Name[zh_TW]=開新視窗 +Exec=firefox-wayland --name firefox-wayland --new-window %u + +[Desktop Action new-private-window] +Name=Open a New Private Window +Name[ach]=Dirica manyen me mung +Name[af]=Nuwe privaatvenster +Name[an]=Nueva finestra privada +Name[ar]=نافذة خاصة جديدة +Name[as]=নতুন ব্যক্তিগত উইন্ডো +Name[ast]=Ventana privada nueva +Name[az]=Yeni Məxfi Pəncərə +Name[be]=Новае акно адасаблення +Name[bg]=Нов прозорец за поверително сърфиране +Name[bn_BD]=নতুন ব্যক্তিগত উইন্ডো +Name[bn_IN]=নতুন ব্যক্তিগত উইন্ডো +Name[br]=Prenestr merdeiñ prevez nevez +Name[brx]=गोदान प्राइभेट उइन्ड' +Name[bs]=Novi privatni prozor +Name[ca]=Finestra privada nova +Name[cak]=K'ak'a' ichinan tzuwäch +Name[cs]=Nové anonymní okno +Name[cy]=Ffenestr Breifat Newydd +Name[da]=Nyt privat vindue +Name[de]=Neues privates Fenster +Name[dsb]=Nowe priwatne wokno +Name[el]=Νέο παράθυρο ιδιωτικής περιήγησης +Name[en_GB]=New Private Window +Name[en_US]=New Private Window +Name[en_ZA]=New Private Window +Name[eo]=Nova privata fenestro +Name[es_AR]=Nueva ventana privada +Name[es_CL]=Nueva ventana privada +Name[es_ES]=Nueva ventana privada +Name[es_MX]=Nueva ventana privada +Name[et]=Uus privaatne aken +Name[eu]=Leiho pribatu berria +Name[fa]=پنجره ناشناس جدید +Name[ff]=Henorde Suturo Hesere +Name[fi]=Uusi yksityinen ikkuna +Name[fr]=Nouvelle fenêtre de navigation privée +Name[fy_NL]=Nij priveefinster +Name[ga_IE]=Fuinneog Nua Phríobháideach +Name[gd]=Uinneag phrìobhaideach ùr +Name[gl]=Nova xanela privada +Name[gn]=Ovetã ñemi pyahu +Name[gu_IN]=નવી ખાનગી વિન્ડો +Name[he]=חלון פרטי חדש +Name[hi_IN]=नयी निजी विंडो +Name[hr]=Novi privatni prozor +Name[hsb]=Nowe priwatne wokno +Name[hu]=Új privát ablak +Name[hy_AM]=Սկսել Գաղտնի դիտարկում +Name[id]=Jendela Mode Pribadi Baru +Name[is]=Nýr huliðsgluggi +Name[it]=Nuova finestra anonima +Name[ja]=新しいプライベートウィンドウ +Name[ja_JP-mac]=新規プライベートウインドウ +Name[ka]=ახალი პირადი ფანჯარა +Name[kk]=Жаңа жекелік терезе +Name[km]=បង្អួច​ឯកជន​ថ្មី +Name[kn]=ಹೊಸ ಖಾಸಗಿ ಕಿಟಕಿ +Name[ko]=새 사생활 보호 모드 +Name[kok]=नवो खाजगी विंडो +Name[ks]=نْو پرایوٹ وینڈو& +Name[lij]=Neuvo barcon privou +Name[lo]=ເປີດຫນ້າຕ່າງສວນຕົວຂື້ນມາໃຫມ່ +Name[lt]=Naujas privataus naršymo langas +Name[ltg]=Jauns privatais lūgs +Name[lv]=Jauns privātais logs +Name[mai]=नया निज विंडो (W) +Name[mk]=Нов приватен прозорец +Name[ml]=പുതിയ സ്വകാര്യ ജാലകം +Name[mr]=नवीन वैयक्तिक पटल +Name[ms]=Tetingkap Persendirian Baharu +Name[my]=New Private Window +Name[nb_NO]=Nytt privat vindu +Name[ne_NP]=नयाँ निजी सञ्झ्याल +Name[nl]=Nieuw privévenster +Name[nn_NO]=Nytt privat vindauge +Name[or]=ନୂତନ ବ୍ୟକ୍ତିଗତ ୱିଣ୍ଡୋ +Name[pa_IN]=ਨਵੀਂ ਪ੍ਰਾਈਵੇਟ ਵਿੰਡੋ +Name[pl]=Nowe okno prywatne +Name[pt_BR]=Nova janela privativa +Name[pt_PT]=Nova janela privada +Name[rm]=Nova fanestra privata +Name[ro]=Fereastră privată nouă +Name[ru]=Новое приватное окно +Name[sat]=नावा निजेराक् विंडो (W ) +Name[si]=නව පුද්ගලික කවුළුව (W) +Name[sk]=Nové okno v režime Súkromné prehliadanie +Name[sl]=Novo zasebno okno +Name[son]=Sutura zanfun taaga +Name[sq]=Dritare e Re Private +Name[sr]=Нови приватан прозор +Name[sv_SE]=Nytt privat fönster +Name[ta]=புதிய தனிப்பட்ட சாளரம் +Name[te]=కొత్త ఆంతరంగిక విండో +Name[th]=หน้าต่างส่วนตัวใหม่ +Name[tr]=Yeni gizli pencere +Name[tsz]=Juchiiti eraatarakua jimpani +Name[uk]=Приватне вікно +Name[ur]=نیا نجی دریچہ +Name[uz]=Yangi maxfiy oyna +Name[vi]=Cửa sổ riêng tư mới +Name[wo]=Panlanteeru biir bu bees +Name[xh]=Ifestile yangasese entsha +Name[zh_CN]=新建隐私浏览窗口 +Name[zh_TW]=新增隱私視窗 +Exec=firefox-wayland --private-window --name firefox-wayland %u + +[Desktop Action profile-manager-window] +Name=Open the Profile Manager +Name[cs]=Správa profilů +Exec=firefox-wayland --name firefox-wayland --ProfileManager diff --git a/firefox-wayland.sh.in b/firefox-wayland.sh.in new file mode 100644 index 0000000000000000000000000000000000000000..bd6806824f22e5d5675583567e0cab2bb433ca3e --- /dev/null +++ b/firefox-wayland.sh.in @@ -0,0 +1,7 @@ +#!/usr/bin/bash +# +# Run Firefox under Wayland +# + +export MOZ_ENABLE_WAYLAND=1 +exec /__PREFIX__/bin/firefox "$@" diff --git a/firefox-x11.desktop b/firefox-x11.desktop new file mode 100644 index 0000000000000000000000000000000000000000..4124891dbae320a4cb9fd103dbc43f60602de580 --- /dev/null +++ b/firefox-x11.desktop @@ -0,0 +1,235 @@ +[Desktop Entry] +Version=1.0 +Name=Firefox on X11 +GenericName=Web Browser +Comment=Browse the Web +Exec=firefox-x11 --name firefox-x11 %u +Icon=firefox +Terminal=false +Type=Application +MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https; +StartupNotify=true +Categories=Network;WebBrowser; +Keywords=web;browser;internet; +Actions=new-window;new-private-window;profile-manager-window; + +[Desktop Action new-window] +Name=Open a New Window +Name[ach]=Dirica manyen +Name[af]=Nuwe venster +Name[an]=Nueva finestra +Name[ar]=نافذة جديدة +Name[as]=নতুন উইন্ডো +Name[ast]=Ventana nueva +Name[az]=Yeni Pəncərə +Name[be]=Новае акно +Name[bg]=Нов прозорец +Name[bn_BD]=নতুন উইন্ডো (N) +Name[bn_IN]=নতুন উইন্ডো +Name[br]=Prenestr nevez +Name[brx]=गोदान उइन्ड'(N) +Name[bs]=Novi prozor +Name[ca]=Finestra nova +Name[cak]=K'ak'a' tzuwäch +Name[cs]=Nové okno +Name[cy]=Ffenestr Newydd +Name[da]=Nyt vindue +Name[de]=Neues Fenster +Name[dsb]=Nowe wokno +Name[el]=Νέο παράθυρο +Name[en_GB]=New Window +Name[en_US]=New Window +Name[en_ZA]=New Window +Name[eo]=Nova fenestro +Name[es_AR]=Nueva ventana +Name[es_CL]=Nueva ventana +Name[es_ES]=Nueva ventana +Name[es_MX]=Nueva ventana +Name[et]=Uus aken +Name[eu]=Leiho berria +Name[fa]=پنجره جدید‌ +Name[ff]=Henorde Hesere +Name[fi]=Uusi ikkuna +Name[fr]=Nouvelle fenêtre +Name[fy_NL]=Nij finster +Name[ga_IE]=Fuinneog Nua +Name[gd]=Uinneag ùr +Name[gl]=Nova xanela +Name[gn]=Ovetã pyahu +Name[gu_IN]=નવી વિન્ડો +Name[he]=חלון חדש +Name[hi_IN]=नया विंडो +Name[hr]=Novi prozor +Name[hsb]=Nowe wokno +Name[hu]=Új ablak +Name[hy_AM]=Նոր Պատուհան +Name[id]=Jendela Baru +Name[is]=Nýr gluggi +Name[it]=Nuova finestra +Name[ja]=新しいウィンドウ +Name[ja_JP-mac]=新規ウインドウ +Name[ka]=ახალი ფანჯარა +Name[kk]=Жаңа терезе +Name[km]=បង្អួច​​​ថ្មី +Name[kn]=ಹೊಸ ಕಿಟಕಿ +Name[ko]=새 창 +Name[kok]=नवें जनेल +Name[ks]=نئئ وِنڈو +Name[lij]=Neuvo barcon +Name[lo]=ຫນ້າຕ່າງໃຫມ່ +Name[lt]=Naujas langas +Name[ltg]=Jauns lūgs +Name[lv]=Jauns logs +Name[mai]=नव विंडो +Name[mk]=Нов прозорец +Name[ml]=പുതിയ ജാലകം +Name[mr]=नवीन पटल +Name[ms]=Tetingkap Baru +Name[my]=ဝင်းဒိုးအသစ် +Name[nb_NO]=Nytt vindu +Name[ne_NP]=नयाँ सञ्झ्याल +Name[nl]=Nieuw venster +Name[nn_NO]=Nytt vindauge +Name[or]=ନୂତନ ୱିଣ୍ଡୋ +Name[pa_IN]=ਨਵੀਂ ਵਿੰਡੋ +Name[pl]=Nowe okno +Name[pt_BR]=Nova janela +Name[pt_PT]=Nova janela +Name[rm]=Nova fanestra +Name[ro]=Fereastră nouă +Name[ru]=Новое окно +Name[sat]=नावा विंडो (N) +Name[si]=නව කවුළුවක් +Name[sk]=Nové okno +Name[sl]=Novo okno +Name[son]=Zanfun taaga +Name[sq]=Dritare e Re +Name[sr]=Нови прозор +Name[sv_SE]=Nytt fönster +Name[ta]=புதிய சாளரம் +Name[te]=కొత్త విండో +Name[th]=หน้าต่างใหม่ +Name[tr]=Yeni pencere +Name[tsz]=Eraatarakua jimpani +Name[uk]=Нове вікно +Name[ur]=نیا دریچہ +Name[uz]=Yangi oyna +Name[vi]=Cửa sổ mới +Name[wo]=Palanteer bu bees +Name[xh]=Ifestile entsha +Name[zh_CN]=新建窗口 +Name[zh_TW]=開新視窗 +Exec=firefox-x11 --name firefox-x11 --new-window %u + +[Desktop Action new-private-window] +Name=Open a New Private Window +Name[ach]=Dirica manyen me mung +Name[af]=Nuwe privaatvenster +Name[an]=Nueva finestra privada +Name[ar]=نافذة خاصة جديدة +Name[as]=নতুন ব্যক্তিগত উইন্ডো +Name[ast]=Ventana privada nueva +Name[az]=Yeni Məxfi Pəncərə +Name[be]=Новае акно адасаблення +Name[bg]=Нов прозорец за поверително сърфиране +Name[bn_BD]=নতুন ব্যক্তিগত উইন্ডো +Name[bn_IN]=নতুন ব্যক্তিগত উইন্ডো +Name[br]=Prenestr merdeiñ prevez nevez +Name[brx]=गोदान प्राइभेट उइन्ड' +Name[bs]=Novi privatni prozor +Name[ca]=Finestra privada nova +Name[cak]=K'ak'a' ichinan tzuwäch +Name[cs]=Nové anonymní okno +Name[cy]=Ffenestr Breifat Newydd +Name[da]=Nyt privat vindue +Name[de]=Neues privates Fenster +Name[dsb]=Nowe priwatne wokno +Name[el]=Νέο παράθυρο ιδιωτικής περιήγησης +Name[en_GB]=New Private Window +Name[en_US]=New Private Window +Name[en_ZA]=New Private Window +Name[eo]=Nova privata fenestro +Name[es_AR]=Nueva ventana privada +Name[es_CL]=Nueva ventana privada +Name[es_ES]=Nueva ventana privada +Name[es_MX]=Nueva ventana privada +Name[et]=Uus privaatne aken +Name[eu]=Leiho pribatu berria +Name[fa]=پنجره ناشناس جدید +Name[ff]=Henorde Suturo Hesere +Name[fi]=Uusi yksityinen ikkuna +Name[fr]=Nouvelle fenêtre de navigation privée +Name[fy_NL]=Nij priveefinster +Name[ga_IE]=Fuinneog Nua Phríobháideach +Name[gd]=Uinneag phrìobhaideach ùr +Name[gl]=Nova xanela privada +Name[gn]=Ovetã ñemi pyahu +Name[gu_IN]=નવી ખાનગી વિન્ડો +Name[he]=חלון פרטי חדש +Name[hi_IN]=नयी निजी विंडो +Name[hr]=Novi privatni prozor +Name[hsb]=Nowe priwatne wokno +Name[hu]=Új privát ablak +Name[hy_AM]=Սկսել Գաղտնի դիտարկում +Name[id]=Jendela Mode Pribadi Baru +Name[is]=Nýr huliðsgluggi +Name[it]=Nuova finestra anonima +Name[ja]=新しいプライベートウィンドウ +Name[ja_JP-mac]=新規プライベートウインドウ +Name[ka]=ახალი პირადი ფანჯარა +Name[kk]=Жаңа жекелік терезе +Name[km]=បង្អួច​ឯកជន​ថ្មី +Name[kn]=ಹೊಸ ಖಾಸಗಿ ಕಿಟಕಿ +Name[ko]=새 사생활 보호 모드 +Name[kok]=नवो खाजगी विंडो +Name[ks]=نْو پرایوٹ وینڈو& +Name[lij]=Neuvo barcon privou +Name[lo]=ເປີດຫນ້າຕ່າງສວນຕົວຂື້ນມາໃຫມ່ +Name[lt]=Naujas privataus naršymo langas +Name[ltg]=Jauns privatais lūgs +Name[lv]=Jauns privātais logs +Name[mai]=नया निज विंडो (W) +Name[mk]=Нов приватен прозорец +Name[ml]=പുതിയ സ്വകാര്യ ജാലകം +Name[mr]=नवीन वैयक्तिक पटल +Name[ms]=Tetingkap Persendirian Baharu +Name[my]=New Private Window +Name[nb_NO]=Nytt privat vindu +Name[ne_NP]=नयाँ निजी सञ्झ्याल +Name[nl]=Nieuw privévenster +Name[nn_NO]=Nytt privat vindauge +Name[or]=ନୂତନ ବ୍ୟକ୍ତିଗତ ୱିଣ୍ଡୋ +Name[pa_IN]=ਨਵੀਂ ਪ੍ਰਾਈਵੇਟ ਵਿੰਡੋ +Name[pl]=Nowe okno prywatne +Name[pt_BR]=Nova janela privativa +Name[pt_PT]=Nova janela privada +Name[rm]=Nova fanestra privata +Name[ro]=Fereastră privată nouă +Name[ru]=Новое приватное окно +Name[sat]=नावा निजेराक् विंडो (W ) +Name[si]=නව පුද්ගලික කවුළුව (W) +Name[sk]=Nové okno v režime Súkromné prehliadanie +Name[sl]=Novo zasebno okno +Name[son]=Sutura zanfun taaga +Name[sq]=Dritare e Re Private +Name[sr]=Нови приватан прозор +Name[sv_SE]=Nytt privat fönster +Name[ta]=புதிய தனிப்பட்ட சாளரம் +Name[te]=కొత్త ఆంతరంగిక విండో +Name[th]=หน้าต่างส่วนตัวใหม่ +Name[tr]=Yeni gizli pencere +Name[tsz]=Juchiiti eraatarakua jimpani +Name[uk]=Приватне вікно +Name[ur]=نیا نجی دریچہ +Name[uz]=Yangi maxfiy oyna +Name[vi]=Cửa sổ riêng tư mới +Name[wo]=Panlanteeru biir bu bees +Name[xh]=Ifestile yangasese entsha +Name[zh_CN]=新建隐私浏览窗口 +Name[zh_TW]=新增隱私視窗 +Exec=firefox-x11 --private-window --name firefox-x11 %u + +[Desktop Action profile-manager-window] +Name=Open the Profile Manager +Name[cs]=Správa profilů +Exec=firefox-x11 --name firefox-x11 --ProfileManager diff --git a/firefox-x11.sh.in b/firefox-x11.sh.in new file mode 100644 index 0000000000000000000000000000000000000000..94045c9c6e19d9d6931a6a59ac434ad950a1e5c9 --- /dev/null +++ b/firefox-x11.sh.in @@ -0,0 +1,7 @@ +#!/usr/bin/bash +# +# Run Firefox on X11 backend +# + +export MOZ_DISABLE_WAYLAND=1 +exec /__PREFIX__/bin/firefox "$@" diff --git a/firefox.1 b/firefox.1 new file mode 100644 index 0000000000000000000000000000000000000000..556cf07eef0947eddbd3326d7d363c540520cc64 --- /dev/null +++ b/firefox.1 @@ -0,0 +1,141 @@ +.TH FIREFOX 1 "November 30, 2017" firefox "Linux User's Manual" +.SH NAME +firefox \- a Web browser for X11 derived from the Mozilla browser + +.SH SYNOPSIS +.B firefox +[\fIOPTIONS\fR ...] [\fIURL\fR] + +.B firefox-bin +[\fIOPTIONS\fR] [\fIURL\fR] + +.SH DESCRIPTION +\fBMozilla Firefox\fR is an open-source web browser, designed for +standards compliance, performance and portability. + +.SH USAGE +\fBfirefox\fR is a simple shell script that will set up the +environment for the actual executable, \fBfirefox-bin\fR. + +.SH OPTIONS +A summary of the options supported by \fBfirefox\fR is included below. + +.SS "X11 options" +.TP +.BI \-\-display= DISPLAY +X display to use +.TP +.B \--sync +Make X calls synchronous +.TP +.B \-\-g-fatal-warnings +Make all warnings fatal + +.SS "Firefox options" +.TP +.B \-h, \-help +Show summary of options. +.TP +.B \-v, \-version +Print Firefox version. +.TP +\fB\-P\fR \fIprofile\fR +Start with \fIprofile\fR. +.TP +\fB\-\-profile\fR \fIpath\fR +Start with profile at \fIpath\fR. +.TP +\fB\-\-migration\fR +Start with migration wizard. +.TP +.B \-\-ProfileManager +Start with ProfileManager. +.TP +\fB\-\-no\-remote\fR +Do not accept or send remote commands; implies \fB--new-instance\fR. +.TP +\fB\-\-new\-instance\fR +Open new instance, not a new window in running instance. +.TP +\fB\-\-UILocale\fR \fIlocale\fR +Start with \fIlocale\fR resources as UI Locale. +.TP +\fB\-\-safe\-mode\fR +Disables extensions and themes for this session. +.TP +\fB\-\-headless\fR +Run without a GUI. +.TP +\fB\-\-marionette\fR +Enable remote control server. +.TP +\fB\-\-browser\fR +Open a browser window. +.TP +\fB\-\-new-window\fR \fIurl\fR +Open \fIurl\fR in a new window. +.TP +\fB\-\-new-tab\fR \fIurl\fR +Open \fIurl\fR in a new tab. +.TP +\fB\-\-private-window\fR \fIurl\fR +Open \fIurl\fR in a new private window. +.TP +\fB\-\-preferences\fR +Open Preferences dialog. +.TP +\fB\-\-screenshot\fR [\fIpath\fR] +Save screenshot to \fIpath\fR or in working directory. +.TP +\fB\-\-window-size\fR \fIwidth\fR[,\fIheight\fR] +Width and optionally height of screenshot. +.TP +\fB\-\-search\fR \fIterm\fR +Search \fIterm\fR with your default search engine. +.TP + + +\fB\-\-jsconsole\fR +Open the Browser Console. +.TP +\fB\-\-jsdebugger\fR +Open the Browser Toolbox. +.TP +\fB\-\-wait-for-jsdebugger\fR +Spin event loop until JS debugger connects. Enables debugging (some) application startup code paths. Only has an effect when \fI--jsdebugger\fR is also supplied. +.TP +\fB\-\-devtools\fR +Open DevTools on initial load. +.TP +\fB\-\-start-debugger-server\fR [ws:][\fIport\fR|\fIpath\fR] +Start the debugger server on a TCP port or Unix domain socket path. Defaults to TCP port 6000. Use WebSocket protocol if ws: prefix is specified. +.TP +\fB\-\-recording\fR \fIfile\fR +Record drawing for a given URL. +.TP +\fB\-\-recording-output\fR \fIfile\fR +Specify destination file for a drawing recording. +.TP +\fB\-\-setDefaultBrowser\fR +Set this app as the default browser. + +.SH FILES +\fI/usr/bin/firefox\fR - shell script wrapping +\fBfirefox\fR +.br +\fI/usr/lib64/firefox/firefox-bin\fR - \fBfirefox\fR +executable + +.SH VERSION +57.0 + +.SH BUGS +To report a bug, please visit \fIhttp://bugzilla.mozilla.org/\fR + +.SH AUTHORS +.TP +.B The Mozilla Organization +.I http://www.mozilla.org/about.html +.TP +.B Tobias Girstmair +.I https://gir.st/ diff --git a/firefox.appdata.xml.in b/firefox.appdata.xml.in new file mode 100644 index 0000000000000000000000000000000000000000..bfa9afc8a5a2ca54d7e6f0bb54eeccf9d57516f5 --- /dev/null +++ b/firefox.appdata.xml.in @@ -0,0 +1,59 @@ + + + + firefox.desktop + CC0-1.0 + Firefox + Web Browser + Navegador web + Webový prohlížeč + Navegador web + مرورگر اینترنتی + WWW-selain + Navigateur Web + Webböngésző + Browser Web + ウェブ・ブラウザ + 웹 브라우저 + Nettleser + Webbrowser + Nettlesar + Nettleser + Przeglądarka WWW + Navegador Web + Navegador Web + Internetový prehliadač + Webbläsare + +

+ Bringing together all kinds of awesomeness to make browsing better for you. + Get to your favorite sites quickly – even if you don’t remember the URLs. + Type your term into the location bar (aka the Awesome Bar) and the autocomplete + function will include possible matches from your browsing history, bookmarked + sites and open tabs. +

+
+ https://www.mozilla.org + stransky@redhat.com + + ModernToolkit + SearchProvider + + Mozilla + GPL-3.0+ + Mozilla Corporation + https://bugzilla.mozilla.org/ + https://support.mozilla.org/ + firefox + + firefox.desktop + + + https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/firefox/a.png + https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/firefox/b.png + https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/firefox/c.png + + + + +
diff --git a/firefox.desktop b/firefox.desktop new file mode 100644 index 0000000000000000000000000000000000000000..02e156d8317f6d6bd9827aba62fe36aeb11341df --- /dev/null +++ b/firefox.desktop @@ -0,0 +1,276 @@ +[Desktop Entry] +Version=1.0 +Name=Firefox +GenericName=Web Browser +GenericName[ca]=Navegador web +GenericName[cs]=Webový prohlížeč +GenericName[es]=Navegador web +GenericName[fa]=مرورگر اینترنتی +GenericName[fi]=WWW-selain +GenericName[fr]=Navigateur Web +GenericName[hu]=Webböngésző +GenericName[it]=Browser Web +GenericName[ja]=ウェブ・ブラウザ +GenericName[ko]=웹 브라우저 +GenericName[nb]=Nettleser +GenericName[nl]=Webbrowser +GenericName[nn]=Nettlesar +GenericName[no]=Nettleser +GenericName[pl]=Przeglądarka WWW +GenericName[pt]=Navegador Web +GenericName[pt_BR]=Navegador Web +GenericName[sk]=Internetový prehliadač +GenericName[sv]=Webbläsare +Comment=Browse the Web +Comment[ca]=Navegueu per el web +Comment[cs]=Prohlížení stránek World Wide Webu +Comment[de]=Im Internet surfen +Comment[es]=Navegue por la web +Comment[fa]=صفحات شبکه جهانی اینترنت را مرور نمایید +Comment[fi]=Selaa Internetin WWW-sivuja +Comment[fr]=Navigue sur Internet +Comment[hu]=A világháló böngészése +Comment[it]=Esplora il web +Comment[ja]=ウェブを閲覧します +Comment[ko]=웹을 돌아 다닙니다 +Comment[nb]=Surf på nettet +Comment[nl]=Verken het internet +Comment[nn]=Surf på nettet +Comment[no]=Surf på nettet +Comment[pl]=Przeglądanie stron WWW +Comment[pt]=Navegue na Internet +Comment[pt_BR]=Navegue na Internet +Comment[sk]=Prehliadanie internetu +Comment[sv]=Surfa på webben +Exec=firefox %u +Icon=firefox +Terminal=false +Type=Application +MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https; +StartupNotify=true +Categories=Network;WebBrowser; +Keywords=web;browser;internet; +Actions=new-window;new-private-window;profile-manager-window; + +[Desktop Action new-window] +Name=Open a New Window +Name[ach]=Dirica manyen +Name[af]=Nuwe venster +Name[an]=Nueva finestra +Name[ar]=نافذة جديدة +Name[as]=নতুন উইন্ডো +Name[ast]=Ventana nueva +Name[az]=Yeni Pəncərə +Name[be]=Новае акно +Name[bg]=Нов прозорец +Name[bn_BD]=নতুন উইন্ডো (N) +Name[bn_IN]=নতুন উইন্ডো +Name[br]=Prenestr nevez +Name[brx]=गोदान उइन्ड'(N) +Name[bs]=Novi prozor +Name[ca]=Finestra nova +Name[cak]=K'ak'a' tzuwäch +Name[cs]=Nové okno +Name[cy]=Ffenestr Newydd +Name[da]=Nyt vindue +Name[de]=Neues Fenster +Name[dsb]=Nowe wokno +Name[el]=Νέο παράθυρο +Name[en_GB]=New Window +Name[en_US]=New Window +Name[en_ZA]=New Window +Name[eo]=Nova fenestro +Name[es_AR]=Nueva ventana +Name[es_CL]=Nueva ventana +Name[es_ES]=Nueva ventana +Name[es_MX]=Nueva ventana +Name[et]=Uus aken +Name[eu]=Leiho berria +Name[fa]=پنجره جدید‌ +Name[ff]=Henorde Hesere +Name[fi]=Uusi ikkuna +Name[fr]=Nouvelle fenêtre +Name[fy_NL]=Nij finster +Name[ga_IE]=Fuinneog Nua +Name[gd]=Uinneag ùr +Name[gl]=Nova xanela +Name[gn]=Ovetã pyahu +Name[gu_IN]=નવી વિન્ડો +Name[he]=חלון חדש +Name[hi_IN]=नया विंडो +Name[hr]=Novi prozor +Name[hsb]=Nowe wokno +Name[hu]=Új ablak +Name[hy_AM]=Նոր Պատուհան +Name[id]=Jendela Baru +Name[is]=Nýr gluggi +Name[it]=Nuova finestra +Name[ja]=新しいウィンドウ +Name[ja_JP-mac]=新規ウインドウ +Name[ka]=ახალი ფანჯარა +Name[kk]=Жаңа терезе +Name[km]=បង្អួច​​​ថ្មី +Name[kn]=ಹೊಸ ಕಿಟಕಿ +Name[ko]=새 창 +Name[kok]=नवें जनेल +Name[ks]=نئئ وِنڈو +Name[lij]=Neuvo barcon +Name[lo]=ຫນ້າຕ່າງໃຫມ່ +Name[lt]=Naujas langas +Name[ltg]=Jauns lūgs +Name[lv]=Jauns logs +Name[mai]=नव विंडो +Name[mk]=Нов прозорец +Name[ml]=പുതിയ ജാലകം +Name[mr]=नवीन पटल +Name[ms]=Tetingkap Baru +Name[my]=ဝင်းဒိုးအသစ် +Name[nb_NO]=Nytt vindu +Name[ne_NP]=नयाँ सञ्झ्याल +Name[nl]=Nieuw venster +Name[nn_NO]=Nytt vindauge +Name[or]=ନୂତନ ୱିଣ୍ଡୋ +Name[pa_IN]=ਨਵੀਂ ਵਿੰਡੋ +Name[pl]=Nowe okno +Name[pt_BR]=Nova janela +Name[pt_PT]=Nova janela +Name[rm]=Nova fanestra +Name[ro]=Fereastră nouă +Name[ru]=Новое окно +Name[sat]=नावा विंडो (N) +Name[si]=නව කවුළුවක් +Name[sk]=Nové okno +Name[sl]=Novo okno +Name[son]=Zanfun taaga +Name[sq]=Dritare e Re +Name[sr]=Нови прозор +Name[sv_SE]=Nytt fönster +Name[ta]=புதிய சாளரம் +Name[te]=కొత్త విండో +Name[th]=หน้าต่างใหม่ +Name[tr]=Yeni pencere +Name[tsz]=Eraatarakua jimpani +Name[uk]=Нове вікно +Name[ur]=نیا دریچہ +Name[uz]=Yangi oyna +Name[vi]=Cửa sổ mới +Name[wo]=Palanteer bu bees +Name[xh]=Ifestile entsha +Name[zh_CN]=新建窗口 +Name[zh_TW]=開新視窗 +Exec=firefox --new-window %u + +[Desktop Action new-private-window] +Name=Open a New Private Window +Name[ach]=Dirica manyen me mung +Name[af]=Nuwe privaatvenster +Name[an]=Nueva finestra privada +Name[ar]=نافذة خاصة جديدة +Name[as]=নতুন ব্যক্তিগত উইন্ডো +Name[ast]=Ventana privada nueva +Name[az]=Yeni Məxfi Pəncərə +Name[be]=Новае акно адасаблення +Name[bg]=Нов прозорец за поверително сърфиране +Name[bn_BD]=নতুন ব্যক্তিগত উইন্ডো +Name[bn_IN]=নতুন ব্যক্তিগত উইন্ডো +Name[br]=Prenestr merdeiñ prevez nevez +Name[brx]=गोदान प्राइभेट उइन्ड' +Name[bs]=Novi privatni prozor +Name[ca]=Finestra privada nova +Name[cak]=K'ak'a' ichinan tzuwäch +Name[cs]=Nové anonymní okno +Name[cy]=Ffenestr Breifat Newydd +Name[da]=Nyt privat vindue +Name[de]=Neues privates Fenster +Name[dsb]=Nowe priwatne wokno +Name[el]=Νέο παράθυρο ιδιωτικής περιήγησης +Name[en_GB]=New Private Window +Name[en_US]=New Private Window +Name[en_ZA]=New Private Window +Name[eo]=Nova privata fenestro +Name[es_AR]=Nueva ventana privada +Name[es_CL]=Nueva ventana privada +Name[es_ES]=Nueva ventana privada +Name[es_MX]=Nueva ventana privada +Name[et]=Uus privaatne aken +Name[eu]=Leiho pribatu berria +Name[fa]=پنجره ناشناس جدید +Name[ff]=Henorde Suturo Hesere +Name[fi]=Uusi yksityinen ikkuna +Name[fr]=Nouvelle fenêtre de navigation privée +Name[fy_NL]=Nij priveefinster +Name[ga_IE]=Fuinneog Nua Phríobháideach +Name[gd]=Uinneag phrìobhaideach ùr +Name[gl]=Nova xanela privada +Name[gn]=Ovetã ñemi pyahu +Name[gu_IN]=નવી ખાનગી વિન્ડો +Name[he]=חלון פרטי חדש +Name[hi_IN]=नयी निजी विंडो +Name[hr]=Novi privatni prozor +Name[hsb]=Nowe priwatne wokno +Name[hu]=Új privát ablak +Name[hy_AM]=Սկսել Գաղտնի դիտարկում +Name[id]=Jendela Mode Pribadi Baru +Name[is]=Nýr huliðsgluggi +Name[it]=Nuova finestra anonima +Name[ja]=新しいプライベートウィンドウ +Name[ja_JP-mac]=新規プライベートウインドウ +Name[ka]=ახალი პირადი ფანჯარა +Name[kk]=Жаңа жекелік терезе +Name[km]=បង្អួច​ឯកជន​ថ្មី +Name[kn]=ಹೊಸ ಖಾಸಗಿ ಕಿಟಕಿ +Name[ko]=새 사생활 보호 모드 +Name[kok]=नवो खाजगी विंडो +Name[ks]=نْو پرایوٹ وینڈو& +Name[lij]=Neuvo barcon privou +Name[lo]=ເປີດຫນ້າຕ່າງສວນຕົວຂື້ນມາໃຫມ່ +Name[lt]=Naujas privataus naršymo langas +Name[ltg]=Jauns privatais lūgs +Name[lv]=Jauns privātais logs +Name[mai]=नया निज विंडो (W) +Name[mk]=Нов приватен прозорец +Name[ml]=പുതിയ സ്വകാര്യ ജാലകം +Name[mr]=नवीन वैयक्तिक पटल +Name[ms]=Tetingkap Persendirian Baharu +Name[my]=New Private Window +Name[nb_NO]=Nytt privat vindu +Name[ne_NP]=नयाँ निजी सञ्झ्याल +Name[nl]=Nieuw privévenster +Name[nn_NO]=Nytt privat vindauge +Name[or]=ନୂତନ ବ୍ୟକ୍ତିଗତ ୱିଣ୍ଡୋ +Name[pa_IN]=ਨਵੀਂ ਪ੍ਰਾਈਵੇਟ ਵਿੰਡੋ +Name[pl]=Nowe okno prywatne +Name[pt_BR]=Nova janela privativa +Name[pt_PT]=Nova janela privada +Name[rm]=Nova fanestra privata +Name[ro]=Fereastră privată nouă +Name[ru]=Новое приватное окно +Name[sat]=नावा निजेराक् विंडो (W ) +Name[si]=නව පුද්ගලික කවුළුව (W) +Name[sk]=Nové okno v režime Súkromné prehliadanie +Name[sl]=Novo zasebno okno +Name[son]=Sutura zanfun taaga +Name[sq]=Dritare e Re Private +Name[sr]=Нови приватан прозор +Name[sv_SE]=Nytt privat fönster +Name[ta]=புதிய தனிப்பட்ட சாளரம் +Name[te]=కొత్త ఆంతరంగిక విండో +Name[th]=หน้าต่างส่วนตัวใหม่ +Name[tr]=Yeni gizli pencere +Name[tsz]=Juchiiti eraatarakua jimpani +Name[uk]=Приватне вікно +Name[ur]=نیا نجی دریچہ +Name[uz]=Yangi maxfiy oyna +Name[vi]=Cửa sổ riêng tư mới +Name[wo]=Panlanteeru biir bu bees +Name[xh]=Ifestile yangasese entsha +Name[zh_CN]=新建隐私浏览窗口 +Name[zh_TW]=新增隱私視窗 +Exec=firefox --private-window %u + +[Desktop Action profile-manager-window] +Name=Open the Profile Manager +Name[cs]=Správa profilů +Name[de]=Profilverwaltung öffnen +Name[fr]=Ouvrir le gestionnaire de profils +Exec=firefox --ProfileManager diff --git a/firefox.sh.in b/firefox.sh.in new file mode 100644 index 0000000000000000000000000000000000000000..078627ffc79894f57110290683fde2c746382059 --- /dev/null +++ b/firefox.sh.in @@ -0,0 +1,290 @@ +#!/usr/bin/bash +# +# The contents of this file are subject to the Netscape Public +# License Version 1.1 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.mozilla.org/NPL/ +# +# Software distributed under the License is distributed on an "AS +# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +# implied. See the License for the specific language governing +# rights and limitations under the License. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is Netscape +# Communications Corporation. Portions created by Netscape are +# Copyright (C) 1998 Netscape Communications Corporation. All +# Rights Reserved. +# +# Contributor(s): +# + +## +## Usage: +## +## $ firefox +## +## This script is meant to run a mozilla program from the mozilla +## rpm installation. +## +## The script will setup all the environment voodoo needed to make +## mozilla work. + +cmdname=`basename $0` + +## +## Variables +## +MOZ_ARCH=$(uname -m) +case $MOZ_ARCH in + x86_64 | s390x | sparc64) + MOZ_LIB_DIR="/__PREFIX__/lib64" + SECONDARY_LIB_DIR="/__PREFIX__/lib" + ;; + * ) + MOZ_LIB_DIR="/__PREFIX__/lib" + SECONDARY_LIB_DIR="/__PREFIX__/lib64" + ;; +esac + +MOZ_FIREFOX_FILE="firefox" + +if [ ! -r $MOZ_LIB_DIR/firefox/$MOZ_FIREFOX_FILE ]; then + if [ ! -r $SECONDARY_LIB_DIR/firefox/$MOZ_FIREFOX_FILE ]; then + echo "Error: $MOZ_LIB_DIR/firefox/$MOZ_FIREFOX_FILE not found" + if [ -d $SECONDARY_LIB_DIR ]; then + echo " $SECONDARY_LIB_DIR/firefox/$MOZ_FIREFOX_FILE not found" + fi + exit 1 + fi + MOZ_LIB_DIR="$SECONDARY_LIB_DIR" +fi +MOZ_DIST_BIN="$MOZ_LIB_DIR/firefox" +MOZ_LANGPACKS_DIR="$MOZ_DIST_BIN/langpacks" +MOZ_EXTENSIONS_PROFILE_DIR="$HOME/.mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}" +MOZ_PROGRAM="$MOZ_DIST_BIN/$MOZ_FIREFOX_FILE" +MOZ_LAUNCHER="$MOZ_DIST_BIN/run-mozilla.sh" +GETENFORCE_FILE="/usr/sbin/getenforce" + +## +## Enable Wayland backend? +## +if ! [ $MOZ_DISABLE_WAYLAND ] && [ "$WAYLAND_DISPLAY" ]; then + if [ "$XDG_CURRENT_DESKTOP" == "GNOME" ]; then + export MOZ_ENABLE_WAYLAND=1 + fi +## Enable Wayland on KDE/Sway +## + if [ "$XDG_SESSION_TYPE" == "wayland" ]; then + export MOZ_ENABLE_WAYLAND=1 + fi +fi + +## +## Use D-Bus remote exclusively when there's Wayland display. +## +if [ "$WAYLAND_DISPLAY" ]; then + export MOZ_DBUS_REMOTE=1 +fi + +## +## Set MOZ_GRE_CONF +## +MOZ_GRE_CONF=/etc/gre.d/gre.conf +if [ "$MOZ_LIB_DIR" == "/__PREFIX__/lib64" ]; then + MOZ_GRE_CONF=/etc/gre.d/gre64.conf +fi +export MOZ_GRE_CONF + +## +## Set MOZILLA_FIVE_HOME +## +MOZILLA_FIVE_HOME="$MOZ_DIST_BIN" + +export MOZILLA_FIVE_HOME + +## +## Make sure that we set the plugin path +## +MOZ_PLUGIN_DIR="plugins" + +if [ "$MOZ_PLUGIN_PATH" ] +then + MOZ_PLUGIN_PATH=$MOZ_PLUGIN_PATH:$MOZ_LIB_DIR/mozilla/$MOZ_PLUGIN_DIR:$MOZ_DIST_BIN/$MOZ_PLUGIN_DIR +else + MOZ_PLUGIN_PATH=$MOZ_LIB_DIR/mozilla/$MOZ_PLUGIN_DIR:$MOZ_DIST_BIN/$MOZ_PLUGIN_DIR +fi +export MOZ_PLUGIN_PATH + +## +## Set MOZ_APP_LAUNCHER for gnome-session +## +export MOZ_APP_LAUNCHER="/__PREFIX__/bin/firefox" + +## +## Set FONTCONFIG_PATH for Xft/fontconfig +## +FONTCONFIG_PATH="/etc/fonts:${MOZILLA_FIVE_HOME}/res/Xft" +export FONTCONFIG_PATH + +## +## We want Firefox to use Openh264 provided by Fedora +## +export MOZ_GMP_PATH=$MOZ_LIB_DIR/mozilla/plugins/gmp-gmpopenh264/system-installed + +## +## In order to better support certain scripts (such as Indic and some CJK +## scripts), Fedora builds its Firefox, with permission from the Mozilla +## Corporation, with the Pango system as its text renderer. This change +## may negatively impact performance on some pages. To disable the use of +## Pango, set MOZ_DISABLE_PANGO=1 in your environment before launching +## Firefox. +## +# +# MOZ_DISABLE_PANGO=1 +# export MOZ_DISABLE_PANGO +# + +## +## Disable the GNOME crash dialog, Moz has it's own +## +GNOME_DISABLE_CRASH_DIALOG=1 +export GNOME_DISABLE_CRASH_DIALOG + +## +## Disable the SLICE allocator (rhbz#1014858) +## +export G_SLICE=always-malloc + +## +## Enable Xinput2 (mozbz#1207973) +## +export MOZ_USE_XINPUT2=${MOZ_USE_XINPUT2-1} + +# OK, here's where all the real work gets done + + +## +## To disable the use of Firefox localization, set MOZ_DISABLE_LANGPACKS=1 +## in your environment before launching Firefox. +## +# +# MOZ_DISABLE_LANGPACKS=1 +# export MOZ_DISABLE_LANGPACKS +# + +## +## Automatically installed langpacks are tracked by .fedora-langpack-install +## config file. +## +FEDORA_LANGPACK_CONFIG="$MOZ_EXTENSIONS_PROFILE_DIR/.fedora-langpack-install" + +# MOZ_DISABLE_LANGPACKS disables language packs completely +MOZILLA_DOWN=0 +if ! [ $MOZ_DISABLE_LANGPACKS ] || [ $MOZ_DISABLE_LANGPACKS -eq 0 ]; then + if [ -x $MOZ_DIST_BIN/$MOZ_FIREFOX_FILE ]; then + # Is firefox running? + /__PREFIX__/bin/pidof $MOZ_PROGRAM > /dev/null 2>&1 + MOZILLA_DOWN=$? + fi +fi + +# When Firefox is not running, restore SELinux labels for profile files +# (rhbz#1731371) +if [ $MOZILLA_DOWN -ne 0 ]; then + if [ -x $GETENFORCE_FILE ] && [ `$GETENFORCE_FILE` != "Disabled" ]; then + (restorecon -vr ~/.mozilla/firefox/* &) + fi +fi + +# Modify language pack configuration only when firefox is not running +# and language packs are not disabled +if [ $MOZILLA_DOWN -ne 0 ]; then + + # Clear already installed langpacks + mkdir -p $MOZ_EXTENSIONS_PROFILE_DIR + if [ -f $FEDORA_LANGPACK_CONFIG ]; then + rm `cat $FEDORA_LANGPACK_CONFIG` > /dev/null 2>&1 + rm $FEDORA_LANGPACK_CONFIG > /dev/null 2>&1 + # remove all empty langpacks dirs while they block installation of langpacks + rmdir $MOZ_EXTENSIONS_PROFILE_DIR/langpack* > /dev/null 2>&1 + fi + + # Get locale from system + CURRENT_LOCALE=$LC_ALL + CURRENT_LOCALE=${CURRENT_LOCALE:-$LC_MESSAGES} + CURRENT_LOCALE=${CURRENT_LOCALE:-$LANG} + + # Try with a local variant first, then without a local variant + SHORTMOZLOCALE=`echo $CURRENT_LOCALE | sed "s|_\([^.]*\).*||g" | sed "s|\..*||g"` + MOZLOCALE=`echo $CURRENT_LOCALE | sed "s|_\([^.]*\).*|-\1|g" | sed "s|\..*||g"` + + function create_langpack_link() { + local language=$* + local langpack=langpack-${language}@firefox.mozilla.org.xpi + if [ -f $MOZ_LANGPACKS_DIR/$langpack ]; then + rm -rf $MOZ_EXTENSIONS_PROFILE_DIR/$langpack + # If the target file is a symlink (the fallback langpack), + # install the original file instead of the fallback one + if [ -h $MOZ_LANGPACKS_DIR/$langpack ]; then + langpack=`readlink $MOZ_LANGPACKS_DIR/$langpack` + fi + ln -s $MOZ_LANGPACKS_DIR/$langpack \ + $MOZ_EXTENSIONS_PROFILE_DIR/$langpack + echo $MOZ_EXTENSIONS_PROFILE_DIR/$langpack > $FEDORA_LANGPACK_CONFIG + return 0 + fi + return 1 + } + + create_langpack_link $MOZLOCALE || create_langpack_link $SHORTMOZLOCALE || true +fi + +# BEAST fix (rhbz#1005611) +NSS_SSL_CBC_RANDOM_IV=${NSS_SSL_CBC_RANDOM_IV-1} +export NSS_SSL_CBC_RANDOM_IV + +# Prepare command line arguments +script_args="" +pass_arg_count=0 +while [ $# -gt $pass_arg_count ] +do + case "$1" in + -g | --debug) + script_args="$script_args -g" + debugging=1 + shift + ;; + -d | --debugger) + if [ $# -gt 1 ]; then + script_args="$script_args -d $2" + shift 2 + else + shift + fi + ;; + *) + # Move the unrecognized argument to the end of the list. + arg="$1" + shift + set -- "$@" "$arg" + pass_arg_count=`expr $pass_arg_count + 1` + ;; + esac +done + +# Flatpak specific environment variables +%FLATPAK_ENV_VARS% + +# Don't throw "old profile" dialog box. +export MOZ_ALLOW_DOWNGRADE=1 + +# Run the browser +debugging=0 +if [ $debugging = 1 ] +then + echo $MOZ_LAUNCHER $script_args $MOZ_PROGRAM "$@" +fi + +exec $MOZ_LAUNCHER $script_args $MOZ_PROGRAM "$@" diff --git a/firefox.spec b/firefox.spec new file mode 100644 index 0000000000000000000000000000000000000000..afe7e2cc59caace9448c5ba4d10e2af9518817d3 --- /dev/null +++ b/firefox.spec @@ -0,0 +1,880 @@ +%define anolis_release 1 +%global release_build 1 + +%global run_firefox_tests 0 +%ifarch x86_64 +%global run_firefox_tests 0 +%endif +%global create_debuginfo 1 +%global debug_build 0 +%global use_xdg_file_portal 0 + +%global system_nss 1 +%global system_libevent 1 +%global build_with_asan 0 +%global test_on_wayland 1 + +%if "%{toolchain}" == "clang" +%global build_with_clang 1 +%else +%global build_with_clang 0 +%endif + +%global enable_mozilla_crashreporter 0 +%ifarch x86_64 +%global enable_mozilla_crashreporter 0 +%endif +%if %{build_with_asan} +%global enable_mozilla_crashreporter 0 +%endif +%if !%{create_debuginfo} +%define _unpackaged_files_terminate_build 0 +%global debug_package %{nil} +%global enable_mozilla_crashreporter 0 +%endif + +%global system_ffi 1 +%global system_libvpx 0 +%global system_jpeg 1 +%global system_pixman 1 +%global use_bundled_cbindgen 1 +%if %{debug_build} +%global release_build 0 +%endif +%global build_with_pgo 0 +%ifarch x86_64 +%if %{release_build} +%global build_with_pgo 0 +%endif +%endif + +%if 0%{?build_with_pgo} +%global use_xvfb 1 +%global build_tests 1 +%endif + +%if 0%{?run_firefox_tests} +%global use_xvfb 1 +%global build_tests 1 +%endif + +%global launch_wayland_compositor 0 +%if %{build_with_pgo} && %{test_on_wayland} +%global launch_wayland_compositor 1 +%endif +%if %{run_firefox_tests} && %{test_on_wayland} +%global launch_wayland_compositor 1 +%endif + +%global default_bookmarks_file %{_datadir}/bookmarks/default-bookmarks.html +%global firefox_app_id \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\} +%global cairo_version 1.13.1 +%global freetype_version 2.1.9 +%global libnotify_version 0.7.0 +%if %{?system_libvpx} +%global libvpx_version 1.8.2 +%endif + +%if %{?system_nss} +%global nspr_version 4.32 +%global nspr_build_version %{nspr_version} +%global nss_version 3.88 +%global nss_build_version %{nss_version} +%endif + +%global mozappdir %{_libdir}/firefox +%global mozappdirdev %{_libdir}/firefox-devel-%{version} +%global langpackdir %{mozappdir}/langpacks +%global tarballdir firefox-%{version} + +%global official_branding 1 + +%bcond_without langpacks + +%if %{with langpacks} +%bcond_without langpacks_subpkg +%endif + +%if !%{release_build} +%global pre_tag .npgo +%endif +%if %{build_with_clang} +%global pre_tag .clang +%endif +%if %{build_with_asan} +%global pre_tag .asan +%global build_with_pgo 0 +%endif +%if !%{system_nss} +%global nss_tag .nss +%endif +%if %{debug_build} +%global pre_tag .debug +%endif + +%global __provides_exclude_from ^%{mozappdir} +%global __requires_exclude ^(%%(find %{buildroot}%{mozappdir} -name '*.so' | xargs -n1 basename | sort -u | paste -s -d '|' -)) + +%undefine _package_note_flags +%global _package_note_status 0 + +Summary: Mozilla Firefox Web browser +Name: firefox +Version: 112.0.1 +Release: %{anolis_release}%{?pre_tag}%{?dist} +URL: https://www.mozilla.org/firefox/ +License: MPLv1.1 or GPLv2+ or LGPLv2+ +Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}/source/firefox-%{version}.source.tar.xz +%if %{with langpacks} +Source1: firefox-langpacks-%{version}-20230417.tar.xz +%endif +# generate by gen_cbindgen-vendor.sh +Source2: cbindgen-vendor.tar.xz +Source10: firefox-mozconfig +Source12: firefox-anolis-default-prefs.js +Source20: firefox.desktop +Source21: firefox.sh.in +Source23: firefox.1 +Source24: mozilla-api-key +Source25: firefox-symbolic.svg +Source26: distribution.ini +Source27: google-api-key +Source28: firefox-wayland.sh.in +Source29: firefox-wayland.desktop +Source30: firefox-x11.sh.in +Source31: firefox-x11.desktop +Source32: node-stdout-nonblocking-wrapper +Source33: firefox.appdata.xml.in +Source34: firefox-search-provider.ini +Source35: google-loc-api-key +Source37: mochitest-python.tar.gz +Source38: print_results +Source39: print-errors +Source40: run-tests-x11 +Source41: run-tests-wayland +Source42: psummary +Source43: print_failures +Source44: print-error-reftest +Source45: run-wayland-compositor + +Patch3: mozilla-build-aarch64.patch +Patch40: build-aarch64-skia.patch +Patch44: build-arm-libopus.patch +Patch47: shebang-build.patch +Patch49: build-arm-libaom.patch +Patch53: firefox-gcc-build.patch +Patch54: mozilla-1669639.patch +Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch +Patch78: firefox-i686-build.patch +Patch79: firefox-gcc-13-build.patch +Patch83: D173814.diff + +Patch102: firefox-tests-xpcshell-freeze.patch + +Patch215: firefox-enable-addons.patch +Patch219: rhbz-1173156.patch +Patch226: rhbz-1354671.patch +Patch228: disable-openh264-download.patch +Patch229: firefox-nss-addon-hack.patch +Patch230: firefox-enable-vaapi.patch + +# upstream pacthes +Patch402: mozilla-1196777.patch +Patch407: mozilla-1667096.patch +Patch408: mozilla-1663844.patch +Patch415: mozilla-1670333.patch +# https://phabricator.services.mozilla.com/D173021 +Patch416: libwebrtc-pipewire-capturer-import-dmabuf-directly-into-desktop-frame.patch +Patch417: mozilla-1826583.patch +Patch418: mozilla-1827429.patch +# PGO/LTO patches +Patch600: pgo.patch +Patch602: mozilla-1516803.patch +# Work around broken moz.build file on ppc64le (mozb#1779545, mozb#1775202) +Patch1100: mozilla-1775202.patch +# https://bugzilla.mozilla.org/show_bug.cgi?id=1474486 +Patch1200: firefox-112.0-commasplit.patch + +BuildRequires: pkgconfig(libpng) +BuildRequires: pkgconfig(gtk+-3.0) +BuildRequires: pkgconfig(krb5) +BuildRequires: pkgconfig(pango) +BuildRequires: pkgconfig(freetype2) >= %{freetype_version} +BuildRequires: pkgconfig(xt) +BuildRequires: pkgconfig(xrender) +BuildRequires: pkgconfig(libstartup-notification-1.0) +BuildRequires: pkgconfig(libnotify) >= %{libnotify_version} +BuildRequires: pkgconfig(dri) +BuildRequires: pkgconfig(libcurl) +BuildRequires: pkgconfig(alsa) +BuildRequires: pkgconfig(libpulse) +BuildRequires: pkgconfig(zlib) +BuildRequires: zip bzip2-devel dbus-glib-devel libproxy-devel +BuildRequires: autoconf yasm make +BuildRequires: llvm llvm-devel clang clang-libs clang-devel +BuildRequires: rust cargo +BuildRequires: nodejs +BuildRequires: nasm >= 1.13 +BuildRequires: fdk-aac-free-devel mesa-libgbm-devel pipewire-devel +BuildRequires: desktop-file-utils libappstream-glib pciutils-libs +BuildRequires: perl-interpreter +BuildRequires: python3-devel python3-setuptools + +%if %{?system_nss} +BuildRequires: pkgconfig(nspr) >= %{nspr_version} +BuildRequires: pkgconfig(nss) >= %{nss_version} +BuildRequires: nss-static >= %{nss_version} +%endif + +%if %{?system_jpeg} +BuildRequires: libjpeg-devel +%endif + +%if %{?system_pixman} +BuildRequires: pixman-devel +%endif + +%if %{?system_libvpx} +BuildRequires: libvpx-devel >= %{libvpx_version} +%endif + +%if %{build_with_clang} +BuildRequires: lld +%endif + +%if !0%{?use_bundled_cbindgen} +BuildRequires: cbindgen +%endif + +%if %{?system_ffi} +BuildRequires: pkgconfig(libffi) +%endif + +%if 0%{?use_xvfb} +BuildRequires: xorg-x11-server-Xvfb +%endif + +%if %{build_with_asan} +BuildRequires: libasan libasan-static +%endif + +%if 0%{?test_on_wayland} +BuildRequires: mutter +BuildRequires: gsettings-desktop-schemas +BuildRequires: gnome-settings-daemon +BuildRequires: mesa-dri-drivers +BuildRequires: xorg-x11-server-Xwayland +BuildRequires: dbus-x11 +BuildRequires: gnome-keyring +%endif + +%if 0%{?run_firefox_tests} +BuildRequires: procps-ng +BuildRequires: nss-tools +BuildRequires: python2.7 +BuildRequires: dejavu-sans-mono-fonts +BuildRequires: dejavu-sans-fonts +BuildRequires: dejavu-serif-fonts +BuildRequires: dbus-x11 +BuildRequires: gnome-keyring +BuildRequires: mesa-dri-drivers +BuildRequires: liberation-fonts-common +BuildRequires: liberation-mono-fonts +BuildRequires: liberation-sans-fonts +BuildRequires: liberation-serif-fonts +BuildRequires: google-carlito-fonts +BuildRequires: google-droid-sans-fonts +BuildRequires: google-noto-fonts-common +BuildRequires: google-noto-cjk-fonts-common +BuildRequires: google-noto-sans-cjk-ttc-fonts +BuildRequires: google-noto-sans-gurmukhi-fonts +BuildRequires: google-noto-sans-fonts +BuildRequires: google-noto-emoji-color-fonts +BuildRequires: google-noto-sans-sinhala-vf-fonts +BuildRequires: thai-scalable-fonts-common +BuildRequires: thai-scalable-waree-fonts +BuildRequires: khmeros-base-fonts +BuildRequires: jomolhari-fonts +BuildRequires: lohit-tamil-fonts +BuildRequires: lohit-telugu-fonts +BuildRequires: paktype-naskh-basic-fonts +BuildRequires: pt-sans-fonts +BuildRequires: smc-meera-fonts +BuildRequires: stix-fonts +BuildRequires: abattis-cantarell-fonts +BuildRequires: xorg-x11-fonts-ISO8859-1-100dpi +BuildRequires: xorg-x11-fonts-misc +%endif + +%if %{?system_libevent} +BuildRequires: pkgconfig(libevent) +%endif + +Requires: mozilla-filesystem +Requires: p11-kit-trust +Requires: pciutils-libs +Requires: u2f-hidraw-policy +Recommends: mozilla-openh264 >= 2.1.1 +Recommends: libva +%if %{?system_nss} +Requires: nspr >= %{nspr_build_version} +Requires: nss >= %{nss_build_version} +%endif +%if %{?use_xdg_file_portal} +Requires: xdg-desktop-portal +%endif +%if %{with langpacks_subpkg} +Recommends: firefox-langpacks = %{version}-%{release} +%else +Obsoletes: firefox-langpacks < %{version}-%{release} +%endif +Obsoletes: mozilla <= 37:1.7.13 +Provides: webclient + +%description +Mozilla Firefox is an open-source web browser, designed for standards +compliance, performance and portability. + +%if %{with langpacks_subpkg} +%package langpacks +Summary: Firefox langpacks +Requires: %{name} = %{version}-%{release} + +%description langpacks +The firefox-langpacks package contains all the localization +and translations langpack add-ons. + +%files langpacks -f %{name}.lang +%dir %{langpackdir} +%endif + +%if %{enable_mozilla_crashreporter} +%global moz_debug_prefix %{_prefix}/lib/debug +%global moz_debug_dir %{moz_debug_prefix}%{mozappdir} +%global uname_m %(uname -m) +%global symbols_file_name %{name}-%{version}.en-US.%{_os}-%{uname_m}.crashreporter-symbols.zip +%global symbols_file_path %{moz_debug_dir}/%{symbols_file_name} +%global _find_debuginfo_opts -p %{symbols_file_path} -o debugcrashreporter.list +%global crashreporter_pkg_name mozilla-crashreporter-%{name}-debuginfo + +%package -n %{crashreporter_pkg_name} +Summary: Debugging symbols used by Mozilla's crash reporter servers + +%description -n %{crashreporter_pkg_name} +This package provides debug information for Firefox, for use by +Mozilla's crash reporter servers. If you are trying to locally +debug %{name}, you want to install %{name}-debuginfo instead. + +%files -n %{crashreporter_pkg_name} -f debugcrashreporter.list +%endif + +%package x11 +Summary: Firefox X11 launcher. +Requires: %{name} + +%description x11 +The firefox-x11 package contains launcher and desktop file +to run Firefox explicitly on X11. + +%package wayland +Summary: Firefox Wayland launcher. +Requires: %{name} + +%description wayland +The firefox-wayland package contains launcher and desktop file +to run Firefox explicitly on Wayland. + +%if 0%{?run_firefox_tests} +%global testsuite_pkg_name %{name}-testresults +%package -n %{testsuite_pkg_name} +Summary: Results of testsuite + +%description -n %{testsuite_pkg_name} +This package contains results of tests executed during build. + +%files -n %{testsuite_pkg_name} +/%{version}-%{release}/test_results +/%{version}-%{release}/test_summary.txt +/%{version}-%{release}/failures-* +%endif + +%prep +%setup -q -n %{tarballdir} + +%patch40 -p1 -b .aarch64-skia +%patch3 -p1 -b .arm +%patch44 -p1 -b .build-arm-libopus +%patch47 -p1 -b .fedora-shebang +%patch49 -p1 -b .build-arm-libaom +%patch53 -p1 -b .firefox-gcc-build +%patch54 -p1 -b .1669639 +%patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 +%patch78 -p1 -b .firefox-i686 +%patch79 -p1 -b .firefox-gcc-13-build +%patch83 -p1 -b .D173814 + +%patch102 -p1 -b .firefox-tests-xpcshell-freeze + +%patch215 -p1 -b .addons +%patch219 -p1 -b .rhbz-1173156 +%ifarch aarch64 +%patch226 -p1 -b .1354671 +%endif +%patch228 -p1 -b .disable-openh264-download +%patch229 -p1 -b .firefox-nss-addon-hack +%patch230 -p1 -b .firefox-enable-vaapi + +%patch402 -p1 -b .1196777 +%patch407 -p1 -b .1667096 +%patch408 -p1 -b .1663844 +%patch415 -p1 -b .1670333 +%patch416 -p1 -b .libwebrtc-pipewire-capturer-import-dmabuf-directly-into-desktop-frame +%patch417 -p1 -b .1826583 +%patch418 -p1 -b .1827429 + +%if %{build_with_pgo} +%if !%{build_with_clang} +%patch600 -p1 -b .pgo +%patch602 -p1 -b .1516803 +%endif +%endif + +%patch1100 -p1 -b .ppc-mobzuild +%patch1200 -p1 -b .rustflags-commasplit + +rm -f .mozconfig +cp %{SOURCE10} .mozconfig +echo "ac_add_options --enable-default-toolkit=cairo-gtk3-wayland" >> .mozconfig +%if %{official_branding} +echo "ac_add_options --enable-official-branding" >> .mozconfig +%endif +cp %{SOURCE24} mozilla-api-key +cp %{SOURCE27} google-api-key +cp %{SOURCE35} google-loc-api-key + +echo "ac_add_options --prefix=\"%{_prefix}\"" >> .mozconfig +echo "ac_add_options --libdir=\"%{_libdir}\"" >> .mozconfig + +%if %{?system_nss} +echo "ac_add_options --with-system-nspr" >> .mozconfig +echo "ac_add_options --with-system-nss" >> .mozconfig +%else +echo "ac_add_options --without-system-nspr" >> .mozconfig +echo "ac_add_options --without-system-nss" >> .mozconfig +%endif + +%if %{?system_libevent} +echo "ac_add_options --with-system-libevent" >> .mozconfig +%endif + +%if %{?system_ffi} +echo "ac_add_options --enable-system-ffi" >> .mozconfig +%endif + +%ifarch aarch64 +echo "ac_add_options --disable-elf-hack" >> .mozconfig +%endif + +%if %{?debug_build} +echo "ac_add_options --enable-debug" >> .mozconfig +echo "ac_add_options --disable-optimize" >> .mozconfig +%else +%global optimize_flags "none" +%ifarch aarch64 +%global optimize_flags "-g -O2" +%endif +%if %{optimize_flags} != "none" +echo 'ac_add_options --enable-optimize=%{?optimize_flags}' >> .mozconfig +%else +echo 'ac_add_options --enable-optimize' >> .mozconfig +%endif +echo "ac_add_options --disable-debug" >> .mozconfig +%endif + +%ifnarch x86_64 +echo "ac_add_options --disable-jemalloc" >> .mozconfig +%endif + +%if !%{enable_mozilla_crashreporter} +echo "ac_add_options --disable-crashreporter" >> .mozconfig +%endif + +%if 0%{?build_tests} +echo "ac_add_options --enable-tests" >> .mozconfig +%else +echo "ac_add_options --disable-tests" >> .mozconfig +%endif + +%if !%{?system_jpeg} +echo "ac_add_options --without-system-jpeg" >> .mozconfig +%else +echo "ac_add_options --with-system-jpeg" >> .mozconfig +%endif + +%if %{?system_pixman} +echo "ac_add_options --enable-system-pixman" >> .mozconfig +%endif + +%if %{?system_libvpx} +echo "ac_add_options --with-system-libvpx" >> .mozconfig +%else +echo "ac_add_options --without-system-libvpx" >> .mozconfig +%endif + +%if %{build_with_asan} +echo "ac_add_options --enable-address-sanitizer" >> .mozconfig +echo "ac_add_options --disable-jemalloc" >> .mozconfig +%endif + +echo "ac_add_options --with-mozilla-api-keyfile=`pwd`/mozilla-api-key" >> .mozconfig +echo "ac_add_options --with-google-location-service-api-keyfile=`pwd`/google-loc-api-key" >> .mozconfig +echo "ac_add_options --with-google-safebrowsing-api-keyfile=`pwd`/google-api-key" >> .mozconfig + +echo 'export NODEJS="%{_buildrootdir}/bin/node-stdout-nonblocking-wrapper"' >> .mozconfig + +chmod -x third_party/rust/itertools/src/lib.rs +chmod a-x third_party/rust/ash/src/extensions/ext/*.rs +chmod a-x third_party/rust/ash/src/extensions/khr/*.rs +chmod a-x third_party/rust/ash/src/extensions/nv/*.rs + +%build +%define _lto_cflags %{nil} + +%if 0%{?use_bundled_cbindgen} +mkdir -p my_rust_vendor +cd my_rust_vendor +tar xf %{SOURCE2} +mkdir -p .cargo +cat > .cargo/config <> .mozconfig +echo "export CXXFLAGS=\"$MOZ_OPT_FLAGS\"" >> .mozconfig +echo "export LDFLAGS=\"$MOZ_LINK_FLAGS\"" >> .mozconfig + +%if %{build_with_clang} +echo "export LLVM_PROFDATA=\"llvm-profdata\"" >> .mozconfig +echo "export AR=\"llvm-ar\"" >> .mozconfig +echo "export NM=\"llvm-nm\"" >> .mozconfig +echo "export RANLIB=\"llvm-ranlib\"" >> .mozconfig +echo "ac_add_options --enable-linker=lld" >> .mozconfig +%else +echo "export CC=gcc" >> .mozconfig +echo "export CXX=g++" >> .mozconfig +echo "export AR=\"gcc-ar\"" >> .mozconfig +echo "export NM=\"gcc-nm\"" >> .mozconfig +echo "export RANLIB=\"gcc-ranlib\"" >> .mozconfig +%endif +%if 0%{?build_with_pgo} +echo "ac_add_options MOZ_PGO=1" >> .mozconfig +export CCACHE_DISABLE=1 +%endif + +%constrain_build -m 2048 +echo "mk_add_options MOZ_MAKE_FLAGS=\"-j%{_smp_build_ncpus}\"" >> .mozconfig + +echo "mk_add_options MOZ_SERVICES_SYNC=1" >> .mozconfig +echo "export STRIP=/bin/true" >> .mozconfig + +%if %{launch_wayland_compositor} +cp %{SOURCE45} . +. ./run-wayland-compositor +%endif + +%if %{build_with_pgo} +%if %{test_on_wayland} +env | grep "WAYLAND" +MOZ_ENABLE_WAYLAND=1 ./mach build -v 2>&1 | cat - || exit 1 +%else +xvfb-run ./mach build -v 2>&1 | cat - || exit 1 +%endif +%else +./mach build -v 2>&1 | cat - || exit 1 +%endif + +%install +export MACH_USE_SYSTEM_PYTHON=1 +%if %{launch_wayland_compositor} +cp %{SOURCE45} . +. ./run-wayland-compositor +%endif + +%if 0%{?run_firefox_tests} +mkdir -p objdir/_virtualenvs/init_py3 +cat > objdir/_virtualenvs/init_py3/pip.conf << EOF +[global] +find-links=`pwd`/mochitest-python +no-index=true +EOF +tar xf %{SOURCE37} +cp %{SOURCE40} %{SOURCE41} %{SOURCE42} %{SOURCE38} %{SOURCE39} %{SOURCE43} %{SOURCE44} . +mkdir -p test_results +%if %{test_on_wayland} +./run-tests-wayland || true +%else +./run-tests-x11 || true +%endif +./print_results > test_summary.txt 2>&1 || true +./print_failures || true +%endif + +cat > objdir/dist/bin/browser/defaults/preferences/firefox-l10n.js << EOF +pref("general.useragent.locale", "chrome://global/locale/intl.properties"); +EOF + +DESTDIR=%{buildroot} make -C objdir install +mkdir -p %{buildroot}{%{_libdir},%{_bindir},%{_datadir}/applications} + +desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE20} +desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE31} +desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE29} + +rm -rf %{buildroot}%{_bindir}/firefox +sed -e 's,/__PREFIX__,%{_prefix},g' %{SOURCE21} > %{buildroot}%{_bindir}/firefox +chmod 755 %{buildroot}%{_bindir}/firefox +sed -i -e 's|%FLATPAK_ENV_VARS%||' %{buildroot}%{_bindir}/firefox +sed -e 's,/__PREFIX__,%{_prefix},g' %{SOURCE30} > %{buildroot}%{_bindir}/firefox-x11 +chmod 755 %{buildroot}%{_bindir}/firefox-x11 +sed -e 's,/__PREFIX__,%{_prefix},g' %{SOURCE28} > %{buildroot}%{_bindir}/firefox-wayland +chmod 755 %{buildroot}%{_bindir}/firefox-wayland + +install -p -D -m 644 %{SOURCE23} %{buildroot}%{_mandir}/man1/firefox.1 + +rm -f %{buildroot}/%{mozappdir}/firefox-config +rm -f %{buildroot}/%{mozappdir}/update-settings.ini + +for s in 16 22 24 32 48 256; do + mkdir -p %{buildroot}%{_datadir}/icons/hicolor/${s}x${s}/apps + cp -p browser/branding/official/default${s}.png \ + %{buildroot}%{_datadir}/icons/hicolor/${s}x${s}/apps/firefox.png +done + +mkdir -p %{buildroot}%{_datadir}/icons/hicolor/symbolic/apps +cp -p %{SOURCE25} \ + %{buildroot}%{_datadir}/icons/hicolor/symbolic/apps + +echo > %{name}.lang +%if %{with langpacks} +mkdir -p %{buildroot}%{langpackdir} +tar xf %{SOURCE1} +for langpack in `ls firefox-langpacks/*.xpi`; do + language=`basename $langpack .xpi` + extensionID=langpack-$language@firefox.mozilla.org + mkdir -p $extensionID + unzip -qq $langpack -d $extensionID + find $extensionID -type f | xargs chmod 644 + + cd $extensionID + zip -qq -r9mX ../${extensionID}.xpi * + cd - + + install -m 644 ${extensionID}.xpi %{buildroot}%{langpackdir} + language=`echo $language | sed -e 's/-/_/g'` + echo "%%lang($language) %{langpackdir}/${extensionID}.xpi" >> %{name}.lang +done +rm -rf firefox-langpacks + +function create_default_langpack() { +language_long=$1 +language_short=$2 +cd %{buildroot}%{langpackdir} +ln -s langpack-$language_long@firefox.mozilla.org.xpi langpack-$language_short@firefox.mozilla.org.xpi +cd - +echo "%%lang($language_short) %{langpackdir}/langpack-$language_short@firefox.mozilla.org.xpi" >> %{name}.lang +} + +create_default_langpack "es-AR" "es" +create_default_langpack "fy-NL" "fy" +create_default_langpack "ga-IE" "ga" +create_default_langpack "gu-IN" "gu" +create_default_langpack "hi-IN" "hi" +create_default_langpack "hy-AM" "hy" +create_default_langpack "nb-NO" "nb" +create_default_langpack "nn-NO" "nn" +create_default_langpack "pa-IN" "pa" +create_default_langpack "pt-PT" "pt" +create_default_langpack "sv-SE" "sv" +create_default_langpack "zh-TW" "zh" +%endif + +mkdir -p %{buildroot}/%{mozappdir}/browser/defaults/preferences +mkdir -p %{buildroot}/%{_sysconfdir}/%{name}/pref +mkdir -p %{buildroot}%{_datadir}/mozilla/extensions/%{firefox_app_id} +mkdir -p %{buildroot}%{_libdir}/mozilla/extensions/%{firefox_app_id} +install -p -c -m 644 LICENSE %{buildroot}/%{mozappdir} +rm -rf %{buildroot}%{mozappdir}/dictionaries +ln -s %{_datadir}/hunspell %{buildroot}%{mozappdir}/dictionaries + +%if %{enable_mozilla_crashreporter} +./mach buildsymbols +sed -i -e "s/\[Crash Reporter\]/[Crash Reporter]\nEnabled=1/" %{buildroot}/%{mozappdir}/application.ini +mkdir -p %{buildroot}/%{moz_debug_dir} +cp objdir/dist/%{symbols_file_name} %{buildroot}/%{moz_debug_dir} +%endif + +%if 0%{?run_firefox_tests} +mkdir -p %{buildroot}/%{version}-%{release}/test_results +cp test_results/* %{buildroot}/%{version}-%{release}/test_results +cp test_summary.txt %{buildroot}/%{version}-%{release}/ +cp failures-* %{buildroot}/%{version}-%{release}/ || true +%endif + +cp %{SOURCE12} %{buildroot}%{mozappdir}/browser/defaults/preferences +%if %{?use_xdg_file_portal} +echo 'pref("widget.use-xdg-desktop-portal.file-picker", 1);' >> %{buildroot}%{mozappdir}/browser/defaults/preferences/firefox-anolis-default-prefs.js +%endif + +cp build/unix/run-mozilla.sh %{buildroot}%{mozappdir} + +mkdir -p %{buildroot}%{mozappdir}/distribution +cp %{SOURCE26} %{buildroot}%{mozappdir}/distribution + +mkdir -p %{buildroot}%{_datadir}/metainfo +sed -e "s/__VERSION__/%{version}/" \ + -e "s/__DATE__/$(date '+%F')/" \ + %{SOURCE33} > %{buildroot}%{_datadir}/metainfo/firefox.appdata.xml + +mkdir -p %{buildroot}%{_datadir}/gnome-shell/search-providers +cp %{SOURCE34} %{buildroot}%{_datadir}/gnome-shell/search-providers + +rm -f %{buildroot}%{mozappdirdev}/sdk/lib/libmozjs.so +rm -f %{buildroot}%{mozappdirdev}/sdk/lib/libmozalloc.so +rm -f %{buildroot}%{mozappdirdev}/sdk/lib/libxul.so + +%pretrans -p +require 'posix' +require 'os' +if (posix.stat("%{mozappdir}/browser/defaults/preferences", "type") == "link") then + posix.unlink("%{mozappdir}/browser/defaults/preferences") + posix.mkdir("%{mozappdir}/browser/defaults/preferences") + if (posix.stat("%{mozappdir}/defaults/preferences", "type") == "directory") then + for i,filename in pairs(posix.dir("%{mozappdir}/defaults/preferences")) do + os.rename("%{mozappdir}/defaults/preferences/"..filename, "%{mozappdir}/browser/defaults/preferences/"..filename) + end + f = io.open("%{mozappdir}/defaults/preferences/README","w") + if f then + f:write("Content of this directory has been moved to %{mozappdir}/browser/defaults/preferences.") + f:close() + end + end +end + +%check +appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/*.appdata.xml + +%preun +if [ $1 -eq 0 ]; then + rm -rf %{mozappdir}/components + rm -rf %{mozappdir}/extensions + rm -rf %{mozappdir}/plugins + rm -rf %{langpackdir} +fi + +%if %{with langpacks_subpkg} +%files +%else +%files -f %{name}.lang +%endif +%{_bindir}/firefox +%{mozappdir}/firefox +%{mozappdir}/firefox-bin +%doc %{_mandir}/man1/* +%dir %{_sysconfdir}/%{name} +%dir %{_sysconfdir}/%{name}/* +%dir %{_datadir}/mozilla/extensions/* +%dir %{_libdir}/mozilla/extensions/* +%{_datadir}/applications/%{name}.desktop +%{_datadir}/metainfo/*.appdata.xml +%{_datadir}/gnome-shell/search-providers/*.ini +%dir %{mozappdir} +%license %{mozappdir}/LICENSE +%{mozappdir}/browser/chrome +%{mozappdir}/browser/defaults/preferences/firefox-anolis-default-prefs.js +%{mozappdir}/browser/features/*.xpi +%{mozappdir}/distribution/distribution.ini +%ghost %{mozappdir}/browser/features/aushelper@mozilla.org.xpi +%if %{without langpacks_subpkg} +%if %{with langpacks} +%dir %{langpackdir} +%endif +%endif +%{mozappdir}/browser/omni.ja +%{mozappdir}/run-mozilla.sh +%{mozappdir}/application.ini +%{mozappdir}/pingsender +%exclude %{mozappdir}/removed-files +%{_datadir}/icons/hicolor/16x16/apps/firefox.png +%{_datadir}/icons/hicolor/22x22/apps/firefox.png +%{_datadir}/icons/hicolor/24x24/apps/firefox.png +%{_datadir}/icons/hicolor/256x256/apps/firefox.png +%{_datadir}/icons/hicolor/32x32/apps/firefox.png +%{_datadir}/icons/hicolor/48x48/apps/firefox.png +%{_datadir}/icons/hicolor/symbolic/apps/firefox-symbolic.svg +%if %{enable_mozilla_crashreporter} +%{mozappdir}/crashreporter +%{mozappdir}/crashreporter.ini +%{mozappdir}/minidump-analyzer +%{mozappdir}/Throbber-small.gif +%{mozappdir}/browser/crashreporter-override.ini +%endif +%{mozappdir}/*.so +%{mozappdir}/defaults/pref/channel-prefs.js +%{mozappdir}/dependentlibs.list +%{mozappdir}/dictionaries +%{mozappdir}/omni.ja +%{mozappdir}/platform.ini +%{mozappdir}/plugin-container +%{mozappdir}/gmp-clearkey +%{mozappdir}/fonts/TwemojiMozilla.ttf +%if !%{?system_nss} +%exclude %{mozappdir}/libnssckbi.so +%endif +%if %{build_with_asan} +%{mozappdir}/llvm-symbolizer +%endif + +%files x11 +%{_bindir}/firefox-x11 +%{_datadir}/applications/firefox-x11.desktop + +%files wayland +%{_bindir}/firefox-wayland +%{_datadir}/applications/firefox-wayland.desktop + +%changelog +* Fri Apr 21 2023 Chunmei Xu - 112.0.1-1 +- init from upstream diff --git a/gen_cbindgen-vendor.sh b/gen_cbindgen-vendor.sh new file mode 100755 index 0000000000000000000000000000000000000000..c2b60f0cf479b8cf59f71107b33e89bc0cec7a71 --- /dev/null +++ b/gen_cbindgen-vendor.sh @@ -0,0 +1,32 @@ +#!/bin/bash +set -x + +# Dummy Cargo.toml file with cbindgen dependency +cat > Cargo.toml < +Date: Fri, 17 Mar 2023 10:58:10 +0100 +Subject: [PATCH] PipeWire capturer: import DMABufs directly into desktop frame + +Originally DMABufs were imported into a temporary buffer followed by a +copy operation into the desktop frame itself. This is not needed as we +can import them directly into desktop frames and avoid this overhead. + +Also drop support for MemPtr buffers as both Mutter and KWin don't seem +to support them and they are going to be too slow anyway. + +Testing with latest Chromium, I could see two processes with usage around 20% and 40% without this change going down to 10% and 20% with +this change applied. + +Bug: webrtc:13429 +Bug: chrome:1378258 +Change-Id: Ice3292528ff56300931c8638f8e03d4883d5e331 +Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/297501 +Reviewed-by: Alexander Cooper +Commit-Queue: Jan Grulich +Cr-Commit-Position: refs/heads/main@{#39594} +--- + +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc +index 5bbd5d7aba..b529077c6d 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc +@@ -101,11 +101,23 @@ typedef void (*glDeleteTextures_func)(GLsizei n, const GLuint* textures); + typedef void (*glGenTextures_func)(GLsizei n, GLuint* textures); + typedef GLenum (*glGetError_func)(void); + typedef const GLubyte* (*glGetString_func)(GLenum name); +-typedef void (*glGetTexImage_func)(GLenum target, +- GLint level, +- GLenum format, +- GLenum type, +- void* pixels); ++typedef void (*glReadPixels_func)(GLint x, ++ GLint y, ++ GLsizei width, ++ GLsizei height, ++ GLenum format, ++ GLenum type, ++ void* data); ++typedef void (*glGenFramebuffers_func)(GLsizei n, GLuint* ids); ++typedef void (*glDeleteFramebuffers_func)(GLsizei n, ++ const GLuint* framebuffers); ++typedef void (*glBindFramebuffer_func)(GLenum target, GLuint framebuffer); ++typedef void (*glFramebufferTexture2D_func)(GLenum target, ++ GLenum attachment, ++ GLenum textarget, ++ GLuint texture, ++ GLint level); ++typedef GLenum (*glCheckFramebufferStatus_func)(GLenum target); + typedef void (*glTexParameteri_func)(GLenum target, GLenum pname, GLint param); + typedef void* (*glXGetProcAddressARB_func)(const char*); + +@@ -118,7 +130,12 @@ glDeleteTextures_func GlDeleteTextures = nullptr; + glGenTextures_func GlGenTextures = nullptr; + glGetError_func GlGetError = nullptr; + glGetString_func GlGetString = nullptr; +-glGetTexImage_func GlGetTexImage = nullptr; ++glReadPixels_func GlReadPixels = nullptr; ++glGenFramebuffers_func GlGenFramebuffers = nullptr; ++glDeleteFramebuffers_func GlDeleteFramebuffers = nullptr; ++glBindFramebuffer_func GlBindFramebuffer = nullptr; ++glFramebufferTexture2D_func GlFramebufferTexture2D = nullptr; ++glCheckFramebufferStatus_func GlCheckFramebufferStatus = nullptr; + glTexParameteri_func GlTexParameteri = nullptr; + glXGetProcAddressARB_func GlXGetProcAddressARB = nullptr; + +@@ -279,12 +296,26 @@ static bool LoadGL() { + (glDeleteTextures_func)GlXGetProcAddressARB("glDeleteTextures"); + GlGenTextures = (glGenTextures_func)GlXGetProcAddressARB("glGenTextures"); + GlGetError = (glGetError_func)GlXGetProcAddressARB("glGetError"); +- GlGetTexImage = (glGetTexImage_func)GlXGetProcAddressARB("glGetTexImage"); ++ GlReadPixels = (glReadPixels_func)GlXGetProcAddressARB("glReadPixels"); ++ GlGenFramebuffers = ++ (glGenFramebuffers_func)GlXGetProcAddressARB("glGenFramebuffers"); ++ GlDeleteFramebuffers = ++ (glDeleteFramebuffers_func)GlXGetProcAddressARB("glDeleteFramebuffers"); ++ GlBindFramebuffer = ++ (glBindFramebuffer_func)GlXGetProcAddressARB("glBindFramebuffer"); ++ GlFramebufferTexture2D = (glFramebufferTexture2D_func)GlXGetProcAddressARB( ++ "glFramebufferTexture2D"); ++ GlCheckFramebufferStatus = ++ (glCheckFramebufferStatus_func)GlXGetProcAddressARB( ++ "glCheckFramebufferStatus"); ++ + GlTexParameteri = + (glTexParameteri_func)GlXGetProcAddressARB("glTexParameteri"); + + return GlBindTexture && GlDeleteTextures && GlGenTextures && GlGetError && +- GlGetTexImage && GlTexParameteri; ++ GlReadPixels && GlGenFramebuffers && GlDeleteFramebuffers && ++ GlBindFramebuffer && GlFramebufferTexture2D && ++ GlCheckFramebufferStatus && GlTexParameteri; + } + + return false; +@@ -435,6 +466,14 @@ EglDmaBuf::~EglDmaBuf() { + EglTerminate(egl_.display); + } + ++ if (fbo_) { ++ GlDeleteFramebuffers(1, &fbo_); ++ } ++ ++ if (texture_) { ++ GlDeleteTextures(1, &texture_); ++ } ++ + // BUG: crbug.com/1290566 + // Closing libEGL.so.1 when using NVidia drivers causes a crash + // when EglGetPlatformDisplayEXT() is used, at least this one is enough +@@ -466,20 +505,20 @@ bool EglDmaBuf::GetClientExtensions(EGLDisplay dpy, EGLint name) { + } + + RTC_NO_SANITIZE("cfi-icall") +-std::unique_ptr EglDmaBuf::ImageFromDmaBuf( +- const DesktopSize& size, +- uint32_t format, +- const std::vector& plane_datas, +- uint64_t modifier) { +- std::unique_ptr src; +- ++bool EglDmaBuf::ImageFromDmaBuf(const DesktopSize& size, ++ uint32_t format, ++ const std::vector& plane_datas, ++ uint64_t modifier, ++ const DesktopVector& offset, ++ const DesktopSize& buffer_size, ++ uint8_t* data) { + if (!egl_initialized_) { +- return src; ++ return false; + } + + if (plane_datas.size() <= 0) { + RTC_LOG(LS_ERROR) << "Failed to process buffer: invalid number of planes"; +- return src; ++ return false; + } + + EGLint attribs[47]; +@@ -568,20 +607,32 @@ std::unique_ptr EglDmaBuf::ImageFromDmaBuf( + if (image == EGL_NO_IMAGE) { + RTC_LOG(LS_ERROR) << "Failed to record frame: Error creating EGLImage - " + << FormatEGLError(EglGetError()); +- return src; ++ return false; + } + + // create GL 2D texture for framebuffer +- GLuint texture; +- GlGenTextures(1, &texture); +- GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); +- GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); +- GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); +- GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); +- GlBindTexture(GL_TEXTURE_2D, texture); ++ if (!texture_) { ++ GlGenTextures(1, &texture_); ++ GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); ++ GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); ++ GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); ++ GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); ++ } ++ GlBindTexture(GL_TEXTURE_2D, texture_); + GlEGLImageTargetTexture2DOES(GL_TEXTURE_2D, image); + +- src = std::make_unique(plane_datas[0].stride * size.height()); ++ if (!fbo_) { ++ GlGenFramebuffers(1, &fbo_); ++ } ++ ++ GlBindFramebuffer(GL_FRAMEBUFFER, fbo_); ++ GlFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, ++ texture_, 0); ++ if (GlCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) { ++ RTC_LOG(LS_ERROR) << "Failed to bind DMA buf framebuffer"; ++ EglDestroyImageKHR(egl_.display, image); ++ return false; ++ } + + GLenum gl_format = GL_BGRA; + switch (format) { +@@ -598,17 +649,18 @@ std::unique_ptr EglDmaBuf::ImageFromDmaBuf( + gl_format = GL_BGRA; + break; + } +- GlGetTexImage(GL_TEXTURE_2D, 0, gl_format, GL_UNSIGNED_BYTE, src.get()); + +- if (GlGetError()) { ++ GlReadPixels(offset.x(), offset.y(), buffer_size.width(), ++ buffer_size.height(), gl_format, GL_UNSIGNED_BYTE, data); ++ ++ const GLenum error = GlGetError(); ++ if (error) { + RTC_LOG(LS_ERROR) << "Failed to get image from DMA buffer."; +- return src; + } + +- GlDeleteTextures(1, &texture); + EglDestroyImageKHR(egl_.display, image); + +- return src; ++ return !error; + } + + RTC_NO_SANITIZE("cfi-icall") +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.h b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.h +index f1d96b2f80..22a8f5ab52 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.h ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.h +@@ -41,11 +41,15 @@ class EglDmaBuf { + EglDmaBuf(); + ~EglDmaBuf(); + +- std::unique_ptr ImageFromDmaBuf( +- const DesktopSize& size, +- uint32_t format, +- const std::vector& plane_datas, +- uint64_t modifiers); ++ // Returns whether the image was successfully imported from ++ // given DmaBuf and its parameters ++ bool ImageFromDmaBuf(const DesktopSize& size, ++ uint32_t format, ++ const std::vector& plane_datas, ++ uint64_t modifiers, ++ const DesktopVector& offset, ++ const DesktopSize& buffer_size, ++ uint8_t* data); + std::vector QueryDmaBufModifiers(uint32_t format); + + bool IsEglInitialized() const { return egl_initialized_; } +@@ -58,6 +62,8 @@ class EglDmaBuf { + int32_t drm_fd_ = -1; // for GBM buffer mmap + gbm_device* gbm_device_ = nullptr; // for passed GBM buffer retrieval + ++ GLuint fbo_ = 0; ++ GLuint texture_ = 0; + EGLStruct egl_; + + absl::optional GetRenderNode(); +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc +index 0ca75d00fc..a8879764c7 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc +@@ -149,6 +149,12 @@ class SharedScreenCastStreamPrivate { + struct spa_video_info_raw spa_video_format_; + + void ProcessBuffer(pw_buffer* buffer); ++ bool ProcessMemFDBuffer(pw_buffer* buffer, ++ DesktopFrame& frame, ++ const DesktopVector& offset); ++ bool ProcessDMABuffer(pw_buffer* buffer, ++ DesktopFrame& frame, ++ const DesktopVector& offset); + void ConvertRGBxToBGRx(uint8_t* frame, uint32_t size); + + // PipeWire callbacks +@@ -268,9 +274,8 @@ void SharedScreenCastStreamPrivate::OnStreamParamChanged( + std::vector params; + const int buffer_types = + has_modifier || (that->pw_server_version_ >= kDmaBufMinVersion) +- ? (1 << SPA_DATA_DmaBuf) | (1 << SPA_DATA_MemFd) | +- (1 << SPA_DATA_MemPtr) +- : (1 << SPA_DATA_MemFd) | (1 << SPA_DATA_MemPtr); ++ ? (1 << SPA_DATA_DmaBuf) | (1 << SPA_DATA_MemFd) ++ : (1 << SPA_DATA_MemFd); + + params.push_back(reinterpret_cast(spa_pod_builder_add_object( + &builder, SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers, +@@ -605,9 +610,6 @@ DesktopVector SharedScreenCastStreamPrivate::CaptureCursorPosition() { + RTC_NO_SANITIZE("cfi-icall") + void SharedScreenCastStreamPrivate::ProcessBuffer(pw_buffer* buffer) { + spa_buffer* spa_buffer = buffer->buffer; +- ScopedBuf map; +- std::unique_ptr src_unique_ptr; +- uint8_t* src = nullptr; + + // Try to update the mouse cursor first, because it can be the only + // information carried by the buffer +@@ -641,76 +643,6 @@ void SharedScreenCastStreamPrivate::ProcessBuffer(pw_buffer* buffer) { + return; + } + +- if (spa_buffer->datas[0].type == SPA_DATA_MemFd) { +- map.initialize( +- static_cast( +- mmap(nullptr, +- spa_buffer->datas[0].maxsize + spa_buffer->datas[0].mapoffset, +- PROT_READ, MAP_PRIVATE, spa_buffer->datas[0].fd, 0)), +- spa_buffer->datas[0].maxsize + spa_buffer->datas[0].mapoffset, +- spa_buffer->datas[0].fd); +- +- if (!map) { +- RTC_LOG(LS_ERROR) << "Failed to mmap the memory: " +- << std::strerror(errno); +- return; +- } +- +- src = SPA_MEMBER(map.get(), spa_buffer->datas[0].mapoffset, uint8_t); +- } else if (spa_buffer->datas[0].type == SPA_DATA_DmaBuf) { +- const uint n_planes = spa_buffer->n_datas; +- +- if (!n_planes) { +- return; +- } +- +- std::vector plane_datas; +- for (uint32_t i = 0; i < n_planes; ++i) { +- EglDmaBuf::PlaneData data = { +- static_cast(spa_buffer->datas[i].fd), +- static_cast(spa_buffer->datas[i].chunk->stride), +- static_cast(spa_buffer->datas[i].chunk->offset)}; +- plane_datas.push_back(data); +- } +- +- // When importing DMA-BUFs, we use the stride (number of bytes from one row +- // of pixels in the buffer) provided by PipeWire. The stride from PipeWire +- // is given by the graphics driver and some drivers might add some +- // additional padding for memory layout optimizations so not everytime the +- // stride is equal to BYTES_PER_PIXEL x WIDTH. This is fine, because during +- // the import we will use OpenGL and same graphics driver so it will be able +- // to work with the stride it provided, but later on when we work with +- // images we get from DMA-BUFs we will need to update the stride to be equal +- // to BYTES_PER_PIXEL x WIDTH as that's the size of the DesktopFrame we +- // allocate for each captured frame. +- src_unique_ptr = egl_dmabuf_->ImageFromDmaBuf( +- stream_size_, spa_video_format_.format, plane_datas, modifier_); +- if (src_unique_ptr) { +- src = src_unique_ptr.get(); +- } else { +- RTC_LOG(LS_ERROR) << "Dropping DMA-BUF modifier: " << modifier_ +- << " and trying to renegotiate stream parameters"; +- +- if (pw_server_version_ >= kDropSingleModifierMinVersion) { +- modifiers_.erase( +- std::remove(modifiers_.begin(), modifiers_.end(), modifier_), +- modifiers_.end()); +- } else { +- modifiers_.clear(); +- } +- +- pw_loop_signal_event(pw_thread_loop_get_loop(pw_main_loop_), +- renegotiate_); +- return; +- } +- } else if (spa_buffer->datas[0].type == SPA_DATA_MemPtr) { +- src = static_cast(spa_buffer->datas[0].data); +- } +- +- if (!src) { +- return; +- } +- + // Use SPA_META_VideoCrop metadata to get the frame size. KDE and GNOME do + // handle screen/window sharing differently. KDE/KWin doesn't use + // SPA_META_VideoCrop metadata and when sharing a window, it always sets +@@ -763,8 +695,8 @@ void SharedScreenCastStreamPrivate::ProcessBuffer(pw_buffer* buffer) { + } + + // Get the position of the video crop within the stream. Just double-check +- // that the position doesn't exceed the size of the stream itself. NOTE: +- // Currently it looks there is no implementation using this. ++ // that the position doesn't exceed the size of the stream itself. ++ // NOTE: Currently it looks there is no implementation using this. + uint32_t y_offset = + videocrop_metadata_use && + (videocrop_metadata->region.position.y + frame_size_.height() <= +@@ -777,22 +709,7 @@ void SharedScreenCastStreamPrivate::ProcessBuffer(pw_buffer* buffer) { + stream_size_.width()) + ? videocrop_metadata->region.position.x + : 0; +- +- const uint32_t stream_stride = kBytesPerPixel * stream_size_.width(); +- uint32_t buffer_stride = spa_buffer->datas[0].chunk->stride; +- uint32_t src_stride = buffer_stride; +- +- if (spa_buffer->datas[0].type == SPA_DATA_DmaBuf && +- buffer_stride > stream_stride) { +- // When DMA-BUFs are used, sometimes spa_buffer->stride we get might +- // contain additional padding, but after we import the buffer, the stride +- // we used is no longer relevant and we should just calculate it based on +- // the stream width. For more context see https://crbug.com/1333304. +- src_stride = stream_stride; +- } +- +- uint8_t* updated_src = +- src + (src_stride * y_offset) + (kBytesPerPixel * x_offset); ++ DesktopVector offset = DesktopVector(x_offset, y_offset); + + webrtc::MutexLock lock(&queue_lock_); + +@@ -813,9 +730,17 @@ void SharedScreenCastStreamPrivate::ProcessBuffer(pw_buffer* buffer) { + queue_.ReplaceCurrentFrame(SharedDesktopFrame::Wrap(std::move(frame))); + } + +- queue_.current_frame()->CopyPixelsFrom( +- updated_src, (src_stride - (kBytesPerPixel * x_offset)), +- DesktopRect::MakeWH(frame_size_.width(), frame_size_.height())); ++ bool bufferProcessed = false; ++ if (spa_buffer->datas[0].type == SPA_DATA_MemFd) { ++ bufferProcessed = ++ ProcessMemFDBuffer(buffer, *queue_.current_frame(), offset); ++ } else if (spa_buffer->datas[0].type == SPA_DATA_DmaBuf) { ++ bufferProcessed = ProcessDMABuffer(buffer, *queue_.current_frame(), offset); ++ } ++ ++ if (!bufferProcessed) { ++ return; ++ } + + if (spa_video_format_.format == SPA_VIDEO_FORMAT_RGBx || + spa_video_format_.format == SPA_VIDEO_FORMAT_RGBA) { +@@ -832,6 +757,87 @@ void SharedScreenCastStreamPrivate::ProcessBuffer(pw_buffer* buffer) { + DesktopRect::MakeSize(queue_.current_frame()->size())); + } + ++RTC_NO_SANITIZE("cfi-icall") ++bool SharedScreenCastStreamPrivate::ProcessMemFDBuffer( ++ pw_buffer* buffer, ++ DesktopFrame& frame, ++ const DesktopVector& offset) { ++ spa_buffer* spa_buffer = buffer->buffer; ++ ScopedBuf map; ++ uint8_t* src = nullptr; ++ ++ map.initialize( ++ static_cast( ++ mmap(nullptr, ++ spa_buffer->datas[0].maxsize + spa_buffer->datas[0].mapoffset, ++ PROT_READ, MAP_PRIVATE, spa_buffer->datas[0].fd, 0)), ++ spa_buffer->datas[0].maxsize + spa_buffer->datas[0].mapoffset, ++ spa_buffer->datas[0].fd); ++ ++ if (!map) { ++ RTC_LOG(LS_ERROR) << "Failed to mmap the memory: " << std::strerror(errno); ++ return false; ++ } ++ ++ src = SPA_MEMBER(map.get(), spa_buffer->datas[0].mapoffset, uint8_t); ++ ++ uint32_t buffer_stride = spa_buffer->datas[0].chunk->stride; ++ uint32_t src_stride = buffer_stride; ++ ++ uint8_t* updated_src = ++ src + (src_stride * offset.y()) + (kBytesPerPixel * offset.x()); ++ ++ frame.CopyPixelsFrom( ++ updated_src, (src_stride - (kBytesPerPixel * offset.x())), ++ DesktopRect::MakeWH(frame.size().width(), frame.size().height())); ++ ++ return true; ++} ++ ++RTC_NO_SANITIZE("cfi-icall") ++bool SharedScreenCastStreamPrivate::ProcessDMABuffer( ++ pw_buffer* buffer, ++ DesktopFrame& frame, ++ const DesktopVector& offset) { ++ spa_buffer* spa_buffer = buffer->buffer; ++ ++ const uint n_planes = spa_buffer->n_datas; ++ ++ if (!n_planes) { ++ return false; ++ } ++ ++ std::vector plane_datas; ++ for (uint32_t i = 0; i < n_planes; ++i) { ++ EglDmaBuf::PlaneData data = { ++ static_cast(spa_buffer->datas[i].fd), ++ static_cast(spa_buffer->datas[i].chunk->stride), ++ static_cast(spa_buffer->datas[i].chunk->offset)}; ++ plane_datas.push_back(data); ++ } ++ ++ const bool imported = egl_dmabuf_->ImageFromDmaBuf( ++ stream_size_, spa_video_format_.format, plane_datas, modifier_, offset, ++ frame.size(), frame.data()); ++ if (!imported) { ++ RTC_LOG(LS_ERROR) << "Dropping DMA-BUF modifier: " << modifier_ ++ << " and trying to renegotiate stream parameters"; ++ ++ if (pw_server_version_ >= kDropSingleModifierMinVersion) { ++ modifiers_.erase( ++ std::remove(modifiers_.begin(), modifiers_.end(), modifier_), ++ modifiers_.end()); ++ } else { ++ modifiers_.clear(); ++ } ++ ++ pw_loop_signal_event(pw_thread_loop_get_loop(pw_main_loop_), renegotiate_); ++ return false; ++ } ++ ++ return true; ++} ++ + void SharedScreenCastStreamPrivate::ConvertRGBxToBGRx(uint8_t* frame, + uint32_t size) { + for (uint32_t i = 0; i < size; i += 4) { diff --git a/mozilla-1196777.patch b/mozilla-1196777.patch new file mode 100644 index 0000000000000000000000000000000000000000..864741e5baf9f06ae8b5b8778371cf29fa73a450 --- /dev/null +++ b/mozilla-1196777.patch @@ -0,0 +1,13 @@ +diff -up firefox-100.0/widget/gtk/nsWindow.cpp.1196777 firefox-100.0/widget/gtk/nsWindow.cpp +--- firefox-100.0/widget/gtk/nsWindow.cpp.1196777 2022-05-02 11:29:06.763325015 +0200 ++++ firefox-100.0/widget/gtk/nsWindow.cpp 2022-05-02 11:30:49.100717334 +0200 +@@ -163,7 +163,8 @@ const gint kEvents = GDK_TOUCHPAD_GESTUR + GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | + GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | + GDK_SMOOTH_SCROLL_MASK | GDK_TOUCH_MASK | GDK_SCROLL_MASK | +- GDK_POINTER_MOTION_MASK | GDK_PROPERTY_CHANGE_MASK; ++ GDK_POINTER_MOTION_MASK | GDK_PROPERTY_CHANGE_MASK | ++ GDK_FOCUS_CHANGE_MASK; + + /* utility functions */ + static bool is_mouse_in_window(GdkWindow* aWindow, gdouble aMouseX, diff --git a/mozilla-1516803.patch b/mozilla-1516803.patch new file mode 100644 index 0000000000000000000000000000000000000000..5053e5196066e0d9c3f28bcac7c950e7339b15c5 --- /dev/null +++ b/mozilla-1516803.patch @@ -0,0 +1,15 @@ +diff -up firefox-84.0/security/sandbox/linux/moz.build.1516803 firefox-84.0/security/sandbox/linux/moz.build +--- firefox-84.0/security/sandbox/linux/moz.build.1516803 2020-12-10 16:17:55.425139545 +0100 ++++ firefox-84.0/security/sandbox/linux/moz.build 2020-12-10 16:29:21.945860841 +0100 +@@ -114,9 +114,8 @@ if CONFIG["CC_TYPE"] in ("clang", "gcc") + # gcc lto likes to put the top level asm in syscall.cc in a different partition + # from the function using it which breaks the build. Work around that by + # forcing there to be only one partition. +-for f in CONFIG["OS_CXXFLAGS"]: +- if f.startswith("-flto") and CONFIG["CC_TYPE"] != "clang": +- LDFLAGS += ["--param lto-partitions=1"] ++if CONFIG['CC_TYPE'] != 'clang': ++ LDFLAGS += ['--param', 'lto-partitions=1'] + + DEFINES["NS_NO_XPCOM"] = True + DisableStlWrapping() diff --git a/mozilla-1663844.patch b/mozilla-1663844.patch new file mode 100644 index 0000000000000000000000000000000000000000..afa5168a8c92b04e21443b63706f9d3f476e1c91 --- /dev/null +++ b/mozilla-1663844.patch @@ -0,0 +1,37 @@ +diff -up firefox-109.0/dom/media/gmp/GMPSharedMemManager.h.1663844 firefox-109.0/dom/media/gmp/GMPSharedMemManager.h +--- firefox-109.0/dom/media/gmp/GMPSharedMemManager.h.1663844 2023-01-09 20:34:10.000000000 +0100 ++++ firefox-109.0/dom/media/gmp/GMPSharedMemManager.h 2023-01-12 09:28:56.035741438 +0100 +@@ -26,7 +26,7 @@ class GMPSharedMem { + // returned to the parent pool (which is not included). If more than + // this are needed, we presume the client has either crashed or hung + // (perhaps temporarily). +- static const uint32_t kGMPBufLimit = 20; ++ static const uint32_t kGMPBufLimit = 40; + + GMPSharedMem() { + for (size_t i = 0; i < sizeof(mGmpAllocated) / sizeof(mGmpAllocated[0]); +diff -up firefox-109.0/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp.1663844 firefox-109.0/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp +--- firefox-109.0/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp.1663844 2023-01-09 20:34:10.000000000 +0100 ++++ firefox-109.0/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp 2023-01-12 09:28:56.036741473 +0100 +@@ -84,6 +84,9 @@ media::DecodeSupportSet GMPDecoderModule + + media::DecodeSupportSet GMPDecoderModule::SupportsMimeType( + const nsACString& aMimeType, DecoderDoctorDiagnostics* aDiagnostics) const { ++ if (MP4Decoder::IsH264(aMimeType)) { ++ return media::DecodeSupport::SoftwareDecode; ++ } + return media::DecodeSupport::Unsupported; + } + +diff -up firefox-109.0/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp.1663844 firefox-109.0/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp +--- firefox-109.0/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp.1663844 2023-01-12 09:28:56.036741473 +0100 ++++ firefox-109.0/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp 2023-01-12 14:18:12.354866405 +0100 +@@ -81,6 +81,8 @@ void GMPVideoDecoder::Decoded(GMPVideoi4 + }); + + mDecodedData.AppendElement(std::move(v)); ++ mDecodePromise.ResolveIfExists(std::move(mDecodedData), __func__); ++ mDecodedData = DecodedData(); + } else { + mDecodedData.Clear(); + mDecodePromise.RejectIfExists( diff --git a/mozilla-1667096.patch b/mozilla-1667096.patch new file mode 100644 index 0000000000000000000000000000000000000000..85dd72930da81eb69a3305dbae175d07ced70930 --- /dev/null +++ b/mozilla-1667096.patch @@ -0,0 +1,549 @@ +diff -up firefox-108.0/media/ffvpx/libavcodec/codec_list.c.1667096 firefox-108.0/media/ffvpx/libavcodec/codec_list.c +--- firefox-108.0/media/ffvpx/libavcodec/codec_list.c.1667096 2022-12-05 21:18:00.000000000 +0100 ++++ firefox-108.0/media/ffvpx/libavcodec/codec_list.c 2022-12-08 08:29:54.513562296 +0100 +@@ -11,6 +11,9 @@ static const FFCodec * const codec_list[ + #if CONFIG_MP3_DECODER + &ff_mp3_decoder, + #endif ++#ifdef CONFIG_LIBFDK_AAC ++ &ff_libfdk_aac_decoder, ++#endif + #if CONFIG_LIBDAV1D + &ff_libdav1d_decoder, + #endif +diff -up firefox-108.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-108.0/media/ffvpx/libavcodec/libfdk-aacdec.c +--- firefox-108.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 2022-12-08 08:29:54.514562328 +0100 ++++ firefox-108.0/media/ffvpx/libavcodec/libfdk-aacdec.c 2022-09-03 18:20:04.000000000 +0200 +@@ -0,0 +1,497 @@ ++/* ++ * AAC decoder wrapper ++ * Copyright (c) 2012 Martin Storsjo ++ * ++ * This file is part of FFmpeg. ++ * ++ * Permission to use, copy, modify, and/or distribute this software for any ++ * purpose with or without fee is hereby granted, provided that the above ++ * copyright notice and this permission notice appear in all copies. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES ++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF ++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF ++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ++ */ ++ ++#include ++ ++#include "libavutil/channel_layout.h" ++#include "libavutil/common.h" ++#include "libavutil/opt.h" ++#include "avcodec.h" ++#include "codec_internal.h" ++#include "decode.h" ++ ++#ifdef AACDECODER_LIB_VL0 ++#define FDKDEC_VER_AT_LEAST(vl0, vl1) \ ++ ((AACDECODER_LIB_VL0 > vl0) || \ ++ (AACDECODER_LIB_VL0 == vl0 && AACDECODER_LIB_VL1 >= vl1)) ++#else ++#define FDKDEC_VER_AT_LEAST(vl0, vl1) 0 ++#endif ++ ++#if !FDKDEC_VER_AT_LEAST(2, 5) // < 2.5.10 ++#define AAC_PCM_MAX_OUTPUT_CHANNELS AAC_PCM_OUTPUT_CHANNELS ++#endif ++ ++enum ConcealMethod { ++ CONCEAL_METHOD_SPECTRAL_MUTING = 0, ++ CONCEAL_METHOD_NOISE_SUBSTITUTION = 1, ++ CONCEAL_METHOD_ENERGY_INTERPOLATION = 2, ++ CONCEAL_METHOD_NB, ++}; ++ ++typedef struct FDKAACDecContext { ++ const AVClass *class; ++ HANDLE_AACDECODER handle; ++ uint8_t *decoder_buffer; ++ int decoder_buffer_size; ++ uint8_t *anc_buffer; ++ int conceal_method; ++ int drc_level; ++ int drc_boost; ++ int drc_heavy; ++ int drc_effect; ++ int drc_cut; ++ int album_mode; ++ int level_limit; ++#if FDKDEC_VER_AT_LEAST(2, 5) // 2.5.10 ++ int output_delay_set; ++ int flush_samples; ++ int delay_samples; ++#endif ++ AVChannelLayout downmix_layout; ++} FDKAACDecContext; ++ ++ ++#define DMX_ANC_BUFFSIZE 128 ++#define DECODER_MAX_CHANNELS 8 ++#define DECODER_BUFFSIZE 2048 * sizeof(INT_PCM) ++ ++#define OFFSET(x) offsetof(FDKAACDecContext, x) ++#define AD AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM ++static const AVOption fdk_aac_dec_options[] = { ++ { "conceal", "Error concealment method", OFFSET(conceal_method), AV_OPT_TYPE_INT, { .i64 = CONCEAL_METHOD_NOISE_SUBSTITUTION }, CONCEAL_METHOD_SPECTRAL_MUTING, CONCEAL_METHOD_NB - 1, AD, "conceal" }, ++ { "spectral", "Spectral muting", 0, AV_OPT_TYPE_CONST, { .i64 = CONCEAL_METHOD_SPECTRAL_MUTING }, INT_MIN, INT_MAX, AD, "conceal" }, ++ { "noise", "Noise Substitution", 0, AV_OPT_TYPE_CONST, { .i64 = CONCEAL_METHOD_NOISE_SUBSTITUTION }, INT_MIN, INT_MAX, AD, "conceal" }, ++ { "energy", "Energy Interpolation", 0, AV_OPT_TYPE_CONST, { .i64 = CONCEAL_METHOD_ENERGY_INTERPOLATION }, INT_MIN, INT_MAX, AD, "conceal" }, ++ { "drc_boost", "Dynamic Range Control: boost, where [0] is none and [127] is max boost", ++ OFFSET(drc_boost), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 127, AD, NULL }, ++ { "drc_cut", "Dynamic Range Control: attenuation factor, where [0] is none and [127] is max compression", ++ OFFSET(drc_cut), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 127, AD, NULL }, ++ { "drc_level", "Dynamic Range Control: reference level, quantized to 0.25dB steps where [0] is 0dB and [127] is -31.75dB, -1 for auto, and -2 for disabled", ++ OFFSET(drc_level), AV_OPT_TYPE_INT, { .i64 = -1}, -2, 127, AD, NULL }, ++ { "drc_heavy", "Dynamic Range Control: heavy compression, where [1] is on (RF mode) and [0] is off", ++ OFFSET(drc_heavy), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 1, AD, NULL }, ++#if FDKDEC_VER_AT_LEAST(2, 5) // 2.5.10 ++ { "level_limit", "Signal level limiting", ++ OFFSET(level_limit), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, AD }, ++#endif ++#if FDKDEC_VER_AT_LEAST(3, 0) // 3.0.0 ++ { "drc_effect","Dynamic Range Control: effect type, where e.g. [0] is none and [6] is general", ++ OFFSET(drc_effect), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 8, AD, NULL }, ++#endif ++#if FDKDEC_VER_AT_LEAST(3, 1) // 3.1.0 ++ { "album_mode","Dynamic Range Control: album mode, where [0] is off and [1] is on", ++ OFFSET(album_mode), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 1, AD, NULL }, ++#endif ++ { "downmix", "Request a specific channel layout from the decoder", OFFSET(downmix_layout), AV_OPT_TYPE_CHLAYOUT, {.str = NULL}, .flags = AD }, ++ { NULL } ++}; ++ ++static const AVClass fdk_aac_dec_class = { ++ .class_name = "libfdk-aac decoder", ++ .item_name = av_default_item_name, ++ .option = fdk_aac_dec_options, ++ .version = LIBAVUTIL_VERSION_INT, ++}; ++ ++static int get_stream_info(AVCodecContext *avctx) ++{ ++ FDKAACDecContext *s = avctx->priv_data; ++ CStreamInfo *info = aacDecoder_GetStreamInfo(s->handle); ++ int channel_counts[0x24] = { 0 }; ++ int i, ch_error = 0; ++ uint64_t ch_layout = 0; ++ ++ if (!info) { ++ av_log(avctx, AV_LOG_ERROR, "Unable to get stream info\n"); ++ return AVERROR_UNKNOWN; ++ } ++ ++ if (info->sampleRate <= 0) { ++ av_log(avctx, AV_LOG_ERROR, "Stream info not initialized\n"); ++ return AVERROR_UNKNOWN; ++ } ++ avctx->sample_rate = info->sampleRate; ++ avctx->frame_size = info->frameSize; ++#if FDKDEC_VER_AT_LEAST(2, 5) // 2.5.10 ++ if (!s->output_delay_set && info->outputDelay) { ++ // Set this only once. ++ s->flush_samples = info->outputDelay; ++ s->delay_samples = info->outputDelay; ++ s->output_delay_set = 1; ++ } ++#endif ++ ++ for (i = 0; i < info->numChannels; i++) { ++ AUDIO_CHANNEL_TYPE ctype = info->pChannelType[i]; ++ if (ctype <= ACT_NONE || ctype >= FF_ARRAY_ELEMS(channel_counts)) { ++ av_log(avctx, AV_LOG_WARNING, "unknown channel type\n"); ++ break; ++ } ++ channel_counts[ctype]++; ++ } ++ av_log(avctx, AV_LOG_DEBUG, ++ "%d channels - front:%d side:%d back:%d lfe:%d top:%d\n", ++ info->numChannels, ++ channel_counts[ACT_FRONT], channel_counts[ACT_SIDE], ++ channel_counts[ACT_BACK], channel_counts[ACT_LFE], ++ channel_counts[ACT_FRONT_TOP] + channel_counts[ACT_SIDE_TOP] + ++ channel_counts[ACT_BACK_TOP] + channel_counts[ACT_TOP]); ++ ++ switch (channel_counts[ACT_FRONT]) { ++ case 4: ++ ch_layout |= AV_CH_LAYOUT_STEREO | AV_CH_FRONT_LEFT_OF_CENTER | ++ AV_CH_FRONT_RIGHT_OF_CENTER; ++ break; ++ case 3: ++ ch_layout |= AV_CH_LAYOUT_STEREO | AV_CH_FRONT_CENTER; ++ break; ++ case 2: ++ ch_layout |= AV_CH_LAYOUT_STEREO; ++ break; ++ case 1: ++ ch_layout |= AV_CH_FRONT_CENTER; ++ break; ++ default: ++ av_log(avctx, AV_LOG_WARNING, ++ "unsupported number of front channels: %d\n", ++ channel_counts[ACT_FRONT]); ++ ch_error = 1; ++ break; ++ } ++ if (channel_counts[ACT_SIDE] > 0) { ++ if (channel_counts[ACT_SIDE] == 2) { ++ ch_layout |= AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT; ++ } else { ++ av_log(avctx, AV_LOG_WARNING, ++ "unsupported number of side channels: %d\n", ++ channel_counts[ACT_SIDE]); ++ ch_error = 1; ++ } ++ } ++ if (channel_counts[ACT_BACK] > 0) { ++ switch (channel_counts[ACT_BACK]) { ++ case 3: ++ ch_layout |= AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT | AV_CH_BACK_CENTER; ++ break; ++ case 2: ++ ch_layout |= AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT; ++ break; ++ case 1: ++ ch_layout |= AV_CH_BACK_CENTER; ++ break; ++ default: ++ av_log(avctx, AV_LOG_WARNING, ++ "unsupported number of back channels: %d\n", ++ channel_counts[ACT_BACK]); ++ ch_error = 1; ++ break; ++ } ++ } ++ if (channel_counts[ACT_LFE] > 0) { ++ if (channel_counts[ACT_LFE] == 1) { ++ ch_layout |= AV_CH_LOW_FREQUENCY; ++ } else { ++ av_log(avctx, AV_LOG_WARNING, ++ "unsupported number of LFE channels: %d\n", ++ channel_counts[ACT_LFE]); ++ ch_error = 1; ++ } ++ } ++ ++ av_channel_layout_uninit(&avctx->ch_layout); ++ av_channel_layout_from_mask(&avctx->ch_layout, ch_layout); ++ if (!ch_error && avctx->ch_layout.nb_channels != info->numChannels) { ++ av_log(avctx, AV_LOG_WARNING, "unsupported channel configuration\n"); ++ ch_error = 1; ++ } ++ if (ch_error) ++ avctx->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; ++ ++ return 0; ++} ++ ++static av_cold int fdk_aac_decode_close(AVCodecContext *avctx) ++{ ++ FDKAACDecContext *s = avctx->priv_data; ++ ++ if (s->handle) ++ aacDecoder_Close(s->handle); ++ av_freep(&s->decoder_buffer); ++ av_freep(&s->anc_buffer); ++ ++ return 0; ++} ++ ++static av_cold int fdk_aac_decode_init(AVCodecContext *avctx) ++{ ++ FDKAACDecContext *s = avctx->priv_data; ++ AAC_DECODER_ERROR err; ++ ++ s->handle = aacDecoder_Open(avctx->extradata_size ? TT_MP4_RAW : TT_MP4_ADTS, 1); ++ if (!s->handle) { ++ av_log(avctx, AV_LOG_ERROR, "Error opening decoder\n"); ++ return AVERROR_UNKNOWN; ++ } ++ ++ if (avctx->extradata_size) { ++ if ((err = aacDecoder_ConfigRaw(s->handle, &avctx->extradata, ++ &avctx->extradata_size)) != AAC_DEC_OK) { ++ av_log(avctx, AV_LOG_ERROR, "Unable to set extradata\n"); ++ return AVERROR_INVALIDDATA; ++ } ++ } ++ ++ if ((err = aacDecoder_SetParam(s->handle, AAC_CONCEAL_METHOD, ++ s->conceal_method)) != AAC_DEC_OK) { ++ av_log(avctx, AV_LOG_ERROR, "Unable to set error concealment method\n"); ++ return AVERROR_UNKNOWN; ++ } ++ ++#if FF_API_OLD_CHANNEL_LAYOUT ++FF_DISABLE_DEPRECATION_WARNINGS ++ if (avctx->request_channel_layout) { ++ av_channel_layout_uninit(&s->downmix_layout); ++ av_channel_layout_from_mask(&s->downmix_layout, avctx->request_channel_layout); ++ } ++FF_ENABLE_DEPRECATION_WARNINGS ++#endif ++ if (s->downmix_layout.nb_channels > 0 && ++ s->downmix_layout.order != AV_CHANNEL_ORDER_NATIVE) { ++ int downmix_channels = -1; ++ ++ switch (s->downmix_layout.u.mask) { ++ case AV_CH_LAYOUT_STEREO: ++ case AV_CH_LAYOUT_STEREO_DOWNMIX: ++ downmix_channels = 2; ++ break; ++ case AV_CH_LAYOUT_MONO: ++ downmix_channels = 1; ++ break; ++ default: ++ av_log(avctx, AV_LOG_WARNING, "Invalid downmix option\n"); ++ break; ++ } ++ ++ if (downmix_channels != -1) { ++ if (aacDecoder_SetParam(s->handle, AAC_PCM_MAX_OUTPUT_CHANNELS, ++ downmix_channels) != AAC_DEC_OK) { ++ av_log(avctx, AV_LOG_WARNING, "Unable to set output channels in the decoder\n"); ++ } else { ++ s->anc_buffer = av_malloc(DMX_ANC_BUFFSIZE); ++ if (!s->anc_buffer) { ++ av_log(avctx, AV_LOG_ERROR, "Unable to allocate ancillary buffer for the decoder\n"); ++ return AVERROR(ENOMEM); ++ } ++ if (aacDecoder_AncDataInit(s->handle, s->anc_buffer, DMX_ANC_BUFFSIZE)) { ++ av_log(avctx, AV_LOG_ERROR, "Unable to register downmix ancillary buffer in the decoder\n"); ++ return AVERROR_UNKNOWN; ++ } ++ } ++ } ++ } ++ ++ if (s->drc_boost != -1) { ++ if (aacDecoder_SetParam(s->handle, AAC_DRC_BOOST_FACTOR, s->drc_boost) != AAC_DEC_OK) { ++ av_log(avctx, AV_LOG_ERROR, "Unable to set DRC boost factor in the decoder\n"); ++ return AVERROR_UNKNOWN; ++ } ++ } ++ ++ if (s->drc_cut != -1) { ++ if (aacDecoder_SetParam(s->handle, AAC_DRC_ATTENUATION_FACTOR, s->drc_cut) != AAC_DEC_OK) { ++ av_log(avctx, AV_LOG_ERROR, "Unable to set DRC attenuation factor in the decoder\n"); ++ return AVERROR_UNKNOWN; ++ } ++ } ++ ++ if (s->drc_level != -1) { ++ // This option defaults to -1, i.e. not calling ++ // aacDecoder_SetParam(AAC_DRC_REFERENCE_LEVEL) at all, which defaults ++ // to the level from DRC metadata, if available. The user can set ++ // -drc_level -2, which calls aacDecoder_SetParam( ++ // AAC_DRC_REFERENCE_LEVEL) with a negative value, which then ++ // explicitly disables the feature. ++ if (aacDecoder_SetParam(s->handle, AAC_DRC_REFERENCE_LEVEL, s->drc_level) != AAC_DEC_OK) { ++ av_log(avctx, AV_LOG_ERROR, "Unable to set DRC reference level in the decoder\n"); ++ return AVERROR_UNKNOWN; ++ } ++ } ++ ++ if (s->drc_heavy != -1) { ++ if (aacDecoder_SetParam(s->handle, AAC_DRC_HEAVY_COMPRESSION, s->drc_heavy) != AAC_DEC_OK) { ++ av_log(avctx, AV_LOG_ERROR, "Unable to set DRC heavy compression in the decoder\n"); ++ return AVERROR_UNKNOWN; ++ } ++ } ++ ++#if FDKDEC_VER_AT_LEAST(2, 5) // 2.5.10 ++ // Setting this parameter to -1 enables the auto behaviour in the library. ++ if (aacDecoder_SetParam(s->handle, AAC_PCM_LIMITER_ENABLE, s->level_limit) != AAC_DEC_OK) { ++ av_log(avctx, AV_LOG_ERROR, "Unable to set in signal level limiting in the decoder\n"); ++ return AVERROR_UNKNOWN; ++ } ++#endif ++ ++#if FDKDEC_VER_AT_LEAST(3, 0) // 3.0.0 ++ if (s->drc_effect != -1) { ++ if (aacDecoder_SetParam(s->handle, AAC_UNIDRC_SET_EFFECT, s->drc_effect) != AAC_DEC_OK) { ++ av_log(avctx, AV_LOG_ERROR, "Unable to set DRC effect type in the decoder\n"); ++ return AVERROR_UNKNOWN; ++ } ++ } ++#endif ++ ++#if FDKDEC_VER_AT_LEAST(3, 1) // 3.1.0 ++ if (s->album_mode != -1) { ++ if (aacDecoder_SetParam(s->handle, AAC_UNIDRC_ALBUM_MODE, s->album_mode) != AAC_DEC_OK) { ++ av_log(avctx, AV_LOG_ERROR, "Unable to set album mode in the decoder\n"); ++ return AVERROR_UNKNOWN; ++ } ++ } ++#endif ++ ++ avctx->sample_fmt = AV_SAMPLE_FMT_S16; ++ ++ s->decoder_buffer_size = DECODER_BUFFSIZE * DECODER_MAX_CHANNELS; ++ s->decoder_buffer = av_malloc(s->decoder_buffer_size); ++ if (!s->decoder_buffer) ++ return AVERROR(ENOMEM); ++ ++ return 0; ++} ++ ++static int fdk_aac_decode_frame(AVCodecContext *avctx, AVFrame *frame, ++ int *got_frame_ptr, AVPacket *avpkt) ++{ ++ FDKAACDecContext *s = avctx->priv_data; ++ int ret; ++ AAC_DECODER_ERROR err; ++ UINT valid = avpkt->size; ++ UINT flags = 0; ++ int input_offset = 0; ++ ++ if (avpkt->size) { ++ err = aacDecoder_Fill(s->handle, &avpkt->data, &avpkt->size, &valid); ++ if (err != AAC_DEC_OK) { ++ av_log(avctx, AV_LOG_ERROR, "aacDecoder_Fill() failed: %x\n", err); ++ return AVERROR_INVALIDDATA; ++ } ++ } else { ++#if FDKDEC_VER_AT_LEAST(2, 5) // 2.5.10 ++ /* Handle decoder draining */ ++ if (s->flush_samples > 0) { ++ flags |= AACDEC_FLUSH; ++ } else { ++ return AVERROR_EOF; ++ } ++#else ++ return AVERROR_EOF; ++#endif ++ } ++ ++ err = aacDecoder_DecodeFrame(s->handle, (INT_PCM *) s->decoder_buffer, ++ s->decoder_buffer_size / sizeof(INT_PCM), ++ flags); ++ if (err == AAC_DEC_NOT_ENOUGH_BITS) { ++ ret = avpkt->size - valid; ++ goto end; ++ } ++ if (err != AAC_DEC_OK) { ++ av_log(avctx, AV_LOG_ERROR, ++ "aacDecoder_DecodeFrame() failed: %x\n", err); ++ ret = AVERROR_UNKNOWN; ++ goto end; ++ } ++ ++ if ((ret = get_stream_info(avctx)) < 0) ++ goto end; ++ frame->nb_samples = avctx->frame_size; ++ ++#if FDKDEC_VER_AT_LEAST(2, 5) // 2.5.10 ++ if (flags & AACDEC_FLUSH) { ++ // Only return the right amount of samples at the end; if calling the ++ // decoder with AACDEC_FLUSH, it will keep returning frames indefinitely. ++ frame->nb_samples = FFMIN(s->flush_samples, frame->nb_samples); ++ av_log(s, AV_LOG_DEBUG, "Returning %d/%d delayed samples.\n", ++ frame->nb_samples, s->flush_samples); ++ s->flush_samples -= frame->nb_samples; ++ } else { ++ // Trim off samples from the start to compensate for extra decoder ++ // delay. We could also just adjust the pts, but this avoids ++ // including the extra samples in the output altogether. ++ if (s->delay_samples) { ++ int drop_samples = FFMIN(s->delay_samples, frame->nb_samples); ++ av_log(s, AV_LOG_DEBUG, "Dropping %d/%d delayed samples.\n", ++ drop_samples, s->delay_samples); ++ s->delay_samples -= drop_samples; ++ frame->nb_samples -= drop_samples; ++ input_offset = drop_samples * avctx->ch_layout.nb_channels; ++ if (frame->nb_samples <= 0) ++ return 0; ++ } ++ } ++#endif ++ ++ if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) ++ goto end; ++ ++ memcpy(frame->extended_data[0], s->decoder_buffer + input_offset, ++ avctx->ch_layout.nb_channels * frame->nb_samples * ++ av_get_bytes_per_sample(avctx->sample_fmt)); ++ ++ *got_frame_ptr = 1; ++ ret = avpkt->size - valid; ++ ++end: ++ return ret; ++} ++ ++static av_cold void fdk_aac_decode_flush(AVCodecContext *avctx) ++{ ++ FDKAACDecContext *s = avctx->priv_data; ++ AAC_DECODER_ERROR err; ++ ++ if (!s->handle) ++ return; ++ ++ if ((err = aacDecoder_SetParam(s->handle, ++ AAC_TPDEC_CLEAR_BUFFER, 1)) != AAC_DEC_OK) ++ av_log(avctx, AV_LOG_WARNING, "failed to clear buffer when flushing\n"); ++} ++ ++const FFCodec ff_libfdk_aac_decoder = { ++ .p.name = "libfdk_aac", ++ CODEC_LONG_NAME("Fraunhofer FDK AAC"), ++ .p.type = AVMEDIA_TYPE_AUDIO, ++ .p.id = AV_CODEC_ID_AAC, ++ .priv_data_size = sizeof(FDKAACDecContext), ++ .init = fdk_aac_decode_init, ++ FF_CODEC_DECODE_CB(fdk_aac_decode_frame), ++ .close = fdk_aac_decode_close, ++ .flush = fdk_aac_decode_flush, ++ .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF ++#if FDKDEC_VER_AT_LEAST(2, 5) // 2.5.10 ++ | AV_CODEC_CAP_DELAY ++#endif ++ , ++ .p.priv_class = &fdk_aac_dec_class, ++ .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, ++ .p.wrapper_name = "libfdk", ++}; +diff -up firefox-108.0/media/ffvpx/libavcodec/moz.build.1667096 firefox-108.0/media/ffvpx/libavcodec/moz.build +--- firefox-108.0/media/ffvpx/libavcodec/moz.build.1667096 2022-12-05 21:18:01.000000000 +0100 ++++ firefox-108.0/media/ffvpx/libavcodec/moz.build 2022-12-08 08:29:54.514562328 +0100 +@@ -130,6 +130,12 @@ if CONFIG['MOZ_LIBAV_FFT']: + 'avfft.c', + ] + ++if CONFIG['MOZ_FDK_AAC']: ++ SOURCES += [ ++ 'libfdk-aacdec.c', ++ ] ++ OS_LIBS += CONFIG['MOZ_FDK_AAC_LIBS'] ++ + SYMBOLS_FILE = 'avcodec.symbols' + NoVisibilityFlags() + +diff -up firefox-108.0/toolkit/moz.configure.1667096 firefox-108.0/toolkit/moz.configure +--- firefox-108.0/toolkit/moz.configure.1667096 2022-12-05 21:21:08.000000000 +0100 ++++ firefox-108.0/toolkit/moz.configure 2022-12-08 08:29:54.514562328 +0100 +@@ -2134,6 +2134,15 @@ with only_when(compile_environment): + + set_config("MOZ_SYSTEM_PNG", True, when="--with-system-png") + ++# FDK AAC support ++# ============================================================== ++option('--with-system-fdk-aac', ++ help='Use system libfdk-aac (located with pkgconfig)') ++ ++system_fdk_aac = pkg_check_modules('MOZ_FDK_AAC', 'fdk-aac', ++ when='--with-system-fdk-aac') ++ ++set_config('MOZ_FDK_AAC', depends(when=system_fdk_aac)(lambda: True)) + + # FFmpeg's ffvpx configuration + # ============================================================== diff --git a/mozilla-1669639.patch b/mozilla-1669639.patch new file mode 100644 index 0000000000000000000000000000000000000000..cd04aabaddc2c7b52eee2649d9753e5746622bdb --- /dev/null +++ b/mozilla-1669639.patch @@ -0,0 +1,14 @@ +--- firefox-81.0.1/build/mach_initialize.py.old 2020-10-06 14:16:06.212974910 +0200 ++++ firefox-81.0.1/build/mach_initialize.py 2020-10-06 14:19:03.313179557 +0200 +@@ -507,7 +507,10 @@ class ImportHook(object): + # doesn't happen or because it doesn't matter). + if not os.path.exists(module.__file__[:-1]): + if os.path.exists(module.__file__): +- os.remove(module.__file__) ++ try: ++ os.remove(module.__file__) ++ except: ++ pass + del sys.modules[module.__name__] + module = self(name, globals, locals, fromlist, level) + diff --git a/mozilla-1670333.patch b/mozilla-1670333.patch new file mode 100644 index 0000000000000000000000000000000000000000..a1eaa9a88d0d92849530049ba44cbf02b595202b --- /dev/null +++ b/mozilla-1670333.patch @@ -0,0 +1,68 @@ +diff -up firefox-105.0/dom/media/mp4/MP4Demuxer.cpp.1670333 firefox-105.0/dom/media/mp4/MP4Demuxer.cpp +--- firefox-105.0/dom/media/mp4/MP4Demuxer.cpp.1670333 2022-09-15 20:49:09.000000000 +0200 ++++ firefox-105.0/dom/media/mp4/MP4Demuxer.cpp 2022-09-20 09:16:35.404519249 +0200 +@@ -31,6 +31,8 @@ mozilla::LogModule* GetDemuxerLog() { re + DDMOZ_LOG(gMediaDemuxerLog, mozilla::LogLevel::Debug, "::%s: " arg, \ + __func__, ##__VA_ARGS__) + ++extern bool gUseKeyframeFromContainer; ++ + namespace mozilla { + + DDLoggedTypeDeclNameAndBase(MP4TrackDemuxer, MediaTrackDemuxer); +@@ -394,6 +396,12 @@ already_AddRefed MP4TrackD + [[fallthrough]]; + case H264::FrameType::OTHER: { + bool keyframe = type == H264::FrameType::I_FRAME; ++ if (gUseKeyframeFromContainer) { ++ if (sample->mKeyframe && sample->mKeyframe != keyframe) { ++ sample->mKeyframe = keyframe; ++ } ++ break; ++ } + if (sample->mKeyframe != keyframe) { + NS_WARNING(nsPrintfCString("Frame incorrectly marked as %skeyframe " + "@ pts:%" PRId64 " dur:%" PRId64 +diff -up firefox-105.0/dom/media/platforms/PDMFactory.cpp.1670333 firefox-105.0/dom/media/platforms/PDMFactory.cpp +--- firefox-105.0/dom/media/platforms/PDMFactory.cpp.1670333 2022-09-15 20:49:09.000000000 +0200 ++++ firefox-105.0/dom/media/platforms/PDMFactory.cpp 2022-09-20 09:20:05.369572900 +0200 +@@ -61,6 +61,8 @@ + + #include + ++bool gUseKeyframeFromContainer = false; ++ + using DecodeSupport = mozilla::media::DecodeSupport; + using DecodeSupportSet = mozilla::media::DecodeSupportSet; + using MediaCodec = mozilla::media::MediaCodec; +@@ -553,7 +555,7 @@ void PDMFactory::CreateRddPDMs() { + #ifdef MOZ_FFMPEG + if (StaticPrefs::media_ffmpeg_enabled() && + StaticPrefs::media_rdd_ffmpeg_enabled() && +- !CreateAndStartupPDM()) { ++ !(mFFmpegUsed = CreateAndStartupPDM())) { + mFailureFlags += GetFailureFlagBasedOnFFmpegStatus( + FFmpegRuntimeLinker::LinkStatusCode()); + } +@@ -653,8 +655,9 @@ void PDMFactory::CreateContentPDMs() { + + CreateAndStartupPDM(); + +- if (StaticPrefs::media_gmp_decoder_enabled() && ++ if (StaticPrefs::media_gmp_decoder_enabled() && !mFFmpegUsed && + !CreateAndStartupPDM()) { ++ gUseKeyframeFromContainer = true; + mFailureFlags += DecoderDoctorDiagnostics::Flags::GMPPDMFailedToStartup; + } + } +diff -up firefox-105.0/dom/media/platforms/PDMFactory.h.1670333 firefox-105.0/dom/media/platforms/PDMFactory.h +--- firefox-105.0/dom/media/platforms/PDMFactory.h.1670333 2022-09-15 20:49:08.000000000 +0200 ++++ firefox-105.0/dom/media/platforms/PDMFactory.h 2022-09-20 09:16:35.404519249 +0200 +@@ -102,6 +102,7 @@ class PDMFactory final { + RefPtr mNullPDM; + + DecoderDoctorDiagnostics::FlagsSet mFailureFlags; ++ bool mFFmpegUsed = false; + + friend class RemoteVideoDecoderParent; + static void EnsureInit(); diff --git a/mozilla-1775202.patch b/mozilla-1775202.patch new file mode 100644 index 0000000000000000000000000000000000000000..e237f4c2e2d406ba0ad6bbc5057e6e2ab3568ff4 --- /dev/null +++ b/mozilla-1775202.patch @@ -0,0 +1,14 @@ +diff -up firefox-109.0/third_party/libwebrtc/moz.build.ppc-mobzuild firefox-109.0/third_party/libwebrtc/moz.build +--- firefox-109.0/third_party/libwebrtc/moz.build.ppc-mobzuild 2023-01-12 21:02:15.000000000 +0100 ++++ firefox-109.0/third_party/libwebrtc/moz.build 2023-01-16 13:30:28.404450100 +0100 +@@ -621,7 +621,9 @@ if CONFIG["CPU_ARCH"] == "ppc64" and CON + "/third_party/libwebrtc/api/audio_codecs/isac/audio_decoder_isac_float_gn", + "/third_party/libwebrtc/api/audio_codecs/isac/audio_encoder_isac_float_gn", + "/third_party/libwebrtc/modules/audio_coding/isac_c_gn", +- "/third_party/libwebrtc/modules/audio_coding/isac_gn" ++ "/third_party/libwebrtc/modules/audio_coding/isac_gn", ++ "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn", ++ "/third_party/libwebrtc/modules/desktop_capture/primitives_gn" + ] + + if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Linux": diff --git a/mozilla-1826583.patch b/mozilla-1826583.patch new file mode 100644 index 0000000000000000000000000000000000000000..52a294717f0a3c7d93abd055a578daf98691e188 --- /dev/null +++ b/mozilla-1826583.patch @@ -0,0 +1,14 @@ +diff -up firefox-112.0/widget/gtk/nsWaylandDisplay.cpp.old firefox-112.0/widget/gtk/nsWaylandDisplay.cpp +--- firefox-112.0/widget/gtk/nsWaylandDisplay.cpp.old 2023-04-06 19:35:44.744731593 +0200 ++++ firefox-112.0/widget/gtk/nsWaylandDisplay.cpp 2023-04-06 19:35:23.650016723 +0200 +@@ -271,8 +271,8 @@ bool nsWaylandDisplay::Matches(wl_displa + return mThreadId == PR_GetCurrentThread() && aDisplay == mDisplay; + } + +-static void WlCrashHandler(const char* format, va_list args) { +- MOZ_CRASH_UNSAFE(g_strdup_vprintf(format, args)); ++static void WlCrashHandler(const char* format, va_list args) { ++ vfprintf(stderr, format, args); + } + + nsWaylandDisplay::nsWaylandDisplay(wl_display* aDisplay) diff --git a/mozilla-1827429.patch b/mozilla-1827429.patch new file mode 100644 index 0000000000000000000000000000000000000000..3c908aa27024aa0f8b2395e63ca9d3032595478f --- /dev/null +++ b/mozilla-1827429.patch @@ -0,0 +1,33 @@ +changeset: 659713:2cf85addfa7a +tag: tip +parent: 659711:25045b498bff +user: stransky +date: Tue Apr 11 16:34:42 2023 +0200 +files: widget/gtk/nsWindow.cpp +description: +Bug 1827429 [Wayland] Call NotifyOcclusionState(OcclusionState::VISIBLE) from nsWindow::OnExposeEvent() as we know the window is visible r?emilio + +Differential Revision: https://phabricator.services.mozilla.com/D175138 + + +diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp +--- a/widget/gtk/nsWindow.cpp ++++ b/widget/gtk/nsWindow.cpp +@@ -3730,9 +3730,14 @@ void nsWindow::CreateCompositorVsyncDisp + + gboolean nsWindow::OnExposeEvent(cairo_t* cr) { + // Send any pending resize events so that layout can update. +- // May run event loop. ++ // May run event loop and destroy us. + MaybeDispatchResized(); +- ++ if (mIsDestroyed) { ++ return FALSE; ++ } ++ ++ // This might destroy us. ++ NotifyOcclusionState(OcclusionState::VISIBLE); + if (mIsDestroyed) { + return FALSE; + } + diff --git a/mozilla-api-key b/mozilla-api-key new file mode 100644 index 0000000000000000000000000000000000000000..81877bc006dbe9ef8295fa06cfa16a9d39723cbf --- /dev/null +++ b/mozilla-api-key @@ -0,0 +1 @@ +9008bb7e-1e22-4038-94fe-047dd48ccc0b diff --git a/mozilla-build-aarch64.patch b/mozilla-build-aarch64.patch new file mode 100644 index 0000000000000000000000000000000000000000..e390a284322df9606b2de0cb8378aaba620f8a20 --- /dev/null +++ b/mozilla-build-aarch64.patch @@ -0,0 +1,14 @@ +diff -up firefox-52.0/gfx/skia/skia/include/core/SkPreConfig.h.arm firefox-52.0/gfx/skia/skia/include/core/SkPreConfig.h +--- firefox-52.0/gfx/skia/skia/include/core/SkPreConfig.h.arm 2017-03-03 13:53:52.480754536 +0100 ++++ firefox-52.0/gfx/skia/skia/include/core/SkPreConfig.h 2017-03-03 13:56:01.476018102 +0100 +@@ -203,6 +203,10 @@ + #define SK_ARM_HAS_CRC32 + #endif + ++#if defined(__aarch64__) ++ #undef SK_ARM_HAS_NEON ++#endif ++ + ////////////////////////////////////////////////////////////////////// + + #if !defined(SKIA_IMPLEMENTATION) diff --git a/node-stdout-nonblocking-wrapper b/node-stdout-nonblocking-wrapper new file mode 100755 index 0000000000000000000000000000000000000000..b2814b8d40392ffe76c24d7676c91a353a23b76a --- /dev/null +++ b/node-stdout-nonblocking-wrapper @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/node "$@" 2>&1 | cat - diff --git a/pgo.patch b/pgo.patch new file mode 100644 index 0000000000000000000000000000000000000000..8d996a21ea1c5096cca62c52ac297710c30aeee9 --- /dev/null +++ b/pgo.patch @@ -0,0 +1,115 @@ +diff -up firefox-112.0/build/moz.configure/lto-pgo.configure.pgo firefox-112.0/build/moz.configure/lto-pgo.configure +--- firefox-112.0/build/moz.configure/lto-pgo.configure.pgo 2023-04-06 17:27:38.000000000 +0200 ++++ firefox-112.0/build/moz.configure/lto-pgo.configure 2023-04-06 21:27:32.537089073 +0200 +@@ -247,8 +247,8 @@ def lto( + cflags.append("-flto") + ldflags.append("-flto") + else: +- cflags.append("-flto=thin") +- ldflags.append("-flto=thin") ++ cflags.append("-flto") ++ ldflags.append("-flto") + + if target.os == "Android" and value == "cross": + # Work around https://github.com/rust-lang/rust/issues/90088 +@@ -264,7 +264,7 @@ def lto( + if value == "full": + cflags.append("-flto") + else: +- cflags.append("-flto=thin") ++ cflags.append("-flto") + # With clang-cl, -flto can only be used with -c or -fuse-ld=lld. + # AC_TRY_LINKs during configure don't have -c, so pass -fuse-ld=lld. + cflags.append("-fuse-ld=lld") +diff -up firefox-112.0/build/pgo/profileserver.py.pgo firefox-112.0/build/pgo/profileserver.py +--- firefox-112.0/build/pgo/profileserver.py.pgo 2023-04-06 17:27:40.000000000 +0200 ++++ firefox-112.0/build/pgo/profileserver.py 2023-04-06 21:29:33.772294479 +0200 +@@ -11,7 +11,7 @@ import subprocess + import sys + + import mozcrash +-from mozbuild.base import BinaryNotFoundException, MozbuildObject ++from mozbuild.base import BinaryNotFoundException, MozbuildObject, BuildEnvironmentNotFoundException + from mozfile import TemporaryDirectory + from mozhttpd import MozHttpd + from mozprofile import FirefoxProfile, Preferences +@@ -87,9 +87,22 @@ if __name__ == "__main__": + locations = ServerLocations() + locations.add_host(host="127.0.0.1", port=PORT, options="primary,privileged") + +- old_profraw_files = glob.glob("*.profraw") +- for f in old_profraw_files: +- os.remove(f) ++ using_gcc = False ++ try: ++ if build.config_environment.substs.get('CC_TYPE') == 'gcc': ++ using_gcc = True ++ except BuildEnvironmentNotFoundException: ++ pass ++ ++ if using_gcc: ++ for dirpath, _, filenames in os.walk('.'): ++ for f in filenames: ++ if f.endswith('.gcda'): ++ os.remove(os.path.join(dirpath, f)) ++ else: ++ old_profraw_files = glob.glob('*.profraw') ++ for f in old_profraw_files: ++ os.remove(f) + + with TemporaryDirectory() as profilePath: + # TODO: refactor this into mozprofile +@@ -213,6 +226,10 @@ if __name__ == "__main__": + print("Firefox exited successfully, but produced a crashreport") + sys.exit(1) + ++ print('Copying profile data....') ++ os.system('pwd'); ++ os.system('tar cf profdata.tar.gz `find . -name "*.gcda"`; cd ..; tar xf instrumented/profdata.tar.gz;'); ++ + llvm_profdata = env.get("LLVM_PROFDATA") + if llvm_profdata: + profraw_files = glob.glob("*.profraw") +diff -up firefox-112.0/build/unix/mozconfig.unix.pgo firefox-112.0/build/unix/mozconfig.unix +--- firefox-112.0/build/unix/mozconfig.unix.pgo 2023-04-06 21:27:32.537089073 +0200 ++++ firefox-112.0/build/unix/mozconfig.unix 2023-04-06 21:28:54.987949124 +0200 +@@ -4,6 +4,15 @@ if [ -n "$FORCE_GCC" ]; then + CC="$MOZ_FETCHES_DIR/gcc/bin/gcc" + CXX="$MOZ_FETCHES_DIR/gcc/bin/g++" + ++ if [ -n "$MOZ_PGO" ]; then ++ if [ -z "$USE_ARTIFACT" ]; then ++ ac_add_options --enable-lto ++ fi ++ export AR="$topsrcdir/gcc/bin/gcc-ar" ++ export NM="$topsrcdir/gcc/bin/gcc-nm" ++ export RANLIB="$topsrcdir/gcc/bin/gcc-ranlib" ++ fi ++ + # We want to make sure we use binutils and other binaries in the tooltool + # package. + mk_add_options "export PATH=$MOZ_FETCHES_DIR/gcc/bin:$MOZ_FETCHES_DIR/binutils/bin:$PATH" +diff -up firefox-112.0/extensions/spellcheck/src/moz.build.pgo firefox-112.0/extensions/spellcheck/src/moz.build +--- firefox-112.0/extensions/spellcheck/src/moz.build.pgo 2023-04-06 17:27:41.000000000 +0200 ++++ firefox-112.0/extensions/spellcheck/src/moz.build 2023-04-06 21:27:32.537089073 +0200 +@@ -28,3 +28,5 @@ EXPORTS.mozilla += [ + "mozInlineSpellChecker.h", + "mozSpellChecker.h", + ] ++ ++CXXFLAGS += ['-fno-devirtualize'] +diff -up firefox-112.0/toolkit/components/terminator/nsTerminator.cpp.pgo firefox-112.0/toolkit/components/terminator/nsTerminator.cpp +--- firefox-112.0/toolkit/components/terminator/nsTerminator.cpp.pgo 2023-04-06 17:27:57.000000000 +0200 ++++ firefox-112.0/toolkit/components/terminator/nsTerminator.cpp 2023-04-06 21:27:32.538089108 +0200 +@@ -460,6 +460,11 @@ void nsTerminator::StartWatchdog() { + } + #endif + ++ // Disable watchdog for PGO train builds - writting profile information at ++ // exit may take time and it is better to make build hang rather than ++ // silently produce poorly performing binary. ++ crashAfterMS = INT32_MAX; ++ + UniquePtr options(new Options()); + // crashAfterTicks is guaranteed to be > 0 as + // crashAfterMS >= ADDITIONAL_WAIT_BEFORE_CRASH_MS >> HEARTBEAT_INTERVAL_MS diff --git a/print-error-reftest b/print-error-reftest new file mode 100755 index 0000000000000000000000000000000000000000..7a58c1cbfd425fa8e8a478544f56a6353db13a4f --- /dev/null +++ b/print-error-reftest @@ -0,0 +1,13 @@ +#!/usr/bin/bash +# Print reftest failures and compose them to html + +TEST_DIR="$1" +TEST_FLAVOUR="$2" +OUTPUT_FILE="failures-reftest$TEST_FLAVOUR.html" + +grep --text -e "REFTEST TEST-UNEXPECTED-PASS" -e "REFTEST TEST-UNEXPECTED-FAIL" -e "IMAGE 1 (TEST):" -e "IMAGE 2 (REFERENCE):" $TEST_DIR/reftest$TEST_FLAVOUR 2>&1 > $OUTPUT_FILE +sed -i '/REFTEST IMAGE 1/a ">' $OUTPUT_FILE +sed -i '/REFTEST IMAGE 2/a ">

' $OUTPUT_FILE +sed -i '/REFTEST TEST/a
' $OUTPUT_FILE +sed -i -e 's/^REFTEST IMAGE 1 (TEST): /&1 > failures-mochitest$TEST_FLAVOUR.txt +grep --text -e " FAIL " -e " TIMEOUT " $TEST_DIR/xpcshell$TEST_FLAVOUR 2>&1 > failures-xpcshell$TEST_FLAVOUR.txt +grep --text -e "REFTEST TEST-UNEXPECTED-PASS" -e "REFTEST TEST-UNEXPECTED-FAIL" $TEST_DIR/reftest$TEST_FLAVOUR 2>&1 > failures-reftest$TEST_FLAVOUR.txt diff --git a/print_failures b/print_failures new file mode 100755 index 0000000000000000000000000000000000000000..bc92b0c81ef66d7f74081a5915a91f44141126d5 --- /dev/null +++ b/print_failures @@ -0,0 +1,9 @@ +#!/usr/bin/bash +# Analyze and print test failures + +export TEST_DIR="test_results" + +#./print-errors $TEST_DIR "" +./print-errors $TEST_DIR "-wr" +#./print-error-reftest $TEST_DIR "" +./print-error-reftest $TEST_DIR "-wr" diff --git a/print_results b/print_results new file mode 100755 index 0000000000000000000000000000000000000000..d0b13079e5aba27e52b3dbbc808c6734f4356b42 --- /dev/null +++ b/print_results @@ -0,0 +1,10 @@ +#!/usr/bin/bash +# Analyze and print general test results + +export TEST_DIR="test_results" + +echo "Test results" +#echo "Basic compositor" +#./psummary $TEST_DIR "" +echo "WebRender" +./psummary $TEST_DIR "-wr" diff --git a/psummary b/psummary new file mode 100755 index 0000000000000000000000000000000000000000..f64fc8fec6a512213a232f549fe05968983aeaba --- /dev/null +++ b/psummary @@ -0,0 +1,23 @@ +#!/usr/bin/bash +# Analyze and print specialized (basic/webrender) test results + +TEST_DIR=$1 +TEST_FLAVOUR=$2 + +MPASS=`grep "TEST_END: Test OK" $TEST_DIR/mochitest$TEST_FLAVOUR | wc -l` +MERR=`grep "TEST_END: Test ERROR" $TEST_DIR/mochitest$TEST_FLAVOUR | wc -l` +MUNEX=`grep "TEST-UNEXPECTED-FAIL" $TEST_DIR/mochitest$TEST_FLAVOUR | wc -l` +echo "Mochitest PASSED: $MPASS FAILED: $MERR UNEXPECTED-FAILURES: $MUNEX" + +XPCPASS=`grep --text "Expected results:" $TEST_DIR/xpcshell$TEST_FLAVOUR | cut -d ' ' -f 3` +XPCFAIL=`grep --text "Unexpected results:" $TEST_DIR/xpcshell$TEST_FLAVOUR | cut -d ' ' -f 3` +echo "XPCShell: PASSED: $XPCPASS FAILED: $XPCFAIL" + +CRPASS=`grep "REFTEST INFO | Successful:" $TEST_DIR/crashtest$TEST_FLAVOUR | cut -d ' ' -f 5` +CRFAIL=`grep "^REFTEST INFO | Unexpected:" $TEST_DIR/crashtest$TEST_FLAVOUR | cut -d ' ' -f 5` +echo "Crashtest: PASSED: $CRPASS FAILED: $CRFAIL" + +RFPASS=`grep --text "REFTEST INFO | Successful:" $TEST_DIR/reftest$TEST_FLAVOUR | cut -d ' ' -f 5` +RFUN=`grep --text "^REFTEST INFO | Unexpected:" $TEST_DIR/reftest$TEST_FLAVOUR | cut -d ' ' -f 5` +RFKNOWN=`grep --text "REFTEST INFO | Known problems:" $TEST_DIR/reftest$TEST_FLAVOUR | cut -d ' ' -f 6` +echo "Reftest: PASSED: $RFPASS FAILED: $RFUN Known issues: $RFKNOWN" diff --git a/rhbz-1173156.patch b/rhbz-1173156.patch new file mode 100644 index 0000000000000000000000000000000000000000..c35d901df935096813b0cba47993ae5f75b52b7a --- /dev/null +++ b/rhbz-1173156.patch @@ -0,0 +1,12 @@ +diff -up firefox-60.5.0/extensions/auth/nsAuthSambaNTLM.cpp.rhbz-1173156 firefox-60.5.0/extensions/auth/nsAuthSambaNTLM.cpp +--- firefox-60.5.0/extensions/auth/nsAuthSambaNTLM.cpp.rhbz-1173156 2019-01-22 10:36:09.284069020 +0100 ++++ firefox-60.5.0/extensions/auth/nsAuthSambaNTLM.cpp 2019-01-22 10:37:12.669757744 +0100 +@@ -161,7 +161,7 @@ nsresult nsAuthSambaNTLM::SpawnNTLMAuthH + const char* username = PR_GetEnv("USER"); + if (!username) return NS_ERROR_FAILURE; + +- const char* const args[] = {"ntlm_auth", ++ const char* const args[] = {"/usr/bin/ntlm_auth", + "--helper-protocol", + "ntlmssp-client-1", + "--use-cached-creds", diff --git a/rhbz-1354671.patch b/rhbz-1354671.patch new file mode 100644 index 0000000000000000000000000000000000000000..b6e8bbd06e06582f1e9c0ce0f5344e90b2ad92f2 --- /dev/null +++ b/rhbz-1354671.patch @@ -0,0 +1,12 @@ +diff -up firefox-70.0/layout/base/PresShell.h.1354671 firefox-70.0/layout/base/PresShell.h +--- firefox-70.0/layout/base/PresShell.h.1354671 2019-10-22 12:33:12.987775587 +0200 ++++ firefox-70.0/layout/base/PresShell.h 2019-10-22 12:36:39.999366086 +0200 +@@ -257,7 +257,7 @@ class PresShell final : public nsStubDoc + * to the same aSize value. AllocateFrame is infallible and will abort + * on out-of-memory. + */ +- void* AllocateFrame(nsQueryFrame::FrameIID aID, size_t aSize) { ++ void* __attribute__((optimize("no-lifetime-dse"))) AllocateFrame(nsQueryFrame::FrameIID aID, size_t aSize) { + #define FRAME_ID(classname, ...) \ + static_assert(size_t(nsQueryFrame::FrameIID::classname##_id) == \ + size_t(eArenaObjectID_##classname), \ diff --git a/run-tests-wayland b/run-tests-wayland new file mode 100755 index 0000000000000000000000000000000000000000..95ee6f62de25c3f62775129da6088bf53df8b80f --- /dev/null +++ b/run-tests-wayland @@ -0,0 +1,80 @@ +#!/usr/bin/bash +# usage: run-tests-wayland [test flavour] + +set -x + +RUN_XPCSHELL_TEST=1 +RUN_REFTEST=1 +RUN_MOCHITEST=1 +RUN_CRASHTEST=1 + +while (( "$#" )); do + SELECTED_TEST=$1 + if [ "$SELECTED_TEST" = "xpcshell" ] ; then + RUN_XPCSHELL_TEST=1 + elif [ "$SELECTED_TEST" = "reftest" ] ; then + RUN_REFTEST=1 + elif [ "$SELECTED_TEST" = "mochitest" ] ; then + RUN_MOCHITEST=1 + elif [ "$SELECTED_TEST" = "crashtest" ] ; then + RUN_CRASHTEST=1 + fi + shift +done + +export MACH_USE_SYSTEM_PYTHON=1 +export MOZ_NODE_PATH=/usr/bin/node + +MOCHITEST_PARAMS="--timeout 1 --chunk-by-dir 4" +TEST_DIR="test_results" +mkdir $TEST_DIR + +env | grep "DISPLAY" + +# Fix for system nss +ln -s /usr/bin/certutil objdir/dist/bin/certutil +ln -s /usr/bin/pk12util objdir/dist/bin/pk12util + +NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`" + +export MOZ_ENABLE_WAYLAND=1 + +if [ $RUN_XPCSHELL_TEST -ne 0 ] ; then +# ./mach xpcshell-test 2>&1 | cat - | tee $TEST_DIR/xpcshell + ./mach xpcshell-test --enable-webrender 2>&1 | cat - | tee $TEST_DIR/xpcshell-wr + sleep 60 +fi + +# Basic render testing +export TEST_PARAMS="--setpref reftest.ignoreWindowSize=true --setpref widget.wayland.test-workarounds.enabled=true" +#export TEST_FLAVOUR="" +#if [ $RUN_REFTEST -ne 0 ] ; then +# ./mach reftest --marionette localhost:$(($(($RANDOM))+2000)) $TEST_PARAMS 2>&1 | tee $TEST_DIR/reftest$TEST_FLAVOUR +#fi +#if [ $RUN_CRASHTEST -ne 0 ] ; then +# ./mach crashtest --marionette localhost:$(($(($RANDOM))+2000)) $TEST_PARAMS 2>&1 | tee $TEST_DIR/crashtest$TEST_FLAVOUR +#fi +#if [ $RUN_MOCHITEST -ne 0 ] ; then +# ./mach mochitest --marionette localhost:$(($(($RANDOM))+2000)) $MOCHITEST_PARAMS $TEST_PARAMS 2>&1 | tee $TEST_DIR/mochitest$TEST_FLAVOUR +#fi + +# WebRender testing +export TEST_PARAMS="--enable-webrender $TEST_PARAMS" +export TEST_FLAVOUR="-wr" +# Use dom/base/test or dom/base/test/chrome for short version +export MOCHITEST_DIR='dom' +if [ $RUN_REFTEST -ne 0 ] ; then + ./mach reftest $TEST_PARAMS 2>&1 | tee $TEST_DIR/reftest$TEST_FLAVOUR + sleep 60 +fi +if [ $RUN_CRASHTEST -ne 0 ] ; then + ./mach crashtest $TEST_PARAMS 2>&1 | tee $TEST_DIR/crashtest$TEST_FLAVOUR + sleep 60 +fi +if [ $RUN_MOCHITEST -ne 0 ] ; then + ./mach mochitest $MOCHITEST_DIR $MOCHITEST_PARAMS $TEST_PARAMS 2>&1 | tee $TEST_DIR/mochitest$TEST_FLAVOUR + sleep 60 +fi + +rm -f objdir/dist/bin/certutil +rm -f objdir/dist/bin/pk12util diff --git a/run-tests-x11 b/run-tests-x11 new file mode 100755 index 0000000000000000000000000000000000000000..1d4a1c0a5720638b723680fba06b605c466eb3d4 --- /dev/null +++ b/run-tests-x11 @@ -0,0 +1,39 @@ +#!/usr/bin/bash +set -x + +export MACH_USE_SYSTEM_PYTHON=1 +export MOZ_NODE_PATH=/usr/bin/node +export X_PARAMS="-screen 0 1600x1200x24" +export MOCHITEST_PARAMS="--timeout 1 --chunk-by-dir 4" +export TEST_DIR="test_results" + +# Fix for system nss +ln -s /usr/bin/certutil objdir/dist/bin/certutil +ln -s /usr/bin/pk12util objdir/dist/bin/pk12util + +NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`" + +# Basic render testing +export TEST_PARAMS="" +export TEST_FLAVOUR="" +#xvfb-run -s "$X_PARAMS" -n 91 ./mach xpcshell-test --sequential $TEST_PARAMS 2>&1 | cat - | tee $TEST_DIR/xpcshell +#xvfb-run -s "$X_PARAMS" -n 92 ./mach reftest --marionette localhost:$(($(($RANDOM))+2000)) $TEST_PARAMS 2>&1 | tee $TEST_DIR/reftest$TEST_FLAVOUR +#xvfb-run -s "$X_PARAMS" -n 93 ./mach crashtest --marionette localhost:$(($(($RANDOM))+2000)) $TEST_PARAMS 2>&1 | tee $TEST_DIR/crashtest$TEST_FLAVOUR +#xvfb-run -s "$X_PARAMS" -n 94 ./mach mochitest --marionette localhost:$(($(($RANDOM))+2000)) $MOCHITEST_PARAMS $TEST_PARAMS 2>&1 | tee $TEST_DIR/mochitest$TEST_FLAVOUR + +# WebRender testing +export TEST_PARAMS="--enable-webrender $TEST_PARAMS" +export TEST_FLAVOUR="-wr" +#xvfb-run -s "$X_PARAMS" -n 95 ./mach xpcshell-test --sequential $TEST_PARAMS 2>&1 | cat - | tee $TEST_DIR/xpcshell-wr +#sleep 60 +#xvfb-run -s "$X_PARAMS" -n 96 ./mach reftest $TEST_PARAMS 2>&1 | tee $TEST_DIR/reftest$TEST_FLAVOUR +#sleep 60 +#xvfb-run -s "$X_PARAMS" -n 97 ./mach crashtest $TEST_PARAMS 2>&1 | tee $TEST_DIR/crashtest$TEST_FLAVOUR +#sleep 60 +#export DISPLAY=:0 +#./mach mochitest dom/base/test/ $MOCHITEST_PARAMS $TEST_PARAMS 2>&1 | tee $TEST_DIR/mochitest$TEST_FLAVOUR +export DISPLAY=:98 +xvfb-run -s "$X_PARAMS" -n 98 ./mach mochitest dom/base/test/ $MOCHITEST_PARAMS $TEST_PARAMS 2>&1 | tee $TEST_DIR/mochitest$TEST_FLAVOUR + +rm -f objdir/dist/bin/certutil +rm -f objdir/dist/bin/pk12util diff --git a/run-wayland-compositor b/run-wayland-compositor new file mode 100755 index 0000000000000000000000000000000000000000..0480ed21663e161598d2ceae63734987537d7f0f --- /dev/null +++ b/run-wayland-compositor @@ -0,0 +1,50 @@ +#!/usr/bin/bash +# Run wayland compositor and set WAYLAND_DISPLAY env variable + +set -x + +echo export DESKTOP_SESSION=gnome > $HOME/.xsessionrc +echo export XDG_CURRENT_DESKTOP=GNOME > $HOME/.xsessionrc +echo export XDG_SESSION_TYPE=wayland >> $HOME/.xsessionrc + +# Turn off the screen saver and screen locking +gsettings set org.gnome.desktop.screensaver idle-activation-enabled false +gsettings set org.gnome.desktop.screensaver lock-enabled false +gsettings set org.gnome.desktop.screensaver lock-delay 3600 + +# Disable the screen saver +# This starts the gnome-keyring-daemon with an unlocked login keyring. libsecret uses this to +# store secrets. Firefox uses libsecret to store a key that protects sensitive information like +# credit card numbers. +if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then + # if not found, launch a new one + eval `dbus-launch --sh-syntax` +fi +eval `echo '' | /usr/bin/gnome-keyring-daemon -r -d --unlock --components=secrets` + +if [ -z "$XDG_RUNTIME_DIR" ]; then + export XDG_RUNTIME_DIR=$HOME +fi + +. xvfb-run -s "-screen 0 1600x1200x24" -n 80 mutter --display=:80 --wayland --nested & +export DISPLAY=:80 + +if [ -z "$WAYLAND_DISPLAY" ] ; then + export WAYLAND_DISPLAY=wayland-0 +else + export WAYLAND_DISPLAY=wayland-1 +fi +sleep 10 +retry_count=0 +max_retries=5 +until [ $retry_count -gt $max_retries ]; do + if [ -S "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY" ]; then + retry_count=$(($max_retries + 1)) + else + retry_count=$(($retry_count + 1)) + echo "Waiting for Mutter, retry: $retry_count" + sleep 2 + fi +done + +env | grep "DISPLAY" diff --git a/shebang-build.patch b/shebang-build.patch new file mode 100644 index 0000000000000000000000000000000000000000..9ade86c309334fabd6fe4771209f54e1f0493d06 --- /dev/null +++ b/shebang-build.patch @@ -0,0 +1,9 @@ +diff -up firefox-73.0/build/unix/run-mozilla.sh.old firefox-73.0/build/unix/run-mozilla.sh +--- firefox-73.0/build/unix/run-mozilla.sh.old 2020-02-12 09:58:00.150895904 +0100 ++++ firefox-73.0/build/unix/run-mozilla.sh 2020-02-12 09:58:06.505860696 +0100 +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/usr/bin/sh + # + # 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