summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO111
-rw-r--r--PKGBUILD277
-rw-r--r--breakpad-glibc2.26.patch208
-rw-r--r--breakpad-glibc2.30.patch49
-rw-r--r--chromium-SIOCGSTAMP.patch13
-rw-r--r--chromium-atk-r1.patch11
-rw-r--r--chromium-gn-bootstrap-r14.patch27
-rw-r--r--chromium-include-functional.patch10
-rw-r--r--chromium-use-system-ffmpeg.patch81
-rw-r--r--chromium-use-system-minizip.patch14
-rw-r--r--chromium-use-system-re2.patch10
-rw-r--r--default_app-icon.patch22
-rw-r--r--dont-bootstrap-libchromiumcontent.patch13
-rw-r--r--dont-update-submodules.patch11
-rw-r--r--dont-use-sysroot.patch27
-rw-r--r--electron2.desktop7
-rw-r--r--gyp-no-rpath.patch12
-rw-r--r--libchromiumcontent-fix-v8-patches.patch536
-rw-r--r--libchromiumcontent-settings.patch43
-rw-r--r--libchromiumcontent-sort-filenames.patch32
-rw-r--r--libchromiumcontent-static-library-only.patch43
-rw-r--r--libchromiumcontent-use-system-tools.patch57
-rw-r--r--no-whole-archive.patch22
-rw-r--r--use-system-ffmpeg.patch21
-rw-r--r--use-system-libraries-in-node.patch31
25 files changed, 1688 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..be2b0bf0d485
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,111 @@
+pkgbase = electron2
+ pkgdesc = Build cross platform desktop apps with web technologies
+ pkgver = 2.0.18
+ pkgrel = 4
+ url = https://electronjs.org/
+ arch = x86_64
+ license = MIT
+ license = custom
+ makedepends = clang
+ makedepends = git
+ makedepends = gperf
+ makedepends = harfbuzz-icu
+ makedepends = jsoncpp
+ makedepends = libnotify
+ makedepends = lld
+ makedepends = llvm
+ makedepends = ninja
+ makedepends = npm
+ makedepends = pciutils
+ makedepends = python2
+ makedepends = wget
+ makedepends = yasm
+ depends = c-ares
+ depends = ffmpeg
+ depends = gtk3
+ depends = http-parser
+ depends = libevent
+ depends = libxslt
+ depends = libxss
+ depends = minizip
+ depends = nss
+ depends = re2
+ depends = snappy
+ optdepends = gvfs: file deletion support (gvfs-trash)
+ optdepends = kde-cli-tools: file deletion support (kioclient5)
+ optdepends = trash-cli: file deletion support (trash-put)
+ optdepends = xdg-utils: open URLs with desktop's default (xdg-email, xdg-open)
+ noextract = chromium-61.0.3163.100.tar.xz
+ source = git+https://github.com/electron/electron.git#tag=v2.0.18
+ source = git+https://github.com/boto/boto.git
+ source = breakpad::git+https://github.com/electron/chromium-breakpad.git
+ source = git+https://chromium.googlesource.com/chromium/src/tools/grit.git
+ source = electron-gyp::git+https://github.com/electron/gyp.git
+ source = git+https://github.com/electron/libchromiumcontent.git
+ source = native_mate::git+https://github.com/electron/native-mate.git
+ source = git+https://github.com/electron/node.git
+ source = pdf_viewer::git+https://github.com/electron/pdf-viewer.git
+ source = git+https://github.com/kennethreitz/requests.git
+ source = google-breakpad::git+https://chromium.googlesource.com/breakpad/breakpad/src
+ source = https://commondatastorage.googleapis.com/chromium-browser-official/chromium-61.0.3163.100.tar.xz
+ source = electron2.desktop
+ source = default_app-icon.patch
+ source = dont-bootstrap-libchromiumcontent.patch
+ source = dont-update-submodules.patch
+ source = dont-use-sysroot.patch
+ source = no-whole-archive.patch
+ source = use-system-libraries-in-node.patch
+ source = use-system-ffmpeg.patch
+ source = breakpad-glibc2.26.patch
+ source = breakpad-glibc2.30.patch
+ source = gyp-no-rpath.patch
+ source = libchromiumcontent-fix-v8-patches.patch
+ source = libchromiumcontent-settings.patch
+ source = libchromiumcontent-sort-filenames.patch
+ source = libchromiumcontent-static-library-only.patch
+ source = libchromiumcontent-use-system-tools.patch
+ source = chromium-atk-r1.patch
+ source = chromium-gn-bootstrap-r14.patch
+ source = chromium-include-functional.patch
+ source = chromium-use-system-ffmpeg.patch
+ source = chromium-use-system-minizip.patch
+ source = chromium-use-system-re2.patch
+ source = chromium-SIOCGSTAMP.patch
+ sha512sums = SKIP
+ sha512sums = SKIP
+ sha512sums = SKIP
+ sha512sums = SKIP
+ sha512sums = SKIP
+ sha512sums = SKIP
+ sha512sums = SKIP
+ sha512sums = SKIP
+ sha512sums = SKIP
+ sha512sums = SKIP
+ sha512sums = SKIP
+ sha512sums = 4dfd3a493ceb7c605eeab6f387541273d529e8b935a6104927e34836469aedcfcbb4a1154591585621d5c2e842e68701d32328acba842f840a20498822165f78
+ sha512sums = 59d8f3cef8f38d2d212c509ced0dbd5a09a6821e8167761ebf826fe8866f2f228ac83bca76b022fd48cb853bde43eabced4065247ae444b8128fab4bd3e7c4ff
+ sha512sums = 6189c850c8dc07c4e517d5b1e3b4771703e1b3d267ef7edc0cf57aa154f4d865a87255a4d28a554db9e8068113ccf851664cb7be04c8d07684e50bacb1021725
+ sha512sums = b002bb96d38875876d09ad5ceb76843b306031c470ba24aace6cbc5b8a22774f44b5c0e4a99bf807737e25f57254d14865934694114a9f4551453cc6c560063a
+ sha512sums = 22d2d3605a49a72cf7e12e4f1cdadb6e327a7487eed47eeb04a4213cf6dcc73c47d93cdea85a767a11181debc37e952f5e4685f9fae1debd4a1a1a10ac188e8c
+ sha512sums = 1bda751a86a1c07f87e6631469701ebab5b1ce8f4052fcf666e8fc3bc645199a4df47fe7e75aed092ff23e17c2b9c4f286a60c2428fd72d0e6cae7a5d0507de4
+ sha512sums = e5a21eea33f24e82b250ad903ae9f6f40a71876661391b7bb2b749edb3470e1256ecb06aba0541f4da4cbaf9be2df90eb2b9e588566138fdb63d92a9aca60936
+ sha512sums = baf921c2970e09cbc98781bdad9625c6926eaeb197cca5588cb3444db4422d18949a611f8d66452c4acff1c5f2cb0ba67cac3f85214a97c91c232778e1e9dce2
+ sha512sums = 89966d7b6eba2a588898cb69a2397ff87ad8936dc1e99e82668b312b6423794e3d6c41ee9defa8773e8fa947c6e873bc23928c719d908687eb28f78df54d6a2a
+ sha512sums = 2dd594a07f8ce62a7706a0365d764ab3ee3cc2d050d6ae4460db3152269e84f43516438a4f48f47fc54fe758a70c462baed6b7defa8b2bd277e67cb1bae8da12
+ sha512sums = 8d9a06f10ecc3a4a54fce8d4ca4d9fce338705c3f43bf4e393377e0cb21710711f8fd0a1e211b01942776fc7117e9d8ecf51609b61d77f42579513dca2c84454
+ sha512sums = d77a2045f03c1327eb78517028c083e8965297a41d5a81df8c7dac5a8500aa242faa644a38be5d12914b68ba3a0b944c1bfe6dbfd7b88b1a0aeeec1d87a1619a
+ sha512sums = 79baa5d144733442cd839d7ee195b11b4e8ee19cd77e37c8ca1def18e2ffa30b8e63b8e4e2688944d55cbea048107f0cf209547ea14c49b4585c936249016c43
+ sha512sums = f7b354b1672760c85b278a900e8398c54c31663148091a59ca63bfcb9739a0071991111c6ce790fcfc072aff30fe8c52309c55cc39ede1f44ba503d712e4fc3d
+ sha512sums = 8da75b16f3fc39e828b94fe9bf013a2fd180a81a9a34a8511a99e62e8d2a714ced24d94ef643561e0c88c27868d8eaa643e19003cbfa293451fc15dd75f5801f
+ sha512sums = efeb0358488a7402d380a4cab736efd4c626171659f1fd627b48b3f44a873d6ef149f8b00a03f6eae4a775d3fe77887e7e8b9ff2753f60d16a94e4f342687384
+ sha512sums = 45c9bcc588d8fc5dd5c5fde17ef5114f0c9717c965a7c3009bfa6e79ba6a3fc9a19eab3451b72e5de75535d62391a3e2660f0aab329d7ec137605593915f4010
+ sha512sums = 5722c571ffc384e0e226342d170e29109bf45761dcd7202b2fe6572795e0a04bd0521b1120eb2247c2a84bed0e63f47a71d25802528992ee4f976b348fb5c8f6
+ sha512sums = d297728681538fd6d6d48da4477e6e42b0ac1585a243dca60c0d9896387a1bf17770aa70966344c8d3551b774cbea6d6acbeaa0dbbfc3c17367dda5daa912297
+ sha512sums = 2906e565804cb42ef3370521683d01e4cb083f0c7d5b02692101afb56616838b3dda8d05d43d0942ea3b7b7528985a1470719574356d37416427b56409c52a7f
+ sha512sums = d549c33d3499737f7d4dd2f87b8f08e90687d107248d9729676b7a0ea8562df3dd0430aa6776e4cb6ca793c2d93a726ce7b8da22703eef3f91aeb42b7e852240
+ sha512sums = eace29bd99f7167ac2e5b7499560ec7e6c205eeee8fd0adef8cc7de3cef5058f9852dd2cc20946d637ed479d25b270c35d52de6f104f41000faa36dc018f63aa
+ sha512sums = 5552e8918462f6c3a4e1baef3c22b57d70c732766945ea0b39f63df7d7b8fca9646f1f9b28b0528fa586799842c949298fc97e1041875da0ca1aacff046f6c9b
+ sha512sums = 764f9d564863098b20fb59c3eac2cf37a5ec725e4113ef7c1b81f91242c1c3ea994afead7fc9b70dbcdaff3d108068167e7b4dc4515de25dc5c18005da8ec55e
+
+pkgname = electron2
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..efe588add87a
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,277 @@
+# Maintainer: Bruno Pagani <archange@archlinux.org>
+# Contributor: Nicola Squartini <tensor5@gmail.com>
+
+_chromiumver=61.0.3163.100
+pkgname=electron2
+pkgver=2.0.18
+pkgrel=4
+pkgdesc='Build cross platform desktop apps with web technologies'
+arch=('x86_64')
+url='https://electronjs.org/'
+license=('MIT' 'custom')
+depends=('c-ares' 'ffmpeg' 'gtk3' 'http-parser' 'libevent' 'libxslt'
+ 'libxss' 'minizip' 'nss' 're2' 'snappy')
+makedepends=('clang' 'git' 'gperf' 'harfbuzz-icu' 'jsoncpp' 'libnotify' 'lld'
+ 'llvm' 'ninja' 'npm' 'pciutils' 'python2' 'wget' 'yasm')
+optdepends=('gvfs: file deletion support (gvfs-trash)'
+ 'kde-cli-tools: file deletion support (kioclient5)'
+ 'trash-cli: file deletion support (trash-put)'
+ "xdg-utils: open URLs with desktop's default (xdg-email, xdg-open)")
+source=("git+https://github.com/electron/electron.git#tag=v${pkgver}"
+ 'git+https://github.com/boto/boto.git'
+ 'breakpad::git+https://github.com/electron/chromium-breakpad.git'
+ 'git+https://chromium.googlesource.com/chromium/src/tools/grit.git'
+ 'electron-gyp::git+https://github.com/electron/gyp.git'
+ "git+https://github.com/electron/libchromiumcontent.git"
+ 'native_mate::git+https://github.com/electron/native-mate.git'
+ 'git+https://github.com/electron/node.git'
+ 'pdf_viewer::git+https://github.com/electron/pdf-viewer.git'
+ 'git+https://github.com/kennethreitz/requests.git'
+ 'google-breakpad::git+https://chromium.googlesource.com/breakpad/breakpad/src'
+ "https://commondatastorage.googleapis.com/chromium-browser-official/chromium-${_chromiumver}.tar.xz"
+ 'electron2.desktop'
+ 'default_app-icon.patch'
+ 'dont-bootstrap-libchromiumcontent.patch'
+ 'dont-update-submodules.patch'
+ 'dont-use-sysroot.patch'
+ 'no-whole-archive.patch'
+ 'use-system-libraries-in-node.patch'
+ 'use-system-ffmpeg.patch'
+ 'breakpad-glibc2.26.patch'
+ 'breakpad-glibc2.30.patch'
+ 'gyp-no-rpath.patch'
+ 'libchromiumcontent-fix-v8-patches.patch'
+ 'libchromiumcontent-settings.patch'
+ 'libchromiumcontent-sort-filenames.patch'
+ 'libchromiumcontent-static-library-only.patch'
+ 'libchromiumcontent-use-system-tools.patch'
+ 'chromium-atk-r1.patch'
+ 'chromium-gn-bootstrap-r14.patch'
+ 'chromium-include-functional.patch'
+ 'chromium-use-system-ffmpeg.patch'
+ 'chromium-use-system-minizip.patch'
+ 'chromium-use-system-re2.patch'
+ 'chromium-SIOCGSTAMP.patch'
+ )
+noextract=("chromium-${_chromiumver}.tar.xz")
+sha512sums=('SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ '4dfd3a493ceb7c605eeab6f387541273d529e8b935a6104927e34836469aedcfcbb4a1154591585621d5c2e842e68701d32328acba842f840a20498822165f78'
+ '59d8f3cef8f38d2d212c509ced0dbd5a09a6821e8167761ebf826fe8866f2f228ac83bca76b022fd48cb853bde43eabced4065247ae444b8128fab4bd3e7c4ff'
+ '6189c850c8dc07c4e517d5b1e3b4771703e1b3d267ef7edc0cf57aa154f4d865a87255a4d28a554db9e8068113ccf851664cb7be04c8d07684e50bacb1021725'
+ 'b002bb96d38875876d09ad5ceb76843b306031c470ba24aace6cbc5b8a22774f44b5c0e4a99bf807737e25f57254d14865934694114a9f4551453cc6c560063a'
+ '22d2d3605a49a72cf7e12e4f1cdadb6e327a7487eed47eeb04a4213cf6dcc73c47d93cdea85a767a11181debc37e952f5e4685f9fae1debd4a1a1a10ac188e8c'
+ '1bda751a86a1c07f87e6631469701ebab5b1ce8f4052fcf666e8fc3bc645199a4df47fe7e75aed092ff23e17c2b9c4f286a60c2428fd72d0e6cae7a5d0507de4'
+ 'e5a21eea33f24e82b250ad903ae9f6f40a71876661391b7bb2b749edb3470e1256ecb06aba0541f4da4cbaf9be2df90eb2b9e588566138fdb63d92a9aca60936'
+ 'baf921c2970e09cbc98781bdad9625c6926eaeb197cca5588cb3444db4422d18949a611f8d66452c4acff1c5f2cb0ba67cac3f85214a97c91c232778e1e9dce2'
+ '89966d7b6eba2a588898cb69a2397ff87ad8936dc1e99e82668b312b6423794e3d6c41ee9defa8773e8fa947c6e873bc23928c719d908687eb28f78df54d6a2a'
+ '2dd594a07f8ce62a7706a0365d764ab3ee3cc2d050d6ae4460db3152269e84f43516438a4f48f47fc54fe758a70c462baed6b7defa8b2bd277e67cb1bae8da12'
+ '8d9a06f10ecc3a4a54fce8d4ca4d9fce338705c3f43bf4e393377e0cb21710711f8fd0a1e211b01942776fc7117e9d8ecf51609b61d77f42579513dca2c84454'
+ 'd77a2045f03c1327eb78517028c083e8965297a41d5a81df8c7dac5a8500aa242faa644a38be5d12914b68ba3a0b944c1bfe6dbfd7b88b1a0aeeec1d87a1619a'
+ '79baa5d144733442cd839d7ee195b11b4e8ee19cd77e37c8ca1def18e2ffa30b8e63b8e4e2688944d55cbea048107f0cf209547ea14c49b4585c936249016c43'
+ 'f7b354b1672760c85b278a900e8398c54c31663148091a59ca63bfcb9739a0071991111c6ce790fcfc072aff30fe8c52309c55cc39ede1f44ba503d712e4fc3d'
+ '8da75b16f3fc39e828b94fe9bf013a2fd180a81a9a34a8511a99e62e8d2a714ced24d94ef643561e0c88c27868d8eaa643e19003cbfa293451fc15dd75f5801f'
+ 'efeb0358488a7402d380a4cab736efd4c626171659f1fd627b48b3f44a873d6ef149f8b00a03f6eae4a775d3fe77887e7e8b9ff2753f60d16a94e4f342687384'
+ '45c9bcc588d8fc5dd5c5fde17ef5114f0c9717c965a7c3009bfa6e79ba6a3fc9a19eab3451b72e5de75535d62391a3e2660f0aab329d7ec137605593915f4010'
+ '5722c571ffc384e0e226342d170e29109bf45761dcd7202b2fe6572795e0a04bd0521b1120eb2247c2a84bed0e63f47a71d25802528992ee4f976b348fb5c8f6'
+ 'd297728681538fd6d6d48da4477e6e42b0ac1585a243dca60c0d9896387a1bf17770aa70966344c8d3551b774cbea6d6acbeaa0dbbfc3c17367dda5daa912297'
+ '2906e565804cb42ef3370521683d01e4cb083f0c7d5b02692101afb56616838b3dda8d05d43d0942ea3b7b7528985a1470719574356d37416427b56409c52a7f'
+ 'd549c33d3499737f7d4dd2f87b8f08e90687d107248d9729676b7a0ea8562df3dd0430aa6776e4cb6ca793c2d93a726ce7b8da22703eef3f91aeb42b7e852240'
+ 'eace29bd99f7167ac2e5b7499560ec7e6c205eeee8fd0adef8cc7de3cef5058f9852dd2cc20946d637ed479d25b270c35d52de6f104f41000faa36dc018f63aa'
+ '5552e8918462f6c3a4e1baef3c22b57d70c732766945ea0b39f63df7d7b8fca9646f1f9b28b0528fa586799842c949298fc97e1041875da0ca1aacff046f6c9b'
+ '764f9d564863098b20fb59c3eac2cf37a5ec725e4113ef7c1b81f91242c1c3ea994afead7fc9b70dbcdaff3d108068167e7b4dc4515de25dc5c18005da8ec55e')
+
+_system_libs=('ffmpeg'
+ 'flac'
+ 'harfbuzz-ng'
+# 'icu'
+ 'libevent'
+ 'libjpeg'
+# 'libpng'
+# 'libvpx' # Not compatible with libvpx 1.8.0
+ 'libwebp'
+ 'libxml'
+ 'libxslt'
+ 're2'
+ 'snappy'
+ 'yasm'
+ 'zlib'
+ )
+
+prepare() {
+ ln -s electron-gyp gyp
+
+ cd "${srcdir}"/electron
+
+ patch -Np1 -i "${srcdir}"/default_app-icon.patch # Icon from .desktop file
+ patch -Np1 -i "${srcdir}"/use-system-libraries-in-node.patch
+ patch -Np1 -i "${srcdir}"/use-system-ffmpeg.patch
+ patch -Np1 -i "${srcdir}"/dont-update-submodules.patch
+ patch -Np1 -i "${srcdir}"/dont-use-sysroot.patch
+ patch -Np1 -i "${srcdir}"/dont-bootstrap-libchromiumcontent.patch
+ patch -Np1 -i "${srcdir}"/no-whole-archive.patch
+
+ # Add extra libraries for unbundling, remove unneeded libraries
+ sed -e "s/'-lexpat',/'-lexpat', '<\!@(pkg-config --libs-only-l libavcodec libavformat libavutil libevent flac harfbuzz-icu jsoncpp minizip libpulse vpx libwebpdemux libwebpmux libxml-2.0 libxslt zlib)', '-ljpeg', '-lre2', '-lsnappy', '-latomic',/" \
+ -e 's/ gconf-2.0//' \
+ -i brightray/brightray.gyp
+
+ mkdir -p "${srcdir}"/python2-path
+ ln -sf /usr/bin/python2 "${srcdir}/python2-path/python"
+
+ for m in boto breakpad gyp libchromiumcontent native_mate node pdf_viewer requests; do
+ git submodule init vendor/${m}
+ git config submodule.vendor/${m}.url "${srcdir}/${m}"
+ done
+ git submodule update
+
+ cd "${srcdir}"/electron/vendor/pdf_viewer
+ git submodule init vendor/grit
+ git config submodule.vendor/grit.url "${srcdir}/grit"
+ git submodule update
+
+ cd "${srcdir}"/electron/vendor/breakpad
+ git submodule init src
+ git config submodule.src.url "${srcdir}"/google-breakpad
+ git submodule update
+ patch -Np1 -i "${srcdir}"/breakpad-glibc2.26.patch
+ patch -Np1 -i "${srcdir}"/breakpad-glibc2.30.patch
+
+ cd "${srcdir}"/electron/vendor/gyp
+ # Remove a useless $ORIGIN/lib/ rpath from the electron binary
+ patch -Np1 -i "${srcdir}"/gyp-no-rpath.patch
+
+ cd "${srcdir}"/electron/vendor/libchromiumcontent
+ patch -Np1 -i "${srcdir}"/libchromiumcontent-fix-v8-patches.patch
+ patch -Np1 -i "${srcdir}"/libchromiumcontent-settings.patch
+ patch -Np1 -i "${srcdir}"/libchromiumcontent-sort-filenames.patch # deterministic build
+ patch -Np1 -i "${srcdir}"/libchromiumcontent-use-system-tools.patch
+ patch -Np1 -i "${srcdir}"/libchromiumcontent-static-library-only.patch
+ rm patches/third_party/ffmpeg/001-build_gn.patch # Use system ffmpeg
+ echo 'Extracting chromium source...'
+ tar -xJf "${srcdir}"/chromium-${_chromiumver}.tar.xz
+ mv chromium-${_chromiumver} src
+ cd src
+ patch -Np1 -i "${srcdir}"/chromium-atk-r1.patch
+ patch -Np1 -i "${srcdir}"/chromium-gn-bootstrap-r14.patch
+ patch -Np1 -i "${srcdir}"/chromium-include-functional.patch
+ patch -Np1 -i "${srcdir}"/chromium-use-system-ffmpeg.patch
+ patch -Np1 -i "${srcdir}"/chromium-use-system-minizip.patch
+ patch -Np1 -i "${srcdir}"/chromium-use-system-re2.patch
+ patch -Np1 -i "${srcdir}"/chromium-SIOCGSTAMP.patch
+
+ for lib in "${_system_libs[@]}" libjpeg_turbo; do
+ find -type f -path "*third_party/${lib}/*" \
+ \! -path "*third_party/${lib}/chromium/*" \
+ \! -path "*third_party/${lib}/google/*" \
+ \! -path "*base/third_party/icu/*" \
+ \! -path "*base/third_party/libevent/*" \
+ \! -regex '.*\.\(gn\|gni\|isolate\|py\)' \
+ -delete
+ done
+ python2 build/linux/unbundle/replace_gn_files.py --system-libraries "${_system_libs[@]}"
+
+ # Create sysmlink to system Node.js
+ mkdir -p third_party/node/linux/node-linux-x64/bin
+ ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin
+}
+
+build() {
+ export PATH="${srcdir}/python2-path:${PATH}"
+
+ # Build GN
+ cd "${srcdir}/electron/vendor/libchromiumcontent/src"
+ gn_flags=(
+ 'clang_base_path="/usr"'
+ 'clang_use_chrome_plugins=false'
+ 'treat_warnings_as_errors=false'
+ 'use_custom_libcxx=false'
+ 'use_sysroot=false'
+ 'use_gconf=false'
+ 'use_gnome_keyring=false'
+)
+ CC=clang CXX=clang++ python2 tools/gn/bootstrap/bootstrap.py --gn-gen-args "${gn_flags[*]}"
+ # libevent not needed anymore
+ find -type f -path "*base/third_party/libevent/*" \
+ \! -regex '.*\.\(gn\|gni\|isolate\|py\)' \
+ -delete
+
+ cd "${srcdir}/electron/vendor/libchromiumcontent"
+ script/update -t x64 --skip_gclient
+ script/build -t x64 -c static_library native_mksnapshot
+ script/create-dist -c static_library -t x64 --no_zip -t x64
+
+ cd "${srcdir}"/electron
+ LDFLAGS="${LDFLAGS} -Wl,-z,noexecstack"
+ distdir="${srcdir}/electron/vendor/libchromiumcontent/dist/main"
+ script/bootstrap.py --verbose \
+ --clang_dir=/usr \
+ --libcc_source_path="${distdir}/src" \
+ --libcc_shared_library_path="${distdir}/shared_library" \
+ --libcc_static_library_path="${distdir}/static_library"
+ script/build.py -c Release --ninja-path=ninja
+}
+
+package() {
+ cd "${srcdir}"/electron
+
+ _cc="${srcdir}"/electron/vendor/libchromiumcontent/dist/main
+
+ install -Dm644 LICENSE "${_cc}"/LICENSES.chromium.html \
+ -t "${pkgdir}"/usr/share/licenses/electron2
+ for lib in native_mate node; do
+ install -m644 vendor/${lib}/LICENSE \
+ "${pkgdir}"/usr/share/licenses/electron2/LICENSE-${lib}
+ done
+ install -m644 vendor/libchromiumcontent/src/LICENSE \
+ "${pkgdir}"/usr/share/licenses/electron2/LICENSE-chromium
+
+ cd out/R
+ install -Dm644 blink_image_resources_200_percent.pak \
+ content_resources_200_percent.pak content_shell.pak icudtl.dat \
+ natives_blob.bin \
+ pdf_viewer_resources.pak \
+ snapshot_blob.bin \
+ ui_resources_200_percent.pak \
+ views_resources_200_percent.pak \
+ -t "${pkgdir}"/usr/lib/electron2
+ install -m755 electron "${pkgdir}"/usr/lib/electron2/electron
+ install -dm755 "${pkgdir}"/usr/bin
+ ln -s ../lib/electron2/electron "${pkgdir}"/usr/bin/electron2
+ # namcap warning: Referenced library 'libnode.so' is an uninstalled dependency
+ # Fixable by moving libnode.so to /usr/lib
+ install -m644 libnode.so "${pkgdir}"/usr/lib/electron2
+ cp -r locales resources "${pkgdir}"/usr/lib/electron2
+ cd ../..
+
+ echo -n "v${pkgver}" > "${pkgdir}"/usr/lib/electron2/version
+
+ # Install .desktop and icon file
+ install -Dm644 "${srcdir}"/electron2.desktop -t "${pkgdir}"/usr/share/applications/
+ install -Dm644 default_app/icon.png \
+ "${pkgdir}"/usr/share/pixmaps/electron2.png # hicolor has no 1024x1024
+
+ # Install Node headers
+ _headers_dest="${pkgdir}/usr/lib/electron2/node"
+ install -d -m755 "${_headers_dest}"
+ cd "${srcdir}"/electron/vendor/node
+ find src deps/http_parser deps/zlib deps/uv deps/npm \
+ -name "*.gypi" \
+ -exec install -D -m644 '{}' "${_headers_dest}/{}" \; \
+ -or -name "*.h" \
+ -exec install -D -m644 '{}' "${_headers_dest}/{}" \;
+ install -m644 {common,config}.gypi "${_headers_dest}"
+ cd "${_cc}"/src
+ find v8 -name "*.h" \
+ -exec install -D -m644 '{}' "${_headers_dest}/deps/{}" \;
+ # echo '9' > "${_headers_dest}/installVersion"
+}
diff --git a/breakpad-glibc2.26.patch b/breakpad-glibc2.26.patch
new file mode 100644
index 000000000000..116fd4b204ef
--- /dev/null
+++ b/breakpad-glibc2.26.patch
@@ -0,0 +1,208 @@
+--- a/src/client/linux/dump_writer_common/ucontext_reader.cc
++++ b/src/client/linux/dump_writer_common/ucontext_reader.cc
+@@ -36,19 +36,19 @@ namespace google_breakpad {
+
+ // Minidump defines register structures which are different from the raw
+ // structures which we get from the kernel. These are platform specific
+-// functions to juggle the ucontext and user structures into minidump format.
++// functions to juggle the ucontext_t and user structures into minidump format.
+
+ #if defined(__i386__)
+
+-uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) {
++uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
+ return uc->uc_mcontext.gregs[REG_ESP];
+ }
+
+-uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) {
++uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
+ return uc->uc_mcontext.gregs[REG_EIP];
+ }
+
+-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc,
++void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+ const struct _libc_fpstate* fp) {
+ const greg_t* regs = uc->uc_mcontext.gregs;
+
+@@ -88,15 +88,15 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc,
+
+ #elif defined(__x86_64)
+
+-uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) {
++uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
+ return uc->uc_mcontext.gregs[REG_RSP];
+ }
+
+-uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) {
++uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
+ return uc->uc_mcontext.gregs[REG_RIP];
+ }
+
+-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc,
++void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+ const struct _libc_fpstate* fpregs) {
+ const greg_t* regs = uc->uc_mcontext.gregs;
+
+@@ -145,15 +145,15 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc,
+
+ #elif defined(__ARM_EABI__)
+
+-uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) {
++uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
+ return uc->uc_mcontext.arm_sp;
+ }
+
+-uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) {
++uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
+ return uc->uc_mcontext.arm_pc;
+ }
+
+-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc) {
++void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) {
+ out->context_flags = MD_CONTEXT_ARM_FULL;
+
+ out->iregs[0] = uc->uc_mcontext.arm_r0;
+@@ -184,15 +184,15 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc) {
+
+ #elif defined(__aarch64__)
+
+-uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) {
++uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
+ return uc->uc_mcontext.sp;
+ }
+
+-uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) {
++uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
+ return uc->uc_mcontext.pc;
+ }
+
+-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc,
++void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+ const struct fpsimd_context* fpregs) {
+ out->context_flags = MD_CONTEXT_ARM64_FULL;
+
+@@ -210,15 +210,15 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc,
+
+ #elif defined(__mips__)
+
+-uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) {
++uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
+ return uc->uc_mcontext.gregs[MD_CONTEXT_MIPS_REG_SP];
+ }
+
+-uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) {
++uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
+ return uc->uc_mcontext.pc;
+ }
+
+-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc) {
++void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) {
+ #if _MIPS_SIM == _ABI64
+ out->context_flags = MD_CONTEXT_MIPS64_FULL;
+ #elif _MIPS_SIM == _ABIO32
+--- a/src/client/linux/dump_writer_common/ucontext_reader.h
++++ b/src/client/linux/dump_writer_common/ucontext_reader.h
+@@ -39,23 +39,23 @@
+
+ namespace google_breakpad {
+
+-// Wraps platform-dependent implementations of accessors to ucontext structs.
++// Wraps platform-dependent implementations of accessors to ucontext_t structs.
+ struct UContextReader {
+- static uintptr_t GetStackPointer(const struct ucontext* uc);
++ static uintptr_t GetStackPointer(const ucontext_t* uc);
+
+- static uintptr_t GetInstructionPointer(const struct ucontext* uc);
++ static uintptr_t GetInstructionPointer(const ucontext_t* uc);
+
+- // Juggle a arch-specific ucontext into a minidump format
++ // Juggle a arch-specific ucontext_t into a minidump format
+ // out: the minidump structure
+ // info: the collection of register structures.
+ #if defined(__i386__) || defined(__x86_64)
+- static void FillCPUContext(RawContextCPU *out, const ucontext *uc,
++ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+ const struct _libc_fpstate* fp);
+ #elif defined(__aarch64__)
+- static void FillCPUContext(RawContextCPU *out, const ucontext *uc,
++ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
+ const struct fpsimd_context* fpregs);
+ #else
+- static void FillCPUContext(RawContextCPU *out, const ucontext *uc);
++ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc);
+ #endif
+ };
+
+--- a/src/client/linux/handler/exception_handler.cc
++++ b/src/client/linux/handler/exception_handler.cc
+@@ -439,9 +439,9 @@ bool ExceptionHandler::HandleSignal(int /*sig*/, siginfo_t* info, void* uc) {
+ // Fill in all the holes in the struct to make Valgrind happy.
+ memset(&g_crash_context_, 0, sizeof(g_crash_context_));
+ memcpy(&g_crash_context_.siginfo, info, sizeof(siginfo_t));
+- memcpy(&g_crash_context_.context, uc, sizeof(struct ucontext));
++ memcpy(&g_crash_context_.context, uc, sizeof(ucontext_t));
+ #if defined(__aarch64__)
+- struct ucontext* uc_ptr = (struct ucontext*)uc;
++ ucontext_t* uc_ptr = (ucontext_t*)uc;
+ struct fpsimd_context* fp_ptr =
+ (struct fpsimd_context*)&uc_ptr->uc_mcontext.__reserved;
+ if (fp_ptr->head.magic == FPSIMD_MAGIC) {
+@@ -450,9 +450,9 @@ bool ExceptionHandler::HandleSignal(int /*sig*/, siginfo_t* info, void* uc) {
+ }
+ #elif !defined(__ARM_EABI__) && !defined(__mips__)
+ // FP state is not part of user ABI on ARM Linux.
+- // In case of MIPS Linux FP state is already part of struct ucontext
++ // In case of MIPS Linux FP state is already part of ucontext_t
+ // and 'float_state' is not a member of CrashContext.
+- struct ucontext* uc_ptr = (struct ucontext*)uc;
++ ucontext_t* uc_ptr = (ucontext_t*)uc;
+ if (uc_ptr->uc_mcontext.fpregs) {
+ memcpy(&g_crash_context_.float_state, uc_ptr->uc_mcontext.fpregs,
+ sizeof(g_crash_context_.float_state));
+@@ -476,7 +476,7 @@ bool ExceptionHandler::SimulateSignalDelivery(int sig) {
+ // ExceptionHandler::HandleSignal().
+ siginfo.si_code = SI_USER;
+ siginfo.si_pid = getpid();
+- struct ucontext context;
++ ucontext_t context;
+ getcontext(&context);
+ return HandleSignal(sig, &siginfo, &context);
+ }
+--- a/src/client/linux/handler/exception_handler.h
++++ b/src/client/linux/handler/exception_handler.h
+@@ -191,11 +191,11 @@ class ExceptionHandler {
+ struct CrashContext {
+ siginfo_t siginfo;
+ pid_t tid; // the crashing thread.
+- struct ucontext context;
++ ucontext_t context;
+ #if !defined(__ARM_EABI__) && !defined(__mips__)
+ // #ifdef this out because FP state is not part of user ABI for Linux ARM.
+ // In case of MIPS Linux FP state is already part of struct
+- // ucontext so 'float_state' is not required.
++ // ucontext_t so 'float_state' is not required.
+ fpstate_t float_state;
+ #endif
+ };
+--- a/src/client/linux/microdump_writer/microdump_writer.cc
++++ b/src/client/linux/microdump_writer/microdump_writer.cc
+@@ -560,7 +560,7 @@ class MicrodumpWriter {
+
+ void* Alloc(unsigned bytes) { return dumper_->allocator()->Alloc(bytes); }
+
+- const struct ucontext* const ucontext_;
++ const ucontext_t* const ucontext_;
+ #if !defined(__ARM_EABI__) && !defined(__mips__)
+ const google_breakpad::fpstate_t* const float_state_;
+ #endif
+--- a/src/client/linux/minidump_writer/minidump_writer.cc
++++ b/src/client/linux/minidump_writer/minidump_writer.cc
+@@ -1248,7 +1248,7 @@ class MinidumpWriter {
+ const int fd_; // File descriptor where the minidum should be written.
+ const char* path_; // Path to the file where the minidum should be written.
+
+- const struct ucontext* const ucontext_; // also from the signal handler
++ const ucontext_t* const ucontext_; // also from the signal handler
+ #if !defined(__ARM_EABI__) && !defined(__mips__)
+ const google_breakpad::fpstate_t* const float_state_; // ditto
+ #endif
diff --git a/breakpad-glibc2.30.patch b/breakpad-glibc2.30.patch
new file mode 100644
index 000000000000..7c8a68c2451a
--- /dev/null
+++ b/breakpad-glibc2.30.patch
@@ -0,0 +1,49 @@
+From 7e3c165000d44fa153a3270870ed500bc8bbb461 Mon Sep 17 00:00:00 2001
+From: Nicholas Baldwin <baldwinn@google.com>
+Date: Fri, 27 Oct 2017 11:44:36 -0700
+Subject: [PATCH] Fix double declaration of tgkill when using Android NDK
+ Headers.
+
+As of Android API level 16 tgkill is declared in the NDK version of
+signal.h, which conflicts with the static definition found in
+src/client/linux/handler/exception_handler.cc. This change removes
+the static tgkill definition and replaces its use with sys_tgkill
+from the linux syscall support library.
+
+Bug:
+Change-Id: Ic70addd8a064cfa36345d86b7e36409e2089e909
+Reviewed-on: https://chromium-review.googlesource.com/738912
+Reviewed-by: Mike Frysinger <vapier@chromium.org>
+---
+ src/client/linux/handler/exception_handler.cc | 8 +-------
+ 1 file changed, 1 insertion(+), 7 deletions(-)
+
+diff --git a/src/client/linux/handler/exception_handler.cc b/src/client/linux/handler/exception_handler.cc
+index 95005209..cd94e3b5 100644
+--- a/src/client/linux/handler/exception_handler.cc
++++ b/src/client/linux/handler/exception_handler.cc
+@@ -105,12 +105,6 @@
+ #define PR_SET_PTRACER 0x59616d61
+ #endif
+
+-// A wrapper for the tgkill syscall: send a signal to a specific thread.
+-static int tgkill(pid_t tgid, pid_t tid, int sig) {
+- return syscall(__NR_tgkill, tgid, tid, sig);
+- return 0;
+-}
+-
+ namespace google_breakpad {
+
+ namespace {
+@@ -400,7 +394,7 @@ void ExceptionHandler::SignalHandler(int sig, siginfo_t* info, void* uc) {
+ // In order to retrigger it, we have to queue a new signal by calling
+ // kill() ourselves. The special case (si_pid == 0 && sig == SIGABRT) is
+ // due to the kernel sending a SIGABRT from a user request via SysRQ.
+- if (tgkill(getpid(), syscall(__NR_gettid), sig) < 0) {
++ if (sys_tgkill(getpid(), syscall(__NR_gettid), sig) < 0) {
+ // If we failed to kill ourselves (e.g. because a sandbox disallows us
+ // to do so), we instead resort to terminating our process. This will
+ // result in an incorrect exit code.
+--
+2.23.0
+
diff --git a/chromium-SIOCGSTAMP.patch b/chromium-SIOCGSTAMP.patch
new file mode 100644
index 000000000000..4e7ae275e246
--- /dev/null
+++ b/chromium-SIOCGSTAMP.patch
@@ -0,0 +1,13 @@
+--- a/third_party/webrtc/rtc_base/physicalsocketserver.cc
++++ b/third_party/webrtc/rtc_base/physicalsocketserver.cc
+@@ -67,6 +67,10 @@
+
+ #endif // WEBRTC_POSIX
+
++#if defined(WEBRTC_LINUX)
++#include <linux/sockios.h>
++#endif
++
+ #if defined(WEBRTC_POSIX) && !defined(WEBRTC_MAC) && !defined(__native_client__)
+
+ int64_t GetSocketRecvTimestamp(int socket) {
diff --git a/chromium-atk-r1.patch b/chromium-atk-r1.patch
new file mode 100644
index 000000000000..32fa29975b3e
--- /dev/null
+++ b/chromium-atk-r1.patch
@@ -0,0 +1,11 @@
+--- a/content/browser/accessibility/browser_accessibility_auralinux.cc.orig 2017-07-27 06:28:01.090257874 +0000
++++ b/content/browser/accessibility/browser_accessibility_auralinux.cc 2017-07-27 06:28:21.174653680 +0000
+@@ -571,7 +571,7 @@
+ // it's best to leave this out rather than break people's builds:
+ #if defined(ATK_CHECK_VERSION)
+ #if ATK_CHECK_VERSION(2, 16, 0)
+- atk_state_set_add_state(atk_state_set, ATK_STATE_READ_ONLY);
++ atk_state_set_add_state(state_set, ATK_STATE_READ_ONLY);
+ #endif
+ #endif
+ break;
diff --git a/chromium-gn-bootstrap-r14.patch b/chromium-gn-bootstrap-r14.patch
new file mode 100644
index 000000000000..3c44c858f78d
--- /dev/null
+++ b/chromium-gn-bootstrap-r14.patch
@@ -0,0 +1,27 @@
+commit 96c271f8ab2be7ea4199078ea65ac50c6ada4685
+Author: Pawel Hajdan, Jr <phajdan.jr@chromium.org>
+Date: Wed Jul 26 21:51:54 2017 +0000
+
+ wip
+
+diff --git a/tools/gn/bootstrap/bootstrap.py b/tools/gn/bootstrap/bootstrap.py
+index 1390560f8e37..ff2ae57c46b0 100755
+--- a/tools/gn/bootstrap/bootstrap.py
++++ b/tools/gn/bootstrap/bootstrap.py
+@@ -449,6 +449,7 @@ def write_gn_ninja(path, root_gen_dir, options):
+ 'base/metrics/histogram_base.cc',
+ 'base/metrics/histogram_functions.cc',
+ 'base/metrics/histogram_samples.cc',
++ 'base/metrics/histogram_snapshot_manager.cc',
+ 'base/metrics/metrics_hashes.cc',
+ 'base/metrics/persistent_histogram_allocator.cc',
+ 'base/metrics/persistent_memory_allocator.cc',
+@@ -534,7 +535,7 @@ def write_gn_ninja(path, root_gen_dir, options):
+ 'base/trace_event/heap_profiler_allocation_context_tracker.cc',
+ 'base/trace_event/heap_profiler_allocation_register.cc',
+ 'base/trace_event/heap_profiler_event_filter.cc',
+- 'base/trace_event/heap_profiler_event_writer.cc',
++ 'base/trace_event/heap_profiler_heap_dump_writer.cc',
+ 'base/trace_event/heap_profiler_serialization_state.cc',
+ 'base/trace_event/heap_profiler_stack_frame_deduplicator.cc',
+ 'base/trace_event/heap_profiler_type_name_deduplicator.cc',
diff --git a/chromium-include-functional.patch b/chromium-include-functional.patch
new file mode 100644
index 000000000000..e21d366e1bfb
--- /dev/null
+++ b/chromium-include-functional.patch
@@ -0,0 +1,10 @@
+--- a/third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContext.h
++++ b/third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContext.h
+@@ -8,6 +8,7 @@
+ #include "platform/PlatformExport.h"
+ #include "platform/wtf/ThreadSpecific.h"
+
++#include <functional>
+ #include <memory>
+
+ namespace gpu {
diff --git a/chromium-use-system-ffmpeg.patch b/chromium-use-system-ffmpeg.patch
new file mode 100644
index 000000000000..d670843ed393
--- /dev/null
+++ b/chromium-use-system-ffmpeg.patch
@@ -0,0 +1,81 @@
+--- a/media/base/decoder_buffer.h
++++ b/media/base/decoder_buffer.h
+@@ -37,7 +37,7 @@
+ : public base::RefCountedThreadSafe<DecoderBuffer> {
+ public:
+ enum {
+- kPaddingSize = 32,
++ kPaddingSize = 64,
+ #if defined(ARCH_CPU_ARM_FAMILY)
+ kAlignmentSize = 16
+ #else
+--- a/media/ffmpeg/ffmpeg_common.cc
++++ b/media/ffmpeg/ffmpeg_common.cc
+@@ -30,10 +30,10 @@
+
+ } // namespace
+
+-// Why FF_INPUT_BUFFER_PADDING_SIZE? FFmpeg assumes all input buffers are
++// Why AV_INPUT_BUFFER_PADDING_SIZE? FFmpeg assumes all input buffers are
+ // padded. Check here to ensure FFmpeg only receives data padded to its
+ // specifications.
+-static_assert(DecoderBuffer::kPaddingSize >= FF_INPUT_BUFFER_PADDING_SIZE,
++static_assert(DecoderBuffer::kPaddingSize >= AV_INPUT_BUFFER_PADDING_SIZE,
+ "DecoderBuffer padding size does not fit ffmpeg requirement");
+
+ // Alignment requirement by FFmpeg for input and output buffers. This need to
+@@ -444,11 +444,11 @@
+ } else {
+ codec_context->extradata_size = config.extra_data().size();
+ codec_context->extradata = reinterpret_cast<uint8_t*>(
+- av_malloc(config.extra_data().size() + FF_INPUT_BUFFER_PADDING_SIZE));
++ av_malloc(config.extra_data().size() + AV_INPUT_BUFFER_PADDING_SIZE));
+ memcpy(codec_context->extradata, &config.extra_data()[0],
+ config.extra_data().size());
+ memset(codec_context->extradata + config.extra_data().size(), '\0',
+- FF_INPUT_BUFFER_PADDING_SIZE);
++ AV_INPUT_BUFFER_PADDING_SIZE);
+ }
+ }
+
+@@ -585,11 +585,11 @@
+ } else {
+ codec_context->extradata_size = config.extra_data().size();
+ codec_context->extradata = reinterpret_cast<uint8_t*>(
+- av_malloc(config.extra_data().size() + FF_INPUT_BUFFER_PADDING_SIZE));
++ av_malloc(config.extra_data().size() + AV_INPUT_BUFFER_PADDING_SIZE));
+ memcpy(codec_context->extradata, &config.extra_data()[0],
+ config.extra_data().size());
+ memset(codec_context->extradata + config.extra_data().size(), '\0',
+- FF_INPUT_BUFFER_PADDING_SIZE);
++ AV_INPUT_BUFFER_PADDING_SIZE);
+ }
+ }
+
+--- a/media/filters/ffmpeg_audio_decoder.cc
++++ b/media/filters/ffmpeg_audio_decoder.cc
+@@ -368,7 +368,7 @@
+ int FFmpegAudioDecoder::GetAudioBuffer(struct AVCodecContext* s,
+ AVFrame* frame,
+ int flags) {
+- DCHECK(s->codec->capabilities & CODEC_CAP_DR1);
++ DCHECK(s->codec->capabilities & AV_CODEC_CAP_DR1);
+ DCHECK_EQ(s->codec_type, AVMEDIA_TYPE_AUDIO);
+
+ // Since this routine is called by FFmpeg when a buffer is required for audio
+--- a/media/filters/ffmpeg_video_decoder.cc
++++ b/media/filters/ffmpeg_video_decoder.cc
+@@ -427,12 +427,11 @@
+ codec_context_->thread_type =
+ FF_THREAD_SLICE | (low_delay ? 0 : FF_THREAD_FRAME);
+ codec_context_->opaque = this;
+- codec_context_->flags |= CODEC_FLAG_EMU_EDGE;
+ codec_context_->get_buffer2 = GetVideoBufferImpl;
+ codec_context_->refcounted_frames = 1;
+
+ if (decode_nalus_)
+- codec_context_->flags2 |= CODEC_FLAG2_CHUNKS;
++ codec_context_->flags2 |= AV_CODEC_FLAG2_CHUNKS;
+
+ AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
+ if (!codec || avcodec_open2(codec_context_.get(), codec, NULL) < 0) {
diff --git a/chromium-use-system-minizip.patch b/chromium-use-system-minizip.patch
new file mode 100644
index 000000000000..cc5c6aa95ad1
--- /dev/null
+++ b/chromium-use-system-minizip.patch
@@ -0,0 +1,14 @@
+--- a/third_party/zlib/google/zip_reader.cc
++++ b/third_party/zlib/google/zip_reader.cc
+@@ -278,10 +278,9 @@
+
+ current_entry_info_.reset();
+ reached_end_ = false;
+- const int kDefaultCaseSensivityOfOS = 0;
+ const int result = unzLocateFile(zip_file_,
+ path_in_zip.AsUTF8Unsafe().c_str(),
+- kDefaultCaseSensivityOfOS);
++ NULL);
+ if (result != UNZ_OK)
+ return false;
+
diff --git a/chromium-use-system-re2.patch b/chromium-use-system-re2.patch
new file mode 100644
index 000000000000..e8237b5c2d6c
--- /dev/null
+++ b/chromium-use-system-re2.patch
@@ -0,0 +1,10 @@
+--- a/build/linux/unbundle/re2.gn
++++ b/build/linux/unbundle/re2.gn
+@@ -11,7 +11,6 @@
+ "re2/re2.h",
+ "re2/set.h",
+ "re2/stringpiece.h",
+- "re2/variadic_function.h",
+ ]
+ }
+
diff --git a/default_app-icon.patch b/default_app-icon.patch
new file mode 100644
index 000000000000..407a28681148
--- /dev/null
+++ b/default_app-icon.patch
@@ -0,0 +1,22 @@
+--- a/default_app/default_app.js
++++ b/default_app/default_app.js
+@@ -20,9 +20,6 @@ exports.load = (appUrl) => {
+ },
+ useContentSize: true
+ }
+- if (process.platform === 'linux') {
+- options.icon = path.join(__dirname, 'icon.png')
+- }
+
+ mainWindow = new BrowserWindow(options)
+ mainWindow.loadURL(appUrl)
+--- a/filenames.gypi
++++ b/filenames.gypi
+@@ -89,7 +89,6 @@
+ ],
+ 'default_app_sources': [
+ 'default_app/default_app.js',
+- 'default_app/icon.png',
+ 'default_app/index.html',
+ 'default_app/main.js',
+ 'default_app/package.json',
diff --git a/dont-bootstrap-libchromiumcontent.patch b/dont-bootstrap-libchromiumcontent.patch
new file mode 100644
index 000000000000..5b3b5fdfbebd
--- /dev/null
+++ b/dont-bootstrap-libchromiumcontent.patch
@@ -0,0 +1,13 @@
+diff --git a/script/build-libchromiumcontent.py b/script/build-libchromiumcontent.py
+index e0a95f6..1383e70 100755
+--- a/script/build-libchromiumcontent.py
++++ b/script/build-libchromiumcontent.py
+@@ -44,7 +44,7 @@ def main():
+ build = os.path.join(script_dir, 'build')
+ create_dist = os.path.join(script_dir, 'create-dist')
+ if args.force_update or libchromiumcontent_outdated():
+- execute_stdout([sys.executable, bootstrap])
++ # execute_stdout([sys.executable, bootstrap])
+ execute_stdout([sys.executable, update, '-t', args.target_arch,
+ '--defines', args.defines])
+ update_gclient_done_marker()
diff --git a/dont-update-submodules.patch b/dont-update-submodules.patch
new file mode 100644
index 000000000000..2c011334a9c3
--- /dev/null
+++ b/dont-update-submodules.patch
@@ -0,0 +1,11 @@
+--- a/script/bootstrap.py
++++ b/script/bootstrap.py
+@@ -31,7 +31,7 @@ def main():
+ if sys.platform == 'cygwin':
+ update_win32_python()
+
+- update_submodules()
++ # update_submodules()
+
+ libcc_source_path = args.libcc_source_path
+ libcc_shared_library_path = args.libcc_shared_library_path
diff --git a/dont-use-sysroot.patch b/dont-use-sysroot.patch
new file mode 100644
index 000000000000..6475f190e38c
--- /dev/null
+++ b/dont-use-sysroot.patch
@@ -0,0 +1,27 @@
+--- a/script/bootstrap.py
++++ b/script/bootstrap.py
+@@ -63,9 +63,6 @@ def main():
+ libcc_source_path, libcc_shared_library_path,
+ libcc_static_library_path)
+
+- if PLATFORM == 'linux' and args.target_arch != 'mips64el':
+- download_sysroot(args.target_arch)
+-
+ create_chrome_version_h()
+ touch_config_gypi()
+ run_update(defines, args.msvs)
+--- a/toolchain.gypi
++++ b/toolchain.gypi
+@@ -62,10 +62,10 @@
+ 'sysroot%': '<(source_root)/vendor/debian_jessie_arm64-sysroot',
+ }],
+ ['target_arch=="ia32"', {
+- 'sysroot%': '<(source_root)/vendor/debian_jessie_i386-sysroot',
++ 'sysroot%': '/',
+ }],
+ ['target_arch=="x64"', {
+- 'sysroot%': '<(source_root)/vendor/debian_jessie_amd64-sysroot',
++ 'sysroot%': '/',
+ }],
+ ['target_arch=="mips64el"', {
+ 'sysroot%': '<(source_root)/vendor/debian_jessie_mips64-sysroot',
diff --git a/electron2.desktop b/electron2.desktop
new file mode 100644
index 000000000000..a7879d71d1a8
--- /dev/null
+++ b/electron2.desktop
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Type=Application
+Name=Electron
+Icon=electron2
+Exec=electron2 %u
+Categories=Development;GTK;
+StartupNotify=true
diff --git a/gyp-no-rpath.patch b/gyp-no-rpath.patch
new file mode 100644
index 000000000000..2843e98fc1a6
--- /dev/null
+++ b/gyp-no-rpath.patch
@@ -0,0 +1,12 @@
+--- a/pylib/gyp/generator/ninja.py
++++ b/pylib/gyp/generator/ninja.py
+@@ -1231,9 +1231,6 @@
+ rpath = 'lib/'
+ if self.toolset != 'target':
+ rpath += self.toolset
+- ldflags.append(r'-Wl,-rpath=\$$ORIGIN/%s' % rpath)
+- else:
+- ldflags.append('-Wl,-rpath=%s' % self.target_rpath)
+ ldflags.append('-Wl,-rpath-link=%s' % rpath)
+ self.WriteVariableList(ninja_file, 'ldflags',
+ map(self.ExpandSpecial, ldflags))
diff --git a/libchromiumcontent-fix-v8-patches.patch b/libchromiumcontent-fix-v8-patches.patch
new file mode 100644
index 000000000000..2c1d0e3f7cc3
--- /dev/null
+++ b/libchromiumcontent-fix-v8-patches.patch
@@ -0,0 +1,536 @@
+--- a/patches/v8/007-backport_f19b889.patch
++++ b/patches/v8/007-backport_f19b889.patch
+@@ -113,63 +113,6 @@
+ void resetContextGroup(int contextGroupId) override;
+ void idleStarted() override;
+ void idleFinished() override;
+-diff --git a/test/inspector/inspector-test.cc b/test/inspector/inspector-test.cc
+-index 930d6c9477..767168b297 100644
+---- a/test/inspector/inspector-test.cc
+-+++ b/test/inspector/inspector-test.cc
+-@@ -642,6 +642,9 @@ class InspectorExtension : public IsolateData::SetupGlobalTask {
+- inspector->Set(ToV8String(isolate, "fireContextDestroyed"),
+- v8::FunctionTemplate::New(
+- isolate, &InspectorExtension::FireContextDestroyed));
+-+ inspector->Set(
+-+ ToV8String(isolate, "freeContext"),
+-+ v8::FunctionTemplate::New(isolate, &InspectorExtension::FreeContext));
+- inspector->Set(ToV8String(isolate, "addInspectedObject"),
+- v8::FunctionTemplate::New(
+- isolate, &InspectorExtension::AddInspectedObject));
+-@@ -683,6 +686,12 @@ class InspectorExtension : public IsolateData::SetupGlobalTask {
+- data->FireContextDestroyed(context);
+- }
+-
+-+ static void FreeContext(const v8::FunctionCallbackInfo<v8::Value>& args) {
+-+ v8::Local<v8::Context> context = args.GetIsolate()->GetCurrentContext();
+-+ IsolateData* data = IsolateData::FromContext(context);
+-+ data->FreeContext(context);
+-+ }
+-+
+- static void AddInspectedObject(
+- const v8::FunctionCallbackInfo<v8::Value>& args) {
+- if (args.Length() != 2 || !args[0]->IsInt32()) {
+-diff --git a/test/inspector/isolate-data.cc b/test/inspector/isolate-data.cc
+-index 74c367a5e9..bd97a927e8 100644
+---- a/test/inspector/isolate-data.cc
+-+++ b/test/inspector/isolate-data.cc
+-@@ -303,6 +303,13 @@ void IsolateData::FireContextDestroyed(v8::Local<v8::Context> context) {
+- inspector_->contextDestroyed(context);
+- }
+-
+-+void IsolateData::FreeContext(v8::Local<v8::Context> context) {
+-+ int context_group_id = GetContextGroupId(context);
+-+ auto it = contexts_.find(context_group_id);
+-+ if (it == contexts_.end()) return;
+-+ contexts_.erase(it);
+-+}
+-+
+- std::vector<int> IsolateData::GetSessionIds(int context_group_id) {
+- std::vector<int> result;
+- for (auto& it : sessions_) {
+-diff --git a/test/inspector/isolate-data.h b/test/inspector/isolate-data.h
+-index a94316ff9b..c96a8d1bbd 100644
+---- a/test/inspector/isolate-data.h
+-+++ b/test/inspector/isolate-data.h
+-@@ -68,6 +68,7 @@ class IsolateData : public v8_inspector::V8InspectorClient {
+- void DumpAsyncTaskStacksStateForTest();
+- void FireContextCreated(v8::Local<v8::Context> context, int context_group_id);
+- void FireContextDestroyed(v8::Local<v8::Context> context);
+-+ void FreeContext(v8::Local<v8::Context> context);
+-
+- private:
+- struct VectorCompare {
+ diff --git a/test/inspector/runtime/context-destroyed-on-context-collected-expected.txt b/test/inspector/runtime/context-destroyed-on-context-collected-expected.txt
+ new file mode 100644
+ index 0000000000..9a5e1708c1
+--- a/patches/v8/009-backport_bca8409.patch
++++ b/patches/v8/009-backport_bca8409.patch
+@@ -136,25 +136,3 @@
+ base::Semaphore pending_sweeper_tasks_semaphore_;
+ base::Mutex mutex_;
+ SweptList swept_list_[kAllocationSpaces];
+-diff --git a/test/unittests/cancelable-tasks-unittest.cc b/test/unittests/cancelable-tasks-unittest.cc
+-index eb5dd91589..d0462877f5 100644
+---- a/test/unittests/cancelable-tasks-unittest.cc
+-+++ b/test/unittests/cancelable-tasks-unittest.cc
+-@@ -180,7 +180,7 @@ TEST(CancelableTask, RemoveBeforeCancelAndWait) {
+- ResultType result1 = 0;
+- TestTask* task1 = new TestTask(&manager, &result1, TestTask::kCheckNotRun);
+- ThreadedRunner runner1(task1);
+-- uint32_t id = task1->id();
+-+ CancelableTaskManager::Id id = task1->id();
+- EXPECT_EQ(id, 1u);
+- EXPECT_TRUE(manager.TryAbort(id));
+- runner1.Start();
+-@@ -195,7 +195,7 @@ TEST(CancelableTask, RemoveAfterCancelAndWait) {
+- ResultType result1 = 0;
+- TestTask* task1 = new TestTask(&manager, &result1);
+- ThreadedRunner runner1(task1);
+-- uint32_t id = task1->id();
+-+ CancelableTaskManager::Id id = task1->id();
+- EXPECT_EQ(id, 1u);
+- runner1.Start();
+- runner1.Join();
+--- a/patches/v8/010-backport_f9c4b7a.patch
++++ b/patches/v8/010-backport_f9c4b7a.patch
+@@ -194,15 +194,3 @@
+
+ DumpAndResetStats();
+
+-diff --git a/test/cctest/heap/test-spaces.cc b/test/cctest/heap/test-spaces.cc
+-index 26b2fdd193..b99913ab80 100644
+---- a/test/cctest/heap/test-spaces.cc
+-+++ b/test/cctest/heap/test-spaces.cc
+-@@ -370,6 +370,7 @@ TEST(NewSpace) {
+- }
+-
+- new_space.TearDown();
+-+ memory_allocator->unmapper()->WaitUntilCompleted();
+- memory_allocator->TearDown();
+- delete memory_allocator;
+- }
+--- a/patches/v8/013-revert_abi_breaking_changes_in_6_1.patch
++++ b/patches/v8/013-revert_abi_breaking_changes_in_6_1.patch
+@@ -552,167 +552,3 @@
+
+ struct ProtectedInstructionData {
+ // The offset of this instruction from the start of its code object.
+-diff --git a/test/cctest/heap/test-heap.cc b/test/cctest/heap/test-heap.cc
+-index 6781d3de6a..d9608292e8 100644
+---- a/test/cctest/heap/test-heap.cc
+-+++ b/test/cctest/heap/test-heap.cc
+-@@ -4806,7 +4806,7 @@ HEAP_TEST(Regress538257) {
+- FLAG_manual_evacuation_candidates_selection = true;
+- v8::Isolate::CreateParams create_params;
+- // Set heap limits.
+-- create_params.constraints.set_max_semi_space_size_in_kb(1024);
+-+ create_params.constraints.set_max_semi_space_size(1);
+- create_params.constraints.set_max_old_space_size(6);
+- create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
+- v8::Isolate* isolate = v8::Isolate::New(create_params);
+-diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
+-index 2d64279bf8..aa4cba5a60 100644
+---- a/test/cctest/test-api.cc
+-+++ b/test/cctest/test-api.cc
+-@@ -3453,16 +3453,10 @@ class ScopedArrayBufferContents {
+- public:
+- explicit ScopedArrayBufferContents(const v8::ArrayBuffer::Contents& contents)
+- : contents_(contents) {}
+-- ~ScopedArrayBufferContents() { free(contents_.AllocationBase()); }
+-+ ~ScopedArrayBufferContents() { free(contents_.Data()); }
+- void* Data() const { return contents_.Data(); }
+- size_t ByteLength() const { return contents_.ByteLength(); }
+-
+-- void* AllocationBase() const { return contents_.AllocationBase(); }
+-- size_t AllocationLength() const { return contents_.AllocationLength(); }
+-- v8::ArrayBuffer::Allocator::AllocationMode AllocationMode() const {
+-- return contents_.AllocationMode();
+-- }
+--
+- private:
+- const v8::ArrayBuffer::Contents contents_;
+- };
+-@@ -3738,43 +3732,15 @@ THREADED_TEST(ArrayBuffer_NeuteringScript) {
+- CheckDataViewIsNeutered(dv);
+- }
+-
+--THREADED_TEST(ArrayBuffer_AllocationInformation) {
+-- LocalContext env;
+-- v8::Isolate* isolate = env->GetIsolate();
+-- v8::HandleScope handle_scope(isolate);
+--
+-- const size_t ab_size = 1024;
+-- Local<v8::ArrayBuffer> ab = v8::ArrayBuffer::New(isolate, ab_size);
+-- ScopedArrayBufferContents contents(ab->Externalize());
+--
+-- // Array buffers should have normal allocation mode.
+-- CHECK(contents.AllocationMode() ==
+-- v8::ArrayBuffer::Allocator::AllocationMode::kNormal);
+-- // The allocation must contain the buffer (normally they will be equal, but
+-- // this is not required by the contract).
+-- CHECK_NOT_NULL(contents.AllocationBase());
+-- const uintptr_t alloc =
+-- reinterpret_cast<uintptr_t>(contents.AllocationBase());
+-- const uintptr_t data = reinterpret_cast<uintptr_t>(contents.Data());
+-- CHECK_LE(alloc, data);
+-- CHECK_LE(data + contents.ByteLength(), alloc + contents.AllocationLength());
+--}
+--
+- class ScopedSharedArrayBufferContents {
+- public:
+- explicit ScopedSharedArrayBufferContents(
+- const v8::SharedArrayBuffer::Contents& contents)
+- : contents_(contents) {}
+-- ~ScopedSharedArrayBufferContents() { free(contents_.AllocationBase()); }
+-+ ~ScopedSharedArrayBufferContents() { free(contents_.Data()); }
+- void* Data() const { return contents_.Data(); }
+- size_t ByteLength() const { return contents_.ByteLength(); }
+-
+-- void* AllocationBase() const { return contents_.AllocationBase(); }
+-- size_t AllocationLength() const { return contents_.AllocationLength(); }
+-- v8::ArrayBuffer::Allocator::AllocationMode AllocationMode() const {
+-- return contents_.AllocationMode();
+-- }
+--
+- private:
+- const v8::SharedArrayBuffer::Contents contents_;
+- };
+-@@ -20361,7 +20327,7 @@ class InitDefaultIsolateThread : public v8::base::Thread {
+- create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
+- switch (testCase_) {
+- case SetResourceConstraints: {
+-- create_params.constraints.set_max_semi_space_size_in_kb(1024);
+-+ create_params.constraints.set_max_semi_space_size(1);
+- create_params.constraints.set_max_old_space_size(6);
+- break;
+- }
+-@@ -26057,29 +26023,6 @@ TEST(FutexInterruption) {
+- timeout_thread.Join();
+- }
+-
+--THREADED_TEST(SharedArrayBuffer_AllocationInformation) {
+-- i::FLAG_harmony_sharedarraybuffer = true;
+-- LocalContext env;
+-- v8::Isolate* isolate = env->GetIsolate();
+-- v8::HandleScope handle_scope(isolate);
+--
+-- const size_t ab_size = 1024;
+-- Local<v8::SharedArrayBuffer> ab =
+-- v8::SharedArrayBuffer::New(isolate, ab_size);
+-- ScopedSharedArrayBufferContents contents(ab->Externalize());
+--
+-- // Array buffers should have normal allocation mode.
+-- CHECK(contents.AllocationMode() ==
+-- v8::ArrayBuffer::Allocator::AllocationMode::kNormal);
+-- // The allocation must contain the buffer (normally they will be equal, but
+-- // this is not required by the contract).
+-- CHECK_NOT_NULL(contents.AllocationBase());
+-- const uintptr_t alloc =
+-- reinterpret_cast<uintptr_t>(contents.AllocationBase());
+-- const uintptr_t data = reinterpret_cast<uintptr_t>(contents.Data());
+-- CHECK_LE(alloc, data);
+-- CHECK_LE(data + contents.ByteLength(), alloc + contents.AllocationLength());
+--}
+-
+- static int nb_uncaught_exception_callback_calls = 0;
+-
+-diff --git a/test/cctest/test-strings.cc b/test/cctest/test-strings.cc
+-index 73e9c58596..d98a4819b5 100644
+---- a/test/cctest/test-strings.cc
+-+++ b/test/cctest/test-strings.cc
+-@@ -1301,7 +1301,7 @@ TEST(SliceFromSlice) {
+- UNINITIALIZED_TEST(OneByteArrayJoin) {
+- v8::Isolate::CreateParams create_params;
+- // Set heap limits.
+-- create_params.constraints.set_max_semi_space_size_in_kb(1024);
+-+ create_params.constraints.set_max_semi_space_size(1);
+- create_params.constraints.set_max_old_space_size(7);
+- create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
+- v8::Isolate* isolate = v8::Isolate::New(create_params);
+-diff --git a/test/unittests/heap/heap-unittest.cc b/test/unittests/heap/heap-unittest.cc
+-index 6262eff210..8dab181ca7 100644
+---- a/test/unittests/heap/heap-unittest.cc
+-+++ b/test/unittests/heap/heap-unittest.cc
+-@@ -63,14 +63,19 @@ TEST(Heap, MaxHeapGrowingFactor) {
+- }
+-
+- TEST(Heap, SemiSpaceSize) {
+-- const size_t KB = static_cast<size_t>(i::KB);
+-- const size_t MB = static_cast<size_t>(i::MB);
+-- const size_t pm = i::Heap::kPointerMultiplier;
+-- ASSERT_EQ(1u * pm * MB / 2, i::Heap::ComputeMaxSemiSpaceSize(0u) * KB);
+-- ASSERT_EQ(1u * pm * MB / 2, i::Heap::ComputeMaxSemiSpaceSize(512u * MB) * KB);
+-- ASSERT_EQ(3u * pm * MB, i::Heap::ComputeMaxSemiSpaceSize(1024u * MB) * KB);
+-- ASSERT_EQ(8u * pm * MB, i::Heap::ComputeMaxSemiSpaceSize(2024u * MB) * KB);
+-- ASSERT_EQ(8u * pm * MB, i::Heap::ComputeMaxSemiSpaceSize(4095u * MB) * KB);
+-+ uint64_t configurations[][2] = {
+-+ {0, 1 * i::Heap::kPointerMultiplier},
+-+ {512 * i::MB, 1 * i::Heap::kPointerMultiplier},
+-+ {1 * i::GB, 3 * i::Heap::kPointerMultiplier},
+-+ {2 * static_cast<uint64_t>(i::GB), i::Heap::kMaxSemiSpaceSize},
+-+ {4 * static_cast<uint64_t>(i::GB), i::Heap::kMaxSemiSpaceSize},
+-+ {8 * static_cast<uint64_t>(i::GB), i::Heap::kMaxSemiSpaceSize}};
+-+
+-+ for (auto configuration : configurations) {
+-+ ASSERT_EQ(configuration[1],
+-+ static_cast<uint64_t>(
+-+ i::Heap::ComputeMaxSemiSpaceSize(configuration[0])));
+-+ }
+- }
+-
+- TEST(Heap, OldGenerationSize) {
+--- a/patches/v8/015-backport_9b21865822243.patch
++++ b/patches/v8/015-backport_9b21865822243.patch
+@@ -332,80 +332,3 @@
+
+ GetExternallyAllocatedMemoryInBytesCallback external_memory_callback_;
+
+-diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
+-index aa4cba5a60..06ce7c565e 100644
+---- a/test/cctest/test-api.cc
+-+++ b/test/cctest/test-api.cc
+-@@ -19592,6 +19592,19 @@ void EpilogueCallbackSecond(v8::Isolate* isolate,
+- ++epilogue_call_count_second;
+- }
+-
+-+void PrologueCallbackNew(v8::Isolate* isolate, v8::GCType,
+-+ v8::GCCallbackFlags flags, void* data) {
+-+ CHECK_EQ(flags, v8::kNoGCCallbackFlags);
+-+ CHECK_EQ(gc_callbacks_isolate, isolate);
+-+ ++*static_cast<int*>(data);
+-+}
+-+
+-+void EpilogueCallbackNew(v8::Isolate* isolate, v8::GCType,
+-+ v8::GCCallbackFlags flags, void* data) {
+-+ CHECK_EQ(flags, v8::kNoGCCallbackFlags);
+-+ CHECK_EQ(gc_callbacks_isolate, isolate);
+-+ ++*static_cast<int*>(data);
+-+}
+-
+- void PrologueCallbackAlloc(v8::Isolate* isolate,
+- v8::GCType,
+-@@ -19666,6 +19679,52 @@ TEST(GCCallbacksOld) {
+- CHECK_EQ(2, epilogue_call_count_second);
+- }
+-
+-+TEST(GCCallbacksWithData) {
+-+ LocalContext context;
+-+
+-+ gc_callbacks_isolate = context->GetIsolate();
+-+ int prologue1 = 0;
+-+ int epilogue1 = 0;
+-+ int prologue2 = 0;
+-+ int epilogue2 = 0;
+-+
+-+ context->GetIsolate()->AddGCPrologueCallback(PrologueCallbackNew, &prologue1);
+-+ context->GetIsolate()->AddGCEpilogueCallback(EpilogueCallbackNew, &epilogue1);
+-+ CHECK_EQ(0, prologue1);
+-+ CHECK_EQ(0, epilogue1);
+-+ CHECK_EQ(0, prologue2);
+-+ CHECK_EQ(0, epilogue2);
+-+ CcTest::CollectAllGarbage();
+-+ CHECK_EQ(1, prologue1);
+-+ CHECK_EQ(1, epilogue1);
+-+ CHECK_EQ(0, prologue2);
+-+ CHECK_EQ(0, epilogue2);
+-+ context->GetIsolate()->AddGCPrologueCallback(PrologueCallbackNew, &prologue2);
+-+ context->GetIsolate()->AddGCEpilogueCallback(EpilogueCallbackNew, &epilogue2);
+-+ CcTest::CollectAllGarbage();
+-+ CHECK_EQ(2, prologue1);
+-+ CHECK_EQ(2, epilogue1);
+-+ CHECK_EQ(1, prologue2);
+-+ CHECK_EQ(1, epilogue2);
+-+ context->GetIsolate()->RemoveGCPrologueCallback(PrologueCallbackNew,
+-+ &prologue1);
+-+ context->GetIsolate()->RemoveGCEpilogueCallback(EpilogueCallbackNew,
+-+ &epilogue1);
+-+ CcTest::CollectAllGarbage();
+-+ CHECK_EQ(2, prologue1);
+-+ CHECK_EQ(2, epilogue1);
+-+ CHECK_EQ(2, prologue2);
+-+ CHECK_EQ(2, epilogue2);
+-+ context->GetIsolate()->RemoveGCPrologueCallback(PrologueCallbackNew,
+-+ &prologue2);
+-+ context->GetIsolate()->RemoveGCEpilogueCallback(EpilogueCallbackNew,
+-+ &epilogue2);
+-+ CcTest::CollectAllGarbage();
+-+ CHECK_EQ(2, prologue1);
+-+ CHECK_EQ(2, epilogue1);
+-+ CHECK_EQ(2, prologue2);
+-+ CHECK_EQ(2, epilogue2);
+-+}
+-
+- TEST(GCCallbacks) {
+- LocalContext context;
+--- a/patches/v8/017-backport_163d360.patch
++++ b/patches/v8/017-backport_163d360.patch
+@@ -142,61 +142,3 @@
+ chunk->ResetProgressBar();
+ MarkingState::Internal(chunk).SetLiveBytes(0);
+ }
+-diff --git a/test/cctest/heap/test-heap.cc b/test/cctest/heap/test-heap.cc
+-index d9608292e8..a2273d2d8c 100644
+---- a/test/cctest/heap/test-heap.cc
+-+++ b/test/cctest/heap/test-heap.cc
+-@@ -6237,6 +6237,53 @@ HEAP_TEST(Regress5831) {
+- CHECK(chunk->NeverEvacuate());
+- }
+-
+-+TEST(Regress6800) {
+-+ CcTest::InitializeVM();
+-+ Isolate* isolate = CcTest::i_isolate();
+-+ HandleScope handle_scope(isolate);
+-+
+-+ const int kRootLength = 1000;
+-+ Handle<FixedArray> root =
+-+ isolate->factory()->NewFixedArray(kRootLength, TENURED);
+-+ {
+-+ HandleScope inner_scope(isolate);
+-+ Handle<FixedArray> new_space_array = isolate->factory()->NewFixedArray(1);
+-+ for (int i = 0; i < kRootLength; i++) {
+-+ root->set(i, *new_space_array);
+-+ }
+-+ for (int i = 0; i < kRootLength; i++) {
+-+ root->set(i, CcTest::heap()->undefined_value());
+-+ }
+-+ }
+-+ CcTest::CollectGarbage(NEW_SPACE);
+-+ CHECK_EQ(0, RememberedSet<OLD_TO_NEW>::NumberOfPreFreedEmptyBuckets(
+-+ MemoryChunk::FromAddress(root->address())));
+-+}
+-+
+-+TEST(Regress6800LargeObject) {
+-+ CcTest::InitializeVM();
+-+ Isolate* isolate = CcTest::i_isolate();
+-+ HandleScope handle_scope(isolate);
+-+
+-+ const int kRootLength = i::kMaxRegularHeapObjectSize / kPointerSize;
+-+ Handle<FixedArray> root =
+-+ isolate->factory()->NewFixedArray(kRootLength, TENURED);
+-+ CcTest::heap()->lo_space()->Contains(*root);
+-+ {
+-+ HandleScope inner_scope(isolate);
+-+ Handle<FixedArray> new_space_array = isolate->factory()->NewFixedArray(1);
+-+ for (int i = 0; i < kRootLength; i++) {
+-+ root->set(i, *new_space_array);
+-+ }
+-+ for (int i = 0; i < kRootLength; i++) {
+-+ root->set(i, CcTest::heap()->undefined_value());
+-+ }
+-+ }
+-+ CcTest::CollectGarbage(OLD_SPACE);
+-+ CHECK_EQ(0, RememberedSet<OLD_TO_NEW>::NumberOfPreFreedEmptyBuckets(
+-+ MemoryChunk::FromAddress(root->address())));
+-+}
+-+
+- HEAP_TEST(RegressMissingWriteBarrierInAllocate) {
+- if (!FLAG_incremental_marking) return;
+- FLAG_black_allocation = true;
+--- a/patches/v8/023-backport_b1cd96e.patch
++++ b/patches/v8/023-backport_b1cd96e.patch
+@@ -57,88 +57,3 @@
+ + await Protocol.Debugger.disable();
+ + InspectorTest.completeTest();
+ +})();
+-diff --git a/test/inspector/inspector-test.cc b/test/inspector/inspector-test.cc
+-index 767168b297..4c133cee1f 100644
+---- a/test/inspector/inspector-test.cc
+-+++ b/test/inspector/inspector-test.cc
+-@@ -299,6 +299,10 @@ class UtilsExtension : public IsolateData::SetupGlobalTask {
+- utils->Set(ToV8String(isolate, "setLogConsoleApiMessageCalls"),
+- v8::FunctionTemplate::New(
+- isolate, &UtilsExtension::SetLogConsoleApiMessageCalls));
+-+ utils->Set(
+-+ ToV8String(isolate, "setLogMaxAsyncCallStackDepthChanged"),
+-+ v8::FunctionTemplate::New(
+-+ isolate, &UtilsExtension::SetLogMaxAsyncCallStackDepthChanged));
+- utils->Set(ToV8String(isolate, "createContextGroup"),
+- v8::FunctionTemplate::New(isolate,
+- &UtilsExtension::CreateContextGroup));
+-@@ -485,6 +489,17 @@ class UtilsExtension : public IsolateData::SetupGlobalTask {
+- args[0].As<v8::Boolean>()->Value());
+- }
+-
+-+ static void SetLogMaxAsyncCallStackDepthChanged(
+-+ const v8::FunctionCallbackInfo<v8::Value>& args) {
+-+ if (args.Length() != 1 || !args[0]->IsBoolean()) {
+-+ fprintf(stderr,
+-+ "Internal error: setLogMaxAsyncCallStackDepthChanged(bool).");
+-+ Exit();
+-+ }
+-+ backend_runner_->data()->SetLogMaxAsyncCallStackDepthChanged(
+-+ args[0].As<v8::Boolean>()->Value());
+-+ }
+-+
+- static void CreateContextGroup(
+- const v8::FunctionCallbackInfo<v8::Value>& args) {
+- if (args.Length() != 0) {
+-diff --git a/test/inspector/isolate-data.cc b/test/inspector/isolate-data.cc
+-index bd97a927e8..2e9a64f66d 100644
+---- a/test/inspector/isolate-data.cc
+-+++ b/test/inspector/isolate-data.cc
+-@@ -355,6 +355,10 @@ void IsolateData::SetLogConsoleApiMessageCalls(bool log) {
+- log_console_api_message_calls_ = log;
+- }
+-
+-+void IsolateData::SetLogMaxAsyncCallStackDepthChanged(bool log) {
+-+ log_max_async_call_stack_depth_changed_ = log;
+-+}
+-+
+- v8::MaybeLocal<v8::Value> IsolateData::memoryInfo(v8::Isolate* isolate,
+- v8::Local<v8::Context>) {
+- if (memory_info_.IsEmpty()) return v8::MaybeLocal<v8::Value>();
+-@@ -381,3 +385,8 @@ void IsolateData::consoleAPIMessage(int contextGroupId,
+- Print(isolate_, stack->toString()->string());
+- fprintf(stdout, "\n");
+- }
+-+
+-+void IsolateData::maxAsyncCallStackDepthChanged(int depth) {
+-+ if (!log_max_async_call_stack_depth_changed_) return;
+-+ fprintf(stdout, "maxAsyncCallStackDepthChanged: %d\n", depth);
+-+}
+-diff --git a/test/inspector/isolate-data.h b/test/inspector/isolate-data.h
+-index c96a8d1bbd..af2bf0ef1e 100644
+---- a/test/inspector/isolate-data.h
+-+++ b/test/inspector/isolate-data.h
+-@@ -64,6 +64,7 @@ class IsolateData : public v8_inspector::V8InspectorClient {
+- void SetCurrentTimeMS(double time);
+- void SetMemoryInfo(v8::Local<v8::Value> memory_info);
+- void SetLogConsoleApiMessageCalls(bool log);
+-+ void SetLogMaxAsyncCallStackDepthChanged(bool log);
+- void SetMaxAsyncTaskStacksForTest(int limit);
+- void DumpAsyncTaskStacksStateForTest();
+- void FireContextCreated(v8::Local<v8::Context> context, int context_group_id);
+-@@ -105,6 +106,7 @@ class IsolateData : public v8_inspector::V8InspectorClient {
+- const v8_inspector::StringView& url,
+- unsigned lineNumber, unsigned columnNumber,
+- v8_inspector::V8StackTrace*) override;
+-+ void maxAsyncCallStackDepthChanged(int depth) override;
+-
+- TaskRunner* task_runner_;
+- SetupGlobalTasks setup_global_tasks_;
+-@@ -122,6 +124,7 @@ class IsolateData : public v8_inspector::V8InspectorClient {
+- bool current_time_set_ = false;
+- double current_time_ = 0.0;
+- bool log_console_api_message_calls_ = false;
+-+ bool log_max_async_call_stack_depth_changed_ = false;
+-
+- DISALLOW_COPY_AND_ASSIGN(IsolateData);
+- };
+--- a/patches/v8/025-cherry_pick_cc55747.patch
++++ /dev/null
+@@ -1,13 +0,0 @@
+-diff --git a/test/message/testcfg.py b/test/message/testcfg.py
+-index 0576458af2..1bbb2b16d8 100644
+---- a/test/message/testcfg.py
+-+++ b/test/message/testcfg.py
+-@@ -107,7 +107,7 @@ class MessageTestSuite(testsuite.TestSuite):
+- expected_lines, actual_lines, fillvalue=''):
+- pattern = re.escape(expected.rstrip() % env)
+- pattern = pattern.replace("\\*", ".*")
+-- pattern = pattern.replace("\\{NUMBER\\}", "\d(?:\.\d*)?")
+-+ pattern = pattern.replace("\\{NUMBER\\}", "\d+(?:\.\d*)?")
+- pattern = "^%s$" % pattern
+- if not re.match(pattern, actual):
+- return True
diff --git a/libchromiumcontent-settings.patch b/libchromiumcontent-settings.patch
new file mode 100644
index 000000000000..8e1e81f48640
--- /dev/null
+++ b/libchromiumcontent-settings.patch
@@ -0,0 +1,43 @@
+--- a/chromiumcontent/args/native_mksnapshot.gn
++++ b/chromiumcontent/args/native_mksnapshot.gn
+@@ -12,3 +12,10 @@
+ if (target_cpu == "arm64") {
+ v8_snapshot_toolchain="//build/toolchain/linux:clang_arm64"
+ }
++clang_base_path = "/usr"
++clang_use_chrome_plugins = false
++treat_warnings_as_errors = false
++use_custom_libcxx = false
++use_sysroot = false
++use_gconf = false
++use_gnome_keyring = false
+--- a/chromiumcontent/args/static_library.gn
++++ b/chromiumcontent/args/static_library.gn
+@@ -1,13 +1,25 @@
+ root_extra_deps = [ "//chromiumcontent:chromiumcontent" ]
+ is_electron_build = true
+ is_component_build = false
+-is_official_build = true
+-symbol_level = 2
++is_debug = false
++symbol_level = 0
+ enable_nacl = false
+ enable_widevine = true
+ proprietary_codecs = true
+ is_component_ffmpeg = true
+ ffmpeg_branding = "Chrome"
++clang_base_path = "/usr"
++clang_use_chrome_plugins = false
++fatal_linker_warnings = false
++treat_warnings_as_errors = false
++fieldtrial_testing_like_official_build = true
++remove_webcore_debug_symbols = true
++link_pulseaudio = true
++linux_use_bundled_binutils = false
++use_cups = true
++use_sysroot = false
++use_gconf = false
++use_gnome_keyring = false
+
+ # CFI is disabled for the time being, as Electron is not a monolithic binary
+ # with at least one shared library component (Node) and CFI is tricky in that
diff --git a/libchromiumcontent-sort-filenames.patch b/libchromiumcontent-sort-filenames.patch
new file mode 100644
index 000000000000..d7314f98a4eb
--- /dev/null
+++ b/libchromiumcontent-sort-filenames.patch
@@ -0,0 +1,32 @@
+--- a/chromiumcontent/build_libs.py
++++ b/chromiumcontent/build_libs.py
+@@ -13,7 +13,8 @@ def gen_list(out, name, obj_dirs):
+ out.write(name + " = [\n")
+ for base_dir in obj_dirs:
+ for dir, subdirs, files in os.walk(os.path.join('obj', base_dir)):
+- for f in files:
++ subdirs.sort()
++ for f in sorted(files):
+ if f.endswith('.obj') or f.endswith('.o'):
+ out.write('"' + os.path.abspath(os.path.join(dir, f)) + '",\n')
+ out.write("]\n")
+--- a/tools/generate_filenames_gypi.py
++++ b/tools/generate_filenames_gypi.py
+@@ -99,7 +99,7 @@ def main(target_file, code_dir, shared_dir, static_dir):
+
+
+ def find_libraries(dirpath, library_suffix, list_of_excludes):
+- libraries = glob.glob(os.path.join(dirpath, '*.' + library_suffix))
++ libraries = sorted(glob.glob(os.path.join(dirpath, '*.' + library_suffix)))
+ if (library_suffix == 'so'):
+ # Handle "libname.so.123"
+ libraries += find_files_by_regex(dirpath, re.compile('.*\.so\.[0-9]+'))
+@@ -132,7 +132,7 @@ def find_files_by_regex(dirpath, regex):
+ if regex.match(file):
+ files_found.append(os.path.join(root, file))
+
+- return files_found
++ return sorted(files_found)
+
+
+ def is_v8_library(p):
diff --git a/libchromiumcontent-static-library-only.patch b/libchromiumcontent-static-library-only.patch
new file mode 100644
index 000000000000..aef041fb7111
--- /dev/null
+++ b/libchromiumcontent-static-library-only.patch
@@ -0,0 +1,43 @@
+--- a/script/create-dist
++++ b/script/create-dist
+@@ -79,7 +79,7 @@ BINARIES = {
+ 'libffmpeg.dylib',
+ ],
+ 'linux': [
+- 'libffmpeg.so',
++ # 'libffmpeg.so',
+ ],
+ 'win32': [
+ 'd3dcompiler_47.dll',
+@@ -414,7 +414,7 @@ def generate_ninja(args, ninja):
+ copy_locales(target_arch, component, ninja)
+
+ if args.component != 'native_mksnapshot':
+- copy_ffmpeg(target_arch, ninja)
++ # copy_ffmpeg(target_arch, ninja)
+ copy_sources(ninja)
+ generate_licenses(ninja)
+
+@@ -542,9 +542,9 @@ def copy_binaries(target_arch, component, create_debug_archive,
+ else:
+ binaries = [ 'chromedriver', 'clang_x64_v8_mips64el/mksnapshot' ]
+ else:
+- binaries = [ 'chromedriver', 'mksnapshot' ]
++ binaries = [ 'mksnapshot' ]
+
+- ffmpeg_output_dir = get_output_dir(SOURCE_ROOT, target_arch, 'ffmpeg')
++ ffmpeg_output_dir = get_output_dir(SOURCE_ROOT, target_arch, 'static_library')
+ for binary in binaries:
+ ninja.copy(os.path.join(ffmpeg_output_dir, binary), target_dir)
+
+--- a/script/update
++++ b/script/update
+@@ -20,7 +20,7 @@ VENDOR_DIR = os.path.join(SOURCE_ROOT, 'vendor')
+ SRC_DIR = os.path.join(SOURCE_ROOT, 'src')
+ CHROMIUMCONTENT_SOURCE_DIR = os.path.join(SOURCE_ROOT, 'chromiumcontent')
+ CHROMIUMCONTENT_DESTINATION_DIR = os.path.join(SRC_DIR, 'chromiumcontent')
+-COMPONENTS = ['static_library', 'shared_library', 'ffmpeg', 'native_mksnapshot']
++COMPONENTS = ['static_library', 'native_mksnapshot']
+ DEPOT_TOOLS = os.path.join(VENDOR_DIR, 'depot_tools')
+
+ # URL to the mips64el sysroot image.
diff --git a/libchromiumcontent-use-system-tools.patch b/libchromiumcontent-use-system-tools.patch
new file mode 100644
index 000000000000..6fb49ec58a16
--- /dev/null
+++ b/libchromiumcontent-use-system-tools.patch
@@ -0,0 +1,57 @@
+--- a/script/build
++++ b/script/build
+@@ -17,7 +17,7 @@
+ # Whether the host system is a mips64el machine.
+ IS_MIPS64EL_HOST = platform.uname()[5] == 'mips64'
+
+-NINJA = os.path.join(VENDOR_DIR, 'depot_tools', 'ninja')
++NINJA = 'ninja'
+ if sys.platform == 'win32':
+ NINJA = '{0}.exe'.format(NINJA)
+ elif IS_MIPS64EL_HOST:
+--- a/script/create-dist
++++ b/script/create-dist
+@@ -34,7 +34,7 @@
+ # Whether the host system is a mips64el machine.
+ IS_MIPS64EL_HOST = platform.uname()[5] == 'mips64'
+
+-NINJA = os.path.join(VENDOR_DIR, 'depot_tools', 'ninja')
++NINJA = 'ninja'
+ if sys.platform == 'win32':
+ NINJA = '{0}.exe'.format(NINJA)
+ elif IS_MIPS64EL_HOST:
+--- a/script/lib/gn.py
++++ b/script/lib/gn.py
+@@ -10,7 +10,7 @@
+ if platform in ['win32', 'cygwin']:
+ relative_path = ['buildtools', 'win', 'gn.exe']
+ elif platform == 'linux2':
+- relative_path = ['buildtools', 'linux64', 'gn']
++ relative_path = ['out', 'Release', 'gn']
+ elif platform == 'darwin':
+ relative_path = ['buildtools', 'mac', 'gn']
+
+--- a/script/update
++++ b/script/update
+@@ -75,17 +75,16 @@
+ if target_arch == 'mips64el' and IS_MIPS64EL_HOST:
+ os.system('sh script/mips64el/runhooks-mips64el')
+
+- if sys.platform == 'linux2':
+- install_sysroot(target_arch)
+- elif sys.platform in ['win32', 'cygwin']:
+- update_toolchain_json()
++ # if sys.platform == 'linux2':
++ # install_sysroot(target_arch)
++ # elif sys.platform in ['win32', 'cygwin']:
++ # update_toolchain_json()
+
+ if target_arch == 'arm64':
+ install_aarch64_bintools()
+
+ return ((apply_patches(target_arch) if args.apply_patches else 0) or
+ copy_chromiumcontent_files() or
+- update_clang() or
+ setup_mips64el_toolchain(target_arch) or
+ run_gn(target_arch))
+
diff --git a/no-whole-archive.patch b/no-whole-archive.patch
new file mode 100644
index 000000000000..8860d9611d1c
--- /dev/null
+++ b/no-whole-archive.patch
@@ -0,0 +1,22 @@
+--- a/brightray/brightray.gyp
++++ b/brightray/brightray.gyp
+@@ -46,14 +46,13 @@
+ 'conditions': [
+ # Link with libraries of libchromiumcontent.
+ ['OS=="linux" and libchromiumcontent_component==0', {
+- # On Linux we have to use "--whole-archive" to force executable
+- # to include all symbols, otherwise we will have plenty of
++ # On Linux we have to use "--start-group" or we will have plenty of
+ # unresolved symbols errors.
+- 'direct_dependent_settings': {
+- 'ldflags': [
+- '-Wl,--whole-archive',
++ 'link_settings': {
++ 'libraries': [
++ '-Wl,--start-group',
+ '<@(libchromiumcontent_libraries)',
+- '-Wl,--no-whole-archive',
++ '-Wl,--end-group'
+ ],
+ }
+ }, { # (Release build on Linux)
diff --git a/use-system-ffmpeg.patch b/use-system-ffmpeg.patch
new file mode 100644
index 000000000000..97f0d2a6c695
--- /dev/null
+++ b/use-system-ffmpeg.patch
@@ -0,0 +1,21 @@
+--- a/brightray/brightray.gyp
++++ b/brightray/brightray.gyp
+@@ -149,8 +149,6 @@
+ }, {
+ 'link_settings': {
+ 'libraries': [
+- # Link with ffmpeg.
+- '<(libchromiumcontent_dir)/libffmpeg.so',
+ # Following libraries are required by libchromiumcontent:
+ '-lasound',
+ '-lcap',
+--- a/electron.gyp
++++ b/electron.gyp
+@@ -215,7 +215,6 @@
+ }, {
+ 'copied_libraries': [
+ '<(PRODUCT_DIR)/lib/libnode.so',
+- '<(libchromiumcontent_dir)/libffmpeg.so',
+ ],
+ }],
+ ],
diff --git a/use-system-libraries-in-node.patch b/use-system-libraries-in-node.patch
new file mode 100644
index 000000000000..8aed2d364d25
--- /dev/null
+++ b/use-system-libraries-in-node.patch
@@ -0,0 +1,31 @@
+--- a/common.gypi
++++ b/common.gypi
+@@ -24,12 +24,12 @@
+ 'node_install_npm': 'false',
+ 'node_prefix': '',
+ 'node_shared': 'true',
+- 'node_shared_cares': 'false',
+- 'node_shared_http_parser': 'false',
++ 'node_shared_cares': 'true',
++ 'node_shared_http_parser': 'true',
+ 'node_shared_libuv': 'false',
+ 'node_shared_openssl': 'false',
+ 'node_shared_v8': 'true',
+- 'node_shared_zlib': 'false',
++ 'node_shared_zlib': 'true',
+ 'node_tag': '',
+ 'node_use_dtrace': 'false',
+ 'node_use_etw': 'false',
+@@ -174,6 +174,12 @@
+ ],
+ }],
+ ['OS=="linux" and libchromiumcontent_component==0', {
++ 'libraries': [
++ '-lcares',
++ '-lcrypto',
++ '-lhttp_parser',
++ '-lz',
++ ],
+ # Prevent the linker from stripping symbols.
+ 'ldflags': [
+ '-Wl,--whole-archive',