├── .gitignore ├── LICENSE ├── add_missing_include.patch ├── allow-to-override-clang-through-env-variables.patch ├── chromium-107-ffmpeg-duration.patch ├── chromium-107-proprietary-codecs.patch ├── chromium-108-EnumTable-crash.patch ├── chromium-108-ffmpeg-first_dts.patch ├── chromium-108-ffmpeg-revert-new-channel-layout-api.patch ├── chromium-108-system-opus.patch ├── chromium-109-disable-GlobalMediaControlsCastStartStop.patch ├── chromium-109-gcc13.patch ├── chromium-109-system-minizip-header-fix.patch ├── chromium-aarch64-cxxflags-addition.patch ├── chromium-enable-widevine.patch ├── chromium-fedora-user-agent.patch ├── chromium-fix-vaapi-on-intel.patch ├── chromium-freeworld.appdata.xml ├── chromium-freeworld.sh ├── chromium-freeworld.spec ├── chromium-java-only-allowed-in-android-builds.patch ├── chromium-manpage.patch ├── chromium-md5-based-build-id.patch ├── chromium-names.patch ├── chromium-no-zlib-mangle.patch ├── chromium-py3-bootstrap.patch ├── chromium-rpm-fusion-brand.patch ├── chromium-symbolic.svg ├── chromium-unbundle-zlib.patch ├── chromium-update-rjsmin-to-1.2.0.patch ├── moc_name.patch ├── noautobuild └── sources /.gitignore: -------------------------------------------------------------------------------- 1 | chromium-*.tar.xz 2 | chromium-patches-*.tar.gz 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2018, Akarshan Biswas 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /add_missing_include.patch: -------------------------------------------------------------------------------- 1 | --- a/extensions/renderer/bindings/argument_spec.h 2022-09-26 16:47:54.000000000 +0100 2 | +++ b/extensions/renderer/bindings/argument_spec.h 2022-09-28 22:08:06.957341472 +0100 3 | @@ -5,6 +5,7 @@ 4 | #ifndef EXTENSIONS_RENDERER_BINDINGS_ARGUMENT_SPEC_H_ 5 | #define EXTENSIONS_RENDERER_BINDINGS_ARGUMENT_SPEC_H_ 6 | 7 | +#include 8 | #include 9 | #include 10 | #include 11 | -------------------------------------------------------------------------------- /allow-to-override-clang-through-env-variables.patch: -------------------------------------------------------------------------------- 1 | From 11fc2f438c726814d54b06dd24a2d393af8d8028 Mon Sep 17 00:00:00 2001 2 | From: Alexey Gladkov 3 | Date: Mon, 27 Aug 2018 14:59:55 +0300 4 | Subject: [PATCH] ALT: allow to override clang through env variables 5 | 6 | --- 7 | build/toolchain/gcc_toolchain.gni | 8 ++++++++ 8 | 1 file changed, 8 insertions(+) 9 | 10 | diff --git a/build/toolchain/gcc_toolchain.gni b/build/toolchain/gcc_toolchain.gni 11 | index 0ad4537a302..3af38ae1c3f 100644 12 | --- a/build/toolchain/gcc_toolchain.gni 13 | +++ b/build/toolchain/gcc_toolchain.gni 14 | @@ -286,20 +286,28 @@ template("gcc_toolchain") { 15 | if (defined(invoker.readelf)) { 16 | readelf = invoker.readelf 17 | } else { 18 | readelf = "readelf" 19 | } 20 | if (defined(invoker.nm)) { 21 | nm = invoker.nm 22 | } else { 23 | nm = "nm" 24 | } 25 | + 26 | + cc = getenv("CC") 27 | + cxx = getenv("CXX") 28 | + ld = getenv("CXX") 29 | + readelf = getenv("READELF") 30 | + ar = getenv("AR") 31 | + nm = getenv("NM") 32 | + 33 | if (defined(invoker.dwp)) { 34 | dwp_switch = " --dwp=\"${invoker.dwp}\"" 35 | } else { 36 | dwp_switch = "" 37 | } 38 | 39 | if (defined(invoker.shlib_extension)) { 40 | default_shlib_extension = invoker.shlib_extension 41 | } else { 42 | default_shlib_extension = shlib_extension 43 | -- 44 | 2.25.4 45 | 46 | -------------------------------------------------------------------------------- /chromium-107-ffmpeg-duration.patch: -------------------------------------------------------------------------------- 1 | diff -up chromium-107.0.5304.121/media/filters/audio_file_reader.cc.me chromium-107.0.5304.121/media/filters/audio_file_reader.cc 2 | --- chromium-107.0.5304.121/media/filters/audio_file_reader.cc.me 2022-12-17 08:27:12.204753071 +0100 3 | +++ chromium-107.0.5304.121/media/filters/audio_file_reader.cc 2022-12-17 08:28:40.908211808 +0100 4 | @@ -243,10 +243,10 @@ bool AudioFileReader::OnNewFrame( 5 | // silence from being output. In the case where we are also discarding some 6 | // portion of the packet (as indicated by a negative pts), we further want to 7 | // adjust the duration downward by however much exists before zero. 8 | - if (audio_codec_ == AudioCodec::kAAC && frame->duration) { 9 | + if (audio_codec_ == AudioCodec::kAAC && frame->pkt_duration) { 10 | const base::TimeDelta pkt_duration = ConvertFromTimeBase( 11 | glue_->format_context()->streams[stream_index_]->time_base, 12 | - frame->duration + std::min(static_cast(0), frame->pts)); 13 | + frame->pkt_duration + std::min(static_cast(0), frame->pts)); 14 | const base::TimeDelta frame_duration = 15 | base::Seconds(frames_read / static_cast(sample_rate_)); 16 | 17 | -------------------------------------------------------------------------------- /chromium-107-proprietary-codecs.patch: -------------------------------------------------------------------------------- 1 | diff -up chromium-107.0.5304.121/media/BUILD.gn.me chromium-107.0.5304.121/media/BUILD.gn 2 | --- chromium-107.0.5304.121/media/BUILD.gn.me 2022-12-17 12:35:44.546779129 +0100 3 | +++ chromium-107.0.5304.121/media/BUILD.gn 2022-12-17 12:35:59.296047028 +0100 4 | @@ -64,12 +64,6 @@ buildflag_header("media_buildflags") { 5 | } 6 | } 7 | 8 | -if (proprietary_codecs && media_use_ffmpeg) { 9 | - assert( 10 | - ffmpeg_branding != "Chromium", 11 | - "proprietary codecs and ffmpeg_branding set to Chromium are incompatible") 12 | -} 13 | - 14 | # Common configuration for targets in the media directory; these must not be 15 | # exported since things like USE_NEON and USE_CRAS have different meanings 16 | # elsewhere in the code base. 17 | -------------------------------------------------------------------------------- /chromium-108-EnumTable-crash.patch: -------------------------------------------------------------------------------- 1 | diff --git a/components/media_router/common/providers/cast/channel/enum_table.h b/components/media_router/common/providers/cast/channel/enum_table.h 2 | index 842553a..89de703 100644 3 | --- a/components/media_router/common/providers/cast/channel/enum_table.h 4 | +++ b/components/media_router/common/providers/cast/channel/enum_table.h 5 | @@ -8,6 +8,7 @@ 6 | #include 7 | #include 8 | #include 9 | +#include 10 | 11 | #include "base/check_op.h" 12 | #include "base/notreached.h" 13 | @@ -187,7 +188,6 @@ class 14 | inline constexpr GenericEnumTableEntry(int32_t value); 15 | inline constexpr GenericEnumTableEntry(int32_t value, base::StringPiece str); 16 | 17 | - GenericEnumTableEntry(const GenericEnumTableEntry&) = delete; 18 | GenericEnumTableEntry& operator=(const GenericEnumTableEntry&) = delete; 19 | 20 | private: 21 | @@ -253,7 +253,6 @@ class EnumTable { 22 | constexpr Entry(E value, base::StringPiece str) 23 | : GenericEnumTableEntry(static_cast(value), str) {} 24 | 25 | - Entry(const Entry&) = delete; 26 | Entry& operator=(const Entry&) = delete; 27 | }; 28 | 29 | @@ -312,15 +311,14 @@ class EnumTable { 30 | if (is_sorted_) { 31 | const std::size_t index = static_cast(value); 32 | if (ANALYZER_ASSUME_TRUE(index < data_.size())) { 33 | - const auto& entry = data_.begin()[index]; 34 | + const auto& entry = data_[index]; 35 | if (ANALYZER_ASSUME_TRUE(entry.has_str())) 36 | return entry.str(); 37 | } 38 | return absl::nullopt; 39 | } 40 | return GenericEnumTableEntry::FindByValue( 41 | - reinterpret_cast(data_.begin()), 42 | - data_.size(), static_cast(value)); 43 | + &data_[0], data_.size(), static_cast(value)); 44 | } 45 | 46 | // This overload of GetString is designed for cases where the argument is a 47 | @@ -348,8 +346,7 @@ class EnumTable { 48 | // enum value directly. 49 | absl::optional GetEnum(base::StringPiece str) const { 50 | auto* entry = GenericEnumTableEntry::FindByString( 51 | - reinterpret_cast(data_.begin()), 52 | - data_.size(), str); 53 | + &data_[0], data_.size(), str); 54 | return entry ? static_cast(entry->value) : absl::optional(); 55 | } 56 | 57 | @@ -364,7 +361,7 @@ class EnumTable { 58 | // Align the data on a cache line boundary. 59 | alignas(64) 60 | #endif 61 | - std::initializer_list data_; 62 | + const std::vector data_; 63 | bool is_sorted_; 64 | 65 | constexpr EnumTable(std::initializer_list data, bool is_sorted) 66 | @@ -376,8 +373,8 @@ class EnumTable { 67 | 68 | for (std::size_t i = 0; i < data.size(); i++) { 69 | for (std::size_t j = i + 1; j < data.size(); j++) { 70 | - const Entry& ei = data.begin()[i]; 71 | - const Entry& ej = data.begin()[j]; 72 | + const Entry& ei = data[i]; 73 | + const Entry& ej = data[j]; 74 | DCHECK(ei.value != ej.value) 75 | << "Found duplicate enum values at indices " << i << " and " << j; 76 | DCHECK(!(ei.has_str() && ej.has_str() && ei.str() == ej.str())) 77 | -------------------------------------------------------------------------------- /chromium-108-ffmpeg-first_dts.patch: -------------------------------------------------------------------------------- 1 | diff -up chromium-108.0.5359.124/AUTHORS.first_dts chromium-108.0.5359.124/AUTHORS 2 | --- chromium-108.0.5359.124/AUTHORS.first_dts 2022-12-31 15:30:52.923006393 +0100 3 | +++ chromium-108.0.5359.124/AUTHORS 2022-12-31 15:32:50.431215836 +0100 4 | @@ -97,6 +97,7 @@ Andra Paraschiv 6 | Andreas Nazlidis 7 | Andreas Papacharalampous 8 | +Andreas Schneider 9 | Andrei Borza 10 | Andrei Parvu 11 | Andrei Parvu 12 | diff -up chromium-108.0.5359.124/media/filters/ffmpeg_demuxer.cc.first_dts chromium-108.0.5359.124/media/filters/ffmpeg_demuxer.cc 13 | --- chromium-108.0.5359.124/media/filters/ffmpeg_demuxer.cc.first_dts 2022-12-14 01:39:52.000000000 +0100 14 | +++ chromium-108.0.5359.124/media/filters/ffmpeg_demuxer.cc 2022-12-31 15:30:52.923006393 +0100 15 | @@ -58,7 +58,7 @@ namespace media { 16 | 17 | namespace { 18 | 19 | -constexpr int64_t kInvalidPTSMarker = static_cast(0x8000000000000000); 20 | +constexpr int64_t kRelativeTsBase = static_cast(0x7ffeffffffffffff); 21 | 22 | void SetAVStreamDiscard(AVStream* stream, AVDiscard discard) { 23 | DCHECK(stream); 24 | @@ -91,7 +91,7 @@ static base::TimeDelta FramesToTimeDelta 25 | sample_rate); 26 | } 27 | 28 | -static base::TimeDelta ExtractStartTime(AVStream* stream) { 29 | +static base::TimeDelta ExtractStartTime(AVStream* stream, int64_t first_dts) { 30 | // The default start time is zero. 31 | base::TimeDelta start_time; 32 | 33 | @@ -101,12 +101,12 @@ static base::TimeDelta ExtractStartTime( 34 | 35 | // Next try to use the first DTS value, for codecs where we know PTS == DTS 36 | // (excludes all H26x codecs). The start time must be returned in PTS. 37 | - if (av_stream_get_first_dts(stream) != kNoFFmpegTimestamp && 38 | + if (first_dts != AV_NOPTS_VALUE && 39 | stream->codecpar->codec_id != AV_CODEC_ID_HEVC && 40 | stream->codecpar->codec_id != AV_CODEC_ID_H264 && 41 | stream->codecpar->codec_id != AV_CODEC_ID_MPEG4) { 42 | const base::TimeDelta first_pts = 43 | - ConvertFromTimeBase(stream->time_base, av_stream_get_first_dts(stream)); 44 | + ConvertFromTimeBase(stream->time_base, first_dts); 45 | if (first_pts < start_time) 46 | start_time = first_pts; 47 | } 48 | @@ -275,6 +275,7 @@ FFmpegDemuxerStream::FFmpegDemuxerStream 49 | fixup_negative_timestamps_(false), 50 | fixup_chained_ogg_(false), 51 | num_discarded_packet_warnings_(0), 52 | + first_dts_(AV_NOPTS_VALUE), 53 | last_packet_pos_(AV_NOPTS_VALUE), 54 | last_packet_dts_(AV_NOPTS_VALUE) { 55 | DCHECK(demuxer_); 56 | @@ -341,6 +342,11 @@ void FFmpegDemuxerStream::EnqueuePacket( 57 | int64_t packet_dts = 58 | packet->dts == AV_NOPTS_VALUE ? packet->pts : packet->dts; 59 | 60 | + if (first_dts_ == AV_NOPTS_VALUE && packet->dts != AV_NOPTS_VALUE && 61 | + last_packet_dts_ != AV_NOPTS_VALUE) { 62 | + first_dts_ = packet->dts - (last_packet_dts_ + kRelativeTsBase); 63 | + } 64 | + 65 | // Chained ogg files have non-monotonically increasing position and time stamp 66 | // values, which prevents us from using them to determine if a packet should 67 | // be dropped. Since chained ogg is only allowed on single track audio only 68 | @@ -683,6 +689,7 @@ void FFmpegDemuxerStream::FlushBuffers(b 69 | ResetBitstreamConverter(); 70 | 71 | if (!preserve_packet_position) { 72 | + first_dts_ = AV_NOPTS_VALUE; 73 | last_packet_pos_ = AV_NOPTS_VALUE; 74 | last_packet_dts_ = AV_NOPTS_VALUE; 75 | } 76 | @@ -1434,7 +1441,8 @@ void FFmpegDemuxer::OnFindStreamInfoDone 77 | 78 | max_duration = std::max(max_duration, streams_[i]->duration()); 79 | 80 | - base::TimeDelta start_time = ExtractStartTime(stream); 81 | + base::TimeDelta start_time = 82 | + ExtractStartTime(stream, streams_[i]->first_dts()); 83 | 84 | // Note: This value is used for seeking, so we must take the true value and 85 | // not the one possibly clamped to zero below. 86 | @@ -1591,7 +1599,7 @@ FFmpegDemuxerStream* FFmpegDemuxer::Find 87 | for (const auto& stream : streams_) { 88 | if (!stream || stream->IsEnabled() != enabled) 89 | continue; 90 | - if (av_stream_get_first_dts(stream->av_stream()) == kInvalidPTSMarker) 91 | + if (stream->first_dts() == AV_NOPTS_VALUE) 92 | continue; 93 | if (!lowest_start_time_stream || 94 | stream->start_time() < lowest_start_time_stream->start_time()) { 95 | @@ -1612,7 +1620,7 @@ FFmpegDemuxerStream* FFmpegDemuxer::Find 96 | if (stream->type() != DemuxerStream::VIDEO) 97 | continue; 98 | 99 | - if (av_stream_get_first_dts(stream->av_stream()) == kInvalidPTSMarker) 100 | + if (stream->first_dts() == AV_NOPTS_VALUE) 101 | continue; 102 | 103 | if (!stream->IsEnabled()) 104 | @@ -1926,4 +1934,4 @@ void FFmpegDemuxer::RunPendingSeekCB(Pip 105 | std::move(pending_seek_cb_).Run(status); 106 | } 107 | 108 | -} // namespace media 109 | +} // namespace media 110 | \ Kein Zeilenumbruch am Dateiende. 111 | diff -up chromium-108.0.5359.124/media/filters/ffmpeg_demuxer.h.first_dts chromium-108.0.5359.124/media/filters/ffmpeg_demuxer.h 112 | --- chromium-108.0.5359.124/media/filters/ffmpeg_demuxer.h.first_dts 2022-12-14 01:39:52.000000000 +0100 113 | +++ chromium-108.0.5359.124/media/filters/ffmpeg_demuxer.h 2022-12-31 15:30:52.924006403 +0100 114 | @@ -145,6 +145,8 @@ class MEDIA_EXPORT FFmpegDemuxerStream : 115 | base::TimeDelta start_time() const { return start_time_; } 116 | void set_start_time(base::TimeDelta time) { start_time_ = time; } 117 | 118 | + int64_t first_dts() const { return first_dts_; } 119 | + 120 | private: 121 | friend class FFmpegDemuxerTest; 122 | 123 | @@ -202,6 +204,7 @@ class MEDIA_EXPORT FFmpegDemuxerStream : 124 | bool fixup_chained_ogg_; 125 | 126 | int num_discarded_packet_warnings_; 127 | + int64_t first_dts_; 128 | int64_t last_packet_pos_; 129 | int64_t last_packet_dts_; 130 | }; 131 | -------------------------------------------------------------------------------- /chromium-108-ffmpeg-revert-new-channel-layout-api.patch: -------------------------------------------------------------------------------- 1 | diff -up chromium-108.0.5359.124/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.cc.revert-new-channel-layout-api chromium-108.0.5359.124/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.cc 2 | --- chromium-108.0.5359.124/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.cc.revert-new-channel-layout-api 2022-12-14 01:39:52.000000000 +0100 3 | +++ chromium-108.0.5359.124/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.cc 2023-01-04 21:44:23.098276796 +0100 4 | @@ -74,7 +74,7 @@ void CdmAudioDecoderConfigToAVCodecConte 5 | codec_context->sample_fmt = AV_SAMPLE_FMT_NONE; 6 | } 7 | 8 | - codec_context->ch_layout.nb_channels = config.channel_count; 9 | + codec_context->channels = config.channel_count; 10 | codec_context->sample_rate = config.samples_per_second; 11 | 12 | if (config.extra_data) { 13 | @@ -124,8 +124,8 @@ void CopySamples(cdm::AudioFormat cdm_fo 14 | case cdm::kAudioFormatPlanarS16: 15 | case cdm::kAudioFormatPlanarF32: { 16 | const int decoded_size_per_channel = 17 | - decoded_audio_size / av_frame.ch_layout.nb_channels; 18 | - for (int i = 0; i < av_frame.ch_layout.nb_channels; ++i) { 19 | + decoded_audio_size / av_frame.channels; 20 | + for (int i = 0; i < av_frame.channels; ++i) { 21 | memcpy(output_buffer, av_frame.extended_data[i], 22 | decoded_size_per_channel); 23 | output_buffer += decoded_size_per_channel; 24 | @@ -185,14 +185,13 @@ bool FFmpegCdmAudioDecoder::Initialize( 25 | // Success! 26 | decoding_loop_ = std::make_unique(codec_context_.get()); 27 | samples_per_second_ = config.samples_per_second; 28 | - bytes_per_frame_ = 29 | - codec_context_->ch_layout.nb_channels * config.bits_per_channel / 8; 30 | + bytes_per_frame_ = codec_context_->channels * config.bits_per_channel / 8; 31 | output_timestamp_helper_ = 32 | std::make_unique(config.samples_per_second); 33 | is_initialized_ = true; 34 | 35 | // Store initial values to guard against midstream configuration changes. 36 | - channels_ = codec_context_->ch_layout.nb_channels; 37 | + channels_ = codec_context_->channels; 38 | av_sample_format_ = codec_context_->sample_fmt; 39 | 40 | return true; 41 | @@ -292,19 +291,17 @@ cdm::Status FFmpegCdmAudioDecoder::Decod 42 | for (auto& frame : audio_frames) { 43 | int decoded_audio_size = 0; 44 | if (frame->sample_rate != samples_per_second_ || 45 | - frame->ch_layout.nb_channels != channels_ || 46 | - frame->format != av_sample_format_) { 47 | + frame->channels != channels_ || frame->format != av_sample_format_) { 48 | DLOG(ERROR) << "Unsupported midstream configuration change!" 49 | << " Sample Rate: " << frame->sample_rate << " vs " 50 | - << samples_per_second_ 51 | - << ", Channels: " << frame->ch_layout.nb_channels << " vs " 52 | - << channels_ << ", Sample Format: " << frame->format << " vs " 53 | - << av_sample_format_; 54 | + << samples_per_second_ << ", Channels: " << frame->channels 55 | + << " vs " << channels_ << ", Sample Format: " << frame->format 56 | + << " vs " << av_sample_format_; 57 | return cdm::kDecodeError; 58 | } 59 | 60 | decoded_audio_size = av_samples_get_buffer_size( 61 | - nullptr, codec_context_->ch_layout.nb_channels, frame->nb_samples, 62 | + nullptr, codec_context_->channels, frame->nb_samples, 63 | codec_context_->sample_fmt, 1); 64 | if (!decoded_audio_size) 65 | continue; 66 | @@ -323,9 +320,9 @@ bool FFmpegCdmAudioDecoder::OnNewFrame( 67 | size_t* total_size, 68 | std::vector>* audio_frames, 69 | AVFrame* frame) { 70 | - *total_size += av_samples_get_buffer_size( 71 | - nullptr, codec_context_->ch_layout.nb_channels, frame->nb_samples, 72 | - codec_context_->sample_fmt, 1); 73 | + *total_size += av_samples_get_buffer_size(nullptr, codec_context_->channels, 74 | + frame->nb_samples, 75 | + codec_context_->sample_fmt, 1); 76 | audio_frames->emplace_back(av_frame_clone(frame)); 77 | return true; 78 | } 79 | diff -up chromium-108.0.5359.124/media/ffmpeg/ffmpeg_common.cc.revert-new-channel-layout-api chromium-108.0.5359.124/media/ffmpeg/ffmpeg_common.cc 80 | --- chromium-108.0.5359.124/media/ffmpeg/ffmpeg_common.cc.revert-new-channel-layout-api 2022-12-14 01:39:52.000000000 +0100 81 | +++ chromium-108.0.5359.124/media/ffmpeg/ffmpeg_common.cc 2023-01-04 21:52:59.674165082 +0100 82 | @@ -353,11 +353,9 @@ bool AVCodecContextToAudioDecoderConfig( 83 | codec_context->sample_fmt, codec_context->codec_id); 84 | 85 | ChannelLayout channel_layout = 86 | - codec_context->ch_layout.nb_channels > 8 87 | + codec_context->channels > 8 88 | ? CHANNEL_LAYOUT_DISCRETE 89 | - : ChannelLayoutToChromeChannelLayout( 90 | - codec_context->ch_layout.u.mask, 91 | - codec_context->ch_layout.nb_channels); 92 | + : ChannelLayoutToChromeChannelLayout(codec_context->channel_layout, codec_context->channels); 93 | 94 | switch (codec) { 95 | // For AC3/EAC3 we enable only demuxing, but not decoding, so FFmpeg does 96 | @@ -409,7 +407,7 @@ bool AVCodecContextToAudioDecoderConfig( 97 | extra_data, encryption_scheme, seek_preroll, 98 | codec_context->delay); 99 | if (channel_layout == CHANNEL_LAYOUT_DISCRETE) 100 | - config->SetChannelsForDiscrete(codec_context->ch_layout.nb_channels); 101 | + config->SetChannelsForDiscrete(codec_context->channels); 102 | 103 | #if BUILDFLAG(ENABLE_PLATFORM_AC3_EAC3_AUDIO) 104 | // These are bitstream formats unknown to ffmpeg, so they don't have 105 | @@ -478,7 +476,7 @@ void AudioDecoderConfigToAVCodecContext( 106 | 107 | // TODO(scherkus): should we set |channel_layout|? I'm not sure if FFmpeg uses 108 | // said information to decode. 109 | - codec_context->ch_layout.nb_channels = config.channels(); 110 | + codec_context->channels = config.channels(); 111 | codec_context->sample_rate = config.samples_per_second(); 112 | 113 | if (config.extra_data().empty()) { 114 | diff -up chromium-108.0.5359.124/media/filters/audio_file_reader.cc.revert-new-channel-layout-api chromium-108.0.5359.124/media/filters/audio_file_reader.cc 115 | --- chromium-108.0.5359.124/media/filters/audio_file_reader.cc.revert-new-channel-layout-api 2023-01-04 21:44:23.095276762 +0100 116 | +++ chromium-108.0.5359.124/media/filters/audio_file_reader.cc 2023-01-04 21:44:23.098276796 +0100 117 | @@ -113,15 +113,14 @@ bool AudioFileReader::OpenDecoder() { 118 | 119 | // Verify the channel layout is supported by Chrome. Acts as a sanity check 120 | // against invalid files. See http://crbug.com/171962 121 | - if (ChannelLayoutToChromeChannelLayout( 122 | - codec_context_->ch_layout.u.mask, 123 | - codec_context_->ch_layout.nb_channels) == 124 | + if (ChannelLayoutToChromeChannelLayout(codec_context_->channel_layout, 125 | + codec_context_->channels) == 126 | CHANNEL_LAYOUT_UNSUPPORTED) { 127 | return false; 128 | } 129 | 130 | // Store initial values to guard against midstream configuration changes. 131 | - channels_ = codec_context_->ch_layout.nb_channels; 132 | + channels_ = codec_context_->channels; 133 | audio_codec_ = CodecIDToAudioCodec(codec_context_->codec_id); 134 | sample_rate_ = codec_context_->sample_rate; 135 | av_sample_format_ = codec_context_->sample_fmt; 136 | @@ -224,7 +223,7 @@ bool AudioFileReader::OnNewFrame( 137 | if (frames_read < 0) 138 | return false; 139 | 140 | - const int channels = frame->ch_layout.nb_channels; 141 | + const int channels = frame->channels; 142 | if (frame->sample_rate != sample_rate_ || channels != channels_ || 143 | frame->format != av_sample_format_) { 144 | DLOG(ERROR) << "Unsupported midstream configuration change!" 145 | diff -up chromium-108.0.5359.124/media/filters/audio_file_reader_unittest.cc.revert-new-channel-layout-api chromium-108.0.5359.124/media/filters/audio_file_reader_unittest.cc 146 | --- chromium-108.0.5359.124/media/filters/audio_file_reader_unittest.cc.revert-new-channel-layout-api 2022-12-14 01:39:52.000000000 +0100 147 | +++ chromium-108.0.5359.124/media/filters/audio_file_reader_unittest.cc 2023-01-04 21:44:23.098276796 +0100 148 | @@ -121,11 +121,11 @@ class AudioFileReaderTest : public testi 149 | EXPECT_FALSE(reader_->Open()); 150 | } 151 | 152 | - void RunTestFailingDecode(const char* fn, int expect_read = 0) { 153 | + void RunTestFailingDecode(const char* fn) { 154 | Initialize(fn); 155 | EXPECT_TRUE(reader_->Open()); 156 | std::vector> decoded_audio_packets; 157 | - EXPECT_EQ(reader_->Read(&decoded_audio_packets), expect_read); 158 | + EXPECT_EQ(reader_->Read(&decoded_audio_packets), 0); 159 | } 160 | 161 | void RunTestPartialDecode(const char* fn) { 162 | @@ -219,7 +219,7 @@ TEST_F(AudioFileReaderTest, AAC_ADTS) { 163 | } 164 | 165 | TEST_F(AudioFileReaderTest, MidStreamConfigChangesFail) { 166 | - RunTestFailingDecode("midstream_config_change.mp3", 42624); 167 | + RunTestFailingDecode("midstream_config_change.mp3"); 168 | } 169 | #endif 170 | 171 | diff -up chromium-108.0.5359.124/media/filters/audio_video_metadata_extractor.cc.revert-new-channel-layout-api chromium-108.0.5359.124/media/filters/audio_video_metadata_extractor.cc 172 | --- chromium-108.0.5359.124/media/filters/audio_video_metadata_extractor.cc.revert-new-channel-layout-api 2022-12-14 01:39:52.000000000 +0100 173 | +++ chromium-108.0.5359.124/media/filters/audio_video_metadata_extractor.cc 2023-01-04 21:44:23.098276796 +0100 174 | @@ -113,15 +113,6 @@ bool AudioVideoMetadataExtractor::Extrac 175 | if (!stream) 176 | continue; 177 | 178 | - void* display_matrix = 179 | - av_stream_get_side_data(stream, AV_PKT_DATA_DISPLAYMATRIX, nullptr); 180 | - if (display_matrix) { 181 | - rotation_ = VideoTransformation::FromFFmpegDisplayMatrix( 182 | - static_cast(display_matrix)) 183 | - .rotation; 184 | - info.tags["rotate"] = base::NumberToString(rotation_); 185 | - } 186 | - 187 | // Extract dictionary from streams also. Needed for containers that attach 188 | // metadata to contained streams instead the container itself, like OGG. 189 | ExtractDictionary(stream->metadata, &info.tags); 190 | @@ -264,6 +255,8 @@ void AudioVideoMetadataExtractor::Extrac 191 | if (raw_tags->find(tag->key) == raw_tags->end()) 192 | (*raw_tags)[tag->key] = tag->value; 193 | 194 | + if (ExtractInt(tag, "rotate", &rotation_)) 195 | + continue; 196 | if (ExtractString(tag, "album", &album_)) 197 | continue; 198 | if (ExtractString(tag, "artist", &artist_)) 199 | diff -up chromium-108.0.5359.124/media/filters/ffmpeg_aac_bitstream_converter.cc.revert-new-channel-layout-api chromium-108.0.5359.124/media/filters/ffmpeg_aac_bitstream_converter.cc 200 | --- chromium-108.0.5359.124/media/filters/ffmpeg_aac_bitstream_converter.cc.revert-new-channel-layout-api 2022-12-14 01:39:52.000000000 +0100 201 | +++ chromium-108.0.5359.124/media/filters/ffmpeg_aac_bitstream_converter.cc 2023-01-04 21:44:23.099276807 +0100 202 | @@ -195,15 +195,14 @@ bool FFmpegAACBitstreamConverter::Conver 203 | if (!header_generated_ || codec_ != stream_codec_parameters_->codec_id || 204 | audio_profile_ != stream_codec_parameters_->profile || 205 | sample_rate_index_ != sample_rate_index || 206 | - channel_configuration_ != 207 | - stream_codec_parameters_->ch_layout.nb_channels || 208 | + channel_configuration_ != stream_codec_parameters_->channels || 209 | frame_length_ != header_plus_packet_size) { 210 | header_generated_ = 211 | GenerateAdtsHeader(stream_codec_parameters_->codec_id, 212 | 0, // layer 213 | stream_codec_parameters_->profile, sample_rate_index, 214 | 0, // private stream 215 | - stream_codec_parameters_->ch_layout.nb_channels, 216 | + stream_codec_parameters_->channels, 217 | 0, // originality 218 | 0, // home 219 | 0, // copyrighted_stream 220 | @@ -215,7 +214,7 @@ bool FFmpegAACBitstreamConverter::Conver 221 | codec_ = stream_codec_parameters_->codec_id; 222 | audio_profile_ = stream_codec_parameters_->profile; 223 | sample_rate_index_ = sample_rate_index; 224 | - channel_configuration_ = stream_codec_parameters_->ch_layout.nb_channels; 225 | + channel_configuration_ = stream_codec_parameters_->channels; 226 | frame_length_ = header_plus_packet_size; 227 | } 228 | 229 | diff -up chromium-108.0.5359.124/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc.revert-new-channel-layout-api chromium-108.0.5359.124/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc 230 | --- chromium-108.0.5359.124/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc.revert-new-channel-layout-api 2022-12-14 01:39:52.000000000 +0100 231 | +++ chromium-108.0.5359.124/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc 2023-01-04 21:44:23.099276807 +0100 232 | @@ -34,7 +34,7 @@ class FFmpegAACBitstreamConverterTest : 233 | memset(&test_parameters_, 0, sizeof(AVCodecParameters)); 234 | test_parameters_.codec_id = AV_CODEC_ID_AAC; 235 | test_parameters_.profile = FF_PROFILE_AAC_MAIN; 236 | - test_parameters_.ch_layout.nb_channels = 2; 237 | + test_parameters_.channels = 2; 238 | test_parameters_.extradata = extradata_header_; 239 | test_parameters_.extradata_size = sizeof(extradata_header_); 240 | } 241 | diff -up chromium-108.0.5359.124/media/filters/ffmpeg_audio_decoder.cc.revert-new-channel-layout-api chromium-108.0.5359.124/media/filters/ffmpeg_audio_decoder.cc 242 | --- chromium-108.0.5359.124/media/filters/ffmpeg_audio_decoder.cc.revert-new-channel-layout-api 2022-12-14 01:39:52.000000000 +0100 243 | +++ chromium-108.0.5359.124/media/filters/ffmpeg_audio_decoder.cc 2023-01-04 21:44:23.099276807 +0100 244 | @@ -28,7 +28,7 @@ namespace media { 245 | 246 | // Return the number of channels from the data in |frame|. 247 | static inline int DetermineChannels(AVFrame* frame) { 248 | - return frame->ch_layout.nb_channels; 249 | + return frame->channels; 250 | } 251 | 252 | // Called by FFmpeg's allocation routine to allocate a buffer. Uses 253 | @@ -233,7 +233,7 @@ bool FFmpegAudioDecoder::OnNewFrame(cons 254 | // Translate unsupported into discrete layouts for discrete configurations; 255 | // ffmpeg does not have a labeled discrete configuration internally. 256 | ChannelLayout channel_layout = ChannelLayoutToChromeChannelLayout( 257 | - codec_context_->ch_layout.u.mask, codec_context_->ch_layout.nb_channels); 258 | + codec_context_->channel_layout, codec_context_->channels); 259 | if (channel_layout == CHANNEL_LAYOUT_UNSUPPORTED && 260 | config_.channel_layout() == CHANNEL_LAYOUT_DISCRETE) { 261 | channel_layout = CHANNEL_LAYOUT_DISCRETE; 262 | @@ -350,11 +350,11 @@ bool FFmpegAudioDecoder::ConfigureDecode 263 | // Success! 264 | av_sample_format_ = codec_context_->sample_fmt; 265 | 266 | - if (codec_context_->ch_layout.nb_channels != config.channels()) { 267 | + if (codec_context_->channels != config.channels()) { 268 | MEDIA_LOG(ERROR, media_log_) 269 | << "Audio configuration specified " << config.channels() 270 | << " channels, but FFmpeg thinks the file contains " 271 | - << codec_context_->ch_layout.nb_channels << " channels"; 272 | + << codec_context_->channels << " channels"; 273 | ReleaseFFmpegResources(); 274 | state_ = DecoderState::kUninitialized; 275 | return false; 276 | @@ -405,7 +405,7 @@ int FFmpegAudioDecoder::GetAudioBuffer(s 277 | if (frame->nb_samples <= 0) 278 | return AVERROR(EINVAL); 279 | 280 | - if (s->ch_layout.nb_channels != channels) { 281 | + if (s->channels != channels) { 282 | DLOG(ERROR) << "AVCodecContext and AVFrame disagree on channel count."; 283 | return AVERROR(EINVAL); 284 | } 285 | @@ -438,8 +438,7 @@ int FFmpegAudioDecoder::GetAudioBuffer(s 286 | ChannelLayout channel_layout = 287 | config_.channel_layout() == CHANNEL_LAYOUT_DISCRETE 288 | ? CHANNEL_LAYOUT_DISCRETE 289 | - : ChannelLayoutToChromeChannelLayout(s->ch_layout.u.mask, 290 | - s->ch_layout.nb_channels); 291 | + : ChannelLayoutToChromeChannelLayout(s->channel_layout, s->channels); 292 | 293 | if (channel_layout == CHANNEL_LAYOUT_UNSUPPORTED) { 294 | DLOG(ERROR) << "Unsupported channel layout."; 295 | -------------------------------------------------------------------------------- /chromium-108-system-opus.patch: -------------------------------------------------------------------------------- 1 | diff -up chromium-108.0.5359.124/media/audio/audio_opus_encoder.h.me chromium-108.0.5359.124/media/audio/audio_opus_encoder.h 2 | --- chromium-108.0.5359.124/media/audio/audio_opus_encoder.h.me 2022-12-31 09:49:17.100277502 +0100 3 | +++ chromium-108.0.5359.124/media/audio/audio_opus_encoder.h 2022-12-31 09:49:57.101016710 +0100 4 | @@ -12,7 +12,7 @@ 5 | #include "media/base/audio_converter.h" 6 | #include "media/base/audio_encoder.h" 7 | #include "media/base/audio_timestamp_helper.h" 8 | -#include "third_party/opus/src/include/opus.h" 9 | +#include 10 | 11 | namespace media { 12 | 13 | -------------------------------------------------------------------------------- /chromium-109-disable-GlobalMediaControlsCastStartStop.patch: -------------------------------------------------------------------------------- 1 | diff -up chromium-109.0.5414.74/chrome/browser/media/router/media_router_feature.cc.disable-GlobalMediaControlsCastStartStop chromium-109.0.5414.74/chrome/browser/media/router/media_router_feature.cc 2 | --- chromium-109.0.5414.74/chrome/browser/media/router/media_router_feature.cc.disable-GlobalMediaControlsCastStartStop 2023-01-11 15:27:50.587737070 +0100 3 | +++ chromium-109.0.5414.74/chrome/browser/media/router/media_router_feature.cc 2023-01-11 15:30:35.136829951 +0100 4 | @@ -48,15 +48,9 @@ BASE_FEATURE(kMediaRemotingWithoutFullsc 5 | "MediaRemotingWithoutFullscreen", 6 | base::FEATURE_DISABLED_BY_DEFAULT); 7 | 8 | -#if BUILDFLAG(IS_CHROMEOS) 9 | BASE_FEATURE(kGlobalMediaControlsCastStartStop, 10 | "GlobalMediaControlsCastStartStop", 11 | base::FEATURE_DISABLED_BY_DEFAULT); 12 | -#else 13 | -BASE_FEATURE(kGlobalMediaControlsCastStartStop, 14 | - "GlobalMediaControlsCastStartStop", 15 | - base::FEATURE_ENABLED_BY_DEFAULT); 16 | -#endif // BUILDFLAG(IS_CHROMEOS) 17 | 18 | #endif // BUILDFLAG(IS_ANDROID) 19 | 20 | -------------------------------------------------------------------------------- /chromium-109-gcc13.patch: -------------------------------------------------------------------------------- 1 | diff -up chromium-109.0.5414.74/base/check_op.h.me chromium-109.0.5414.74/base/check_op.h 2 | --- chromium-109.0.5414.74/base/check_op.h.me 2023-01-17 17:39:27.620875883 +0100 3 | +++ chromium-109.0.5414.74/base/check_op.h 2023-01-17 17:39:42.546060957 +0100 4 | @@ -5,6 +5,7 @@ 5 | #ifndef BASE_CHECK_OP_H_ 6 | #define BASE_CHECK_OP_H_ 7 | 8 | +#include 9 | #include 10 | #include 11 | #include 12 | diff -up chromium-109.0.5414.74/base/debug/profiler.h.me chromium-109.0.5414.74/base/debug/profiler.h 13 | --- chromium-109.0.5414.74/base/debug/profiler.h.me 2023-01-17 16:29:26.368090073 +0100 14 | +++ chromium-109.0.5414.74/base/debug/profiler.h 2023-01-17 16:59:41.190628679 +0100 15 | @@ -7,6 +7,7 @@ 16 | 17 | #include 18 | 19 | +#include 20 | #include 21 | 22 | #include "base/base_export.h" 23 | diff -up chromium-109.0.5414.74/components/viz/common/view_transition_element_resource_id.h.me chromium-109.0.5414.74/components/viz/common/view_transition_element_resource_id.h 24 | --- chromium-109.0.5414.74/components/viz/common/view_transition_element_resource_id.h.me 2023-01-17 19:03:10.920014806 +0100 25 | +++ chromium-109.0.5414.74/components/viz/common/view_transition_element_resource_id.h 2023-01-17 19:03:48.736395274 +0100 26 | @@ -5,6 +5,7 @@ 27 | #ifndef COMPONENTS_VIZ_COMMON_VIEW_TRANSITION_ELEMENT_RESOURCE_ID_H_ 28 | #define COMPONENTS_VIZ_COMMON_VIEW_TRANSITION_ELEMENT_RESOURCE_ID_H_ 29 | 30 | +#include 31 | #include 32 | #include 33 | 34 | diff -up chromium-109.0.5414.74/gpu/config/gpu_feature_info.h.me chromium-109.0.5414.74/gpu/config/gpu_feature_info.h 35 | --- chromium-109.0.5414.74/gpu/config/gpu_feature_info.h.me 2023-01-17 19:06:53.530675129 +0100 36 | +++ chromium-109.0.5414.74/gpu/config/gpu_feature_info.h 2023-01-17 19:07:08.874849879 +0100 37 | @@ -5,6 +5,7 @@ 38 | #ifndef GPU_CONFIG_GPU_FEATURE_INFO_H_ 39 | #define GPU_CONFIG_GPU_FEATURE_INFO_H_ 40 | 41 | +#include 42 | #include 43 | #include 44 | 45 | diff -up chromium-109.0.5414.74/net/base/net_export.h.me chromium-109.0.5414.74/net/base/net_export.h 46 | --- chromium-109.0.5414.74/net/base/net_export.h.me 2023-01-17 18:16:34.133854615 +0100 47 | +++ chromium-109.0.5414.74/net/base/net_export.h 2023-01-17 18:16:15.945623153 +0100 48 | @@ -5,6 +5,8 @@ 49 | #ifndef NET_BASE_NET_EXPORT_H_ 50 | #define NET_BASE_NET_EXPORT_H_ 51 | 52 | +#include 53 | + 54 | // Defines NET_EXPORT so that functionality implemented by the net module can 55 | // be exported to consumers, and NET_EXPORT_PRIVATE that allows unit tests to 56 | // access features not intended to be used directly by real consumers. 57 | diff -up chromium-109.0.5414.74/net/third_party/quiche/src/quiche/quic/core/quic_connection_id.h.me chromium-109.0.5414.74/net/third_party/quiche/src/quiche/quic/core/quic_connection_id.h 58 | --- chromium-109.0.5414.74/net/third_party/quiche/src/quiche/quic/core/quic_connection_id.h.me 2023-01-17 17:46:30.830283261 +0100 59 | +++ chromium-109.0.5414.74/net/third_party/quiche/src/quiche/quic/core/quic_connection_id.h 2023-01-17 17:46:40.158407274 +0100 60 | @@ -5,6 +5,7 @@ 61 | #ifndef QUICHE_QUIC_CORE_QUIC_CONNECTION_ID_H_ 62 | #define QUICHE_QUIC_CORE_QUIC_CONNECTION_ID_H_ 63 | 64 | +#include 65 | #include 66 | #include 67 | 68 | diff -up chromium-109.0.5414.74/sandbox/linux/syscall_broker/broker_file_permission.h.me chromium-109.0.5414.74/sandbox/linux/syscall_broker/broker_file_permission.h 69 | --- chromium-109.0.5414.74/sandbox/linux/syscall_broker/broker_file_permission.h.me 2023-01-17 17:12:34.184686515 +0100 70 | +++ chromium-109.0.5414.74/sandbox/linux/syscall_broker/broker_file_permission.h 2023-01-17 17:13:16.537162420 +0100 71 | @@ -5,6 +5,7 @@ 72 | #ifndef SANDBOX_LINUX_SYSCALL_BROKER_BROKER_FILE_PERMISSION_H_ 73 | #define SANDBOX_LINUX_SYSCALL_BROKER_BROKER_FILE_PERMISSION_H_ 74 | 75 | +#include 76 | #include 77 | #include 78 | 79 | diff -up chromium-109.0.5414.74/third_party/abseil-cpp/absl/strings/string_view.h.me chromium-109.0.5414.74/third_party/abseil-cpp/absl/strings/string_view.h 80 | --- chromium-109.0.5414.74/third_party/abseil-cpp/absl/strings/string_view.h.me 2023-01-17 17:33:20.895717307 +0100 81 | +++ chromium-109.0.5414.74/third_party/abseil-cpp/absl/strings/string_view.h 2023-01-17 17:34:03.456185365 +0100 82 | @@ -27,6 +27,7 @@ 83 | #ifndef ABSL_STRINGS_STRING_VIEW_H_ 84 | #define ABSL_STRINGS_STRING_VIEW_H_ 85 | 86 | +#include 87 | #include 88 | #include 89 | #include 90 | diff -up chromium-109.0.5414.74/third_party/angle/include/GLSLANG/ShaderVars.h.me chromium-109.0.5414.74/third_party/angle/include/GLSLANG/ShaderVars.h 91 | --- chromium-109.0.5414.74/third_party/angle/include/GLSLANG/ShaderVars.h.me 2023-01-17 17:36:15.017616250 +0100 92 | +++ chromium-109.0.5414.74/third_party/angle/include/GLSLANG/ShaderVars.h 2023-01-17 17:36:48.960982195 +0100 93 | @@ -10,6 +10,7 @@ 94 | #ifndef GLSLANG_SHADERVARS_H_ 95 | #define GLSLANG_SHADERVARS_H_ 96 | 97 | +#include 98 | #include 99 | #include 100 | #include 101 | diff -up chromium-109.0.5414.74/third_party/blink/public/common/bluetooth/web_bluetooth_device_id.h.me chromium-109.0.5414.74/third_party/blink/public/common/bluetooth/web_bluetooth_device_id.h 102 | --- chromium-109.0.5414.74/third_party/blink/public/common/bluetooth/web_bluetooth_device_id.h.me 2023-01-17 19:17:40.480876171 +0100 103 | +++ chromium-109.0.5414.74/third_party/blink/public/common/bluetooth/web_bluetooth_device_id.h 2023-01-17 19:17:46.803958320 +0100 104 | @@ -5,6 +5,7 @@ 105 | #ifndef THIRD_PARTY_BLINK_PUBLIC_COMMON_BLUETOOTH_WEB_BLUETOOTH_DEVICE_ID_H_ 106 | #define THIRD_PARTY_BLINK_PUBLIC_COMMON_BLUETOOTH_WEB_BLUETOOTH_DEVICE_ID_H_ 107 | 108 | +#include 109 | #include 110 | #include 111 | 112 | diff -up chromium-109.0.5414.74/third_party/dawn/src/dawn/native/stream/ByteVectorSink.h.me chromium-109.0.5414.74/third_party/dawn/src/dawn/native/stream/ByteVectorSink.h 113 | --- chromium-109.0.5414.74/third_party/dawn/src/dawn/native/stream/ByteVectorSink.h.me 2023-01-17 18:00:37.123218954 +0100 114 | +++ chromium-109.0.5414.74/third_party/dawn/src/dawn/native/stream/ByteVectorSink.h 2023-01-17 18:00:50.610300138 +0100 115 | @@ -15,6 +15,7 @@ 116 | #ifndef SRC_DAWN_NATIVE_STREAM_BYTEVECTORSINK_H_ 117 | #define SRC_DAWN_NATIVE_STREAM_BYTEVECTORSINK_H_ 118 | 119 | +#include 120 | #include 121 | #include 122 | 123 | diff -up chromium-109.0.5414.74/third_party/dawn/src/tint/reader/spirv/namer.h.me chromium-109.0.5414.74/third_party/dawn/src/tint/reader/spirv/namer.h 124 | --- chromium-109.0.5414.74/third_party/dawn/src/tint/reader/spirv/namer.h.me 2023-01-17 18:02:44.681538107 +0100 125 | +++ chromium-109.0.5414.74/third_party/dawn/src/tint/reader/spirv/namer.h 2023-01-17 18:02:57.208679140 +0100 126 | @@ -15,6 +15,7 @@ 127 | #ifndef SRC_TINT_READER_SPIRV_NAMER_H_ 128 | #define SRC_TINT_READER_SPIRV_NAMER_H_ 129 | 130 | +#include 131 | #include 132 | #include 133 | #include 134 | diff -up chromium-109.0.5414.74/third_party/openscreen/src/discovery/dnssd/public/dns_sd_txt_record.h.me chromium-109.0.5414.74/third_party/openscreen/src/discovery/dnssd/public/dns_sd_txt_record.h 135 | --- chromium-109.0.5414.74/third_party/openscreen/src/discovery/dnssd/public/dns_sd_txt_record.h.me 2023-01-18 15:22:38.472940648 +0100 136 | +++ chromium-109.0.5414.74/third_party/openscreen/src/discovery/dnssd/public/dns_sd_txt_record.h 2023-01-18 15:23:09.380255101 +0100 137 | @@ -5,6 +5,7 @@ 138 | #ifndef DISCOVERY_DNSSD_PUBLIC_DNS_SD_TXT_RECORD_H_ 139 | #define DISCOVERY_DNSSD_PUBLIC_DNS_SD_TXT_RECORD_H_ 140 | 141 | +#include 142 | #include 143 | #include 144 | #include 145 | diff -up chromium-109.0.5414.74/third_party/swiftshader/src/System/LRUCache.hpp.me chromium-109.0.5414.74/third_party/swiftshader/src/System/LRUCache.hpp 146 | --- chromium-109.0.5414.74/third_party/swiftshader/src/System/LRUCache.hpp.me 2023-01-17 15:37:48.530626516 +0100 147 | +++ chromium-109.0.5414.74/third_party/swiftshader/src/System/LRUCache.hpp 2023-01-17 16:57:46.025548092 +0100 148 | @@ -17,6 +17,7 @@ 149 | 150 | #include "System/Debug.hpp" 151 | 152 | +#include 153 | #include 154 | #include 155 | #include 156 | diff -up chromium-109.0.5414.74/third_party/vulkan_memory_allocator/include/vk_mem_alloc.h.me chromium-109.0.5414.74/third_party/vulkan_memory_allocator/include/vk_mem_alloc.h 157 | --- chromium-109.0.5414.74/third_party/vulkan_memory_allocator/include/vk_mem_alloc.h.me 2023-01-17 15:40:23.854386206 +0100 158 | +++ chromium-109.0.5414.74/third_party/vulkan_memory_allocator/include/vk_mem_alloc.h 2023-01-17 16:58:19.397862885 +0100 159 | @@ -2388,6 +2388,7 @@ VMA_CALL_PRE void VMA_CALL_POST vmaFreeV 160 | #ifdef VMA_IMPLEMENTATION 161 | #undef VMA_IMPLEMENTATION 162 | 163 | +#include 164 | #include 165 | #include 166 | #include 167 | diff -up chromium-109.0.5414.74/ui/gfx/geometry/linear_gradient.h.me chromium-109.0.5414.74/ui/gfx/geometry/linear_gradient.h 168 | --- chromium-109.0.5414.74/ui/gfx/geometry/linear_gradient.h.me 2023-01-17 18:08:25.745491353 +0100 169 | +++ chromium-109.0.5414.74/ui/gfx/geometry/linear_gradient.h 2023-01-17 18:08:35.777667632 +0100 170 | @@ -5,6 +5,7 @@ 171 | #ifndef UI_GFX_LINEAR_GRADIENT_H_ 172 | #define UI_GFX_LINEAR_GRADIENT_H_ 173 | 174 | +#include 175 | #include 176 | #include 177 | 178 | diff -up chromium-109.0.5414.74/third_party/perfetto/include/perfetto/ext/base/uuid.h.me chromium-109.0.5414.74/third_party/perfetto/include/perfetto/ext/base/uuid.h 179 | --- chromium-109.0.5414.74/third_party/perfetto/include/perfetto/ext/base/uuid.h.me 2023-01-18 16:00:58.563875881 +0100 180 | +++ chromium-109.0.5414.74/third_party/perfetto/include/perfetto/ext/base/uuid.h 2023-01-18 16:02:01.773517452 +0100 181 | @@ -17,6 +17,7 @@ 182 | #ifndef INCLUDE_PERFETTO_EXT_BASE_UUID_H_ 183 | #define INCLUDE_PERFETTO_EXT_BASE_UUID_H_ 184 | 185 | +#include 186 | #include 187 | #include 188 | 189 | diff -up chromium-109.0.5414.74/third_party/ruy/src/ruy/profiler/instrumentation.h.me chromium-109.0.5414.74/third_party/ruy/src/ruy/profiler/instrumentation.h 190 | --- chromium-109.0.5414.74/third_party/ruy/src/ruy/profiler/instrumentation.h.me 2023-01-19 10:10:21.287876736 +0100 191 | +++ chromium-109.0.5414.74/third_party/ruy/src/ruy/profiler/instrumentation.h 2023-01-19 10:11:21.714778896 +0100 192 | @@ -17,6 +17,7 @@ limitations under the License. 193 | #define RUY_RUY_PROFILER_INSTRUMENTATION_H_ 194 | 195 | #ifdef RUY_PROFILER 196 | +#include 197 | #include 198 | #include 199 | #include 200 | diff -up chromium-109.0.5414.74/third_party/tflite/src/tensorflow/lite/kernels/internal/spectrogram.h.me chromium-109.0.5414.74/third_party/tflite/src/tensorflow/lite/kernels/internal/spectrogram.h 201 | --- chromium-109.0.5414.74/third_party/tflite/src/tensorflow/lite/kernels/internal/spectrogram.h.me 2023-01-19 10:30:27.533861985 +0100 202 | +++ chromium-109.0.5414.74/third_party/tflite/src/tensorflow/lite/kernels/internal/spectrogram.h 2023-01-19 10:31:12.585554183 +0100 203 | @@ -31,6 +31,7 @@ limitations under the License. 204 | #ifndef TENSORFLOW_LITE_KERNELS_INTERNAL_SPECTROGRAM_H_ 205 | #define TENSORFLOW_LITE_KERNELS_INTERNAL_SPECTROGRAM_H_ 206 | 207 | +#include 208 | #include 209 | #include 210 | #include 211 | diff -up chromium-109.0.5414.74/base/containers/flat_map.h.mee chromium-109.0.5414.74/base/containers/flat_map.h 212 | --- chromium-109.0.5414.74/base/containers/flat_map.h.mee 2023-01-19 10:59:52.214957773 +0100 213 | +++ chromium-109.0.5414.74/base/containers/flat_map.h 2023-01-19 11:00:06.415215309 +0100 214 | @@ -5,6 +5,7 @@ 215 | #ifndef BASE_CONTAINERS_FLAT_MAP_H_ 216 | #define BASE_CONTAINERS_FLAT_MAP_H_ 217 | 218 | +#include 219 | #include 220 | #include 221 | #include 222 | diff -up chromium-109.0.5414.74/components/crash/core/app/crash_reporter_client.h.mee chromium-109.0.5414.74/components/crash/core/app/crash_reporter_client.h 223 | --- chromium-109.0.5414.74/components/crash/core/app/crash_reporter_client.h.mee 2023-01-19 10:36:40.571422826 +0100 224 | +++ chromium-109.0.5414.74/components/crash/core/app/crash_reporter_client.h 2023-01-19 10:36:49.343565294 +0100 225 | @@ -5,6 +5,7 @@ 226 | #ifndef COMPONENTS_CRASH_CORE_APP_CRASH_REPORTER_CLIENT_H_ 227 | #define COMPONENTS_CRASH_CORE_APP_CRASH_REPORTER_CLIENT_H_ 228 | 229 | +#include 230 | #include 231 | 232 | #include "build/build_config.h" 233 | diff -up chromium-109.0.5414.74/device/bluetooth/public/cpp/bluetooth_uuid.h.mee chromium-109.0.5414.74/device/bluetooth/public/cpp/bluetooth_uuid.h 234 | --- chromium-109.0.5414.74/device/bluetooth/public/cpp/bluetooth_uuid.h.mee 2023-01-19 10:46:54.826513707 +0100 235 | +++ chromium-109.0.5414.74/device/bluetooth/public/cpp/bluetooth_uuid.h 2023-01-19 10:47:11.255711472 +0100 236 | @@ -5,6 +5,7 @@ 237 | #ifndef DEVICE_BLUETOOTH_PUBLIC_CPP_BLUETOOTH_UUID_H_ 238 | #define DEVICE_BLUETOOTH_PUBLIC_CPP_BLUETOOTH_UUID_H_ 239 | 240 | +#include 241 | #include 242 | #include 243 | #include 244 | diff -up chromium-109.0.5414.74/ui/base/prediction/kalman_filter.h.mee chromium-109.0.5414.74/ui/base/prediction/kalman_filter.h 245 | --- chromium-109.0.5414.74/ui/base/prediction/kalman_filter.h.mee 2023-01-19 11:45:15.953159755 +0100 246 | +++ chromium-109.0.5414.74/ui/base/prediction/kalman_filter.h 2023-01-19 11:45:22.320246241 +0100 247 | @@ -5,6 +5,8 @@ 248 | #ifndef UI_BASE_PREDICTION_KALMAN_FILTER_H_ 249 | #define UI_BASE_PREDICTION_KALMAN_FILTER_H_ 250 | 251 | +#include 252 | + 253 | #include "base/component_export.h" 254 | #include "ui/gfx/geometry/matrix3_f.h" 255 | 256 | diff -up chromium-109.0.5414.74/components/password_manager/core/browser/generation/password_generator.h.me chromium-109.0.5414.74/components/password_manager/core/browser/generation/password_generator.h 257 | --- chromium-109.0.5414.74/components/password_manager/core/browser/generation/password_generator.h.me 2023-01-19 15:20:07.620987949 +0100 258 | +++ chromium-109.0.5414.74/components/password_manager/core/browser/generation/password_generator.h 2023-01-19 15:20:18.324173702 +0100 259 | @@ -5,6 +5,7 @@ 260 | #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_GENERATION_PASSWORD_GENERATOR_H_ 261 | #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_GENERATION_PASSWORD_GENERATOR_H_ 262 | 263 | +#include 264 | #include 265 | 266 | 267 | diff -up chromium-109.0.5414.74/components/feature_engagement/internal/event_storage_validator.h.me chromium-109.0.5414.74/components/feature_engagement/internal/event_storage_validator.h 268 | --- chromium-109.0.5414.74/components/feature_engagement/internal/event_storage_validator.h.me 2023-01-19 16:00:14.350186515 +0100 269 | +++ chromium-109.0.5414.74/components/feature_engagement/internal/event_storage_validator.h 2023-01-19 16:00:21.643307993 +0100 270 | @@ -5,6 +5,7 @@ 271 | #ifndef COMPONENTS_FEATURE_ENGAGEMENT_INTERNAL_EVENT_STORAGE_VALIDATOR_H_ 272 | #define COMPONENTS_FEATURE_ENGAGEMENT_INTERNAL_EVENT_STORAGE_VALIDATOR_H_ 273 | 274 | +#include 275 | #include 276 | 277 | namespace feature_engagement { 278 | diff -up chromium-109.0.5414.74/components/feature_engagement/internal/never_event_storage_validator.h.me chromium-109.0.5414.74/components/feature_engagement/internal/never_event_storage_validator.h 279 | --- chromium-109.0.5414.74/components/feature_engagement/internal/never_event_storage_validator.h.me 2023-01-19 15:59:18.210239416 +0100 280 | +++ chromium-109.0.5414.74/components/feature_engagement/internal/never_event_storage_validator.h 2023-01-19 15:59:34.513515030 +0100 281 | @@ -5,6 +5,7 @@ 282 | #ifndef COMPONENTS_FEATURE_ENGAGEMENT_INTERNAL_NEVER_EVENT_STORAGE_VALIDATOR_H_ 283 | #define COMPONENTS_FEATURE_ENGAGEMENT_INTERNAL_NEVER_EVENT_STORAGE_VALIDATOR_H_ 284 | 285 | +#include 286 | #include 287 | 288 | #include "components/feature_engagement/internal/event_storage_validator.h" 289 | diff -up chromium-109.0.5414.74/third_party/swiftshader/third_party/llvm-10.0/llvm/include/llvm/Support/Signals.h.me chromium-109.0.5414.74/third_party/swiftshader/third_party/llvm-10.0/llvm/include/llvm/Support/Signals.h 290 | --- chromium-109.0.5414.74/third_party/swiftshader/third_party/llvm-10.0/llvm/include/llvm/Support/Signals.h.me 2023-01-19 16:06:17.548272878 +0100 291 | +++ chromium-109.0.5414.74/third_party/swiftshader/third_party/llvm-10.0/llvm/include/llvm/Support/Signals.h 2023-01-19 16:06:25.685410592 +0100 292 | @@ -14,6 +14,7 @@ 293 | #ifndef LLVM_SUPPORT_SIGNALS_H 294 | #define LLVM_SUPPORT_SIGNALS_H 295 | 296 | +#include 297 | #include 298 | 299 | namespace llvm { 300 | diff -up chromium-109.0.5414.74/third_party/swiftshader/third_party/llvm-10.0/llvm/lib/Support/Unix/Signals.inc.me chromium-109.0.5414.74/third_party/swiftshader/third_party/llvm-10.0/llvm/lib/Support/Unix/Signals.inc 301 | --- chromium-109.0.5414.74/third_party/swiftshader/third_party/llvm-10.0/llvm/lib/Support/Unix/Signals.inc.me 2023-01-19 16:09:29.216477182 +0100 302 | +++ chromium-109.0.5414.74/third_party/swiftshader/third_party/llvm-10.0/llvm/lib/Support/Unix/Signals.inc 2023-01-19 16:10:05.657089208 +0100 303 | @@ -45,6 +45,7 @@ 304 | #include "llvm/Support/SaveAndRestore.h" 305 | #include "llvm/Support/raw_ostream.h" 306 | #include 307 | +#include 308 | #include 309 | #include 310 | #ifdef HAVE_BACKTRACE 311 | diff -up chromium-109.0.5414.74/chrome/browser/privacy_budget/encountered_surface_tracker.h.me chromium-109.0.5414.74/chrome/browser/privacy_budget/encountered_surface_tracker.h 312 | --- chromium-109.0.5414.74/chrome/browser/privacy_budget/encountered_surface_tracker.h.me 2023-01-19 16:32:05.338160131 +0100 313 | +++ chromium-109.0.5414.74/chrome/browser/privacy_budget/encountered_surface_tracker.h 2023-01-19 16:32:16.213326798 +0100 314 | @@ -5,6 +5,7 @@ 315 | #ifndef CHROME_BROWSER_PRIVACY_BUDGET_ENCOUNTERED_SURFACE_TRACKER_H_ 316 | #define CHROME_BROWSER_PRIVACY_BUDGET_ENCOUNTERED_SURFACE_TRACKER_H_ 317 | 318 | +#include 319 | #include 320 | 321 | #include "base/containers/flat_set.h" 322 | diff -up chromium-109.0.5414.74/components/autofill/core/browser/autofill_ablation_study.h.me chromium-109.0.5414.74/components/autofill/core/browser/autofill_ablation_study.h 323 | --- chromium-109.0.5414.74/components/autofill/core/browser/autofill_ablation_study.h.me 2023-01-19 16:47:55.548571102 +0100 324 | +++ chromium-109.0.5414.74/components/autofill/core/browser/autofill_ablation_study.h 2023-01-19 16:48:29.214146529 +0100 325 | @@ -5,6 +5,7 @@ 326 | #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_ABLATION_STUDY_H_ 327 | #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_ABLATION_STUDY_H_ 328 | 329 | +#include 330 | #include 331 | 332 | class GURL; 333 | diff -up chromium-109.0.5414.74/components/omnibox/browser/on_device_head_model.h.me chromium-109.0.5414.74/components/omnibox/browser/on_device_head_model.h 334 | --- chromium-109.0.5414.74/components/omnibox/browser/on_device_head_model.h.me 2023-01-19 16:57:29.525372814 +0100 335 | +++ chromium-109.0.5414.74/components/omnibox/browser/on_device_head_model.h 2023-01-19 16:58:02.667979288 +0100 336 | @@ -5,6 +5,7 @@ 337 | #ifndef COMPONENTS_OMNIBOX_BROWSER_ON_DEVICE_HEAD_MODEL_H_ 338 | #define COMPONENTS_OMNIBOX_BROWSER_ON_DEVICE_HEAD_MODEL_H_ 339 | 340 | +#include 341 | #include 342 | #include 343 | #include 344 | diff -up chromium-109.0.5414.74/components/payments/content/utility/fingerprint_parser.h.me chromium-109.0.5414.74/components/payments/content/utility/fingerprint_parser.h 345 | --- chromium-109.0.5414.74/components/payments/content/utility/fingerprint_parser.h.me 2023-01-19 17:02:45.258544665 +0100 346 | +++ chromium-109.0.5414.74/components/payments/content/utility/fingerprint_parser.h 2023-01-19 17:02:52.577611757 +0100 347 | @@ -5,6 +5,7 @@ 348 | #ifndef COMPONENTS_PAYMENTS_CONTENT_UTILITY_FINGERPRINT_PARSER_H_ 349 | #define COMPONENTS_PAYMENTS_CONTENT_UTILITY_FINGERPRINT_PARSER_H_ 350 | 351 | +#include 352 | #include 353 | 354 | #include 355 | diff -up chromium-109.0.5414.74/pdf/document_attachment_info.h.me chromium-109.0.5414.74/pdf/document_attachment_info.h 356 | --- chromium-109.0.5414.74/pdf/document_attachment_info.h.me 2023-01-19 17:28:28.552063534 +0100 357 | +++ chromium-109.0.5414.74/pdf/document_attachment_info.h 2023-01-19 17:28:48.072379953 +0100 358 | @@ -5,6 +5,7 @@ 359 | #ifndef PDF_DOCUMENT_ATTACHMENT_INFO_H_ 360 | #define PDF_DOCUMENT_ATTACHMENT_INFO_H_ 361 | 362 | +#include 363 | #include 364 | 365 | 366 | diff -up chromium-109.0.5414.74/third_party/pdfium/constants/annotation_flags.h.me chromium-109.0.5414.74/third_party/pdfium/constants/annotation_flags.h 367 | --- chromium-109.0.5414.74/third_party/pdfium/constants/annotation_flags.h.me 2023-01-19 18:25:47.648193710 +0100 368 | +++ chromium-109.0.5414.74/third_party/pdfium/constants/annotation_flags.h 2023-01-19 18:26:11.488593556 +0100 369 | @@ -5,6 +5,8 @@ 370 | #ifndef CONSTANTS_ANNOTATION_FLAGS_H_ 371 | #define CONSTANTS_ANNOTATION_FLAGS_H_ 372 | 373 | +#include 374 | + 375 | namespace pdfium { 376 | namespace annotation_flags { 377 | 378 | diff -up chromium-109.0.5414.74/base/cpu.h.me chromium-109.0.5414.74/base/cpu.h 379 | --- chromium-109.0.5414.74/base/cpu.h.me 2023-01-19 21:31:02.905062987 +0100 380 | +++ chromium-109.0.5414.74/base/cpu.h 2023-01-19 21:31:32.298573267 +0100 381 | @@ -5,6 +5,7 @@ 382 | #ifndef BASE_CPU_H_ 383 | #define BASE_CPU_H_ 384 | 385 | +#include 386 | #include 387 | 388 | #include "base/base_export.h" 389 | -------------------------------------------------------------------------------- /chromium-109-system-minizip-header-fix.patch: -------------------------------------------------------------------------------- 1 | diff -up chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc.system-minizip chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc 2 | --- chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc.system-minizip 2023-01-04 20:20:37.000000000 +0100 3 | +++ chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc 2023-01-08 15:48:08.654793086 +0100 4 | @@ -27,8 +27,8 @@ limitations under the License. 5 | #include "tensorflow_lite_support/cc/port/status_macros.h" 6 | #include "tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.h" 7 | #include "tensorflow_lite_support/metadata/metadata_schema_generated.h" 8 | -#include "third_party/zlib/contrib/minizip/ioapi.h" 9 | -#include "third_party/zlib/contrib/minizip/unzip.h" 10 | +#include 11 | +#include 12 | 13 | namespace tflite { 14 | namespace metadata { 15 | diff -up chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc.system-minizip chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc 16 | --- chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc.system-minizip 2023-01-04 20:20:37.000000000 +0100 17 | +++ chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc 2023-01-08 15:48:08.655793097 +0100 18 | @@ -26,8 +26,8 @@ limitations under the License. 19 | #include "tensorflow_lite_support/cc/port/statusor.h" 20 | #include "tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h" 21 | #include "tensorflow_lite_support/metadata/metadata_schema_generated.h" 22 | -#include "third_party/zlib/contrib/minizip/ioapi.h" 23 | -#include "third_party/zlib/contrib/minizip/unzip.h" 24 | +#include 25 | +#include 26 | 27 | namespace tflite { 28 | namespace metadata { 29 | diff -up chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc.system-minizip chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc 30 | --- chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc.system-minizip 2023-01-08 15:48:08.655793097 +0100 31 | +++ chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc 2023-01-08 15:53:17.498329640 +0100 32 | @@ -19,7 +19,7 @@ limitations under the License. 33 | #include 34 | 35 | #include "absl/strings/string_view.h" // from @com_google_absl 36 | -#include "third_party/zlib/contrib/minizip/ioapi.h" 37 | +#include 38 | 39 | namespace tflite { 40 | namespace metadata { 41 | diff -up chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc.system-minizip chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc 42 | --- chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc.system-minizip 2023-01-04 20:20:37.000000000 +0100 43 | +++ chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc 2023-01-08 15:48:08.655793097 +0100 44 | @@ -19,7 +19,7 @@ limitations under the License. 45 | #include 46 | 47 | #include "absl/strings/string_view.h" // from @com_google_absl 48 | -#include "third_party/zlib/contrib/minizip/ioapi.h" 49 | +#include 50 | 51 | namespace tflite { 52 | namespace metadata { 53 | diff -up chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h.system-minizip chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h 54 | --- chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h.system-minizip 2023-01-04 20:20:37.000000000 +0100 55 | +++ chromium-109.0.5414.74/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h 2023-01-08 15:48:08.655793097 +0100 56 | @@ -19,7 +19,7 @@ limitations under the License. 57 | #include 58 | 59 | #include "absl/strings/string_view.h" // from @com_google_absl 60 | -#include "third_party/zlib/contrib/minizip/ioapi.h" 61 | +#include 62 | 63 | namespace tflite { 64 | namespace metadata { 65 | -------------------------------------------------------------------------------- /chromium-aarch64-cxxflags-addition.patch: -------------------------------------------------------------------------------- 1 | diff -up chromium-91.0.4472.77/build/config/compiler/BUILD.gn.aarch-cxxflags chromium-91.0.4472.77/build/config/compiler/BUILD.gn 2 | --- chromium-91.0.4472.77/build/config/compiler/BUILD.gn.aarch-cxxflags 2021-06-02 12:58:21.998750145 -0400 3 | +++ chromium-91.0.4472.77/build/config/compiler/BUILD.gn 2021-06-02 12:59:29.762092189 -0400 4 | @@ -1511,6 +1511,10 @@ config("default_warnings") { 5 | cflags += [ "-Wno-psabi" ] 6 | } 7 | 8 | + if (current_cpu == "arm64" && !is_clang) { 9 | + cflags_cc += [ "-flax-vector-conversions" ] 10 | + } 11 | + 12 | if (!is_clang) { 13 | cflags_cc += [ 14 | # See comment for -Wno-c++11-narrowing. 15 | -------------------------------------------------------------------------------- /chromium-enable-widevine.patch: -------------------------------------------------------------------------------- 1 | --- a/third_party/widevine/cdm/BUILD.gn 2 | +++ b/third_party/widevine/cdm/BUILD.gn 3 | @@ -16,7 +16,7 @@ buildflag_header("buildflags") { 4 | 5 | flags = [ 6 | "ENABLE_WIDEVINE=$enable_widevine", 7 | - "BUNDLE_WIDEVINE_CDM=$bundle_widevine_cdm", 8 | + "BUNDLE_WIDEVINE_CDM=true", 9 | "ENABLE_WIDEVINE_CDM_COMPONENT=$enable_widevine_cdm_component", 10 | "ENABLE_MEDIA_FOUNDATION_WIDEVINE_CDM=$enable_media_foundation_widevine_cdm", 11 | ] 12 | -------------------------------------------------------------------------------- /chromium-fedora-user-agent.patch: -------------------------------------------------------------------------------- 1 | diff -up chromium-101.0.4951.41/content/common/user_agent.cc.fedora-user-agent chromium-101.0.4951.41/content/common/user_agent.cc 2 | --- chromium-101.0.4951.41/content/common/user_agent.cc.fedora-user-agent 2022-04-27 20:03:36.913767022 +0000 3 | +++ chromium-101.0.4951.41/content/common/user_agent.cc 2022-04-27 20:04:30.591942420 +0000 4 | @@ -34,7 +34,7 @@ std::string GetUserAgentPlatform() { 5 | #elif BUILDFLAG(IS_MAC) 6 | return "Macintosh; "; 7 | #elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) 8 | - return "X11; "; // strange, but that's what Firefox uses 9 | + return "X11; Fedora; "; // strange, but that's what Firefox uses 10 | #elif BUILDFLAG(IS_ANDROID) 11 | return "Linux; "; 12 | #elif BUILDFLAG(IS_FUCHSIA) 13 | -------------------------------------------------------------------------------- /chromium-fix-vaapi-on-intel.patch: -------------------------------------------------------------------------------- 1 | From 9ff06536caf7ea51aad9fd2bb649c858eaf7ee84 Mon Sep 17 00:00:00 2001 2 | From: Akarshan Biswas 3 | Date: Sat, 26 Oct 2019 10:06:30 +0530 4 | Subject: [PATCH] Move offending function to chromeos only 5 | 6 | --- a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc 7 | +++ b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc 8 | @@ -59,6 +59,7 @@ unsigned int GetVaFormatForVideoCodecPro 9 | return VA_RT_FORMAT_YUV420; 10 | } 11 | 12 | +#if defined(OS_ANDROID) || defined(OS_CHROMEOS) 13 | // Returns true if the CPU is an Intel Gemini Lake or later (including Kaby 14 | // Lake) Cpu platform id's are referenced from the following file in kernel 15 | // source arch/x86/include/asm/intel-family.h 16 | @@ -71,6 +72,7 @@ bool IsGeminiLakeOrLater() { 17 | cpuid.model() >= kGeminiLakeModelId; 18 | return is_geminilake_or_later; 19 | } 20 | +#endif 21 | 22 | } // namespace 23 | 24 | @@ -1231,6 +1233,8 @@ VaapiVideoDecodeAccelerator::DecideBuffe 25 | if (output_mode_ == VideoDecodeAccelerator::Config::OutputMode::IMPORT) 26 | return BufferAllocationMode::kNormal; 27 | 28 | +#if defined(OS_ANDROID) || defined(OS_CHROMEOS) 29 | + // Move this to chromeOs only as it is causing problem in some intel linux drivers 30 | // On Gemini Lake, Kaby Lake and later we can pass to libva the client's 31 | // PictureBuffers to decode onto, which skips the use of the Vpp unit and its 32 | // associated format reconciliation copy, avoiding all internal buffer 33 | @@ -1246,6 +1250,7 @@ VaapiVideoDecodeAccelerator::DecideBuffe 34 | num_extra_pics_ = 3; 35 | return BufferAllocationMode::kNone; 36 | } 37 | +#endif 38 | 39 | // For H.264 on older devices, another +1 is experimentally needed for 40 | // high-to-high resolution changes. 41 | -------------------------------------------------------------------------------- /chromium-freeworld.appdata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | chromium-freeworld.desktop 4 | chromium-freeworld-owner@rpmfusion.org 5 | CC0-1.0 6 | 7 | BSD-3-Clause and LGPL-2.1+ and Apache-2.0 and IJG and MIT and 8 | GPL-2.0+ and ISC and OpenSSL and (MPL-1.1 or GPL-2.0 or LGPL-2.0) 9 | 10 | Chromium (Freeworld) 11 | Chromium built with all freeworld codecs and VA-API support 12 | 13 |

14 | Chromium is an open-source browser project that aims to build a safer, 15 | faster, and more stable way to experience the web. 16 |

17 |

18 | We invite you to join our effort to build a powerful platform for 19 | developing a new generation of web applications. 20 |

21 |

22 | This package comes with all freeworld codecs and VA-API support enabled. 23 |

24 |
25 | 26 | 27 | https://user-images.githubusercontent.com/16843577/91254744-d4725100-e76b-11ea-8a0d-b1d22effab7e.png 28 | 29 | 30 | 31 | 32 | The Chromium Authors 33 | https://www.chromium.org/Home 34 | https://www.chromium.org/for-testers/bug-reporting-guidelines 35 |
36 | -------------------------------------------------------------------------------- /chromium-freeworld.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2011 The Chromium Authors. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | # This file is obtained from https://src.fedoraproject.org/rpms/chromium/ 8 | # and modified by Akarshan Biswas . All modifications are also 9 | # licensed under 3-clause BSD license. 10 | 11 | # Let the wrapped binary know that it has been run through the wrapper. 12 | export CHROME_WRAPPER="$(readlink -f "$0")" 13 | 14 | HERE="`dirname "$CHROME_WRAPPER"`" 15 | # We include some xdg utilities next to the binary, and we want to prefer them 16 | # over the system versions when we know the system versions are very old. We 17 | # detect whether the system xdg utilities are sufficiently new to be likely to 18 | # work for us by looking for xdg-settings. If we find it, we leave $PATH alone, 19 | # so that the system xdg utilities (including any distro patches) will be used. 20 | if ! which xdg-settings &> /dev/null; then 21 | # Old xdg utilities. Prepend $HERE to $PATH to use ours instead. 22 | export PATH="$HERE:$PATH" 23 | else 24 | # Use system xdg utilities. But first create mimeapps.list if it doesn't 25 | # exist; some systems have bugs in xdg-mime that make it fail without it. 26 | xdg_app_dir="${XDG_DATA_HOME:-$HOME/.local/share/applications}" 27 | mkdir -p "$xdg_app_dir" 28 | [ -f "$xdg_app_dir/mimeapps.list" ] || touch "$xdg_app_dir/mimeapps.list" 29 | fi 30 | 31 | # Always use our versions of ffmpeg libs. 32 | # This also makes RPMs find the compatibly-named library symlinks. 33 | if [[ -n "$LD_LIBRARY_PATH" ]]; then 34 | LD_LIBRARY_PATH="$HERE:$HERE/lib:$LD_LIBRARY_PATH" 35 | else 36 | LD_LIBRARY_PATH="$HERE:$HERE/lib" 37 | fi 38 | export LD_LIBRARY_PATH 39 | 40 | # We don't want bug-buddy intercepting our crashes. http://crbug.com/24120 41 | export GNOME_DISABLE_CRASH_DIALOG=SET_BY_GOOGLE_CHROME 42 | 43 | # Disable allow_rgb_configs to fix odd color and vaapi issues with Mesa 44 | export allow_rgb10_configs=false 45 | 46 | # Sanitize std{in,out,err} because they'll be shared with untrusted child 47 | # processes (http://crbug.com/376567). 48 | exec < /dev/null 49 | exec > >(exec cat) 50 | exec 2> >(exec cat >&2) 51 | 52 | CHROMIUM_DISTRO_FLAGS=" --enable-plugins \ 53 | --enable-extensions \ 54 | --enable-user-scripts \ 55 | --enable-printing \ 56 | --enable-gpu-rasterization \ 57 | --disable-features=AudioServiceSandbox \ 58 | --enable-sync" 59 | 60 | # This provides a much better experience on Wayland. 61 | if [ "$XDG_SESSION_TYPE" == "wayland" ] || [[ $WAYLAND_DISPLAY ]] ; then 62 | CHROMIUM_DISTRO_FLAGS="--ozone-platform=wayland $CHROMIUM_DISTRO_FLAGS" 63 | fi 64 | 65 | exec -a "$0" "@@CHROMIUMDIR@@/$(basename "$0" | sed 's/\.sh$//')" $CHROMIUM_DISTRO_FLAGS "$@" 66 | -------------------------------------------------------------------------------- /chromium-freeworld.spec: -------------------------------------------------------------------------------- 1 | %global debug_package %{nil} 2 | %global _default_patch_fuzz 2 3 | #Global Libraries 4 | %global menu_name Chromium (Freeworld) 5 | %global xdg_subdir chromium 6 | %ifarch aarch64 7 | %global _smp_build_ncpus 6 8 | %endif 9 | %undefine _auto_set_build_flags 10 | #This can be any folder on out 11 | %global target out/Release 12 | ### Google API keys (see http://www.chromium.org/developers/how-tos/api-keys) 13 | ### Note: These are for Fedora use ONLY. 14 | ### For your own distribution, please get your own set of keys. 15 | ### http://lists.debian.org/debian-legal/2013/11/msg00006.html 16 | %global api_key AIzaSyDUIXvzVrt5OkVsgXhQ6NFfvWlA44by-aw 17 | ###############################Exclude Private chromium libs########################### 18 | %global __requires_exclude %{chromiumdir}/.*\\.so 19 | %global __provides_exclude_from %{chromiumdir}/.*\\.so 20 | #######################################CONFIGS########################################### 21 | # System libraries to use. 22 | %global system_libdrm 1 23 | %if 0%{?fedora} == 36 24 | %global system_aom 0 25 | %else 26 | %global system_aom 1 27 | %endif 28 | # Chrome upstream uses custom ffmpeg patches 29 | %global system_ffmpeg 1 30 | %global system_flac 1 31 | %global system_fontconfig 1 32 | # fedora freetype is too old 33 | %global system_freetype 1 34 | %global system_harfbuzz 0 35 | %global system_libjpeg 1 36 | %global system_libicu 0 37 | # lto issue with system libpng 38 | %global system_libpng 1 39 | %global system_libvpx 0 40 | # The libxml_utils code depends on the specific bundled libxml checkout 41 | %global system_libxml2 0 42 | # lto issue with system minizip 43 | %global system_minizip 1 44 | %global system_re2 0 45 | %global system_libwebp 1 46 | %global system_xslt 1 47 | %global system_snappy 1 48 | 49 | ##############################Package Definitions###################################### 50 | Name: chromium-freeworld 51 | Version: 111.0.5563.110 52 | Release: 2%{?dist} 53 | Summary: Chromium built with all freeworld codecs and VA-API support 54 | License: BSD and LGPLv2+ and ASL 2.0 and IJG and MIT and GPLv2+ and ISC and OpenSSL and (MPLv1.1 or GPLv2 or LGPLv2) 55 | URL: https://www.chromium.org/Home 56 | Source0: https://commondatastorage.googleapis.com/chromium-browser-official/chromium-%{version}.tar.xz 57 | 58 | # Patchset composed by Stephan Hartmann. 59 | %global patchset_revision chromium-111-patchset-2 60 | Source1: https://github.com/stha09/chromium-patches/archive/%{patchset_revision}/chromium-patches-%{patchset_revision}.tar.gz 61 | 62 | # The following two source files are copied and modified from the chromium source 63 | Source10: %{name}.sh 64 | #Add our own appdata file. 65 | Source11: %{name}.appdata.xml 66 | Source12: chromium-symbolic.svg 67 | #Personal stuff 68 | Source15: LICENSE 69 | ######################## Installation Folder ################################################# 70 | #Our installation folder 71 | %global chromiumdir %{_libdir}/%{name} 72 | ######################################################################################## 73 | BuildRequires: clang, clang-tools-extra 74 | BuildRequires: lld 75 | BuildRequires: llvm 76 | # Basic tools and libraries needed for building 77 | BuildRequires: ninja-build, nodejs, bison, gperf, hwdata 78 | BuildRequires: libatomic, flex, perl-Switch, elfutils, git-core 79 | BuildRequires: libcap-devel, cups-devel, alsa-lib-devel 80 | BuildRequires: mesa-libGL-devel, mesa-libEGL-devel 81 | # Pipewire need this. 82 | BuildRequires: pkgconfig(libpipewire-0.3) 83 | BuildRequires: pkgconfig(gtk+-3.0) 84 | BuildRequires: pkgconfig(libexif), pkgconfig(nss) 85 | BuildRequires: pkgconfig(xtst), pkgconfig(xscrnsaver) 86 | BuildRequires: pkgconfig(dbus-1), pkgconfig(dbus-glib-1) 87 | BuildRequires: pkgconfig(libudev), pkgconfig(uuid) 88 | BuildRequires: pkgconfig(xt) 89 | BuildRequires: pkgconfig(xcb-proto) 90 | BuildRequires: pkgconfig(gnome-keyring-1) 91 | BuildRequires: pkgconfig(libdrm) 92 | BuildRequires: pkgconfig(libffi) 93 | BuildRequires: expat-devel 94 | BuildRequires: pciutils-devel 95 | BuildRequires: speech-dispatcher-devel 96 | BuildRequires: pulseaudio-libs-devel 97 | BuildRequires: libcurl-devel 98 | BuildRequires: libxshmfence-devel 99 | # install desktop files 100 | BuildRequires: desktop-file-utils 101 | # install AppData files 102 | BuildRequires: libappstream-glib 103 | # Libstdc++ static needed for linker 104 | BuildRequires: libstdc++-static 105 | #for vaapi 106 | BuildRequires: pkgconfig(libva) 107 | BuildRequires: pkgconfig(gbm) 108 | BuildRequires: pkgconfig(wayland-client) 109 | BuildRequires: pkgconfig(wayland-cursor) 110 | BuildRequires: pkgconfig(wayland-scanner) 111 | BuildRequires: pkgconfig(wayland-server) 112 | BuildRequires: pkgconfig(Qt5Core) 113 | BuildRequires: pkgconfig(Qt5Widgets) 114 | 115 | BuildRequires: python3-devel 116 | BuildRequires: python-unversioned-command 117 | BuildRequires: python3-beautifulsoup4 118 | BuildRequires: python3-html5lib 119 | BuildRequires: python3-json5 120 | BuildRequires: python3-mako 121 | BuildRequires: python3-markupsafe 122 | BuildRequires: python3-ply 123 | BuildRequires: python3-simplejson 124 | BuildRequires: python3-six 125 | BuildRequires: zlib-devel 126 | # replace_gn_files.py --system-libraries 127 | %if %{system_aom} 128 | BuildRequires: libaom-devel 129 | %endif 130 | %if %{system_flac} 131 | BuildRequires: flac-devel 132 | %endif 133 | %if %{system_freetype} 134 | BuildRequires: freetype-devel 135 | %endif 136 | %if %{system_harfbuzz} 137 | BuildRequires: harfbuzz-devel 138 | %endif 139 | %if %{system_libicu} 140 | BuildRequires: libicu-devel 141 | %endif 142 | %if %{system_libjpeg} 143 | BuildRequires: libjpeg-turbo-devel 144 | %endif 145 | %if %{system_libpng} 146 | BuildRequires: libpng-devel 147 | %endif 148 | %if %{system_libvpx} 149 | BuildRequires: libvpx-devel 150 | %endif 151 | %if %{system_ffmpeg} 152 | BuildRequires: ffmpeg-devel 153 | BuildRequires: opus-devel 154 | %endif 155 | %if %{system_libwebp} 156 | BuildRequires: libwebp-devel 157 | %endif 158 | %if %{system_minizip} 159 | BuildRequires: minizip-compat-devel 160 | %endif 161 | %if %{system_libxml2} 162 | BuildRequires: pkgconfig(libxml-2.0) 163 | %endif 164 | %if %{system_xslt} 165 | BuildRequires: pkgconfig(libxslt) 166 | %endif 167 | %if %{system_re2} 168 | BuildRequires: re2-devel 169 | %endif 170 | %if %{system_snappy} 171 | BuildRequires: snappy-devel 172 | %endif 173 | 174 | # Runtime Requirements 175 | Requires: hicolor-icon-theme 176 | # GTK modules it expects to find for some reason. 177 | Requires: libcanberra-gtk3%{_isa} 178 | # Chromium needs an explicit Requires: minizip-compat 179 | # We put it here to cover headless too. 180 | Requires: minizip-compat%{_isa} 181 | # Make sure chromium-freeworld replaces chromium-vaapi 182 | Provides: chromium-vaapi = %{version}-%{release} 183 | Obsoletes: chromium-vaapi < %{version}-%{release} 184 | #Some recommendations 185 | Recommends: libva-utils 186 | 187 | # This build should be only available to amd64 188 | ExclusiveArch: x86_64 %{arm64} 189 | 190 | # Gentoo patches: 191 | Patch201: chromium-108-EnumTable-crash.patch 192 | 193 | # Arch Linux patches: 194 | 195 | # Suse patches: 196 | 197 | # Fedora patches: 198 | Patch300: chromium-py3-bootstrap.patch 199 | Patch301: chromium-java-only-allowed-in-android-builds.patch 200 | Patch302: chromium-aarch64-cxxflags-addition.patch 201 | Patch303: chromium-update-rjsmin-to-1.2.0.patch 202 | Patch304: chromium-fedora-user-agent.patch 203 | Patch305: chromium-109-gcc13.patch 204 | Patch306: chromium-109-disable-GlobalMediaControlsCastStartStop.patch 205 | Patch1300: chromium-109-system-minizip-header-fix.patch 206 | Patch1301: chromium-no-zlib-mangle.patch 207 | Patch1302: chromium-unbundle-zlib.patch 208 | Patch1303: chromium-107-ffmpeg-duration.patch 209 | Patch1304: chromium-107-proprietary-codecs.patch 210 | Patch1305: chromium-108-ffmpeg-first_dts.patch 211 | Patch1306: chromium-108-ffmpeg-revert-new-channel-layout-api.patch 212 | Patch1307: chromium-108-system-opus.patch 213 | 214 | # RPM Fusion patches [free/chromium-freeworld]: 215 | Patch401: chromium-fix-vaapi-on-intel.patch 216 | Patch402: chromium-enable-widevine.patch 217 | Patch403: chromium-manpage.patch 218 | Patch404: chromium-md5-based-build-id.patch 219 | Patch405: chromium-names.patch 220 | Patch406: allow-to-override-clang-through-env-variables.patch 221 | Patch407: chromium-rpm-fusion-brand.patch 222 | Patch408: add_missing_include.patch 223 | Patch409: moc_name.patch 224 | 225 | %description 226 | %{name} is an open-source web browser, powered by WebKit (Blink) 227 | ############################################PREP########################################################### 228 | %prep 229 | %setup -q -T -n chromium-patches-%{patchset_revision} -b 1 230 | %setup -q -n chromium-%{version} 231 | 232 | %global patchset_root %{_builddir}/chromium-patches-%{patchset_revision} 233 | 234 | # Apply patchset composed by Stephan Hartmann. 235 | %global patchset_apply() \ 236 | printf "Applying %%s\\n" %{1} \ 237 | %{__scm_apply_patch -p1} <%{patchset_root}/%{1} 238 | 239 | %patchset_apply chromium-103-VirtualCursor-std-layout.patch 240 | 241 | # Apply patches up to #1000 from this spec. 242 | %autopatch -M1000 -p1 243 | 244 | # Manually apply patches that need an ifdef 245 | %if %{system_minizip} 246 | %patch -P1300 -p1 247 | %patch -P1301 -p1 248 | %patch -P1302 -p1 249 | %endif 250 | %if %{system_ffmpeg} 251 | %patch -P1303 -p1 252 | %patch -P1304 -p1 253 | %patch -P1305 -p1 254 | %patch -P1306 -p1 255 | %patch -P1307 -p1 256 | %endif 257 | 258 | ./build/linux/unbundle/replace_gn_files.py --system-libraries \ 259 | %if %{system_aom} 260 | libaom \ 261 | %endif 262 | %if %{system_ffmpeg} 263 | ffmpeg \ 264 | opus \ 265 | %endif 266 | %if %{system_harfbuzz} 267 | harfbuzz-ng \ 268 | %endif 269 | %if %{system_flac} 270 | flac \ 271 | %endif 272 | %if %{system_freetype} 273 | freetype \ 274 | %endif 275 | %if %{system_fontconfig} 276 | fontconfig \ 277 | %endif 278 | %if %{system_libicu} 279 | icu \ 280 | %endif 281 | %if %{system_libdrm} 282 | libdrm \ 283 | %endif 284 | %if %{system_libjpeg} 285 | libjpeg \ 286 | %endif 287 | %if %{system_libpng} 288 | libpng \ 289 | %endif 290 | %if %{system_libvpx} 291 | libvpx \ 292 | %endif 293 | %if %{system_libwebp} 294 | libwebp \ 295 | %endif 296 | %if %{system_libxml2} 297 | libxml \ 298 | %endif 299 | %if %{system_xslt} 300 | libxslt \ 301 | %endif 302 | %if %{system_re2} 303 | re2 \ 304 | %endif 305 | %if %{system_snappy} 306 | snappy \ 307 | %endif 308 | %if %{system_minizip} 309 | zlib 310 | %endif 311 | 312 | # Too much debuginfo 313 | sed -i 's|-g2|-g0|g' build/config/compiler/BUILD.gn 314 | 315 | sed -i 's|//third_party/usb_ids|/usr/share/hwdata|g' \ 316 | services/device/public/cpp/usb/BUILD.gn 317 | 318 | sed -i \ 319 | -e 's/"-no-canonical-prefixes"//g' \ 320 | build/config/compiler/BUILD.gn 321 | 322 | sed -i \ 323 | 's|OFFICIAL_BUILD|GOOGLE_CHROME_BUILD|g' \ 324 | tools/generate_shim_headers/generate_shim_headers.py 325 | 326 | mkdir -p third_party/node/linux/node-linux-x64/bin 327 | ln -s %{_bindir}/node third_party/node/linux/node-linux-x64/bin/node 328 | 329 | mkdir -p buildtools/third_party/eu-strip/bin 330 | ln -sf %{_bindir}/eu-strip buildtools/third_party/eu-strip/bin/eu-strip 331 | 332 | rm -f -- third_party/depot_tools/ninja 333 | ln -s %{_bindir}/ninja third_party/depot_tools/ninja 334 | 335 | %build 336 | # Final link uses lots of file descriptors. 337 | ulimit -n 2048 338 | 339 | #export compilar variables 340 | export CC="clang" 341 | export CXX="clang++" 342 | export AR="llvm-ar" 343 | export NM="llvm-nm" 344 | export READELF="llvm-readelf" 345 | 346 | export RANLIB="ranlib" 347 | export PATH="$PWD/third_party/depot_tools:$PATH" 348 | export CHROMIUM_RPATH="%{_libdir}/%{name}" 349 | 350 | FLAGS=' -Wno-unknown-warning-option -Wno-deprecated-declarations' 351 | export CFLAGS="$FLAGS" 352 | export CXXFLAGS="$FLAGS" 353 | 354 | CHROMIUM_GN_DEFINES="" 355 | 356 | CHROMIUM_GN_DEFINES+=' rpm_fusion_package_name="%{name}"' 357 | CHROMIUM_GN_DEFINES+=' rpm_fusion_menu_name="%{menu_name}"' 358 | CHROMIUM_GN_DEFINES+=' custom_toolchain="//build/toolchain/linux/unbundle:default"' 359 | CHROMIUM_GN_DEFINES+=' host_toolchain="//build/toolchain/linux/unbundle:default"' 360 | CHROMIUM_GN_DEFINES+=' target_os="linux"' 361 | CHROMIUM_GN_DEFINES+=' current_os="linux"' 362 | CHROMIUM_GN_DEFINES+=' is_official_build=true' 363 | CHROMIUM_GN_DEFINES+=' disable_fieldtrial_testing_config=true' 364 | CHROMIUM_GN_DEFINES+=' use_custom_libcxx=false' 365 | CHROMIUM_GN_DEFINES+=' use_sysroot=false' 366 | CHROMIUM_GN_DEFINES+=' use_gio=true' 367 | CHROMIUM_GN_DEFINES+=' use_libpci=true' 368 | CHROMIUM_GN_DEFINES+=' use_pulseaudio=true' 369 | CHROMIUM_GN_DEFINES+=' use_qt=true' 370 | CHROMIUM_GN_DEFINES+=' use_aura=true' 371 | CHROMIUM_GN_DEFINES+=' use_cups=true' 372 | CHROMIUM_GN_DEFINES+=' use_kerberos=true' 373 | CHROMIUM_GN_DEFINES+=' use_gold=false' 374 | CHROMIUM_GN_DEFINES+=' optimize_webui=false' 375 | %if %{system_freetype} 376 | CHROMIUM_GN_DEFINES+=' use_system_freetype=true' 377 | %endif 378 | %if %{system_harfbuzz} 379 | CHROMIUM_GN_DEFINES+=' use_system_harfbuzz=true' 380 | %endif 381 | CHROMIUM_GN_DEFINES+=' link_pulseaudio=true' 382 | CHROMIUM_GN_DEFINES+=' enable_hangout_services_extension=true' 383 | CHROMIUM_GN_DEFINES+=' treat_warnings_as_errors=false' 384 | CHROMIUM_GN_DEFINES+=' fatal_linker_warnings=false' 385 | CHROMIUM_GN_DEFINES+=' system_libdir="%{_lib}"' 386 | CHROMIUM_GN_DEFINES+=' use_icf=false' 387 | CHROMIUM_GN_DEFINES+=' enable_js_type_check=false' 388 | CHROMIUM_GN_DEFINES+=' use_system_libffi=true' 389 | 390 | # ffmpeg 391 | CHROMIUM_GN_DEFINES+=' ffmpeg_branding="Chrome"' 392 | CHROMIUM_GN_DEFINES+=' proprietary_codecs=true' 393 | CHROMIUM_GN_DEFINES+=' is_component_ffmpeg=true' 394 | CHROMIUM_GN_DEFINES+=' enable_ffmpeg_video_decoders=true' 395 | CHROMIUM_GN_DEFINES+=' media_use_ffmpeg=true' 396 | 397 | # Remove debug 398 | CHROMIUM_GN_DEFINES+=' is_debug=false' 399 | CHROMIUM_GN_DEFINES+=' symbol_level=0' 400 | CHROMIUM_GN_DEFINES+=' blink_symbol_level=0' 401 | CHROMIUM_GN_DEFINES+=' v8_symbol_level=0' 402 | CHROMIUM_GN_DEFINES+=' build_dawn_tests=false' 403 | CHROMIUM_GN_DEFINES+=' enable_perfetto_unittests=false' 404 | CHROMIUM_GN_DEFINES+=' enable_iterator_debugging=false' 405 | 406 | CHROMIUM_GN_DEFINES+=' enable_nacl=false' 407 | CHROMIUM_GN_DEFINES+=' enable_widevine=true' 408 | CHROMIUM_GN_DEFINES+=' rtc_use_pipewire=true' 409 | CHROMIUM_GN_DEFINES+=' rtc_link_pipewire=true' 410 | 411 | CHROMIUM_GN_DEFINES+=' clang_base_path="%{_prefix}"' 412 | CHROMIUM_GN_DEFINES+=' is_clang=true' 413 | CHROMIUM_GN_DEFINES+=' clang_use_chrome_plugins=false' 414 | CHROMIUM_GN_DEFINES+=' use_lld=true' 415 | %ifarch %{arm64} 416 | CHROMIUM_GN_DEFINES+=' target_cpu="arm64"' 417 | %endif 418 | CHROMIUM_GN_DEFINES+=' use_thin_lto=false' 419 | CHROMIUM_GN_DEFINES+=' use_vaapi=true' 420 | CHROMIUM_GN_DEFINES+=' is_cfi=false' 421 | CHROMIUM_GN_DEFINES+=' use_cfi_icall=false' 422 | CHROMIUM_GN_DEFINES+=' chrome_pgo_phase=0' 423 | 424 | %if %{system_libicu} 425 | CHROMIUM_GN_DEFINES+=' icu_use_data_file=false' 426 | %endif 427 | 428 | CHROMIUM_GN_DEFINES+=' enable_vr=false' 429 | CHROMIUM_GN_DEFINES+=' enable_vulkan=true' 430 | 431 | CHROMIUM_GN_DEFINES+=' google_api_key="%{api_key}"' 432 | 433 | 434 | export CHROMIUM_GN_DEFINES 435 | 436 | tools/gn/bootstrap/bootstrap.py --gn-gen-args="$CHROMIUM_GN_DEFINES" --build-path=%{target} 437 | %{target}/gn --script-executable=%{__python3} gen --args="$CHROMIUM_GN_DEFINES" %{target} 438 | %ninja_build -C %{target} chrome chrome_sandbox 439 | 440 | ######################################Install#################################### 441 | %install 442 | mkdir -p %{buildroot}%{_bindir} 443 | mkdir -p %{buildroot}%{chromiumdir}/locales 444 | mkdir -p %{buildroot}%{chromiumdir}/MEIPreload 445 | mkdir -p %{buildroot}%{_mandir}/man1 446 | mkdir -p %{buildroot}%{_metainfodir} 447 | mkdir -p %{buildroot}%{_datadir}/applications 448 | mkdir -p %{buildroot}%{_datadir}/gnome-control-center/default-apps 449 | mkdir -p %{buildroot}%{_datadir}/icons/hicolor/symbolic/apps 450 | sed -e "s|@@CHROMIUMDIR@@|%{chromiumdir}|" %{SOURCE10} > %{name}.sh 451 | install -m 755 %{name}.sh %{buildroot}%{_bindir}/%{name} 452 | install -m 644 %{SOURCE11} %{buildroot}%{_metainfodir} 453 | sed \ 454 | -e "s|@@MENUNAME@@|Chromium|g" \ 455 | -e "s|@@PACKAGE@@|%{name}|g" \ 456 | -e "s|@@SUMMARY@@|%{summary}|g" \ 457 | -e "s|@@XDG_SUBDIR@@|%{xdg_subdir}|g" \ 458 | chrome/app/resources/manpage.1.in >chrome.1 459 | install -m 644 chrome.1 %{buildroot}%{_mandir}/man1/%{name}.1 460 | sed \ 461 | -e "s|@@MENUNAME@@|%{menu_name}|g" \ 462 | -e "s|@@PACKAGE@@|%{name}|g" \ 463 | -e "s|%{_bindir}/@@USR_BIN_SYMLINK_NAME@@|%{name}|g" \ 464 | chrome/installer/linux/common/desktop.template >%{name}.desktop 465 | desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{name}.desktop 466 | sed \ 467 | -e "s|@@INSTALLDIR@@|%{_bindir}|g" \ 468 | -e "s|@@MENUNAME@@|%{menu_name}|g" \ 469 | -e "s|@@PACKAGE@@|%{name}|g" \ 470 | chrome/installer/linux/common/default-app.template >%{name}.xml 471 | install -m 644 %{name}.xml %{buildroot}%{_datadir}/gnome-control-center/default-apps/ 472 | install -m 755 %{target}/chrome %{buildroot}%{chromiumdir}/%{name} 473 | install -m 4755 %{target}/chrome_sandbox %{buildroot}%{chromiumdir}/chrome-sandbox 474 | install -m 755 %{target}/chrome_crashpad_handler %{buildroot}%{chromiumdir}/ 475 | install -m 755 %{target}/libEGL.so %{buildroot}%{chromiumdir}/ 476 | install -m 755 %{target}/libGLESv2.so %{buildroot}%{chromiumdir}/ 477 | install -m 755 %{target}/libqt5_shim.so %{buildroot}%{chromiumdir}/ 478 | %if !%{system_libicu} 479 | install -m 644 %{target}/icudtl.dat %{buildroot}%{chromiumdir}/ 480 | %endif 481 | install -m 644 %{target}/v8_context_snapshot.bin %{buildroot}%{chromiumdir}/ 482 | install -m 644 %{target}/*.pak %{buildroot}%{chromiumdir}/ 483 | install -m 644 %{target}/locales/*.pak %{buildroot}%{chromiumdir}/locales/ 484 | install -m 755 %{target}/xdg* %{buildroot}%{chromiumdir}/ 485 | install -m 644 %{target}/MEIPreload/* %{buildroot}%{chromiumdir}/MEIPreload/ 486 | install -m 755 %{target}/libvk_swiftshader.so %{buildroot}%{chromiumdir}/ 487 | install -m 755 %{target}/libvulkan.so.1 %{buildroot}%{chromiumdir}/ 488 | install -m 644 %{target}/vk_swiftshader_icd.json %{buildroot}%{chromiumdir}/ 489 | 490 | # Icons 491 | for i in 16 32; do 492 | mkdir -p %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps 493 | install -m 644 chrome/app/theme/default_100_percent/chromium/product_logo_$i.png \ 494 | %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/%{name}.png 495 | done 496 | for i in 24 32 48 64 128 256; do 497 | if [ ${i} = 32 ]; then ext=xpm; else ext=png; fi 498 | if [ ${i} = 32 ]; then dir=linux/; else dir=; fi 499 | mkdir -p %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps 500 | install -m 644 chrome/app/theme/chromium/${dir}product_logo_$i.${ext} \ 501 | %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/%{name}.${ext} 502 | done 503 | install -m 644 %{SOURCE12} \ 504 | %{buildroot}%{_datadir}/icons/hicolor/symbolic/apps/%{name}-symbolic.svg 505 | 506 | strip %{buildroot}%{chromiumdir}/%{name} 507 | strip %{buildroot}%{chromiumdir}/chrome-sandbox 508 | strip %{buildroot}%{chromiumdir}/chrome_crashpad_handler 509 | strip %{buildroot}%{chromiumdir}/libEGL.so 510 | strip %{buildroot}%{chromiumdir}/libGLESv2.so 511 | strip %{buildroot}%{chromiumdir}/libqt5_shim.so 512 | strip %{buildroot}%{chromiumdir}/libvk_swiftshader.so 513 | strip %{buildroot}%{chromiumdir}/libvulkan.so.1 514 | 515 | ####################################check################################################## 516 | %check 517 | appstream-util validate-relax --nonet "%{buildroot}%{_metainfodir}/%{name}.appdata.xml" 518 | ######################################files################################################ 519 | %files 520 | %license LICENSE 521 | %doc AUTHORS 522 | %{_bindir}/%{name} 523 | %{_metainfodir}/%{name}.appdata.xml 524 | %{_datadir}/applications/%{name}.desktop 525 | %{_datadir}/gnome-control-center/default-apps/%{name}.xml 526 | %{_datadir}/icons/hicolor/16x16/apps/%{name}.png 527 | %{_datadir}/icons/hicolor/24x24/apps/%{name}.png 528 | %{_datadir}/icons/hicolor/32x32/apps/%{name}.png 529 | %{_datadir}/icons/hicolor/32x32/apps/%{name}.xpm 530 | %{_datadir}/icons/hicolor/48x48/apps/%{name}.png 531 | %{_datadir}/icons/hicolor/64x64/apps/%{name}.png 532 | %{_datadir}/icons/hicolor/128x128/apps/%{name}.png 533 | %{_datadir}/icons/hicolor/256x256/apps/%{name}.png 534 | %{_datadir}/icons/hicolor/symbolic/apps/%{name}-symbolic.svg 535 | %{_mandir}/man1/%{name}.1.* 536 | %dir %{chromiumdir} 537 | %{chromiumdir}/%{name} 538 | %{chromiumdir}/chrome-sandbox 539 | %{chromiumdir}/chrome_crashpad_handler 540 | %{chromiumdir}/libEGL.so 541 | %{chromiumdir}/libGLESv2.so 542 | %{chromiumdir}/libqt5_shim.so 543 | %if !%{system_libicu} 544 | %{chromiumdir}/icudtl.dat 545 | %endif 546 | %{chromiumdir}/v8_context_snapshot.bin 547 | %{chromiumdir}/*.pak 548 | %{chromiumdir}/xdg-mime 549 | %{chromiumdir}/xdg-settings 550 | %dir %{chromiumdir}/MEIPreload 551 | %{chromiumdir}/MEIPreload/manifest.json 552 | %{chromiumdir}/MEIPreload/preloaded_data.pb 553 | %dir %{chromiumdir}/locales 554 | %{chromiumdir}/locales/*.pak 555 | %{chromiumdir}/libvk_swiftshader.so 556 | %{chromiumdir}/libvulkan.so.1 557 | %{chromiumdir}/vk_swiftshader_icd.json 558 | #########################################changelogs################################################# 559 | %changelog 560 | * Thu Mar 23 2023 Leigh Scott - 111.0.5563.110-2 561 | - Build with system libs 562 | 563 | * Tue Mar 21 2023 Leigh Scott - 111.0.5563.110-1 564 | - Update to 111.0.5563.110 565 | 566 | * Wed Mar 08 2023 Leigh Scott - 111.0.5563.64-1 567 | - Update to 111.0.5563.64 568 | 569 | * Wed Feb 22 2023 Leigh Scott - 110.0.5481.177-1 570 | - Update to 110.0.5481.177 571 | 572 | * Thu Feb 16 2023 Leigh Scott - 110.0.5481.100-1 573 | - Update to 110.0.5481.100 574 | 575 | * Wed Feb 08 2023 Leigh Scott - 110.0.5481.77-1 576 | - Update to 110.0.5481.77 577 | 578 | * Wed Jan 25 2023 Leigh Scott - 109.0.5414.119-1 579 | - Update to 109.0.5414.119 580 | 581 | * Wed Jan 11 2023 Leigh Scott - 109.0.5414.74-1 582 | - Update to 109.0.5414.74 583 | 584 | * Wed Dec 14 2022 Leigh Scott - 108.0.5359.124-1 585 | - Update to 108.0.5359.124 586 | 587 | * Thu Dec 08 2022 Leigh Scott - 108.0.5359.98-1 588 | - Update to 108.0.5359.98 589 | 590 | * Sat Dec 03 2022 Leigh Scott - 108.0.5359.94-1 591 | - Update to 108.0.5359.94 592 | 593 | * Wed Nov 30 2022 Leigh Scott - 108.0.5359.71-1 594 | - Update to 108.0.5359.71 595 | 596 | * Thu Nov 24 2022 Leigh Scott - 107.0.5304.121-1 597 | - Update to 107.0.5304.121 598 | 599 | * Tue Nov 08 2022 Leigh Scott - 107.0.5304.110-1 600 | - Update to 107.0.5304.110 601 | 602 | * Fri Oct 28 2022 Leigh Scott - 107.0.5304.87-1 603 | - Update to 107.0.5304.87 604 | 605 | * Tue Oct 25 2022 Leigh Scott - 107.0.5304.68-1 606 | - Update to 107.0.5304.68 607 | - Disable v4l2 for aarch64 due to missing header file linux/media/av1-ctrls.h 608 | 609 | * Wed Oct 12 2022 Leigh Scott - 106.0.5249.119-1 610 | - Update to 106.0.5249.119 611 | 612 | * Fri Oct 07 2022 Leigh Scott - 106.0.5249.103-1 613 | - Update to 106.0.5249.103 614 | 615 | * Sat Oct 01 2022 Leigh Scott - 106.0.5249.91-1 616 | - Update to 106.0.5249.91 617 | 618 | * Fri Sep 30 2022 Leigh Scott - 106.0.5249.61-2 619 | - deleted previous build by mistake trying to fix the signing issue 620 | 621 | * Wed Sep 28 2022 Leigh Scott - 106.0.5249.61-1 622 | - Update to 106.0.5249.61 623 | 624 | * Tue Sep 13 2022 Leigh Scott - 105.0.5195.125-1 625 | - Update to 105.0.5195.125 626 | 627 | * Sat Sep 03 2022 Leigh Scott - 105.0.5195.102-1 628 | - Update to 105.0.5195.102 629 | 630 | * Thu Sep 01 2022 Leigh Scott - 105.0.5195.52-2 631 | - Enable v4l2 and disable vaapi for aarch64 632 | 633 | * Tue Aug 30 2022 Leigh Scott - 105.0.5195.52-1 634 | - Update to 105.0.5195.52 635 | 636 | -------------------------------------------------------------------------------- /chromium-java-only-allowed-in-android-builds.patch: -------------------------------------------------------------------------------- 1 | diff -up chromium-91.0.4472.77/third_party/closure_compiler/compiler.py.java-allowed chromium-91.0.4472.77/third_party/closure_compiler/compiler.py 2 | --- chromium-91.0.4472.77/third_party/closure_compiler/compiler.py.java-allowed 2021-06-02 17:14:48.445064647 +0000 3 | +++ chromium-91.0.4472.77/third_party/closure_compiler/compiler.py 2021-06-02 17:15:12.994836949 +0000 4 | @@ -13,8 +13,7 @@ import subprocess 5 | 6 | 7 | _CURRENT_DIR = os.path.join(os.path.dirname(__file__)) 8 | -_JAVA_PATH = os.path.join(_CURRENT_DIR, "..", "jdk", "current", "bin", "java") 9 | -assert os.path.isfile(_JAVA_PATH), "java only allowed in android builds" 10 | +_JAVA_PATH = "java" 11 | 12 | class Compiler(object): 13 | """Runs the Closure compiler on given source files to typecheck them 14 | -------------------------------------------------------------------------------- /chromium-manpage.patch: -------------------------------------------------------------------------------- 1 | --- a/chrome/app/resources/manpage.1.in 2 | +++ b/chrome/app/resources/manpage.1.in 3 | @@ -3,7 +3,7 @@ 4 | .TH @@PACKAGE@@ 1 "" "" "USER COMMANDS" 5 | 6 | .SH NAME 7 | -@@PACKAGE@@ \- the web browser from Google 8 | +@@PACKAGE@@ \- @@SUMMARY@@ 9 | 10 | .SH SYNOPSIS 11 | .B @@PACKAGE@@ 12 | @@ -24,7 +24,7 @@ stable flags. 13 | \fB\-\-user\-data\-dir\fR=\fIDIR\fR 14 | Specifies the directory that user data (your "profile") is kept in. 15 | Defaults to 16 | -.I $HOME/.config/@@PACKAGE@@ . 17 | +.I $HOME/.config/@@XDG_SUBDIR@@ . 18 | Separate instances of @@MENUNAME@@ must use separate user data directories; 19 | repeated invocations of @@PACKAGE@@ will reuse an existing process for 20 | a given user data directory. 21 | @@ -150,11 +150,11 @@ Comma separated list of hosts or pattern 22 | 23 | .SH FILES 24 | .TP 25 | -.I $HOME/.config/@@PACKAGE@@ 26 | +.I $HOME/.config/@@XDG_SUBDIR@@ 27 | Default directory for configuration data. 28 | 29 | .TP 30 | -.I $HOME/.cache/@@PACKAGE@@ 31 | +.I $HOME/.cache/@@XDG_SUBDIR@@ 32 | Default directory for cache data. (Why? See 33 | .) 34 | 35 | -------------------------------------------------------------------------------- /chromium-md5-based-build-id.patch: -------------------------------------------------------------------------------- 1 | Resolve conflicts with Fedora Chromium by using MD5-based BuildID. 2 | https://bugzilla.rpmfusion.org/show_bug.cgi?id=5743 3 | 4 | --- a/build/config/compiler/BUILD.gn 5 | +++ b/build/config/compiler/BUILD.gn 6 | @@ -406,7 +406,7 @@ config("compiler") { 7 | # links. 8 | ldflags += [ "-Wl,--build-id=sha1" ] 9 | } else if (current_os != "aix" && current_os != "zos") { 10 | - ldflags += [ "-Wl,--build-id" ] 11 | + ldflags += [ "-Wl,--build-id=md5" ] 12 | } 13 | 14 | if (!is_android) { 15 | -------------------------------------------------------------------------------- /chromium-names.patch: -------------------------------------------------------------------------------- 1 | Replace hard-coded "chromium-browser" with package name. 2 | 3 | * Fixes Icon key in chrome-apps.directory. 4 | https://bugzilla.rpmfusion.org/show_bug.cgi?id=5895 5 | 6 | * Fixes PulseAudio application name and icon 7 | as seen from pavucontrol. 8 | 9 | * Prevents showing "Chromium isn't your default browser", 10 | when the browser is launched directly without the wrapper. 11 | 12 | --- a/chrome/browser/BUILD.gn 13 | +++ b/chrome/browser/BUILD.gn 14 | @@ -6449,6 +6449,7 @@ static_library("browser") { 15 | "first_run/upgrade_util_linux.cc", 16 | "first_run/upgrade_util_linux.h", 17 | ] 18 | + configs += [ "//third_party/rpm_fusion:defines" ] 19 | deps += [ "//chrome/app/theme:chrome_unscaled_resources_grit" ] 20 | 21 | if (use_dbus) { 22 | --- a/chrome/browser/shell_integration_linux.cc 23 | +++ b/chrome/browser/shell_integration_linux.cc 24 | @@ -466,7 +466,7 @@ std::string GetIconName() { 25 | #if BUILDFLAG(GOOGLE_CHROME_BRANDING) 26 | return "google-chrome"; 27 | #else // BUILDFLAG(CHROMIUM_BRANDING) 28 | - return "chromium-browser"; 29 | + return RPM_FUSION_PACKAGE_NAME; 30 | #endif 31 | } 32 | 33 | --- a/chrome/common/BUILD.gn 34 | +++ b/chrome/common/BUILD.gn 35 | @@ -86,6 +86,7 @@ source_set("channel_info") { 36 | sources += [ "channel_info_lacros.cc" ] 37 | } else if (is_posix) { 38 | sources += [ "channel_info_posix.cc" ] 39 | + configs += [ "//third_party/rpm_fusion:defines" ] 40 | } else if (is_fuchsia) { 41 | sources += [ "channel_info_fuchsia.cc" ] 42 | } 43 | --- a/chrome/common/channel_info_posix.cc 44 | +++ b/chrome/common/channel_info_posix.cc 45 | @@ -120,7 +120,7 @@ std::string GetDesktopName(base::Environ 46 | std::string name; 47 | if (env->GetVar("CHROME_DESKTOP", &name) && !name.empty()) 48 | return name; 49 | - return "chromium-browser.desktop"; 50 | + return RPM_FUSION_PACKAGE_NAME ".desktop"; 51 | #endif 52 | } 53 | #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) 54 | --- a/media/audio/BUILD.gn 55 | +++ b/media/audio/BUILD.gn 56 | @@ -308,6 +308,8 @@ source_set("audio") { 57 | "pulse/pulse_util.h", 58 | ] 59 | 60 | + configs += [ "//third_party/rpm_fusion:defines" ] 61 | + 62 | deps += [ "//build:branding_buildflags" ] 63 | 64 | if (link_pulseaudio) { 65 | --- a/media/audio/pulse/pulse_util.cc 66 | +++ b/media/audio/pulse/pulse_util.cc 67 | @@ -38,8 +38,8 @@ namespace { 68 | constexpr char kBrowserDisplayName[] = "google-chrome"; 69 | #define PRODUCT_STRING "Google Chrome" 70 | #else 71 | -constexpr char kBrowserDisplayName[] = "chromium-browser"; 72 | -#define PRODUCT_STRING "Chromium" 73 | +constexpr char kBrowserDisplayName[] = RPM_FUSION_PACKAGE_NAME; 74 | +#define PRODUCT_STRING RPM_FUSION_MENU_NAME 75 | #endif 76 | 77 | #if defined(DLOPEN_PULSEAUDIO) 78 | --- /dev/null 79 | +++ b/third_party/rpm_fusion/BUILD.gn 80 | @@ -0,0 +1,11 @@ 81 | +declare_args() { 82 | + rpm_fusion_package_name = "chromium-browser" 83 | + rpm_fusion_menu_name = "Chromium" 84 | +} 85 | + 86 | +config("defines") { 87 | + defines = [ 88 | + "RPM_FUSION_PACKAGE_NAME=\"$rpm_fusion_package_name\"", 89 | + "RPM_FUSION_MENU_NAME=\"$rpm_fusion_menu_name\"", 90 | + ] 91 | +} 92 | -------------------------------------------------------------------------------- /chromium-no-zlib-mangle.patch: -------------------------------------------------------------------------------- 1 | diff -up chromium-77.0.3865.75/third_party/zlib/zconf.h.nozmangle chromium-77.0.3865.75/third_party/zlib/zconf.h 2 | --- chromium-77.0.3865.75/third_party/zlib/zconf.h.nozmangle 2019-09-12 09:36:37.924086850 +0200 3 | +++ chromium-77.0.3865.75/third_party/zlib/zconf.h 2019-09-12 09:53:01.623958551 +0200 4 | @@ -9,18 +9,6 @@ 5 | #define ZCONF_H 6 | 7 | /* 8 | - * This library is also built as a part of AOSP, which does not need to include 9 | - * chromeconf.h. This config does not want chromeconf.h, so it can set this 10 | - * macro to opt out. While this works today, there's no guarantee that building 11 | - * zlib outside of Chromium keeps working in the future. 12 | - */ 13 | -#if !defined(CHROMIUM_ZLIB_NO_CHROMECONF) 14 | -/* This include does prefixing as below, but with an updated set of names. Also 15 | - * sets up export macros in component builds. */ 16 | -#include "chromeconf.h" 17 | -#endif 18 | - 19 | -/* 20 | * If you *really* need a unique prefix for all types and library functions, 21 | * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. 22 | * Even better than compiling with -DZ_PREFIX would be to use configure to set 23 | -------------------------------------------------------------------------------- /chromium-py3-bootstrap.patch: -------------------------------------------------------------------------------- 1 | --- a/tools/gn/bootstrap/bootstrap.py 2 | +++ b/tools/gn/bootstrap/bootstrap.py 3 | @@ -130,7 +130,7 @@ def main(argv): 4 | if not options.debug: 5 | gn_gen_args += ' is_debug=false' 6 | subprocess.check_call([ 7 | - gn_path, 'gen', out_dir, 8 | + gn_path, 'gen', out_dir, ' --script-executable=/usr/bin/python3', 9 | '--args=%s' % gn_gen_args, "--root=" + SRC_ROOT 10 | ]) 11 | 12 | -------------------------------------------------------------------------------- /chromium-rpm-fusion-brand.patch: -------------------------------------------------------------------------------- 1 | From bfff7b95bb4d9ff20a3a67191dfffe25334f9dca Mon Sep 17 00:00:00 2001 2 | From: Akarshan Biswas 3 | Date: Wed, 7 Nov 2018 16:29:01 +0530 4 | Subject: [PATCH] Let's brand chromium-vaapi 5 | 6 | --- a/components/version_ui_strings.grdp 7 | +++ b/components/version_ui_strings.grdp 8 | @@ -7,7 +7,7 @@ 9 | Official Build 10 | 11 | 12 | - Developer Build 13 | + RPM Fusion Build 14 | 15 | 16 | (32-bit) 17 | -------------------------------------------------------------------------------- /chromium-symbolic.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /chromium-unbundle-zlib.patch: -------------------------------------------------------------------------------- 1 | diff -up chromium-81.0.4044.92/third_party/perfetto/gn/BUILD.gn.unbundle-zlib chromium-81.0.4044.92/third_party/perfetto/gn/BUILD.gn 2 | --- chromium-81.0.4044.92/third_party/perfetto/gn/BUILD.gn.unbundle-zlib 2020-04-13 12:25:09.001172601 -0400 3 | +++ chromium-81.0.4044.92/third_party/perfetto/gn/BUILD.gn 2020-04-13 12:25:23.688921586 -0400 4 | @@ -294,7 +294,7 @@ if (enable_perfetto_zlib) { 5 | public_configs = [ "//buildtools:zlib_config" ] 6 | public_deps = [ "//buildtools:zlib" ] 7 | } else { 8 | - public_configs = [ "//third_party/zlib:zlib_config" ] 9 | + public_configs = [ "//third_party/zlib:system_zlib" ] 10 | public_deps = [ "//third_party/zlib" ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /chromium-update-rjsmin-to-1.2.0.patch: -------------------------------------------------------------------------------- 1 | diff -up chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/rjsmin.c.12 chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/rjsmin.c 2 | --- chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/rjsmin.c.12 2022-06-28 12:50:10.167324583 +0000 3 | +++ chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/rjsmin.c 2021-11-14 19:50:55.000000000 +0000 4 | @@ -1,5 +1,5 @@ 5 | /* 6 | - * Copyright 2011 - 2015 7 | + * Copyright 2011 - 2021 8 | * Andr\xe9 Malo or his licensors, as applicable 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | @@ -18,21 +18,21 @@ 12 | #include "cext.h" 13 | EXT_INIT_FUNC; 14 | 15 | -#define RJSMIN_DULL_BIT (1 << 0) 16 | -#define RJSMIN_PRE_REGEX_BIT (1 << 1) 17 | -#define RJSMIN_REGEX_DULL_BIT (1 << 2) 18 | -#define RJSMIN_REGEX_CC_DULL_BIT (1 << 3) 19 | -#define RJSMIN_ID_LIT_BIT (1 << 4) 20 | -#define RJSMIN_ID_LIT_O_BIT (1 << 5) 21 | -#define RJSMIN_ID_LIT_C_BIT (1 << 6) 22 | -#define RJSMIN_STRING_DULL_BIT (1 << 7) 23 | -#define RJSMIN_SPACE_BIT (1 << 8) 24 | -#define RJSMIN_POST_REGEX_OFF_BIT (1 << 9) 25 | +#define RJSMIN_DULL_BIT (1 << 0) 26 | +#define RJSMIN_PRE_REGEX_BIT (1 << 1) 27 | +#define RJSMIN_REGEX_DULL_BIT (1 << 2) 28 | +#define RJSMIN_REGEX_CC_DULL_BIT (1 << 3) 29 | +#define RJSMIN_ID_LIT_BIT (1 << 4) 30 | +#define RJSMIN_ID_LIT_O_BIT (1 << 5) 31 | +#define RJSMIN_ID_LIT_C_BIT (1 << 6) 32 | +#define RJSMIN_STRING_DULL_BIT (1 << 7) 33 | +#define RJSMIN_SPACE_BIT (1 << 8) 34 | +#define RJSMIN_POST_REGEX_OFF_BIT (1 << 9) 35 | +#define RJSMIN_A_Z_BIT (1 << 10) 36 | 37 | -#ifdef EXT3 38 | -typedef Py_UNICODE rchar; 39 | -#else 40 | typedef unsigned char rchar; 41 | +#ifdef U 42 | +#undef U 43 | #endif 44 | #define U(c) ((rchar)(c)) 45 | 46 | @@ -66,66 +66,120 @@ typedef unsigned char rchar; 47 | #define RJSMIN_IS_PRE_REGEX_1(c) ((U(c) <= 127) && \ 48 | (rjsmin_charmask[U(c) & 0x7F] & RJSMIN_PRE_REGEX_BIT)) 49 | 50 | +#define RJSMIN_IS_A_Z(c) ((U(c) <= 127) && \ 51 | + (rjsmin_charmask[U(c) & 0x7F] & RJSMIN_A_Z_BIT)) 52 | + 53 | 54 | static const unsigned short rjsmin_charmask[128] = { 55 | - 396, 396, 396, 396, 396, 396, 396, 396, 56 | - 396, 396, 2, 396, 396, 2, 396, 396, 57 | - 396, 396, 396, 396, 396, 396, 396, 396, 58 | - 396, 396, 396, 396, 396, 396, 396, 396, 59 | - 396, 687, 588, 653, 765, 653, 143, 588, 60 | - 687, 205, 653, 237, 143, 237, 141, 648, 61 | - 765, 765, 765, 765, 765, 765, 765, 765, 62 | - 765, 765, 143, 143, 653, 143, 653, 143, 63 | - 653, 765, 765, 765, 765, 765, 765, 765, 64 | - 765, 765, 765, 765, 765, 765, 765, 765, 65 | - 765, 765, 765, 765, 765, 765, 765, 765, 66 | - 765, 765, 765, 683, 513, 197, 653, 765, 67 | - 653, 765, 765, 765, 765, 765, 765, 765, 68 | - 765, 765, 765, 765, 765, 765, 765, 765, 69 | - 765, 765, 765, 765, 765, 765, 765, 765, 70 | - 765, 765, 765, 687, 143, 207, 653, 765 71 | + 396, 396, 396, 396, 396, 396, 396, 396, 72 | + 396, 396, 2, 396, 396, 2, 396, 396, 73 | + 396, 396, 396, 396, 396, 396, 396, 396, 74 | + 396, 396, 396, 396, 396, 396, 396, 396, 75 | + 396, 687, 588, 653, 765, 653, 143, 588, 76 | + 687, 205, 655, 239, 143, 239, 141, 648, 77 | + 765, 765, 765, 765, 765, 765, 765, 765, 78 | + 765, 765, 143, 143, 653, 143, 653, 143, 79 | + 653, 765, 765, 765, 765, 765, 765, 765, 80 | + 765, 765, 765, 765, 765, 765, 765, 765, 81 | + 765, 765, 765, 765, 765, 765, 765, 765, 82 | + 765, 765, 765, 683, 513, 197, 653, 765, 83 | + 588, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 84 | + 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 85 | + 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, 86 | + 1789, 1789, 1789, 687, 143, 207, 653, 765 87 | }; 88 | 89 | + 90 | static Py_ssize_t 91 | rjsmin(const rchar *source, rchar *target, Py_ssize_t length, 92 | int keep_bang_comments) 93 | { 94 | - const rchar *reset, *pcreset = NULL, *pctoken = NULL, *xtarget, 95 | - *sentinel = source + length; 96 | - rchar *tstart = target; 97 | - int post_regex = 0; 98 | - rchar c, quote, spaced = U(' '); 99 | + const rchar 100 | + *sentinel = source + length, /* never hit this pointer (source buf) */ 101 | + *reset, /* reset pointer (source buf) */ 102 | + *pcreset = NULL, /* pre-comment reset pointer (source buf) */ 103 | + *pctoken = NULL, /* pre-comment token pointer (target buf) 104 | + * Pointing to before the last kept comment, if any */ 105 | + *rsreset = NULL, /* regex-with-method reset pointer (source buf) */ 106 | + *xtarget; /* pre-regex-2 target pointer */ 107 | + 108 | + rchar *tstart = target, /* Target start pointer for reference */ 109 | + *rtreset = NULL; /* regex-with-method reset pointer (target buf) */ 110 | + 111 | + int rsdot, /* seen dot after regex-with-method pattern? */ 112 | + post_regex = 0; 113 | + rchar c, quote, 114 | + spaced = U(' '); /* the last seen kind of space (nl taking prio), 115 | + * init with ' ' */ 116 | 117 | + /* main loop */ 118 | while (source < sentinel) { 119 | c = *source++; 120 | + 121 | if (RJSMIN_IS_DULL(c)) { 122 | if (post_regex) post_regex = 0; 123 | if (pctoken) pctoken = NULL; 124 | if (spaced == U('\n')) spaced = U(' '); 125 | + if (rsreset) { 126 | + /* both a-z and . are covered by "dull" */ 127 | + if (!rsdot) { 128 | + if (c != U('.')) { 129 | + /* reset regex-with-method to the starting slash */ 130 | + source = rsreset; 131 | + target = rtreset; 132 | + rsreset = NULL; 133 | + continue; /* main loop */ 134 | + } 135 | + /* Found a dot after possible regex, looking for a-z now */ 136 | + rsdot = 1; 137 | + } 138 | + else if (!RJSMIN_IS_A_Z(c)) { 139 | + /* reset regex-with-method to the starting slash */ 140 | + source = rsreset; 141 | + target = rtreset; 142 | + rsreset = NULL; 143 | + continue; /* main loop */ 144 | + } 145 | + else { 146 | + /* Successfull finish the regex-with-method match */ 147 | + rsreset = NULL; 148 | + } 149 | + } 150 | 151 | *target++ = c; 152 | - continue; 153 | + continue; /* main loop */ 154 | } 155 | + 156 | switch (c) { 157 | 158 | /* String */ 159 | - case U('\''): case U('"'): 160 | + case U('\''): case U('"'): case U('`'): 161 | if (post_regex) post_regex = 0; 162 | if (pctoken) pctoken = NULL; 163 | if (spaced == U('\n')) spaced = U(' '); 164 | + if (rsreset) { 165 | + /* reset regex-with-method to the starting slash */ 166 | + source = rsreset; 167 | + target = rtreset; 168 | + rsreset = NULL; 169 | + continue; /* main loop */ 170 | + } 171 | 172 | reset = source; 173 | *target++ = quote = c; 174 | + 175 | + /* string loop */ 176 | while (source < sentinel) { 177 | c = *source++; 178 | *target++ = c; 179 | if (RJSMIN_IS_STRING_DULL(c)) 180 | - continue; 181 | + continue; /* string loop */ 182 | + 183 | switch (c) { 184 | - case U('\''): case U('"'): 185 | + case U('\''): case U('"'): case U('`'): 186 | if (c == quote) 187 | - goto cont; 188 | - continue; 189 | + goto cont; /* main loop */ 190 | + continue; /* string loop */ 191 | case U('\\'): 192 | if (source < sentinel) { 193 | c = *source++; 194 | @@ -134,13 +188,18 @@ rjsmin(const rchar *source, rchar *targe 195 | && *source == U('\n')) 196 | *target++ = *source++; 197 | } 198 | - continue; 199 | + continue; /* string loop */ 200 | + case U('\r'): case U('\n'): 201 | + if (quote != U('`')) 202 | + break; /* string reset */ 203 | + continue; /* string loop */ 204 | } 205 | - break; 206 | + break; /* string reset */ 207 | } 208 | + /* string reset */ 209 | target -= source - reset; 210 | source = reset; 211 | - continue; 212 | + continue; /* main loop */ 213 | 214 | /* Comment or Regex or something else entirely */ 215 | case U('/'): 216 | @@ -148,6 +207,13 @@ rjsmin(const rchar *source, rchar *targe 217 | if (post_regex) post_regex = 0; 218 | if (pctoken) pctoken = NULL; 219 | if (spaced == U('\n')) spaced = U(' '); 220 | + if (rsreset) { 221 | + /* reset regex-with-method to the starting slash */ 222 | + source = rsreset; 223 | + target = rtreset; 224 | + rsreset = NULL; 225 | + continue; /* main loop */ 226 | + } 227 | 228 | *target++ = c; 229 | } 230 | @@ -157,7 +223,19 @@ rjsmin(const rchar *source, rchar *targe 231 | case U('*'): case U('/'): 232 | goto skip_or_copy_ws; 233 | 234 | + /* Regex or slash */ 235 | default: 236 | + if (rsreset) { 237 | + /* reset regex-with-method to the starting slash */ 238 | + if (post_regex) post_regex = 0; 239 | + if (pctoken) pctoken = NULL; 240 | + if (spaced == U('\n')) spaced = U(' '); 241 | + source = rsreset; 242 | + target = rtreset; 243 | + rsreset = NULL; 244 | + continue; /* main loop */ 245 | + } 246 | + 247 | xtarget = NULL; 248 | if ( target == tstart 249 | || RJSMIN_IS_PRE_REGEX_1(*((pctoken ? pctoken : target) 250 | @@ -176,99 +254,148 @@ rjsmin(const rchar *source, rchar *targe 251 | || !RJSMIN_IS_ID_LITERAL(*(xtarget - 7)) 252 | ) 253 | )) { 254 | - 255 | - /* Regex */ 256 | + /* nothing to do here, continuing down below 257 | + * We could unset rsreset here, but we know it already 258 | + * is. */ 259 | + ; 260 | + } 261 | + else if (*((pctoken ? pctoken : target) - 1) == U(')')) { 262 | + xtarget = NULL; 263 | + rsreset = source; 264 | + rtreset = target + 1; 265 | + rsdot = 0; 266 | + } 267 | + else { 268 | + /* Just a slash */ 269 | if (post_regex) post_regex = 0; 270 | if (pctoken) pctoken = NULL; 271 | + if (spaced == U('\n')) spaced = U(' '); 272 | 273 | - reset = source; 274 | - if (spaced == U('\n')) { 275 | - spaced = U(' '); 276 | - if (xtarget) 277 | - *target++ = U('\n'); 278 | - } 279 | + *target++ = c; 280 | + continue; /* main loop */ 281 | + } 282 | 283 | - *target++ = U('/'); 284 | - while (source < sentinel) { 285 | - c = *source++; 286 | - *target++ = c; 287 | - if (RJSMIN_IS_REGEX_DULL(c)) 288 | - continue; 289 | - switch (c) { 290 | - case U('/'): 291 | - post_regex = 1; 292 | - goto cont; 293 | - case U('\\'): 294 | - if (source < sentinel) { 295 | - c = *source++; 296 | - *target++ = c; 297 | - if (c == U('\r') || c == U('\n')) 298 | - break; 299 | - } 300 | - continue; 301 | - case U('['): 302 | - while (source < sentinel) { 303 | - c = *source++; 304 | - *target++ = c; 305 | - if (RJSMIN_IS_REGEX_CC_DULL(c)) 306 | - continue; 307 | - switch (c) { 308 | - case U('\\'): 309 | - if (source < sentinel) { 310 | - c = *source++; 311 | - *target++ = c; 312 | - if (c == U('\r') || c == U('\n')) 313 | - break; 314 | - } 315 | - continue; 316 | - case U(']'): 317 | - goto cont_regex; 318 | + if (post_regex) post_regex = 0; 319 | + if (pctoken) pctoken = NULL; 320 | + 321 | + reset = source; 322 | + if (spaced == U('\n')) { 323 | + spaced = U(' '); 324 | + if (xtarget) 325 | + *target++ = U('\n'); 326 | + } 327 | + 328 | + *target++ = U('/'); 329 | + 330 | + /* regex loop */ 331 | + while (source < sentinel) { 332 | + c = *source++; 333 | + *target++ = c; 334 | + 335 | + if (RJSMIN_IS_REGEX_DULL(c)) 336 | + continue; /* regex loop */ 337 | + 338 | + switch (c) { 339 | + case U('/'): 340 | + while (source < sentinel 341 | + && RJSMIN_IS_A_Z(*source)) 342 | + *target++ = *source++; 343 | + post_regex = !rsreset; 344 | + /* This check is supposed to make it faster. 345 | + * It doesn't. It slows it down. I wonder why... 346 | + */ 347 | + /* 348 | + * if (!post_regex 349 | + * && source < sentinel - 1 350 | + * && *source == U('.') 351 | + * && RJSMIN_IS_A_Z(*(source + 1))) 352 | + * rsreset = NULL; 353 | + */ 354 | + 355 | + goto cont; /* main loop */ 356 | + 357 | + case U('\\'): 358 | + if (source < sentinel) { 359 | + c = *source++; 360 | + *target++ = c; 361 | + if (c == U('\r') || c == U('\n')) 362 | + break; /* regex reset */ 363 | + } 364 | + continue; /* regex loop */ 365 | + 366 | + case U('['): 367 | + /* regex CC loop */ 368 | + while (source < sentinel) { 369 | + c = *source++; 370 | + *target++ = c; 371 | + 372 | + if (RJSMIN_IS_REGEX_CC_DULL(c)) 373 | + continue; /* regex CC loop */ 374 | + 375 | + switch (c) { 376 | + case U('\\'): 377 | + if (source < sentinel) { 378 | + c = *source++; 379 | + *target++ = c; 380 | + if (c == U('\r') || c == U('\n')) 381 | + break; /* regex reset */ 382 | } 383 | + continue; /* regex CC loop */ 384 | + 385 | + case U(']'): 386 | + goto cont_regex; /* regex loop */ 387 | } 388 | - break; 389 | } 390 | - break; 391 | - cont_regex: 392 | - continue; 393 | + break; /* regex reset */ 394 | + 395 | } 396 | - target -= source - reset; 397 | - source = reset; 398 | - } 399 | - else { 400 | - /* Just a slash */ 401 | - if (post_regex) post_regex = 0; 402 | - if (pctoken) pctoken = NULL; 403 | - if (spaced == U('\n')) spaced = U(' '); 404 | + break; /* regex reset */ 405 | 406 | - *target++ = c; 407 | + cont_regex: 408 | + continue; /* regex loop */ 409 | } 410 | - continue; 411 | + 412 | + /* regex reset */ 413 | + target -= source - reset; 414 | + source = reset; 415 | + rsreset = NULL; 416 | + continue; /* main loop */ 417 | } 418 | } 419 | - continue; 420 | + continue; /* main loop */ /* LCOV_EXCL_LINE */ 421 | 422 | /* Whitespace */ 423 | default: 424 | skip_or_copy_ws: 425 | + /* remember if we've seen a newline, start with: no */ 426 | quote = U(' '); 427 | --source; 428 | + 429 | + /* space loop */ 430 | while (source < sentinel) { 431 | c = *source++; 432 | if (RJSMIN_IS_SPACE(c)) 433 | - continue; 434 | + continue; /* space loop */ 435 | + 436 | switch (c) { 437 | case U('\r'): case U('\n'): 438 | quote = U('\n'); 439 | - continue; 440 | + continue; /* space loop */ 441 | + 442 | + /* Can only be a comment at this point 443 | + * (or ending prematurely) */ 444 | case U('/'): 445 | if (source < sentinel) { 446 | switch (*source) { 447 | + 448 | + /* multiline comment */ 449 | case U('*'): 450 | reset = source++; 451 | /* copy bang comment, if requested */ 452 | if ( keep_bang_comments && source < sentinel 453 | && *source == U('!')) { 454 | if (!pctoken) { 455 | + /* Backtracking if ending prematurely */ 456 | pctoken = target; 457 | pcreset = reset; 458 | } 459 | @@ -276,6 +403,8 @@ rjsmin(const rchar *source, rchar *targe 460 | *target++ = U('/'); 461 | *target++ = U('*'); 462 | *target++ = *source++; 463 | + 464 | + /* comment loop */ 465 | while (source < sentinel) { 466 | c = *source++; 467 | *target++ = c; 468 | @@ -283,20 +412,21 @@ rjsmin(const rchar *source, rchar *targe 469 | && *source == U('/')) { 470 | *target++ = *source++; 471 | reset = NULL; 472 | - break; 473 | + break; /* continue space loop */ 474 | } 475 | } 476 | if (!reset) 477 | - continue; 478 | + continue; /* space loop */ 479 | 480 | + /* comment reset */ 481 | target -= source - reset; 482 | source = reset; 483 | if (pcreset == reset) { 484 | pctoken = NULL; 485 | pcreset = NULL; 486 | } 487 | - 488 | } 489 | + 490 | /* strip regular comment */ 491 | else { 492 | while (source < sentinel) { 493 | @@ -305,41 +435,52 @@ rjsmin(const rchar *source, rchar *targe 494 | && *source == U('/')) { 495 | ++source; 496 | reset = NULL; 497 | - break; 498 | + break; /* continue space loop */ 499 | } 500 | } 501 | if (!reset) 502 | - continue; 503 | + continue; /* space loop */ 504 | + 505 | + /* comment reset: fallback to slash */ 506 | source = reset; 507 | *target++ = U('/'); 508 | } 509 | - goto cont; 510 | + goto cont; /* main loop */ 511 | + 512 | + /* single line comment */ 513 | case U('/'): 514 | ++source; 515 | + 516 | + /* single line comment loop */ 517 | while (source < sentinel) { 518 | c = *source++; 519 | switch (c) { 520 | case U('\n'): 521 | - break; 522 | + break; /* continue space loop */ 523 | + 524 | case U('\r'): 525 | if (source < sentinel 526 | && *source == U('\n')) 527 | ++source; 528 | - break; 529 | + break; /* continue space loop */ 530 | + 531 | default: 532 | - continue; 533 | + continue; /* single line comment loop */ 534 | } 535 | - break; 536 | + break; /* continue space loop */ 537 | } 538 | quote = U('\n'); 539 | - continue; 540 | + continue; /* space loop */ 541 | } 542 | } 543 | } 544 | + 545 | + /* No more spacy character found */ 546 | --source; 547 | - break; 548 | + break; /* end space loop */ 549 | } 550 | 551 | + /* Copy a space if needed */ 552 | if ((tstart < (pctoken ? pctoken : target) && source < sentinel) 553 | && ((quote == U('\n') 554 | && ((RJSMIN_IS_ID_LITERAL_CLOSE(*((pctoken ? 555 | @@ -363,8 +504,9 @@ rjsmin(const rchar *source, rchar *targe 556 | pcreset = NULL; 557 | spaced = quote; 558 | } 559 | + 560 | cont: 561 | - continue; 562 | + continue; /* main loop */ 563 | } 564 | return (Py_ssize_t)(target - tstart); 565 | } 566 | @@ -385,15 +527,15 @@ substitution regex.\n\ 567 | :Note: This is a hand crafted C implementation built on the regex\n\ 568 | semantics.\n\ 569 | \n\ 570 | -:Parameters:\n\ 571 | - `script` : ``str``\n\ 572 | +Parameters:\n\ 573 | + script (str):\n\ 574 | Script to minify\n\ 575 | \n\ 576 | - `keep_bang_comments` : ``bool``\n\ 577 | + keep_bang_comments (bool):\n\ 578 | Keep comments starting with an exclamation mark? (``/*!...*/``)\n\ 579 | \n\ 580 | -:Return: Minified script\n\ 581 | -:Rtype: ``str``"); 582 | +Returns:\n\ 583 | + str: Minified script"); 584 | 585 | static PyObject * 586 | rjsmin_jsmin(PyObject *self, PyObject *args, PyObject *kwds) 587 | @@ -404,15 +546,15 @@ rjsmin_jsmin(PyObject *self, PyObject *a 588 | int keep_bang_comments; 589 | #ifdef EXT2 590 | int uni; 591 | -#define UOBJ "O" 592 | #endif 593 | #ifdef EXT3 594 | -#define UOBJ "U" 595 | + int bytes; 596 | + rchar *bytescript; 597 | #endif 598 | 599 | - if (!PyArg_ParseTupleAndKeywords(args, kwds, UOBJ "|O", kwlist, 600 | + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O", kwlist, 601 | &script, &keep_bang_comments_)) 602 | - return NULL; 603 | + LCOV_EXCL_LINE_RETURN(NULL); 604 | 605 | if (!keep_bang_comments_) 606 | keep_bang_comments = 0; 607 | @@ -425,28 +567,27 @@ rjsmin_jsmin(PyObject *self, PyObject *a 608 | #ifdef EXT2 609 | if (PyUnicode_Check(script)) { 610 | if (!(script = PyUnicode_AsUTF8String(script))) 611 | - return NULL; 612 | + LCOV_EXCL_LINE_RETURN(NULL); 613 | uni = 1; 614 | } 615 | + else if (!PyString_Check(script)) { 616 | + PyErr_SetString(PyExc_TypeError, "Unexpected type"); 617 | + return NULL; 618 | + } 619 | else { 620 | if (!(script = PyObject_Str(script))) 621 | - return NULL; 622 | + LCOV_EXCL_LINE_RETURN(NULL); 623 | uni = 0; 624 | } 625 | -#endif 626 | - 627 | -#ifdef EXT3 628 | - Py_INCREF(script); 629 | -#define PyString_GET_SIZE PyUnicode_GET_SIZE 630 | -#define PyString_AS_STRING PyUnicode_AS_UNICODE 631 | -#define _PyString_Resize PyUnicode_Resize 632 | -#define PyString_FromStringAndSize PyUnicode_FromUnicode 633 | -#endif 634 | - 635 | slength = PyString_GET_SIZE(script); 636 | + 637 | if (!(result = PyString_FromStringAndSize(NULL, slength))) { 638 | + LCOV_EXCL_START 639 | + 640 | Py_DECREF(script); 641 | return NULL; 642 | + 643 | + LCOV_EXCL_STOP 644 | } 645 | Py_BEGIN_ALLOW_THREADS 646 | length = rjsmin((rchar *)PyString_AS_STRING(script), 647 | @@ -456,30 +597,97 @@ rjsmin_jsmin(PyObject *self, PyObject *a 648 | 649 | Py_DECREF(script); 650 | if (length < 0) { 651 | + LCOV_EXCL_START 652 | + 653 | Py_DECREF(result); 654 | return NULL; 655 | + 656 | + LCOV_EXCL_STOP 657 | } 658 | if (length != slength && _PyString_Resize(&result, length) == -1) 659 | - return NULL; 660 | + LCOV_EXCL_LINE_RETURN(NULL); 661 | 662 | -#ifdef EXT2 663 | if (uni) { 664 | script = PyUnicode_DecodeUTF8(PyString_AS_STRING(result), 665 | PyString_GET_SIZE(result), "strict"); 666 | Py_DECREF(result); 667 | - if (!script) 668 | - return NULL; 669 | - result = script; 670 | + return script; 671 | } 672 | -#endif 673 | + 674 | return result; 675 | + 676 | +#else /* EXT3 */ 677 | + 678 | + if (PyUnicode_Check(script)) { 679 | + bytes = 0; 680 | + script = PyUnicode_AsUTF8String(script); 681 | + bytescript = (rchar *)PyBytes_AS_STRING(script); 682 | + slength = PyBytes_GET_SIZE(script); 683 | + } 684 | + else if (PyBytes_Check(script)) { 685 | + bytes = 1; 686 | + Py_INCREF(script); 687 | + bytescript = (rchar *)PyBytes_AS_STRING(script); 688 | + slength = PyBytes_GET_SIZE(script); 689 | + } 690 | + else if (PyByteArray_Check(script)) { 691 | + bytes = 2; 692 | + Py_INCREF(script); 693 | + bytescript = (rchar *)PyByteArray_AS_STRING(script); 694 | + slength = PyByteArray_GET_SIZE(script); 695 | + } 696 | + else { 697 | + PyErr_SetString(PyExc_TypeError, "Unexpected type"); 698 | + return NULL; 699 | + } 700 | + 701 | + if (!(result = PyBytes_FromStringAndSize(NULL, slength))) { 702 | + LCOV_EXCL_START 703 | + 704 | + Py_DECREF(script); 705 | + return NULL; 706 | + 707 | + LCOV_EXCL_STOP 708 | + } 709 | + Py_BEGIN_ALLOW_THREADS 710 | + length = rjsmin(bytescript, (rchar *)PyBytes_AS_STRING(result), 711 | + slength, keep_bang_comments); 712 | + Py_END_ALLOW_THREADS 713 | + 714 | + Py_DECREF(script); 715 | + if (length < 0) { 716 | + LCOV_EXCL_START 717 | + 718 | + Py_DECREF(result); 719 | + return NULL; 720 | + 721 | + LCOV_EXCL_STOP 722 | + } 723 | + 724 | + if (!bytes) { 725 | + script = PyUnicode_DecodeUTF8(PyBytes_AS_STRING(result), length, 726 | + "strict"); 727 | + Py_DECREF(result); 728 | + return script; 729 | + } 730 | + if (bytes == 1) { 731 | + if (length != slength) { 732 | + _PyBytes_Resize(&result, length); 733 | + } 734 | + return result; 735 | + } 736 | + /* bytes == 2: bytearray */ 737 | + script = PyByteArray_FromStringAndSize(PyBytes_AS_STRING(result), length); 738 | + Py_DECREF(result); 739 | + return script; 740 | +#endif 741 | } 742 | 743 | /* ------------------------ BEGIN MODULE DEFINITION ------------------------ */ 744 | 745 | EXT_METHODS = { 746 | {"jsmin", 747 | - (PyCFunction)rjsmin_jsmin, METH_VARARGS | METH_KEYWORDS, 748 | + EXT_CFUNC(rjsmin_jsmin), METH_VARARGS | METH_KEYWORDS, 749 | rjsmin_jsmin__doc__}, 750 | 751 | {NULL} /* Sentinel */ 752 | @@ -499,10 +707,10 @@ EXT_INIT_FUNC { 753 | 754 | /* Create the module and populate stuff */ 755 | if (!(m = EXT_CREATE(&EXT_DEFINE_VAR))) 756 | - EXT_INIT_ERROR(NULL); 757 | + EXT_INIT_ERROR(LCOV_EXCL_LINE(NULL)); 758 | 759 | EXT_ADD_UNICODE(m, "__author__", "Andr\xe9 Malo", "latin-1"); 760 | - EXT_ADD_STRING(m, "__docformat__", "restructuredtext en"); 761 | + EXT_ADD_STRING(m, "__version__", STRINGIFY(EXT_VERSION)); 762 | 763 | EXT_INIT_RETURN(m); 764 | } 765 | diff -up chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/rjsmin.py.12 chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/rjsmin.py 766 | --- chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/rjsmin.py.12 2022-07-01 20:33:39.317727375 +0000 767 | +++ chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/rjsmin.py 2021-11-14 20:24:16.000000000 +0000 768 | @@ -1,6 +1,6 @@ 769 | #!/usr/bin/env python 770 | # -*- coding: ascii -*- 771 | -r""" 772 | +u""" 773 | ===================== 774 | Javascript Minifier 775 | ===================== 776 | @@ -11,7 +11,7 @@ The minifier is based on the semantics o 777 | 778 | :Copyright: 779 | 780 | - Copyright 2011 - 2015 781 | + Copyright 2011 - 2021 782 | Andr\xe9 Malo or his licensors, as applicable 783 | 784 | :License: 785 | @@ -39,9 +39,11 @@ same results as the original ``jsmin.c`` 786 | - Newline characters are not allowed inside string and regex literals, except 787 | for line continuations in string literals (ECMA-5). 788 | - "return /regex/" is recognized correctly. 789 | +- More characters are allowed before regexes. 790 | - Line terminators after regex literals are handled more sensibly 791 | - "+ +" and "- -" sequences are not collapsed to '++' or '--' 792 | - Newlines before ! operators are removed more sensibly 793 | +- (Unnested) template literals are supported (ECMA-6) 794 | - Comments starting with an exclamation mark (``!``) can be kept optionally 795 | - rJSmin does not handle streams, but only complete strings. (However, the 796 | module provides a "streamy" interface). 797 | @@ -56,20 +58,17 @@ file for details. 798 | 799 | rjsmin.c is a reimplementation of rjsmin.py in C and speeds it up even more. 800 | 801 | -Both python 2 and python 3 are supported. 802 | +Supported python versions are 2.7 and 3.6+. 803 | 804 | .. _jsmin.c by Douglas Crockford: 805 | http://www.crockford.com/javascript/jsmin.c 806 | """ 807 | -if __doc__: 808 | - # pylint: disable = redefined-builtin 809 | - __doc__ = __doc__.encode('ascii').decode('unicode_escape') 810 | -__author__ = r"Andr\xe9 Malo".encode('ascii').decode('unicode_escape') 811 | -__docformat__ = "restructuredtext en" 812 | +__author__ = u"Andr\xe9 Malo" 813 | __license__ = "Apache License, Version 2.0" 814 | -__version__ = '1.0.12' 815 | +__version__ = '1.2.0' 816 | __all__ = ['jsmin'] 817 | 818 | +import functools as _ft 819 | import re as _re 820 | 821 | 822 | @@ -80,13 +79,13 @@ def _make_jsmin(python_only=False): 823 | .. _jsmin.c by Douglas Crockford: 824 | http://www.crockford.com/javascript/jsmin.c 825 | 826 | - :Parameters: 827 | - `python_only` : ``bool`` 828 | + Parameters: 829 | + python_only (bool): 830 | Use only the python variant. If true, the c extension is not even 831 | tried to be loaded. 832 | 833 | - :Return: Minifier 834 | - :Rtype: ``callable`` 835 | + Returns: 836 | + callable: Minifier 837 | """ 838 | # pylint: disable = unused-variable 839 | # pylint: disable = too-many-locals 840 | @@ -97,7 +96,10 @@ def _make_jsmin(python_only=False): 841 | except ImportError: 842 | pass 843 | else: 844 | - return _rjsmin.jsmin 845 | + # Ensure that the C version is in sync 846 | + # https://github.com/ndparker/rjsmin/issues/11 847 | + if getattr(_rjsmin, '__version__', None) == __version__: 848 | + return _rjsmin.jsmin 849 | try: 850 | xrange 851 | except NameError: 852 | @@ -110,15 +112,16 @@ def _make_jsmin(python_only=False): 853 | space_comment_nobang = r'(?:/\*(?!!)[^*]*\*+(?:[^/*][^*]*\*+)*/)' 854 | bang_comment = r'(?:/\*![^*]*\*+(?:[^/*][^*]*\*+)*/)' 855 | 856 | - string1 = \ 857 | - r'(?:\047[^\047\\\r\n]*(?:\\(?:[^\r\n]|\r?\n|\r)[^\047\\\r\n]*)*\047)' 858 | + string1 = r"(?:'[^'\\\r\n]*(?:\\(?:[^\r\n]|\r?\n|\r)[^'\\\r\n]*)*')" 859 | + string1 = string1.replace("'", r'\047') # portability 860 | string2 = r'(?:"[^"\\\r\n]*(?:\\(?:[^\r\n]|\r?\n|\r)[^"\\\r\n]*)*")' 861 | - string3 = r'(?:`(?:[^`\\]|\\.)*`)' 862 | + string3 = r'(?:`[^`\\]*(?:\\(?:[^\r\n]|\r?\n|\r)[^`\\]*)*`)' 863 | + string3 = string3.replace('`', r'\140') # portability 864 | strings = r'(?:%s|%s|%s)' % (string1, string2, string3) 865 | 866 | charclass = r'(?:\[[^\\\]\r\n]*(?:\\[^\r\n][^\\\]\r\n]*)*\])' 867 | nospecial = r'[^/\\\[\r\n]' 868 | - regex = r'(?:/(?![\r\n/*])%s*(?:(?:\\[^\r\n]|%s)%s*)*/)' % ( 869 | + regex = r'(?:/(?![\r\n/*])%s*(?:(?:\\[^\r\n]|%s)%s*)*/[a-z]*)' % ( 870 | nospecial, charclass, nospecial 871 | ) 872 | space = r'(?:%s|%s)' % (space_chars, space_comment) 873 | @@ -154,7 +157,7 @@ def _make_jsmin(python_only=False): 874 | ) for first, last in result]) # noqa 875 | 876 | return _re.sub( 877 | - r'([\000-\040\047])', # \047 for better portability 878 | + r"([\000-\040'`])", # ' and ` for better portability 879 | lambda m: '\\%03o' % ord(m.group(1)), ( 880 | sequentize(result) 881 | .replace('\\', '\\\\') 882 | @@ -180,42 +183,48 @@ def _make_jsmin(python_only=False): 883 | return r'[%s]' % fix_charclass(result) 884 | 885 | not_id_literal = not_id_literal_(r'[a-zA-Z0-9_$]') 886 | - preregex1 = r'[(,=:\[!&|?{};\r\n]' 887 | + preregex1 = r'[(,=:\[!&|?{};\r\n+*-]' 888 | preregex2 = r'%(not_id_literal)sreturn' % locals() 889 | 890 | id_literal = id_literal_(r'[a-zA-Z0-9_$]') 891 | id_literal_open = id_literal_(r'[a-zA-Z0-9_${\[(!+-]') 892 | - id_literal_close = id_literal_(r'[a-zA-Z0-9_$}\])"\047+-]') 893 | + id_literal_close = id_literal_(r'[a-zA-Z0-9_$}\])"\047\140+-]') 894 | post_regex_off = id_literal_(r'[^\000-\040}\])?:|,;.&=+-]') 895 | 896 | - dull = r'[^\047"`/\000-\040]' 897 | + dull = r'[^\047"\140/\000-\040]' 898 | 899 | space_sub_simple = _re.compile(( 900 | - # noqa pylint: disable = bad-continuation 901 | + # noqa pylint: disable = bad-option-value, bad-continuation 902 | 903 | r'(%(dull)s+)' # 0 904 | r'|(%(strings)s%(dull)s*)' # 1 905 | - r'|(?<=%(preregex1)s)' 906 | + r'|(?<=[)])' 907 | r'%(space)s*(?:%(newline)s%(space)s*)*' 908 | r'(%(regex)s)' # 2 909 | - r'(%(space)s*(?:%(newline)s%(space)s*)+' # 3 910 | + r'(?=%(space)s*(?:%(newline)s%(space)s*)*' 911 | + r'\.' 912 | + r'%(space)s*(?:%(newline)s%(space)s*)*[a-z])' 913 | + r'|(?<=%(preregex1)s)' 914 | + r'%(space)s*(?:%(newline)s%(space)s*)*' 915 | + r'(%(regex)s)' # 3 916 | + r'(%(space)s*(?:%(newline)s%(space)s*)+' # 4 917 | r'(?=%(post_regex_off)s))?' 918 | r'|(?<=%(preregex2)s)' 919 | - r'%(space)s*(?:(%(newline)s)%(space)s*)*' # 4 920 | - r'(%(regex)s)' # 5 921 | - r'(%(space)s*(?:%(newline)s%(space)s*)+' # 6 922 | + r'%(space)s*(?:(%(newline)s)%(space)s*)*' # 5 923 | + r'(%(regex)s)' # 6 924 | + r'(%(space)s*(?:%(newline)s%(space)s*)+' # 7 925 | r'(?=%(post_regex_off)s))?' 926 | r'|(?<=%(id_literal_close)s)' 927 | - r'%(space)s*(?:(%(newline)s)%(space)s*)+' # 7 928 | + r'%(space)s*(?:(%(newline)s)%(space)s*)+' # 8 929 | r'(?=%(id_literal_open)s)' 930 | - r'|(?<=%(id_literal)s)(%(space)s)+(?=%(id_literal)s)' # 8 931 | - r'|(?<=\+)(%(space)s)+(?=\+)' # 9 932 | - r'|(?<=-)(%(space)s)+(?=-)' # 10 933 | + r'|(?<=%(id_literal)s)(%(space)s)+(?=%(id_literal)s)' # 9 934 | + r'|(?<=\+)(%(space)s)+(?=\+)' # 10 935 | + r'|(?<=-)(%(space)s)+(?=-)' # 11 936 | r'|%(space)s+' 937 | r'|(?:%(newline)s%(space)s*)+' 938 | ) % locals()).sub 939 | 940 | - # print space_sub_simple.__self__.pattern 941 | + # print(space_sub_simple.__self__.pattern) 942 | 943 | def space_subber_simple(match): 944 | """ Substitution callback """ 945 | @@ -227,48 +236,56 @@ def _make_jsmin(python_only=False): 946 | elif groups[1]: 947 | return groups[1] 948 | elif groups[2]: 949 | - if groups[3]: 950 | - return groups[2] + '\n' 951 | return groups[2] 952 | - elif groups[5]: 953 | + elif groups[3]: 954 | + if groups[4]: 955 | + return groups[3] + '\n' 956 | + return groups[3] 957 | + elif groups[6]: 958 | return "%s%s%s" % ( 959 | - groups[4] and '\n' or '', 960 | - groups[5], 961 | - groups[6] and '\n' or '', 962 | + groups[5] and '\n' or '', 963 | + groups[6], 964 | + groups[7] and '\n' or '', 965 | ) 966 | - elif groups[7]: 967 | + elif groups[8]: 968 | return '\n' 969 | - elif groups[8] or groups[9] or groups[10]: 970 | + elif groups[9] or groups[10] or groups[11]: 971 | return ' ' 972 | else: 973 | return '' 974 | 975 | space_sub_banged = _re.compile(( 976 | - # noqa pylint: disable = bad-continuation 977 | + # noqa pylint: disable = bad-option-value, bad-continuation 978 | 979 | r'(%(dull)s+)' # 0 980 | r'|(%(strings)s%(dull)s*)' # 1 981 | - r'|(?<=%(preregex1)s)' 982 | + r'|(?<=[)])' 983 | r'(%(space)s*(?:%(newline)s%(space)s*)*)' # 2 984 | r'(%(regex)s)' # 3 985 | - r'(%(space)s*(?:%(newline)s%(space)s*)+' # 4 986 | + r'(?=%(space)s*(?:%(newline)s%(space)s*)*' 987 | + r'\.' 988 | + r'%(space)s*(?:%(newline)s%(space)s*)*[a-z])' 989 | + r'|(?<=%(preregex1)s)' 990 | + r'(%(space)s*(?:%(newline)s%(space)s*)*)' # 4 991 | + r'(%(regex)s)' # 5 992 | + r'(%(space)s*(?:%(newline)s%(space)s*)+' # 6 993 | r'(?=%(post_regex_off)s))?' 994 | r'|(?<=%(preregex2)s)' 995 | - r'(%(space)s*(?:(%(newline)s)%(space)s*)*)' # 5, 6 996 | - r'(%(regex)s)' # 7 997 | - r'(%(space)s*(?:%(newline)s%(space)s*)+' # 8 998 | + r'(%(space)s*(?:(%(newline)s)%(space)s*)*)' # 7, 8 999 | + r'(%(regex)s)' # 9 1000 | + r'(%(space)s*(?:%(newline)s%(space)s*)+' # 10 1001 | r'(?=%(post_regex_off)s))?' 1002 | r'|(?<=%(id_literal_close)s)' 1003 | - r'(%(space)s*(?:%(newline)s%(space)s*)+)' # 9 1004 | + r'(%(space)s*(?:%(newline)s%(space)s*)+)' # 11 1005 | r'(?=%(id_literal_open)s)' 1006 | - r'|(?<=%(id_literal)s)(%(space)s+)(?=%(id_literal)s)' # 10 1007 | - r'|(?<=\+)(%(space)s+)(?=\+)' # 11 1008 | - r'|(?<=-)(%(space)s+)(?=-)' # 12 1009 | - r'|(%(space)s+)' # 13 1010 | - r'|((?:%(newline)s%(space)s*)+)' # 14 1011 | + r'|(?<=%(id_literal)s)(%(space)s+)(?=%(id_literal)s)' # 12 1012 | + r'|(?<=\+)(%(space)s+)(?=\+)' # 13 1013 | + r'|(?<=-)(%(space)s+)(?=-)' # 14 1014 | + r'|(%(space)s+)' # 15 1015 | + r'|((?:%(newline)s%(space)s*)+)' # 16 1016 | ) % locals()).sub 1017 | 1018 | - # print space_sub_banged.__self__.pattern 1019 | + # print(space_sub_banged.__self__.pattern) 1020 | 1021 | keep = _re.compile(( 1022 | r'%(space_chars)s+|%(space_comment_nobang)s+|%(newline)s+' 1023 | @@ -276,7 +293,7 @@ def _make_jsmin(python_only=False): 1024 | ) % locals()).sub 1025 | keeper = lambda m: m.groups()[0] or '' 1026 | 1027 | - # print keep.__self__.pattern 1028 | + # print(keep.__self__.pattern) 1029 | 1030 | def space_subber_banged(match): 1031 | """ Substitution callback """ 1032 | @@ -288,26 +305,34 @@ def _make_jsmin(python_only=False): 1033 | elif groups[1]: 1034 | return groups[1] 1035 | elif groups[3]: 1036 | - return "%s%s%s%s" % ( 1037 | + return "%s%s" % ( 1038 | keep(keeper, groups[2]), 1039 | groups[3], 1040 | - keep(keeper, groups[4] or ''), 1041 | - groups[4] and '\n' or '', 1042 | ) 1043 | - elif groups[7]: 1044 | - return "%s%s%s%s%s" % ( 1045 | - keep(keeper, groups[5]), 1046 | + elif groups[5]: 1047 | + return "%s%s%s%s" % ( 1048 | + keep(keeper, groups[4]), 1049 | + groups[5], 1050 | + keep(keeper, groups[6] or ''), 1051 | groups[6] and '\n' or '', 1052 | - groups[7], 1053 | - keep(keeper, groups[8] or ''), 1054 | - groups[8] and '\n' or '', 1055 | ) 1056 | elif groups[9]: 1057 | - return keep(keeper, groups[9]) + '\n' 1058 | - elif groups[10] or groups[11] or groups[12]: 1059 | - return keep(keeper, groups[10] or groups[11] or groups[12]) or ' ' 1060 | + return "%s%s%s%s%s" % ( 1061 | + keep(keeper, groups[7]), 1062 | + groups[8] and '\n' or '', 1063 | + groups[9], 1064 | + keep(keeper, groups[10] or ''), 1065 | + groups[10] and '\n' or '', 1066 | + ) 1067 | + elif groups[11]: 1068 | + return keep(keeper, groups[11]) + '\n' 1069 | + elif groups[12] or groups[13] or groups[14]: 1070 | + return keep(keeper, groups[12] or groups[13] or groups[14]) or ' ' 1071 | else: 1072 | - return keep(keeper, groups[13] or groups[14]) 1073 | + return keep(keeper, groups[15] or groups[16]) 1074 | + 1075 | + banged = _ft.partial(space_sub_banged, space_subber_banged) 1076 | + simple = _ft.partial(space_sub_simple, space_subber_simple) 1077 | 1078 | def jsmin(script, keep_bang_comments=False): 1079 | r""" 1080 | @@ -320,32 +345,51 @@ def _make_jsmin(python_only=False): 1081 | .. _jsmin.c by Douglas Crockford: 1082 | http://www.crockford.com/javascript/jsmin.c 1083 | 1084 | - :Parameters: 1085 | - `script` : ``str`` 1086 | + Parameters: 1087 | + script (str): 1088 | Script to minify 1089 | 1090 | - `keep_bang_comments` : ``bool`` 1091 | + keep_bang_comments (bool): 1092 | Keep comments starting with an exclamation mark? (``/*!...*/``) 1093 | 1094 | - :Return: Minified script 1095 | - :Rtype: ``str`` 1096 | + Returns: 1097 | + str: Minified script 1098 | """ 1099 | # pylint: disable = redefined-outer-name 1100 | 1101 | - if keep_bang_comments: 1102 | - return space_sub_banged( 1103 | - space_subber_banged, '\n%s\n' % script 1104 | - ).strip() 1105 | - else: 1106 | - return space_sub_simple( 1107 | - space_subber_simple, '\n%s\n' % script 1108 | - ).strip() 1109 | + is_bytes, script = _as_str(script) 1110 | + script = (banged if keep_bang_comments else simple)( 1111 | + '\n%s\n' % script 1112 | + ).strip() 1113 | + if is_bytes: 1114 | + script = script.encode('latin-1') 1115 | + if is_bytes == 2: 1116 | + script = bytearray(script) 1117 | + return script 1118 | 1119 | return jsmin 1120 | 1121 | jsmin = _make_jsmin() 1122 | 1123 | 1124 | +def _as_str(script): 1125 | + """ Make sure the script is a text string """ 1126 | + is_bytes = False 1127 | + if str is bytes: 1128 | + if not isinstance(script, basestring): # noqa pylint: disable = undefined-variable 1129 | + raise TypeError("Unexpected type") 1130 | + elif isinstance(script, bytes): 1131 | + is_bytes = True 1132 | + script = script.decode('latin-1') 1133 | + elif isinstance(script, bytearray): 1134 | + is_bytes = 2 1135 | + script = script.decode('latin-1') 1136 | + elif not isinstance(script, str): 1137 | + raise TypeError("Unexpected type") 1138 | + 1139 | + return is_bytes, script 1140 | + 1141 | + 1142 | def jsmin_for_posers(script, keep_bang_comments=False): 1143 | r""" 1144 | Minify javascript based on `jsmin.c by Douglas Crockford`_\. 1145 | @@ -361,49 +405,61 @@ def jsmin_for_posers(script, keep_bang_c 1146 | utilizes the resulting regexes. It's here for fun and may 1147 | vanish any time. Use the `jsmin` function instead. 1148 | 1149 | - :Parameters: 1150 | - `script` : ``str`` 1151 | + Parameters: 1152 | + script (str): 1153 | Script to minify 1154 | 1155 | - `keep_bang_comments` : ``bool`` 1156 | + keep_bang_comments (bool): 1157 | Keep comments starting with an exclamation mark? (``/*!...*/``) 1158 | 1159 | - :Return: Minified script 1160 | - :Rtype: ``str`` 1161 | + Returns: 1162 | + str: Minified script 1163 | """ 1164 | if not keep_bang_comments: 1165 | rex = ( 1166 | - r'([^\047"/\000-\040]+)|((?:(?:\047[^\047\\\r\n]*(?:\\(?:[^\r\n]' 1167 | - r'|\r?\n|\r)[^\047\\\r\n]*)*\047)|(?:"[^"\\\r\n]*(?:\\(?:[^\r\n]' 1168 | - r'|\r?\n|\r)[^"\\\r\n]*)*"))[^\047"/\000-\040]*)|(?<=[(,=:\[!&|?' 1169 | - r'{};\r\n])(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*' 1170 | - r'][^*]*\*+)*/))*(?:(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\011\013\0' 1171 | - r'14\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)*((?:/(?![\r' 1172 | - r'\n/*])[^/\\\[\r\n]*(?:(?:\\[^\r\n]|(?:\[[^\\\]\r\n]*(?:\\[^\r' 1173 | - r'\n][^\\\]\r\n]*)*\]))[^/\\\[\r\n]*)*/))((?:[\000-\011\013\014' 1174 | + r'([^\047"\140/\000-\040]+)|((?:(?:\047[^\047\\\r\n]*(?:\\(?:[^' 1175 | + r'\r\n]|\r?\n|\r)[^\047\\\r\n]*)*\047)|(?:"[^"\\\r\n]*(?:\\(?:[^' 1176 | + r'\r\n]|\r?\n|\r)[^"\\\r\n]*)*")|(?:\140[^\140\\]*(?:\\(?:[^\r\n' 1177 | + r']|\r?\n|\r)[^\140\\]*)*\140))[^\047"\140/\000-\040]*)|(?<=[)])' 1178 | + r'(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+' 1179 | + r')*/))*(?:(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\011\013\014\016-\0' 1180 | + r'40]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)*((?:/(?![\r\n/*])[^/' 1181 | + r'\\\[\r\n]*(?:(?:\\[^\r\n]|(?:\[[^\\\]\r\n]*(?:\\[^\r\n][^\\\]' 1182 | + r'\r\n]*)*\]))[^/\\\[\r\n]*)*/[a-z]*))(?=(?:[\000-\011\013\014\0' 1183 | + r'16-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:(?:(?://[^\r\n' 1184 | + r']*)?[\r\n])(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^' 1185 | + r'/*][^*]*\*+)*/))*)*\.(?:[\000-\011\013\014\016-\040]|(?:/\*[^*' 1186 | + r']*\*+(?:[^/*][^*]*\*+)*/))*(?:(?:(?://[^\r\n]*)?[\r\n])(?:[\00' 1187 | + r'0-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)' 1188 | + r'*[a-z])|(?<=[(,=:\[!&|?{};\r\n+*-])(?:[\000-\011\013\014\016-' 1189 | + r'\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:(?:(?://[^\r\n]*)' 1190 | + r'?[\r\n])(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*]' 1191 | + r'[^*]*\*+)*/))*)*((?:/(?![\r\n/*])[^/\\\[\r\n]*(?:(?:\\[^\r\n]|' 1192 | + r'(?:\[[^\\\]\r\n]*(?:\\[^\r\n][^\\\]\r\n]*)*\]))[^/\\\[\r\n]*)*' 1193 | + r'/[a-z]*))((?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/' 1194 | + r'*][^*]*\*+)*/))*(?:(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\011\013' 1195 | + r'\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)+(?=[^\000' 1196 | + r'-\040&)+,.:;=?\]|}-]))?|(?<=[\000-#%-,./:-@\[-^\140{-~-]return' 1197 | + r')(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*' 1198 | + r'+)*/))*(?:((?:(?://[^\r\n]*)?[\r\n]))(?:[\000-\011\013\014\016' 1199 | + r'-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)*((?:/(?![\r\n/*])' 1200 | + r'[^/\\\[\r\n]*(?:(?:\\[^\r\n]|(?:\[[^\\\]\r\n]*(?:\\[^\r\n][^' 1201 | + r'\\\]\r\n]*)*\]))[^/\\\[\r\n]*)*/[a-z]*))((?:[\000-\011\013\014' 1202 | r'\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:(?:(?://[^\r' 1203 | r'\n]*)?[\r\n])(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:' 1204 | - r'[^/*][^*]*\*+)*/))*)+(?=[^\000-\040&)+,.:;=?\]|}-]))?|(?<=[\00' 1205 | - r'0-#%-,./:-@\[-^`{-~-]return)(?:[\000-\011\013\014\016-\040]|(?' 1206 | - r':/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:((?:(?://[^\r\n]*)?[\r\n]' 1207 | - r'))(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*' 1208 | - r'\*+)*/))*)*((?:/(?![\r\n/*])[^/\\\[\r\n]*(?:(?:\\[^\r\n]|(?:\[' 1209 | - r'[^\\\]\r\n]*(?:\\[^\r\n][^\\\]\r\n]*)*\]))[^/\\\[\r\n]*)*/))((' 1210 | - r'?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)' 1211 | - r'*/))*(?:(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\011\013\014\016-\04' 1212 | - r'0]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)+(?=[^\000-\040&)+,.:;' 1213 | - r'=?\]|}-]))?|(?<=[^\000-!#%&(*,./:-@\[\\^`{|~])(?:[\000-\011\01' 1214 | - r'3\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:((?:(?:' 1215 | - r'//[^\r\n]*)?[\r\n]))(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]' 1216 | - r'*\*+(?:[^/*][^*]*\*+)*/))*)+(?=[^\000-\040"#%-\047)*,./:-@\\-^' 1217 | - r'`|-~])|(?<=[^\000-#%-,./:-@\[-^`{-~-])((?:[\000-\011\013\014\0' 1218 | - r'16-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/)))+(?=[^\000-#%-,./' 1219 | - r':-@\[-^`{-~-])|(?<=\+)((?:[\000-\011\013\014\016-\040]|(?:/\*[' 1220 | - r'^*]*\*+(?:[^/*][^*]*\*+)*/)))+(?=\+)|(?<=-)((?:[\000-\011\013' 1221 | - r'\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/)))+(?=-)|(?:[' 1222 | - r'\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/)' 1223 | - r')+|(?:(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\011\013\014\016-\040]' 1224 | - r'|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)+' 1225 | + r'[^/*][^*]*\*+)*/))*)+(?=[^\000-\040&)+,.:;=?\]|}-]))?|(?<=[^\0' 1226 | + r'00-!#%&(*,./:-@\[\\^{|~])(?:[\000-\011\013\014\016-\040]|(?:/' 1227 | + r'\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:((?:(?://[^\r\n]*)?[\r\n]))' 1228 | + r'(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+' 1229 | + r')*/))*)+(?=[^\000-\040"#%-\047)*,./:-@\\-^\140|-~])|(?<=[^\000' 1230 | + r'-#%-,./:-@\[-^\140{-~-])((?:[\000-\011\013\014\016-\040]|(?:/' 1231 | + r'\*[^*]*\*+(?:[^/*][^*]*\*+)*/)))+(?=[^\000-#%-,./:-@\[-^\140{-' 1232 | + r'~-])|(?<=\+)((?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:' 1233 | + r'[^/*][^*]*\*+)*/)))+(?=\+)|(?<=-)((?:[\000-\011\013\014\016-\0' 1234 | + r'40]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/)))+(?=-)|(?:[\000-\011\0' 1235 | + r'13\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))+|(?:(?:(?' 1236 | + r'://[^\r\n]*)?[\r\n])(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]' 1237 | + r'*\*+(?:[^/*][^*]*\*+)*/))*)+' 1238 | ) 1239 | 1240 | def subber(match): 1241 | @@ -412,59 +468,72 @@ def jsmin_for_posers(script, keep_bang_c 1242 | return ( 1243 | groups[0] or 1244 | groups[1] or 1245 | - (groups[3] and (groups[2] + '\n')) or 1246 | groups[2] or 1247 | - (groups[5] and "%s%s%s" % ( 1248 | - groups[4] and '\n' or '', 1249 | - groups[5], 1250 | - groups[6] and '\n' or '', 1251 | + (groups[4] and (groups[3] + '\n')) or 1252 | + groups[3] or 1253 | + (groups[6] and "%s%s%s" % ( 1254 | + groups[5] and '\n' or '', 1255 | + groups[6], 1256 | + groups[7] and '\n' or '', 1257 | )) or 1258 | - (groups[7] and '\n') or 1259 | - (groups[8] and ' ') or 1260 | + (groups[8] and '\n') or 1261 | (groups[9] and ' ') or 1262 | (groups[10] and ' ') or 1263 | + (groups[11] and ' ') or 1264 | '' 1265 | ) 1266 | else: 1267 | rex = ( 1268 | - r'([^\047"/\000-\040]+)|((?:(?:\047[^\047\\\r\n]*(?:\\(?:[^\r\n]' 1269 | - r'|\r?\n|\r)[^\047\\\r\n]*)*\047)|(?:"[^"\\\r\n]*(?:\\(?:[^\r\n]' 1270 | - r'|\r?\n|\r)[^"\\\r\n]*)*"))[^\047"/\000-\040]*)|(?<=[(,=:\[!&|?' 1271 | - r'{};\r\n])((?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/' 1272 | - r'*][^*]*\*+)*/))*(?:(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\011\013' 1273 | - r'\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)*)((?:/(?!' 1274 | - r'[\r\n/*])[^/\\\[\r\n]*(?:(?:\\[^\r\n]|(?:\[[^\\\]\r\n]*(?:\\[^' 1275 | - r'\r\n][^\\\]\r\n]*)*\]))[^/\\\[\r\n]*)*/))((?:[\000-\011\013\01' 1276 | - r'4\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:(?:(?://[^' 1277 | + r'([^\047"\140/\000-\040]+)|((?:(?:\047[^\047\\\r\n]*(?:\\(?:[^' 1278 | + r'\r\n]|\r?\n|\r)[^\047\\\r\n]*)*\047)|(?:"[^"\\\r\n]*(?:\\(?:[^' 1279 | + r'\r\n]|\r?\n|\r)[^"\\\r\n]*)*")|(?:\140[^\140\\]*(?:\\(?:[^\r\n' 1280 | + r']|\r?\n|\r)[^\140\\]*)*\140))[^\047"\140/\000-\040]*)|(?<=[)])' 1281 | + r'((?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*' 1282 | + r'+)*/))*(?:(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\011\013\014\016-' 1283 | + r'\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)*)((?:/(?![\r\n/*])' 1284 | + r'[^/\\\[\r\n]*(?:(?:\\[^\r\n]|(?:\[[^\\\]\r\n]*(?:\\[^\r\n][^' 1285 | + r'\\\]\r\n]*)*\]))[^/\\\[\r\n]*)*/[a-z]*))(?=(?:[\000-\011\013\0' 1286 | + r'14\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:(?:(?://[^' 1287 | r'\r\n]*)?[\r\n])(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(' 1288 | - r'?:[^/*][^*]*\*+)*/))*)+(?=[^\000-\040&)+,.:;=?\]|}-]))?|(?<=[' 1289 | - r'\000-#%-,./:-@\[-^`{-~-]return)((?:[\000-\011\013\014\016-\040' 1290 | - r']|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:((?:(?://[^\r\n]*)?[' 1291 | - r'\r\n]))(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][' 1292 | - r'^*]*\*+)*/))*)*)((?:/(?![\r\n/*])[^/\\\[\r\n]*(?:(?:\\[^\r\n]|' 1293 | - r'(?:\[[^\\\]\r\n]*(?:\\[^\r\n][^\\\]\r\n]*)*\]))[^/\\\[\r\n]*)*' 1294 | - r'/))((?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]' 1295 | - r'*\*+)*/))*(?:(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\011\013\014\01' 1296 | - r'6-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)+(?=[^\000-\040&)' 1297 | - r'+,.:;=?\]|}-]))?|(?<=[^\000-!#%&(*,./:-@\[\\^`{|~])((?:[\000-' 1298 | - r'\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:' 1299 | - r'(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\011\013\014\016-\040]|(?:/' 1300 | - r'\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)+)(?=[^\000-\040"#%-\047)*,./' 1301 | - r':-@\\-^`|-~])|(?<=[^\000-#%-,./:-@\[-^`{-~-])((?:[\000-\011\01' 1302 | - r'3\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))+)(?=[^\000' 1303 | - r'-#%-,./:-@\[-^`{-~-])|(?<=\+)((?:[\000-\011\013\014\016-\040]|' 1304 | - r'(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))+)(?=\+)|(?<=-)((?:[\000-\0' 1305 | - r'11\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))+)(?=-' 1306 | - r')|((?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*' 1307 | - r'\*+)*/))+)|((?:(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\011\013\014' 1308 | - r'\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)+)' 1309 | + r'?:[^/*][^*]*\*+)*/))*)*\.(?:[\000-\011\013\014\016-\040]|(?:/' 1310 | + r'\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:(?:(?://[^\r\n]*)?[\r\n])(?' 1311 | + r':[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*' 1312 | + r'/))*)*[a-z])|(?<=[(,=:\[!&|?{};\r\n+*-])((?:[\000-\011\013\014' 1313 | + r'\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:(?:(?://[^\r' 1314 | + r'\n]*)?[\r\n])(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:' 1315 | + r'[^/*][^*]*\*+)*/))*)*)((?:/(?![\r\n/*])[^/\\\[\r\n]*(?:(?:\\[^' 1316 | + r'\r\n]|(?:\[[^\\\]\r\n]*(?:\\[^\r\n][^\\\]\r\n]*)*\]))[^/\\\[\r' 1317 | + r'\n]*)*/[a-z]*))((?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+' 1318 | + r'(?:[^/*][^*]*\*+)*/))*(?:(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\01' 1319 | + r'1\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)+(?=[' 1320 | + r'^\000-\040&)+,.:;=?\]|}-]))?|(?<=[\000-#%-,./:-@\[-^\140{-~-]r' 1321 | + r'eturn)((?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][' 1322 | + r'^*]*\*+)*/))*(?:((?:(?://[^\r\n]*)?[\r\n]))(?:[\000-\011\013\0' 1323 | + r'14\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)*)((?:/(?![' 1324 | + r'\r\n/*])[^/\\\[\r\n]*(?:(?:\\[^\r\n]|(?:\[[^\\\]\r\n]*(?:\\[^' 1325 | + r'\r\n][^\\\]\r\n]*)*\]))[^/\\\[\r\n]*)*/[a-z]*))((?:[\000-\011' 1326 | + r'\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:(?:(' 1327 | + r'?://[^\r\n]*)?[\r\n])(?:[\000-\011\013\014\016-\040]|(?:/\*[^*' 1328 | + r']*\*+(?:[^/*][^*]*\*+)*/))*)+(?=[^\000-\040&)+,.:;=?\]|}-]))?|' 1329 | + r'(?<=[^\000-!#%&(*,./:-@\[\\^{|~])((?:[\000-\011\013\014\016-\0' 1330 | + r'40]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:(?:(?://[^\r\n]*)?[' 1331 | + r'\r\n])(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^' 1332 | + r'*]*\*+)*/))*)+)(?=[^\000-\040"#%-\047)*,./:-@\\-^\140|-~])|(?<' 1333 | + r'=[^\000-#%-,./:-@\[-^\140{-~-])((?:[\000-\011\013\014\016-\040' 1334 | + r']|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))+)(?=[^\000-#%-,./:-@\[-^' 1335 | + r'\140{-~-])|(?<=\+)((?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*' 1336 | + r'\*+(?:[^/*][^*]*\*+)*/))+)(?=\+)|(?<=-)((?:[\000-\011\013\014' 1337 | + r'\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))+)(?=-)|((?:[\00' 1338 | + r'0-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))+)' 1339 | + r'|((?:(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\011\013\014\016-\040]|' 1340 | + r'(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)+)' 1341 | ) 1342 | 1343 | - keep = _re.compile(( 1344 | + keep = _re.compile( 1345 | r'[\000-\011\013\014\016-\040]+|(?:/\*(?!!)[^*]*\*+(?:[^/*][^*]*' 1346 | r'\*+)*/)+|(?:(?://[^\r\n]*)?[\r\n])+|((?:/\*![^*]*\*+(?:[^/*][^' 1347 | r'*]*\*+)*/)+)' 1348 | - ) % locals()).sub 1349 | + ).sub 1350 | keeper = lambda m: m.groups()[0] or '' 1351 | 1352 | def subber(match): 1353 | @@ -473,27 +542,37 @@ def jsmin_for_posers(script, keep_bang_c 1354 | return ( 1355 | groups[0] or 1356 | groups[1] or 1357 | - (groups[3] and "%s%s%s%s" % ( 1358 | + groups[3] and "%s%s" % ( 1359 | keep(keeper, groups[2]), 1360 | groups[3], 1361 | - keep(keeper, groups[4] or ''), 1362 | - groups[4] and '\n' or '', 1363 | - )) or 1364 | - (groups[7] and "%s%s%s%s%s" % ( 1365 | - keep(keeper, groups[5]), 1366 | + ) or 1367 | + groups[5] and "%s%s%s%s" % ( 1368 | + keep(keeper, groups[4]), 1369 | + groups[5], 1370 | + keep(keeper, groups[6] or ''), 1371 | groups[6] and '\n' or '', 1372 | - groups[7], 1373 | - keep(keeper, groups[8] or ''), 1374 | + ) or 1375 | + groups[9] and "%s%s%s%s%s" % ( 1376 | + keep(keeper, groups[7]), 1377 | groups[8] and '\n' or '', 1378 | - )) or 1379 | - (groups[9] and keep(keeper, groups[9] + '\n')) or 1380 | - (groups[10] and keep(keeper, groups[10]) or ' ') or 1381 | - (groups[11] and keep(keeper, groups[11]) or ' ') or 1382 | - (groups[12] and keep(keeper, groups[12]) or ' ') or 1383 | - keep(keeper, groups[13] or groups[14]) 1384 | + groups[9], 1385 | + keep(keeper, groups[10] or ''), 1386 | + groups[10] and '\n' or '', 1387 | + ) or 1388 | + groups[11] and (keep(keeper, groups[11]) + '\n') or 1389 | + groups[12] and (keep(keeper, groups[12]) or ' ') or 1390 | + groups[13] and (keep(keeper, groups[13]) or ' ') or 1391 | + groups[14] and (keep(keeper, groups[14]) or ' ') or 1392 | + keep(keeper, groups[15] or groups[16]) 1393 | ) 1394 | 1395 | - return _re.sub(rex, subber, '\n%s\n' % script).strip() 1396 | + is_bytes, script = _as_str(script) 1397 | + script = _re.sub(rex, subber, '\n%s\n' % script).strip() 1398 | + if is_bytes: 1399 | + script = script.encode('latin-1') 1400 | + if is_bytes == 2: 1401 | + script = bytearray(script) 1402 | + return script 1403 | 1404 | 1405 | if __name__ == '__main__': 1406 | diff -up chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/setup.py.12 chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/setup.py 1407 | --- chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/setup.py.12 2022-06-28 12:50:10.171324444 +0000 1408 | +++ chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/setup.py 2021-11-05 17:03:12.000000000 +0000 1409 | @@ -1,41 +1,264 @@ 1410 | #!/usr/bin/env python 1411 | # -*- coding: ascii -*- 1412 | -# 1413 | -# Copyright 2006 - 2013 1414 | -# Andr\xe9 Malo or his licensors, as applicable 1415 | -# 1416 | -# Licensed under the Apache License, Version 2.0 (the "License"); 1417 | -# you may not use this file except in compliance with the License. 1418 | -# You may obtain a copy of the License at 1419 | -# 1420 | -# http://www.apache.org/licenses/LICENSE-2.0 1421 | -# 1422 | -# Unless required by applicable law or agreed to in writing, software 1423 | -# distributed under the License is distributed on an "AS IS" BASIS, 1424 | -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1425 | -# See the License for the specific language governing permissions and 1426 | -# limitations under the License. 1427 | +u""" 1428 | +:Copyright: 1429 | 1430 | + Copyright 2011 - 2021 1431 | + Andr\xe9 Malo or his licensors, as applicable 1432 | + 1433 | +:License: 1434 | + 1435 | + Licensed under the Apache License, Version 2.0 (the "License"); 1436 | + you may not use this file except in compliance with the License. 1437 | + You may obtain a copy of the License at 1438 | + 1439 | + http://www.apache.org/licenses/LICENSE-2.0 1440 | + 1441 | + Unless required by applicable law or agreed to in writing, software 1442 | + distributed under the License is distributed on an "AS IS" BASIS, 1443 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1444 | + See the License for the specific language governing permissions and 1445 | + limitations under the License. 1446 | + 1447 | +=========================================== 1448 | + rJSmin - A Javascript Minifier For Python 1449 | +=========================================== 1450 | + 1451 | +rJSmin - A Javascript Minifier For Python. 1452 | +""" 1453 | +from __future__ import print_function 1454 | +__author__ = u"Andr\xe9 Malo" 1455 | +__docformat__ = "restructuredtext en" 1456 | + 1457 | +import os as _os 1458 | +import posixpath as _posixpath 1459 | import sys as _sys 1460 | -from _setup import run 1461 | 1462 | +# pylint: disable = no-name-in-module, import-error, raise-missing-from 1463 | +import setuptools as _setuptools 1464 | + 1465 | +# pylint: disable = invalid-name 1466 | + 1467 | + 1468 | +def _doc(filename): 1469 | + """ Read docs file """ 1470 | + # pylint: disable = unspecified-encoding 1471 | + args = {} if str is bytes else dict(encoding='utf-8') 1472 | + try: 1473 | + with open(_os.path.join('docs', filename), **args) as fp: 1474 | + return fp.read() 1475 | + except IOError: 1476 | + return None 1477 | + 1478 | + 1479 | +def _lines(multiline): 1480 | + """ Split multiline string into single line % empty and comments """ 1481 | + return [line for line in ( 1482 | + line.strip() for line in multiline.splitlines(False) 1483 | + ) if line and not line.startswith('#')] 1484 | + 1485 | + 1486 | +package = dict( 1487 | + name='rjsmin', 1488 | + top='.', 1489 | + pathname='.', 1490 | + provides=_doc('PROVIDES'), 1491 | + desc=_doc('SUMMARY').strip(), 1492 | + longdesc=_doc('DESCRIPTION'), 1493 | + author=__author__, 1494 | + email='nd@perlig.de', 1495 | + license="Apache License, Version 2.0", 1496 | + keywords=_lines(_doc('KEYWORDS')), 1497 | + url='http://opensource.perlig.de/rjsmin/', 1498 | + classifiers=_lines(_doc('CLASSIFIERS') or ''), 1499 | + 1500 | + packages=False, 1501 | + py_modules=['rjsmin'], 1502 | + version_file='rjsmin.py', 1503 | + install_requires=[], 1504 | +) 1505 | + 1506 | + 1507 | +class BuildFailed(Exception): 1508 | + """ The build has failed """ 1509 | + 1510 | + 1511 | +from distutils.command import build_ext as _build_ext # pylint: disable = wrong-import-order 1512 | +from distutils import errors as _errors # pylint: disable = wrong-import-order 1513 | +class build_ext(_build_ext.build_ext): # pylint: disable = no-init 1514 | + """ Improved extension building code """ 1515 | + 1516 | + def run(self): 1517 | + """ Unify exception """ 1518 | + try: 1519 | + _build_ext.build_ext.run(self) 1520 | + except _errors.DistutilsPlatformError: 1521 | + raise BuildFailed() 1522 | + 1523 | + 1524 | + def build_extension(self, ext): 1525 | + """ 1526 | + Build C extension - with extended functionality 1527 | 1528 | -def setup(args=None, _manifest=0): 1529 | - """ Main setup function """ 1530 | - from _setup.ext import Extension 1531 | + The following features are added here: 1532 | 1533 | - if 'java' in _sys.platform.lower(): 1534 | - # no c extension for jython 1535 | - ext = None 1536 | + - The macros ``EXT_PACKAGE`` and ``EXT_MODULE`` will be filled (or 1537 | + unset) depending on the extensions name, but only if they are not 1538 | + already defined. 1539 | + 1540 | + - "." is added to the include directories (for cext.h) 1541 | + 1542 | + :Parameters: 1543 | + `ext` : `Extension` 1544 | + The extension to build 1545 | + 1546 | + :Return: whatever ``distutils.command.build_ext.build_ext`` returns 1547 | + :Rtype: any 1548 | + """ 1549 | + # handle name macros 1550 | + macros = dict(ext.define_macros or ()) 1551 | + tup = ext.name.split('.') 1552 | + if len(tup) == 1: 1553 | + pkg, mod = None, tup[0] 1554 | + else: 1555 | + pkg, mod = '.'.join(tup[:-1]), tup[-1] 1556 | + if pkg is not None and 'EXT_PACKAGE' not in macros: 1557 | + ext.define_macros.append(('EXT_PACKAGE', pkg)) 1558 | + if 'EXT_MODULE' not in macros: 1559 | + ext.define_macros.append(('EXT_MODULE', mod)) 1560 | + if pkg is None: 1561 | + macros = dict(ext.undef_macros or ()) 1562 | + if 'EXT_PACKAGE' not in macros: 1563 | + ext.undef_macros.append('EXT_PACKAGE') 1564 | + 1565 | + import pprint; pprint.pprint(ext.__dict__) 1566 | + try: 1567 | + return _build_ext.build_ext.build_extension(self, ext) 1568 | + except (_errors.CCompilerError, _errors.DistutilsExecError, 1569 | + _errors.DistutilsPlatformError, IOError, ValueError): 1570 | + raise BuildFailed() 1571 | + 1572 | + 1573 | +class Extension(_setuptools.Extension): 1574 | + """ improved functionality """ 1575 | + 1576 | + def __init__(self, *args, **kwargs): 1577 | + """ Initialization """ 1578 | + version = kwargs.pop('version') 1579 | + self.depends = [] 1580 | + if 'depends' in kwargs: 1581 | + self.depends = kwargs['depends'] 1582 | + _setuptools.Extension.__init__(self, *args, **kwargs) 1583 | + self.define_macros.append(('EXT_VERSION', version)) 1584 | + 1585 | + # add include path 1586 | + included = '.' 1587 | + if included not in self.include_dirs: 1588 | + self.include_dirs.append(included) 1589 | + 1590 | + # add cext.h to the dependencies 1591 | + cext_h = _posixpath.normpath(_posixpath.join(included, 'cext.h')) 1592 | + for item in self.depends: 1593 | + if _posixpath.normpath(item) == cext_h: 1594 | + break 1595 | + else: 1596 | + self.depends.append(cext_h) 1597 | + 1598 | + 1599 | +EXTENSIONS = lambda v: [Extension('_rjsmin', ["rjsmin.c"], version=v)] 1600 | + 1601 | + 1602 | +def do_setup(cext): 1603 | + """ Main """ 1604 | + # pylint: disable = too-many-branches 1605 | + # pylint: disable = unspecified-encoding 1606 | + 1607 | + args = {} if str is bytes else dict(encoding='utf-8') 1608 | + version_file = '%s/%s' % (package['pathname'], 1609 | + package.get('version_file', '__init__.py')) 1610 | + with open(version_file, **args) as fp: 1611 | + for line in fp: # pylint: disable = redefined-outer-name 1612 | + if line.startswith('__version__'): 1613 | + version = line.split('=', 1)[1].strip() 1614 | + if version.startswith(("'", '"')): 1615 | + version = version[1:-1].strip() 1616 | + break 1617 | + else: 1618 | + raise RuntimeError("Version not found") 1619 | + 1620 | + kwargs = {} 1621 | + 1622 | + if not cext or 'java' in _sys.platform.lower(): 1623 | + extensions = [] 1624 | else: 1625 | - ext=[Extension('_rjsmin', sources=['rjsmin.c'])] 1626 | + extensions = EXTENSIONS(version) 1627 | + 1628 | + if extensions: 1629 | + if 'build_ext' in globals(): 1630 | + kwargs.setdefault('cmdclass', {})['build_ext'] = build_ext 1631 | + kwargs['ext_modules'] = extensions 1632 | + 1633 | + cflags = None 1634 | + if _os.environ.get('CFLAGS') is None: 1635 | + from distutils import ccompiler as _ccompiler 1636 | + 1637 | + compiler = _ccompiler.get_default_compiler() 1638 | + try: 1639 | + with open("debug.%s.cflags" % compiler) as fp: 1640 | + cflags = ' '.join([ 1641 | + line for line in (line.strip() for line in fp) 1642 | + if line and not line.startswith('#') 1643 | + ]).split() or None 1644 | + except IOError: 1645 | + pass 1646 | + 1647 | + if cflags: 1648 | + gcov = 'coverage' in ' '.join(cflags) 1649 | + for ext in extensions: 1650 | + # pylint: disable = attribute-defined-outside-init 1651 | + ext.extra_compile_args = \ 1652 | + getattr(ext, 'extra_compile_args', []) + cflags 1653 | + if gcov: 1654 | + ext.libraries.append('gcov') 1655 | + 1656 | + 1657 | + if package.get('packages', True): 1658 | + kwargs['packages'] = [package['top']] + [ 1659 | + '%s.%s' % (package['top'], item) 1660 | + for item in 1661 | + _setuptools.find_packages(package['pathname']) 1662 | + ] 1663 | + if package.get('py_modules'): 1664 | + kwargs['py_modules'] = package['py_modules'] 1665 | 1666 | - return run(script_args=args, ext=ext, manifest_only=_manifest) 1667 | + _setuptools.setup( 1668 | + name=package['name'], 1669 | + author=package['author'], 1670 | + author_email=package['email'], 1671 | + license=package['license'], 1672 | + classifiers=package['classifiers'], 1673 | + description=package['desc'], 1674 | + long_description=package['longdesc'], 1675 | + url=package['url'], 1676 | + install_requires=package['install_requires'], 1677 | + version=version, 1678 | + zip_safe=False, 1679 | + **kwargs 1680 | + ) 1681 | 1682 | 1683 | -def manifest(): 1684 | - """ Create List of packaged files """ 1685 | - return setup((), _manifest=1) 1686 | +def setup(): 1687 | + """ Run setup """ 1688 | + try: 1689 | + do_setup(True) 1690 | + except BuildFailed: 1691 | + env = 'SETUP_CEXT_REQUIRED' 1692 | + if _os.environ.get(env, '') not in ('', '0'): 1693 | + raise 1694 | + print("C extension build failed - building python only version now. " 1695 | + "Set '%s' environment variable to '1' to make it fail." 1696 | + % (env,), file=_sys.stderr) 1697 | + do_setup(False) 1698 | 1699 | 1700 | if __name__ == '__main__': 1701 | -------------------------------------------------------------------------------- /moc_name.patch: -------------------------------------------------------------------------------- 1 | --- a/ui/qt/moc_wrapper.py 2 | +++ b/ui/qt/moc_wrapper.py 3 | @@ -7,4 +7,4 @@ import subprocess 4 | import sys 5 | 6 | 7 | -subprocess.check_call(["moc", sys.argv[1], "-o", sys.argv[2]]) 8 | +subprocess.check_call(["moc-qt5", sys.argv[1], "-o", sys.argv[2]]) 9 | -------------------------------------------------------------------------------- /noautobuild: -------------------------------------------------------------------------------- 1 | # No need for mass rebuild here 2 | -------------------------------------------------------------------------------- /sources: -------------------------------------------------------------------------------- 1 | SHA512 (chromium-patches-chromium-111-patchset-2.tar.gz) = 0387d1725b7f186bd4f007f747e349bb82c534a2a44ca96450173c35f7a5efbecf2e79972d842f44e09c4c4065e400e7ea94a6f0ab78427ff8c9745e6aa20b4d 2 | SHA512 (chromium-111.0.5563.110.tar.xz) = 1274b14ef9b1eb418a87589979703731eb4907a90eb8ea58f343344f1e6c2bee1c88b3cb290485c833c0bda79a7c8ae59ba425c492e8738d19740cb0514e8ac5 3 | --------------------------------------------------------------------------------