extra/chromium fixes

This commit is contained in:
Kevin Mihelich 2016-10-23 21:55:00 +00:00
parent 425b1da16e
commit 370eaaf06e
4 changed files with 126 additions and 46 deletions

View file

@ -1,7 +1,7 @@
From 61fa940ff939b5e5c725469c5e546dc840ccf1a2 Mon Sep 17 00:00:00 2001
From 95b245cd1a23298440e283d36d150cdc0ec4cba7 Mon Sep 17 00:00:00 2001
From: Kevin Mihelich <kevin@archlinuxarm.org>
Date: Sun, 6 Mar 2016 20:26:53 -0700
Subject: [PATCH] system ffmpeg fixes
Subject: [PATCH 1/3] system ffmpeg fixes
---
media/ffmpeg/ffmpeg_common.h | 5 -----
@ -32,13 +32,13 @@ index fa5dfee..db045f3 100644
#include <libavutil/avutil.h>
#include <libavutil/imgutils.h>
diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc
index 83b1879..6d5e6f0 100644
index b34d8bc..3a2ebe6 100644
--- a/media/filters/ffmpeg_demuxer.cc
+++ b/media/filters/ffmpeg_demuxer.cc
@@ -1106,24 +1106,6 @@ void FFmpegDemuxer::OnFindStreamInfoDone(const PipelineStatusCB& status_cb,
// If no estimate is found, the stream entry will be kInfiniteDuration().
@@ -1151,24 +1151,6 @@ void FFmpegDemuxer::OnFindStreamInfoDone(const PipelineStatusCB& status_cb,
// If no estimate is found, the stream entry will be kInfiniteDuration.
std::vector<base::TimeDelta> start_time_estimates(format_context->nb_streams,
kInfiniteDuration());
kInfiniteDuration);
- const AVFormatInternal* internal = format_context->internal;
- if (internal && internal->packet_buffer &&
- format_context->start_time != static_cast<int64_t>(AV_NOPTS_VALUE)) {
@ -61,5 +61,5 @@ index 83b1879..6d5e6f0 100644
std::unique_ptr<MediaTracks> media_tracks(new MediaTracks());
AVStream* audio_stream = NULL;
--
2.9.3
2.10.0

View file

@ -0,0 +1,33 @@
From 354891ae65c570ebe8e54923a19b3bdbabfdfe2c Mon Sep 17 00:00:00 2001
From: Kevin Mihelich <kevin@archlinuxarm.org>
Date: Sun, 23 Oct 2016 10:56:44 -0600
Subject: [PATCH 2/3] Add aarch64 GN support
---
tools/gn/args.cc | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/gn/args.cc b/tools/gn/args.cc
index 9aaafb0..7ddfba4 100644
--- a/tools/gn/args.cc
+++ b/tools/gn/args.cc
@@ -268,6 +268,7 @@ void Args::SetSystemVarsLocked(Scope* dest) const {
static const char kX86[] = "x86";
static const char kX64[] = "x64";
static const char kArm[] = "arm";
+ static const char kArm64[] = "arm64";
static const char kMips[] = "mipsel";
const char* arch = nullptr;
@@ -280,6 +281,8 @@ void Args::SetSystemVarsLocked(Scope* dest) const {
arch = kX64;
else if (os_arch.substr(0, 3) == "arm")
arch = kArm;
+ else if (os_arch == "aarch64")
+ arch = kArm64;
else if (os_arch == "mips")
arch = kMips;
else
--
2.10.0

View file

@ -0,0 +1,60 @@
From 69d032371b025928e54c4304b8443fed7b12c08c Mon Sep 17 00:00:00 2001
From: Kevin Mihelich <kevin@archlinuxarm.org>
Date: Sun, 23 Oct 2016 10:57:25 -0600
Subject: [PATCH 3/3] ARM toolchain fixes
---
build/toolchain/linux/BUILD.gn | 28 +++++++++++++++++++++-------
1 file changed, 21 insertions(+), 7 deletions(-)
diff --git a/build/toolchain/linux/BUILD.gn b/build/toolchain/linux/BUILD.gn
index 548722d..39c5b08 100644
--- a/build/toolchain/linux/BUILD.gn
+++ b/build/toolchain/linux/BUILD.gn
@@ -22,15 +22,13 @@ clang_toolchain("clang_arm64") {
}
gcc_toolchain("arm") {
- toolprefix = "arm-linux-gnueabihf-"
-
- cc = "${toolprefix}gcc"
- cxx = "${toolprefix}g++"
+ cc = "gcc"
+ cxx = "g++"
- ar = "${toolprefix}ar"
+ ar = "ar"
ld = cxx
- readelf = "${toolprefix}readelf"
- nm = "${toolprefix}nm"
+ readelf = "readelf"
+ nm = "nm"
toolchain_args = {
current_cpu = "arm"
@@ -39,6 +37,22 @@ gcc_toolchain("arm") {
}
}
+gcc_toolchain("arm64") {
+ cc = "gcc"
+ cxx = "g++"
+
+ ar = "ar"
+ ld = cxx
+ readelf = "readelf"
+ nm = "nm"
+
+ toolchain_args = {
+ current_cpu = "arm64"
+ current_os = "linux"
+ is_clang = false
+ }
+}
+
clang_toolchain("clang_x86") {
toolchain_args = {
current_cpu = "x86"
--
2.10.0

View file

@ -5,21 +5,21 @@
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - removed NaCl, not for ARM
# - adjusted gyp flags for v7/aarch64
# - add ffmpeg to _system_libs
# - makeflags to -j4 on v7, RAM constraints
# - Gentoo patch to remove lingering built-in ffmpeg code
# - patches to fix GN for AArch64 and ARM toolchain definitions
buildarch=12
highmem=1
noautobuild=1
# Possible replacements are listed in build/linux/unbundle/replace_gn_files.py
# Keys are the names in the above script; values are the dependencies in Arch
declare -rgA _system_libs=(
[ffmpeg]=ffmpeg
[flac]=flac
[harfbuzz-ng]=harfbuzz-icu
#[libjpeg]=libjpeg # Error during build
[libjpeg]=libjpeg
[libpng]=libpng
[libvpx]=libvpx
[libwebp]=libwebp
@ -36,8 +36,8 @@ pkgver=54.0.2840.71
pkgrel=1
_launcher_ver=3
pkgdesc="The open-source project behind Google Chrome, an attempt at creating a safer, faster, and more stable browser"
arch=('armv6h' 'armv7h')
url="http://www.chromium.org/"
arch=('i686' 'x86_64' 'armv7h' 'aarch64')
url="https://www.chromium.org/Home"
license=('BSD')
depends=('gtk2' 'nss' 'alsa-lib' 'xdg-utils' 'libxss' 'libexif' 'libgcrypt'
'ttf-font' 'systemd' 'dbus' 'libpulse' 'perl' 'perl-file-basedir'
@ -47,8 +47,6 @@ makedepends=('python2' 'gperf' 'yasm' 'mesa' 'ninja')
optdepends=('kdebase-kdialog: needed for file dialogs in KDE'
'gnome-keyring: for storing passwords in GNOME keyring'
'kwallet: for storing passwords in KWallet')
provides=('chromium-browser')
conflicts=('chromium-browser')
install=chromium.install
source=(https://commondatastorage.googleapis.com/chromium-browser-official/$pkgname-$pkgver.tar.xz
chromium-launcher-$_launcher_ver.tar.gz::https://github.com/foutrelis/chromium-launcher/archive/v$_launcher_ver.tar.gz
@ -56,14 +54,18 @@ source=(https://commondatastorage.googleapis.com/chromium-browser-official/$pkgn
chromium-52.0.2743.116-unset-madv_free.patch
chromium-53.0.2785.92-last-commit-position.patch
chromium-widevine.patch
0001-system-ffmpeg-fixes.patch)
0001-system-ffmpeg-fixes.patch
0002-Add-aarch64-GN-support.patch
0003-ARM-toolchain-fixes.patch)
sha256sums=('d202d3eb0b3a979ad0e6d0d0c4faa93222c5e5b664d88b9f3a0343899fe7dd7d'
'8b01fb4efe58146279858a754d90b49e5a38c9a0b36a1f84cbb7d12f92b84c28'
'028a748a5c275de9b8f776f97909f999a8583a4b77fd1cd600b4fc5c0c3e91e9'
'd6fdcb922e5a7fbe15759d39ccc8ea4225821c44d98054ce0f23f9d1f00c9808'
'3b3aa9e28f29e6f539ed1c7832e79463b13128863a02e9c6fecd16c30d61c227'
'd3dc397956a26ec045e76c25c57a1fac5fc0acff94306b2a670daee7ba15709e'
'4a8907651ea25dd7753566799bea28b74b8cd512d3cbc40c34b6d9a43cb36e22')
'd6fdcb922e5a7fbe15759d39ccc8ea4225821c44d98054ce0f23f9d1f00c9808'
'0bb0d916a2bc332de61dc72e0726cae0cd677761d025bffc77052648ebfa3bd6'
'001c913c608482d49080c520b53a669ce7d1941ed484f5dee713bb44ca195fdc'
'ab2c1864df8f2aa36a4d8beef9d9a25fa52ed5dbb1993e11d9e5da62422f9014')
# Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
# Note: These are for Arch Linux use ONLY. For your own distribution, please
@ -77,15 +79,19 @@ _google_default_client_secret=0ZChLK6AxeA3Isu96MkwqDR4
prepare() {
cd "$srcdir/$pkgname-$pkgver"
# Arch Linux ARM fixes
patch -Np1 -i ../0001-system-ffmpeg-fixes.patch
patch -Np1 -i ../0002-Add-aarch64-GN-support.patch
patch -Np1 -i ../0003-ARM-toolchain-fixes.patch
[[ $CARCH == "armv7h" ]] && MAKEFLAGS="-j4" && CFLAGS=`echo $CFLAGS | sed -e 's/vfpv3-d16/neon/'` && CXXFLAGS="$CFLAGS"
# Enable support for the Widevine CDM plugin
# libwidevinecdm.so is not included, but can be copied over from Chrome
# (Version string doesn't seem to matter so let's go with "Pinkie Pie")
sed "s/@WIDEVINE_VERSION@/Pinkie Pie/" ../chromium-widevine.patch |
patch -Np1
# Fix building with system ffmpeg
patch -Np1 -i ../0001-system-ffmpeg-fixes.patch
# Disable MADV_FREE (if set by glibc)
# https://bugzilla.redhat.com/show_bug.cgi?id=1361157
patch -Np1 -i ../chromium-52.0.2743.116-unset-madv_free.patch
@ -99,8 +105,6 @@ prepare() {
sed -i '/config("compiler")/ a cflags_cc = [ "-fno-delete-null-pointer-checks" ]' \
build/config/linux/BUILD.gn
[[ $CARCH == "armv7h" ]] && MAKEFLAGS=-j4
# Use Python 2
find . -name '*.py' -exec sed -i -r 's|/usr/bin/python$|&2|g' {} +
@ -112,7 +116,7 @@ prepare() {
# *should* do what the remove_bundled_libraries.py script does, with the
# added benefit of not having to list all the remaining libraries
local _lib
for _lib in ${!_system_libs[@]}; do
for _lib in ${!_system_libs[@]} ${_system_libs[libjpeg]+libjpeg_turbo}; do
find -type f -path "*third_party/$_lib/*" \
\! -path "*third_party/$_lib/chromium/*" \
\! -path "*third_party/$_lib/google/*" \
@ -131,8 +135,6 @@ build() {
cd "$srcdir/$pkgname-$pkgver"
CFLAGS=`echo $CFLAGS | sed -e 's/vfpv3-d16/neon/'` && CXXFLAGS="$CFLAGS"
export PATH="$srcdir/python2-path:$PATH"
export TMPDIR="$srcdir/temp"
mkdir -p "$TMPDIR"
@ -161,31 +163,18 @@ build() {
'use_sysroot=false'
'enable_hangout_services_extension=true'
'enable_widevine=true'
"enable_nacl=$_build_nacl"
"enable_nacl_nonsfi=$_build_nacl"
'enable_nacl=false'
'enable_nacl_nonsfi=false'
"google_api_key=\"${_google_api_key}\""
"google_default_client_id=\"${_google_default_client_id}\""
"google_default_client_secret=\"${_google_default_client_secret}\""
)
[[ $CARCH == "armv7h" ]] && _chromium_conf+=(
-Dtarget_arch=arm
-Darm_neon=1
-Dv8_use_arm_eabi_hardfloat=true
-Darm_float_abi=hard
-Darmv7=1
-Darm_fpu=neon)
[[ $CARCH == "aarch64" ]] && _chromium_conf+=(
-Dtarget_arch=arm64
-Darm_neon=0
-Duse_allocator=none)
python2 tools/gn/bootstrap/bootstrap.py --gn-gen-args "${_flags[*]}"
out/Release/gn gen out/Release --args="${_flags[*]}" \
--script-executable=/usr/bin/python2
ninja -C out/Release chrome chrome_sandbox widevinecdmadapter
ninja -C out/Release chrome chrome_sandbox chromedriver widevinecdmadapter
}
package() {
@ -205,14 +194,12 @@ package() {
install -Dm4755 out/Release/chrome_sandbox \
"$pkgdir/usr/lib/chromium/chrome-sandbox"
cp -a out/Release/{*.pak,*.bin,libwidevinecdmadapter.so,icudtl.dat} \
cp -a out/Release/{*.pak,*.bin,chromedriver,libwidevinecdmadapter.so,icudtl.dat} \
out/Release/locales \
out/Release/gen/content/content_resources.pak \
"$pkgdir/usr/lib/chromium/"
# Manually strip binaries so that 'nacl_irt_*.nexe' is left intact
strip $STRIP_BINARIES "$pkgdir/usr/lib/chromium/"{chromium,chrome-sandbox}
strip $STRIP_SHARED "$pkgdir/usr/lib/chromium/libwidevinecdmadapter.so"
ln -s /usr/lib/chromium/chromedriver "$pkgdir/usr/bin/chromedriver"
for size in 22 24 48 64 128 256; do
install -Dm644 "chrome/app/theme/chromium/product_logo_$size.png" \