From 306d54f76870c753cc022f4889af1512286bfb20 Mon Sep 17 00:00:00 2001 From: Duncaen Date: Thu, 22 Mar 2018 22:32:48 +0100 Subject: [PATCH] chromium: update to 65.0.3325.181. The build with gcc is currently broken, therefor I added a clang build option that is enabled by default for now. The following system libraries are now used: * fontconfig * freetype * harfbuzz-ng * opus * re2 Removed the `use_gconf` gn option because it doesn't exist anymore. Closes #12807 --- .../files/musl-patches/musl-libc++.patch | 13 ---- .../chromium/patches/chromium-clang-r2.patch | 21 +++++ .../chromium/patches/chromium-math.h-r0.patch | 29 +++++++ .../patches/chromium-skia-harmony.patch | 77 +++++++++++++++++++ .../chromium/patches/chromium-stdint.patch | 21 +++++ srcpkgs/chromium/patches/xlocale.patch | 11 --- srcpkgs/chromium/template | 62 +++++++++------ 7 files changed, 188 insertions(+), 46 deletions(-) create mode 100644 srcpkgs/chromium/patches/chromium-clang-r2.patch create mode 100644 srcpkgs/chromium/patches/chromium-math.h-r0.patch create mode 100644 srcpkgs/chromium/patches/chromium-skia-harmony.patch create mode 100644 srcpkgs/chromium/patches/chromium-stdint.patch delete mode 100644 srcpkgs/chromium/patches/xlocale.patch diff --git a/srcpkgs/chromium/files/musl-patches/musl-libc++.patch b/srcpkgs/chromium/files/musl-patches/musl-libc++.patch index 7f179331d0a..088d80fad52 100644 --- a/srcpkgs/chromium/files/musl-patches/musl-libc++.patch +++ b/srcpkgs/chromium/files/musl-patches/musl-libc++.patch @@ -53,16 +53,3 @@ index 4163c2c..3d1902a 100644 #endif } #endif -diff --git a/buildtools/third_party/libc++/trunk/src/system_error.cpp b/buildtools/third_party/libc++/trunk/src/system_error.cpp -index cbbbb5d..8761e65 100644 ---- buildtools/third_party/libc++/trunk/src/system_error.cpp -+++ buildtools/third_party/libc++/trunk/src/system_error.cpp -@@ -73,7 +73,7 @@ string do_strerror_r(int ev) { - std::snprintf(buffer, strerror_buff_size, "unknown error %d", ev); - return string(buffer); - } --#elif defined(__linux__) && !defined(_LIBCPP_HAS_MUSL_LIBC) && \ -+#elif defined(__GLIBC__) && !defined(_LIBCPP_HAS_MUSL_LIBC) && \ - (!defined(__ANDROID__) || __ANDROID_API__ >= 23) - // GNU Extended version - string do_strerror_r(int ev) { diff --git a/srcpkgs/chromium/patches/chromium-clang-r2.patch b/srcpkgs/chromium/patches/chromium-clang-r2.patch new file mode 100644 index 00000000000..ca38f6de573 --- /dev/null +++ b/srcpkgs/chromium/patches/chromium-clang-r2.patch @@ -0,0 +1,21 @@ +--- build/config/compiler/BUILD.gn ++++ build/config/compiler/BUILD.gn +@@ -422,18 +422,6 @@ + cflags += [ "-fcolor-diagnostics" ] + } + +- # TODO(hans): Remove this once Clang generates better optimized debug info by +- # default. https://crbug.com/765793 +- if (is_clang && !is_nacl && current_toolchain == host_toolchain && +- target_os != "chromeos") { +- cflags += [ +- "-Xclang", +- "-mllvm", +- "-Xclang", +- "-instcombine-lower-dbg-declare=0", +- ] +- } +- + # Print absolute paths in diagnostics. There is no precedent for doing this + # on Linux/Mac (GCC doesn't support it), but MSVC does this with /FC and + # Windows developers rely on it (crbug.com/636109) so only do this on Windows. diff --git a/srcpkgs/chromium/patches/chromium-math.h-r0.patch b/srcpkgs/chromium/patches/chromium-math.h-r0.patch new file mode 100644 index 00000000000..9d837c2c8f1 --- /dev/null +++ b/srcpkgs/chromium/patches/chromium-math.h-r0.patch @@ -0,0 +1,29 @@ +From 9f63f94a11abc34d40ede8b8712fa15b5844a8c0 Mon Sep 17 00:00:00 2001 +From: Tom Anderson +Date: Sat, 27 Jan 2018 20:03:37 +0000 +Subject: [PATCH] Fix build with glibc 2.27 + +BUG=806340 +TBR=hamelphi@chromium.org + +Change-Id: Ib4e5091212d874d9ad88f3e9a1fdfee3ed7e0d5e +Reviewed-on: https://chromium-review.googlesource.com/890059 +Reviewed-by: Thomas Anderson +Reviewed-by: Philippe Hamel +Commit-Queue: Thomas Anderson +Cr-Commit-Position: refs/heads/master@{#532249} +--- + +diff --git a/components/assist_ranker/ranker_example_util.cc b/components/assist_ranker/ranker_example_util.cc +index 54d4dbd..ceedd8f 100644 +--- components/assist_ranker/ranker_example_util.cc ++++ components/assist_ranker/ranker_example_util.cc +@@ -2,6 +2,8 @@ + // Use of this source code is governed by a BSD-style license that can be + // found in the LICENSE file. + ++#include ++ + #include "components/assist_ranker/ranker_example_util.h" + #include "base/bit_cast.h" + #include "base/format_macros.h" diff --git a/srcpkgs/chromium/patches/chromium-skia-harmony.patch b/srcpkgs/chromium/patches/chromium-skia-harmony.patch new file mode 100644 index 00000000000..04e27b12160 --- /dev/null +++ b/srcpkgs/chromium/patches/chromium-skia-harmony.patch @@ -0,0 +1,77 @@ +--- third_party/skia/src/ports/SkFontHost_FreeType.cpp.orig 2017-10-10 17:42:06.956950985 +0200 ++++ third_party/skia/src/ports/SkFontHost_FreeType.cpp 2017-10-10 17:46:05.824187787 +0200 +@@ -99,8 +99,6 @@ + FreeTypeLibrary() + : fGetVarDesignCoordinates(nullptr) + , fLibrary(nullptr) +- , fIsLCDSupported(false) +- , fLCDExtra(0) + { + if (FT_New_Library(&gFTMemory, &fLibrary)) { + return; +@@ -147,12 +145,7 @@ + } + #endif + +- // Setup LCD filtering. This reduces color fringes for LCD smoothed glyphs. +- // The default has changed over time, so this doesn't mean the same thing to all users. +- if (FT_Library_SetLcdFilter(fLibrary, FT_LCD_FILTER_DEFAULT) == 0) { +- fIsLCDSupported = true; +- fLCDExtra = 2; //Using a filter adds one full pixel to each side. +- } ++ FT_Library_SetLcdFilter(fLibrary, FT_LCD_FILTER_DEFAULT); + } + ~FreeTypeLibrary() { + if (fLibrary) { +@@ -161,8 +153,6 @@ + } + + FT_Library library() { return fLibrary; } +- bool isLCDSupported() { return fIsLCDSupported; } +- int lcdExtra() { return fLCDExtra; } + + // FT_Get_{MM,Var}_{Blend,Design}_Coordinates were added in FreeType 2.7.1. + // Prior to this there was no way to get the coordinates out of the FT_Face. +@@ -173,8 +163,6 @@ + + private: + FT_Library fLibrary; +- bool fIsLCDSupported; +- int fLCDExtra; + + // FT_Library_SetLcdFilterWeights was introduced in FreeType 2.4.0. + // The following platforms provide FreeType of at least 2.4.0. +@@ -704,17 +692,6 @@ + rec->fTextSize = SkIntToScalar(1 << 14); + } + +- if (isLCD(*rec)) { +- // TODO: re-work so that FreeType is set-up and selected by the SkFontMgr. +- SkAutoMutexAcquire ama(gFTMutex); +- ref_ft_library(); +- if (!gFTLibrary->isLCDSupported()) { +- // If the runtime Freetype library doesn't support LCD, disable it here. +- rec->fMaskFormat = SkMask::kA8_Format; +- } +- unref_ft_library(); +- } +- + SkPaint::Hinting h = rec->getHinting(); + if (SkPaint::kFull_Hinting == h && !isLCD(*rec)) { + // collapse full->normal hinting if we're not doing LCD +@@ -1115,11 +1092,11 @@ + void SkScalerContext_FreeType::updateGlyphIfLCD(SkGlyph* glyph) { + if (isLCD(fRec)) { + if (fLCDIsVert) { +- glyph->fHeight += gFTLibrary->lcdExtra(); +- glyph->fTop -= gFTLibrary->lcdExtra() >> 1; ++ glyph->fHeight += 2; ++ glyph->fTop -= 1; + } else { +- glyph->fWidth += gFTLibrary->lcdExtra(); +- glyph->fLeft -= gFTLibrary->lcdExtra() >> 1; ++ glyph->fWidth += 2; ++ glyph->fLeft -= 1; + } + } + } diff --git a/srcpkgs/chromium/patches/chromium-stdint.patch b/srcpkgs/chromium/patches/chromium-stdint.patch new file mode 100644 index 00000000000..9b0390d5b77 --- /dev/null +++ b/srcpkgs/chromium/patches/chromium-stdint.patch @@ -0,0 +1,21 @@ +From 0235c2b657d936f3cdb09053776e5929fc84704b Mon Sep 17 00:00:00 2001 +From: Tomas Popela +Date: Wed, 31 Jan 2018 18:57:07 +0000 +Subject: [PATCH] Add missing stdint include + +diff --git a/chrome/browser/vr/sample_queue.cc b/chrome/browser/vr/sample_queue.cc +index c2ca777ce90c..53cb3aab1576 100644 +--- chrome/browser/vr/sample_queue.cc ++++ chrome/browser/vr/sample_queue.cc +@@ -2,6 +2,8 @@ + // Use of this source code is governed by a BSD-style license that can be + // found in the LICENSE file. + ++#include ++ + #include "chrome/browser/vr/sample_queue.h" + + namespace vr { +-- +2.16.2 + diff --git a/srcpkgs/chromium/patches/xlocale.patch b/srcpkgs/chromium/patches/xlocale.patch deleted file mode 100644 index 4d32a9e525d..00000000000 --- a/srcpkgs/chromium/patches/xlocale.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- buildtools/third_party/libc++/trunk/include/__locale.orig 2017-09-14 19:06:26.000000000 +0000 -+++ buildtools/third_party/libc++/trunk/include/__locale 2017-09-15 08:58:37.520038686 +0000 -@@ -34,7 +34,7 @@ - # include - #elif defined(_NEWLIB_VERSION) - # include --#elif (defined(__GLIBC__) || defined(__APPLE__) || defined(__FreeBSD__) \ -+#elif (defined(__APPLE__) || defined(__FreeBSD__) \ - || defined(__EMSCRIPTEN__) || defined(__IBMCPP__)) - # include - #elif defined(__Fuchsia__) diff --git a/srcpkgs/chromium/template b/srcpkgs/chromium/template index 1b30159bf3d..35edf37e941 100644 --- a/srcpkgs/chromium/template +++ b/srcpkgs/chromium/template @@ -1,24 +1,26 @@ # Template file for 'chromium' pkgname=chromium # See http://www.chromium.org/developers/calendar for the latest version -version=63.0.3239.84 +version=65.0.3325.181 revision=1 short_desc="Google's attempt at creating a safer, faster, and more stable browser" maintainer="Juan RP " homepage="http://www.chromium.org/" license="BSD" distfiles="https://commondatastorage.googleapis.com/chromium-browser-official/${pkgname}-${version}.tar.xz" -checksum=6de2754dfc333675ae6a67ae13c95666009b35c84f847b058edbf312e42fa3af +checksum=93666448c6b96ec83e6a35a64cff40db4eb92a154fe1db4e7dab4761d0e38687 only_for_archs="i686 x86_64 x86_64-musl" lib32disabled=yes nodebug=yes nopie=yes # contains tools that are not PIE, enables PIE itself -build_options="nacl" +build_options="nacl clang" +build_options_default="clang" desc_option_nacl="Enable NaCL support" +desc_option_clang="Use clang to build" -hostmakedepends="yasm python pkg-config perl gperf bison ninja nodejs hwids +hostmakedepends="$(vopt_if clang clang) yasm python pkg-config perl gperf bison ninja nodejs hwids libatomic-devel libevent-devel libglib-devel" makedepends="libpng-devel gtk+-devel gtk+3-devel nss-devel pciutils-devel libXi-devel libgcrypt-devel libgnome-keyring-devel cups-devel elfutils-devel @@ -27,7 +29,8 @@ makedepends="libpng-devel gtk+-devel gtk+3-devel nss-devel pciutils-devel libxml2-devel libxslt-devel pulseaudio-devel nss-devel libexif-devel libXcursor-devel libflac-devel speex-devel libmtp-devel libwebp-devel libjpeg-turbo-devel libevent-devel json-c-devel harfbuzz-devel - minizip-devel jsoncpp-devel zlib-devel libcap-devel libXdamage-devel" + minizip-devel jsoncpp-devel zlib-devel libcap-devel libXdamage-devel + re2-devel fontconfig-devel freetype-devel harfbuzz-devel opus-devel" depends="libexif hwids desktop-file-utils hicolor-icon-theme" nostrip_files="$(vopt_if nacl 'nacl_irt_x86_64.nexe nacl_irt_x86_32.nexe')" @@ -50,20 +53,27 @@ post_extract() { sed 's|//third_party/usb_ids/usb.ids|/usr/share/hwdata/usb.ids|g' \ -i device/usb/BUILD.gn - # Work around bug in blink in which GCC 6 optimizes away null pointer checks - # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=833524 - # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68853#c2 - sed -i '/config("compiler")/ a cflags_cc = [ "-fno-delete-null-pointer-checks" ]' \ - build/config/linux/BUILD.gn - # use system nodejs mkdir -p third_party/node/linux/node-linux-x64/bin ln -sf /usr/bin/node third_party/node/linux/node-linux-x64/bin/node + + if [ -z "$build_option_clang" ]; then + # Work around bug in blink in which GCC 6 optimizes away null pointer checks + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=833524 + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68853#c2 + sed -i '/config("compiler")/ a cflags_cc = [ "-fno-delete-null-pointer-checks" ]' \ + build/config/linux/BUILD.gn + fi } do_configure() { local system="" bootstrap_conf="" conf="" export -n CFLAGS CXXFLAGS LDFLAGS + if [ -n "$build_option_clang" ]; then + export CC=clang + export CXX=clang++ + fi + # Use system-provided libraries. # TODO: use_system_hunspell (upstream changes needed). # TODO: use_system_libsrtp. @@ -71,16 +81,18 @@ do_configure() { # TODO: use_system_ssl (http://crbug.com/58087). # TODO: use_system_sqlite (http://crbug.com/22208). # XXX xtraeme: broken currently - # use_system_opus=1 (needs opus_custom.h) # use_system_protobuf # use_system_v8=1 # use_system_zlib=1 # use_system_libvpx=1 - # use_system_re2=1 // breaks with re2-devel-2016.06.01 # bzip2 jsoncpp minizip xdg_utils speex - # harfbuzz-ng (https://crbug.com/768938) system=" flac + fontconfig + freetype + harfbuzz-ng + opus + re2 libevent libjpeg libpng @@ -97,6 +109,9 @@ do_configure() { find -type f -path "*third_party/$LIB/*" \ \! -path "*third_party/$LIB/chromium/*" \ \! -path "*third_party/$LIB/google/*" \ + \! -path './base/third_party/icu/*' \ + \! -path './third_party/pdfium/third_party/freetype/include/pstables.h' \ + \! -path './third_party/yasm/run_yasm.py' \ \! -regex '.*\.\(gn\|gni\|isolate\|py\)' \ -delete done @@ -119,12 +134,11 @@ do_configure() { fi # bootstrap GN - bootstrap_conf=' - is_clang=false + bootstrap_conf="is_clang=$(vopt_if clang true false)" + bootstrap_conf+=' treat_warnings_as_errors=false binutils_path="/usr/bin" gold_path="/usr/bin/ld.gold" - use_gconf=false use_sysroot=false use_allocator="none" use_allocator_shim=false' @@ -155,16 +169,17 @@ do_configure() { conf+=' enable_nacl=false enable_nacl_nonsfi=false' fi - conf+=' - is_clang=false - is_debug=false + conf+=" is_clang=$(vopt_if clang true false)" + conf+=' is_debug=false + clang_use_chrome_plugins=false + custom_toolchain="//build/toolchain/linux/unbundle:default" + host_toolchain="//build/toolchain/linux/unbundle:default" remove_webcore_debug_symbols=true symbol_level=0 icu_use_data_file=true use_allocator="none" use_allocator_shim=false use_cups=true - use_gconf=false use_pulseaudio=true use_sysroot=false use_system_harfbuzz=true @@ -187,7 +202,10 @@ do_configure() { # Never use bundled binutils/gold binary. conf+=" binutils_path=\"${XBPS_CROSS_BASE}/usr/bin\" - gold_path=\"${XBPS_CROSS_BASE}/usr/bin/ld.gold\"" + gold_path=\"${XBPS_CROSS_BASE}/usr/bin/ld.gold\" + linux_use_bundled_binutils=false + use_custom_libcxx=false + use_lld=false" # XXX: gold broken with musl case "${XBPS_TARGET_MACHINE}" in