commit: 3adc451e1efd5b4c974451062bd387e16e31d474 Author: Matt Jolly <kangie <AT> gentoo <DOT> org> AuthorDate: Sun Feb 22 09:35:09 2026 +0000 Commit: Matt Jolly <kangie <AT> gentoo <DOT> org> CommitDate: Sun Feb 22 09:36:12 2026 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3adc451e
www-client/chromium: fix build with USE=-rar Closes: https://bugs.gentoo.org/970372 Signed-off-by: Matt Jolly <kangie <AT> gentoo.org> www-client/chromium/chromium-145.0.7632.109.ebuild | 1 + www-client/chromium/files/cr145-fix-no-unrar.patch | 144 +++++++++++++++++++++ 2 files changed, 145 insertions(+) diff --git a/www-client/chromium/chromium-145.0.7632.109.ebuild b/www-client/chromium/chromium-145.0.7632.109.ebuild index cdc3d38ed319..6a0de7542fc2 100644 --- a/www-client/chromium/chromium-145.0.7632.109.ebuild +++ b/www-client/chromium/chromium-145.0.7632.109.ebuild @@ -543,6 +543,7 @@ src_prepare() { "${FILESDIR}/cr144-glibc-2.43.patch" "${FILESDIR}/cr145-oauth2-client-switches.patch" "${FILESDIR}/cr145-revert-to-rollup-wasm.patch" + "${FILESDIR}/cr145-fix-no-unrar.patch" ) # No copium patches here: they should only need to apply to unbundled toolchain builds # and don't get fetched or unpacked. diff --git a/www-client/chromium/files/cr145-fix-no-unrar.patch b/www-client/chromium/files/cr145-fix-no-unrar.patch new file mode 100644 index 000000000000..fb7f78780d6b --- /dev/null +++ b/www-client/chromium/files/cr145-fix-no-unrar.patch @@ -0,0 +1,144 @@ +https://chromium-review.googlesource.com/c/chromium/src/+/7493269 +From: LN Liberda <[email protected]> +Date: Tue, 20 Jan 2026 17:01:22 -0800 +Subject: [PATCH] Fixes for safe_browsing_use_unrar=false + +Bug: none +Change-Id: Ie58652c7b7262d74cd9bd9cb88286aed3fda4426 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7493269 +Commit-Queue: Xinghui Lu <[email protected]> +Reviewed-by: Xinghui Lu <[email protected]> +Reviewed-by: Daniel Rubery <[email protected]> +Cr-Commit-Position: refs/heads/main@{#1571974} +--- a/chrome/services/file_util/BUILD.gn ++++ b/chrome/services/file_util/BUILD.gn +@@ -25,7 +25,6 @@ source_set("file_util") { + "//components/safe_browsing:buildflags", + "//extensions/buildflags", + "//mojo/public/cpp/bindings", +- "//third_party/unrar", + "//third_party/zlib", + ] + +@@ -36,7 +35,11 @@ source_set("file_util") { + "//mojo/public/mojom/base", + ] + +- defines = [] ++ defines = [ "USE_UNRAR=$safe_browsing_use_unrar" ] ++ ++ if (safe_browsing_use_unrar) { ++ deps += [ "//third_party/unrar" ] ++ } + + if (is_chromeos) { + sources += [ +@@ -67,8 +70,6 @@ source_set("file_util") { + "//chrome/utility/safe_browsing", + "//components/enterprise/obfuscation/core:enterprise_obfuscation", + ] +- +- defines += [ "USE_UNRAR=$safe_browsing_use_unrar" ] + } + + if (enable_extractors) { +--- a/chrome/services/file_util/obfuscated_archive_analysis_delegate.cc ++++ b/chrome/services/file_util/obfuscated_archive_analysis_delegate.cc +@@ -104,6 +104,7 @@ class ObfuscatedZipWriterDelegate : public zip::FileWriterDelegate, + bool closed_ = false; + }; + ++#if USE_UNRAR + class ObfuscatedRarReaderDelegate + : public third_party_unrar::RarReaderDelegate { + public: +@@ -175,6 +176,7 @@ class ObfuscatedRarWriterDelegate + std::unique_ptr<enterprise_obfuscation::DownloadObfuscator> obfuscator_; + bool init_ = false; + }; ++#endif + + } // namespace + +@@ -203,6 +205,7 @@ ObfuscatedArchiveAnalysisDelegate::CreateZipWriterDelegate(base::File file) { + return std::make_unique<ObfuscatedZipWriterDelegate>(std::move(file)); + } + ++#if USE_UNRAR + std::unique_ptr<third_party_unrar::RarReaderDelegate> + ObfuscatedArchiveAnalysisDelegate::CreateRarReaderDelegate(base::File file) { + base::expected<enterprise_obfuscation::ObfuscatedFileReader, +@@ -220,6 +223,7 @@ std::unique_ptr<third_party_unrar::RarWriterDelegate> + ObfuscatedArchiveAnalysisDelegate::CreateRarWriterDelegate(base::File file) { + return std::make_unique<ObfuscatedRarWriterDelegate>(std::move(file)); + } ++#endif + + std::unique_ptr<ArchiveAnalysisDelegate> + ObfuscatedArchiveAnalysisDelegate::CreateNestedDelegate( +--- a/chrome/services/file_util/obfuscated_archive_analysis_delegate.h ++++ b/chrome/services/file_util/obfuscated_archive_analysis_delegate.h +@@ -22,10 +22,12 @@ class ObfuscatedArchiveAnalysisDelegate : public ArchiveAnalysisDelegate { + base::File file) override; + std::unique_ptr<SafeBrowsingZipWriterDelegate> CreateZipWriterDelegate( + base::File file) override; ++#if USE_UNRAR + std::unique_ptr<third_party_unrar::RarReaderDelegate> CreateRarReaderDelegate( + base::File file) override; + std::unique_ptr<third_party_unrar::RarWriterDelegate> CreateRarWriterDelegate( + base::File file) override; ++#endif + std::unique_ptr<ArchiveAnalysisDelegate> CreateNestedDelegate( + base::File extracted_file) override; + +--- a/chrome/services/file_util/regular_archive_analysis_delegate.cc ++++ b/chrome/services/file_util/regular_archive_analysis_delegate.cc +@@ -92,6 +92,7 @@ RegularArchiveAnalysisDelegate::CreateZipWriterDelegate(base::File file) { + return std::make_unique<ZipWriterDelegate>(std::move(file)); + } + ++#if USE_UNRAR + std::unique_ptr<third_party_unrar::RarReaderDelegate> + RegularArchiveAnalysisDelegate::CreateRarReaderDelegate(base::File file) { + return std::make_unique<third_party_unrar::FileReader>(std::move(file)); +@@ -101,6 +102,7 @@ std::unique_ptr<third_party_unrar::RarWriterDelegate> + RegularArchiveAnalysisDelegate::CreateRarWriterDelegate(base::File file) { + return std::make_unique<third_party_unrar::FileWriter>(std::move(file)); + } ++#endif + + std::unique_ptr<ArchiveAnalysisDelegate> + RegularArchiveAnalysisDelegate::CreateNestedDelegate( +--- a/chrome/services/file_util/regular_archive_analysis_delegate.h ++++ b/chrome/services/file_util/regular_archive_analysis_delegate.h +@@ -20,10 +20,12 @@ class RegularArchiveAnalysisDelegate : public ArchiveAnalysisDelegate { + base::File file) override; + std::unique_ptr<SafeBrowsingZipWriterDelegate> CreateZipWriterDelegate( + base::File file) override; ++#if USE_UNRAR + std::unique_ptr<third_party_unrar::RarReaderDelegate> CreateRarReaderDelegate( + base::File file) override; + std::unique_ptr<third_party_unrar::RarWriterDelegate> CreateRarWriterDelegate( + base::File file) override; ++#endif + std::unique_ptr<ArchiveAnalysisDelegate> CreateNestedDelegate( + base::File extracted_file) override; + }; +--- a/chrome/utility/safe_browsing/archive_analysis_delegate.h ++++ b/chrome/utility/safe_browsing/archive_analysis_delegate.h +@@ -28,6 +28,7 @@ class ArchiveAnalysisDelegate { + virtual std::unique_ptr<SafeBrowsingZipWriterDelegate> + CreateZipWriterDelegate(base::File file) = 0; + ++#if USE_UNRAR + // Creates a reader delegate for reading the RAR archive. + virtual std::unique_ptr<third_party_unrar::RarReaderDelegate> + CreateRarReaderDelegate(base::File file) = 0; +@@ -35,6 +36,7 @@ class ArchiveAnalysisDelegate { + // Creates a writer delegate for writing extracted RAR entries. + virtual std::unique_ptr<third_party_unrar::RarWriterDelegate> + CreateRarWriterDelegate(base::File file) = 0; ++#endif + + // Creates a delegate for analyzing a nested archive extracted from the + // current archive. Returns nullptr if the nested archive cannot be handled
