<NME> PKGBUILD
<BEF> # Maintainer: Michael Egger <gcarq@archlinux.info>
# Contributor: Evangelos Foutras <evangelos@foutrelis.com>
# Contributor: Pierre Schmitz <pierre@archlinux.de>
# Contributor: Jan "heftig" Steffens <jan.steffens@gmail.com>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>

pkgname=inox
pkgver=67.0.3396.87
pkgrel=1
_launcher_ver=6
pkgdesc="Chromium Spin-off to enhance privacy by disabling data transmission to Google"
arch=('x86_64')
url="https://www.chromium.org/Home"
license=('BSD')
depends=('gtk3' 'nss' 'alsa-lib' 'xdg-utils' 'libxss' 'libcups' 'libgcrypt'
         'ttf-font' 'systemd' 'dbus' 'libpulse' 'pciutils' 'json-glib'
         'desktop-file-utils' 'hicolor-icon-theme')
makedepends=('python' 'python2' 'gperf' 'yasm' 'mesa' 'ninja' 'nodejs' 'git'
             'clang' 'lld' 'llvm' 'libva')
optdepends=('pepper-flash: support for Flash content'
            'kdialog: needed for file dialogs in KDE'
            'gnome-keyring: for storing passwords in GNOME keyring'
            'kwallet: for storing passwords in KWallet'
            'libva-intel-driver: for hardware video acceleration with Intel GPUs'
            'libva-mesa-driver: for hardware video acceleration with AMD/ATI GPUs'
            'libva-vdpau-driver: for hardware video acceleration with NVIDIA GPUs')
install=inox.install
source=(https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$pkgver.tar.xz
        chromium-launcher-$_launcher_ver.tar.gz::https://github.com/foutrelis/chromium-launcher/archive/v$_launcher_ver.tar.gz
        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/product_logo_{16,22,24,32,48,64,128,256}.png
)

pkgname=inox
pkgver=59.0.3071.109
pkgrel=1
_launcher_ver=5
pkgdesc="Chromium Spin-off to enhance privacy by disabling data transmission to Google"
arch=('i686' 'x86_64')
url="https://www.chromium.org/Home"
        # Inox patchset
        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0001-fix-building-without-safebrowsing.patch
        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0002-fix-building-without-reporting.patch
        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0003-disable-autofill-download-manager.patch
        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0004-disable-google-url-tracker.patch
        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0005-disable-default-extensions.patch
        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0006-modify-default-prefs.patch
        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0007-disable-web-resource-service.patch
        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0008-restore-classic-ntp.patch
        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0009-disable-google-ipv6-probes.patch
install=inox.install
source=(https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$pkgver.tar.xz
        chromium-launcher-$_launcher_ver.tar.gz::https://github.com/foutrelis/chromium-launcher/archive/v$_launcher_ver.tar.gz
        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/inox.desktop
        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-system-ffmpeg-r6.patch
        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0001-ClientNativePixmapFactoryDmabuf-uses-ioctl-instead-o.patch
        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0001-Fix-kernel-version-condition-for-including-dma-buf.h.patch
        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-blink-gcc7.patch
        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-v8-gcc7.patch
        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-widevine.patch
        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/9000-disable-metrics.patch)
sha256sums=('5d27a72f0cb8247343034f63fdd9747ff388c05b9fceb541668dd04fb372db1d'
            '04917e3cd4307d8e31bfb0027a5dce6d086edb10ff8a716024fbb8bb0c7dccf1'
            '71471fa4690894420f9e04a2e9a622af620d92ac2714a35f9a4c4e90fa3968dd'
            '4a533acefbbc1567b0d74a1c0903e9179b8c59c1beabe748850795815366e509'
            '7b88830c5e0e9819f514ad68aae885d427541a907e25607e47dee1b0f38975fd'
            '8c10e3b03b13555b461add586422472e0a96d3af49a078d6d952bc0719ba9d94'
            'cc08b771d83b7434c3173c27419bc7d1d4ee375256f3169ef2b9333ba1f2beeb'
            '53a1e8da18069eb4d6ab3af9c923c22a0f020241a4839c3140e3601052ddf6ff'
            '896993987d4ef9f0ac7db454f288117316c2c80ed0b6764019afd760db222dad'
            '3df9b3bbdc07fde63d9e400954dcc6ab6e0e5454f0ef6447570eef0549337354'
            'ebf0054a2f8ad4d7e4da438e143d8674c88a31385f409068c3729c5b222e3973'
            'aa885330bc4180b78d915f9dfdfc3210038a0acab7b16735ea9828ab6a633bde'
            'feca54ab09ac0fc9d0626770a6b899a6ac5a12173c7d0c1005bc3964ec83e7b3'
            '068e11a910779d39c5f223018c8f3503734cb3b303471858006cb81ed4886c1b'
            'd6af7a4afcdfce965d9ebcf177ab8189c7006c587c30e940255163db3da4b6c8'
            'e2c2754536243a60fa70541bbd4121715eccd83caa8f1fb1873bd994cd81f871'
            '98a5c41cf9687c52ee380d2b683c95387334c76254479c347bdb733646dab815'
            'a7dbcbfc5ec18606c260df67b98fb2440fe59a4c9ede0823fc43f3bcf439887b'
        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0001-fix-building-without-safebrowsing.patch
        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/product_logo_{16,22,24,32,48,64,128,256}.png)

sha256sums=('83faeb3537428d83728258b28e907caaee6e6572bcd7d9b9a5f6009e7ea758d9'
            '4dc3428f2c927955d9ae117f2fb24d098cc6dd67adb760ac9c82b522ec8b0587'
            'ff3f939a8757f482c1c5ba35c2c0f01ee80e2a2273c16238370081564350b148'
            '2fc21f48b95f9f2c2bd8576742fcf8028a8877c6b6e96c04d88184915982234e'
            '9c081c84a4f85dbef82a9edf34cf0b1e8377c563874fd9c1b4efddf1476748f9'
            '42eb6ada30d5d507f2bda2d2caece37e397e7086bc0d430db776fad143562fb6'
            'f94310a7ba9b8b777adfb4442bcc0a8f0a3d549b2cf4a156066f8e2e28e2f323'
            '46dacc4fa52652b7d99b8996d6a97e5e3bac586f879aefb9fb95020d2c4e5aec'
            'd6fdcb922e5a7fbe15759d39ccc8ea4225821c44d98054ce0f23f9d1f00c9808'
            '44db6f3733332167518e947c72c9661b74c757aeed1b4912f94f3f34aeea067a'
            '7e12969dda184e24eccd6e5bf2b8244ba1336c2dc2dbf0494c153d09923723fd'
            '38583c9e1313e46e7444d990a00e64fb4a07fbb7f3d926737c97b0bfa2e44e33'
            'a6d29b8c041e0a367ad68e817c703e03bed63bff26c47d7d94ae280af45b9457'
            'e297609b4673e3b35c5843a9c3e49ab1b04bc9a02e9e178d5cee58b6ca8cda01'
            '7e8f34e146284aa63d34d50663e52a94f8cbeaaa431ba27bdc948592dd930662'
            '80e6512b928082a0b59465e1dcbab5e6284b545933f42d262194b1a86811a243'
            'd950ffdb1fd573f1e9049293a36025d71a1c08ad772ffe92fe4c7d1761469c4d')

# 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 -gA _system_libs=(
  [ffmpeg]=ffmpeg
  [flac]=flac
  [fontconfig]=fontconfig
  [freetype]=freetype2
  [harfbuzz-ng]=harfbuzz
  [icu]=icu
  [libdrm]=
  [libjpeg]=libjpeg
  #[libpng]=libpng            # https://crbug.com/752403#c10
  #[libvpx]=libvpx            # needs unreleased libvpx
  [libwebp]=libwebp
  [libxml]=libxml2
  [libxslt]=libxslt
  [opus]=opus
  [re2]=re2
  [snappy]=snappy
  [yasm]=
prepare() {
  cd "$srcdir/chromium-$pkgver"

  # 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")
  cd "$srcdir/chromium-$pkgver"

  # Allow building against system libraries in official builds
  sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \
  patch -Np1 -i ../0001-ClientNativePixmapFactoryDmabuf-uses-ioctl-instead-o.patch
  patch -Np1 -i ../0001-Fix-kernel-version-condition-for-including-dma-buf.h.patch

  # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=853347
  patch -Np1 -i ../chromium-blink-gcc7.patch

  patch -Np1 -i ../blink-disable-XML-catalogs-at-runtime.patch

  # https://crbug.com/skia/6663#c10
  patch -Np4 -i ../chromium-skia-harmony.patch

  # Fixes from Gentoo
  patch -Np1 -i ../chromium-ffmpeg-r1.patch
  patch -Np1 -i ../chromium-widevine-r2.patch

  # Remove compiler flags not supported by our system clang
  sed -i \
    -e '/"-Wno-ignored-pragma-optimize"/d' \
    build/config/compiler/BUILD.gn

  # Reformat arflags for compatibility with llvm
  patch -Np1 -i ../chromium-arflags.patch

  msg2 'Applying VA-API patches'
  patch -Np1 -i ../chromium-vaapi-r18.patch

  msg2 'Applying Inox patchset'
  # Apply patches to fix building
  patch -Np1 -i ../0001-fix-building-without-safebrowsing.patch
  patch -Np1 -i ../0002-fix-building-without-reporting.patch

  # Apply Inox patches
  patch -Np1 -i ../0003-disable-autofill-download-manager.patch
  patch -Np1 -i ../0004-disable-google-url-tracker.patch
  patch -Np1 -i ../0005-disable-default-extensions.patch
  patch -Np1 -i ../0006-modify-default-prefs.patch
  patch -Np1 -i ../0007-disable-web-resource-service.patch
  patch -Np1 -i ../0008-restore-classic-ntp.patch
  patch -Np1 -i ../0009-disable-google-ipv6-probes.patch
  patch -Np1 -i ../0010-disable-gcm-status-check.patch
  patch -Np1 -i ../0011-add-duckduckgo-search-engine.patch
  patch -Np1 -i ../0012-branding.patch
  patch -Np1 -i ../0013-disable-missing-key-warning.patch
  patch -Np1 -i ../0014-disable-translation-lang-fetch.patch
  patch -Np1 -i ../0015-disable-update-pings.patch
  patch -Np1 -i ../0016-chromium-sandbox-pie.patch
  patch -Np1 -i ../0017-disable-new-avatar-menu.patch
  patch -Np1 -i ../0018-disable-first-run-behaviour.patch
  patch -Np1 -i ../0019-disable-battery-status-service.patch
  patch -Np1 -i ../0021-disable-rlz.patch
  patch -Np1 -i ../9000-disable-metrics.patch

  # Force script incompatible with Python 3 to use /usr/bin/python2
  sed -i '1s|python$|&2|' third_party/dom_distiller_js/protoc_plugins/*.py

  mkdir -p third_party/node/linux/node-linux-x64/bin
  ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/

  # Remove bundled libraries for which we will use the system copies; this
  # *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 ${_unwanted_bundled_libs[@]}; do
    find "third_party/$_lib" -type f \
      \! -path "third_party/$_lib/chromium/*" \
      \! -path "third_party/$_lib/google/*" \
      \! -path 'third_party/yasm/run_yasm.py' \
      \! -regex '.*\.\(gn\|gni\|isolate\)' \
      -delete
  done

  python2 build/linux/unbundle/replace_gn_files.py \
    --system-libraries "${!_system_libs[@]}"

  msg2 'Applying Chromium launcher patches'
  cd "$srcdir/chromium-launcher-$_launcher_ver"
  patch -Np1 -i ../0020-launcher-branding.patch
}

build() {
  make -C chromium-launcher-$_launcher_ver

  cd "$srcdir/chromium-$pkgver"

  if check_buildoption ccache y; then
    # Avoid falling back to preprocessor mode when sources contain time macros
    export CCACHE_SLOPPINESS=time_macros
  fi

  export CC=clang
  export CXX=clang++
  export AR=llvm-ar
  export NM=llvm-nm

  local _flags=(
    'custom_toolchain="//build/toolchain/linux/unbundle:default"'
    'host_toolchain="//build/toolchain/linux/unbundle:default"'
    'clang_use_chrome_plugins=false'
    'is_official_build=true' # implies is_cfi=true on x86_64
    'is_debug=false'
    'treat_warnings_as_errors=false'
    'fieldtrial_testing_like_official_build=true'
    'remove_webcore_debug_symbols=true'
    'ffmpeg_branding="Chrome"'
    'proprietary_codecs=true'
    'link_pulseaudio=true'
    'use_gnome_keyring=false'
    'use_sysroot=false'
    'linux_use_bundled_binutils=false'
    'use_custom_libcxx=false'
    'use_vaapi=true'
    'enable_hangout_services_extension=false'
    'enable_widevine=true'
    'enable_nacl=false'
    'enable_swiftshader=false'
    'enable_nacl_nonsfi=false'
    'enable_remoting=false'
    'enable_google_now=false'
    'enable_reporting=false'
    'safe_browsing_mode=0'
  )

  # Facilitate deterministic builds (taken from build/config/compiler/BUILD.gn)
  CFLAGS+='   -Wno-builtin-macro-redefined'
  CXXFLAGS+=' -Wno-builtin-macro-redefined'
  CPPFLAGS+=' -D__DATE__=  -D__TIME__=  -D__TIMESTAMP__='

  if check_option strip y; then
    _flags+=('symbol_level=0')

    # Mimic exclude_unwind_tables=true
    CFLAGS+='   -fno-unwind-tables -fno-asynchronous-unwind-tables'
    CXXFLAGS+=' -fno-unwind-tables -fno-asynchronous-unwind-tables'
    CPPFLAGS+=' -DNO_UNWIND_TABLES'
  fi

  msg2 'Building GN'
  python2 tools/gn/bootstrap/bootstrap.py -s --no-clean
  msg2 'Configuring Chromium'
  out/Release/gn gen out/Release --args="${_flags[*]}" \
    --script-executable=/usr/bin/python2

  msg2 'Building Chromium'
  ninja -C out/Release chrome chrome_sandbox chromedriver
}

package() {
  cd chromium-launcher-$_launcher_ver
  make PREFIX=/usr DESTDIR="$pkgdir" install
  install -Dm644 LICENSE \
    "$pkgdir/usr/share/licenses/$pkgname/LICENSE.launcher"

  cd "$srcdir/chromium-$pkgver"

  install -D out/Release/chrome "$pkgdir/usr/lib/$pkgname/$pkgname"
  install -Dm4755 out/Release/chrome_sandbox "$pkgdir/usr/lib/$pkgname/chrome-sandbox"
  install -D out/Release/chromedriver "$pkgdir/usr/lib/$pkgname/inoxdriver"
  ln -s /usr/lib/$pkgname/inoxdriver "$pkgdir/usr/bin/inoxdriver"

  install -Dm644 chrome/installer/linux/common/desktop.template \
    "$pkgdir/usr/share/applications/$pkgname.desktop"
  install -Dm644 chrome/app/resources/manpage.1.in \
    "$pkgdir/usr/share/man/man1/$pkgname.1"
  sed -i \
    -e "s/@@MENUNAME@@/${pkgname^}/g" \
    -e "s/@@PACKAGE@@/$pkgname/g" \
    -e "s/@@USR_BIN_SYMLINK_NAME@@/$pkgname/g" \
    "$pkgdir/usr/share/applications/$pkgname.desktop" \
    "$pkgdir/usr/share/man/man1/$pkgname.1"

  cp \
    out/Release/{chrome_{100,200}_percent,resources}.pak \
    out/Release/*.bin \
    "$pkgdir/usr/lib/$pkgname/"
  install -Dm644 -t "$pkgdir/usr/lib/$pkgname/locales" out/Release/locales/*.pak

  if [[ -z ${_system_libs[icu]+set} ]]; then
    cp out/Release/icudtl.dat "$pkgdir/usr/lib/$pkgname/"
  fi

  for size in 16 22 24 32 48 64 128 256; do
    install -Dm644 "$srcdir/product_logo_$size.png" \
      "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/$pkgname.png"
  done

  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

# vim:set ts=2 sw=2 et:

<MSG> update to 59.0.3071.115

<DFF> @@ -31,9 +31,10 @@ declare -rgA _system_libs=(
 )
 
 pkgname=inox
-pkgver=59.0.3071.109
+pkgver=59.0.3071.115
 pkgrel=1
 _launcher_ver=5
+_freetype_rev=5a3490e054bda8a318ebde482
 pkgdesc="Chromium Spin-off to enhance privacy by disabling data transmission to Google"
 arch=('i686' 'x86_64')
 url="https://www.chromium.org/Home"
@@ -50,10 +51,12 @@ optdepends=('pepper-flash: support for Flash content'
 install=inox.install
 source=(https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$pkgver.tar.xz
         chromium-launcher-$_launcher_ver.tar.gz::https://github.com/foutrelis/chromium-launcher/archive/v$_launcher_ver.tar.gz
+        chromium-freetype2::git+https://chromium.googlesource.com/chromium/src/third_party/freetype2#commit=$_freetype_rev
         https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/inox.desktop
         https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-system-ffmpeg-r6.patch
         https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0001-ClientNativePixmapFactoryDmabuf-uses-ioctl-instead-o.patch
         https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0001-Fix-kernel-version-condition-for-including-dma-buf.h.patch
+        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0001-Clip-FreeType-glyph-bitmap-to-mask.patch
         https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-blink-gcc7.patch
         https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-v8-gcc7.patch
         https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-widevine.patch
@@ -79,12 +82,14 @@ source=(https://commondatastorage.googleapis.com/chromium-browser-official/chrom
         https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0001-fix-building-without-safebrowsing.patch
         https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/product_logo_{16,22,24,32,48,64,128,256}.png)
 
-sha256sums=('83faeb3537428d83728258b28e907caaee6e6572bcd7d9b9a5f6009e7ea758d9'
+sha256sums=('37cbc9955ae3b25cd4e9851a82ea97a0035021cc90658902938ad1c20f263170'
             '4dc3428f2c927955d9ae117f2fb24d098cc6dd67adb760ac9c82b522ec8b0587'
+            'SKIP'
             'ff3f939a8757f482c1c5ba35c2c0f01ee80e2a2273c16238370081564350b148'
             '2fc21f48b95f9f2c2bd8576742fcf8028a8877c6b6e96c04d88184915982234e'
             '9c081c84a4f85dbef82a9edf34cf0b1e8377c563874fd9c1b4efddf1476748f9'
             '42eb6ada30d5d507f2bda2d2caece37e397e7086bc0d430db776fad143562fb6'
+            'e60aa0ff01f8bee67e45fde7bbe932901194984673ec4b10ea82bba1bace0cd7'
             'f94310a7ba9b8b777adfb4442bcc0a8f0a3d549b2cf4a156066f8e2e28e2f323'
             '46dacc4fa52652b7d99b8996d6a97e5e3bac586f879aefb9fb95020d2c4e5aec'
             'd6fdcb922e5a7fbe15759d39ccc8ea4225821c44d98054ce0f23f9d1f00c9808'
@@ -120,6 +125,9 @@ sha256sums=('83faeb3537428d83728258b28e907caaee6e6572bcd7d9b9a5f6009e7ea758d9'
 prepare() {
   cd "$srcdir/chromium-$pkgver"
 
+  # https://groups.google.com/a/chromium.org/d/msg/chromium-packagers/wuInaKJkosg/kMfIV_7wDgAJ
+  mv "$srcdir/chromium-freetype2" third_party/freetype/src
+
   # 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")
@@ -130,6 +138,9 @@ prepare() {
   patch -Np1 -i ../0001-ClientNativePixmapFactoryDmabuf-uses-ioctl-instead-o.patch
   patch -Np1 -i ../0001-Fix-kernel-version-condition-for-including-dma-buf.h.patch
 
+  # https://bugs.chromium.org/p/skia/issues/detail?id=6663
+  patch -Np1 -d third_party/skia <../0001-Clip-FreeType-glyph-bitmap-to-mask.patch
+
   # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=853347
   patch -Np1 -i ../chromium-blink-gcc7.patch
 

{'commit': 'diff --git a/0001-Clip-FreeType-glyph-bitmap-to-mask.patch b/0001-Clip-FreeType-glyph-bitmap-to-mask.patch\nnew file mode 100644\nindex 0000000..5a395b5\n--- /dev/null\n+++ b/0001-Clip-FreeType-glyph-bitmap-to-mask.patch\n@@ -0,0 +1,170 @@\n+From 6cdb5f2ad7684302a8a66217462d2aef4c5f4632 Mon Sep 17 00:00:00 2001\n+From: Ben Wagner <bungeman@behemoth.cnc.corp.google.com>\n+Date: Thu, 15 Jun 2017 10:43:17 -0400\n+Subject: [PATCH] Clip FreeType glyph bitmap to mask.\n+\n+Skia has for some time assumed that when using FT_Render_Glyph with one\n+of the LCD render modes that one extra pixel would be applied to each\n+side of the resulting bitmap. FreieType has changed to make this more\n+conservative when possible, so the pre-allocated SkMask and the generated\n+FT_Bitmap may no longer agree on the size and origin.\n+\n+This change ensures the SkMask and FT_Bitmap are the same size and their\n+origins align. This is not an ideal long term fix, but is both simple and\n+localized for easy and quick back-porting, should that become necessary.\n+\n+BUG=skia:6663\n+\n+Change-Id: I49ec8f45376be8d867e8aef54eab79537731c310\n+Reviewed-on: https://skia-review.googlesource.com/20327\n+Reviewed-by: Herb Derby <herb@google.com>\n+Commit-Queue: Ben Wagner <bungeman@google.com>\n+---\n+ src/ports/SkFontHost_FreeType_common.cpp | 100 +++++++++++++++++++++++++------\n+ 1 file changed, 83 insertions(+), 17 deletions(-)\n+\n+diff --git a/src/ports/SkFontHost_FreeType_common.cpp b/src/ports/SkFontHost_FreeType_common.cpp\n+index 9df7268bb4..a216fdb29c 100644\n+--- a/src/ports/SkFontHost_FreeType_common.cpp\n++++ b/src/ports/SkFontHost_FreeType_common.cpp\n+@@ -395,8 +395,6 @@ void SkScalerContext_FreeType_Base::generateGlyphImage(\n+     switch ( face->glyph->format ) {\n+         case FT_GLYPH_FORMAT_OUTLINE: {\n+             FT_Outline* outline = &face->glyph->outline;\n+-            FT_BBox     bbox;\n+-            FT_Bitmap   target;\n+ \n+             int dx = 0, dy = 0;\n+             if (fRec.fFlags & SkScalerContext::kSubpixelPositioning_Flag) {\n+@@ -405,36 +403,97 @@ void SkScalerContext_FreeType_Base::generateGlyphImage(\n+                 // negate dy since freetype-y-goes-up and skia-y-goes-down\n+                 dy = -dy;\n+             }\n+-            FT_Outline_Get_CBox(outline, &bbox);\n+-            /*\n+-                what we really want to do for subpixel is\n+-                    offset(dx, dy)\n+-                    compute_bounds\n+-                    offset(bbox & !63)\n+-                but that is two calls to offset, so we do the following, which\n+-                achieves the same thing with only one offset call.\n+-            */\n+-            FT_Outline_Translate(outline, dx - ((bbox.xMin + dx) & ~63),\n+-                                          dy - ((bbox.yMin + dy) & ~63));\n++\n++            memset(glyph.fImage, 0, glyph.rowBytes() * glyph.fHeight);\n+ \n+             if (SkMask::kLCD16_Format == glyph.fMaskFormat) {\n++                FT_Outline_Translate(outline, dx, dy);\n+                 FT_Error err = FT_Render_Glyph(face->glyph, doVert ? FT_RENDER_MODE_LCD_V :\n+                                                                      FT_RENDER_MODE_LCD);\n+                 if (err) {\n+                     SK_TRACEFTR(err, "Could not render glyph.");\n+-                    sk_bzero(glyph.fImage, glyph.computeImageSize());\n+                     return;\n+                 }\n++\n+                 SkMask mask;\n+                 glyph.toMask(&mask);\n++#ifdef SK_SHOW_TEXT_BLIT_COVERAGE\n++                memset(mask.fImage, 0x80, mask.fBounds.height() * mask.fRowBytes);\n++#endif\n++                FT_GlyphSlotRec& ftGlyph = *face->glyph;\n++\n++                if (!SkIRect::Intersects(mask.fBounds,\n++                                         SkIRect::MakeXYWH( ftGlyph.bitmap_left,\n++                                                           -ftGlyph.bitmap_top,\n++                                                            ftGlyph.bitmap.width,\n++                                                            ftGlyph.bitmap.rows)))\n++                {\n++                    return;\n++                }\n++\n++                // If the FT_Bitmap extent is larger, discard bits of the bitmap outside the mask.\n++                // If the SkMask extent is larger, shrink mask to fit bitmap (clearing discarded).\n++                unsigned char* origBuffer = ftGlyph.bitmap.buffer;\n++                // First align the top left (origin).\n++                if (-ftGlyph.bitmap_top < mask.fBounds.fTop) {\n++                    int32_t topDiff = mask.fBounds.fTop - (-ftGlyph.bitmap_top);\n++                    ftGlyph.bitmap.buffer += ftGlyph.bitmap.pitch * topDiff;\n++                    ftGlyph.bitmap.rows -= topDiff;\n++                    ftGlyph.bitmap_top = -mask.fBounds.fTop;\n++                }\n++                if (ftGlyph.bitmap_left < mask.fBounds.fLeft) {\n++                    int32_t leftDiff = mask.fBounds.fLeft - ftGlyph.bitmap_left;\n++                    ftGlyph.bitmap.buffer += leftDiff;\n++                    ftGlyph.bitmap.width -= leftDiff;\n++                    ftGlyph.bitmap_left = mask.fBounds.fLeft;\n++                }\n++                if (mask.fBounds.fTop < -ftGlyph.bitmap_top) {\n++                    mask.fImage += mask.fRowBytes * (-ftGlyph.bitmap_top - mask.fBounds.fTop);\n++                    mask.fBounds.fTop = -ftGlyph.bitmap_top;\n++                }\n++                if (mask.fBounds.fLeft < ftGlyph.bitmap_left) {\n++                    mask.fImage += sizeof(uint16_t) * (ftGlyph.bitmap_left - mask.fBounds.fLeft);\n++                    mask.fBounds.fLeft = ftGlyph.bitmap_left;\n++                }\n++                // Origins aligned, clean up the width and height.\n++                int ftVertScale = (doVert ? 3 : 1);\n++                int ftHoriScale = (doVert ? 1 : 3);\n++                if (mask.fBounds.height() * ftVertScale < SkToInt(ftGlyph.bitmap.rows)) {\n++                    ftGlyph.bitmap.rows = mask.fBounds.height() * ftVertScale;\n++                }\n++                if (mask.fBounds.width() * ftHoriScale < SkToInt(ftGlyph.bitmap.width)) {\n++                    ftGlyph.bitmap.width = mask.fBounds.width() * ftHoriScale;\n++                }\n++                if (SkToInt(ftGlyph.bitmap.rows) < mask.fBounds.height() * ftVertScale) {\n++                    mask.fBounds.fBottom = mask.fBounds.fTop + ftGlyph.bitmap.rows / ftVertScale;\n++                }\n++                if (SkToInt(ftGlyph.bitmap.width) < mask.fBounds.width() * ftHoriScale) {\n++                    mask.fBounds.fRight = mask.fBounds.fLeft + ftGlyph.bitmap.width / ftHoriScale;\n++                }\n+                 if (fPreBlend.isApplicable()) {\n+-                    copyFT2LCD16<true>(face->glyph->bitmap, mask, doBGR,\n++                    copyFT2LCD16<true>(ftGlyph.bitmap, mask, doBGR,\n+                                        fPreBlend.fR, fPreBlend.fG, fPreBlend.fB);\n+                 } else {\n+-                    copyFT2LCD16<false>(face->glyph->bitmap, mask, doBGR,\n++                    copyFT2LCD16<false>(ftGlyph.bitmap, mask, doBGR,\n+                                         fPreBlend.fR, fPreBlend.fG, fPreBlend.fB);\n+                 }\n++                // Restore the buffer pointer so FreeType can properly free it.\n++                ftGlyph.bitmap.buffer = origBuffer;\n+             } else {\n++                FT_BBox     bbox;\n++                FT_Bitmap   target;\n++                FT_Outline_Get_CBox(outline, &bbox);\n++                /*\n++                    what we really want to do for subpixel is\n++                        offset(dx, dy)\n++                        compute_bounds\n++                        offset(bbox & !63)\n++                    but that is two calls to offset, so we do the following, which\n++                    achieves the same thing with only one offset call.\n++                */\n++                FT_Outline_Translate(outline, dx - ((bbox.xMin + dx) & ~63),\n++                                              dy - ((bbox.yMin + dy) & ~63));\n++\n+                 target.width = glyph.fWidth;\n+                 target.rows = glyph.fHeight;\n+                 target.pitch = glyph.rowBytes();\n+@@ -442,8 +501,15 @@ void SkScalerContext_FreeType_Base::generateGlyphImage(\n+                 target.pixel_mode = compute_pixel_mode( (SkMask::Format)fRec.fMaskFormat);\n+                 target.num_grays = 256;\n+ \n+-                memset(glyph.fImage, 0, glyph.rowBytes() * glyph.fHeight);\n+                 FT_Outline_Get_Bitmap(face->glyph->library, outline, &target);\n++#ifdef SK_SHOW_TEXT_BLIT_COVERAGE\n++                for (int y = 0; y < glyph.fHeight; ++y) {\n++                    for (int x = 0; x < glyph.fWidth; ++x) {\n++                        uint8_t& a = ((uint8_t*)glyph.fImage)[(glyph.rowBytes() * y) + x];\n++                        a = SkTMax<uint8_t>(a, 0x20);\n++                    }\n++                }\n++#endif\n+             }\n+         } break;\n+ \n+-- \n+2.13.2\n+\ndiff --git a/PKGBUILD b/PKGBUILD\nindex ccc0279..b9915e0 100644\n--- a/PKGBUILD\n+++ b/PKGBUILD\n@@ -31,9 +31,10 @@ declare -rgA _system_libs=(\n )\n \n pkgname=inox\n-pkgver=59.0.3071.109\n+pkgver=59.0.3071.115\n pkgrel=1\n _launcher_ver=5\n+_freetype_rev=5a3490e054bda8a318ebde482\n pkgdesc="Chromium Spin-off to enhance privacy by disabling data transmission to Google"\n arch=(\'i686\' \'x86_64\')\n url="https://www.chromium.org/Home"\n@@ -50,10 +51,12 @@ optdepends=(\'pepper-flash: support for Flash content\'\n install=inox.install\n source=(https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$pkgver.tar.xz\n         chromium-launcher-$_launcher_ver.tar.gz::https://github.com/foutrelis/chromium-launcher/archive/v$_launcher_ver.tar.gz\n+        chromium-freetype2::git+https://chromium.googlesource.com/chromium/src/third_party/freetype2#commit=$_freetype_rev\n         https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/inox.desktop\n         https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-system-ffmpeg-r6.patch\n         https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0001-ClientNativePixmapFactoryDmabuf-uses-ioctl-instead-o.patch\n         https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0001-Fix-kernel-version-condition-for-including-dma-buf.h.patch\n+        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0001-Clip-FreeType-glyph-bitmap-to-mask.patch\n         https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-blink-gcc7.patch\n         https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-v8-gcc7.patch\n         https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-widevine.patch\n@@ -79,12 +82,14 @@ source=(https://commondatastorage.googleapis.com/chromium-browser-official/chrom\n         https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0001-fix-building-without-safebrowsing.patch\n         https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/product_logo_{16,22,24,32,48,64,128,256}.png)\n \n-sha256sums=(\'83faeb3537428d83728258b28e907caaee6e6572bcd7d9b9a5f6009e7ea758d9\'\n+sha256sums=(\'37cbc9955ae3b25cd4e9851a82ea97a0035021cc90658902938ad1c20f263170\'\n             \'4dc3428f2c927955d9ae117f2fb24d098cc6dd67adb760ac9c82b522ec8b0587\'\n+            \'SKIP\'\n             \'ff3f939a8757f482c1c5ba35c2c0f01ee80e2a2273c16238370081564350b148\'\n             \'2fc21f48b95f9f2c2bd8576742fcf8028a8877c6b6e96c04d88184915982234e\'\n             \'9c081c84a4f85dbef82a9edf34cf0b1e8377c563874fd9c1b4efddf1476748f9\'\n             \'42eb6ada30d5d507f2bda2d2caece37e397e7086bc0d430db776fad143562fb6\'\n+            \'e60aa0ff01f8bee67e45fde7bbe932901194984673ec4b10ea82bba1bace0cd7\'\n             \'f94310a7ba9b8b777adfb4442bcc0a8f0a3d549b2cf4a156066f8e2e28e2f323\'\n             \'46dacc4fa52652b7d99b8996d6a97e5e3bac586f879aefb9fb95020d2c4e5aec\'\n             \'d6fdcb922e5a7fbe15759d39ccc8ea4225821c44d98054ce0f23f9d1f00c9808\'\n@@ -120,6 +125,9 @@ sha256sums=(\'83faeb3537428d83728258b28e907caaee6e6572bcd7d9b9a5f6009e7ea758d9\'\n prepare() {\n   cd "$srcdir/chromium-$pkgver"\n \n+  # https://groups.google.com/a/chromium.org/d/msg/chromium-packagers/wuInaKJkosg/kMfIV_7wDgAJ\n+  mv "$srcdir/chromium-freetype2" third_party/freetype/src\n+\n   # Enable support for the Widevine CDM plugin\n   # libwidevinecdm.so is not included, but can be copied over from Chrome\n   # (Version string doesn\'t seem to matter so let\'s go with "Pinkie Pie")\n@@ -130,6 +138,9 @@ prepare() {\n   patch -Np1 -i ../0001-ClientNativePixmapFactoryDmabuf-uses-ioctl-instead-o.patch\n   patch -Np1 -i ../0001-Fix-kernel-version-condition-for-including-dma-buf.h.patch\n \n+  # https://bugs.chromium.org/p/skia/issues/detail?id=6663\n+  patch -Np1 -d third_party/skia <../0001-Clip-FreeType-glyph-bitmap-to-mask.patch\n+\n   # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=853347\n   patch -Np1 -i ../chromium-blink-gcc7.patch\n \n', 'commit_subject': 'update to 59.0.3071.115', 'repo_name': 'gcarq/inox-patchset', 'committer': {'name': 'gcarq', 'email': 'fad1b8902574891cc8bce6b1dc20b2cadd54e24f@tsn.at', 'time_sec': '1498858408', 'tz_offset': '120', 'date': {'seconds': '1498858408'}}, 'commit_tree': '490d24d59453552b0e036fea2c3ac8399d0d166a', 'commit_message': 'update to 59.0.3071.115\n', 'language_name': 'Shell', 'license': 'bsd-2-clause', 'hunks': '@@ -31,9 +31,10 @@ declare -rgA _system_libs=(\n )\n \n pkgname=inox\n-pkgver=59.0.3071.109\n+pkgver=59.0.3071.115\n pkgrel=1\n _launcher_ver=5\n+_freetype_rev=5a3490e054bda8a318ebde482\n pkgdesc="Chromium Spin-off to enhance privacy by disabling data transmission to Google"\n arch=(\'i686\' \'x86_64\')\n url="https://www.chromium.org/Home"\n@@ -50,10 +51,12 @@ optdepends=(\'pepper-flash: support for Flash content\'\n install=inox.install\n source=(https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$pkgver.tar.xz\n         chromium-launcher-$_launcher_ver.tar.gz::https://github.com/foutrelis/chromium-launcher/archive/v$_launcher_ver.tar.gz\n+        chromium-freetype2::git+https://chromium.googlesource.com/chromium/src/third_party/freetype2#commit=$_freetype_rev\n         https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/inox.desktop\n         https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-system-ffmpeg-r6.patch\n         https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0001-ClientNativePixmapFactoryDmabuf-uses-ioctl-instead-o.patch\n         https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0001-Fix-kernel-version-condition-for-including-dma-buf.h.patch\n+        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0001-Clip-FreeType-glyph-bitmap-to-mask.patch\n         https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-blink-gcc7.patch\n         https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-v8-gcc7.patch\n         https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-widevine.patch\n@@ -79,12 +82,14 @@ source=(https://commondatastorage.googleapis.com/chromium-browser-official/chrom\n         https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0001-fix-building-without-safebrowsing.patch\n         https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/product_logo_{16,22,24,32,48,64,128,256}.png)\n \n-sha256sums=(\'83faeb3537428d83728258b28e907caaee6e6572bcd7d9b9a5f6009e7ea758d9\'\n+sha256sums=(\'37cbc9955ae3b25cd4e9851a82ea97a0035021cc90658902938ad1c20f263170\'\n             \'4dc3428f2c927955d9ae117f2fb24d098cc6dd67adb760ac9c82b522ec8b0587\'\n+            \'SKIP\'\n             \'ff3f939a8757f482c1c5ba35c2c0f01ee80e2a2273c16238370081564350b148\'\n             \'2fc21f48b95f9f2c2bd8576742fcf8028a8877c6b6e96c04d88184915982234e\'\n             \'9c081c84a4f85dbef82a9edf34cf0b1e8377c563874fd9c1b4efddf1476748f9\'\n             \'42eb6ada30d5d507f2bda2d2caece37e397e7086bc0d430db776fad143562fb6\'\n+            \'e60aa0ff01f8bee67e45fde7bbe932901194984673ec4b10ea82bba1bace0cd7\'\n             \'f94310a7ba9b8b777adfb4442bcc0a8f0a3d549b2cf4a156066f8e2e28e2f323\'\n             \'46dacc4fa52652b7d99b8996d6a97e5e3bac586f879aefb9fb95020d2c4e5aec\'\n             \'d6fdcb922e5a7fbe15759d39ccc8ea4225821c44d98054ce0f23f9d1f00c9808\'\n@@ -120,6 +125,9 @@ sha256sums=(\'83faeb3537428d83728258b28e907caaee6e6572bcd7d9b9a5f6009e7ea758d9\'\n prepare() {\n   cd "$srcdir/chromium-$pkgver"\n \n+  # https://groups.google.com/a/chromium.org/d/msg/chromium-packagers/wuInaKJkosg/kMfIV_7wDgAJ\n+  mv "$srcdir/chromium-freetype2" third_party/freetype/src\n+\n   # Enable support for the Widevine CDM plugin\n   # libwidevinecdm.so is not included, but can be copied over from Chrome\n   # (Version string doesn\'t seem to matter so let\'s go with "Pinkie Pie")\n@@ -130,6 +138,9 @@ prepare() {\n   patch -Np1 -i ../0001-ClientNativePixmapFactoryDmabuf-uses-ioctl-instead-o.patch\n   patch -Np1 -i ../0001-Fix-kernel-version-condition-for-including-dma-buf.h.patch\n \n+  # https://bugs.chromium.org/p/skia/issues/detail?id=6663\n+  patch -Np1 -d third_party/skia <../0001-Clip-FreeType-glyph-bitmap-to-mask.patch\n+\n   # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=853347\n   patch -Np1 -i ../chromium-blink-gcc7.patch\n \n', 'addition_count': 13, 'deletion_count': 2, 'src_file': 'a/PKGBUILD', 'tgt_file': 'b/PKGBUILD', 'file_extension': '', 'before_file': '# Maintainer: Michael Egger <gcarq@archlinux.info>\n# Contributor: Evangelos Foutras <evangelos@foutrelis.com>\n# Contributor: Pierre Schmitz <pierre@archlinux.de>\n# Contributor: Jan "heftig" Steffens <jan.steffens@gmail.com>\n# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>\n\npkgname=inox\npkgver=67.0.3396.87\npkgrel=1\n_launcher_ver=6\npkgdesc="Chromium Spin-off to enhance privacy by disabling data transmission to Google"\narch=(\'x86_64\')\nurl="https://www.chromium.org/Home"\nlicense=(\'BSD\')\ndepends=(\'gtk3\' \'nss\' \'alsa-lib\' \'xdg-utils\' \'libxss\' \'libcups\' \'libgcrypt\'\n         \'ttf-font\' \'systemd\' \'dbus\' \'libpulse\' \'pciutils\' \'json-glib\'\n         \'desktop-file-utils\' \'hicolor-icon-theme\')\nmakedepends=(\'python\' \'python2\' \'gperf\' \'yasm\' \'mesa\' \'ninja\' \'nodejs\' \'git\'\n             \'clang\' \'lld\' \'llvm\' \'libva\')\noptdepends=(\'pepper-flash: support for Flash content\'\n            \'kdialog: needed for file dialogs in KDE\'\n            \'gnome-keyring: for storing passwords in GNOME keyring\'\n            \'kwallet: for storing passwords in KWallet\'\n            \'libva-intel-driver: for hardware video acceleration with Intel GPUs\'\n            \'libva-mesa-driver: for hardware video acceleration with AMD/ATI GPUs\'\n            \'libva-vdpau-driver: for hardware video acceleration with NVIDIA GPUs\')\ninstall=inox.install\nsource=(https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$pkgver.tar.xz\n        chromium-launcher-$_launcher_ver.tar.gz::https://github.com/foutrelis/chromium-launcher/archive/v$_launcher_ver.tar.gz\n        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/product_logo_{16,22,24,32,48,64,128,256}.png\n)\n\npkgname=inox\npkgver=59.0.3071.109\npkgrel=1\n_launcher_ver=5\npkgdesc="Chromium Spin-off to enhance privacy by disabling data transmission to Google"\narch=(\'i686\' \'x86_64\')\nurl="https://www.chromium.org/Home"\n        # Inox patchset\n        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0001-fix-building-without-safebrowsing.patch\n        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0002-fix-building-without-reporting.patch\n        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0003-disable-autofill-download-manager.patch\n        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0004-disable-google-url-tracker.patch\n        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0005-disable-default-extensions.patch\n        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0006-modify-default-prefs.patch\n        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0007-disable-web-resource-service.patch\n        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0008-restore-classic-ntp.patch\n        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0009-disable-google-ipv6-probes.patch\ninstall=inox.install\nsource=(https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$pkgver.tar.xz\n        chromium-launcher-$_launcher_ver.tar.gz::https://github.com/foutrelis/chromium-launcher/archive/v$_launcher_ver.tar.gz\n        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/inox.desktop\n        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-system-ffmpeg-r6.patch\n        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0001-ClientNativePixmapFactoryDmabuf-uses-ioctl-instead-o.patch\n        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0001-Fix-kernel-version-condition-for-including-dma-buf.h.patch\n        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-blink-gcc7.patch\n        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-v8-gcc7.patch\n        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/chromium-widevine.patch\n        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/9000-disable-metrics.patch)\nsha256sums=(\'5d27a72f0cb8247343034f63fdd9747ff388c05b9fceb541668dd04fb372db1d\'\n            \'04917e3cd4307d8e31bfb0027a5dce6d086edb10ff8a716024fbb8bb0c7dccf1\'\n            \'71471fa4690894420f9e04a2e9a622af620d92ac2714a35f9a4c4e90fa3968dd\'\n            \'4a533acefbbc1567b0d74a1c0903e9179b8c59c1beabe748850795815366e509\'\n            \'7b88830c5e0e9819f514ad68aae885d427541a907e25607e47dee1b0f38975fd\'\n            \'8c10e3b03b13555b461add586422472e0a96d3af49a078d6d952bc0719ba9d94\'\n            \'cc08b771d83b7434c3173c27419bc7d1d4ee375256f3169ef2b9333ba1f2beeb\'\n            \'53a1e8da18069eb4d6ab3af9c923c22a0f020241a4839c3140e3601052ddf6ff\'\n            \'896993987d4ef9f0ac7db454f288117316c2c80ed0b6764019afd760db222dad\'\n            \'3df9b3bbdc07fde63d9e400954dcc6ab6e0e5454f0ef6447570eef0549337354\'\n            \'ebf0054a2f8ad4d7e4da438e143d8674c88a31385f409068c3729c5b222e3973\'\n            \'aa885330bc4180b78d915f9dfdfc3210038a0acab7b16735ea9828ab6a633bde\'\n            \'feca54ab09ac0fc9d0626770a6b899a6ac5a12173c7d0c1005bc3964ec83e7b3\'\n            \'068e11a910779d39c5f223018c8f3503734cb3b303471858006cb81ed4886c1b\'\n            \'d6af7a4afcdfce965d9ebcf177ab8189c7006c587c30e940255163db3da4b6c8\'\n            \'e2c2754536243a60fa70541bbd4121715eccd83caa8f1fb1873bd994cd81f871\'\n            \'98a5c41cf9687c52ee380d2b683c95387334c76254479c347bdb733646dab815\'\n            \'a7dbcbfc5ec18606c260df67b98fb2440fe59a4c9ede0823fc43f3bcf439887b\'\n        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/0001-fix-building-without-safebrowsing.patch\n        https://raw.githubusercontent.com/gcarq/inox-patchset/$pkgver/product_logo_{16,22,24,32,48,64,128,256}.png)\n\nsha256sums=(\'83faeb3537428d83728258b28e907caaee6e6572bcd7d9b9a5f6009e7ea758d9\'\n            \'4dc3428f2c927955d9ae117f2fb24d098cc6dd67adb760ac9c82b522ec8b0587\'\n            \'ff3f939a8757f482c1c5ba35c2c0f01ee80e2a2273c16238370081564350b148\'\n            \'2fc21f48b95f9f2c2bd8576742fcf8028a8877c6b6e96c04d88184915982234e\'\n            \'9c081c84a4f85dbef82a9edf34cf0b1e8377c563874fd9c1b4efddf1476748f9\'\n            \'42eb6ada30d5d507f2bda2d2caece37e397e7086bc0d430db776fad143562fb6\'\n            \'f94310a7ba9b8b777adfb4442bcc0a8f0a3d549b2cf4a156066f8e2e28e2f323\'\n            \'46dacc4fa52652b7d99b8996d6a97e5e3bac586f879aefb9fb95020d2c4e5aec\'\n            \'d6fdcb922e5a7fbe15759d39ccc8ea4225821c44d98054ce0f23f9d1f00c9808\'\n            \'44db6f3733332167518e947c72c9661b74c757aeed1b4912f94f3f34aeea067a\'\n            \'7e12969dda184e24eccd6e5bf2b8244ba1336c2dc2dbf0494c153d09923723fd\'\n            \'38583c9e1313e46e7444d990a00e64fb4a07fbb7f3d926737c97b0bfa2e44e33\'\n            \'a6d29b8c041e0a367ad68e817c703e03bed63bff26c47d7d94ae280af45b9457\'\n            \'e297609b4673e3b35c5843a9c3e49ab1b04bc9a02e9e178d5cee58b6ca8cda01\'\n            \'7e8f34e146284aa63d34d50663e52a94f8cbeaaa431ba27bdc948592dd930662\'\n            \'80e6512b928082a0b59465e1dcbab5e6284b545933f42d262194b1a86811a243\'\n            \'d950ffdb1fd573f1e9049293a36025d71a1c08ad772ffe92fe4c7d1761469c4d\')\n\n# Possible replacements are listed in build/linux/unbundle/replace_gn_files.py\n# Keys are the names in the above script; values are the dependencies in Arch\ndeclare -gA _system_libs=(\n  [ffmpeg]=ffmpeg\n  [flac]=flac\n  [fontconfig]=fontconfig\n  [freetype]=freetype2\n  [harfbuzz-ng]=harfbuzz\n  [icu]=icu\n  [libdrm]=\n  [libjpeg]=libjpeg\n  #[libpng]=libpng            # https://crbug.com/752403#c10\n  #[libvpx]=libvpx            # needs unreleased libvpx\n  [libwebp]=libwebp\n  [libxml]=libxml2\n  [libxslt]=libxslt\n  [opus]=opus\n  [re2]=re2\n  [snappy]=snappy\n  [yasm]=\nprepare() {\n  cd "$srcdir/chromium-$pkgver"\n\n  # Enable support for the Widevine CDM plugin\n  # libwidevinecdm.so is not included, but can be copied over from Chrome\n  # (Version string doesn\'t seem to matter so let\'s go with "Pinkie Pie")\n  cd "$srcdir/chromium-$pkgver"\n\n  # Allow building against system libraries in official builds\n  sed -i \'s/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/\' \\\n  patch -Np1 -i ../0001-ClientNativePixmapFactoryDmabuf-uses-ioctl-instead-o.patch\n  patch -Np1 -i ../0001-Fix-kernel-version-condition-for-including-dma-buf.h.patch\n\n  # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=853347\n  patch -Np1 -i ../chromium-blink-gcc7.patch\n\n  patch -Np1 -i ../blink-disable-XML-catalogs-at-runtime.patch\n\n  # https://crbug.com/skia/6663#c10\n  patch -Np4 -i ../chromium-skia-harmony.patch\n\n  # Fixes from Gentoo\n  patch -Np1 -i ../chromium-ffmpeg-r1.patch\n  patch -Np1 -i ../chromium-widevine-r2.patch\n\n  # Remove compiler flags not supported by our system clang\n  sed -i \\\n    -e \'/"-Wno-ignored-pragma-optimize"/d\' \\\n    build/config/compiler/BUILD.gn\n\n  # Reformat arflags for compatibility with llvm\n  patch -Np1 -i ../chromium-arflags.patch\n\n  msg2 \'Applying VA-API patches\'\n  patch -Np1 -i ../chromium-vaapi-r18.patch\n\n  msg2 \'Applying Inox patchset\'\n  # Apply patches to fix building\n  patch -Np1 -i ../0001-fix-building-without-safebrowsing.patch\n  patch -Np1 -i ../0002-fix-building-without-reporting.patch\n\n  # Apply Inox patches\n  patch -Np1 -i ../0003-disable-autofill-download-manager.patch\n  patch -Np1 -i ../0004-disable-google-url-tracker.patch\n  patch -Np1 -i ../0005-disable-default-extensions.patch\n  patch -Np1 -i ../0006-modify-default-prefs.patch\n  patch -Np1 -i ../0007-disable-web-resource-service.patch\n  patch -Np1 -i ../0008-restore-classic-ntp.patch\n  patch -Np1 -i ../0009-disable-google-ipv6-probes.patch\n  patch -Np1 -i ../0010-disable-gcm-status-check.patch\n  patch -Np1 -i ../0011-add-duckduckgo-search-engine.patch\n  patch -Np1 -i ../0012-branding.patch\n  patch -Np1 -i ../0013-disable-missing-key-warning.patch\n  patch -Np1 -i ../0014-disable-translation-lang-fetch.patch\n  patch -Np1 -i ../0015-disable-update-pings.patch\n  patch -Np1 -i ../0016-chromium-sandbox-pie.patch\n  patch -Np1 -i ../0017-disable-new-avatar-menu.patch\n  patch -Np1 -i ../0018-disable-first-run-behaviour.patch\n  patch -Np1 -i ../0019-disable-battery-status-service.patch\n  patch -Np1 -i ../0021-disable-rlz.patch\n  patch -Np1 -i ../9000-disable-metrics.patch\n\n  # Force script incompatible with Python 3 to use /usr/bin/python2\n  sed -i \'1s|python$|&2|\' third_party/dom_distiller_js/protoc_plugins/*.py\n\n  mkdir -p third_party/node/linux/node-linux-x64/bin\n  ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/\n\n  # Remove bundled libraries for which we will use the system copies; this\n  # *should* do what the remove_bundled_libraries.py script does, with the\n  # added benefit of not having to list all the remaining libraries\n  local _lib\n  for _lib in ${_unwanted_bundled_libs[@]}; do\n    find "third_party/$_lib" -type f \\\n      \\! -path "third_party/$_lib/chromium/*" \\\n      \\! -path "third_party/$_lib/google/*" \\\n      \\! -path \'third_party/yasm/run_yasm.py\' \\\n      \\! -regex \'.*\\.\\(gn\\|gni\\|isolate\\)\' \\\n      -delete\n  done\n\n  python2 build/linux/unbundle/replace_gn_files.py \\\n    --system-libraries "${!_system_libs[@]}"\n\n  msg2 \'Applying Chromium launcher patches\'\n  cd "$srcdir/chromium-launcher-$_launcher_ver"\n  patch -Np1 -i ../0020-launcher-branding.patch\n}\n\nbuild() {\n  make -C chromium-launcher-$_launcher_ver\n\n  cd "$srcdir/chromium-$pkgver"\n\n  if check_buildoption ccache y; then\n    # Avoid falling back to preprocessor mode when sources contain time macros\n    export CCACHE_SLOPPINESS=time_macros\n  fi\n\n  export CC=clang\n  export CXX=clang++\n  export AR=llvm-ar\n  export NM=llvm-nm\n\n  local _flags=(\n    \'custom_toolchain="//build/toolchain/linux/unbundle:default"\'\n    \'host_toolchain="//build/toolchain/linux/unbundle:default"\'\n    \'clang_use_chrome_plugins=false\'\n    \'is_official_build=true\' # implies is_cfi=true on x86_64\n    \'is_debug=false\'\n    \'treat_warnings_as_errors=false\'\n    \'fieldtrial_testing_like_official_build=true\'\n    \'remove_webcore_debug_symbols=true\'\n    \'ffmpeg_branding="Chrome"\'\n    \'proprietary_codecs=true\'\n    \'link_pulseaudio=true\'\n    \'use_gnome_keyring=false\'\n    \'use_sysroot=false\'\n    \'linux_use_bundled_binutils=false\'\n    \'use_custom_libcxx=false\'\n    \'use_vaapi=true\'\n    \'enable_hangout_services_extension=false\'\n    \'enable_widevine=true\'\n    \'enable_nacl=false\'\n    \'enable_swiftshader=false\'\n    \'enable_nacl_nonsfi=false\'\n    \'enable_remoting=false\'\n    \'enable_google_now=false\'\n    \'enable_reporting=false\'\n    \'safe_browsing_mode=0\'\n  )\n\n  # Facilitate deterministic builds (taken from build/config/compiler/BUILD.gn)\n  CFLAGS+=\'   -Wno-builtin-macro-redefined\'\n  CXXFLAGS+=\' -Wno-builtin-macro-redefined\'\n  CPPFLAGS+=\' -D__DATE__=  -D__TIME__=  -D__TIMESTAMP__=\'\n\n  if check_option strip y; then\n    _flags+=(\'symbol_level=0\')\n\n    # Mimic exclude_unwind_tables=true\n    CFLAGS+=\'   -fno-unwind-tables -fno-asynchronous-unwind-tables\'\n    CXXFLAGS+=\' -fno-unwind-tables -fno-asynchronous-unwind-tables\'\n    CPPFLAGS+=\' -DNO_UNWIND_TABLES\'\n  fi\n\n  msg2 \'Building GN\'\n  python2 tools/gn/bootstrap/bootstrap.py -s --no-clean\n  msg2 \'Configuring Chromium\'\n  out/Release/gn gen out/Release --args="${_flags[*]}" \\\n    --script-executable=/usr/bin/python2\n\n  msg2 \'Building Chromium\'\n  ninja -C out/Release chrome chrome_sandbox chromedriver\n}\n\npackage() {\n  cd chromium-launcher-$_launcher_ver\n  make PREFIX=/usr DESTDIR="$pkgdir" install\n  install -Dm644 LICENSE \\\n    "$pkgdir/usr/share/licenses/$pkgname/LICENSE.launcher"\n\n  cd "$srcdir/chromium-$pkgver"\n\n  install -D out/Release/chrome "$pkgdir/usr/lib/$pkgname/$pkgname"\n  install -Dm4755 out/Release/chrome_sandbox "$pkgdir/usr/lib/$pkgname/chrome-sandbox"\n  install -D out/Release/chromedriver "$pkgdir/usr/lib/$pkgname/inoxdriver"\n  ln -s /usr/lib/$pkgname/inoxdriver "$pkgdir/usr/bin/inoxdriver"\n\n  install -Dm644 chrome/installer/linux/common/desktop.template \\\n    "$pkgdir/usr/share/applications/$pkgname.desktop"\n  install -Dm644 chrome/app/resources/manpage.1.in \\\n    "$pkgdir/usr/share/man/man1/$pkgname.1"\n  sed -i \\\n    -e "s/@@MENUNAME@@/${pkgname^}/g" \\\n    -e "s/@@PACKAGE@@/$pkgname/g" \\\n    -e "s/@@USR_BIN_SYMLINK_NAME@@/$pkgname/g" \\\n    "$pkgdir/usr/share/applications/$pkgname.desktop" \\\n    "$pkgdir/usr/share/man/man1/$pkgname.1"\n\n  cp \\\n    out/Release/{chrome_{100,200}_percent,resources}.pak \\\n    out/Release/*.bin \\\n    "$pkgdir/usr/lib/$pkgname/"\n  install -Dm644 -t "$pkgdir/usr/lib/$pkgname/locales" out/Release/locales/*.pak\n\n  if [[ -z ${_system_libs[icu]+set} ]]; then\n    cp out/Release/icudtl.dat "$pkgdir/usr/lib/$pkgname/"\n  fi\n\n  for size in 16 22 24 32 48 64 128 256; do\n    install -Dm644 "$srcdir/product_logo_$size.png" \\\n      "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/$pkgname.png"\n  done\n\n  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"\n}\n\n# vim:set ts=2 sw=2 et:\n', 'message': 'update to 59.0.3071.115\n', 'author_name': 'gcarq', 'lang': 'PKGBUILD'}