diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2021-09-16 22:05:01 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2021-09-16 22:05:01 +0100 |
commit | cc4618c9ba3d974948ebf340b542d8cb01db2f55 (patch) | |
tree | 125ee67bb9e0d548771cf7b61d04bb1f0dc57687 /www-client/chromium/files | |
parent | 677b7ba5c317778df2ad7e70df94b9b7eec4adbc (diff) |
gentoo resync : 16.09.2021
Diffstat (limited to 'www-client/chromium/files')
-rw-r--r-- | www-client/chromium/files/chromium-93-fix-build-with-system-ffmpeg.patch | 85 | ||||
-rw-r--r-- | www-client/chromium/files/chromium-launcher-r7.sh | 59 |
2 files changed, 144 insertions, 0 deletions
diff --git a/www-client/chromium/files/chromium-93-fix-build-with-system-ffmpeg.patch b/www-client/chromium/files/chromium-93-fix-build-with-system-ffmpeg.patch new file mode 100644 index 000000000000..c19066837192 --- /dev/null +++ b/www-client/chromium/files/chromium-93-fix-build-with-system-ffmpeg.patch @@ -0,0 +1,85 @@ +From: 52c3e9c0f140a8742034e107fb0f371c0d73bf1d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Beh=C3=BAn?= <kabel@kernel.org> +Date: Sun, 12 Sep 2021 04:20:11 +0200 +Subject: [PATCH] chromium-93: fix building with system-ffmpeg +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The version of ffmpeg bundled in Chromium changed ABI a little, which +affected the code in that the type of the last parameter of +av_packet_get_side_data() is now size_t instead of int. + +This causes Chromium to fail to build with system-ffmpeg if the system +ffmpeg's version does not yet have this ABI change. + +Fix the code to be able to compile with older ffmpeg as well. + +Signed-off-by: Marek BehĂșn <kabel@kernel.org> +--- + media/filters/audio_decoder_unittest.cc | 4 ++++ + media/filters/ffmpeg_demuxer.cc | 16 ++++++++++++++++ + 2 files changed, 20 insertions(+) + +diff --git a/media/filters/audio_decoder_unittest.cc b/media/filters/audio_decoder_unittest.cc +--- a/media/filters/audio_decoder_unittest.cc ++++ b/media/filters/audio_decoder_unittest.cc +@@ -109,7 +109,11 @@ void SetDiscardPadding(AVPacket* packet, + } + + // If the timestamp is positive, try to use FFmpeg's discard data. ++#if LIBAVUTIL_VERSION_MAJOR < 57 ++ int skip_samples_size = 0; ++#else + size_t skip_samples_size = 0; ++#endif + const uint32_t* skip_samples_ptr = + reinterpret_cast<const uint32_t*>(av_packet_get_side_data( + packet, AV_PKT_DATA_SKIP_SAMPLES, &skip_samples_size)); +diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc +--- a/media/filters/ffmpeg_demuxer.cc ++++ b/media/filters/ffmpeg_demuxer.cc +@@ -427,11 +427,19 @@ void FFmpegDemuxerStream::EnqueuePacket( + scoped_refptr<DecoderBuffer> buffer; + + if (type() == DemuxerStream::TEXT) { ++#if LIBAVUTIL_VERSION_MAJOR < 57 ++ int id_size = 0; ++#else + size_t id_size = 0; ++#endif + uint8_t* id_data = av_packet_get_side_data( + packet.get(), AV_PKT_DATA_WEBVTT_IDENTIFIER, &id_size); + ++#if LIBAVUTIL_VERSION_MAJOR < 57 ++ int settings_size = 0; ++#else + size_t settings_size = 0; ++#endif + uint8_t* settings_data = av_packet_get_side_data( + packet.get(), AV_PKT_DATA_WEBVTT_SETTINGS, &settings_size); + +@@ -443,7 +451,11 @@ void FFmpegDemuxerStream::EnqueuePacket( + buffer = DecoderBuffer::CopyFrom(packet->data, packet->size, + side_data.data(), side_data.size()); + } else { ++#if LIBAVUTIL_VERSION_MAJOR < 57 ++ int side_data_size = 0; ++#else + size_t side_data_size = 0; ++#endif + uint8_t* side_data = av_packet_get_side_data( + packet.get(), AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, &side_data_size); + +@@ -504,7 +516,11 @@ void FFmpegDemuxerStream::EnqueuePacket( + packet->size - data_offset); + } + ++#if LIBAVUTIL_VERSION_MAJOR < 57 ++ int skip_samples_size = 0; ++#else + size_t skip_samples_size = 0; ++#endif + const uint32_t* skip_samples_ptr = + reinterpret_cast<const uint32_t*>(av_packet_get_side_data( + packet.get(), AV_PKT_DATA_SKIP_SAMPLES, &skip_samples_size)); diff --git a/www-client/chromium/files/chromium-launcher-r7.sh b/www-client/chromium/files/chromium-launcher-r7.sh new file mode 100644 index 000000000000..1163ff3ddc09 --- /dev/null +++ b/www-client/chromium/files/chromium-launcher-r7.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +# Allow the user to override command-line flags, bug #357629. +# This is based on Debian's chromium-browser package, and is intended +# to be consistent with Debian. +for f in /etc/chromium/*; do + [[ -f ${f} ]] && source "${f}" +done + +# Prefer user defined CHROMIUM_USER_FLAGS (from env) over system +# default CHROMIUM_FLAGS (from /etc/chromium/default). +CHROMIUM_FLAGS=${CHROMIUM_USER_FLAGS:-"$CHROMIUM_FLAGS"} + +# Let the wrapped binary know that it has been run through the wrapper +export CHROME_WRAPPER=$(readlink -f "$0") + +PROGDIR=${CHROME_WRAPPER%/*} + +case ":$PATH:" in + *:$PROGDIR:*) + # $PATH already contains $PROGDIR + ;; + *) + # Append $PROGDIR to $PATH + export PATH="$PATH:$PROGDIR" + ;; +esac + +if [[ ${EUID} == 0 && -O ${XDG_CONFIG_HOME:-${HOME}} ]]; then + # Running as root with HOME owned by root. + # Pass --user-data-dir to work around upstream failsafe. + CHROMIUM_FLAGS="--user-data-dir=${XDG_CONFIG_HOME:-${HOME}/.config}/chromium + ${CHROMIUM_FLAGS}" +fi + +# Select session type and platform +if @@OZONE_AUTO_SESSION@@; then + platform= + if [[ ${XDG_SESSION_TYPE} == x11 ]]; then + platform=x11 + elif [[ ${XDG_SESSION_TYPE} == wayland ]]; then + platform=wayland + else + if [[ -n ${WAYLAND_DISPLAY} ]]; then + platform=wayland + else + platform=x11 + fi + fi + if ${DISABLE_OZONE_PLATFORM:-false}; then + platform=x11 + fi + CHROMIUM_FLAGS="--ozone-platform=${platform} ${CHROMIUM_FLAGS}" +fi + +# Set the .desktop file name +export CHROME_DESKTOP="chromium-browser-chromium.desktop" + +exec -a "chromium-browser" "$PROGDIR/chrome" --extra-plugin-dir=/usr/lib/nsbrowser/plugins ${CHROMIUM_FLAGS} "$@" |