[dwarffortress] Rebuild for glew 2.1.0
by Sérgio M. Basto
commit 88101da6bb2f3f5d4bd3dc46f410809362717810
Author: Sérgio M. Basto <sergio(a)serjux.com>
Date: Sun Sep 30 03:00:54 2018 +0100
Rebuild for glew 2.1.0
dwarffortress.spec | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/dwarffortress.spec b/dwarffortress.spec
index ff3850b..4526e0f 100644
--- a/dwarffortress.spec
+++ b/dwarffortress.spec
@@ -5,7 +5,7 @@
Name: dwarffortress
Version: 0.44.12
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: A single-player procedurally generated fantasy game
@@ -140,6 +140,9 @@ appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/appdata/*.appdata
%{_datadir}/appdata/dwarffortress.appdata.xml
%changelog
+* Sun Sep 30 2018 Sérgio Basto <sergio(a)serjux.com> - 0.44.12-2
+- Rebuild for glew 2.1.0
+
* Thu Aug 09 2018 Ben Rosser <rosser.bjr(a)gmail.com> - 0.44.12-1
- Updated to latest upstream release.
6 years, 1 month
[xorg-x11-drv-nvidia] Add isa to vulkan-loader requires
by Leigh Scott
commit f4932986fc1fd52a6ba1123b724a6849595df52a
Author: leigh123linux <leigh123linux(a)googlemail.com>
Date: Sun Sep 30 00:20:36 2018 +0100
Add isa to vulkan-loader requires
xorg-x11-drv-nvidia.spec | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/xorg-x11-drv-nvidia.spec b/xorg-x11-drv-nvidia.spec
index e6dabab..dc9f07f 100644
--- a/xorg-x11-drv-nvidia.spec
+++ b/xorg-x11-drv-nvidia.spec
@@ -156,7 +156,7 @@ Requires: mesa-libGLES%{?_isa} >= 13.0.3-3
%if 0%{?rhel}
Requires: vulkan-filesystem
%else
-Requires: vulkan-loader
+Requires: vulkan-loader%{?_isa}
%ifarch x86_64
# Boolean dependencies are only fedora
Requires: (%{name}-libs(x86-32) = %{?epoch}:%{version}-%{release} if libGL(x86-32))
6 years, 1 month
[xorg-x11-drv-nvidia] Add epoch to nvidia-modprobe and nvidia-xconfig requires
by Leigh Scott
commit 691d7f9c447de472e3b669fee6c1a7abd646cb32
Author: leigh123linux <leigh123linux(a)googlemail.com>
Date: Sat Sep 29 17:14:37 2018 +0100
Add epoch to nvidia-modprobe and nvidia-xconfig requires
xorg-x11-drv-nvidia.spec | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/xorg-x11-drv-nvidia.spec b/xorg-x11-drv-nvidia.spec
index e49ad5f..e6dabab 100644
--- a/xorg-x11-drv-nvidia.spec
+++ b/xorg-x11-drv-nvidia.spec
@@ -21,7 +21,7 @@
Name: xorg-x11-drv-nvidia
Epoch: 3
Version: 410.57
-Release: 4%{?dist}
+Release: 5%{?dist}
Summary: NVIDIA's proprietary display driver for NVIDIA graphic cards
License: Redistributable, no modification permitted
@@ -58,9 +58,9 @@ Requires(post): grubby
Requires: which
Requires: nvidia-settings%{?_isa} = %{?epoch}:%{version}
%if 0%{?fedora}
-Suggests: nvidia-xconfig%{?_isa} = %{version}
+Suggests: nvidia-xconfig%{?_isa} = %{?epoch}:%{version}
%else
-Requires: nvidia-xconfig%{?_isa} = %{version}
+Requires: nvidia-xconfig%{?_isa} = %{?epoch}:%{version}
%endif
Requires: %{_nvidia_serie}-kmod >= %{?epoch}:%{version}
@@ -107,11 +107,11 @@ Requires: %{_nvidia_serie}-kmod >= %{?epoch}:%{version}
Requires: %{name}-cuda-libs%{?_isa} = %{?epoch}:%{version}-%{release}
Requires: nvidia-persistenced%{?_isa} = %{?epoch}:%{version}
%if 0%{?fedora}
-Suggests: nvidia-modprobe%{?_isa} = %{version}
+Suggests: nvidia-modprobe%{?_isa} = %{?epoch}:%{version}
# Boolean dependencies are only fedora
Requires: (%{name}-cuda-libs(x86-32) = %{?epoch}:%{version}-%{release} if libGL(x86-32))
%else
-Requires: nvidia-modprobe%{?_isa} = %{version}
+Requires: nvidia-modprobe%{?_isa} = %{?epoch}:%{version}
%endif
Requires: ocl-icd%{?_isa}
Requires: opencl-filesystem
@@ -476,12 +476,15 @@ fi ||:
%{_libdir}/libnvidia-encode.so
%changelog
+* Sat Sep 29 2018 Leigh Scott <leigh123linux(a)googlemail.com> - 3:410.57-5
+- Add epoch to nvidia-modprobe and nvidia-xconfig requires
+
* Sun Sep 23 2018 Leigh Scott <leigh123linux(a)googlemail.com> - 3:410.57-4
- Add new raytracing libs
- Move the new glx server lib to it's correct location
* Fri Sep 21 2018 Leigh Scott <leigh123linux(a)googlemail.com> - 3:410.57-3
-- Add epoch to for nvidia-settings requires
+- Add epoch to nvidia-settings requires
* Thu Sep 20 2018 Leigh Scott <leigh123linux(a)googlemail.com> - 3:410.57-2
- Filter libglxserver_nvidia.so requires on main
6 years, 1 month
[nvidia-modprobe] Match the cuda repo epoch
by Leigh Scott
commit bb20c039faa6ba33b036f3a85436a96b6bc9eea3
Author: leigh123linux <leigh123linux(a)googlemail.com>
Date: Sat Sep 29 17:09:31 2018 +0100
Match the cuda repo epoch
nvidia-modprobe.spec | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/nvidia-modprobe.spec b/nvidia-modprobe.spec
index cd91064..9725aa2 100644
--- a/nvidia-modprobe.spec
+++ b/nvidia-modprobe.spec
@@ -1,6 +1,7 @@
Name: nvidia-modprobe
+Epoch: 3
Version: 410.57
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Load the NVIDIA kernel module and create NVIDIA character device files
License: MIT and GPLv2+
@@ -41,6 +42,9 @@ chmod -x %{buildroot}%{_mandir}/man1/nvidia-modprobe.1.*
%changelog
+* Sat Sep 29 2018 Leigh Scott <leigh123linux(a)googlemail.com> - 3:410.57-2
+- Match the cuda repo epoch
+
* Thu Sep 20 2018 Leigh Scott <leigh123linux(a)googlemail.com> - 410.57-1
- Update to 410.57 beta
6 years, 1 month
[nvidia-xconfig] Match the cuda repo epoch
by Leigh Scott
commit 84cefb8343236c3de9f90afe061dde80c4b0b2b0
Author: leigh123linux <leigh123linux(a)googlemail.com>
Date: Sat Sep 29 10:36:24 2018 +0100
Match the cuda repo epoch
nvidia-xconfig.spec | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/nvidia-xconfig.spec b/nvidia-xconfig.spec
index 5a12b01..cc4ef55 100644
--- a/nvidia-xconfig.spec
+++ b/nvidia-xconfig.spec
@@ -1,6 +1,7 @@
Name: nvidia-xconfig
+Epoch: 3
Version: 410.57
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: NVIDIA X configuration file editor
License: GPLv2+
@@ -48,6 +49,9 @@ mkdir -p %{buildroot}%{_sbindir}
%changelog
+* Sat Sep 29 2018 Leigh Scott <leigh123linux(a)googlemail.com> - 3:410.57-2
+- Match the cuda repo epoch
+
* Thu Sep 20 2018 Leigh Scott <leigh123linux(a)googlemail.com> - 410.57-1
- Update to 410.57 beta
6 years, 1 month
[chromium-vaapi/f29] Remove dependency on minizip-compat package(https://bugzilla.redhat.com/show_bug.cgi?id=1632170) Add
by hellbanger
commit 40af32839f5f42c3e596bb5568fb5a38c8feb0ce
Author: Akarshan Biswas <hellbanger(a)ga-lmt-s2.biswasab.org>
Date: Sat Sep 29 14:37:41 2018 +0530
Remove dependency on minizip-compat package(https://bugzilla.redhat.com/show_bug.cgi?id=1632170)
Add conditions to build with{out} system minizip
.gitignore | 1 +
LICENSE | 29 +++
chromium-vaapi.appdata.xml | 37 +++
chromium-vaapi.sh | 60 +++++
chromium-vaapi.spec | 598 +++++++++++++++++++++++++++++++++++++++++++++
py2-bootstrap.patch | 33 +++
sources | 1 +
unrar.patch | 186 ++++++++++++++
vaapi.patch | 542 ++++++++++++++++++++++++++++++++++++++++
widevine.patch | 23 ++
10 files changed, 1510 insertions(+)
---
diff --git a/.gitignore b/.gitignore
index e69de29..6317544 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/chromium-69.0.3497.100.tar.xz
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..1c5664f
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,29 @@
+BSD 3-Clause License
+
+Copyright (c) 2018, Akarshan Biswas
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+* Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/chromium-vaapi.appdata.xml b/chromium-vaapi.appdata.xml
new file mode 100644
index 0000000..a2b2064
--- /dev/null
+++ b/chromium-vaapi.appdata.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Referenced from https://www.freedesktop.org/software/appstream/docs/chap-Quickstart.html#... -->
+<component type="desktop">
+ <id>chromium-vaapi.desktop</id>
+ <update_contact> chromium-vaapi-owner(a)rpmfusion.org</update_contact>
+ <metadata_license>CC0-1.0</metadata_license>
+ <project_license>BSD-3-Clause and LGPL-2.1+ and Apache-2.0 and IJG and MIT and GPL-2.0+ and ISC and OpenSSL and (MPL-1.1 or GPL-2.0 or LGPL-2.0)</project_license>
+ <name>chromium-vaapi</name>
+ <summary>Web Browser</summary>
+ <description>
+ <p>
+ Chromium-vaapi is an open-source browser based on webkit(blink).
+ This build of chromium comes with video decoding acceleration enabled through libva vaapi.
+ Chromium browser with hardware video decoding will not only increase the battery by minimising the power consumption but also enable 4K video ( if supported ) on weaker systems. Installing this build requires vaapi driver to be installed on the system. check with vainfo. Compare CPU usages of both enabled and disabled state.
+ </p>
+ <p>
+ Video acceleration may or may not work on Nvidia GPUs because of no support of vaapi. Only Intel and amdgpus are supported at the moment. If chromium gives an error, try checking your gpu by running vainfo.
+Nvidia's open source Nouveau driver might work(with firmware from the binary driver) but it may crash.
+ Please look at the logs in chrome://gpu.
+Sometimes "Video Decode" in the "Graphics Feature Status" maybe misleading, Please look at "Video Acceleration Information" section.
+ </p>
+ </description>
+ <url type="homepage">https://www.chromium.org/Home</url>
+ <screenshots>
+ <screenshot type="default">
+ <caption>The main window</caption>
+ <image>https://gitlab.com/biswasab/Project-screenshots/raw/master/a.png</image>
+ </screenshot>
+ <screenshot>
+ <caption>The chrome://gpu page</caption>
+ <image>https://gitlab.com/biswasab/Project-screenshots/raw/master/b.png</image>
+ </screenshot>
+ </screenshots>
+ <developer_name>Google</developer_name>
+ <url type="bugtracker">https://bugzilla.rpmfusion.org</url>
+ <url type="help">https://chromium.googlesource.com/chromium/src/+/master/docs/linux_debugg...</url>
+</component>
diff --git a/chromium-vaapi.sh b/chromium-vaapi.sh
new file mode 100644
index 0000000..77a0027
--- /dev/null
+++ b/chromium-vaapi.sh
@@ -0,0 +1,60 @@
+#!/bin/bash
+#
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# This file is obtained from https://src.fedoraproject.org/rpms/chromium/
+# and modified by Akarshan Biswas <akarshan.biswas(a)hotmail.com. All modifications are also
+# licensed under 3-clause BSD license.
+
+# Let the wrapped binary know that it has been run through the wrapper.
+export CHROME_WRAPPER="$(readlink -f "$0")"
+
+HERE="`dirname "$CHROME_WRAPPER"`"
+export CHROME_DESKTOP="chromium-vaapi.desktop"
+# We include some xdg utilities next to the binary, and we want to prefer them
+# over the system versions when we know the system versions are very old. We
+# detect whether the system xdg utilities are sufficiently new to be likely to
+# work for us by looking for xdg-settings. If we find it, we leave $PATH alone,
+# so that the system xdg utilities (including any distro patches) will be used.
+if ! which xdg-settings &> /dev/null; then
+ # Old xdg utilities. Prepend $HERE to $PATH to use ours instead.
+ export PATH="$HERE:$PATH"
+else
+ # Use system xdg utilities. But first create mimeapps.list if it doesn't
+ # exist; some systems have bugs in xdg-mime that make it fail without it.
+ xdg_app_dir="${XDG_DATA_HOME:-$HOME/.local/share/applications}"
+ mkdir -p "$xdg_app_dir"
+ [ -f "$xdg_app_dir/mimeapps.list" ] || touch "$xdg_app_dir/mimeapps.list"
+fi
+
+# Always use our versions of ffmpeg libs.
+# This also makes RPMs find the compatibly-named library symlinks.
+if [[ -n "$LD_LIBRARY_PATH" ]]; then
+ LD_LIBRARY_PATH="$HERE:$HERE/lib:$LD_LIBRARY_PATH"
+else
+ LD_LIBRARY_PATH="$HERE:$HERE/lib"
+fi
+export LD_LIBRARY_PATH
+
+# Sanitize std{in,out,err} because they'll be shared with untrusted child
+# processes (http://crbug.com/376567).
+exec < /dev/null
+exec > >(exec cat)
+exec 2> >(exec cat >&2)
+
+export CHROME_VERSION_EXTRA="Built from source for @@BUILDTARGET@@"
+
+CHROMIUM_DISTRO_FLAGS=" --enable-plugins \
+ --enable-extensions \
+ --enable-user-scripts \
+ --enable-printing \
+ --enable-accelerated-video \
+ --enable-native-gpu-memory-buffers \
+ --enable-accelerated-mjpeg-decode \
+ --enable-gpu-rasterization \
+ --disable-gpu-driver-bug-workarounds \
+ --enable-sync"
+
+exec -a "$0" "@@CHROMIUMDIR@@/$(basename "$0" | sed 's/\.sh$//')" $CHROMIUM_DISTRO_FLAGS "$@"
diff --git a/chromium-vaapi.spec b/chromium-vaapi.spec
new file mode 100644
index 0000000..f2d300b
--- /dev/null
+++ b/chromium-vaapi.spec
@@ -0,0 +1,598 @@
+# This spec file is based on other spec files, ebuilds, PKGBUILDs available from
+# [1] https://repos.fedorapeople.org/repos/spot/chromium/
+# [2] https://copr.fedoraproject.org/coprs/churchyard/chromium-russianfedora-te...
+# [3] https://www.archlinux.org/packages/extra/x86_64/chromium/
+# [4] https://src.fedoraproject.org/rpms/chromium/
+# [5] https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/chromium/
+# [6] https://copr.fedorainfracloud.org/coprs/lantw44/chromium/
+# Get the version number of latest stable version
+# $ curl -s 'https://omahaproxy.appspot.com/all?os=linux&channel=stable' | sed 1d | cut -d , -f 3
+######################################################################################################################
+#Global Libraries
+#Do not turn it on in Fedora copr!
+%global freeworld 1
+#This can be any folder on out
+%global target out/Release
+#Our installation folder
+%global chromiumdir %{_libdir}/chromium-vaapi
+### Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
+### Note: These are for Fedora use ONLY.
+### For your own distribution, please get your own set of keys.
+### http://lists.debian.org/debian-legal/2013/11/msg00006.html
+%global api_key AIzaSyDUIXvzVrt5OkVsgXhQ6NFfvWlA44by-aw
+%global default_client_id 449907151817.apps.googleusercontent.com
+%global default_client_secret miEreAep8nuvTdvLums6qyLK
+###############################Exclude Private chromium libs###########################
+%global __requires_exclude %{chromiumdir}/.*\\.so
+%global __provides_exclude_from %{chromiumdir}/.*\\.so
+#######################################CONFIGS###########################################
+# Require harfbuzz >= 1.5.0 for hb_glyph_info_t
+%if 0%{?fedora} >= 28
+%bcond_without system_harfbuzz
+%else
+%bcond_with system_harfbuzz
+%endif
+# Require libxml2 > 2.9.4 for XML_PARSE_NOXXE
+%bcond_without system_libxml2
+
+# https://github.com/dabeaz/ply/issues/66
+%bcond_without system_ply
+
+# Allow testing whether icu can be unbundled
+%bcond_with system_libicu
+# Allow testing whether libvpx can be unbundled
+%bcond_with system_libvpx
+#Allow minizip to be unbundled
+#mini-compat is going to be removed from fedora 30!
+%if 0%{?fedora} >= 30
+%bcond_with system_minizip
+%else
+%bcond_without system_minizip
+%endif
+#Turn on verbose mode
+%global debug_logs 1
+#Build debug packages for debugging
+%global debug_pkg 1
+# Allow compiling with clang
+%global clang 0
+#Allow building with Fedora compilation flags
+%global fedora_compilation_flags 1
+##############################Package Definitions######################################
+Name: chromium-vaapi
+Version: 69.0.3497.100
+Release: 3%{?dist}
+Summary: A Chromium web browser with video decoding acceleration
+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)
+URL: https://www.chromium.org/Home
+%if %{freeworld}
+Source0: https://commondatastorage.googleapis.com/chromium-browser-official/chromi...
+%else
+Source0: chromium-%{version}-clean.tar.xz
+%endif
+# The following two source files are copied and modified from the chromium source
+Source10: %{name}.sh
+#Add our own appdata file. ##TODO
+Source11: %{name}.appdata.xml
+#Personal stuff
+Source15: LICENSE
+#Video acceleration patch from https://chromium-review.googlesource.com/c/chromium/src/+/532294
+Patch1: vaapi.patch
+Patch2: widevine.patch
+%if %{clang}
+#Will use any clang patch here
+#Fix breaking builds caused by gcc_ar_wrapper.py from upstream
+Patch7: llvm-arflags.patch
+%else
+#Gcc patches area.
+%endif
+#More patches to fix chromium build here
+#remove dependency on unrar. That's a nasty code.
+Patch50: unrar.patch
+#Bootstrap still uses python command
+Patch51: py2-bootstrap.patch
+#This build should be only available to amd64
+ExclusiveArch: x86_64
+########################################################################################
+#Compiler settings
+%if %{clang}
+BuildRequires: clang, llvm, lld
+%else
+#GCC mode on
+# Make sure we don't encounter any bug
+BuildRequires: gcc
+BuildRequires: gcc-c++
+%endif
+# Basic tools and libraries needed for building
+BuildRequires: ninja-build, nodejs, bison, gperf, hwdata
+BuildRequires: libgcc, glibc, libatomic, libstdc++-static
+BuildRequires: libcap-devel, cups-devel, alsa-lib-devel
+BuildRequires: mesa-libGL-devel, mesa-libEGL-devel
+%if %{with system_minizip}
+BuildRequires: minizip-devel
+%endif
+BuildRequires: pkgconfig(gtk+-2.0), pkgconfig(gtk+-3.0)
+BuildRequires: pkgconfig(libexif), pkgconfig(nss)
+BuildRequires: pkgconfig(xtst), pkgconfig(xscrnsaver)
+BuildRequires: pkgconfig(dbus-1), pkgconfig(libudev)
+BuildRequires: pkgconfig(gnome-keyring-1)
+BuildRequires: pkgconfig(libffi)
+# remove_bundled_libraries.py --do-remove
+BuildRequires: python2-rpm-macros
+BuildRequires: python2-beautifulsoup4
+BuildRequires: python2-html5lib
+BuildRequires: python2-markupsafe
+%if %{with system_ply}
+BuildRequires: python2-ply
+%endif
+# replace_gn_files.py --system-libraries
+BuildRequires: flac-devel
+BuildRequires: freetype-devel
+%if %{with system_harfbuzz}
+BuildRequires: harfbuzz-devel
+%endif
+%if %{with system_libicu}
+BuildRequires: libicu-devel
+%endif
+BuildRequires: libdrm-devel
+BuildRequires: libjpeg-turbo-devel
+BuildRequires: libpng-devel
+# Chromium requires libvpx 1.5.0 and some non-default options
+%if %{with system_libvpx}
+BuildRequires: libvpx-devel
+%endif
+BuildRequires: libwebp-devel
+%if %{with system_libxml2}
+BuildRequires: pkgconfig(libxml-2.0)
+%endif
+BuildRequires: pkgconfig(libxslt)
+BuildRequires: opus-devel
+BuildRequires: re2-devel
+BuildRequires: snappy-devel
+BuildRequires: yasm
+BuildRequires: pciutils-devel
+BuildRequires: speech-dispatcher-devel
+BuildRequires: pulseaudio-libs-devel
+# install desktop files
+BuildRequires: desktop-file-utils
+# install AppData files
+BuildRequires: libappstream-glib
+#for vaapi
+BuildRequires: libva-devel
+#Runtime Requirements
+Requires: hicolor-icon-theme
+#Some recommendations
+Recommends: libva-intel-hybrid-driver%{?_isa}
+Recommends: libva-intel-driver%{?_isa}
+%if !%{debug_pkg}
+%global debug_package %{nil}
+%endif
+%description
+chromium-vaapi is an open-source web browser, powered by WebKit (Blink)
+############################################PREP###########################################################
+%prep
+%autosetup -n chromium-%{version} -p1
+#Let's change the default shebang of python files.
+find -depth -type f -name "*.py" -exec sed -iE '1s=^#! */usr/bin/\(python\|env python\)[23]\?=#!%{__python2}=' {} +
+./build/linux/unbundle/remove_bundled_libraries.py --do-remove \
+ base/third_party/dmg_fp \
+ base/third_party/dynamic_annotations \
+ base/third_party/icu \
+ base/third_party/libevent \
+ base/third_party/nspr \
+ base/third_party/superfasthash \
+ base/third_party/symbolize \
+ base/third_party/valgrind \
+ base/third_party/xdg_mime \
+ base/third_party/xdg_user_dirs \
+ buildtools/third_party/libc++ \
+ buildtools/third_party/libc++abi \
+ chrome/third_party/mozilla_security_manager \
+ courgette/third_party \
+ native_client/src/third_party/dlmalloc \
+ native_client/src/third_party/valgrind \
+ net/third_party/http2 \
+ net/third_party/mozilla_security_manager \
+ net/third_party/nss \
+ net/third_party/quic \
+ net/third_party/spdy \
+ third_party/abseil-cpp \
+ third_party/adobe \
+ third_party/analytics \
+ third_party/angle \
+ third_party/angle/src/common/third_party/base \
+ third_party/angle/src/common/third_party/smhasher \
+ third_party/angle/src/third_party/compiler \
+ third_party/angle/src/third_party/libXNVCtrl \
+ third_party/angle/src/third_party/trace_event \
+ third_party/angle/third_party/glslang \
+ third_party/angle/third_party/spirv-headers \
+ third_party/angle/third_party/spirv-tools \
+ third_party/angle/third_party/vulkan-headers \
+ third_party/angle/third_party/vulkan-loader \
+ third_party/angle/third_party/vulkan-tools \
+ third_party/angle/third_party/vulkan-validation-layers \
+ third_party/apple_apsl \
+ third_party/boringssl \
+ third_party/boringssl/src/third_party/fiat \
+ third_party/blink \
+ third_party/breakpad \
+ third_party/breakpad/breakpad/src/third_party/curl \
+ third_party/brotli \
+ third_party/cacheinvalidation \
+ third_party/catapult \
+ third_party/catapult/common/py_vulcanize/third_party/rcssmin \
+ third_party/catapult/common/py_vulcanize/third_party/rjsmin \
+ third_party/catapult/third_party/polymer \
+ third_party/catapult/tracing/third_party/d3 \
+ third_party/catapult/tracing/third_party/gl-matrix \
+ third_party/catapult/tracing/third_party/jszip \
+ third_party/catapult/tracing/third_party/mannwhitneyu \
+ third_party/catapult/tracing/third_party/oboe \
+ third_party/catapult/tracing/third_party/pako \
+ third_party/ced \
+ third_party/cld_3 \
+ third_party/crashpad \
+ third_party/crashpad/crashpad/third_party/zlib \
+ third_party/crc32c \
+ third_party/cros_system_api \
+ third_party/devscripts \
+ third_party/dom_distiller_js \
+ third_party/ffmpeg \
+ third_party/fips181 \
+ third_party/flatbuffers \
+ third_party/flot \
+ third_party/freetype \
+ third_party/glslang-angle \
+ third_party/google_input_tools \
+ third_party/google_input_tools/third_party/closure_library \
+ third_party/google_input_tools/third_party/closure_library/third_party/closure \
+ third_party/googletest \
+%if !%{with system_harfbuzz}
+ third_party/harfbuzz-ng \
+%endif
+ third_party/hunspell \
+ third_party/iccjpeg \
+%if !%{with system_libicu}
+ third_party/icu \
+%endif
+ third_party/inspector_protocol \
+ third_party/jinja2 \
+ third_party/jstemplate \
+ third_party/khronos \
+ third_party/leveldatabase \
+ third_party/libaddressinput \
+ third_party/libaom \
+ third_party/libjingle \
+ third_party/libphonenumber \
+ third_party/libsecret \
+ third_party/libsrtp \
+ third_party/libsync \
+ third_party/libudev \
+%if !%{with system_libvpx}
+ third_party/libvpx \
+ third_party/libvpx/source/libvpx/third_party/x86inc \
+%endif
+ third_party/libwebm \
+%if %{with system_libxml2}
+ third_party/libxml/chromium \
+%else
+ third_party/libxml \
+%endif
+ third_party/libXNVCtrl \
+ third_party/libyuv \
+ third_party/lss \
+ third_party/lzma_sdk \
+ third_party/mesa \
+ third_party/metrics_proto \
+%if !%{with system_minizip}
+ third_party/minizip/ \
+%endif
+ third_party/modp_b64 \
+ third_party/node \
+ third_party/node/node_modules/polymer-bundler/lib/third_party/UglifyJS2 \
+ third_party/openh264 \
+ third_party/openmax_dl \
+ third_party/ots \
+ third_party/pdfium \
+ third_party/pdfium/third_party/agg23 \
+ third_party/pdfium/third_party/base \
+ third_party/pdfium/third_party/bigint \
+ third_party/pdfium/third_party/freetype \
+ third_party/pdfium/third_party/lcms \
+ third_party/pdfium/third_party/libopenjpeg20 \
+ third_party/pdfium/third_party/libpng16 \
+ third_party/pdfium/third_party/libtiff \
+ third_party/pdfium/third_party/skia_shared \
+ third_party/perfetto \
+%if !%{with system_ply}
+ third_party/ply \
+%endif
+ third_party/polymer \
+ third_party/protobuf \
+ third_party/protobuf/third_party/six \
+ third_party/pyjson5 \
+ third_party/qcms \
+ third_party/rnnoise \
+ third_party/s2cellid \
+ third_party/sfntly \
+ third_party/skia \
+ third_party/skia/third_party/gif \
+ third_party/skia/third_party/vulkan \
+ third_party/skia/third_party/skcms \
+ third_party/smhasher \
+ third_party/speech-dispatcher \
+ third_party/spirv-headers \
+ third_party/spirv-tools-angle \
+ third_party/sqlite \
+ third_party/swiftshader \
+ third_party/swiftshader/third_party/llvm-subzero \
+ third_party/swiftshader/third_party/subzero \
+ third_party/tcmalloc \
+ third_party/usb_ids \
+ third_party/usrsctp \
+ third_party/vulkan \
+ third_party/vulkan-validation-layers \
+ third_party/web-animations-js \
+ third_party/webdriver \
+ third_party/WebKit \
+ third_party/webrtc \
+ third_party/widevine \
+ third_party/woff2 \
+ third_party/xdg-utils \
+ third_party/yasm/run_yasm.py \
+ third_party/zlib/google \
+%if !%{with system_minizip}
+ third_party/zlib \
+%endif
+ tools/gn/base/third_party/icu \
+ url/third_party/mozilla \
+ v8/third_party/antlr4 \
+ v8/src/third_party/valgrind \
+ v8/src/third_party/utf8-decoder \
+ v8/third_party/inspector_protocol
+
+./build/linux/unbundle/replace_gn_files.py --system-libraries \
+ flac \
+ freetype \
+ fontconfig \
+%if %{with system_libicu}
+ icu \
+%endif
+ libdrm \
+ libjpeg \
+ libpng \
+%if %{with system_libvpx}
+ libvpx \
+%endif
+ libwebp \
+%if %{with system_libxml2}
+ libxml \
+%endif
+ libxslt \
+ opus \
+ re2 \
+ snappy \
+ yasm \
+%if %{with system_minizip}
+ zlib
+%endif
+
+
+sed -i 's|//third_party/usb_ids|/usr/share/hwdata|g' device/usb/BUILD.gn
+%if %{clang}
+# Remove compiler flags not supported by our system clang
+ sed -i \
+ -e '/"-Wno-ignored-pragma-optimize"/d' \
+ build/config/compiler/BUILD.gn
+%endif
+rmdir third_party/markupsafe
+ln -s %{python2_sitearch}/markupsafe third_party/markupsafe
+%if %{with system_ply}
+rmdir third_party/ply
+ln -s %{python2_sitelib}/ply third_party/ply
+%endif
+# Fix the path to nodejs binary
+mkdir -p third_party/node/linux/node-linux-x64/bin
+ln -s %{_bindir}/node third_party/node/linux/node-linux-x64/bin/node
+# Hard code extra version
+FILE=chrome/common/channel_info_posix.cc
+sed -i.orig -e 's/getenv("CHROME_VERSION_EXTRA")/"Chromium(vaapi) Fedora Project"/' $FILE
+#####################################BUILD#############################################
+%build
+#export compilar variables
+%if %{clang}
+export AR=llvm-ar NM=llvm-nm
+export CC=clang CXX=clang++
+%else
+export AR=ar NM=nm
+export CC=gcc CXX=g++
+%if %{fedora_compilation_flags}
+#Build falgs to make hardened binaries
+#Remove some flags which can create conflicts with chromium gyp flags.
+export CFLAGS="$(echo '%{__global_cflags}' |sed -e 's/-fexceptions//' \
+ -e 's/-Werror=format-security//' \
+ -e 's/-pipe//' \
+ -e 's/-g/-g1/g' \
+ -e 's/-g1record-g1cc-switches//' )"
+export CXXFLAGS="$(echo '%{?__global_cxxflags}%{!?__global_cxxflags:%{__global_cflags}}' | sed -e 's/-fexceptions//' \
+ -e 's/-Werror=format-security//' \
+ -e 's/-pipe//' \
+ -e 's/-g/-g1/g' \
+ -e 's/-g1record-g1cc-switches//' )"
+
+export LDFLAGS='%{__global_ldflags}'
+%else
+export CXXFLAGS=$CXXFLAGS" -fno-delete-null-pointer-checks"
+%endif
+%endif
+gn_args=(
+ is_debug=false
+ use_vaapi=true
+ use_gtk3=true
+ enable_swiftshader=false
+ is_component_build=false
+ use_sysroot=false
+ use_custom_libcxx=false
+ use_aura=true
+ 'system_libdir="%{_lib}"'
+ use_cups=true
+ use_gnome_keyring=true
+ use_gio=true
+ use_kerberos=true
+ use_libpci=true
+ use_pulseaudio=true
+ use_system_freetype=true
+ enable_widevine=true
+%if %{with system_harfbuzz}
+ use_system_harfbuzz=true
+%endif
+%if %{freeworld}
+ 'ffmpeg_branding="Chrome"'
+ proprietary_codecs=true
+%else
+ 'ffmpeg_branding="Chromium"'
+ proprietary_codecs=false
+%endif
+ enable_nacl=false
+ enable_hangout_services_extension=false
+ fatal_linker_warnings=false
+ treat_warnings_as_errors=false
+ linux_use_bundled_binutils=false
+ remove_webcore_debug_symbols=true
+ fieldtrial_testing_like_official_build=true
+ 'custom_toolchain="//build/toolchain/linux/unbundle:default"'
+ 'host_toolchain="//build/toolchain/linux/unbundle:default"'
+ 'google_api_key="%{api_key}"'
+ 'google_default_client_id="%{default_client_id}"'
+ 'google_default_client_secret="%{default_client_secret}"'
+)
+gn_args+=(
+%if %{clang}
+ is_clang=true
+ 'clang_base_path = "/usr"'
+ clang_use_chrome_plugins=false
+%else
+ is_clang=false
+ use_lld=false
+%endif
+)
+
+tools/gn/bootstrap/bootstrap.py --gn-gen-args "${gn_args[*]}"
+%{target}/gn --script-executable=%{__python2} gen --args="${gn_args[*]}" %{target}
+%if %{debug_logs}
+ninja %{_smp_mflags} -C %{target} -v chrome chrome_sandbox chromedriver
+%else
+ninja %{_smp_mflags} -C %{target} chrome chrome_sandbox chromedriver
+%endif
+######################################Install####################################
+%install
+mkdir -p %{buildroot}%{_bindir}
+mkdir -p %{buildroot}%{chromiumdir}/locales
+mkdir -p %{buildroot}%{_mandir}/man1
+mkdir -p %{buildroot}%{_datadir}/metainfo
+mkdir -p %{buildroot}%{_datadir}/applications
+mkdir -p %{buildroot}%{_datadir}/gnome-control-center/default-apps
+sed -e "s|@@CHROMIUMDIR@@|%{chromiumdir}|" -e "s|@@BUILDTARGET@@|`cat /etc/redhat-release`|" \
+ %{SOURCE10} > chromium-vaapi.sh
+install -m 755 chromium-vaapi.sh %{buildroot}%{_bindir}/%{name}
+install -m 644 %{SOURCE11} %{buildroot}%{_datadir}/metainfo
+sed -e "s|@@MENUNAME@@|%{name}|g" -e "s|@@PACKAGE@@|%{name}|g" \
+ chrome/app/resources/manpage.1.in > chrome.1
+install -m 644 chrome.1 %{buildroot}%{_mandir}/man1/%{name}.1
+#Using the template from the source. Still doesn't help in fixing.
+sed -e "s|@@MENUNAME@@|%{name}|g" -e "s|@@PACKAGE@@|%{name}|g" -e "s|@@USR_BIN_SYMLINK_NAME@@|%{name}|g" \
+ chrome/installer/linux/common/desktop.template > %{name}.desktop
+desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{name}.desktop
+sed -e "s|@@MENUNAME@@|%{name}|g" -e "s|@@PACKAGE@@|%{name}|g" -e "s|@@INSTALLDIR@@|%{_bindir}|g" \
+chrome/installer/linux/common/default-app.template > %{name}.xml
+install -m 644 %{name}.xml %{buildroot}%{_datadir}/gnome-control-center/default-apps/
+install -m 755 %{target}/chrome %{buildroot}%{chromiumdir}/%{name}
+install -m 4755 %{target}/chrome_sandbox %{buildroot}%{chromiumdir}/chrome-sandbox
+install -m 755 %{target}/chromedriver %{buildroot}%{chromiumdir}/
+%if !%{with system_libicu}
+install -m 644 %{target}/icudtl.dat %{buildroot}%{chromiumdir}/
+%endif
+install -m 644 %{target}/natives_blob.bin %{buildroot}%{chromiumdir}/
+install -m 644 %{target}/v8_context_snapshot.bin %{buildroot}%{chromiumdir}/
+install -m 644 %{target}/*.pak %{buildroot}%{chromiumdir}/
+install -m 644 %{target}/locales/*.pak %{buildroot}%{chromiumdir}/locales/
+install -m 644 %{target}/xdg* %{buildroot}%{chromiumdir}/
+for i in 16 32; do
+ mkdir -p %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps
+ install -m 644 chrome/app/theme/default_100_percent/chromium/product_logo_$i.png \
+ %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/%{name}.png
+done
+for i in 22 24 32 48 64 128 256; do
+ if [ ${i} = 32 ]; then ext=xpm; else ext=png; fi
+ if [ ${i} = 32 ]; then dir=linux/; else dir=; fi
+ mkdir -p %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps
+ install -m 644 chrome/app/theme/chromium/${dir}product_logo_$i.${ext} \
+ %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/%{name}.${ext}
+done
+####################################check##################################################
+%check
+appstream-util validate-relax --nonet "%{buildroot}%{_datadir}/metainfo/%{name}.appdata.xml"
+######################################files################################################
+%files
+%license LICENSE
+%doc AUTHORS
+%{_bindir}/chromium-vaapi
+%{_datadir}/metainfo/chromium-vaapi.appdata.xml
+%{_datadir}/applications/chromium-vaapi.desktop
+%{_datadir}/gnome-control-center/default-apps/chromium-vaapi.xml
+%{_datadir}/icons/hicolor/16x16/apps/chromium-vaapi.png
+%{_datadir}/icons/hicolor/22x22/apps/chromium-vaapi.png
+%{_datadir}/icons/hicolor/24x24/apps/chromium-vaapi.png
+%{_datadir}/icons/hicolor/32x32/apps/chromium-vaapi.png
+%{_datadir}/icons/hicolor/32x32/apps/chromium-vaapi.xpm
+%{_datadir}/icons/hicolor/48x48/apps/chromium-vaapi.png
+%{_datadir}/icons/hicolor/64x64/apps/chromium-vaapi.png
+%{_datadir}/icons/hicolor/128x128/apps/chromium-vaapi.png
+%{_datadir}/icons/hicolor/256x256/apps/chromium-vaapi.png
+%{_mandir}/man1/chromium-vaapi.1.gz
+%dir %{chromiumdir}
+%{chromiumdir}/chromium-vaapi
+%{chromiumdir}/chrome-sandbox
+%{chromiumdir}/chromedriver
+%if !%{with system_libicu}
+%{chromiumdir}/icudtl.dat
+%endif
+%{chromiumdir}/natives_blob.bin
+%{chromiumdir}/v8_context_snapshot.bin
+%{chromiumdir}/*.pak
+%{chromiumdir}/xdg-mime
+%{chromiumdir}/xdg-settings
+%dir %{chromiumdir}/locales
+%{chromiumdir}/locales/*.pak
+#########################################changelogs#################################################
+%changelog
+* Fri Sep 28 2018 Akarshan Biswas <akarshan.biswas(a)hotmail.com> 69.0.3497.100-3
+- Remove dependency on minizip-compat package(https://bugzilla.redhat.com/show_bug.cgi?id=1632170)
+- Add conditions to build with{out} system minizip
+
+* Sat Sep 22 2018 Akarshan Biswas <akarshan.biswas(a)hotmail.com> 69.0.3497.100-2
+- Produce an entire new package with unique appdata
+- Use desktop and default app template from the source
+- enable debug builds
+- Update chromium wrapper
+- Remove dependent on unrar
+
+* Tue Sep 18 2018 Akarshan Biswas <akarshan.biswas(a)hotmail.com> 69.0.3497.100-1
+- Updated chromium to 69.0.3497.100.
+- Enabled fedora GCC build flags and removed those flags which can cause confict with chromium's gyp flags.
+- Removed some duplicate flags and added g1 to ease memory which building.
+
+* Thu Sep 13 2018 Akarshan Biswas <akarshan.biswas(a)hotmail.com> 69.0.3497.92-1
+- updated chromium to 69.0.3497.92
+- fixed vaapi patch
+- Moved appstream validation to check
+
+* Thu Sep 06 2018 Akarshan Biswas <akarshan.biswas(a)hotmail.com> 69.0.3497.81-1
+- updated chromium to 69.0.3497.81
+- removed useless requirements
+- turned on verbose
+- removed conditions on obsolete fedora releases
+- fixed fedora compilation flags
+
+* Wed Aug 29 2018 Akarshan Biswas <akarshan.biswas(a)hotmail.com> 68.0.3440.106-1
+- Deleted provides and excludes and added conflict
diff --git a/py2-bootstrap.patch b/py2-bootstrap.patch
new file mode 100644
index 0000000..8a5db71
--- /dev/null
+++ b/py2-bootstrap.patch
@@ -0,0 +1,33 @@
+diff -up chromium-69.0.3497.81/third_party/catapult/common/py_vulcanize/py_vulcanize/generate.py.py2 chromium-69.0.3497.81/third_party/catapult/common/py_vulcanize/py_vulcanize/generate.py
+--- chromium-69.0.3497.81/third_party/catapult/common/py_vulcanize/py_vulcanize/generate.py.py2 2018-09-06 10:45:17.919774145 -0400
++++ chromium-69.0.3497.81/third_party/catapult/common/py_vulcanize/py_vulcanize/generate.py 2018-09-06 10:45:17.914774254 -0400
+@@ -58,7 +58,7 @@ def _MinifyJS(input_js):
+
+ with tempfile.NamedTemporaryFile() as _:
+ args = [
+- 'python',
++ 'python2',
+ rjsmin_path
+ ]
+ p = subprocess.Popen(args,
+@@ -177,7 +177,7 @@ def _MinifyCSS(css_text):
+ os.path.join(py_vulcanize_path, 'third_party', 'rcssmin', 'rcssmin.py'))
+
+ with tempfile.NamedTemporaryFile() as _:
+- rcssmin_args = ['python', rcssmin_path]
++ rcssmin_args = ['python2', rcssmin_path]
+ p = subprocess.Popen(rcssmin_args,
+ stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE,
+diff -up chromium-69.0.3497.81/tools/gn/bootstrap/bootstrap.py.py2 chromium-69.0.3497.81/tools/gn/bootstrap/bootstrap.py
+--- chromium-69.0.3497.81/tools/gn/bootstrap/bootstrap.py.py2 2018-09-06 10:44:42.225550561 -0400
++++ chromium-69.0.3497.81/tools/gn/bootstrap/bootstrap.py 2018-09-06 13:06:24.251636231 -0400
+@@ -87,7 +87,7 @@ def main(argv):
+ if not options.debug:
+ gn_gen_args += ' is_debug=false'
+ subprocess.check_call([
+- gn_path, 'gen', out_dir,
++ gn_path, 'gen', out_dir, ' --script-executable=/usr/bin/python2',
+ '--args=%s' % gn_gen_args, "--root=" + SRC_ROOT
+ ])
+
diff --git a/sources b/sources
index e69de29..7d1e885 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+1779724693bdcf7b4e01ea1133abdde2 chromium-69.0.3497.100.tar.xz
diff --git a/unrar.patch b/unrar.patch
new file mode 100644
index 0000000..5951ab4
--- /dev/null
+++ b/unrar.patch
@@ -0,0 +1,186 @@
+diff --git a/chrome/browser/safe_browsing/download_protection/check_client_download_request.cc b/chrome/browser/safe_browsing/download_protection/check_client_download_request.cc
+index f5aaff83c87a..737e168ec5aa 100644
+--- a/chrome/browser/safe_browsing/download_protection/check_client_download_request.cc
++++ b/chrome/browser/safe_browsing/download_protection/check_client_download_request.cc
+@@ -379,10 +379,6 @@ void CheckClientDownloadRequest::AnalyzeFile() {
+ // are enabled.
+ if (item_->GetTargetFilePath().MatchesExtension(FILE_PATH_LITERAL(".zip"))) {
+ StartExtractZipFeatures();
+- } else if (item_->GetTargetFilePath().MatchesExtension(
+- FILE_PATH_LITERAL(".rar")) &&
+- base::FeatureList::IsEnabled(kInspectDownloadedRarFiles)) {
+- StartExtractRarFeatures();
+ #if defined(OS_MACOSX)
+ } else if (item_->GetTargetFilePath().MatchesExtension(
+ FILE_PATH_LITERAL(".dmg")) ||
+@@ -499,71 +495,6 @@ void CheckClientDownloadRequest::ExtractFileFeatures(
+ OnFileFeatureExtractionDone();
+ }
+
+-void CheckClientDownloadRequest::StartExtractRarFeatures() {
+- DCHECK_CURRENTLY_ON(BrowserThread::UI);
+- DCHECK(item_); // Called directly from Start(), item should still exist.
+- rar_analysis_start_time_ = base::TimeTicks::Now();
+- // We give the rar analyzer a weak pointer to this object. Since the
+- // analyzer is refcounted, it might outlive the request.
+- rar_analyzer_ = new SandboxedRarAnalyzer(
+- item_->GetFullPath(),
+- base::BindRepeating(&CheckClientDownloadRequest::OnRarAnalysisFinished,
+- weakptr_factory_.GetWeakPtr()),
+- content::ServiceManagerConnection::GetForProcess()->GetConnector());
+- rar_analyzer_->Start();
+-}
+-
+-void CheckClientDownloadRequest::OnRarAnalysisFinished(
+- const ArchiveAnalyzerResults& results) {
+- DCHECK_CURRENTLY_ON(BrowserThread::UI);
+- if (item_ == nullptr) {
+- PostFinishTask(DownloadCheckResult::UNKNOWN, REASON_REQUEST_CANCELED);
+- return;
+- }
+- if (!service_)
+- return;
+-
+- archive_is_valid_ =
+- (results.success ? ArchiveValid::VALID : ArchiveValid::INVALID);
+- archived_executable_ = results.has_executable;
+- CopyArchivedBinaries(results.archived_binary, &archived_binaries_);
+- DVLOG(1) << "Rar analysis finished for " << item_->GetFullPath().value()
+- << ", has_executable=" << results.has_executable
+- << ", has_archive=" << results.has_archive
+- << ", success=" << results.success;
+-
+- if (archived_executable_) {
+- UMA_HISTOGRAM_COUNTS_100("SBClientDownload.RarFileArchivedBinariesCount",
+- results.archived_binary.size());
+- }
+- UMA_HISTOGRAM_BOOLEAN("SBClientDownload.RarFileSuccess", results.success);
+- UMA_HISTOGRAM_BOOLEAN("SBClientDownload.RarFileHasExecutable",
+- archived_executable_);
+- UMA_HISTOGRAM_BOOLEAN("SBClientDownload.RarFileHasArchiveButNoExecutable",
+- results.has_archive && !archived_executable_);
+- UMA_HISTOGRAM_TIMES("SBClientDownload.ExtractRarFeaturesTime",
+- base::TimeTicks::Now() - rar_analysis_start_time_);
+- for (const auto& file_name : results.archived_archive_filenames)
+- RecordArchivedArchiveFileExtensionType(file_name);
+-
+- if (!archived_executable_) {
+- if (results.has_archive) {
+- type_ = ClientDownloadRequest::RAR_COMPRESSED_ARCHIVE;
+- } else if (!results.success) {
+- // .rar files that look invalid to Chrome may be successfully unpacked by
+- // other archive tools, so they may be a real threat.
+- type_ = ClientDownloadRequest::INVALID_RAR;
+- } else {
+- // Normal rar w/o EXEs, or invalid rar and not extended-reporting.
+- PostFinishTask(DownloadCheckResult::UNKNOWN,
+- REASON_ARCHIVE_WITHOUT_BINARIES);
+- return;
+- }
+- }
+-
+- OnFileFeatureExtractionDone();
+-}
+-
+ void CheckClientDownloadRequest::StartExtractZipFeatures() {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ DCHECK(item_); // Called directly from Start(), item should still exist.
+diff --git a/chrome/browser/safe_browsing/download_protection/check_client_download_request.h b/chrome/browser/safe_browsing/download_protection/check_client_download_request.h
+index 9042d5d589ab..1c50dcff4312 100644
+--- a/chrome/browser/safe_browsing/download_protection/check_client_download_request.h
++++ b/chrome/browser/safe_browsing/download_protection/check_client_download_request.h
+@@ -148,7 +148,6 @@ class CheckClientDownloadRequest
+ scoped_refptr<SafeBrowsingDatabaseManager> database_manager_;
+ const bool pingback_enabled_;
+ std::unique_ptr<network::SimpleURLLoader> loader_;
+- scoped_refptr<SandboxedRarAnalyzer> rar_analyzer_;
+ scoped_refptr<SandboxedZipAnalyzer> zip_analyzer_;
+ base::TimeTicks rar_analysis_start_time_;
+ base::TimeTicks zip_analysis_start_time_;
+diff --git a/chrome/common/safe_browsing/BUILD.gn b/chrome/common/safe_browsing/BUILD.gn
+index 92cc4f57d03b..4780e931e9e7 100644
+--- a/chrome/common/safe_browsing/BUILD.gn
++++ b/chrome/common/safe_browsing/BUILD.gn
+@@ -68,7 +68,6 @@ if (safe_browsing_mode == 1) {
+ ":file_type_policies",
+ "//base",
+ "//base:i18n",
+- "//third_party/unrar:unrar",
+ ]
+
+ defines = [
+@@ -121,7 +120,6 @@ source_set("safe_browsing") {
+ deps += [
+ ":archive_analyzer_results",
+ ":download_protection_util",
+- ":rar_analyzer",
+ "//components/safe_browsing:features",
+ ]
+
+diff --git a/chrome/services/file_util/public/cpp/BUILD.gn b/chrome/services/file_util/public/cpp/BUILD.gn
+index 158cbfc6d157..6d8b0df7c59e 100644
+--- a/chrome/services/file_util/public/cpp/BUILD.gn
++++ b/chrome/services/file_util/public/cpp/BUILD.gn
+@@ -14,8 +14,6 @@ source_set("cpp") {
+ sources = [
+ "sandboxed_dmg_analyzer_mac.cc",
+ "sandboxed_dmg_analyzer_mac.h",
+- "sandboxed_rar_analyzer.cc",
+- "sandboxed_rar_analyzer.h",
+ "sandboxed_zip_analyzer.cc",
+ "sandboxed_zip_analyzer.h",
+ ]
+@@ -35,7 +33,6 @@ source_set("unit_tests") {
+
+ sources = [
+ "sandboxed_dmg_analyzer_mac_unittest.cc",
+- "sandboxed_rar_analyzer_unittest.cc",
+ "sandboxed_zip_analyzer_unittest.cc",
+ ]
+
+diff --git a/chrome/services/file_util/public/mojom/safe_archive_analyzer.mojom b/chrome/services/file_util/public/mojom/safe_archive_analyzer.mojom
+index 6983f7b415d4..15d5aaba3657 100644
+--- a/chrome/services/file_util/public/mojom/safe_archive_analyzer.mojom
++++ b/chrome/services/file_util/public/mojom/safe_archive_analyzer.mojom
+@@ -22,11 +22,6 @@ interface SafeArchiveAnalyzer {
+ // for malicious download protection.
+ AnalyzeDmgFile(mojo_base.mojom.File dmg_file)
+ => (SafeArchiveAnalyzerResults results);
+-
+- // Build flag FULL_SAFE_BROWSING: Analyze the |rar_file| for malicious
+- // download protection.
+- AnalyzeRarFile(mojo_base.mojom.File rar_file)
+- => (SafeArchiveAnalyzerResults results);
+ };
+
+ [Native]
+diff --git a/chrome/services/file_util/safe_archive_analyzer.cc b/chrome/services/file_util/safe_archive_analyzer.cc
+index a13b42b197b3..db49c37b9b49 100644
+--- a/chrome/services/file_util/safe_archive_analyzer.cc
++++ b/chrome/services/file_util/safe_archive_analyzer.cc
+@@ -44,12 +44,3 @@ void SafeArchiveAnalyzer::AnalyzeDmgFile(base::File dmg_file,
+ NOTREACHED();
+ #endif
+ }
+-
+-void SafeArchiveAnalyzer::AnalyzeRarFile(base::File rar_file,
+- AnalyzeRarFileCallback callback) {
+- DCHECK(rar_file.IsValid());
+-
+- safe_browsing::ArchiveAnalyzerResults results;
+- safe_browsing::rar_analyzer::AnalyzeRarFile(std::move(rar_file), &results);
+- std::move(callback).Run(results);
+-}
+diff --git a/chrome/services/file_util/safe_archive_analyzer.h b/chrome/services/file_util/safe_archive_analyzer.h
+index f21efa6f57ba..2eda4f378bcc 100644
+--- a/chrome/services/file_util/safe_archive_analyzer.h
++++ b/chrome/services/file_util/safe_archive_analyzer.h
+@@ -25,8 +25,6 @@ class SafeArchiveAnalyzer : public chrome::mojom::SafeArchiveAnalyzer {
+ AnalyzeZipFileCallback callback) override;
+ void AnalyzeDmgFile(base::File dmg_file,
+ AnalyzeDmgFileCallback callback) override;
+- void AnalyzeRarFile(base::File rar_file,
+- AnalyzeRarFileCallback callback) override;
+
+ const std::unique_ptr<service_manager::ServiceContextRef> service_ref_;
+
diff --git a/vaapi.patch b/vaapi.patch
new file mode 100644
index 0000000..70d0cfb
--- /dev/null
+++ b/vaapi.patch
@@ -0,0 +1,542 @@
+diff -ur chromium-69.0.3497.92-orig/chrome/browser/about_flags.cc chromium-69.0.3497.92/chrome/browser/about_flags.cc
+--- chromium-69.0.3497.92-orig/chrome/browser/about_flags.cc 2018-09-12 00:39:23.000000000 +0530
++++ chromium-69.0.3497.92/chrome/browser/about_flags.cc 2018-09-13 22:10:33.938016199 +0530
+@@ -1238,12 +1238,14 @@
+ {"ui-disable-partial-swap", flag_descriptions::kUiPartialSwapName,
+ flag_descriptions::kUiPartialSwapDescription, kOsAll,
+ SINGLE_DISABLE_VALUE_TYPE(switches::kUIDisablePartialSwap)},
++#if defined(OS_CHROMEOS) || defined(OS_ANDROID)
+ {"disable-webrtc-hw-decoding", flag_descriptions::kWebrtcHwDecodingName,
+ flag_descriptions::kWebrtcHwDecodingDescription, kOsAndroid | kOsCrOS,
+ SINGLE_DISABLE_VALUE_TYPE(switches::kDisableWebRtcHWDecoding)},
+ {"disable-webrtc-hw-encoding", flag_descriptions::kWebrtcHwEncodingName,
+ flag_descriptions::kWebrtcHwEncodingDescription, kOsAndroid | kOsCrOS,
+ SINGLE_DISABLE_VALUE_TYPE(switches::kDisableWebRtcHWEncoding)},
++#endif
+ {"enable-webrtc-hw-h264-encoding",
+ flag_descriptions::kWebrtcHwH264EncodingName,
+ flag_descriptions::kWebrtcHwH264EncodingDescription, kOsAndroid | kOsCrOS,
+@@ -1612,6 +1614,13 @@
+ flag_descriptions::kShowTouchHudDescription, kOsCrOS,
+ SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud)},
+ #endif // OS_CHROMEOS
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++ {
++ "enable-accelerated-video", flag_descriptions::kAcceleratedVideoName,
++ flag_descriptions::kAcceleratedVideoDescription, kOsLinux,
++ SINGLE_VALUE_TYPE(switches::kEnableAcceleratedVideo),
++ },
++#else
+ {
+ "disable-accelerated-video-decode",
+ flag_descriptions::kAcceleratedVideoDecodeName,
+@@ -1619,6 +1628,7 @@
+ kOsMac | kOsWin | kOsCrOS | kOsAndroid,
+ SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
+ },
++#endif
+ #if defined(OS_WIN)
+ {"enable-hdr", flag_descriptions::kEnableHDRName,
+ flag_descriptions::kEnableHDRDescription, kOsWin,
+@@ -2291,12 +2301,17 @@
+ FEATURE_VALUE_TYPE(features::kOpenVR)},
+ #endif // ENABLE_OPENVR
+ #endif // ENABLE_VR
+-#if defined(OS_CHROMEOS)
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++ {"enable-accelerated-mjpeg-decode",
++ flag_descriptions::kAcceleratedMjpegDecodeName,
++ flag_descriptions::kAcceleratedMjpegDecodeDescription, kOsLinux,
++ SINGLE_VALUE_TYPE(switches::kEnableAcceleratedMjpegDecode)},
++#elif defined(OS_CHROMEOS)
+ {"disable-accelerated-mjpeg-decode",
+ flag_descriptions::kAcceleratedMjpegDecodeName,
+ flag_descriptions::kAcceleratedMjpegDecodeDescription, kOsCrOS,
+ SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedMjpegDecode)},
+-#endif // OS_CHROMEOS
++#endif
+ {"v8-cache-options", flag_descriptions::kV8CacheOptionsName,
+ flag_descriptions::kV8CacheOptionsDescription, kOsAll,
+ MULTI_VALUE_TYPE(kV8CacheOptionsChoices)},
+Only in chromium-69.0.3497.92/chrome/browser: about_flags.cc.orig
+diff -ur chromium-69.0.3497.92-orig/chrome/browser/chromeos/login/chrome_restart_request.cc chromium-69.0.3497.92/chrome/browser/chromeos/login/chrome_restart_request.cc
+--- chromium-69.0.3497.92-orig/chrome/browser/chromeos/login/chrome_restart_request.cc 2018-09-12 00:39:23.000000000 +0530
++++ chromium-69.0.3497.92/chrome/browser/chromeos/login/chrome_restart_request.cc 2018-09-13 22:10:33.986014728 +0530
+@@ -19,6 +19,7 @@
+ #include "base/sys_info.h"
+ #include "base/timer/timer.h"
+ #include "base/values.h"
++#include "build/build_config.h"
+ #include "cc/base/switches.h"
+ #include "chrome/browser/browser_process.h"
+ #include "chrome/browser/chromeos/boot_times_recorder.h"
+@@ -84,9 +85,14 @@
+ ::switches::kDisable2dCanvasImageChromium,
+ ::switches::kDisableAccelerated2dCanvas,
+ ::switches::kDisableAcceleratedJpegDecoding,
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++ ::switches::kEnableAcceleratedMjpegDecode,
++ ::switches::kEnableAcceleratedVideo,
++#else
+ ::switches::kDisableAcceleratedMjpegDecode,
+ ::switches::kDisableAcceleratedVideoDecode,
+ ::switches::kDisableAcceleratedVideoEncode,
++#endif
+ ::switches::kDisableBlinkFeatures,
+ ::switches::kDisableCastStreamingHWEncoding,
+ ::switches::kDisableGpu,
+@@ -160,8 +166,10 @@
+ ::switches::kEnableWebGLImageChromium,
+ ::switches::kEnableWebVR,
+ ::switches::kEnableUnsafeWebGPU,
++#if (defined(OS_CHROMEOS) || defined(OS_ANDROID))
+ ::switches::kDisableWebRtcHWDecoding,
+ ::switches::kDisableWebRtcHWEncoding,
++#endif
+ ::switches::kOzonePlatform,
+ ash::switches::kAshEnableTabletMode,
+ ash::switches::kAshEnableWaylandServer,
+diff -ur chromium-69.0.3497.92-orig/chrome/browser/flag_descriptions.cc chromium-69.0.3497.92/chrome/browser/flag_descriptions.cc
+--- chromium-69.0.3497.92-orig/chrome/browser/flag_descriptions.cc 2018-09-12 00:39:24.000000000 +0530
++++ chromium-69.0.3497.92/chrome/browser/flag_descriptions.cc 2018-09-13 22:10:34.007014085 +0530
+@@ -14,6 +14,13 @@
+ "Enables the use of the GPU to perform 2d canvas rendering instead of "
+ "using software rendering.";
+
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++const char kAcceleratedVideoName[] = "Hardware-accelerated video";
++const char kAcceleratedVideoDescription[] =
++ "Hardware-accelerated video where VA-API driver is installed on the"
++ "system.";
++#endif
++
+ const char kAcceleratedVideoDecodeName[] = "Hardware-accelerated video decode";
+ const char kAcceleratedVideoDecodeDescription[] =
+ "Hardware-accelerated video decode where available.";
+@@ -1986,6 +1993,7 @@
+ const char kWebrtcEchoCanceller3Description[] =
+ "Experimental WebRTC echo canceller (AEC3).";
+
++#if defined(OS_CHROMEOS) || defined(OS_ANDROID)
+ const char kWebrtcHwDecodingName[] = "WebRTC hardware video decoding";
+ const char kWebrtcHwDecodingDescription[] =
+ "Support in WebRTC for decoding video streams using platform hardware.";
+@@ -1993,6 +2001,7 @@
+ const char kWebrtcHwEncodingName[] = "WebRTC hardware video encoding";
+ const char kWebrtcHwEncodingDescription[] =
+ "Support in WebRTC for encoding video streams using platform hardware.";
++#endif
+
+ const char kWebrtcHwH264EncodingName[] = "WebRTC hardware h264 video encoding";
+ const char kWebrtcHwH264EncodingDescription[] =
+@@ -2892,14 +2901,16 @@
+
+ // Chrome OS -------------------------------------------------------------------
+
+-#if defined(OS_CHROMEOS)
++#if defined(OS_CHROMEOS) || (defined(OS_LINUX) && !defined(OS_ANDROID))
+
+ const char kAcceleratedMjpegDecodeName[] =
+ "Hardware-accelerated mjpeg decode for captured frame";
+ const char kAcceleratedMjpegDecodeDescription[] =
+ "Enable hardware-accelerated mjpeg decode for captured frame where "
+ "available.";
++#endif
+
++#if defined(OS_CHROMEOS)
+ const char kAllowTouchpadThreeFingerClickName[] = "Touchpad three-finger-click";
+ const char kAllowTouchpadThreeFingerClickDescription[] =
+ "Enables touchpad three-finger-click as middle button.";
+diff -ur chromium-69.0.3497.92-orig/chrome/browser/flag_descriptions.h chromium-69.0.3497.92/chrome/browser/flag_descriptions.h
+--- chromium-69.0.3497.92-orig/chrome/browser/flag_descriptions.h 2018-09-12 00:39:24.000000000 +0530
++++ chromium-69.0.3497.92/chrome/browser/flag_descriptions.h 2018-09-13 22:10:34.030013380 +0530
+@@ -37,6 +37,10 @@
+ extern const char kAccelerated2dCanvasName[];
+ extern const char kAccelerated2dCanvasDescription[];
+
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++extern const char kAcceleratedVideoName[];
++extern const char kAcceleratedVideoDescription[];
++#endif
+ extern const char kAcceleratedVideoDecodeName[];
+ extern const char kAcceleratedVideoDecodeDescription[];
+
+@@ -1762,13 +1766,17 @@
+
+ #endif // defined(OS_MACOSX)
+
+-// Chrome OS ------------------------------------------------------------------
+-
+-#if defined(OS_CHROMEOS)
++#if defined(OS_CHROMEOS) || (defined(OS_LINUX) && !defined(OS_ANDROID))
+
+ extern const char kAcceleratedMjpegDecodeName[];
+ extern const char kAcceleratedMjpegDecodeDescription[];
+
++#endif
++
++// Chrome OS ------------------------------------------------------------------
++
++#if defined(OS_CHROMEOS)
++
+ extern const char kAllowTouchpadThreeFingerClickName[];
+ extern const char kAllowTouchpadThreeFingerClickDescription[];
+
+diff -ur chromium-69.0.3497.92-orig/content/browser/gpu/compositor_util.cc chromium-69.0.3497.92/content/browser/gpu/compositor_util.cc
+--- chromium-69.0.3497.92-orig/content/browser/gpu/compositor_util.cc 2018-09-12 00:39:41.000000000 +0530
++++ chromium-69.0.3497.92/content/browser/gpu/compositor_util.cc 2018-09-13 22:10:34.072012092 +0530
+@@ -149,7 +149,11 @@
+ {"video_decode",
+ SafeGetFeatureStatus(gpu_feature_info,
+ gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE),
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++ !command_line.HasSwitch(switches::kEnableAcceleratedVideo),
++#else
+ command_line.HasSwitch(switches::kDisableAcceleratedVideoDecode),
++#endif
+ "Accelerated video decode has been disabled, either via blacklist, "
+ "about:flags or the command line.",
+ true, true},
+diff -ur chromium-69.0.3497.92-orig/content/browser/gpu/gpu_process_host.cc chromium-69.0.3497.92/content/browser/gpu/gpu_process_host.cc
+--- chromium-69.0.3497.92-orig/content/browser/gpu/gpu_process_host.cc 2018-09-12 00:39:41.000000000 +0530
++++ chromium-69.0.3497.92/content/browser/gpu/gpu_process_host.cc 2018-09-13 22:10:34.113010836 +0530
+@@ -209,7 +209,9 @@
+ switches::kDisableLogging,
+ switches::kDisableShaderNameHashing,
+ switches::kDisableSkiaRuntimeOpts,
++#if !defined(OS_LINUX)
+ switches::kDisableWebRtcHWEncoding,
++#endif
+ #if defined(OS_WIN)
+ switches::kEnableAcceleratedVpxDecode,
+ #endif
+diff -ur chromium-69.0.3497.92-orig/content/browser/renderer_host/media/video_capture_browsertest.cc chromium-69.0.3497.92/content/browser/renderer_host/media/video_capture_browsertest.cc
+--- chromium-69.0.3497.92-orig/content/browser/renderer_host/media/video_capture_browsertest.cc 2018-09-12 00:39:41.000000000 +0530
++++ chromium-69.0.3497.92/content/browser/renderer_host/media/video_capture_browsertest.cc 2018-09-13 22:10:34.124010499 +0530
+@@ -165,8 +165,13 @@
+ base::CommandLine::ForCurrentProcess()->AppendSwitch(
+ switches::kUseFakeJpegDecodeAccelerator);
+ } else {
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++ base::CommandLine::ForCurrentProcess()->AppendSwitch(
++ switches::kEnableAcceleratedMjpegDecode);
++#else
+ base::CommandLine::ForCurrentProcess()->AppendSwitch(
+ switches::kDisableAcceleratedMjpegDecode);
++#endif
+ }
+ }
+
+diff -ur chromium-69.0.3497.92-orig/content/browser/renderer_host/render_process_host_impl.cc chromium-69.0.3497.92/content/browser/renderer_host/render_process_host_impl.cc
+--- chromium-69.0.3497.92-orig/content/browser/renderer_host/render_process_host_impl.cc 2018-09-12 00:39:41.000000000 +0530
++++ chromium-69.0.3497.92/content/browser/renderer_host/render_process_host_impl.cc 2018-09-13 22:10:34.133010223 +0530
+@@ -2798,7 +2798,11 @@
+ switches::kDefaultTileHeight,
+ switches::kDisable2dCanvasImageChromium,
+ switches::kDisableAcceleratedJpegDecoding,
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++ switches::kEnableAcceleratedVideo,
++#else
+ switches::kDisableAcceleratedVideoDecode,
++#endif
+ switches::kDisableBackgroundTasks,
+ switches::kDisableBackgroundTimerThrottling,
+ switches::kDisableBreakpad,
+@@ -2933,8 +2937,10 @@
+ #if BUILDFLAG(ENABLE_RUNTIME_MEDIA_RENDERER_SELECTION)
+ switches::kDisableMojoRenderer,
+ #endif
++#if !defined(OS_LINUX) || defined(OS_CHROMEOS)
+ switches::kDisableWebRtcHWDecoding,
+ switches::kDisableWebRtcHWEncoding,
++#endif
+ switches::kEnableWebRtcSrtpAesGcm,
+ switches::kEnableWebRtcSrtpEncryptedHeaders,
+ switches::kEnableWebRtcStunOrigin,
+Only in chromium-69.0.3497.92/content/browser/renderer_host: render_process_host_impl.cc.orig
+diff -ur chromium-69.0.3497.92-orig/content/browser/utility_process_host.cc chromium-69.0.3497.92/content/browser/utility_process_host.cc
+--- chromium-69.0.3497.92-orig/content/browser/utility_process_host.cc 2018-09-12 00:39:41.000000000 +0530
++++ chromium-69.0.3497.92/content/browser/utility_process_host.cc 2018-09-13 22:10:34.296005227 +0530
+@@ -296,7 +296,11 @@
+ switches::kOverrideUseSoftwareGLForTests,
+ switches::kOverrideEnabledCdmInterfaceVersion,
+ switches::kProxyServer,
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++ switches::kEnableAcceleratedMjpegDecode,
++#else
+ switches::kDisableAcceleratedMjpegDecode,
++#endif
+ switches::kUseFakeDeviceForMediaStream,
+ switches::kUseFakeJpegDecodeAccelerator,
+ switches::kUseFileForFakeVideoCapture,
+diff -ur chromium-69.0.3497.92-orig/content/browser/webrtc/webrtc_media_recorder_browsertest.cc chromium-69.0.3497.92/content/browser/webrtc/webrtc_media_recorder_browsertest.cc
+--- chromium-69.0.3497.92-orig/content/browser/webrtc/webrtc_media_recorder_browsertest.cc 2018-09-12 00:39:41.000000000 +0530
++++ chromium-69.0.3497.92/content/browser/webrtc/webrtc_media_recorder_browsertest.cc 2018-09-13 22:10:34.143009916 +0530
+@@ -66,7 +66,12 @@
+ return;
+ // This flag is also used for encoding, https://crbug.com/616640.
+ base::CommandLine::ForCurrentProcess()->AppendSwitch(
+- switches::kDisableAcceleratedVideoDecode);
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++ switches::kEnableAcceleratedVideo
++#else
++ switches::kDisableAcceleratedVideoDecode
++#endif
++ );
+ }
+
+ private:
+diff -ur chromium-69.0.3497.92-orig/content/gpu/BUILD.gn chromium-69.0.3497.92/content/gpu/BUILD.gn
+--- chromium-69.0.3497.92-orig/content/gpu/BUILD.gn 2018-09-12 00:39:41.000000000 +0530
++++ chromium-69.0.3497.92/content/gpu/BUILD.gn 2018-09-13 22:10:34.148009763 +0530
+@@ -133,4 +133,8 @@
+ (!is_chromecast || is_cast_desktop_build)) {
+ configs += [ "//build/config/linux/dri" ]
+ }
++
++ if (is_desktop_linux) {
++ public_configs = [ "//media/gpu:libva_config" ]
++ }
+ }
+diff -ur chromium-69.0.3497.92-orig/content/gpu/gpu_main.cc chromium-69.0.3497.92/content/gpu/gpu_main.cc
+--- chromium-69.0.3497.92-orig/content/gpu/gpu_main.cc 2018-09-12 00:39:41.000000000 +0530
++++ chromium-69.0.3497.92/content/gpu/gpu_main.cc 2018-09-13 22:10:34.153009610 +0530
+@@ -284,7 +284,7 @@
+
+ base::PlatformThread::SetName("CrGpuMain");
+
+-#if defined(OS_ANDROID) || defined(OS_CHROMEOS)
++#if defined(OS_LINUX)
+ // Set thread priority before sandbox initialization.
+ base::PlatformThread::SetCurrentThreadPriority(base::ThreadPriority::DISPLAY);
+ #endif
+@@ -317,7 +317,7 @@
+ GetContentClient()->SetGpuInfo(gpu_init->gpu_info());
+
+ base::ThreadPriority io_thread_priority = base::ThreadPriority::NORMAL;
+-#if defined(OS_ANDROID) || defined(OS_CHROMEOS)
++#if defined(OS_LINUX)
+ io_thread_priority = base::ThreadPriority::DISPLAY;
+ #endif
+
+diff -ur chromium-69.0.3497.92-orig/content/public/browser/gpu_utils.cc chromium-69.0.3497.92/content/public/browser/gpu_utils.cc
+--- chromium-69.0.3497.92-orig/content/public/browser/gpu_utils.cc 2018-09-12 00:39:42.000000000 +0530
++++ chromium-69.0.3497.92/content/public/browser/gpu_utils.cc 2018-09-13 22:10:34.164009273 +0530
+@@ -57,9 +57,17 @@
+ gpu_preferences.in_process_gpu =
+ command_line->HasSwitch(switches::kInProcessGPU);
+ gpu_preferences.disable_accelerated_video_decode =
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++ !command_line->HasSwitch(switches::kEnableAcceleratedVideo);
++#else
+ command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode);
++#endif
+ gpu_preferences.disable_accelerated_video_encode =
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++ !command_line->HasSwitch(switches::kEnableAcceleratedVideo);
++#else
+ command_line->HasSwitch(switches::kDisableAcceleratedVideoEncode);
++#endif
+ #if defined(OS_WIN)
+ uint32_t enable_accelerated_vpx_decode_val =
+ gpu::GpuPreferences::VPX_VENDOR_MICROSOFT;
+diff -ur chromium-69.0.3497.92-orig/content/public/common/content_switches.cc chromium-69.0.3497.92/content/public/common/content_switches.cc
+--- chromium-69.0.3497.92-orig/content/public/common/content_switches.cc 2018-09-12 00:39:42.000000000 +0530
++++ chromium-69.0.3497.92/content/public/common/content_switches.cc 2018-09-13 22:10:34.172009028 +0530
+@@ -79,6 +79,11 @@
+ // Disable gpu-accelerated 2d canvas.
+ const char kDisableAccelerated2dCanvas[] = "disable-accelerated-2d-canvas";
+
++#if defined(OS_LINUX)
++// Enables hardware acceleration of video for Linux only. VA-API driver
++// is required to be present on the system installation.
++const char kEnableAcceleratedVideo[] = "enable-accelerated-video";
++#endif
+ // Disables hardware acceleration of video decode, where available.
+ const char kDisableAcceleratedVideoDecode[] =
+ "disable-accelerated-video-decode";
+@@ -868,11 +873,13 @@
+ // ignores this switch on its stable and beta channels.
+ const char kDisableWebRtcEncryption[] = "disable-webrtc-encryption";
+
++#if defined(OS_CHROMEOS)
+ // Disables HW decode acceleration for WebRTC.
+ const char kDisableWebRtcHWDecoding[] = "disable-webrtc-hw-decoding";
+
+ // Disables HW encode acceleration for WebRTC.
+ const char kDisableWebRtcHWEncoding[] = "disable-webrtc-hw-encoding";
++#endif
+
+ // Enables negotiation of GCM cipher suites from RFC 7714 for SRTP in WebRTC.
+ // See https://tools.ietf.org/html/rfc7714 for further information.
+diff -ur chromium-69.0.3497.92-orig/content/public/common/content_switches.h chromium-69.0.3497.92/content/public/common/content_switches.h
+--- chromium-69.0.3497.92-orig/content/public/common/content_switches.h 2018-09-12 00:39:42.000000000 +0530
++++ chromium-69.0.3497.92/content/public/common/content_switches.h 2018-09-13 22:10:34.172009028 +0530
+@@ -104,6 +104,9 @@
+ CONTENT_EXPORT extern const char kDomAutomationController[];
+ extern const char kDisable2dCanvasClipAntialiasing[];
+ CONTENT_EXPORT extern const char kDumpBlinkRuntimeCallStats[];
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++CONTENT_EXPORT extern const char kEnableAcceleratedVideo[];
++#endif
+ CONTENT_EXPORT extern const char kEnableAccessibilityObjectModel[];
+ CONTENT_EXPORT extern const char kEnableAggressiveDOMStorageFlushing[];
+ CONTENT_EXPORT extern const char kEnableAutomation[];
+@@ -241,8 +244,10 @@
+ CONTENT_EXPORT extern const char kWaitForDebuggerChildren[];
+
+ CONTENT_EXPORT extern const char kDisableWebRtcEncryption[];
++#if defined(OS_CHROMEOS)
+ CONTENT_EXPORT extern const char kDisableWebRtcHWDecoding[];
+ CONTENT_EXPORT extern const char kDisableWebRtcHWEncoding[];
++#endif
+ CONTENT_EXPORT extern const char kEnableWebRtcSrtpAesGcm[];
+ CONTENT_EXPORT extern const char kEnableWebRtcSrtpEncryptedHeaders[];
+ CONTENT_EXPORT extern const char kEnableWebRtcStunOrigin[];
+diff -ur chromium-69.0.3497.92-orig/content/renderer/media/webrtc/peer_connection_dependency_factory.cc chromium-69.0.3497.92/content/renderer/media/webrtc/peer_connection_dependency_factory.cc
+--- chromium-69.0.3497.92-orig/content/renderer/media/webrtc/peer_connection_dependency_factory.cc 2018-09-12 00:39:42.000000000 +0530
++++ chromium-69.0.3497.92/content/renderer/media/webrtc/peer_connection_dependency_factory.cc 2018-09-13 22:10:34.181008752 +0530
+@@ -276,10 +276,18 @@
+
+ const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
+ if (gpu_factories && gpu_factories->IsGpuVideoAcceleratorEnabled()) {
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++ if (cmd_line->HasSwitch(switches::kEnableAcceleratedVideo))
++#else
+ if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWDecoding))
++#endif
+ decoder_factory.reset(new RTCVideoDecoderFactory(gpu_factories));
+
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++ if (cmd_line->HasSwitch(switches::kEnableAcceleratedVideo))
++#else
+ if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWEncoding))
++#endif
+ encoder_factory.reset(new RTCVideoEncoderFactory(gpu_factories));
+ }
+
+diff -ur chromium-69.0.3497.92-orig/content/renderer/render_thread_impl.cc chromium-69.0.3497.92/content/renderer/render_thread_impl.cc
+--- chromium-69.0.3497.92-orig/content/renderer/render_thread_impl.cc 2018-09-12 00:39:42.000000000 +0530
++++ chromium-69.0.3497.92/content/renderer/render_thread_impl.cc 2018-09-13 22:10:34.192008415 +0530
+@@ -1441,7 +1441,11 @@
+ kGpuStreamPriorityMedia);
+
+ const bool enable_video_accelerator =
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++ cmd_line->HasSwitch(switches::kEnableAcceleratedVideo) &&
++#else
+ !cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode) &&
++#endif
+ (gpu_channel_host->gpu_feature_info()
+ .status_values[gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE] ==
+ gpu::kGpuFeatureStatusEnabled);
+Only in chromium-69.0.3497.92/content/renderer: render_thread_impl.cc.orig
+diff -ur chromium-69.0.3497.92-orig/gpu/config/software_rendering_list.json chromium-69.0.3497.92/gpu/config/software_rendering_list.json
+--- chromium-69.0.3497.92-orig/gpu/config/software_rendering_list.json 2018-09-12 00:39:44.000000000 +0530
++++ chromium-69.0.3497.92/gpu/config/software_rendering_list.json 2018-09-13 22:10:34.193008384 +0530
+@@ -377,17 +377,6 @@
+ ]
+ },
+ {
+- "id": 48,
+- "description": "Accelerated video decode is unavailable on Linux",
+- "cr_bugs": [137247],
+- "os": {
+- "type": "linux"
+- },
+- "features": [
+- "accelerated_video_decode"
+- ]
+- },
+- {
+ "id": 50,
+ "description": "Disable VMware software renderer on older Mesa",
+ "cr_bugs": [145531, 332596, 571899, 629434],
+diff -ur chromium-69.0.3497.92-orig/media/base/media_switches.cc chromium-69.0.3497.92/media/base/media_switches.cc
+--- chromium-69.0.3497.92-orig/media/base/media_switches.cc 2018-09-12 00:39:48.000000000 +0530
++++ chromium-69.0.3497.92/media/base/media_switches.cc 2018-09-13 22:10:34.214007740 +0530
+@@ -117,10 +117,15 @@
+ // accelerator hardware to be present.
+ const char kUseFakeJpegDecodeAccelerator[] = "use-fake-jpeg-decode-accelerator";
+
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++// Enable hardware accelerated mjpeg decode on linux
++const char kEnableAcceleratedMjpegDecode[] = "enable-accelerated-mjpeg-decode";
++#else
+ // Disable hardware acceleration of mjpeg decode for captured frame, where
+ // available.
+ const char kDisableAcceleratedMjpegDecode[] =
+ "disable-accelerated-mjpeg-decode";
++#endif
+
+ // When running tests on a system without the required hardware or libraries,
+ // this flag will cause the tests to fail. Otherwise, they silently succeed.
+@@ -462,15 +467,22 @@
+ #endif
+
+ bool IsVideoCaptureAcceleratedJpegDecodingEnabled() {
++
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++ if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
++ switches::kEnableAcceleratedMjpegDecode)
++#else
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+- switches::kDisableAcceleratedMjpegDecode)) {
++ switches::kDisableAcceleratedMjpegDecode)
++#endif
++ ) {
+ return false;
+ }
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kUseFakeJpegDecodeAccelerator)) {
+ return true;
+ }
+-#if defined(OS_CHROMEOS)
++#if !defined(OS_ANDROID) && defined(OS_LINUX)
+ return true;
+ #endif
+ return false;
+diff -ur chromium-69.0.3497.92-orig/media/base/media_switches.h chromium-69.0.3497.92/media/base/media_switches.h
+--- chromium-69.0.3497.92-orig/media/base/media_switches.h 2018-09-12 00:39:48.000000000 +0530
++++ chromium-69.0.3497.92/media/base/media_switches.h 2018-09-13 22:10:34.283005625 +0530
+@@ -66,7 +66,11 @@
+ MEDIA_EXPORT extern const char kUseFileForFakeVideoCapture[];
+ MEDIA_EXPORT extern const char kUseFileForFakeAudioCapture[];
+ MEDIA_EXPORT extern const char kUseFakeJpegDecodeAccelerator[];
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++MEDIA_EXPORT extern const char kEnableAcceleratedMjpegDecode[];
++#else
+ MEDIA_EXPORT extern const char kDisableAcceleratedMjpegDecode[];
++#endif
+
+ MEDIA_EXPORT extern const char kRequireAudioHardwareForTesting[];
+ MEDIA_EXPORT extern const char kMuteAudio[];
+diff -ur chromium-69.0.3497.92-orig/media/gpu/BUILD.gn chromium-69.0.3497.92/media/gpu/BUILD.gn
+--- chromium-69.0.3497.92-orig/media/gpu/BUILD.gn 2018-09-12 00:39:48.000000000 +0530
++++ chromium-69.0.3497.92/media/gpu/BUILD.gn 2018-09-13 22:10:34.210007863 +0530
+@@ -495,6 +495,14 @@
+ }
+ }
+
++if (is_desktop_linux && use_vaapi) {
++ import("//build/config/linux/pkg_config.gni")
++
++ pkg_config("libva_config") {
++ packages = [ "libva" ]
++ }
++}
++
+ if (use_vaapi) {
+ test("jpeg_encode_accelerator_unittest") {
+ deps = [
+@@ -559,6 +567,10 @@
+ if (use_ozone) {
+ deps += [ "//ui/ozone" ]
+ }
++
++ if (is_desktop_linux) {
++ public_configs = [ ":libva_config" ]
++ }
+ }
+ }
+
diff --git a/widevine.patch b/widevine.patch
new file mode 100644
index 0000000..2fc8d79
--- /dev/null
+++ b/widevine.patch
@@ -0,0 +1,23 @@
+diff -upr chromium-48.0.2564.82.orig/third_party/widevine/cdm/stub/widevine_cdm_version.h chromium-48.0.2564.82/third_party/widevine/cdm/stub/widevine_cdm_version.h
+--- chromium-48.0.2564.82.orig/third_party/widevine/cdm/stub/widevine_cdm_version.h 2016-01-14 01:05:17.000000000 +0200
++++ chromium-48.0.2564.82/third_party/widevine/cdm/stub/widevine_cdm_version.h 2016-01-21 19:18:51.287978456 +0200
+@@ -12,4 +12,6 @@
+
+ #define WIDEVINE_CDM_AVAILABLE
+
++#define WIDEVINE_CDM_VERSION_STRING "67"
++
+ #endif // WIDEVINE_CDM_VERSION_H_
+ #endif // WIDEVINE_CDM_VERSION_H_
+
+--- a/third_party/widevine/cdm/BUILD.gn
++++ b/third_party/widevine/cdm/BUILD.gn
+@@ -11,7 +11,7 @@ import("//third_party/widevine/cdm/widev
+ # Internal Cast builds set enable_widevine=true to bring in Widevine support.
+ # TODO(xhwang): Support component updated CDM on other platforms and remove this
+ # assert.
+-assert(!enable_widevine || is_win || is_mac || is_chromecast,
++assert(!enable_widevine || is_win || is_mac || is_chromecast || is_linux,
+ "Component updated CDM only supported on Windows and Mac for now.")
+
+ widevine_arch = current_cpu
6 years, 1 month
[chromium-vaapi/f28] Remove dependency on minizip-compat package(https://bugzilla.redhat.com/show_bug.cgi?id=1632170) Add
by hellbanger
commit 42729b74f488afc5fb777013b9828d9e8c131968
Author: Akarshan Biswas <hellbanger(a)ga-lmt-s2.biswasab.org>
Date: Sat Sep 29 14:36:13 2018 +0530
Remove dependency on minizip-compat package(https://bugzilla.redhat.com/show_bug.cgi?id=1632170)
Add conditions to build with{out} system minizip
.gitignore | 1 +
LICENSE | 29 +++
chromium-vaapi.appdata.xml | 37 +++
chromium-vaapi.sh | 60 +++++
chromium-vaapi.spec | 598 +++++++++++++++++++++++++++++++++++++++++++++
py2-bootstrap.patch | 33 +++
sources | 1 +
unrar.patch | 186 ++++++++++++++
vaapi.patch | 542 ++++++++++++++++++++++++++++++++++++++++
widevine.patch | 23 ++
10 files changed, 1510 insertions(+)
---
diff --git a/.gitignore b/.gitignore
index e69de29..6317544 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/chromium-69.0.3497.100.tar.xz
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..1c5664f
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,29 @@
+BSD 3-Clause License
+
+Copyright (c) 2018, Akarshan Biswas
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+* Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/chromium-vaapi.appdata.xml b/chromium-vaapi.appdata.xml
new file mode 100644
index 0000000..a2b2064
--- /dev/null
+++ b/chromium-vaapi.appdata.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Referenced from https://www.freedesktop.org/software/appstream/docs/chap-Quickstart.html#... -->
+<component type="desktop">
+ <id>chromium-vaapi.desktop</id>
+ <update_contact> chromium-vaapi-owner(a)rpmfusion.org</update_contact>
+ <metadata_license>CC0-1.0</metadata_license>
+ <project_license>BSD-3-Clause and LGPL-2.1+ and Apache-2.0 and IJG and MIT and GPL-2.0+ and ISC and OpenSSL and (MPL-1.1 or GPL-2.0 or LGPL-2.0)</project_license>
+ <name>chromium-vaapi</name>
+ <summary>Web Browser</summary>
+ <description>
+ <p>
+ Chromium-vaapi is an open-source browser based on webkit(blink).
+ This build of chromium comes with video decoding acceleration enabled through libva vaapi.
+ Chromium browser with hardware video decoding will not only increase the battery by minimising the power consumption but also enable 4K video ( if supported ) on weaker systems. Installing this build requires vaapi driver to be installed on the system. check with vainfo. Compare CPU usages of both enabled and disabled state.
+ </p>
+ <p>
+ Video acceleration may or may not work on Nvidia GPUs because of no support of vaapi. Only Intel and amdgpus are supported at the moment. If chromium gives an error, try checking your gpu by running vainfo.
+Nvidia's open source Nouveau driver might work(with firmware from the binary driver) but it may crash.
+ Please look at the logs in chrome://gpu.
+Sometimes "Video Decode" in the "Graphics Feature Status" maybe misleading, Please look at "Video Acceleration Information" section.
+ </p>
+ </description>
+ <url type="homepage">https://www.chromium.org/Home</url>
+ <screenshots>
+ <screenshot type="default">
+ <caption>The main window</caption>
+ <image>https://gitlab.com/biswasab/Project-screenshots/raw/master/a.png</image>
+ </screenshot>
+ <screenshot>
+ <caption>The chrome://gpu page</caption>
+ <image>https://gitlab.com/biswasab/Project-screenshots/raw/master/b.png</image>
+ </screenshot>
+ </screenshots>
+ <developer_name>Google</developer_name>
+ <url type="bugtracker">https://bugzilla.rpmfusion.org</url>
+ <url type="help">https://chromium.googlesource.com/chromium/src/+/master/docs/linux_debugg...</url>
+</component>
diff --git a/chromium-vaapi.sh b/chromium-vaapi.sh
new file mode 100644
index 0000000..77a0027
--- /dev/null
+++ b/chromium-vaapi.sh
@@ -0,0 +1,60 @@
+#!/bin/bash
+#
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# This file is obtained from https://src.fedoraproject.org/rpms/chromium/
+# and modified by Akarshan Biswas <akarshan.biswas(a)hotmail.com. All modifications are also
+# licensed under 3-clause BSD license.
+
+# Let the wrapped binary know that it has been run through the wrapper.
+export CHROME_WRAPPER="$(readlink -f "$0")"
+
+HERE="`dirname "$CHROME_WRAPPER"`"
+export CHROME_DESKTOP="chromium-vaapi.desktop"
+# We include some xdg utilities next to the binary, and we want to prefer them
+# over the system versions when we know the system versions are very old. We
+# detect whether the system xdg utilities are sufficiently new to be likely to
+# work for us by looking for xdg-settings. If we find it, we leave $PATH alone,
+# so that the system xdg utilities (including any distro patches) will be used.
+if ! which xdg-settings &> /dev/null; then
+ # Old xdg utilities. Prepend $HERE to $PATH to use ours instead.
+ export PATH="$HERE:$PATH"
+else
+ # Use system xdg utilities. But first create mimeapps.list if it doesn't
+ # exist; some systems have bugs in xdg-mime that make it fail without it.
+ xdg_app_dir="${XDG_DATA_HOME:-$HOME/.local/share/applications}"
+ mkdir -p "$xdg_app_dir"
+ [ -f "$xdg_app_dir/mimeapps.list" ] || touch "$xdg_app_dir/mimeapps.list"
+fi
+
+# Always use our versions of ffmpeg libs.
+# This also makes RPMs find the compatibly-named library symlinks.
+if [[ -n "$LD_LIBRARY_PATH" ]]; then
+ LD_LIBRARY_PATH="$HERE:$HERE/lib:$LD_LIBRARY_PATH"
+else
+ LD_LIBRARY_PATH="$HERE:$HERE/lib"
+fi
+export LD_LIBRARY_PATH
+
+# Sanitize std{in,out,err} because they'll be shared with untrusted child
+# processes (http://crbug.com/376567).
+exec < /dev/null
+exec > >(exec cat)
+exec 2> >(exec cat >&2)
+
+export CHROME_VERSION_EXTRA="Built from source for @@BUILDTARGET@@"
+
+CHROMIUM_DISTRO_FLAGS=" --enable-plugins \
+ --enable-extensions \
+ --enable-user-scripts \
+ --enable-printing \
+ --enable-accelerated-video \
+ --enable-native-gpu-memory-buffers \
+ --enable-accelerated-mjpeg-decode \
+ --enable-gpu-rasterization \
+ --disable-gpu-driver-bug-workarounds \
+ --enable-sync"
+
+exec -a "$0" "@@CHROMIUMDIR@@/$(basename "$0" | sed 's/\.sh$//')" $CHROMIUM_DISTRO_FLAGS "$@"
diff --git a/chromium-vaapi.spec b/chromium-vaapi.spec
new file mode 100644
index 0000000..f2d300b
--- /dev/null
+++ b/chromium-vaapi.spec
@@ -0,0 +1,598 @@
+# This spec file is based on other spec files, ebuilds, PKGBUILDs available from
+# [1] https://repos.fedorapeople.org/repos/spot/chromium/
+# [2] https://copr.fedoraproject.org/coprs/churchyard/chromium-russianfedora-te...
+# [3] https://www.archlinux.org/packages/extra/x86_64/chromium/
+# [4] https://src.fedoraproject.org/rpms/chromium/
+# [5] https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/chromium/
+# [6] https://copr.fedorainfracloud.org/coprs/lantw44/chromium/
+# Get the version number of latest stable version
+# $ curl -s 'https://omahaproxy.appspot.com/all?os=linux&channel=stable' | sed 1d | cut -d , -f 3
+######################################################################################################################
+#Global Libraries
+#Do not turn it on in Fedora copr!
+%global freeworld 1
+#This can be any folder on out
+%global target out/Release
+#Our installation folder
+%global chromiumdir %{_libdir}/chromium-vaapi
+### Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
+### Note: These are for Fedora use ONLY.
+### For your own distribution, please get your own set of keys.
+### http://lists.debian.org/debian-legal/2013/11/msg00006.html
+%global api_key AIzaSyDUIXvzVrt5OkVsgXhQ6NFfvWlA44by-aw
+%global default_client_id 449907151817.apps.googleusercontent.com
+%global default_client_secret miEreAep8nuvTdvLums6qyLK
+###############################Exclude Private chromium libs###########################
+%global __requires_exclude %{chromiumdir}/.*\\.so
+%global __provides_exclude_from %{chromiumdir}/.*\\.so
+#######################################CONFIGS###########################################
+# Require harfbuzz >= 1.5.0 for hb_glyph_info_t
+%if 0%{?fedora} >= 28
+%bcond_without system_harfbuzz
+%else
+%bcond_with system_harfbuzz
+%endif
+# Require libxml2 > 2.9.4 for XML_PARSE_NOXXE
+%bcond_without system_libxml2
+
+# https://github.com/dabeaz/ply/issues/66
+%bcond_without system_ply
+
+# Allow testing whether icu can be unbundled
+%bcond_with system_libicu
+# Allow testing whether libvpx can be unbundled
+%bcond_with system_libvpx
+#Allow minizip to be unbundled
+#mini-compat is going to be removed from fedora 30!
+%if 0%{?fedora} >= 30
+%bcond_with system_minizip
+%else
+%bcond_without system_minizip
+%endif
+#Turn on verbose mode
+%global debug_logs 1
+#Build debug packages for debugging
+%global debug_pkg 1
+# Allow compiling with clang
+%global clang 0
+#Allow building with Fedora compilation flags
+%global fedora_compilation_flags 1
+##############################Package Definitions######################################
+Name: chromium-vaapi
+Version: 69.0.3497.100
+Release: 3%{?dist}
+Summary: A Chromium web browser with video decoding acceleration
+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)
+URL: https://www.chromium.org/Home
+%if %{freeworld}
+Source0: https://commondatastorage.googleapis.com/chromium-browser-official/chromi...
+%else
+Source0: chromium-%{version}-clean.tar.xz
+%endif
+# The following two source files are copied and modified from the chromium source
+Source10: %{name}.sh
+#Add our own appdata file. ##TODO
+Source11: %{name}.appdata.xml
+#Personal stuff
+Source15: LICENSE
+#Video acceleration patch from https://chromium-review.googlesource.com/c/chromium/src/+/532294
+Patch1: vaapi.patch
+Patch2: widevine.patch
+%if %{clang}
+#Will use any clang patch here
+#Fix breaking builds caused by gcc_ar_wrapper.py from upstream
+Patch7: llvm-arflags.patch
+%else
+#Gcc patches area.
+%endif
+#More patches to fix chromium build here
+#remove dependency on unrar. That's a nasty code.
+Patch50: unrar.patch
+#Bootstrap still uses python command
+Patch51: py2-bootstrap.patch
+#This build should be only available to amd64
+ExclusiveArch: x86_64
+########################################################################################
+#Compiler settings
+%if %{clang}
+BuildRequires: clang, llvm, lld
+%else
+#GCC mode on
+# Make sure we don't encounter any bug
+BuildRequires: gcc
+BuildRequires: gcc-c++
+%endif
+# Basic tools and libraries needed for building
+BuildRequires: ninja-build, nodejs, bison, gperf, hwdata
+BuildRequires: libgcc, glibc, libatomic, libstdc++-static
+BuildRequires: libcap-devel, cups-devel, alsa-lib-devel
+BuildRequires: mesa-libGL-devel, mesa-libEGL-devel
+%if %{with system_minizip}
+BuildRequires: minizip-devel
+%endif
+BuildRequires: pkgconfig(gtk+-2.0), pkgconfig(gtk+-3.0)
+BuildRequires: pkgconfig(libexif), pkgconfig(nss)
+BuildRequires: pkgconfig(xtst), pkgconfig(xscrnsaver)
+BuildRequires: pkgconfig(dbus-1), pkgconfig(libudev)
+BuildRequires: pkgconfig(gnome-keyring-1)
+BuildRequires: pkgconfig(libffi)
+# remove_bundled_libraries.py --do-remove
+BuildRequires: python2-rpm-macros
+BuildRequires: python2-beautifulsoup4
+BuildRequires: python2-html5lib
+BuildRequires: python2-markupsafe
+%if %{with system_ply}
+BuildRequires: python2-ply
+%endif
+# replace_gn_files.py --system-libraries
+BuildRequires: flac-devel
+BuildRequires: freetype-devel
+%if %{with system_harfbuzz}
+BuildRequires: harfbuzz-devel
+%endif
+%if %{with system_libicu}
+BuildRequires: libicu-devel
+%endif
+BuildRequires: libdrm-devel
+BuildRequires: libjpeg-turbo-devel
+BuildRequires: libpng-devel
+# Chromium requires libvpx 1.5.0 and some non-default options
+%if %{with system_libvpx}
+BuildRequires: libvpx-devel
+%endif
+BuildRequires: libwebp-devel
+%if %{with system_libxml2}
+BuildRequires: pkgconfig(libxml-2.0)
+%endif
+BuildRequires: pkgconfig(libxslt)
+BuildRequires: opus-devel
+BuildRequires: re2-devel
+BuildRequires: snappy-devel
+BuildRequires: yasm
+BuildRequires: pciutils-devel
+BuildRequires: speech-dispatcher-devel
+BuildRequires: pulseaudio-libs-devel
+# install desktop files
+BuildRequires: desktop-file-utils
+# install AppData files
+BuildRequires: libappstream-glib
+#for vaapi
+BuildRequires: libva-devel
+#Runtime Requirements
+Requires: hicolor-icon-theme
+#Some recommendations
+Recommends: libva-intel-hybrid-driver%{?_isa}
+Recommends: libva-intel-driver%{?_isa}
+%if !%{debug_pkg}
+%global debug_package %{nil}
+%endif
+%description
+chromium-vaapi is an open-source web browser, powered by WebKit (Blink)
+############################################PREP###########################################################
+%prep
+%autosetup -n chromium-%{version} -p1
+#Let's change the default shebang of python files.
+find -depth -type f -name "*.py" -exec sed -iE '1s=^#! */usr/bin/\(python\|env python\)[23]\?=#!%{__python2}=' {} +
+./build/linux/unbundle/remove_bundled_libraries.py --do-remove \
+ base/third_party/dmg_fp \
+ base/third_party/dynamic_annotations \
+ base/third_party/icu \
+ base/third_party/libevent \
+ base/third_party/nspr \
+ base/third_party/superfasthash \
+ base/third_party/symbolize \
+ base/third_party/valgrind \
+ base/third_party/xdg_mime \
+ base/third_party/xdg_user_dirs \
+ buildtools/third_party/libc++ \
+ buildtools/third_party/libc++abi \
+ chrome/third_party/mozilla_security_manager \
+ courgette/third_party \
+ native_client/src/third_party/dlmalloc \
+ native_client/src/third_party/valgrind \
+ net/third_party/http2 \
+ net/third_party/mozilla_security_manager \
+ net/third_party/nss \
+ net/third_party/quic \
+ net/third_party/spdy \
+ third_party/abseil-cpp \
+ third_party/adobe \
+ third_party/analytics \
+ third_party/angle \
+ third_party/angle/src/common/third_party/base \
+ third_party/angle/src/common/third_party/smhasher \
+ third_party/angle/src/third_party/compiler \
+ third_party/angle/src/third_party/libXNVCtrl \
+ third_party/angle/src/third_party/trace_event \
+ third_party/angle/third_party/glslang \
+ third_party/angle/third_party/spirv-headers \
+ third_party/angle/third_party/spirv-tools \
+ third_party/angle/third_party/vulkan-headers \
+ third_party/angle/third_party/vulkan-loader \
+ third_party/angle/third_party/vulkan-tools \
+ third_party/angle/third_party/vulkan-validation-layers \
+ third_party/apple_apsl \
+ third_party/boringssl \
+ third_party/boringssl/src/third_party/fiat \
+ third_party/blink \
+ third_party/breakpad \
+ third_party/breakpad/breakpad/src/third_party/curl \
+ third_party/brotli \
+ third_party/cacheinvalidation \
+ third_party/catapult \
+ third_party/catapult/common/py_vulcanize/third_party/rcssmin \
+ third_party/catapult/common/py_vulcanize/third_party/rjsmin \
+ third_party/catapult/third_party/polymer \
+ third_party/catapult/tracing/third_party/d3 \
+ third_party/catapult/tracing/third_party/gl-matrix \
+ third_party/catapult/tracing/third_party/jszip \
+ third_party/catapult/tracing/third_party/mannwhitneyu \
+ third_party/catapult/tracing/third_party/oboe \
+ third_party/catapult/tracing/third_party/pako \
+ third_party/ced \
+ third_party/cld_3 \
+ third_party/crashpad \
+ third_party/crashpad/crashpad/third_party/zlib \
+ third_party/crc32c \
+ third_party/cros_system_api \
+ third_party/devscripts \
+ third_party/dom_distiller_js \
+ third_party/ffmpeg \
+ third_party/fips181 \
+ third_party/flatbuffers \
+ third_party/flot \
+ third_party/freetype \
+ third_party/glslang-angle \
+ third_party/google_input_tools \
+ third_party/google_input_tools/third_party/closure_library \
+ third_party/google_input_tools/third_party/closure_library/third_party/closure \
+ third_party/googletest \
+%if !%{with system_harfbuzz}
+ third_party/harfbuzz-ng \
+%endif
+ third_party/hunspell \
+ third_party/iccjpeg \
+%if !%{with system_libicu}
+ third_party/icu \
+%endif
+ third_party/inspector_protocol \
+ third_party/jinja2 \
+ third_party/jstemplate \
+ third_party/khronos \
+ third_party/leveldatabase \
+ third_party/libaddressinput \
+ third_party/libaom \
+ third_party/libjingle \
+ third_party/libphonenumber \
+ third_party/libsecret \
+ third_party/libsrtp \
+ third_party/libsync \
+ third_party/libudev \
+%if !%{with system_libvpx}
+ third_party/libvpx \
+ third_party/libvpx/source/libvpx/third_party/x86inc \
+%endif
+ third_party/libwebm \
+%if %{with system_libxml2}
+ third_party/libxml/chromium \
+%else
+ third_party/libxml \
+%endif
+ third_party/libXNVCtrl \
+ third_party/libyuv \
+ third_party/lss \
+ third_party/lzma_sdk \
+ third_party/mesa \
+ third_party/metrics_proto \
+%if !%{with system_minizip}
+ third_party/minizip/ \
+%endif
+ third_party/modp_b64 \
+ third_party/node \
+ third_party/node/node_modules/polymer-bundler/lib/third_party/UglifyJS2 \
+ third_party/openh264 \
+ third_party/openmax_dl \
+ third_party/ots \
+ third_party/pdfium \
+ third_party/pdfium/third_party/agg23 \
+ third_party/pdfium/third_party/base \
+ third_party/pdfium/third_party/bigint \
+ third_party/pdfium/third_party/freetype \
+ third_party/pdfium/third_party/lcms \
+ third_party/pdfium/third_party/libopenjpeg20 \
+ third_party/pdfium/third_party/libpng16 \
+ third_party/pdfium/third_party/libtiff \
+ third_party/pdfium/third_party/skia_shared \
+ third_party/perfetto \
+%if !%{with system_ply}
+ third_party/ply \
+%endif
+ third_party/polymer \
+ third_party/protobuf \
+ third_party/protobuf/third_party/six \
+ third_party/pyjson5 \
+ third_party/qcms \
+ third_party/rnnoise \
+ third_party/s2cellid \
+ third_party/sfntly \
+ third_party/skia \
+ third_party/skia/third_party/gif \
+ third_party/skia/third_party/vulkan \
+ third_party/skia/third_party/skcms \
+ third_party/smhasher \
+ third_party/speech-dispatcher \
+ third_party/spirv-headers \
+ third_party/spirv-tools-angle \
+ third_party/sqlite \
+ third_party/swiftshader \
+ third_party/swiftshader/third_party/llvm-subzero \
+ third_party/swiftshader/third_party/subzero \
+ third_party/tcmalloc \
+ third_party/usb_ids \
+ third_party/usrsctp \
+ third_party/vulkan \
+ third_party/vulkan-validation-layers \
+ third_party/web-animations-js \
+ third_party/webdriver \
+ third_party/WebKit \
+ third_party/webrtc \
+ third_party/widevine \
+ third_party/woff2 \
+ third_party/xdg-utils \
+ third_party/yasm/run_yasm.py \
+ third_party/zlib/google \
+%if !%{with system_minizip}
+ third_party/zlib \
+%endif
+ tools/gn/base/third_party/icu \
+ url/third_party/mozilla \
+ v8/third_party/antlr4 \
+ v8/src/third_party/valgrind \
+ v8/src/third_party/utf8-decoder \
+ v8/third_party/inspector_protocol
+
+./build/linux/unbundle/replace_gn_files.py --system-libraries \
+ flac \
+ freetype \
+ fontconfig \
+%if %{with system_libicu}
+ icu \
+%endif
+ libdrm \
+ libjpeg \
+ libpng \
+%if %{with system_libvpx}
+ libvpx \
+%endif
+ libwebp \
+%if %{with system_libxml2}
+ libxml \
+%endif
+ libxslt \
+ opus \
+ re2 \
+ snappy \
+ yasm \
+%if %{with system_minizip}
+ zlib
+%endif
+
+
+sed -i 's|//third_party/usb_ids|/usr/share/hwdata|g' device/usb/BUILD.gn
+%if %{clang}
+# Remove compiler flags not supported by our system clang
+ sed -i \
+ -e '/"-Wno-ignored-pragma-optimize"/d' \
+ build/config/compiler/BUILD.gn
+%endif
+rmdir third_party/markupsafe
+ln -s %{python2_sitearch}/markupsafe third_party/markupsafe
+%if %{with system_ply}
+rmdir third_party/ply
+ln -s %{python2_sitelib}/ply third_party/ply
+%endif
+# Fix the path to nodejs binary
+mkdir -p third_party/node/linux/node-linux-x64/bin
+ln -s %{_bindir}/node third_party/node/linux/node-linux-x64/bin/node
+# Hard code extra version
+FILE=chrome/common/channel_info_posix.cc
+sed -i.orig -e 's/getenv("CHROME_VERSION_EXTRA")/"Chromium(vaapi) Fedora Project"/' $FILE
+#####################################BUILD#############################################
+%build
+#export compilar variables
+%if %{clang}
+export AR=llvm-ar NM=llvm-nm
+export CC=clang CXX=clang++
+%else
+export AR=ar NM=nm
+export CC=gcc CXX=g++
+%if %{fedora_compilation_flags}
+#Build falgs to make hardened binaries
+#Remove some flags which can create conflicts with chromium gyp flags.
+export CFLAGS="$(echo '%{__global_cflags}' |sed -e 's/-fexceptions//' \
+ -e 's/-Werror=format-security//' \
+ -e 's/-pipe//' \
+ -e 's/-g/-g1/g' \
+ -e 's/-g1record-g1cc-switches//' )"
+export CXXFLAGS="$(echo '%{?__global_cxxflags}%{!?__global_cxxflags:%{__global_cflags}}' | sed -e 's/-fexceptions//' \
+ -e 's/-Werror=format-security//' \
+ -e 's/-pipe//' \
+ -e 's/-g/-g1/g' \
+ -e 's/-g1record-g1cc-switches//' )"
+
+export LDFLAGS='%{__global_ldflags}'
+%else
+export CXXFLAGS=$CXXFLAGS" -fno-delete-null-pointer-checks"
+%endif
+%endif
+gn_args=(
+ is_debug=false
+ use_vaapi=true
+ use_gtk3=true
+ enable_swiftshader=false
+ is_component_build=false
+ use_sysroot=false
+ use_custom_libcxx=false
+ use_aura=true
+ 'system_libdir="%{_lib}"'
+ use_cups=true
+ use_gnome_keyring=true
+ use_gio=true
+ use_kerberos=true
+ use_libpci=true
+ use_pulseaudio=true
+ use_system_freetype=true
+ enable_widevine=true
+%if %{with system_harfbuzz}
+ use_system_harfbuzz=true
+%endif
+%if %{freeworld}
+ 'ffmpeg_branding="Chrome"'
+ proprietary_codecs=true
+%else
+ 'ffmpeg_branding="Chromium"'
+ proprietary_codecs=false
+%endif
+ enable_nacl=false
+ enable_hangout_services_extension=false
+ fatal_linker_warnings=false
+ treat_warnings_as_errors=false
+ linux_use_bundled_binutils=false
+ remove_webcore_debug_symbols=true
+ fieldtrial_testing_like_official_build=true
+ 'custom_toolchain="//build/toolchain/linux/unbundle:default"'
+ 'host_toolchain="//build/toolchain/linux/unbundle:default"'
+ 'google_api_key="%{api_key}"'
+ 'google_default_client_id="%{default_client_id}"'
+ 'google_default_client_secret="%{default_client_secret}"'
+)
+gn_args+=(
+%if %{clang}
+ is_clang=true
+ 'clang_base_path = "/usr"'
+ clang_use_chrome_plugins=false
+%else
+ is_clang=false
+ use_lld=false
+%endif
+)
+
+tools/gn/bootstrap/bootstrap.py --gn-gen-args "${gn_args[*]}"
+%{target}/gn --script-executable=%{__python2} gen --args="${gn_args[*]}" %{target}
+%if %{debug_logs}
+ninja %{_smp_mflags} -C %{target} -v chrome chrome_sandbox chromedriver
+%else
+ninja %{_smp_mflags} -C %{target} chrome chrome_sandbox chromedriver
+%endif
+######################################Install####################################
+%install
+mkdir -p %{buildroot}%{_bindir}
+mkdir -p %{buildroot}%{chromiumdir}/locales
+mkdir -p %{buildroot}%{_mandir}/man1
+mkdir -p %{buildroot}%{_datadir}/metainfo
+mkdir -p %{buildroot}%{_datadir}/applications
+mkdir -p %{buildroot}%{_datadir}/gnome-control-center/default-apps
+sed -e "s|@@CHROMIUMDIR@@|%{chromiumdir}|" -e "s|@@BUILDTARGET@@|`cat /etc/redhat-release`|" \
+ %{SOURCE10} > chromium-vaapi.sh
+install -m 755 chromium-vaapi.sh %{buildroot}%{_bindir}/%{name}
+install -m 644 %{SOURCE11} %{buildroot}%{_datadir}/metainfo
+sed -e "s|@@MENUNAME@@|%{name}|g" -e "s|@@PACKAGE@@|%{name}|g" \
+ chrome/app/resources/manpage.1.in > chrome.1
+install -m 644 chrome.1 %{buildroot}%{_mandir}/man1/%{name}.1
+#Using the template from the source. Still doesn't help in fixing.
+sed -e "s|@@MENUNAME@@|%{name}|g" -e "s|@@PACKAGE@@|%{name}|g" -e "s|@@USR_BIN_SYMLINK_NAME@@|%{name}|g" \
+ chrome/installer/linux/common/desktop.template > %{name}.desktop
+desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{name}.desktop
+sed -e "s|@@MENUNAME@@|%{name}|g" -e "s|@@PACKAGE@@|%{name}|g" -e "s|@@INSTALLDIR@@|%{_bindir}|g" \
+chrome/installer/linux/common/default-app.template > %{name}.xml
+install -m 644 %{name}.xml %{buildroot}%{_datadir}/gnome-control-center/default-apps/
+install -m 755 %{target}/chrome %{buildroot}%{chromiumdir}/%{name}
+install -m 4755 %{target}/chrome_sandbox %{buildroot}%{chromiumdir}/chrome-sandbox
+install -m 755 %{target}/chromedriver %{buildroot}%{chromiumdir}/
+%if !%{with system_libicu}
+install -m 644 %{target}/icudtl.dat %{buildroot}%{chromiumdir}/
+%endif
+install -m 644 %{target}/natives_blob.bin %{buildroot}%{chromiumdir}/
+install -m 644 %{target}/v8_context_snapshot.bin %{buildroot}%{chromiumdir}/
+install -m 644 %{target}/*.pak %{buildroot}%{chromiumdir}/
+install -m 644 %{target}/locales/*.pak %{buildroot}%{chromiumdir}/locales/
+install -m 644 %{target}/xdg* %{buildroot}%{chromiumdir}/
+for i in 16 32; do
+ mkdir -p %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps
+ install -m 644 chrome/app/theme/default_100_percent/chromium/product_logo_$i.png \
+ %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/%{name}.png
+done
+for i in 22 24 32 48 64 128 256; do
+ if [ ${i} = 32 ]; then ext=xpm; else ext=png; fi
+ if [ ${i} = 32 ]; then dir=linux/; else dir=; fi
+ mkdir -p %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps
+ install -m 644 chrome/app/theme/chromium/${dir}product_logo_$i.${ext} \
+ %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/%{name}.${ext}
+done
+####################################check##################################################
+%check
+appstream-util validate-relax --nonet "%{buildroot}%{_datadir}/metainfo/%{name}.appdata.xml"
+######################################files################################################
+%files
+%license LICENSE
+%doc AUTHORS
+%{_bindir}/chromium-vaapi
+%{_datadir}/metainfo/chromium-vaapi.appdata.xml
+%{_datadir}/applications/chromium-vaapi.desktop
+%{_datadir}/gnome-control-center/default-apps/chromium-vaapi.xml
+%{_datadir}/icons/hicolor/16x16/apps/chromium-vaapi.png
+%{_datadir}/icons/hicolor/22x22/apps/chromium-vaapi.png
+%{_datadir}/icons/hicolor/24x24/apps/chromium-vaapi.png
+%{_datadir}/icons/hicolor/32x32/apps/chromium-vaapi.png
+%{_datadir}/icons/hicolor/32x32/apps/chromium-vaapi.xpm
+%{_datadir}/icons/hicolor/48x48/apps/chromium-vaapi.png
+%{_datadir}/icons/hicolor/64x64/apps/chromium-vaapi.png
+%{_datadir}/icons/hicolor/128x128/apps/chromium-vaapi.png
+%{_datadir}/icons/hicolor/256x256/apps/chromium-vaapi.png
+%{_mandir}/man1/chromium-vaapi.1.gz
+%dir %{chromiumdir}
+%{chromiumdir}/chromium-vaapi
+%{chromiumdir}/chrome-sandbox
+%{chromiumdir}/chromedriver
+%if !%{with system_libicu}
+%{chromiumdir}/icudtl.dat
+%endif
+%{chromiumdir}/natives_blob.bin
+%{chromiumdir}/v8_context_snapshot.bin
+%{chromiumdir}/*.pak
+%{chromiumdir}/xdg-mime
+%{chromiumdir}/xdg-settings
+%dir %{chromiumdir}/locales
+%{chromiumdir}/locales/*.pak
+#########################################changelogs#################################################
+%changelog
+* Fri Sep 28 2018 Akarshan Biswas <akarshan.biswas(a)hotmail.com> 69.0.3497.100-3
+- Remove dependency on minizip-compat package(https://bugzilla.redhat.com/show_bug.cgi?id=1632170)
+- Add conditions to build with{out} system minizip
+
+* Sat Sep 22 2018 Akarshan Biswas <akarshan.biswas(a)hotmail.com> 69.0.3497.100-2
+- Produce an entire new package with unique appdata
+- Use desktop and default app template from the source
+- enable debug builds
+- Update chromium wrapper
+- Remove dependent on unrar
+
+* Tue Sep 18 2018 Akarshan Biswas <akarshan.biswas(a)hotmail.com> 69.0.3497.100-1
+- Updated chromium to 69.0.3497.100.
+- Enabled fedora GCC build flags and removed those flags which can cause confict with chromium's gyp flags.
+- Removed some duplicate flags and added g1 to ease memory which building.
+
+* Thu Sep 13 2018 Akarshan Biswas <akarshan.biswas(a)hotmail.com> 69.0.3497.92-1
+- updated chromium to 69.0.3497.92
+- fixed vaapi patch
+- Moved appstream validation to check
+
+* Thu Sep 06 2018 Akarshan Biswas <akarshan.biswas(a)hotmail.com> 69.0.3497.81-1
+- updated chromium to 69.0.3497.81
+- removed useless requirements
+- turned on verbose
+- removed conditions on obsolete fedora releases
+- fixed fedora compilation flags
+
+* Wed Aug 29 2018 Akarshan Biswas <akarshan.biswas(a)hotmail.com> 68.0.3440.106-1
+- Deleted provides and excludes and added conflict
diff --git a/py2-bootstrap.patch b/py2-bootstrap.patch
new file mode 100644
index 0000000..8a5db71
--- /dev/null
+++ b/py2-bootstrap.patch
@@ -0,0 +1,33 @@
+diff -up chromium-69.0.3497.81/third_party/catapult/common/py_vulcanize/py_vulcanize/generate.py.py2 chromium-69.0.3497.81/third_party/catapult/common/py_vulcanize/py_vulcanize/generate.py
+--- chromium-69.0.3497.81/third_party/catapult/common/py_vulcanize/py_vulcanize/generate.py.py2 2018-09-06 10:45:17.919774145 -0400
++++ chromium-69.0.3497.81/third_party/catapult/common/py_vulcanize/py_vulcanize/generate.py 2018-09-06 10:45:17.914774254 -0400
+@@ -58,7 +58,7 @@ def _MinifyJS(input_js):
+
+ with tempfile.NamedTemporaryFile() as _:
+ args = [
+- 'python',
++ 'python2',
+ rjsmin_path
+ ]
+ p = subprocess.Popen(args,
+@@ -177,7 +177,7 @@ def _MinifyCSS(css_text):
+ os.path.join(py_vulcanize_path, 'third_party', 'rcssmin', 'rcssmin.py'))
+
+ with tempfile.NamedTemporaryFile() as _:
+- rcssmin_args = ['python', rcssmin_path]
++ rcssmin_args = ['python2', rcssmin_path]
+ p = subprocess.Popen(rcssmin_args,
+ stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE,
+diff -up chromium-69.0.3497.81/tools/gn/bootstrap/bootstrap.py.py2 chromium-69.0.3497.81/tools/gn/bootstrap/bootstrap.py
+--- chromium-69.0.3497.81/tools/gn/bootstrap/bootstrap.py.py2 2018-09-06 10:44:42.225550561 -0400
++++ chromium-69.0.3497.81/tools/gn/bootstrap/bootstrap.py 2018-09-06 13:06:24.251636231 -0400
+@@ -87,7 +87,7 @@ def main(argv):
+ if not options.debug:
+ gn_gen_args += ' is_debug=false'
+ subprocess.check_call([
+- gn_path, 'gen', out_dir,
++ gn_path, 'gen', out_dir, ' --script-executable=/usr/bin/python2',
+ '--args=%s' % gn_gen_args, "--root=" + SRC_ROOT
+ ])
+
diff --git a/sources b/sources
index e69de29..7d1e885 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+1779724693bdcf7b4e01ea1133abdde2 chromium-69.0.3497.100.tar.xz
diff --git a/unrar.patch b/unrar.patch
new file mode 100644
index 0000000..5951ab4
--- /dev/null
+++ b/unrar.patch
@@ -0,0 +1,186 @@
+diff --git a/chrome/browser/safe_browsing/download_protection/check_client_download_request.cc b/chrome/browser/safe_browsing/download_protection/check_client_download_request.cc
+index f5aaff83c87a..737e168ec5aa 100644
+--- a/chrome/browser/safe_browsing/download_protection/check_client_download_request.cc
++++ b/chrome/browser/safe_browsing/download_protection/check_client_download_request.cc
+@@ -379,10 +379,6 @@ void CheckClientDownloadRequest::AnalyzeFile() {
+ // are enabled.
+ if (item_->GetTargetFilePath().MatchesExtension(FILE_PATH_LITERAL(".zip"))) {
+ StartExtractZipFeatures();
+- } else if (item_->GetTargetFilePath().MatchesExtension(
+- FILE_PATH_LITERAL(".rar")) &&
+- base::FeatureList::IsEnabled(kInspectDownloadedRarFiles)) {
+- StartExtractRarFeatures();
+ #if defined(OS_MACOSX)
+ } else if (item_->GetTargetFilePath().MatchesExtension(
+ FILE_PATH_LITERAL(".dmg")) ||
+@@ -499,71 +495,6 @@ void CheckClientDownloadRequest::ExtractFileFeatures(
+ OnFileFeatureExtractionDone();
+ }
+
+-void CheckClientDownloadRequest::StartExtractRarFeatures() {
+- DCHECK_CURRENTLY_ON(BrowserThread::UI);
+- DCHECK(item_); // Called directly from Start(), item should still exist.
+- rar_analysis_start_time_ = base::TimeTicks::Now();
+- // We give the rar analyzer a weak pointer to this object. Since the
+- // analyzer is refcounted, it might outlive the request.
+- rar_analyzer_ = new SandboxedRarAnalyzer(
+- item_->GetFullPath(),
+- base::BindRepeating(&CheckClientDownloadRequest::OnRarAnalysisFinished,
+- weakptr_factory_.GetWeakPtr()),
+- content::ServiceManagerConnection::GetForProcess()->GetConnector());
+- rar_analyzer_->Start();
+-}
+-
+-void CheckClientDownloadRequest::OnRarAnalysisFinished(
+- const ArchiveAnalyzerResults& results) {
+- DCHECK_CURRENTLY_ON(BrowserThread::UI);
+- if (item_ == nullptr) {
+- PostFinishTask(DownloadCheckResult::UNKNOWN, REASON_REQUEST_CANCELED);
+- return;
+- }
+- if (!service_)
+- return;
+-
+- archive_is_valid_ =
+- (results.success ? ArchiveValid::VALID : ArchiveValid::INVALID);
+- archived_executable_ = results.has_executable;
+- CopyArchivedBinaries(results.archived_binary, &archived_binaries_);
+- DVLOG(1) << "Rar analysis finished for " << item_->GetFullPath().value()
+- << ", has_executable=" << results.has_executable
+- << ", has_archive=" << results.has_archive
+- << ", success=" << results.success;
+-
+- if (archived_executable_) {
+- UMA_HISTOGRAM_COUNTS_100("SBClientDownload.RarFileArchivedBinariesCount",
+- results.archived_binary.size());
+- }
+- UMA_HISTOGRAM_BOOLEAN("SBClientDownload.RarFileSuccess", results.success);
+- UMA_HISTOGRAM_BOOLEAN("SBClientDownload.RarFileHasExecutable",
+- archived_executable_);
+- UMA_HISTOGRAM_BOOLEAN("SBClientDownload.RarFileHasArchiveButNoExecutable",
+- results.has_archive && !archived_executable_);
+- UMA_HISTOGRAM_TIMES("SBClientDownload.ExtractRarFeaturesTime",
+- base::TimeTicks::Now() - rar_analysis_start_time_);
+- for (const auto& file_name : results.archived_archive_filenames)
+- RecordArchivedArchiveFileExtensionType(file_name);
+-
+- if (!archived_executable_) {
+- if (results.has_archive) {
+- type_ = ClientDownloadRequest::RAR_COMPRESSED_ARCHIVE;
+- } else if (!results.success) {
+- // .rar files that look invalid to Chrome may be successfully unpacked by
+- // other archive tools, so they may be a real threat.
+- type_ = ClientDownloadRequest::INVALID_RAR;
+- } else {
+- // Normal rar w/o EXEs, or invalid rar and not extended-reporting.
+- PostFinishTask(DownloadCheckResult::UNKNOWN,
+- REASON_ARCHIVE_WITHOUT_BINARIES);
+- return;
+- }
+- }
+-
+- OnFileFeatureExtractionDone();
+-}
+-
+ void CheckClientDownloadRequest::StartExtractZipFeatures() {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ DCHECK(item_); // Called directly from Start(), item should still exist.
+diff --git a/chrome/browser/safe_browsing/download_protection/check_client_download_request.h b/chrome/browser/safe_browsing/download_protection/check_client_download_request.h
+index 9042d5d589ab..1c50dcff4312 100644
+--- a/chrome/browser/safe_browsing/download_protection/check_client_download_request.h
++++ b/chrome/browser/safe_browsing/download_protection/check_client_download_request.h
+@@ -148,7 +148,6 @@ class CheckClientDownloadRequest
+ scoped_refptr<SafeBrowsingDatabaseManager> database_manager_;
+ const bool pingback_enabled_;
+ std::unique_ptr<network::SimpleURLLoader> loader_;
+- scoped_refptr<SandboxedRarAnalyzer> rar_analyzer_;
+ scoped_refptr<SandboxedZipAnalyzer> zip_analyzer_;
+ base::TimeTicks rar_analysis_start_time_;
+ base::TimeTicks zip_analysis_start_time_;
+diff --git a/chrome/common/safe_browsing/BUILD.gn b/chrome/common/safe_browsing/BUILD.gn
+index 92cc4f57d03b..4780e931e9e7 100644
+--- a/chrome/common/safe_browsing/BUILD.gn
++++ b/chrome/common/safe_browsing/BUILD.gn
+@@ -68,7 +68,6 @@ if (safe_browsing_mode == 1) {
+ ":file_type_policies",
+ "//base",
+ "//base:i18n",
+- "//third_party/unrar:unrar",
+ ]
+
+ defines = [
+@@ -121,7 +120,6 @@ source_set("safe_browsing") {
+ deps += [
+ ":archive_analyzer_results",
+ ":download_protection_util",
+- ":rar_analyzer",
+ "//components/safe_browsing:features",
+ ]
+
+diff --git a/chrome/services/file_util/public/cpp/BUILD.gn b/chrome/services/file_util/public/cpp/BUILD.gn
+index 158cbfc6d157..6d8b0df7c59e 100644
+--- a/chrome/services/file_util/public/cpp/BUILD.gn
++++ b/chrome/services/file_util/public/cpp/BUILD.gn
+@@ -14,8 +14,6 @@ source_set("cpp") {
+ sources = [
+ "sandboxed_dmg_analyzer_mac.cc",
+ "sandboxed_dmg_analyzer_mac.h",
+- "sandboxed_rar_analyzer.cc",
+- "sandboxed_rar_analyzer.h",
+ "sandboxed_zip_analyzer.cc",
+ "sandboxed_zip_analyzer.h",
+ ]
+@@ -35,7 +33,6 @@ source_set("unit_tests") {
+
+ sources = [
+ "sandboxed_dmg_analyzer_mac_unittest.cc",
+- "sandboxed_rar_analyzer_unittest.cc",
+ "sandboxed_zip_analyzer_unittest.cc",
+ ]
+
+diff --git a/chrome/services/file_util/public/mojom/safe_archive_analyzer.mojom b/chrome/services/file_util/public/mojom/safe_archive_analyzer.mojom
+index 6983f7b415d4..15d5aaba3657 100644
+--- a/chrome/services/file_util/public/mojom/safe_archive_analyzer.mojom
++++ b/chrome/services/file_util/public/mojom/safe_archive_analyzer.mojom
+@@ -22,11 +22,6 @@ interface SafeArchiveAnalyzer {
+ // for malicious download protection.
+ AnalyzeDmgFile(mojo_base.mojom.File dmg_file)
+ => (SafeArchiveAnalyzerResults results);
+-
+- // Build flag FULL_SAFE_BROWSING: Analyze the |rar_file| for malicious
+- // download protection.
+- AnalyzeRarFile(mojo_base.mojom.File rar_file)
+- => (SafeArchiveAnalyzerResults results);
+ };
+
+ [Native]
+diff --git a/chrome/services/file_util/safe_archive_analyzer.cc b/chrome/services/file_util/safe_archive_analyzer.cc
+index a13b42b197b3..db49c37b9b49 100644
+--- a/chrome/services/file_util/safe_archive_analyzer.cc
++++ b/chrome/services/file_util/safe_archive_analyzer.cc
+@@ -44,12 +44,3 @@ void SafeArchiveAnalyzer::AnalyzeDmgFile(base::File dmg_file,
+ NOTREACHED();
+ #endif
+ }
+-
+-void SafeArchiveAnalyzer::AnalyzeRarFile(base::File rar_file,
+- AnalyzeRarFileCallback callback) {
+- DCHECK(rar_file.IsValid());
+-
+- safe_browsing::ArchiveAnalyzerResults results;
+- safe_browsing::rar_analyzer::AnalyzeRarFile(std::move(rar_file), &results);
+- std::move(callback).Run(results);
+-}
+diff --git a/chrome/services/file_util/safe_archive_analyzer.h b/chrome/services/file_util/safe_archive_analyzer.h
+index f21efa6f57ba..2eda4f378bcc 100644
+--- a/chrome/services/file_util/safe_archive_analyzer.h
++++ b/chrome/services/file_util/safe_archive_analyzer.h
+@@ -25,8 +25,6 @@ class SafeArchiveAnalyzer : public chrome::mojom::SafeArchiveAnalyzer {
+ AnalyzeZipFileCallback callback) override;
+ void AnalyzeDmgFile(base::File dmg_file,
+ AnalyzeDmgFileCallback callback) override;
+- void AnalyzeRarFile(base::File rar_file,
+- AnalyzeRarFileCallback callback) override;
+
+ const std::unique_ptr<service_manager::ServiceContextRef> service_ref_;
+
diff --git a/vaapi.patch b/vaapi.patch
new file mode 100644
index 0000000..70d0cfb
--- /dev/null
+++ b/vaapi.patch
@@ -0,0 +1,542 @@
+diff -ur chromium-69.0.3497.92-orig/chrome/browser/about_flags.cc chromium-69.0.3497.92/chrome/browser/about_flags.cc
+--- chromium-69.0.3497.92-orig/chrome/browser/about_flags.cc 2018-09-12 00:39:23.000000000 +0530
++++ chromium-69.0.3497.92/chrome/browser/about_flags.cc 2018-09-13 22:10:33.938016199 +0530
+@@ -1238,12 +1238,14 @@
+ {"ui-disable-partial-swap", flag_descriptions::kUiPartialSwapName,
+ flag_descriptions::kUiPartialSwapDescription, kOsAll,
+ SINGLE_DISABLE_VALUE_TYPE(switches::kUIDisablePartialSwap)},
++#if defined(OS_CHROMEOS) || defined(OS_ANDROID)
+ {"disable-webrtc-hw-decoding", flag_descriptions::kWebrtcHwDecodingName,
+ flag_descriptions::kWebrtcHwDecodingDescription, kOsAndroid | kOsCrOS,
+ SINGLE_DISABLE_VALUE_TYPE(switches::kDisableWebRtcHWDecoding)},
+ {"disable-webrtc-hw-encoding", flag_descriptions::kWebrtcHwEncodingName,
+ flag_descriptions::kWebrtcHwEncodingDescription, kOsAndroid | kOsCrOS,
+ SINGLE_DISABLE_VALUE_TYPE(switches::kDisableWebRtcHWEncoding)},
++#endif
+ {"enable-webrtc-hw-h264-encoding",
+ flag_descriptions::kWebrtcHwH264EncodingName,
+ flag_descriptions::kWebrtcHwH264EncodingDescription, kOsAndroid | kOsCrOS,
+@@ -1612,6 +1614,13 @@
+ flag_descriptions::kShowTouchHudDescription, kOsCrOS,
+ SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud)},
+ #endif // OS_CHROMEOS
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++ {
++ "enable-accelerated-video", flag_descriptions::kAcceleratedVideoName,
++ flag_descriptions::kAcceleratedVideoDescription, kOsLinux,
++ SINGLE_VALUE_TYPE(switches::kEnableAcceleratedVideo),
++ },
++#else
+ {
+ "disable-accelerated-video-decode",
+ flag_descriptions::kAcceleratedVideoDecodeName,
+@@ -1619,6 +1628,7 @@
+ kOsMac | kOsWin | kOsCrOS | kOsAndroid,
+ SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
+ },
++#endif
+ #if defined(OS_WIN)
+ {"enable-hdr", flag_descriptions::kEnableHDRName,
+ flag_descriptions::kEnableHDRDescription, kOsWin,
+@@ -2291,12 +2301,17 @@
+ FEATURE_VALUE_TYPE(features::kOpenVR)},
+ #endif // ENABLE_OPENVR
+ #endif // ENABLE_VR
+-#if defined(OS_CHROMEOS)
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++ {"enable-accelerated-mjpeg-decode",
++ flag_descriptions::kAcceleratedMjpegDecodeName,
++ flag_descriptions::kAcceleratedMjpegDecodeDescription, kOsLinux,
++ SINGLE_VALUE_TYPE(switches::kEnableAcceleratedMjpegDecode)},
++#elif defined(OS_CHROMEOS)
+ {"disable-accelerated-mjpeg-decode",
+ flag_descriptions::kAcceleratedMjpegDecodeName,
+ flag_descriptions::kAcceleratedMjpegDecodeDescription, kOsCrOS,
+ SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedMjpegDecode)},
+-#endif // OS_CHROMEOS
++#endif
+ {"v8-cache-options", flag_descriptions::kV8CacheOptionsName,
+ flag_descriptions::kV8CacheOptionsDescription, kOsAll,
+ MULTI_VALUE_TYPE(kV8CacheOptionsChoices)},
+Only in chromium-69.0.3497.92/chrome/browser: about_flags.cc.orig
+diff -ur chromium-69.0.3497.92-orig/chrome/browser/chromeos/login/chrome_restart_request.cc chromium-69.0.3497.92/chrome/browser/chromeos/login/chrome_restart_request.cc
+--- chromium-69.0.3497.92-orig/chrome/browser/chromeos/login/chrome_restart_request.cc 2018-09-12 00:39:23.000000000 +0530
++++ chromium-69.0.3497.92/chrome/browser/chromeos/login/chrome_restart_request.cc 2018-09-13 22:10:33.986014728 +0530
+@@ -19,6 +19,7 @@
+ #include "base/sys_info.h"
+ #include "base/timer/timer.h"
+ #include "base/values.h"
++#include "build/build_config.h"
+ #include "cc/base/switches.h"
+ #include "chrome/browser/browser_process.h"
+ #include "chrome/browser/chromeos/boot_times_recorder.h"
+@@ -84,9 +85,14 @@
+ ::switches::kDisable2dCanvasImageChromium,
+ ::switches::kDisableAccelerated2dCanvas,
+ ::switches::kDisableAcceleratedJpegDecoding,
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++ ::switches::kEnableAcceleratedMjpegDecode,
++ ::switches::kEnableAcceleratedVideo,
++#else
+ ::switches::kDisableAcceleratedMjpegDecode,
+ ::switches::kDisableAcceleratedVideoDecode,
+ ::switches::kDisableAcceleratedVideoEncode,
++#endif
+ ::switches::kDisableBlinkFeatures,
+ ::switches::kDisableCastStreamingHWEncoding,
+ ::switches::kDisableGpu,
+@@ -160,8 +166,10 @@
+ ::switches::kEnableWebGLImageChromium,
+ ::switches::kEnableWebVR,
+ ::switches::kEnableUnsafeWebGPU,
++#if (defined(OS_CHROMEOS) || defined(OS_ANDROID))
+ ::switches::kDisableWebRtcHWDecoding,
+ ::switches::kDisableWebRtcHWEncoding,
++#endif
+ ::switches::kOzonePlatform,
+ ash::switches::kAshEnableTabletMode,
+ ash::switches::kAshEnableWaylandServer,
+diff -ur chromium-69.0.3497.92-orig/chrome/browser/flag_descriptions.cc chromium-69.0.3497.92/chrome/browser/flag_descriptions.cc
+--- chromium-69.0.3497.92-orig/chrome/browser/flag_descriptions.cc 2018-09-12 00:39:24.000000000 +0530
++++ chromium-69.0.3497.92/chrome/browser/flag_descriptions.cc 2018-09-13 22:10:34.007014085 +0530
+@@ -14,6 +14,13 @@
+ "Enables the use of the GPU to perform 2d canvas rendering instead of "
+ "using software rendering.";
+
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++const char kAcceleratedVideoName[] = "Hardware-accelerated video";
++const char kAcceleratedVideoDescription[] =
++ "Hardware-accelerated video where VA-API driver is installed on the"
++ "system.";
++#endif
++
+ const char kAcceleratedVideoDecodeName[] = "Hardware-accelerated video decode";
+ const char kAcceleratedVideoDecodeDescription[] =
+ "Hardware-accelerated video decode where available.";
+@@ -1986,6 +1993,7 @@
+ const char kWebrtcEchoCanceller3Description[] =
+ "Experimental WebRTC echo canceller (AEC3).";
+
++#if defined(OS_CHROMEOS) || defined(OS_ANDROID)
+ const char kWebrtcHwDecodingName[] = "WebRTC hardware video decoding";
+ const char kWebrtcHwDecodingDescription[] =
+ "Support in WebRTC for decoding video streams using platform hardware.";
+@@ -1993,6 +2001,7 @@
+ const char kWebrtcHwEncodingName[] = "WebRTC hardware video encoding";
+ const char kWebrtcHwEncodingDescription[] =
+ "Support in WebRTC for encoding video streams using platform hardware.";
++#endif
+
+ const char kWebrtcHwH264EncodingName[] = "WebRTC hardware h264 video encoding";
+ const char kWebrtcHwH264EncodingDescription[] =
+@@ -2892,14 +2901,16 @@
+
+ // Chrome OS -------------------------------------------------------------------
+
+-#if defined(OS_CHROMEOS)
++#if defined(OS_CHROMEOS) || (defined(OS_LINUX) && !defined(OS_ANDROID))
+
+ const char kAcceleratedMjpegDecodeName[] =
+ "Hardware-accelerated mjpeg decode for captured frame";
+ const char kAcceleratedMjpegDecodeDescription[] =
+ "Enable hardware-accelerated mjpeg decode for captured frame where "
+ "available.";
++#endif
+
++#if defined(OS_CHROMEOS)
+ const char kAllowTouchpadThreeFingerClickName[] = "Touchpad three-finger-click";
+ const char kAllowTouchpadThreeFingerClickDescription[] =
+ "Enables touchpad three-finger-click as middle button.";
+diff -ur chromium-69.0.3497.92-orig/chrome/browser/flag_descriptions.h chromium-69.0.3497.92/chrome/browser/flag_descriptions.h
+--- chromium-69.0.3497.92-orig/chrome/browser/flag_descriptions.h 2018-09-12 00:39:24.000000000 +0530
++++ chromium-69.0.3497.92/chrome/browser/flag_descriptions.h 2018-09-13 22:10:34.030013380 +0530
+@@ -37,6 +37,10 @@
+ extern const char kAccelerated2dCanvasName[];
+ extern const char kAccelerated2dCanvasDescription[];
+
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++extern const char kAcceleratedVideoName[];
++extern const char kAcceleratedVideoDescription[];
++#endif
+ extern const char kAcceleratedVideoDecodeName[];
+ extern const char kAcceleratedVideoDecodeDescription[];
+
+@@ -1762,13 +1766,17 @@
+
+ #endif // defined(OS_MACOSX)
+
+-// Chrome OS ------------------------------------------------------------------
+-
+-#if defined(OS_CHROMEOS)
++#if defined(OS_CHROMEOS) || (defined(OS_LINUX) && !defined(OS_ANDROID))
+
+ extern const char kAcceleratedMjpegDecodeName[];
+ extern const char kAcceleratedMjpegDecodeDescription[];
+
++#endif
++
++// Chrome OS ------------------------------------------------------------------
++
++#if defined(OS_CHROMEOS)
++
+ extern const char kAllowTouchpadThreeFingerClickName[];
+ extern const char kAllowTouchpadThreeFingerClickDescription[];
+
+diff -ur chromium-69.0.3497.92-orig/content/browser/gpu/compositor_util.cc chromium-69.0.3497.92/content/browser/gpu/compositor_util.cc
+--- chromium-69.0.3497.92-orig/content/browser/gpu/compositor_util.cc 2018-09-12 00:39:41.000000000 +0530
++++ chromium-69.0.3497.92/content/browser/gpu/compositor_util.cc 2018-09-13 22:10:34.072012092 +0530
+@@ -149,7 +149,11 @@
+ {"video_decode",
+ SafeGetFeatureStatus(gpu_feature_info,
+ gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE),
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++ !command_line.HasSwitch(switches::kEnableAcceleratedVideo),
++#else
+ command_line.HasSwitch(switches::kDisableAcceleratedVideoDecode),
++#endif
+ "Accelerated video decode has been disabled, either via blacklist, "
+ "about:flags or the command line.",
+ true, true},
+diff -ur chromium-69.0.3497.92-orig/content/browser/gpu/gpu_process_host.cc chromium-69.0.3497.92/content/browser/gpu/gpu_process_host.cc
+--- chromium-69.0.3497.92-orig/content/browser/gpu/gpu_process_host.cc 2018-09-12 00:39:41.000000000 +0530
++++ chromium-69.0.3497.92/content/browser/gpu/gpu_process_host.cc 2018-09-13 22:10:34.113010836 +0530
+@@ -209,7 +209,9 @@
+ switches::kDisableLogging,
+ switches::kDisableShaderNameHashing,
+ switches::kDisableSkiaRuntimeOpts,
++#if !defined(OS_LINUX)
+ switches::kDisableWebRtcHWEncoding,
++#endif
+ #if defined(OS_WIN)
+ switches::kEnableAcceleratedVpxDecode,
+ #endif
+diff -ur chromium-69.0.3497.92-orig/content/browser/renderer_host/media/video_capture_browsertest.cc chromium-69.0.3497.92/content/browser/renderer_host/media/video_capture_browsertest.cc
+--- chromium-69.0.3497.92-orig/content/browser/renderer_host/media/video_capture_browsertest.cc 2018-09-12 00:39:41.000000000 +0530
++++ chromium-69.0.3497.92/content/browser/renderer_host/media/video_capture_browsertest.cc 2018-09-13 22:10:34.124010499 +0530
+@@ -165,8 +165,13 @@
+ base::CommandLine::ForCurrentProcess()->AppendSwitch(
+ switches::kUseFakeJpegDecodeAccelerator);
+ } else {
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++ base::CommandLine::ForCurrentProcess()->AppendSwitch(
++ switches::kEnableAcceleratedMjpegDecode);
++#else
+ base::CommandLine::ForCurrentProcess()->AppendSwitch(
+ switches::kDisableAcceleratedMjpegDecode);
++#endif
+ }
+ }
+
+diff -ur chromium-69.0.3497.92-orig/content/browser/renderer_host/render_process_host_impl.cc chromium-69.0.3497.92/content/browser/renderer_host/render_process_host_impl.cc
+--- chromium-69.0.3497.92-orig/content/browser/renderer_host/render_process_host_impl.cc 2018-09-12 00:39:41.000000000 +0530
++++ chromium-69.0.3497.92/content/browser/renderer_host/render_process_host_impl.cc 2018-09-13 22:10:34.133010223 +0530
+@@ -2798,7 +2798,11 @@
+ switches::kDefaultTileHeight,
+ switches::kDisable2dCanvasImageChromium,
+ switches::kDisableAcceleratedJpegDecoding,
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++ switches::kEnableAcceleratedVideo,
++#else
+ switches::kDisableAcceleratedVideoDecode,
++#endif
+ switches::kDisableBackgroundTasks,
+ switches::kDisableBackgroundTimerThrottling,
+ switches::kDisableBreakpad,
+@@ -2933,8 +2937,10 @@
+ #if BUILDFLAG(ENABLE_RUNTIME_MEDIA_RENDERER_SELECTION)
+ switches::kDisableMojoRenderer,
+ #endif
++#if !defined(OS_LINUX) || defined(OS_CHROMEOS)
+ switches::kDisableWebRtcHWDecoding,
+ switches::kDisableWebRtcHWEncoding,
++#endif
+ switches::kEnableWebRtcSrtpAesGcm,
+ switches::kEnableWebRtcSrtpEncryptedHeaders,
+ switches::kEnableWebRtcStunOrigin,
+Only in chromium-69.0.3497.92/content/browser/renderer_host: render_process_host_impl.cc.orig
+diff -ur chromium-69.0.3497.92-orig/content/browser/utility_process_host.cc chromium-69.0.3497.92/content/browser/utility_process_host.cc
+--- chromium-69.0.3497.92-orig/content/browser/utility_process_host.cc 2018-09-12 00:39:41.000000000 +0530
++++ chromium-69.0.3497.92/content/browser/utility_process_host.cc 2018-09-13 22:10:34.296005227 +0530
+@@ -296,7 +296,11 @@
+ switches::kOverrideUseSoftwareGLForTests,
+ switches::kOverrideEnabledCdmInterfaceVersion,
+ switches::kProxyServer,
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++ switches::kEnableAcceleratedMjpegDecode,
++#else
+ switches::kDisableAcceleratedMjpegDecode,
++#endif
+ switches::kUseFakeDeviceForMediaStream,
+ switches::kUseFakeJpegDecodeAccelerator,
+ switches::kUseFileForFakeVideoCapture,
+diff -ur chromium-69.0.3497.92-orig/content/browser/webrtc/webrtc_media_recorder_browsertest.cc chromium-69.0.3497.92/content/browser/webrtc/webrtc_media_recorder_browsertest.cc
+--- chromium-69.0.3497.92-orig/content/browser/webrtc/webrtc_media_recorder_browsertest.cc 2018-09-12 00:39:41.000000000 +0530
++++ chromium-69.0.3497.92/content/browser/webrtc/webrtc_media_recorder_browsertest.cc 2018-09-13 22:10:34.143009916 +0530
+@@ -66,7 +66,12 @@
+ return;
+ // This flag is also used for encoding, https://crbug.com/616640.
+ base::CommandLine::ForCurrentProcess()->AppendSwitch(
+- switches::kDisableAcceleratedVideoDecode);
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++ switches::kEnableAcceleratedVideo
++#else
++ switches::kDisableAcceleratedVideoDecode
++#endif
++ );
+ }
+
+ private:
+diff -ur chromium-69.0.3497.92-orig/content/gpu/BUILD.gn chromium-69.0.3497.92/content/gpu/BUILD.gn
+--- chromium-69.0.3497.92-orig/content/gpu/BUILD.gn 2018-09-12 00:39:41.000000000 +0530
++++ chromium-69.0.3497.92/content/gpu/BUILD.gn 2018-09-13 22:10:34.148009763 +0530
+@@ -133,4 +133,8 @@
+ (!is_chromecast || is_cast_desktop_build)) {
+ configs += [ "//build/config/linux/dri" ]
+ }
++
++ if (is_desktop_linux) {
++ public_configs = [ "//media/gpu:libva_config" ]
++ }
+ }
+diff -ur chromium-69.0.3497.92-orig/content/gpu/gpu_main.cc chromium-69.0.3497.92/content/gpu/gpu_main.cc
+--- chromium-69.0.3497.92-orig/content/gpu/gpu_main.cc 2018-09-12 00:39:41.000000000 +0530
++++ chromium-69.0.3497.92/content/gpu/gpu_main.cc 2018-09-13 22:10:34.153009610 +0530
+@@ -284,7 +284,7 @@
+
+ base::PlatformThread::SetName("CrGpuMain");
+
+-#if defined(OS_ANDROID) || defined(OS_CHROMEOS)
++#if defined(OS_LINUX)
+ // Set thread priority before sandbox initialization.
+ base::PlatformThread::SetCurrentThreadPriority(base::ThreadPriority::DISPLAY);
+ #endif
+@@ -317,7 +317,7 @@
+ GetContentClient()->SetGpuInfo(gpu_init->gpu_info());
+
+ base::ThreadPriority io_thread_priority = base::ThreadPriority::NORMAL;
+-#if defined(OS_ANDROID) || defined(OS_CHROMEOS)
++#if defined(OS_LINUX)
+ io_thread_priority = base::ThreadPriority::DISPLAY;
+ #endif
+
+diff -ur chromium-69.0.3497.92-orig/content/public/browser/gpu_utils.cc chromium-69.0.3497.92/content/public/browser/gpu_utils.cc
+--- chromium-69.0.3497.92-orig/content/public/browser/gpu_utils.cc 2018-09-12 00:39:42.000000000 +0530
++++ chromium-69.0.3497.92/content/public/browser/gpu_utils.cc 2018-09-13 22:10:34.164009273 +0530
+@@ -57,9 +57,17 @@
+ gpu_preferences.in_process_gpu =
+ command_line->HasSwitch(switches::kInProcessGPU);
+ gpu_preferences.disable_accelerated_video_decode =
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++ !command_line->HasSwitch(switches::kEnableAcceleratedVideo);
++#else
+ command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode);
++#endif
+ gpu_preferences.disable_accelerated_video_encode =
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++ !command_line->HasSwitch(switches::kEnableAcceleratedVideo);
++#else
+ command_line->HasSwitch(switches::kDisableAcceleratedVideoEncode);
++#endif
+ #if defined(OS_WIN)
+ uint32_t enable_accelerated_vpx_decode_val =
+ gpu::GpuPreferences::VPX_VENDOR_MICROSOFT;
+diff -ur chromium-69.0.3497.92-orig/content/public/common/content_switches.cc chromium-69.0.3497.92/content/public/common/content_switches.cc
+--- chromium-69.0.3497.92-orig/content/public/common/content_switches.cc 2018-09-12 00:39:42.000000000 +0530
++++ chromium-69.0.3497.92/content/public/common/content_switches.cc 2018-09-13 22:10:34.172009028 +0530
+@@ -79,6 +79,11 @@
+ // Disable gpu-accelerated 2d canvas.
+ const char kDisableAccelerated2dCanvas[] = "disable-accelerated-2d-canvas";
+
++#if defined(OS_LINUX)
++// Enables hardware acceleration of video for Linux only. VA-API driver
++// is required to be present on the system installation.
++const char kEnableAcceleratedVideo[] = "enable-accelerated-video";
++#endif
+ // Disables hardware acceleration of video decode, where available.
+ const char kDisableAcceleratedVideoDecode[] =
+ "disable-accelerated-video-decode";
+@@ -868,11 +873,13 @@
+ // ignores this switch on its stable and beta channels.
+ const char kDisableWebRtcEncryption[] = "disable-webrtc-encryption";
+
++#if defined(OS_CHROMEOS)
+ // Disables HW decode acceleration for WebRTC.
+ const char kDisableWebRtcHWDecoding[] = "disable-webrtc-hw-decoding";
+
+ // Disables HW encode acceleration for WebRTC.
+ const char kDisableWebRtcHWEncoding[] = "disable-webrtc-hw-encoding";
++#endif
+
+ // Enables negotiation of GCM cipher suites from RFC 7714 for SRTP in WebRTC.
+ // See https://tools.ietf.org/html/rfc7714 for further information.
+diff -ur chromium-69.0.3497.92-orig/content/public/common/content_switches.h chromium-69.0.3497.92/content/public/common/content_switches.h
+--- chromium-69.0.3497.92-orig/content/public/common/content_switches.h 2018-09-12 00:39:42.000000000 +0530
++++ chromium-69.0.3497.92/content/public/common/content_switches.h 2018-09-13 22:10:34.172009028 +0530
+@@ -104,6 +104,9 @@
+ CONTENT_EXPORT extern const char kDomAutomationController[];
+ extern const char kDisable2dCanvasClipAntialiasing[];
+ CONTENT_EXPORT extern const char kDumpBlinkRuntimeCallStats[];
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++CONTENT_EXPORT extern const char kEnableAcceleratedVideo[];
++#endif
+ CONTENT_EXPORT extern const char kEnableAccessibilityObjectModel[];
+ CONTENT_EXPORT extern const char kEnableAggressiveDOMStorageFlushing[];
+ CONTENT_EXPORT extern const char kEnableAutomation[];
+@@ -241,8 +244,10 @@
+ CONTENT_EXPORT extern const char kWaitForDebuggerChildren[];
+
+ CONTENT_EXPORT extern const char kDisableWebRtcEncryption[];
++#if defined(OS_CHROMEOS)
+ CONTENT_EXPORT extern const char kDisableWebRtcHWDecoding[];
+ CONTENT_EXPORT extern const char kDisableWebRtcHWEncoding[];
++#endif
+ CONTENT_EXPORT extern const char kEnableWebRtcSrtpAesGcm[];
+ CONTENT_EXPORT extern const char kEnableWebRtcSrtpEncryptedHeaders[];
+ CONTENT_EXPORT extern const char kEnableWebRtcStunOrigin[];
+diff -ur chromium-69.0.3497.92-orig/content/renderer/media/webrtc/peer_connection_dependency_factory.cc chromium-69.0.3497.92/content/renderer/media/webrtc/peer_connection_dependency_factory.cc
+--- chromium-69.0.3497.92-orig/content/renderer/media/webrtc/peer_connection_dependency_factory.cc 2018-09-12 00:39:42.000000000 +0530
++++ chromium-69.0.3497.92/content/renderer/media/webrtc/peer_connection_dependency_factory.cc 2018-09-13 22:10:34.181008752 +0530
+@@ -276,10 +276,18 @@
+
+ const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
+ if (gpu_factories && gpu_factories->IsGpuVideoAcceleratorEnabled()) {
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++ if (cmd_line->HasSwitch(switches::kEnableAcceleratedVideo))
++#else
+ if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWDecoding))
++#endif
+ decoder_factory.reset(new RTCVideoDecoderFactory(gpu_factories));
+
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++ if (cmd_line->HasSwitch(switches::kEnableAcceleratedVideo))
++#else
+ if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWEncoding))
++#endif
+ encoder_factory.reset(new RTCVideoEncoderFactory(gpu_factories));
+ }
+
+diff -ur chromium-69.0.3497.92-orig/content/renderer/render_thread_impl.cc chromium-69.0.3497.92/content/renderer/render_thread_impl.cc
+--- chromium-69.0.3497.92-orig/content/renderer/render_thread_impl.cc 2018-09-12 00:39:42.000000000 +0530
++++ chromium-69.0.3497.92/content/renderer/render_thread_impl.cc 2018-09-13 22:10:34.192008415 +0530
+@@ -1441,7 +1441,11 @@
+ kGpuStreamPriorityMedia);
+
+ const bool enable_video_accelerator =
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++ cmd_line->HasSwitch(switches::kEnableAcceleratedVideo) &&
++#else
+ !cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode) &&
++#endif
+ (gpu_channel_host->gpu_feature_info()
+ .status_values[gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE] ==
+ gpu::kGpuFeatureStatusEnabled);
+Only in chromium-69.0.3497.92/content/renderer: render_thread_impl.cc.orig
+diff -ur chromium-69.0.3497.92-orig/gpu/config/software_rendering_list.json chromium-69.0.3497.92/gpu/config/software_rendering_list.json
+--- chromium-69.0.3497.92-orig/gpu/config/software_rendering_list.json 2018-09-12 00:39:44.000000000 +0530
++++ chromium-69.0.3497.92/gpu/config/software_rendering_list.json 2018-09-13 22:10:34.193008384 +0530
+@@ -377,17 +377,6 @@
+ ]
+ },
+ {
+- "id": 48,
+- "description": "Accelerated video decode is unavailable on Linux",
+- "cr_bugs": [137247],
+- "os": {
+- "type": "linux"
+- },
+- "features": [
+- "accelerated_video_decode"
+- ]
+- },
+- {
+ "id": 50,
+ "description": "Disable VMware software renderer on older Mesa",
+ "cr_bugs": [145531, 332596, 571899, 629434],
+diff -ur chromium-69.0.3497.92-orig/media/base/media_switches.cc chromium-69.0.3497.92/media/base/media_switches.cc
+--- chromium-69.0.3497.92-orig/media/base/media_switches.cc 2018-09-12 00:39:48.000000000 +0530
++++ chromium-69.0.3497.92/media/base/media_switches.cc 2018-09-13 22:10:34.214007740 +0530
+@@ -117,10 +117,15 @@
+ // accelerator hardware to be present.
+ const char kUseFakeJpegDecodeAccelerator[] = "use-fake-jpeg-decode-accelerator";
+
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++// Enable hardware accelerated mjpeg decode on linux
++const char kEnableAcceleratedMjpegDecode[] = "enable-accelerated-mjpeg-decode";
++#else
+ // Disable hardware acceleration of mjpeg decode for captured frame, where
+ // available.
+ const char kDisableAcceleratedMjpegDecode[] =
+ "disable-accelerated-mjpeg-decode";
++#endif
+
+ // When running tests on a system without the required hardware or libraries,
+ // this flag will cause the tests to fail. Otherwise, they silently succeed.
+@@ -462,15 +467,22 @@
+ #endif
+
+ bool IsVideoCaptureAcceleratedJpegDecodingEnabled() {
++
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++ if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
++ switches::kEnableAcceleratedMjpegDecode)
++#else
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+- switches::kDisableAcceleratedMjpegDecode)) {
++ switches::kDisableAcceleratedMjpegDecode)
++#endif
++ ) {
+ return false;
+ }
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kUseFakeJpegDecodeAccelerator)) {
+ return true;
+ }
+-#if defined(OS_CHROMEOS)
++#if !defined(OS_ANDROID) && defined(OS_LINUX)
+ return true;
+ #endif
+ return false;
+diff -ur chromium-69.0.3497.92-orig/media/base/media_switches.h chromium-69.0.3497.92/media/base/media_switches.h
+--- chromium-69.0.3497.92-orig/media/base/media_switches.h 2018-09-12 00:39:48.000000000 +0530
++++ chromium-69.0.3497.92/media/base/media_switches.h 2018-09-13 22:10:34.283005625 +0530
+@@ -66,7 +66,11 @@
+ MEDIA_EXPORT extern const char kUseFileForFakeVideoCapture[];
+ MEDIA_EXPORT extern const char kUseFileForFakeAudioCapture[];
+ MEDIA_EXPORT extern const char kUseFakeJpegDecodeAccelerator[];
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++MEDIA_EXPORT extern const char kEnableAcceleratedMjpegDecode[];
++#else
+ MEDIA_EXPORT extern const char kDisableAcceleratedMjpegDecode[];
++#endif
+
+ MEDIA_EXPORT extern const char kRequireAudioHardwareForTesting[];
+ MEDIA_EXPORT extern const char kMuteAudio[];
+diff -ur chromium-69.0.3497.92-orig/media/gpu/BUILD.gn chromium-69.0.3497.92/media/gpu/BUILD.gn
+--- chromium-69.0.3497.92-orig/media/gpu/BUILD.gn 2018-09-12 00:39:48.000000000 +0530
++++ chromium-69.0.3497.92/media/gpu/BUILD.gn 2018-09-13 22:10:34.210007863 +0530
+@@ -495,6 +495,14 @@
+ }
+ }
+
++if (is_desktop_linux && use_vaapi) {
++ import("//build/config/linux/pkg_config.gni")
++
++ pkg_config("libva_config") {
++ packages = [ "libva" ]
++ }
++}
++
+ if (use_vaapi) {
+ test("jpeg_encode_accelerator_unittest") {
+ deps = [
+@@ -559,6 +567,10 @@
+ if (use_ozone) {
+ deps += [ "//ui/ozone" ]
+ }
++
++ if (is_desktop_linux) {
++ public_configs = [ ":libva_config" ]
++ }
+ }
+ }
+
diff --git a/widevine.patch b/widevine.patch
new file mode 100644
index 0000000..2fc8d79
--- /dev/null
+++ b/widevine.patch
@@ -0,0 +1,23 @@
+diff -upr chromium-48.0.2564.82.orig/third_party/widevine/cdm/stub/widevine_cdm_version.h chromium-48.0.2564.82/third_party/widevine/cdm/stub/widevine_cdm_version.h
+--- chromium-48.0.2564.82.orig/third_party/widevine/cdm/stub/widevine_cdm_version.h 2016-01-14 01:05:17.000000000 +0200
++++ chromium-48.0.2564.82/third_party/widevine/cdm/stub/widevine_cdm_version.h 2016-01-21 19:18:51.287978456 +0200
+@@ -12,4 +12,6 @@
+
+ #define WIDEVINE_CDM_AVAILABLE
+
++#define WIDEVINE_CDM_VERSION_STRING "67"
++
+ #endif // WIDEVINE_CDM_VERSION_H_
+ #endif // WIDEVINE_CDM_VERSION_H_
+
+--- a/third_party/widevine/cdm/BUILD.gn
++++ b/third_party/widevine/cdm/BUILD.gn
+@@ -11,7 +11,7 @@ import("//third_party/widevine/cdm/widev
+ # Internal Cast builds set enable_widevine=true to bring in Widevine support.
+ # TODO(xhwang): Support component updated CDM on other platforms and remove this
+ # assert.
+-assert(!enable_widevine || is_win || is_mac || is_chromecast,
++assert(!enable_widevine || is_win || is_mac || is_chromecast || is_linux,
+ "Component updated CDM only supported on Windows and Mac for now.")
+
+ widevine_arch = current_cpu
6 years, 1 month
[chromium-vaapi] Remove dependency on minizip-compat package(https://bugzilla.redhat.com/show_bug.cgi?id=1632170) Add
by hellbanger
commit 444bbe51cf3250b7fe426354858a35f7d05c1f73
Author: Akarshan Biswas <hellbanger(a)ga-lmt-s2.biswasab.org>
Date: Sat Sep 29 14:05:57 2018 +0530
Remove dependency on minizip-compat package(https://bugzilla.redhat.com/show_bug.cgi?id=1632170)
Add conditions to build with{out} system minizip
.gitignore | 1 +
LICENSE | 29 +++
chromium-vaapi.appdata.xml | 37 +++
chromium-vaapi.sh | 60 +++++
chromium-vaapi.spec | 598 +++++++++++++++++++++++++++++++++++++++++++++
py2-bootstrap.patch | 33 +++
sources | 1 +
unrar.patch | 186 ++++++++++++++
vaapi.patch | 542 ++++++++++++++++++++++++++++++++++++++++
widevine.patch | 23 ++
10 files changed, 1510 insertions(+)
---
diff --git a/.gitignore b/.gitignore
index e69de29..6317544 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/chromium-69.0.3497.100.tar.xz
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..1c5664f
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,29 @@
+BSD 3-Clause License
+
+Copyright (c) 2018, Akarshan Biswas
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+* Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/chromium-vaapi.appdata.xml b/chromium-vaapi.appdata.xml
new file mode 100644
index 0000000..a2b2064
--- /dev/null
+++ b/chromium-vaapi.appdata.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Referenced from https://www.freedesktop.org/software/appstream/docs/chap-Quickstart.html#... -->
+<component type="desktop">
+ <id>chromium-vaapi.desktop</id>
+ <update_contact> chromium-vaapi-owner(a)rpmfusion.org</update_contact>
+ <metadata_license>CC0-1.0</metadata_license>
+ <project_license>BSD-3-Clause and LGPL-2.1+ and Apache-2.0 and IJG and MIT and GPL-2.0+ and ISC and OpenSSL and (MPL-1.1 or GPL-2.0 or LGPL-2.0)</project_license>
+ <name>chromium-vaapi</name>
+ <summary>Web Browser</summary>
+ <description>
+ <p>
+ Chromium-vaapi is an open-source browser based on webkit(blink).
+ This build of chromium comes with video decoding acceleration enabled through libva vaapi.
+ Chromium browser with hardware video decoding will not only increase the battery by minimising the power consumption but also enable 4K video ( if supported ) on weaker systems. Installing this build requires vaapi driver to be installed on the system. check with vainfo. Compare CPU usages of both enabled and disabled state.
+ </p>
+ <p>
+ Video acceleration may or may not work on Nvidia GPUs because of no support of vaapi. Only Intel and amdgpus are supported at the moment. If chromium gives an error, try checking your gpu by running vainfo.
+Nvidia's open source Nouveau driver might work(with firmware from the binary driver) but it may crash.
+ Please look at the logs in chrome://gpu.
+Sometimes "Video Decode" in the "Graphics Feature Status" maybe misleading, Please look at "Video Acceleration Information" section.
+ </p>
+ </description>
+ <url type="homepage">https://www.chromium.org/Home</url>
+ <screenshots>
+ <screenshot type="default">
+ <caption>The main window</caption>
+ <image>https://gitlab.com/biswasab/Project-screenshots/raw/master/a.png</image>
+ </screenshot>
+ <screenshot>
+ <caption>The chrome://gpu page</caption>
+ <image>https://gitlab.com/biswasab/Project-screenshots/raw/master/b.png</image>
+ </screenshot>
+ </screenshots>
+ <developer_name>Google</developer_name>
+ <url type="bugtracker">https://bugzilla.rpmfusion.org</url>
+ <url type="help">https://chromium.googlesource.com/chromium/src/+/master/docs/linux_debugg...</url>
+</component>
diff --git a/chromium-vaapi.sh b/chromium-vaapi.sh
new file mode 100644
index 0000000..77a0027
--- /dev/null
+++ b/chromium-vaapi.sh
@@ -0,0 +1,60 @@
+#!/bin/bash
+#
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# This file is obtained from https://src.fedoraproject.org/rpms/chromium/
+# and modified by Akarshan Biswas <akarshan.biswas(a)hotmail.com. All modifications are also
+# licensed under 3-clause BSD license.
+
+# Let the wrapped binary know that it has been run through the wrapper.
+export CHROME_WRAPPER="$(readlink -f "$0")"
+
+HERE="`dirname "$CHROME_WRAPPER"`"
+export CHROME_DESKTOP="chromium-vaapi.desktop"
+# We include some xdg utilities next to the binary, and we want to prefer them
+# over the system versions when we know the system versions are very old. We
+# detect whether the system xdg utilities are sufficiently new to be likely to
+# work for us by looking for xdg-settings. If we find it, we leave $PATH alone,
+# so that the system xdg utilities (including any distro patches) will be used.
+if ! which xdg-settings &> /dev/null; then
+ # Old xdg utilities. Prepend $HERE to $PATH to use ours instead.
+ export PATH="$HERE:$PATH"
+else
+ # Use system xdg utilities. But first create mimeapps.list if it doesn't
+ # exist; some systems have bugs in xdg-mime that make it fail without it.
+ xdg_app_dir="${XDG_DATA_HOME:-$HOME/.local/share/applications}"
+ mkdir -p "$xdg_app_dir"
+ [ -f "$xdg_app_dir/mimeapps.list" ] || touch "$xdg_app_dir/mimeapps.list"
+fi
+
+# Always use our versions of ffmpeg libs.
+# This also makes RPMs find the compatibly-named library symlinks.
+if [[ -n "$LD_LIBRARY_PATH" ]]; then
+ LD_LIBRARY_PATH="$HERE:$HERE/lib:$LD_LIBRARY_PATH"
+else
+ LD_LIBRARY_PATH="$HERE:$HERE/lib"
+fi
+export LD_LIBRARY_PATH
+
+# Sanitize std{in,out,err} because they'll be shared with untrusted child
+# processes (http://crbug.com/376567).
+exec < /dev/null
+exec > >(exec cat)
+exec 2> >(exec cat >&2)
+
+export CHROME_VERSION_EXTRA="Built from source for @@BUILDTARGET@@"
+
+CHROMIUM_DISTRO_FLAGS=" --enable-plugins \
+ --enable-extensions \
+ --enable-user-scripts \
+ --enable-printing \
+ --enable-accelerated-video \
+ --enable-native-gpu-memory-buffers \
+ --enable-accelerated-mjpeg-decode \
+ --enable-gpu-rasterization \
+ --disable-gpu-driver-bug-workarounds \
+ --enable-sync"
+
+exec -a "$0" "@@CHROMIUMDIR@@/$(basename "$0" | sed 's/\.sh$//')" $CHROMIUM_DISTRO_FLAGS "$@"
diff --git a/chromium-vaapi.spec b/chromium-vaapi.spec
new file mode 100644
index 0000000..f2d300b
--- /dev/null
+++ b/chromium-vaapi.spec
@@ -0,0 +1,598 @@
+# This spec file is based on other spec files, ebuilds, PKGBUILDs available from
+# [1] https://repos.fedorapeople.org/repos/spot/chromium/
+# [2] https://copr.fedoraproject.org/coprs/churchyard/chromium-russianfedora-te...
+# [3] https://www.archlinux.org/packages/extra/x86_64/chromium/
+# [4] https://src.fedoraproject.org/rpms/chromium/
+# [5] https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/chromium/
+# [6] https://copr.fedorainfracloud.org/coprs/lantw44/chromium/
+# Get the version number of latest stable version
+# $ curl -s 'https://omahaproxy.appspot.com/all?os=linux&channel=stable' | sed 1d | cut -d , -f 3
+######################################################################################################################
+#Global Libraries
+#Do not turn it on in Fedora copr!
+%global freeworld 1
+#This can be any folder on out
+%global target out/Release
+#Our installation folder
+%global chromiumdir %{_libdir}/chromium-vaapi
+### Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
+### Note: These are for Fedora use ONLY.
+### For your own distribution, please get your own set of keys.
+### http://lists.debian.org/debian-legal/2013/11/msg00006.html
+%global api_key AIzaSyDUIXvzVrt5OkVsgXhQ6NFfvWlA44by-aw
+%global default_client_id 449907151817.apps.googleusercontent.com
+%global default_client_secret miEreAep8nuvTdvLums6qyLK
+###############################Exclude Private chromium libs###########################
+%global __requires_exclude %{chromiumdir}/.*\\.so
+%global __provides_exclude_from %{chromiumdir}/.*\\.so
+#######################################CONFIGS###########################################
+# Require harfbuzz >= 1.5.0 for hb_glyph_info_t
+%if 0%{?fedora} >= 28
+%bcond_without system_harfbuzz
+%else
+%bcond_with system_harfbuzz
+%endif
+# Require libxml2 > 2.9.4 for XML_PARSE_NOXXE
+%bcond_without system_libxml2
+
+# https://github.com/dabeaz/ply/issues/66
+%bcond_without system_ply
+
+# Allow testing whether icu can be unbundled
+%bcond_with system_libicu
+# Allow testing whether libvpx can be unbundled
+%bcond_with system_libvpx
+#Allow minizip to be unbundled
+#mini-compat is going to be removed from fedora 30!
+%if 0%{?fedora} >= 30
+%bcond_with system_minizip
+%else
+%bcond_without system_minizip
+%endif
+#Turn on verbose mode
+%global debug_logs 1
+#Build debug packages for debugging
+%global debug_pkg 1
+# Allow compiling with clang
+%global clang 0
+#Allow building with Fedora compilation flags
+%global fedora_compilation_flags 1
+##############################Package Definitions######################################
+Name: chromium-vaapi
+Version: 69.0.3497.100
+Release: 3%{?dist}
+Summary: A Chromium web browser with video decoding acceleration
+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)
+URL: https://www.chromium.org/Home
+%if %{freeworld}
+Source0: https://commondatastorage.googleapis.com/chromium-browser-official/chromi...
+%else
+Source0: chromium-%{version}-clean.tar.xz
+%endif
+# The following two source files are copied and modified from the chromium source
+Source10: %{name}.sh
+#Add our own appdata file. ##TODO
+Source11: %{name}.appdata.xml
+#Personal stuff
+Source15: LICENSE
+#Video acceleration patch from https://chromium-review.googlesource.com/c/chromium/src/+/532294
+Patch1: vaapi.patch
+Patch2: widevine.patch
+%if %{clang}
+#Will use any clang patch here
+#Fix breaking builds caused by gcc_ar_wrapper.py from upstream
+Patch7: llvm-arflags.patch
+%else
+#Gcc patches area.
+%endif
+#More patches to fix chromium build here
+#remove dependency on unrar. That's a nasty code.
+Patch50: unrar.patch
+#Bootstrap still uses python command
+Patch51: py2-bootstrap.patch
+#This build should be only available to amd64
+ExclusiveArch: x86_64
+########################################################################################
+#Compiler settings
+%if %{clang}
+BuildRequires: clang, llvm, lld
+%else
+#GCC mode on
+# Make sure we don't encounter any bug
+BuildRequires: gcc
+BuildRequires: gcc-c++
+%endif
+# Basic tools and libraries needed for building
+BuildRequires: ninja-build, nodejs, bison, gperf, hwdata
+BuildRequires: libgcc, glibc, libatomic, libstdc++-static
+BuildRequires: libcap-devel, cups-devel, alsa-lib-devel
+BuildRequires: mesa-libGL-devel, mesa-libEGL-devel
+%if %{with system_minizip}
+BuildRequires: minizip-devel
+%endif
+BuildRequires: pkgconfig(gtk+-2.0), pkgconfig(gtk+-3.0)
+BuildRequires: pkgconfig(libexif), pkgconfig(nss)
+BuildRequires: pkgconfig(xtst), pkgconfig(xscrnsaver)
+BuildRequires: pkgconfig(dbus-1), pkgconfig(libudev)
+BuildRequires: pkgconfig(gnome-keyring-1)
+BuildRequires: pkgconfig(libffi)
+# remove_bundled_libraries.py --do-remove
+BuildRequires: python2-rpm-macros
+BuildRequires: python2-beautifulsoup4
+BuildRequires: python2-html5lib
+BuildRequires: python2-markupsafe
+%if %{with system_ply}
+BuildRequires: python2-ply
+%endif
+# replace_gn_files.py --system-libraries
+BuildRequires: flac-devel
+BuildRequires: freetype-devel
+%if %{with system_harfbuzz}
+BuildRequires: harfbuzz-devel
+%endif
+%if %{with system_libicu}
+BuildRequires: libicu-devel
+%endif
+BuildRequires: libdrm-devel
+BuildRequires: libjpeg-turbo-devel
+BuildRequires: libpng-devel
+# Chromium requires libvpx 1.5.0 and some non-default options
+%if %{with system_libvpx}
+BuildRequires: libvpx-devel
+%endif
+BuildRequires: libwebp-devel
+%if %{with system_libxml2}
+BuildRequires: pkgconfig(libxml-2.0)
+%endif
+BuildRequires: pkgconfig(libxslt)
+BuildRequires: opus-devel
+BuildRequires: re2-devel
+BuildRequires: snappy-devel
+BuildRequires: yasm
+BuildRequires: pciutils-devel
+BuildRequires: speech-dispatcher-devel
+BuildRequires: pulseaudio-libs-devel
+# install desktop files
+BuildRequires: desktop-file-utils
+# install AppData files
+BuildRequires: libappstream-glib
+#for vaapi
+BuildRequires: libva-devel
+#Runtime Requirements
+Requires: hicolor-icon-theme
+#Some recommendations
+Recommends: libva-intel-hybrid-driver%{?_isa}
+Recommends: libva-intel-driver%{?_isa}
+%if !%{debug_pkg}
+%global debug_package %{nil}
+%endif
+%description
+chromium-vaapi is an open-source web browser, powered by WebKit (Blink)
+############################################PREP###########################################################
+%prep
+%autosetup -n chromium-%{version} -p1
+#Let's change the default shebang of python files.
+find -depth -type f -name "*.py" -exec sed -iE '1s=^#! */usr/bin/\(python\|env python\)[23]\?=#!%{__python2}=' {} +
+./build/linux/unbundle/remove_bundled_libraries.py --do-remove \
+ base/third_party/dmg_fp \
+ base/third_party/dynamic_annotations \
+ base/third_party/icu \
+ base/third_party/libevent \
+ base/third_party/nspr \
+ base/third_party/superfasthash \
+ base/third_party/symbolize \
+ base/third_party/valgrind \
+ base/third_party/xdg_mime \
+ base/third_party/xdg_user_dirs \
+ buildtools/third_party/libc++ \
+ buildtools/third_party/libc++abi \
+ chrome/third_party/mozilla_security_manager \
+ courgette/third_party \
+ native_client/src/third_party/dlmalloc \
+ native_client/src/third_party/valgrind \
+ net/third_party/http2 \
+ net/third_party/mozilla_security_manager \
+ net/third_party/nss \
+ net/third_party/quic \
+ net/third_party/spdy \
+ third_party/abseil-cpp \
+ third_party/adobe \
+ third_party/analytics \
+ third_party/angle \
+ third_party/angle/src/common/third_party/base \
+ third_party/angle/src/common/third_party/smhasher \
+ third_party/angle/src/third_party/compiler \
+ third_party/angle/src/third_party/libXNVCtrl \
+ third_party/angle/src/third_party/trace_event \
+ third_party/angle/third_party/glslang \
+ third_party/angle/third_party/spirv-headers \
+ third_party/angle/third_party/spirv-tools \
+ third_party/angle/third_party/vulkan-headers \
+ third_party/angle/third_party/vulkan-loader \
+ third_party/angle/third_party/vulkan-tools \
+ third_party/angle/third_party/vulkan-validation-layers \
+ third_party/apple_apsl \
+ third_party/boringssl \
+ third_party/boringssl/src/third_party/fiat \
+ third_party/blink \
+ third_party/breakpad \
+ third_party/breakpad/breakpad/src/third_party/curl \
+ third_party/brotli \
+ third_party/cacheinvalidation \
+ third_party/catapult \
+ third_party/catapult/common/py_vulcanize/third_party/rcssmin \
+ third_party/catapult/common/py_vulcanize/third_party/rjsmin \
+ third_party/catapult/third_party/polymer \
+ third_party/catapult/tracing/third_party/d3 \
+ third_party/catapult/tracing/third_party/gl-matrix \
+ third_party/catapult/tracing/third_party/jszip \
+ third_party/catapult/tracing/third_party/mannwhitneyu \
+ third_party/catapult/tracing/third_party/oboe \
+ third_party/catapult/tracing/third_party/pako \
+ third_party/ced \
+ third_party/cld_3 \
+ third_party/crashpad \
+ third_party/crashpad/crashpad/third_party/zlib \
+ third_party/crc32c \
+ third_party/cros_system_api \
+ third_party/devscripts \
+ third_party/dom_distiller_js \
+ third_party/ffmpeg \
+ third_party/fips181 \
+ third_party/flatbuffers \
+ third_party/flot \
+ third_party/freetype \
+ third_party/glslang-angle \
+ third_party/google_input_tools \
+ third_party/google_input_tools/third_party/closure_library \
+ third_party/google_input_tools/third_party/closure_library/third_party/closure \
+ third_party/googletest \
+%if !%{with system_harfbuzz}
+ third_party/harfbuzz-ng \
+%endif
+ third_party/hunspell \
+ third_party/iccjpeg \
+%if !%{with system_libicu}
+ third_party/icu \
+%endif
+ third_party/inspector_protocol \
+ third_party/jinja2 \
+ third_party/jstemplate \
+ third_party/khronos \
+ third_party/leveldatabase \
+ third_party/libaddressinput \
+ third_party/libaom \
+ third_party/libjingle \
+ third_party/libphonenumber \
+ third_party/libsecret \
+ third_party/libsrtp \
+ third_party/libsync \
+ third_party/libudev \
+%if !%{with system_libvpx}
+ third_party/libvpx \
+ third_party/libvpx/source/libvpx/third_party/x86inc \
+%endif
+ third_party/libwebm \
+%if %{with system_libxml2}
+ third_party/libxml/chromium \
+%else
+ third_party/libxml \
+%endif
+ third_party/libXNVCtrl \
+ third_party/libyuv \
+ third_party/lss \
+ third_party/lzma_sdk \
+ third_party/mesa \
+ third_party/metrics_proto \
+%if !%{with system_minizip}
+ third_party/minizip/ \
+%endif
+ third_party/modp_b64 \
+ third_party/node \
+ third_party/node/node_modules/polymer-bundler/lib/third_party/UglifyJS2 \
+ third_party/openh264 \
+ third_party/openmax_dl \
+ third_party/ots \
+ third_party/pdfium \
+ third_party/pdfium/third_party/agg23 \
+ third_party/pdfium/third_party/base \
+ third_party/pdfium/third_party/bigint \
+ third_party/pdfium/third_party/freetype \
+ third_party/pdfium/third_party/lcms \
+ third_party/pdfium/third_party/libopenjpeg20 \
+ third_party/pdfium/third_party/libpng16 \
+ third_party/pdfium/third_party/libtiff \
+ third_party/pdfium/third_party/skia_shared \
+ third_party/perfetto \
+%if !%{with system_ply}
+ third_party/ply \
+%endif
+ third_party/polymer \
+ third_party/protobuf \
+ third_party/protobuf/third_party/six \
+ third_party/pyjson5 \
+ third_party/qcms \
+ third_party/rnnoise \
+ third_party/s2cellid \
+ third_party/sfntly \
+ third_party/skia \
+ third_party/skia/third_party/gif \
+ third_party/skia/third_party/vulkan \
+ third_party/skia/third_party/skcms \
+ third_party/smhasher \
+ third_party/speech-dispatcher \
+ third_party/spirv-headers \
+ third_party/spirv-tools-angle \
+ third_party/sqlite \
+ third_party/swiftshader \
+ third_party/swiftshader/third_party/llvm-subzero \
+ third_party/swiftshader/third_party/subzero \
+ third_party/tcmalloc \
+ third_party/usb_ids \
+ third_party/usrsctp \
+ third_party/vulkan \
+ third_party/vulkan-validation-layers \
+ third_party/web-animations-js \
+ third_party/webdriver \
+ third_party/WebKit \
+ third_party/webrtc \
+ third_party/widevine \
+ third_party/woff2 \
+ third_party/xdg-utils \
+ third_party/yasm/run_yasm.py \
+ third_party/zlib/google \
+%if !%{with system_minizip}
+ third_party/zlib \
+%endif
+ tools/gn/base/third_party/icu \
+ url/third_party/mozilla \
+ v8/third_party/antlr4 \
+ v8/src/third_party/valgrind \
+ v8/src/third_party/utf8-decoder \
+ v8/third_party/inspector_protocol
+
+./build/linux/unbundle/replace_gn_files.py --system-libraries \
+ flac \
+ freetype \
+ fontconfig \
+%if %{with system_libicu}
+ icu \
+%endif
+ libdrm \
+ libjpeg \
+ libpng \
+%if %{with system_libvpx}
+ libvpx \
+%endif
+ libwebp \
+%if %{with system_libxml2}
+ libxml \
+%endif
+ libxslt \
+ opus \
+ re2 \
+ snappy \
+ yasm \
+%if %{with system_minizip}
+ zlib
+%endif
+
+
+sed -i 's|//third_party/usb_ids|/usr/share/hwdata|g' device/usb/BUILD.gn
+%if %{clang}
+# Remove compiler flags not supported by our system clang
+ sed -i \
+ -e '/"-Wno-ignored-pragma-optimize"/d' \
+ build/config/compiler/BUILD.gn
+%endif
+rmdir third_party/markupsafe
+ln -s %{python2_sitearch}/markupsafe third_party/markupsafe
+%if %{with system_ply}
+rmdir third_party/ply
+ln -s %{python2_sitelib}/ply third_party/ply
+%endif
+# Fix the path to nodejs binary
+mkdir -p third_party/node/linux/node-linux-x64/bin
+ln -s %{_bindir}/node third_party/node/linux/node-linux-x64/bin/node
+# Hard code extra version
+FILE=chrome/common/channel_info_posix.cc
+sed -i.orig -e 's/getenv("CHROME_VERSION_EXTRA")/"Chromium(vaapi) Fedora Project"/' $FILE
+#####################################BUILD#############################################
+%build
+#export compilar variables
+%if %{clang}
+export AR=llvm-ar NM=llvm-nm
+export CC=clang CXX=clang++
+%else
+export AR=ar NM=nm
+export CC=gcc CXX=g++
+%if %{fedora_compilation_flags}
+#Build falgs to make hardened binaries
+#Remove some flags which can create conflicts with chromium gyp flags.
+export CFLAGS="$(echo '%{__global_cflags}' |sed -e 's/-fexceptions//' \
+ -e 's/-Werror=format-security//' \
+ -e 's/-pipe//' \
+ -e 's/-g/-g1/g' \
+ -e 's/-g1record-g1cc-switches//' )"
+export CXXFLAGS="$(echo '%{?__global_cxxflags}%{!?__global_cxxflags:%{__global_cflags}}' | sed -e 's/-fexceptions//' \
+ -e 's/-Werror=format-security//' \
+ -e 's/-pipe//' \
+ -e 's/-g/-g1/g' \
+ -e 's/-g1record-g1cc-switches//' )"
+
+export LDFLAGS='%{__global_ldflags}'
+%else
+export CXXFLAGS=$CXXFLAGS" -fno-delete-null-pointer-checks"
+%endif
+%endif
+gn_args=(
+ is_debug=false
+ use_vaapi=true
+ use_gtk3=true
+ enable_swiftshader=false
+ is_component_build=false
+ use_sysroot=false
+ use_custom_libcxx=false
+ use_aura=true
+ 'system_libdir="%{_lib}"'
+ use_cups=true
+ use_gnome_keyring=true
+ use_gio=true
+ use_kerberos=true
+ use_libpci=true
+ use_pulseaudio=true
+ use_system_freetype=true
+ enable_widevine=true
+%if %{with system_harfbuzz}
+ use_system_harfbuzz=true
+%endif
+%if %{freeworld}
+ 'ffmpeg_branding="Chrome"'
+ proprietary_codecs=true
+%else
+ 'ffmpeg_branding="Chromium"'
+ proprietary_codecs=false
+%endif
+ enable_nacl=false
+ enable_hangout_services_extension=false
+ fatal_linker_warnings=false
+ treat_warnings_as_errors=false
+ linux_use_bundled_binutils=false
+ remove_webcore_debug_symbols=true
+ fieldtrial_testing_like_official_build=true
+ 'custom_toolchain="//build/toolchain/linux/unbundle:default"'
+ 'host_toolchain="//build/toolchain/linux/unbundle:default"'
+ 'google_api_key="%{api_key}"'
+ 'google_default_client_id="%{default_client_id}"'
+ 'google_default_client_secret="%{default_client_secret}"'
+)
+gn_args+=(
+%if %{clang}
+ is_clang=true
+ 'clang_base_path = "/usr"'
+ clang_use_chrome_plugins=false
+%else
+ is_clang=false
+ use_lld=false
+%endif
+)
+
+tools/gn/bootstrap/bootstrap.py --gn-gen-args "${gn_args[*]}"
+%{target}/gn --script-executable=%{__python2} gen --args="${gn_args[*]}" %{target}
+%if %{debug_logs}
+ninja %{_smp_mflags} -C %{target} -v chrome chrome_sandbox chromedriver
+%else
+ninja %{_smp_mflags} -C %{target} chrome chrome_sandbox chromedriver
+%endif
+######################################Install####################################
+%install
+mkdir -p %{buildroot}%{_bindir}
+mkdir -p %{buildroot}%{chromiumdir}/locales
+mkdir -p %{buildroot}%{_mandir}/man1
+mkdir -p %{buildroot}%{_datadir}/metainfo
+mkdir -p %{buildroot}%{_datadir}/applications
+mkdir -p %{buildroot}%{_datadir}/gnome-control-center/default-apps
+sed -e "s|@@CHROMIUMDIR@@|%{chromiumdir}|" -e "s|@@BUILDTARGET@@|`cat /etc/redhat-release`|" \
+ %{SOURCE10} > chromium-vaapi.sh
+install -m 755 chromium-vaapi.sh %{buildroot}%{_bindir}/%{name}
+install -m 644 %{SOURCE11} %{buildroot}%{_datadir}/metainfo
+sed -e "s|@@MENUNAME@@|%{name}|g" -e "s|@@PACKAGE@@|%{name}|g" \
+ chrome/app/resources/manpage.1.in > chrome.1
+install -m 644 chrome.1 %{buildroot}%{_mandir}/man1/%{name}.1
+#Using the template from the source. Still doesn't help in fixing.
+sed -e "s|@@MENUNAME@@|%{name}|g" -e "s|@@PACKAGE@@|%{name}|g" -e "s|@@USR_BIN_SYMLINK_NAME@@|%{name}|g" \
+ chrome/installer/linux/common/desktop.template > %{name}.desktop
+desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{name}.desktop
+sed -e "s|@@MENUNAME@@|%{name}|g" -e "s|@@PACKAGE@@|%{name}|g" -e "s|@@INSTALLDIR@@|%{_bindir}|g" \
+chrome/installer/linux/common/default-app.template > %{name}.xml
+install -m 644 %{name}.xml %{buildroot}%{_datadir}/gnome-control-center/default-apps/
+install -m 755 %{target}/chrome %{buildroot}%{chromiumdir}/%{name}
+install -m 4755 %{target}/chrome_sandbox %{buildroot}%{chromiumdir}/chrome-sandbox
+install -m 755 %{target}/chromedriver %{buildroot}%{chromiumdir}/
+%if !%{with system_libicu}
+install -m 644 %{target}/icudtl.dat %{buildroot}%{chromiumdir}/
+%endif
+install -m 644 %{target}/natives_blob.bin %{buildroot}%{chromiumdir}/
+install -m 644 %{target}/v8_context_snapshot.bin %{buildroot}%{chromiumdir}/
+install -m 644 %{target}/*.pak %{buildroot}%{chromiumdir}/
+install -m 644 %{target}/locales/*.pak %{buildroot}%{chromiumdir}/locales/
+install -m 644 %{target}/xdg* %{buildroot}%{chromiumdir}/
+for i in 16 32; do
+ mkdir -p %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps
+ install -m 644 chrome/app/theme/default_100_percent/chromium/product_logo_$i.png \
+ %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/%{name}.png
+done
+for i in 22 24 32 48 64 128 256; do
+ if [ ${i} = 32 ]; then ext=xpm; else ext=png; fi
+ if [ ${i} = 32 ]; then dir=linux/; else dir=; fi
+ mkdir -p %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps
+ install -m 644 chrome/app/theme/chromium/${dir}product_logo_$i.${ext} \
+ %{buildroot}%{_datadir}/icons/hicolor/${i}x${i}/apps/%{name}.${ext}
+done
+####################################check##################################################
+%check
+appstream-util validate-relax --nonet "%{buildroot}%{_datadir}/metainfo/%{name}.appdata.xml"
+######################################files################################################
+%files
+%license LICENSE
+%doc AUTHORS
+%{_bindir}/chromium-vaapi
+%{_datadir}/metainfo/chromium-vaapi.appdata.xml
+%{_datadir}/applications/chromium-vaapi.desktop
+%{_datadir}/gnome-control-center/default-apps/chromium-vaapi.xml
+%{_datadir}/icons/hicolor/16x16/apps/chromium-vaapi.png
+%{_datadir}/icons/hicolor/22x22/apps/chromium-vaapi.png
+%{_datadir}/icons/hicolor/24x24/apps/chromium-vaapi.png
+%{_datadir}/icons/hicolor/32x32/apps/chromium-vaapi.png
+%{_datadir}/icons/hicolor/32x32/apps/chromium-vaapi.xpm
+%{_datadir}/icons/hicolor/48x48/apps/chromium-vaapi.png
+%{_datadir}/icons/hicolor/64x64/apps/chromium-vaapi.png
+%{_datadir}/icons/hicolor/128x128/apps/chromium-vaapi.png
+%{_datadir}/icons/hicolor/256x256/apps/chromium-vaapi.png
+%{_mandir}/man1/chromium-vaapi.1.gz
+%dir %{chromiumdir}
+%{chromiumdir}/chromium-vaapi
+%{chromiumdir}/chrome-sandbox
+%{chromiumdir}/chromedriver
+%if !%{with system_libicu}
+%{chromiumdir}/icudtl.dat
+%endif
+%{chromiumdir}/natives_blob.bin
+%{chromiumdir}/v8_context_snapshot.bin
+%{chromiumdir}/*.pak
+%{chromiumdir}/xdg-mime
+%{chromiumdir}/xdg-settings
+%dir %{chromiumdir}/locales
+%{chromiumdir}/locales/*.pak
+#########################################changelogs#################################################
+%changelog
+* Fri Sep 28 2018 Akarshan Biswas <akarshan.biswas(a)hotmail.com> 69.0.3497.100-3
+- Remove dependency on minizip-compat package(https://bugzilla.redhat.com/show_bug.cgi?id=1632170)
+- Add conditions to build with{out} system minizip
+
+* Sat Sep 22 2018 Akarshan Biswas <akarshan.biswas(a)hotmail.com> 69.0.3497.100-2
+- Produce an entire new package with unique appdata
+- Use desktop and default app template from the source
+- enable debug builds
+- Update chromium wrapper
+- Remove dependent on unrar
+
+* Tue Sep 18 2018 Akarshan Biswas <akarshan.biswas(a)hotmail.com> 69.0.3497.100-1
+- Updated chromium to 69.0.3497.100.
+- Enabled fedora GCC build flags and removed those flags which can cause confict with chromium's gyp flags.
+- Removed some duplicate flags and added g1 to ease memory which building.
+
+* Thu Sep 13 2018 Akarshan Biswas <akarshan.biswas(a)hotmail.com> 69.0.3497.92-1
+- updated chromium to 69.0.3497.92
+- fixed vaapi patch
+- Moved appstream validation to check
+
+* Thu Sep 06 2018 Akarshan Biswas <akarshan.biswas(a)hotmail.com> 69.0.3497.81-1
+- updated chromium to 69.0.3497.81
+- removed useless requirements
+- turned on verbose
+- removed conditions on obsolete fedora releases
+- fixed fedora compilation flags
+
+* Wed Aug 29 2018 Akarshan Biswas <akarshan.biswas(a)hotmail.com> 68.0.3440.106-1
+- Deleted provides and excludes and added conflict
diff --git a/py2-bootstrap.patch b/py2-bootstrap.patch
new file mode 100644
index 0000000..8a5db71
--- /dev/null
+++ b/py2-bootstrap.patch
@@ -0,0 +1,33 @@
+diff -up chromium-69.0.3497.81/third_party/catapult/common/py_vulcanize/py_vulcanize/generate.py.py2 chromium-69.0.3497.81/third_party/catapult/common/py_vulcanize/py_vulcanize/generate.py
+--- chromium-69.0.3497.81/third_party/catapult/common/py_vulcanize/py_vulcanize/generate.py.py2 2018-09-06 10:45:17.919774145 -0400
++++ chromium-69.0.3497.81/third_party/catapult/common/py_vulcanize/py_vulcanize/generate.py 2018-09-06 10:45:17.914774254 -0400
+@@ -58,7 +58,7 @@ def _MinifyJS(input_js):
+
+ with tempfile.NamedTemporaryFile() as _:
+ args = [
+- 'python',
++ 'python2',
+ rjsmin_path
+ ]
+ p = subprocess.Popen(args,
+@@ -177,7 +177,7 @@ def _MinifyCSS(css_text):
+ os.path.join(py_vulcanize_path, 'third_party', 'rcssmin', 'rcssmin.py'))
+
+ with tempfile.NamedTemporaryFile() as _:
+- rcssmin_args = ['python', rcssmin_path]
++ rcssmin_args = ['python2', rcssmin_path]
+ p = subprocess.Popen(rcssmin_args,
+ stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE,
+diff -up chromium-69.0.3497.81/tools/gn/bootstrap/bootstrap.py.py2 chromium-69.0.3497.81/tools/gn/bootstrap/bootstrap.py
+--- chromium-69.0.3497.81/tools/gn/bootstrap/bootstrap.py.py2 2018-09-06 10:44:42.225550561 -0400
++++ chromium-69.0.3497.81/tools/gn/bootstrap/bootstrap.py 2018-09-06 13:06:24.251636231 -0400
+@@ -87,7 +87,7 @@ def main(argv):
+ if not options.debug:
+ gn_gen_args += ' is_debug=false'
+ subprocess.check_call([
+- gn_path, 'gen', out_dir,
++ gn_path, 'gen', out_dir, ' --script-executable=/usr/bin/python2',
+ '--args=%s' % gn_gen_args, "--root=" + SRC_ROOT
+ ])
+
diff --git a/sources b/sources
index e69de29..7d1e885 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+1779724693bdcf7b4e01ea1133abdde2 chromium-69.0.3497.100.tar.xz
diff --git a/unrar.patch b/unrar.patch
new file mode 100644
index 0000000..5951ab4
--- /dev/null
+++ b/unrar.patch
@@ -0,0 +1,186 @@
+diff --git a/chrome/browser/safe_browsing/download_protection/check_client_download_request.cc b/chrome/browser/safe_browsing/download_protection/check_client_download_request.cc
+index f5aaff83c87a..737e168ec5aa 100644
+--- a/chrome/browser/safe_browsing/download_protection/check_client_download_request.cc
++++ b/chrome/browser/safe_browsing/download_protection/check_client_download_request.cc
+@@ -379,10 +379,6 @@ void CheckClientDownloadRequest::AnalyzeFile() {
+ // are enabled.
+ if (item_->GetTargetFilePath().MatchesExtension(FILE_PATH_LITERAL(".zip"))) {
+ StartExtractZipFeatures();
+- } else if (item_->GetTargetFilePath().MatchesExtension(
+- FILE_PATH_LITERAL(".rar")) &&
+- base::FeatureList::IsEnabled(kInspectDownloadedRarFiles)) {
+- StartExtractRarFeatures();
+ #if defined(OS_MACOSX)
+ } else if (item_->GetTargetFilePath().MatchesExtension(
+ FILE_PATH_LITERAL(".dmg")) ||
+@@ -499,71 +495,6 @@ void CheckClientDownloadRequest::ExtractFileFeatures(
+ OnFileFeatureExtractionDone();
+ }
+
+-void CheckClientDownloadRequest::StartExtractRarFeatures() {
+- DCHECK_CURRENTLY_ON(BrowserThread::UI);
+- DCHECK(item_); // Called directly from Start(), item should still exist.
+- rar_analysis_start_time_ = base::TimeTicks::Now();
+- // We give the rar analyzer a weak pointer to this object. Since the
+- // analyzer is refcounted, it might outlive the request.
+- rar_analyzer_ = new SandboxedRarAnalyzer(
+- item_->GetFullPath(),
+- base::BindRepeating(&CheckClientDownloadRequest::OnRarAnalysisFinished,
+- weakptr_factory_.GetWeakPtr()),
+- content::ServiceManagerConnection::GetForProcess()->GetConnector());
+- rar_analyzer_->Start();
+-}
+-
+-void CheckClientDownloadRequest::OnRarAnalysisFinished(
+- const ArchiveAnalyzerResults& results) {
+- DCHECK_CURRENTLY_ON(BrowserThread::UI);
+- if (item_ == nullptr) {
+- PostFinishTask(DownloadCheckResult::UNKNOWN, REASON_REQUEST_CANCELED);
+- return;
+- }
+- if (!service_)
+- return;
+-
+- archive_is_valid_ =
+- (results.success ? ArchiveValid::VALID : ArchiveValid::INVALID);
+- archived_executable_ = results.has_executable;
+- CopyArchivedBinaries(results.archived_binary, &archived_binaries_);
+- DVLOG(1) << "Rar analysis finished for " << item_->GetFullPath().value()
+- << ", has_executable=" << results.has_executable
+- << ", has_archive=" << results.has_archive
+- << ", success=" << results.success;
+-
+- if (archived_executable_) {
+- UMA_HISTOGRAM_COUNTS_100("SBClientDownload.RarFileArchivedBinariesCount",
+- results.archived_binary.size());
+- }
+- UMA_HISTOGRAM_BOOLEAN("SBClientDownload.RarFileSuccess", results.success);
+- UMA_HISTOGRAM_BOOLEAN("SBClientDownload.RarFileHasExecutable",
+- archived_executable_);
+- UMA_HISTOGRAM_BOOLEAN("SBClientDownload.RarFileHasArchiveButNoExecutable",
+- results.has_archive && !archived_executable_);
+- UMA_HISTOGRAM_TIMES("SBClientDownload.ExtractRarFeaturesTime",
+- base::TimeTicks::Now() - rar_analysis_start_time_);
+- for (const auto& file_name : results.archived_archive_filenames)
+- RecordArchivedArchiveFileExtensionType(file_name);
+-
+- if (!archived_executable_) {
+- if (results.has_archive) {
+- type_ = ClientDownloadRequest::RAR_COMPRESSED_ARCHIVE;
+- } else if (!results.success) {
+- // .rar files that look invalid to Chrome may be successfully unpacked by
+- // other archive tools, so they may be a real threat.
+- type_ = ClientDownloadRequest::INVALID_RAR;
+- } else {
+- // Normal rar w/o EXEs, or invalid rar and not extended-reporting.
+- PostFinishTask(DownloadCheckResult::UNKNOWN,
+- REASON_ARCHIVE_WITHOUT_BINARIES);
+- return;
+- }
+- }
+-
+- OnFileFeatureExtractionDone();
+-}
+-
+ void CheckClientDownloadRequest::StartExtractZipFeatures() {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ DCHECK(item_); // Called directly from Start(), item should still exist.
+diff --git a/chrome/browser/safe_browsing/download_protection/check_client_download_request.h b/chrome/browser/safe_browsing/download_protection/check_client_download_request.h
+index 9042d5d589ab..1c50dcff4312 100644
+--- a/chrome/browser/safe_browsing/download_protection/check_client_download_request.h
++++ b/chrome/browser/safe_browsing/download_protection/check_client_download_request.h
+@@ -148,7 +148,6 @@ class CheckClientDownloadRequest
+ scoped_refptr<SafeBrowsingDatabaseManager> database_manager_;
+ const bool pingback_enabled_;
+ std::unique_ptr<network::SimpleURLLoader> loader_;
+- scoped_refptr<SandboxedRarAnalyzer> rar_analyzer_;
+ scoped_refptr<SandboxedZipAnalyzer> zip_analyzer_;
+ base::TimeTicks rar_analysis_start_time_;
+ base::TimeTicks zip_analysis_start_time_;
+diff --git a/chrome/common/safe_browsing/BUILD.gn b/chrome/common/safe_browsing/BUILD.gn
+index 92cc4f57d03b..4780e931e9e7 100644
+--- a/chrome/common/safe_browsing/BUILD.gn
++++ b/chrome/common/safe_browsing/BUILD.gn
+@@ -68,7 +68,6 @@ if (safe_browsing_mode == 1) {
+ ":file_type_policies",
+ "//base",
+ "//base:i18n",
+- "//third_party/unrar:unrar",
+ ]
+
+ defines = [
+@@ -121,7 +120,6 @@ source_set("safe_browsing") {
+ deps += [
+ ":archive_analyzer_results",
+ ":download_protection_util",
+- ":rar_analyzer",
+ "//components/safe_browsing:features",
+ ]
+
+diff --git a/chrome/services/file_util/public/cpp/BUILD.gn b/chrome/services/file_util/public/cpp/BUILD.gn
+index 158cbfc6d157..6d8b0df7c59e 100644
+--- a/chrome/services/file_util/public/cpp/BUILD.gn
++++ b/chrome/services/file_util/public/cpp/BUILD.gn
+@@ -14,8 +14,6 @@ source_set("cpp") {
+ sources = [
+ "sandboxed_dmg_analyzer_mac.cc",
+ "sandboxed_dmg_analyzer_mac.h",
+- "sandboxed_rar_analyzer.cc",
+- "sandboxed_rar_analyzer.h",
+ "sandboxed_zip_analyzer.cc",
+ "sandboxed_zip_analyzer.h",
+ ]
+@@ -35,7 +33,6 @@ source_set("unit_tests") {
+
+ sources = [
+ "sandboxed_dmg_analyzer_mac_unittest.cc",
+- "sandboxed_rar_analyzer_unittest.cc",
+ "sandboxed_zip_analyzer_unittest.cc",
+ ]
+
+diff --git a/chrome/services/file_util/public/mojom/safe_archive_analyzer.mojom b/chrome/services/file_util/public/mojom/safe_archive_analyzer.mojom
+index 6983f7b415d4..15d5aaba3657 100644
+--- a/chrome/services/file_util/public/mojom/safe_archive_analyzer.mojom
++++ b/chrome/services/file_util/public/mojom/safe_archive_analyzer.mojom
+@@ -22,11 +22,6 @@ interface SafeArchiveAnalyzer {
+ // for malicious download protection.
+ AnalyzeDmgFile(mojo_base.mojom.File dmg_file)
+ => (SafeArchiveAnalyzerResults results);
+-
+- // Build flag FULL_SAFE_BROWSING: Analyze the |rar_file| for malicious
+- // download protection.
+- AnalyzeRarFile(mojo_base.mojom.File rar_file)
+- => (SafeArchiveAnalyzerResults results);
+ };
+
+ [Native]
+diff --git a/chrome/services/file_util/safe_archive_analyzer.cc b/chrome/services/file_util/safe_archive_analyzer.cc
+index a13b42b197b3..db49c37b9b49 100644
+--- a/chrome/services/file_util/safe_archive_analyzer.cc
++++ b/chrome/services/file_util/safe_archive_analyzer.cc
+@@ -44,12 +44,3 @@ void SafeArchiveAnalyzer::AnalyzeDmgFile(base::File dmg_file,
+ NOTREACHED();
+ #endif
+ }
+-
+-void SafeArchiveAnalyzer::AnalyzeRarFile(base::File rar_file,
+- AnalyzeRarFileCallback callback) {
+- DCHECK(rar_file.IsValid());
+-
+- safe_browsing::ArchiveAnalyzerResults results;
+- safe_browsing::rar_analyzer::AnalyzeRarFile(std::move(rar_file), &results);
+- std::move(callback).Run(results);
+-}
+diff --git a/chrome/services/file_util/safe_archive_analyzer.h b/chrome/services/file_util/safe_archive_analyzer.h
+index f21efa6f57ba..2eda4f378bcc 100644
+--- a/chrome/services/file_util/safe_archive_analyzer.h
++++ b/chrome/services/file_util/safe_archive_analyzer.h
+@@ -25,8 +25,6 @@ class SafeArchiveAnalyzer : public chrome::mojom::SafeArchiveAnalyzer {
+ AnalyzeZipFileCallback callback) override;
+ void AnalyzeDmgFile(base::File dmg_file,
+ AnalyzeDmgFileCallback callback) override;
+- void AnalyzeRarFile(base::File rar_file,
+- AnalyzeRarFileCallback callback) override;
+
+ const std::unique_ptr<service_manager::ServiceContextRef> service_ref_;
+
diff --git a/vaapi.patch b/vaapi.patch
new file mode 100644
index 0000000..70d0cfb
--- /dev/null
+++ b/vaapi.patch
@@ -0,0 +1,542 @@
+diff -ur chromium-69.0.3497.92-orig/chrome/browser/about_flags.cc chromium-69.0.3497.92/chrome/browser/about_flags.cc
+--- chromium-69.0.3497.92-orig/chrome/browser/about_flags.cc 2018-09-12 00:39:23.000000000 +0530
++++ chromium-69.0.3497.92/chrome/browser/about_flags.cc 2018-09-13 22:10:33.938016199 +0530
+@@ -1238,12 +1238,14 @@
+ {"ui-disable-partial-swap", flag_descriptions::kUiPartialSwapName,
+ flag_descriptions::kUiPartialSwapDescription, kOsAll,
+ SINGLE_DISABLE_VALUE_TYPE(switches::kUIDisablePartialSwap)},
++#if defined(OS_CHROMEOS) || defined(OS_ANDROID)
+ {"disable-webrtc-hw-decoding", flag_descriptions::kWebrtcHwDecodingName,
+ flag_descriptions::kWebrtcHwDecodingDescription, kOsAndroid | kOsCrOS,
+ SINGLE_DISABLE_VALUE_TYPE(switches::kDisableWebRtcHWDecoding)},
+ {"disable-webrtc-hw-encoding", flag_descriptions::kWebrtcHwEncodingName,
+ flag_descriptions::kWebrtcHwEncodingDescription, kOsAndroid | kOsCrOS,
+ SINGLE_DISABLE_VALUE_TYPE(switches::kDisableWebRtcHWEncoding)},
++#endif
+ {"enable-webrtc-hw-h264-encoding",
+ flag_descriptions::kWebrtcHwH264EncodingName,
+ flag_descriptions::kWebrtcHwH264EncodingDescription, kOsAndroid | kOsCrOS,
+@@ -1612,6 +1614,13 @@
+ flag_descriptions::kShowTouchHudDescription, kOsCrOS,
+ SINGLE_VALUE_TYPE(ash::switches::kAshTouchHud)},
+ #endif // OS_CHROMEOS
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++ {
++ "enable-accelerated-video", flag_descriptions::kAcceleratedVideoName,
++ flag_descriptions::kAcceleratedVideoDescription, kOsLinux,
++ SINGLE_VALUE_TYPE(switches::kEnableAcceleratedVideo),
++ },
++#else
+ {
+ "disable-accelerated-video-decode",
+ flag_descriptions::kAcceleratedVideoDecodeName,
+@@ -1619,6 +1628,7 @@
+ kOsMac | kOsWin | kOsCrOS | kOsAndroid,
+ SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
+ },
++#endif
+ #if defined(OS_WIN)
+ {"enable-hdr", flag_descriptions::kEnableHDRName,
+ flag_descriptions::kEnableHDRDescription, kOsWin,
+@@ -2291,12 +2301,17 @@
+ FEATURE_VALUE_TYPE(features::kOpenVR)},
+ #endif // ENABLE_OPENVR
+ #endif // ENABLE_VR
+-#if defined(OS_CHROMEOS)
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++ {"enable-accelerated-mjpeg-decode",
++ flag_descriptions::kAcceleratedMjpegDecodeName,
++ flag_descriptions::kAcceleratedMjpegDecodeDescription, kOsLinux,
++ SINGLE_VALUE_TYPE(switches::kEnableAcceleratedMjpegDecode)},
++#elif defined(OS_CHROMEOS)
+ {"disable-accelerated-mjpeg-decode",
+ flag_descriptions::kAcceleratedMjpegDecodeName,
+ flag_descriptions::kAcceleratedMjpegDecodeDescription, kOsCrOS,
+ SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedMjpegDecode)},
+-#endif // OS_CHROMEOS
++#endif
+ {"v8-cache-options", flag_descriptions::kV8CacheOptionsName,
+ flag_descriptions::kV8CacheOptionsDescription, kOsAll,
+ MULTI_VALUE_TYPE(kV8CacheOptionsChoices)},
+Only in chromium-69.0.3497.92/chrome/browser: about_flags.cc.orig
+diff -ur chromium-69.0.3497.92-orig/chrome/browser/chromeos/login/chrome_restart_request.cc chromium-69.0.3497.92/chrome/browser/chromeos/login/chrome_restart_request.cc
+--- chromium-69.0.3497.92-orig/chrome/browser/chromeos/login/chrome_restart_request.cc 2018-09-12 00:39:23.000000000 +0530
++++ chromium-69.0.3497.92/chrome/browser/chromeos/login/chrome_restart_request.cc 2018-09-13 22:10:33.986014728 +0530
+@@ -19,6 +19,7 @@
+ #include "base/sys_info.h"
+ #include "base/timer/timer.h"
+ #include "base/values.h"
++#include "build/build_config.h"
+ #include "cc/base/switches.h"
+ #include "chrome/browser/browser_process.h"
+ #include "chrome/browser/chromeos/boot_times_recorder.h"
+@@ -84,9 +85,14 @@
+ ::switches::kDisable2dCanvasImageChromium,
+ ::switches::kDisableAccelerated2dCanvas,
+ ::switches::kDisableAcceleratedJpegDecoding,
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++ ::switches::kEnableAcceleratedMjpegDecode,
++ ::switches::kEnableAcceleratedVideo,
++#else
+ ::switches::kDisableAcceleratedMjpegDecode,
+ ::switches::kDisableAcceleratedVideoDecode,
+ ::switches::kDisableAcceleratedVideoEncode,
++#endif
+ ::switches::kDisableBlinkFeatures,
+ ::switches::kDisableCastStreamingHWEncoding,
+ ::switches::kDisableGpu,
+@@ -160,8 +166,10 @@
+ ::switches::kEnableWebGLImageChromium,
+ ::switches::kEnableWebVR,
+ ::switches::kEnableUnsafeWebGPU,
++#if (defined(OS_CHROMEOS) || defined(OS_ANDROID))
+ ::switches::kDisableWebRtcHWDecoding,
+ ::switches::kDisableWebRtcHWEncoding,
++#endif
+ ::switches::kOzonePlatform,
+ ash::switches::kAshEnableTabletMode,
+ ash::switches::kAshEnableWaylandServer,
+diff -ur chromium-69.0.3497.92-orig/chrome/browser/flag_descriptions.cc chromium-69.0.3497.92/chrome/browser/flag_descriptions.cc
+--- chromium-69.0.3497.92-orig/chrome/browser/flag_descriptions.cc 2018-09-12 00:39:24.000000000 +0530
++++ chromium-69.0.3497.92/chrome/browser/flag_descriptions.cc 2018-09-13 22:10:34.007014085 +0530
+@@ -14,6 +14,13 @@
+ "Enables the use of the GPU to perform 2d canvas rendering instead of "
+ "using software rendering.";
+
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++const char kAcceleratedVideoName[] = "Hardware-accelerated video";
++const char kAcceleratedVideoDescription[] =
++ "Hardware-accelerated video where VA-API driver is installed on the"
++ "system.";
++#endif
++
+ const char kAcceleratedVideoDecodeName[] = "Hardware-accelerated video decode";
+ const char kAcceleratedVideoDecodeDescription[] =
+ "Hardware-accelerated video decode where available.";
+@@ -1986,6 +1993,7 @@
+ const char kWebrtcEchoCanceller3Description[] =
+ "Experimental WebRTC echo canceller (AEC3).";
+
++#if defined(OS_CHROMEOS) || defined(OS_ANDROID)
+ const char kWebrtcHwDecodingName[] = "WebRTC hardware video decoding";
+ const char kWebrtcHwDecodingDescription[] =
+ "Support in WebRTC for decoding video streams using platform hardware.";
+@@ -1993,6 +2001,7 @@
+ const char kWebrtcHwEncodingName[] = "WebRTC hardware video encoding";
+ const char kWebrtcHwEncodingDescription[] =
+ "Support in WebRTC for encoding video streams using platform hardware.";
++#endif
+
+ const char kWebrtcHwH264EncodingName[] = "WebRTC hardware h264 video encoding";
+ const char kWebrtcHwH264EncodingDescription[] =
+@@ -2892,14 +2901,16 @@
+
+ // Chrome OS -------------------------------------------------------------------
+
+-#if defined(OS_CHROMEOS)
++#if defined(OS_CHROMEOS) || (defined(OS_LINUX) && !defined(OS_ANDROID))
+
+ const char kAcceleratedMjpegDecodeName[] =
+ "Hardware-accelerated mjpeg decode for captured frame";
+ const char kAcceleratedMjpegDecodeDescription[] =
+ "Enable hardware-accelerated mjpeg decode for captured frame where "
+ "available.";
++#endif
+
++#if defined(OS_CHROMEOS)
+ const char kAllowTouchpadThreeFingerClickName[] = "Touchpad three-finger-click";
+ const char kAllowTouchpadThreeFingerClickDescription[] =
+ "Enables touchpad three-finger-click as middle button.";
+diff -ur chromium-69.0.3497.92-orig/chrome/browser/flag_descriptions.h chromium-69.0.3497.92/chrome/browser/flag_descriptions.h
+--- chromium-69.0.3497.92-orig/chrome/browser/flag_descriptions.h 2018-09-12 00:39:24.000000000 +0530
++++ chromium-69.0.3497.92/chrome/browser/flag_descriptions.h 2018-09-13 22:10:34.030013380 +0530
+@@ -37,6 +37,10 @@
+ extern const char kAccelerated2dCanvasName[];
+ extern const char kAccelerated2dCanvasDescription[];
+
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++extern const char kAcceleratedVideoName[];
++extern const char kAcceleratedVideoDescription[];
++#endif
+ extern const char kAcceleratedVideoDecodeName[];
+ extern const char kAcceleratedVideoDecodeDescription[];
+
+@@ -1762,13 +1766,17 @@
+
+ #endif // defined(OS_MACOSX)
+
+-// Chrome OS ------------------------------------------------------------------
+-
+-#if defined(OS_CHROMEOS)
++#if defined(OS_CHROMEOS) || (defined(OS_LINUX) && !defined(OS_ANDROID))
+
+ extern const char kAcceleratedMjpegDecodeName[];
+ extern const char kAcceleratedMjpegDecodeDescription[];
+
++#endif
++
++// Chrome OS ------------------------------------------------------------------
++
++#if defined(OS_CHROMEOS)
++
+ extern const char kAllowTouchpadThreeFingerClickName[];
+ extern const char kAllowTouchpadThreeFingerClickDescription[];
+
+diff -ur chromium-69.0.3497.92-orig/content/browser/gpu/compositor_util.cc chromium-69.0.3497.92/content/browser/gpu/compositor_util.cc
+--- chromium-69.0.3497.92-orig/content/browser/gpu/compositor_util.cc 2018-09-12 00:39:41.000000000 +0530
++++ chromium-69.0.3497.92/content/browser/gpu/compositor_util.cc 2018-09-13 22:10:34.072012092 +0530
+@@ -149,7 +149,11 @@
+ {"video_decode",
+ SafeGetFeatureStatus(gpu_feature_info,
+ gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE),
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++ !command_line.HasSwitch(switches::kEnableAcceleratedVideo),
++#else
+ command_line.HasSwitch(switches::kDisableAcceleratedVideoDecode),
++#endif
+ "Accelerated video decode has been disabled, either via blacklist, "
+ "about:flags or the command line.",
+ true, true},
+diff -ur chromium-69.0.3497.92-orig/content/browser/gpu/gpu_process_host.cc chromium-69.0.3497.92/content/browser/gpu/gpu_process_host.cc
+--- chromium-69.0.3497.92-orig/content/browser/gpu/gpu_process_host.cc 2018-09-12 00:39:41.000000000 +0530
++++ chromium-69.0.3497.92/content/browser/gpu/gpu_process_host.cc 2018-09-13 22:10:34.113010836 +0530
+@@ -209,7 +209,9 @@
+ switches::kDisableLogging,
+ switches::kDisableShaderNameHashing,
+ switches::kDisableSkiaRuntimeOpts,
++#if !defined(OS_LINUX)
+ switches::kDisableWebRtcHWEncoding,
++#endif
+ #if defined(OS_WIN)
+ switches::kEnableAcceleratedVpxDecode,
+ #endif
+diff -ur chromium-69.0.3497.92-orig/content/browser/renderer_host/media/video_capture_browsertest.cc chromium-69.0.3497.92/content/browser/renderer_host/media/video_capture_browsertest.cc
+--- chromium-69.0.3497.92-orig/content/browser/renderer_host/media/video_capture_browsertest.cc 2018-09-12 00:39:41.000000000 +0530
++++ chromium-69.0.3497.92/content/browser/renderer_host/media/video_capture_browsertest.cc 2018-09-13 22:10:34.124010499 +0530
+@@ -165,8 +165,13 @@
+ base::CommandLine::ForCurrentProcess()->AppendSwitch(
+ switches::kUseFakeJpegDecodeAccelerator);
+ } else {
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++ base::CommandLine::ForCurrentProcess()->AppendSwitch(
++ switches::kEnableAcceleratedMjpegDecode);
++#else
+ base::CommandLine::ForCurrentProcess()->AppendSwitch(
+ switches::kDisableAcceleratedMjpegDecode);
++#endif
+ }
+ }
+
+diff -ur chromium-69.0.3497.92-orig/content/browser/renderer_host/render_process_host_impl.cc chromium-69.0.3497.92/content/browser/renderer_host/render_process_host_impl.cc
+--- chromium-69.0.3497.92-orig/content/browser/renderer_host/render_process_host_impl.cc 2018-09-12 00:39:41.000000000 +0530
++++ chromium-69.0.3497.92/content/browser/renderer_host/render_process_host_impl.cc 2018-09-13 22:10:34.133010223 +0530
+@@ -2798,7 +2798,11 @@
+ switches::kDefaultTileHeight,
+ switches::kDisable2dCanvasImageChromium,
+ switches::kDisableAcceleratedJpegDecoding,
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++ switches::kEnableAcceleratedVideo,
++#else
+ switches::kDisableAcceleratedVideoDecode,
++#endif
+ switches::kDisableBackgroundTasks,
+ switches::kDisableBackgroundTimerThrottling,
+ switches::kDisableBreakpad,
+@@ -2933,8 +2937,10 @@
+ #if BUILDFLAG(ENABLE_RUNTIME_MEDIA_RENDERER_SELECTION)
+ switches::kDisableMojoRenderer,
+ #endif
++#if !defined(OS_LINUX) || defined(OS_CHROMEOS)
+ switches::kDisableWebRtcHWDecoding,
+ switches::kDisableWebRtcHWEncoding,
++#endif
+ switches::kEnableWebRtcSrtpAesGcm,
+ switches::kEnableWebRtcSrtpEncryptedHeaders,
+ switches::kEnableWebRtcStunOrigin,
+Only in chromium-69.0.3497.92/content/browser/renderer_host: render_process_host_impl.cc.orig
+diff -ur chromium-69.0.3497.92-orig/content/browser/utility_process_host.cc chromium-69.0.3497.92/content/browser/utility_process_host.cc
+--- chromium-69.0.3497.92-orig/content/browser/utility_process_host.cc 2018-09-12 00:39:41.000000000 +0530
++++ chromium-69.0.3497.92/content/browser/utility_process_host.cc 2018-09-13 22:10:34.296005227 +0530
+@@ -296,7 +296,11 @@
+ switches::kOverrideUseSoftwareGLForTests,
+ switches::kOverrideEnabledCdmInterfaceVersion,
+ switches::kProxyServer,
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++ switches::kEnableAcceleratedMjpegDecode,
++#else
+ switches::kDisableAcceleratedMjpegDecode,
++#endif
+ switches::kUseFakeDeviceForMediaStream,
+ switches::kUseFakeJpegDecodeAccelerator,
+ switches::kUseFileForFakeVideoCapture,
+diff -ur chromium-69.0.3497.92-orig/content/browser/webrtc/webrtc_media_recorder_browsertest.cc chromium-69.0.3497.92/content/browser/webrtc/webrtc_media_recorder_browsertest.cc
+--- chromium-69.0.3497.92-orig/content/browser/webrtc/webrtc_media_recorder_browsertest.cc 2018-09-12 00:39:41.000000000 +0530
++++ chromium-69.0.3497.92/content/browser/webrtc/webrtc_media_recorder_browsertest.cc 2018-09-13 22:10:34.143009916 +0530
+@@ -66,7 +66,12 @@
+ return;
+ // This flag is also used for encoding, https://crbug.com/616640.
+ base::CommandLine::ForCurrentProcess()->AppendSwitch(
+- switches::kDisableAcceleratedVideoDecode);
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++ switches::kEnableAcceleratedVideo
++#else
++ switches::kDisableAcceleratedVideoDecode
++#endif
++ );
+ }
+
+ private:
+diff -ur chromium-69.0.3497.92-orig/content/gpu/BUILD.gn chromium-69.0.3497.92/content/gpu/BUILD.gn
+--- chromium-69.0.3497.92-orig/content/gpu/BUILD.gn 2018-09-12 00:39:41.000000000 +0530
++++ chromium-69.0.3497.92/content/gpu/BUILD.gn 2018-09-13 22:10:34.148009763 +0530
+@@ -133,4 +133,8 @@
+ (!is_chromecast || is_cast_desktop_build)) {
+ configs += [ "//build/config/linux/dri" ]
+ }
++
++ if (is_desktop_linux) {
++ public_configs = [ "//media/gpu:libva_config" ]
++ }
+ }
+diff -ur chromium-69.0.3497.92-orig/content/gpu/gpu_main.cc chromium-69.0.3497.92/content/gpu/gpu_main.cc
+--- chromium-69.0.3497.92-orig/content/gpu/gpu_main.cc 2018-09-12 00:39:41.000000000 +0530
++++ chromium-69.0.3497.92/content/gpu/gpu_main.cc 2018-09-13 22:10:34.153009610 +0530
+@@ -284,7 +284,7 @@
+
+ base::PlatformThread::SetName("CrGpuMain");
+
+-#if defined(OS_ANDROID) || defined(OS_CHROMEOS)
++#if defined(OS_LINUX)
+ // Set thread priority before sandbox initialization.
+ base::PlatformThread::SetCurrentThreadPriority(base::ThreadPriority::DISPLAY);
+ #endif
+@@ -317,7 +317,7 @@
+ GetContentClient()->SetGpuInfo(gpu_init->gpu_info());
+
+ base::ThreadPriority io_thread_priority = base::ThreadPriority::NORMAL;
+-#if defined(OS_ANDROID) || defined(OS_CHROMEOS)
++#if defined(OS_LINUX)
+ io_thread_priority = base::ThreadPriority::DISPLAY;
+ #endif
+
+diff -ur chromium-69.0.3497.92-orig/content/public/browser/gpu_utils.cc chromium-69.0.3497.92/content/public/browser/gpu_utils.cc
+--- chromium-69.0.3497.92-orig/content/public/browser/gpu_utils.cc 2018-09-12 00:39:42.000000000 +0530
++++ chromium-69.0.3497.92/content/public/browser/gpu_utils.cc 2018-09-13 22:10:34.164009273 +0530
+@@ -57,9 +57,17 @@
+ gpu_preferences.in_process_gpu =
+ command_line->HasSwitch(switches::kInProcessGPU);
+ gpu_preferences.disable_accelerated_video_decode =
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++ !command_line->HasSwitch(switches::kEnableAcceleratedVideo);
++#else
+ command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode);
++#endif
+ gpu_preferences.disable_accelerated_video_encode =
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++ !command_line->HasSwitch(switches::kEnableAcceleratedVideo);
++#else
+ command_line->HasSwitch(switches::kDisableAcceleratedVideoEncode);
++#endif
+ #if defined(OS_WIN)
+ uint32_t enable_accelerated_vpx_decode_val =
+ gpu::GpuPreferences::VPX_VENDOR_MICROSOFT;
+diff -ur chromium-69.0.3497.92-orig/content/public/common/content_switches.cc chromium-69.0.3497.92/content/public/common/content_switches.cc
+--- chromium-69.0.3497.92-orig/content/public/common/content_switches.cc 2018-09-12 00:39:42.000000000 +0530
++++ chromium-69.0.3497.92/content/public/common/content_switches.cc 2018-09-13 22:10:34.172009028 +0530
+@@ -79,6 +79,11 @@
+ // Disable gpu-accelerated 2d canvas.
+ const char kDisableAccelerated2dCanvas[] = "disable-accelerated-2d-canvas";
+
++#if defined(OS_LINUX)
++// Enables hardware acceleration of video for Linux only. VA-API driver
++// is required to be present on the system installation.
++const char kEnableAcceleratedVideo[] = "enable-accelerated-video";
++#endif
+ // Disables hardware acceleration of video decode, where available.
+ const char kDisableAcceleratedVideoDecode[] =
+ "disable-accelerated-video-decode";
+@@ -868,11 +873,13 @@
+ // ignores this switch on its stable and beta channels.
+ const char kDisableWebRtcEncryption[] = "disable-webrtc-encryption";
+
++#if defined(OS_CHROMEOS)
+ // Disables HW decode acceleration for WebRTC.
+ const char kDisableWebRtcHWDecoding[] = "disable-webrtc-hw-decoding";
+
+ // Disables HW encode acceleration for WebRTC.
+ const char kDisableWebRtcHWEncoding[] = "disable-webrtc-hw-encoding";
++#endif
+
+ // Enables negotiation of GCM cipher suites from RFC 7714 for SRTP in WebRTC.
+ // See https://tools.ietf.org/html/rfc7714 for further information.
+diff -ur chromium-69.0.3497.92-orig/content/public/common/content_switches.h chromium-69.0.3497.92/content/public/common/content_switches.h
+--- chromium-69.0.3497.92-orig/content/public/common/content_switches.h 2018-09-12 00:39:42.000000000 +0530
++++ chromium-69.0.3497.92/content/public/common/content_switches.h 2018-09-13 22:10:34.172009028 +0530
+@@ -104,6 +104,9 @@
+ CONTENT_EXPORT extern const char kDomAutomationController[];
+ extern const char kDisable2dCanvasClipAntialiasing[];
+ CONTENT_EXPORT extern const char kDumpBlinkRuntimeCallStats[];
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++CONTENT_EXPORT extern const char kEnableAcceleratedVideo[];
++#endif
+ CONTENT_EXPORT extern const char kEnableAccessibilityObjectModel[];
+ CONTENT_EXPORT extern const char kEnableAggressiveDOMStorageFlushing[];
+ CONTENT_EXPORT extern const char kEnableAutomation[];
+@@ -241,8 +244,10 @@
+ CONTENT_EXPORT extern const char kWaitForDebuggerChildren[];
+
+ CONTENT_EXPORT extern const char kDisableWebRtcEncryption[];
++#if defined(OS_CHROMEOS)
+ CONTENT_EXPORT extern const char kDisableWebRtcHWDecoding[];
+ CONTENT_EXPORT extern const char kDisableWebRtcHWEncoding[];
++#endif
+ CONTENT_EXPORT extern const char kEnableWebRtcSrtpAesGcm[];
+ CONTENT_EXPORT extern const char kEnableWebRtcSrtpEncryptedHeaders[];
+ CONTENT_EXPORT extern const char kEnableWebRtcStunOrigin[];
+diff -ur chromium-69.0.3497.92-orig/content/renderer/media/webrtc/peer_connection_dependency_factory.cc chromium-69.0.3497.92/content/renderer/media/webrtc/peer_connection_dependency_factory.cc
+--- chromium-69.0.3497.92-orig/content/renderer/media/webrtc/peer_connection_dependency_factory.cc 2018-09-12 00:39:42.000000000 +0530
++++ chromium-69.0.3497.92/content/renderer/media/webrtc/peer_connection_dependency_factory.cc 2018-09-13 22:10:34.181008752 +0530
+@@ -276,10 +276,18 @@
+
+ const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
+ if (gpu_factories && gpu_factories->IsGpuVideoAcceleratorEnabled()) {
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++ if (cmd_line->HasSwitch(switches::kEnableAcceleratedVideo))
++#else
+ if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWDecoding))
++#endif
+ decoder_factory.reset(new RTCVideoDecoderFactory(gpu_factories));
+
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++ if (cmd_line->HasSwitch(switches::kEnableAcceleratedVideo))
++#else
+ if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWEncoding))
++#endif
+ encoder_factory.reset(new RTCVideoEncoderFactory(gpu_factories));
+ }
+
+diff -ur chromium-69.0.3497.92-orig/content/renderer/render_thread_impl.cc chromium-69.0.3497.92/content/renderer/render_thread_impl.cc
+--- chromium-69.0.3497.92-orig/content/renderer/render_thread_impl.cc 2018-09-12 00:39:42.000000000 +0530
++++ chromium-69.0.3497.92/content/renderer/render_thread_impl.cc 2018-09-13 22:10:34.192008415 +0530
+@@ -1441,7 +1441,11 @@
+ kGpuStreamPriorityMedia);
+
+ const bool enable_video_accelerator =
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++ cmd_line->HasSwitch(switches::kEnableAcceleratedVideo) &&
++#else
+ !cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode) &&
++#endif
+ (gpu_channel_host->gpu_feature_info()
+ .status_values[gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE] ==
+ gpu::kGpuFeatureStatusEnabled);
+Only in chromium-69.0.3497.92/content/renderer: render_thread_impl.cc.orig
+diff -ur chromium-69.0.3497.92-orig/gpu/config/software_rendering_list.json chromium-69.0.3497.92/gpu/config/software_rendering_list.json
+--- chromium-69.0.3497.92-orig/gpu/config/software_rendering_list.json 2018-09-12 00:39:44.000000000 +0530
++++ chromium-69.0.3497.92/gpu/config/software_rendering_list.json 2018-09-13 22:10:34.193008384 +0530
+@@ -377,17 +377,6 @@
+ ]
+ },
+ {
+- "id": 48,
+- "description": "Accelerated video decode is unavailable on Linux",
+- "cr_bugs": [137247],
+- "os": {
+- "type": "linux"
+- },
+- "features": [
+- "accelerated_video_decode"
+- ]
+- },
+- {
+ "id": 50,
+ "description": "Disable VMware software renderer on older Mesa",
+ "cr_bugs": [145531, 332596, 571899, 629434],
+diff -ur chromium-69.0.3497.92-orig/media/base/media_switches.cc chromium-69.0.3497.92/media/base/media_switches.cc
+--- chromium-69.0.3497.92-orig/media/base/media_switches.cc 2018-09-12 00:39:48.000000000 +0530
++++ chromium-69.0.3497.92/media/base/media_switches.cc 2018-09-13 22:10:34.214007740 +0530
+@@ -117,10 +117,15 @@
+ // accelerator hardware to be present.
+ const char kUseFakeJpegDecodeAccelerator[] = "use-fake-jpeg-decode-accelerator";
+
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++// Enable hardware accelerated mjpeg decode on linux
++const char kEnableAcceleratedMjpegDecode[] = "enable-accelerated-mjpeg-decode";
++#else
+ // Disable hardware acceleration of mjpeg decode for captured frame, where
+ // available.
+ const char kDisableAcceleratedMjpegDecode[] =
+ "disable-accelerated-mjpeg-decode";
++#endif
+
+ // When running tests on a system without the required hardware or libraries,
+ // this flag will cause the tests to fail. Otherwise, they silently succeed.
+@@ -462,15 +467,22 @@
+ #endif
+
+ bool IsVideoCaptureAcceleratedJpegDecodingEnabled() {
++
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
++ if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
++ switches::kEnableAcceleratedMjpegDecode)
++#else
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+- switches::kDisableAcceleratedMjpegDecode)) {
++ switches::kDisableAcceleratedMjpegDecode)
++#endif
++ ) {
+ return false;
+ }
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kUseFakeJpegDecodeAccelerator)) {
+ return true;
+ }
+-#if defined(OS_CHROMEOS)
++#if !defined(OS_ANDROID) && defined(OS_LINUX)
+ return true;
+ #endif
+ return false;
+diff -ur chromium-69.0.3497.92-orig/media/base/media_switches.h chromium-69.0.3497.92/media/base/media_switches.h
+--- chromium-69.0.3497.92-orig/media/base/media_switches.h 2018-09-12 00:39:48.000000000 +0530
++++ chromium-69.0.3497.92/media/base/media_switches.h 2018-09-13 22:10:34.283005625 +0530
+@@ -66,7 +66,11 @@
+ MEDIA_EXPORT extern const char kUseFileForFakeVideoCapture[];
+ MEDIA_EXPORT extern const char kUseFileForFakeAudioCapture[];
+ MEDIA_EXPORT extern const char kUseFakeJpegDecodeAccelerator[];
++#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++MEDIA_EXPORT extern const char kEnableAcceleratedMjpegDecode[];
++#else
+ MEDIA_EXPORT extern const char kDisableAcceleratedMjpegDecode[];
++#endif
+
+ MEDIA_EXPORT extern const char kRequireAudioHardwareForTesting[];
+ MEDIA_EXPORT extern const char kMuteAudio[];
+diff -ur chromium-69.0.3497.92-orig/media/gpu/BUILD.gn chromium-69.0.3497.92/media/gpu/BUILD.gn
+--- chromium-69.0.3497.92-orig/media/gpu/BUILD.gn 2018-09-12 00:39:48.000000000 +0530
++++ chromium-69.0.3497.92/media/gpu/BUILD.gn 2018-09-13 22:10:34.210007863 +0530
+@@ -495,6 +495,14 @@
+ }
+ }
+
++if (is_desktop_linux && use_vaapi) {
++ import("//build/config/linux/pkg_config.gni")
++
++ pkg_config("libva_config") {
++ packages = [ "libva" ]
++ }
++}
++
+ if (use_vaapi) {
+ test("jpeg_encode_accelerator_unittest") {
+ deps = [
+@@ -559,6 +567,10 @@
+ if (use_ozone) {
+ deps += [ "//ui/ozone" ]
+ }
++
++ if (is_desktop_linux) {
++ public_configs = [ ":libva_config" ]
++ }
+ }
+ }
+
diff --git a/widevine.patch b/widevine.patch
new file mode 100644
index 0000000..2fc8d79
--- /dev/null
+++ b/widevine.patch
@@ -0,0 +1,23 @@
+diff -upr chromium-48.0.2564.82.orig/third_party/widevine/cdm/stub/widevine_cdm_version.h chromium-48.0.2564.82/third_party/widevine/cdm/stub/widevine_cdm_version.h
+--- chromium-48.0.2564.82.orig/third_party/widevine/cdm/stub/widevine_cdm_version.h 2016-01-14 01:05:17.000000000 +0200
++++ chromium-48.0.2564.82/third_party/widevine/cdm/stub/widevine_cdm_version.h 2016-01-21 19:18:51.287978456 +0200
+@@ -12,4 +12,6 @@
+
+ #define WIDEVINE_CDM_AVAILABLE
+
++#define WIDEVINE_CDM_VERSION_STRING "67"
++
+ #endif // WIDEVINE_CDM_VERSION_H_
+ #endif // WIDEVINE_CDM_VERSION_H_
+
+--- a/third_party/widevine/cdm/BUILD.gn
++++ b/third_party/widevine/cdm/BUILD.gn
+@@ -11,7 +11,7 @@ import("//third_party/widevine/cdm/widev
+ # Internal Cast builds set enable_widevine=true to bring in Widevine support.
+ # TODO(xhwang): Support component updated CDM on other platforms and remove this
+ # assert.
+-assert(!enable_widevine || is_win || is_mac || is_chromecast,
++assert(!enable_widevine || is_win || is_mac || is_chromecast || is_linux,
+ "Component updated CDM only supported on Windows and Mac for now.")
+
+ widevine_arch = current_cpu
6 years, 1 month
[telegram-desktop] Updated to 1.4.0.
by Vitaly Zaitsev
Summary of changes:
a8d5647... Updated to 1.4.0. (*)
(*) This commit already existed in another branch; no separate mail sent
6 years, 1 month