From e5610c145413cc5cdc0f192f5f368f8a18ba9654 Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Thu, 23 Oct 2025 09:21:08 +0800 Subject: [PATCH] support building with system cbindgen (cherry picked from commit 1def49ceb208dad244cb876e2b9e6a6b269559ca) --- firefox.spec | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/firefox.spec b/firefox.spec index 7822c59..8125304 100644 --- a/firefox.spec +++ b/firefox.spec @@ -26,6 +26,7 @@ %global system_drm 0 %global use_pipewire_camera 0 %global use_gcc_ts 0 +%global use_bundled_cbindgen 1 %if 0%{?openEuler_version} == 22 %global use_gcc_ts 1 @@ -62,7 +63,7 @@ Summary: Mozilla Firefox Web browser Name: firefox Version: 140.4.0 -Release: 2 +Release: 3 URL: https://www.mozilla.org/firefox/ License: MPL-1.1 or GPL-2.0-or-later or LGPL-2.0-or-later Source0: https://ftp.mozilla.org/pub/firefox/releases/%{version}esr/source/firefox-%{version}esr.source.tar.xz @@ -193,6 +194,10 @@ BuildRequires: mesa-libgbm-devel BuildRequires: pipewire-devel %endif +%if !0%{?use_bundled_cbindgen} +BuildRequires: rust-cbindgen +%endif + BuildRequires: cargo BuildRequires: %{llvm}-clang-devel >= %{llvm_version} BuildRequires: %{llvm}-clang >= %{llvm_version} @@ -624,6 +629,8 @@ which ld which nasm which node which python3 + +%if 0%{?use_bundled_cbindgen} # Bundled cbindgen mkdir -p my_rust_vendor cd my_rust_vendor @@ -644,6 +651,7 @@ export PATH=`pwd`/.cargo/bin:$PATH cd - # end of Bundled cbindgen +%endif mkdir %{_buildrootdir}/bin || : chmod a+x %{SOURCE32} @@ -667,11 +675,12 @@ MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-g/-g0/') export MOZ_DEBUG_FLAGS=" " %endif +MOZ_LINK_FLAGS="%{?build_ldflags}" ### NOTE: these sections are not required anymore. Alson --no-keep-memory + -Wl,-z,pack-relative-relocs causes ### ld to go OOM (https://sourceware.org/bugzilla/show_bug.cgi?id=30756) # Limit RAM usage during link #%ifarch s390x aarch64 %{ix86} -#MOZ_LINK_FLAGS="-Wl,--no-keep-memory -Wl,--reduce-memory-overheads" +MOZ_LINK_FLAGS="$MOZ_LINK_FLAGS -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" #%endif %if 0%{?flatpak} @@ -1024,6 +1033,10 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %endif %changelog +* Wed Oct 22 2025 Funda Wang - 140.4.0-3 +- support building with system cbindgen +- build with system ldflags + * Tue Oct 21 2025 Peng Haitao - 140.4.0-2 - Modify openEuler to %{vendor} -- Gitee