From bc72b53dfb70da2469849a5d2c3ea69139eb5e6c Mon Sep 17 00:00:00 2001 From: zhuhongbo Date: Mon, 8 Sep 2025 15:15:27 +0800 Subject: [PATCH] Update to firefox-128.5.1-1 --- download | 5 ++- firefox-anolis-default-prefs.js | 2 +- firefox-mozconfig | 2 - firefox.spec | 65 +++++++++++++++++++++++++++++---- wasi.patch | 12 ++++++ wasi.patch.template | 12 ++++++ 6 files changed, 86 insertions(+), 12 deletions(-) create mode 100644 wasi.patch create mode 100644 wasi.patch.template diff --git a/download b/download index 284fe24..3d65271 100644 --- a/download +++ b/download @@ -1,7 +1,8 @@ fc25f988b87b5187d4e2f006efa699a3 cbindgen-vendor.tar.xz b3c1d2ea615cb0195f4f62b005773262 mochitest-python.tar.gz -243e5cc9280f6013db6fc9949f84a536 firefox-128.4.0esr.processed-source.tar.xz -40aba5a73ff41a4421fe55e474a98b82 firefox-langpacks-128.4.0esr-20241022.tar.xz +99ab93195f2701b6a1d4c51e7fa90e1b firefox-128.5.1esr.processed-source.tar.xz +89357336f89f65969d33a7ccee839d17 firefox-langpacks-128.5.1esr-20241202.tar.xz 7b35b9a003996b1f1dbc3cd936a609f2 nspr-4.35.0-1.el8_1.src.rpm ab085bce989de91681f48fdd05be4c0f nss-3.101.0-7.el8_2.src.rpm dbf6357877e3e1042de1a95cdfb61507 nss-3.101.0-7.el9_2.src.rpm +2d901c7a62fc68bbd8816e8c4c6276c1 wasi-sdk-20.tar.gz diff --git a/firefox-anolis-default-prefs.js b/firefox-anolis-default-prefs.js index 66813cc..ad8dbea 100644 --- a/firefox-anolis-default-prefs.js +++ b/firefox-anolis-default-prefs.js @@ -14,7 +14,7 @@ pref("browser.shell.checkDefaultBrowser", false); pref("network.manage-offline-status", true); pref("extensions.shownSelectionUI", true); pref("ui.SpellCheckerUnderlineStyle", 1); -ref("startup.homepage_override_url", "https://openanolis.cn/"); +pref("startup.homepage_override_url", "https://openanolis.cn/"); pref("startup.homepage_welcome_url", "https://openanolis.cn/"); pref("browser.startup.homepage", "data:text/plain,browser.startup.homepage=file:///%PREFIX%/share/doc/HTML/index.html"); pref("media.gmp-gmpopenh264.autoupdate",true); diff --git a/firefox-mozconfig b/firefox-mozconfig index 9944800..0a4e08a 100644 --- a/firefox-mozconfig +++ b/firefox-mozconfig @@ -12,9 +12,7 @@ ac_add_options --enable-official-branding ac_add_options --enable-pulseaudio ac_add_options --enable-release ac_add_options --enable-system-ffi -ac_add_options --without-sysroot ac_add_options --without-system-icu -ac_add_options --without-wasm-sandboxed-libraries ac_add_options --with-system-jpeg ac_add_options --with-system-zlib ac_add_options --with-unsigned-addon-scopes=app,system diff --git a/firefox.spec b/firefox.spec index bbebd80..f9a09c5 100644 --- a/firefox.spec +++ b/firefox.spec @@ -18,6 +18,9 @@ AutoReq: no AutoProv: no +# wasi_sdk is for sandboxing third party c/c++ libs by using rlbox, exclude s390x on the f39. +%bcond_with wasi_sdk + %{lua: function dist_to_rhel_minor(str, start) match = string.match(str, ".module%+an8.%d+") @@ -42,7 +45,7 @@ function dist_to_rhel_minor(str, start) end match = string.match(str, ".el9") if match then - return 5 + return 6 end match = string.match(str, ".el10_%d+") if match then @@ -62,22 +65,31 @@ end} %global bundle_nss 0 %if 0%{?rhel} == 7 -%global bundle_nss 0 -%global system_nss 0 + %global bundle_nss 0 + %global system_nss 0 %endif + %if 0%{?rhel} == 8 %if %{rhel_minor_version} < 8 %global bundle_nss 1 %global system_nss 1 %endif + %if %{rhel_minor_version} >= 10 + %global with_wasi_sdk 1 + %endif %endif + %if 0%{?rhel} == 9 %if %{rhel_minor_version} < 2 %global bundle_nss 1 %global system_nss 1 %endif + %if %{rhel_minor_version} > 5 + %global with_wasi_sdk 1 + %endif %endif + %global dts_version 11 %global llvm_version 7.0 %global nspr_version 4.35 @@ -143,7 +155,7 @@ end} Summary: Mozilla Firefox Web browser Name: firefox -Version: 128.4.0 +Version: 128.5.1 Release: 1%{anolis_release}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ @@ -174,7 +186,7 @@ ExcludeArch: aarch64 s390 ppc # Link to original tarball: https://archive.mozilla.org/pub/firefox/releases/%%{version}%%{?pre_version}/source/firefox-%%{version}%%{?pre_version}.source.tar.xz Source0: firefox-%{version}%{?pre_version}%{?buildnum}.processed-source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20241022.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20241202.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: process-official-tarball @@ -195,6 +207,11 @@ Source34: firefox-search-provider.ini Source35: google-loc-api-key Source36: testing.sh Source37: mochitest-python.tar.gz +Source38: wasi.patch.template +# Created by: +# git clone --recursive https://github.com/WebAssembly/wasi-sdk.git +# cd wasi-sdk && git-archive-all --force-submodules wasi-sdk-20.tar.gz +Source50: wasi-sdk-20.tar.gz # Bundled libraries Source401: nss-setup-flags-env.inc @@ -246,7 +263,7 @@ Patch155: rhbz-1354671.patch Patch200: webrtc-128.0.patch.patch Patch201: D224587.1728128070.diff Patch202: D224588.1728128098.diff - +Patch203: wasi.patch # ---- Test patches ---- # Generate without context by @@ -367,6 +384,11 @@ BuildRequires: xmlto BuildRequires: zlib-devel %endif +%if %{with wasi_sdk} +BuildRequires: lld +BuildRequires: clang cmake ninja-build +%endif + #%if !0%{?flatpak} #TODO #BuildRequires: system-bookmarks @@ -1132,10 +1154,15 @@ echo "system_nss %{?system_nss}" echo "use_dts %{?use_dts}" echo "use_nodejs_scl %{?use_nodejs_scl}" echo "use_python3_scl %{?use_python3_scl}" +echo "with_wasi_sdk %{?with_wasi_sdk}" echo "--------------------------------------------" #clang -print-search-dirs %setup -q -n %{name}-%{version} +%if %{with wasi_sdk} +%setup -q -T -D -a 50 +%endif + # ---- RHEL specific patches --- # -- Downstream only -- %patch -P1 -p1 -b .disable-elfhack @@ -1161,6 +1188,12 @@ echo "--------------------------------------------" %patch -P9 -p1 -b .rhbz-2131158-webrtc-nss-fix %patch -P10 -p1 -b .build-ffvpx +# We need to create the wasi.patch with the correct path to the wasm libclang_rt. +%if %{with wasi_sdk} +export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a; cat %{SOURCE38} | envsubst > %{_sourcedir}/wasi.patch +%patch -P203 -p1 -b .wasi +%endif + # -- Upstreamed patches -- %patch -P51 -p1 -b .mozilla-bmo1170092 @@ -1192,7 +1225,6 @@ echo "--------------------------------------------" %patch -P202 -p1 -b .D224588 %endif - # ---- Security patches ---- %{__rm} -f .mozconfig @@ -1273,6 +1305,13 @@ echo "ac_add_options --with-google-safebrowsing-api-keyfile=`pwd`/google-api-key # Clang 17 upstream's detection fails, tell it where to look. echo "ac_add_options --with-libclang-path=`llvm-config --libdir`" >> .mozconfig +%if %{with wasi_sdk} +echo "ac_add_options --with-wasi-sysroot=`pwd`/wasi-sdk-20/build/install/opt/wasi-sdk/share/wasi-sysroot" >> .mozconfig +%else +echo "ac_add_options --without-sysroot" >> .mozconfig +echo "ac_add_options --without-wasm-sandboxed-libraries" >> .mozconfig +%endif + echo 'export NODEJS="%{_buildrootdir}/bin/node-stdout-nonblocking-wrapper"' >> .mozconfig # Remove executable bit to make brp-mangle-shebangs happy. @@ -1311,6 +1350,15 @@ export LDFLAGS="$LDFLAGS -static-libstdc++ -static-libgcc -Wl,-Bstatic -lstdc++ # Disable LTO to work around rhbz#1883904 %define _lto_cflags %{nil} +#WASI SDK +%if %{with wasi_sdk} +pushd wasi-sdk-20 +sed -i -e "s|VERSION=.*|VERSION=20|g" tar_from_installation.sh +cat tar_from_installation.sh +NINJA_FLAGS=-v CC=clang CXX=clang++ env -u CFLAGS -u CXXFLAGS -u FFLAGS -u VALFLAGS -u RUSTFLAGS -u LDFLAGS -u LT_SYS_LIBRARY_PATH make package +popd +%endif + export PATH="%{_buildrootdir}/bin:$PATH" # Cleanup buildroot for existing rpms from bundled nss/nspr and other packages rm -rf %{_buildrootdir}/* @@ -1953,6 +2001,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Fri Sep 5 2025 zhuhongbo - 128.5.1-1.0.2 +- Update to firefox-128.5.1-1 + * Fri Sep 5 2025 zhuhongbo - 128.4.0-1.0.2 - Update to firefox-128.4.0-1 diff --git a/wasi.patch b/wasi.patch new file mode 100644 index 0000000..b47b496 --- /dev/null +++ b/wasi.patch @@ -0,0 +1,12 @@ +diff -up firefox-121.0.1/toolkit/moz.configure.wasi firefox-121.0.1/toolkit/moz.configure +--- firefox-121.0.1/toolkit/moz.configure.wasi 2024-02-01 09:14:33.816548952 +0100 ++++ firefox-121.0.1/toolkit/moz.configure 2024-02-01 09:15:53.264684309 +0100 +@@ -2663,7 +2663,7 @@ with only_when(requires_wasm_sandboxing + def wasi_sysroot_flags(wasi_sysroot): + if wasi_sysroot: + log.info("Using wasi sysroot in %s", wasi_sysroot) +- return ["--sysroot=%s" % wasi_sysroot] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/home/jhorak/rpmbuild/BUILDROOT/usr/share/wasi-sysroot/lib/libclang_rt.builtins-wasm32.a"] + return [] + + set_config("WASI_SYSROOT", wasi_sysroot) diff --git a/wasi.patch.template b/wasi.patch.template new file mode 100644 index 0000000..aa2838e --- /dev/null +++ b/wasi.patch.template @@ -0,0 +1,12 @@ +diff -up firefox-121.0.1/toolkit/moz.configure.wasi firefox-121.0.1/toolkit/moz.configure +--- firefox-121.0.1/toolkit/moz.configure.wasi 2024-02-01 09:14:33.816548952 +0100 ++++ firefox-121.0.1/toolkit/moz.configure 2024-02-01 09:15:53.264684309 +0100 +@@ -2663,7 +2663,7 @@ with only_when(requires_wasm_sandboxing + def wasi_sysroot_flags(wasi_sysroot): + if wasi_sysroot: + log.info("Using wasi sysroot in %s", wasi_sysroot) +- return ["--sysroot=%s" % wasi_sysroot] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "$LIBCLANG_RT"] + return [] + + set_config("WASI_SYSROOT", wasi_sysroot) -- Gitee