summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authortensor52019-06-22 08:38:39 +0000
committerMartin Kröning2020-06-12 10:09:44 +0200
commit47363510f64f42dbe1a4a2e71532b4e9972f580b (patch)
treed0d3057fe6d6703df0fb1032b04721a448cfdabb
downloadaur-47363510f64f42dbe1a4a2e71532b4e9972f580b.tar.gz
addpkg: electron4 4.2.5-1
git-svn-id: file:///srv/repos/svn-community/svn@482701 9fca08f4-af9d-4005-b8df-a31f2cc04f65
-rw-r--r--.SRCINFO59
-rw-r--r--PKGBUILD185
-rw-r--r--chromium-skia-harmony.patch77
-rw-r--r--chromium-system-icu.patch19
-rw-r--r--default_app-icon.patch21
-rw-r--r--electron4.desktop7
-rw-r--r--fix-cfi-icall-failure-with-use_system_libjpeg-true.patch52
-rw-r--r--only-disable-cfi-icall-when-use_system_libjpeg-true.patch34
-rw-r--r--use-system-libraries-in-node.patch54
9 files changed, 508 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..3e3e684de70a
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,59 @@
+pkgbase = electron4
+ pkgdesc = Build cross platform desktop apps with web technologies
+ pkgver = 4.2.5
+ pkgrel = 1
+ url = https://electronjs.org/
+ arch = x86_64
+ license = MIT
+ license = custom
+ makedepends = clang
+ makedepends = git
+ makedepends = gn
+ 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 = libnghttp2
+ depends = libxslt
+ depends = libxss
+ depends = minizip
+ depends = nss
+ depends = re2
+ depends = snappy
+ 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)
+ source = git+https://github.com/electron/electron.git
+ source = git+https://chromium.googlesource.com/chromium/tools/depot_tools.git
+ source = electron4.desktop
+ source = default_app-icon.patch
+ source = use-system-libraries-in-node.patch
+ source = chromium-skia-harmony.patch
+ source = chromium-system-icu.patch
+ source = fix-cfi-icall-failure-with-use_system_libjpeg-true.patch
+ source = only-disable-cfi-icall-when-use_system_libjpeg-true.patch
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = 6a4f7164c60aede9bdc866a5f8b6a1bb473e498a6dcea9bf73f64843af34f0aa
+ sha256sums = 37372e8afd7c2405a8e50bca95c98b3c78e4c9b681cbef16da9c7a84b45e41e3
+ sha256sums = 3a81953701ac976a311db4e17999e67ab7c6de97ff63388f287d6497ef9adb9b
+ sha256sums = feca54ab09ac0fc9d0626770a6b899a6ac5a12173c7d0c1005bc3964ec83e7b3
+ sha256sums = c4f2d1bed9034c02b8806f00c2e8165df24de467803855904bff709ceaf11af5
+ sha256sums = 97b421bc60a4abdf37de2d88a51b973e9f68fb44d1eccd464adfb3d9f5d71478
+ sha256sums = 9cae9ded6497afd15ad72d963897425ab6c7f28941bb3c3948e7996610a0d180
+
+pkgname = electron4
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..d13867c2259c
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,185 @@
+# Maintainer: Nicola Squartini <tensor5@gmail.com>
+
+pkgname=electron4
+pkgver=4.2.5
+_commit=5d67ec3da5376a5058990e8a9557bc9124ad59a8
+_chromiumver=69.0.3497.128
+pkgrel=1
+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' 'libnghttp2'
+ 'libxslt' 'libxss' 'minizip' 'nss' 're2' 'snappy')
+makedepends=('clang' 'git' 'gn' 'gperf' 'harfbuzz-icu' 'jsoncpp' 'libnotify'
+ 'lld' 'llvm' 'ninja' 'npm' 'pciutils' 'python2' 'wget' 'yasm')
+optdepends=('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'
+ 'git+https://chromium.googlesource.com/chromium/tools/depot_tools.git'
+ 'electron4.desktop'
+ 'default_app-icon.patch'
+ 'use-system-libraries-in-node.patch'
+ 'chromium-skia-harmony.patch'
+ 'chromium-system-icu.patch'
+ 'fix-cfi-icall-failure-with-use_system_libjpeg-true.patch'
+ 'only-disable-cfi-icall-when-use_system_libjpeg-true.patch'
+ )
+sha256sums=('SKIP'
+ 'SKIP'
+ '6a4f7164c60aede9bdc866a5f8b6a1bb473e498a6dcea9bf73f64843af34f0aa'
+ '37372e8afd7c2405a8e50bca95c98b3c78e4c9b681cbef16da9c7a84b45e41e3'
+ '3a81953701ac976a311db4e17999e67ab7c6de97ff63388f287d6497ef9adb9b'
+ 'feca54ab09ac0fc9d0626770a6b899a6ac5a12173c7d0c1005bc3964ec83e7b3'
+ 'c4f2d1bed9034c02b8806f00c2e8165df24de467803855904bff709ceaf11af5'
+ '97b421bc60a4abdf37de2d88a51b973e9f68fb44d1eccd464adfb3d9f5d71478'
+ '9cae9ded6497afd15ad72d963897425ab6c7f28941bb3c3948e7996610a0d180')
+
+_system_libs=('ffmpeg'
+ 'flac'
+ 'fontconfig'
+ 'freetype'
+ 'harfbuzz-ng'
+ 'icu'
+ 'libdrm'
+ 'libevent'
+ 'libjpeg'
+# 'libpng'
+# 'libvpx'
+ 'libwebp'
+ 'libxml'
+ 'libxslt'
+# 'openh264'
+ 'opus'
+ 're2'
+ 'snappy'
+ 'yasm'
+ 'zlib'
+ )
+
+prepare() {
+ mkdir -p "${srcdir}"/python2-path
+ ln -sf /usr/bin/python2 "${srcdir}/python2-path/python"
+ export PATH="${srcdir}/python2-path:${PATH}:${srcdir}/depot_tools"
+
+ echo "Fetching chromium..."
+ git clone --branch=${_chromiumver} --depth=1 \
+ https://chromium.googlesource.com/chromium/src.git
+
+ echo "solutions = [
+ {
+ \"name\": \"src/electron\",
+ \"url\": \"file://${srcdir}/electron@${_commit}\",
+ \"deps_file\": \"DEPS\",
+ \"managed\": False,
+ \"custom_deps\": {
+ \"src\": None,
+ },
+ \"custom_vars\": {},
+ },
+]" > .gclient
+
+ python2 "${srcdir}/depot_tools/gclient.py" sync \
+ --with_branch_heads \
+ --with_tags \
+ --nohooks
+
+ sed -e "s/'am'/'apply'/" -i src/electron/script/lib/git.py
+
+ echo "Running hooks..."
+ # python2 "${srcdir}/depot_tools/gclient.py" runhooks
+ python2 src/build/landmines.py
+ python2 src/build/util/lastchange.py -o src/build/util/LASTCHANGE
+ python2 src/build/util/lastchange.py -m GPU_LISTS_VERSION \
+ --revision-id-only --header src/gpu/config/gpu_lists_version.h
+ python2 src/build/util/lastchange.py -m SKIA_COMMIT_HASH \
+ -s src/third_party/skia --header src/skia/ext/skia_commit_hash.h
+ # Create sysmlink to system Node.js
+ mkdir -p src/third_party/node/linux/node-linux-x64/bin
+ ln -sf /usr/bin/node src/third_party/node/linux/node-linux-x64/bin
+ python2 src/third_party/depot_tools/download_from_google_storage.py \
+ --no_resume --extract --no_auth --bucket chromium-nodejs \
+ -s src/third_party/node/node_modules.tar.gz.sha1
+ vpython src/chrome/android/profiles/update_afdo_profile.py
+ python2 src/electron/script/apply_all_patches.py \
+ src/electron/patches/common/config.json
+ cd src/electron
+ npm install
+ cd ..
+
+ echo "Patching Chromium for using system libraries..."
+ sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \
+ tools/generate_shim_headers/generate_shim_headers.py
+ for lib in "${_system_libs[@]}" libjpeg_turbo; do
+ third_party_dir="third_party/${lib}"
+ if [ ! -d ${third_party_dir} ]; then
+ third_party_dir="base/${third_party_dir}"
+ fi
+ find ${third_party_dir} -type f \
+ \! -path "${third_party_dir}/chromium/*" \
+ \! -path "${third_party_dir}/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[@]}"
+
+ echo "Applying local patches..."
+ patch -Np4 -i ../chromium-skia-harmony.patch
+ patch -Np1 -i ../chromium-system-icu.patch
+ patch -Np1 -i ../fix-cfi-icall-failure-with-use_system_libjpeg-true.patch
+ patch -Np1 -i ../only-disable-cfi-icall-when-use_system_libjpeg-true.patch
+ patch -Np1 -i ../use-system-libraries-in-node.patch
+ patch -Np1 -i ../default_app-icon.patch # Icon from .desktop file
+}
+
+build() {
+ export CC=clang
+ export CXX=clang++
+ export AR=ar
+ export NM=nm
+
+ cd src
+ export CHROMIUM_BUILDTOOLS_PATH="${PWD}/buildtools"
+ GN_EXTRA_ARGS='
+ clang_use_chrome_plugins = false
+ custom_toolchain = "//build/toolchain/linux/unbundle:default"
+ host_toolchain = "//build/toolchain/linux/unbundle:default"
+ icu_use_data_file = false
+ is_component_ffmpeg = false
+ link_pulseaudio = true
+ linux_use_bundled_binutils = false
+ remove_webcore_debug_symbols = true
+ treat_warnings_as_errors = false
+ use_custom_libcxx = false
+ use_gnome_keyring = false
+ use_sysroot = false
+ '
+ gn gen out/Release \
+ --args="import(\"//electron/build/args/release.gn\") ${GN_EXTRA_ARGS}"
+ ninja -C out/Release electron_dist_zip
+ # ninja -C out/Release third_party/electron_node:headers
+}
+
+package() {
+ install -dm755 "${pkgdir}/usr/lib/${pkgname}"
+ bsdtar -xf src/out/Release/dist.zip -C "${pkgdir}/usr/lib/${pkgname}"
+
+ install -dm755 "${pkgdir}/usr/share/licenses/${pkgname}"
+ for l in "${pkgdir}/usr/lib/${pkgname}"/{LICENSE,LICENSES.chromium.html}; do
+ ln -s \
+ $(realpath --relative-to="${pkgdir}/usr/share/licenses/${pkgname}" ${l}) \
+ "${pkgdir}/usr/share/licenses/${pkgname}"
+ done
+
+ install -dm755 "${pkgdir}"/usr/bin
+ ln -s ../lib/${pkgname}/electron "${pkgdir}"/usr/bin/${pkgname}
+
+ # Install .desktop and icon file (see default_app-icon.patch)
+ install -Dm644 -t "${pkgdir}/usr/share/applications" ${pkgname}.desktop
+ install -Dm644 src/electron/default_app/icon.png \
+ "${pkgdir}/usr/share/pixmaps/${pkgname}.png" # hicolor has no 1024x1024
+}
diff --git a/chromium-skia-harmony.patch b/chromium-skia-harmony.patch
new file mode 100644
index 000000000000..6343f7f804ff
--- /dev/null
+++ b/chromium-skia-harmony.patch
@@ -0,0 +1,77 @@
+--- qtwebengine-opensource-src-5.9.1/src/3rdparty/chromium/third_party/skia/src/ports/SkFontHost_FreeType.cpp.orig 2017-10-10 17:42:06.956950985 +0200
++++ qtwebengine-opensource-src-5.9.1/src/3rdparty/chromium/third_party/skia/src/ports/SkFontHost_FreeType.cpp 2017-10-10 17:46:05.824187787 +0200
+@@ -99,8 +99,6 @@
+ FreeTypeLibrary()
+ : fGetVarDesignCoordinates(nullptr)
+ , fLibrary(nullptr)
+- , fIsLCDSupported(false)
+- , fLCDExtra(0)
+ {
+ if (FT_New_Library(&gFTMemory, &fLibrary)) {
+ return;
+@@ -147,12 +145,7 @@
+ }
+ #endif
+
+- // Setup LCD filtering. This reduces color fringes for LCD smoothed glyphs.
+- // The default has changed over time, so this doesn't mean the same thing to all users.
+- if (FT_Library_SetLcdFilter(fLibrary, FT_LCD_FILTER_DEFAULT) == 0) {
+- fIsLCDSupported = true;
+- fLCDExtra = 2; //Using a filter adds one full pixel to each side.
+- }
++ FT_Library_SetLcdFilter(fLibrary, FT_LCD_FILTER_DEFAULT);
+ }
+ ~FreeTypeLibrary() {
+ if (fLibrary) {
+@@ -161,8 +153,6 @@
+ }
+
+ FT_Library library() { return fLibrary; }
+- bool isLCDSupported() { return fIsLCDSupported; }
+- int lcdExtra() { return fLCDExtra; }
+
+ // FT_Get_{MM,Var}_{Blend,Design}_Coordinates were added in FreeType 2.7.1.
+ // Prior to this there was no way to get the coordinates out of the FT_Face.
+@@ -173,8 +163,6 @@
+
+ private:
+ FT_Library fLibrary;
+- bool fIsLCDSupported;
+- int fLCDExtra;
+
+ // FT_Library_SetLcdFilterWeights was introduced in FreeType 2.4.0.
+ // The following platforms provide FreeType of at least 2.4.0.
+@@ -704,17 +692,6 @@
+ rec->fTextSize = SkIntToScalar(1 << 14);
+ }
+
+- if (isLCD(*rec)) {
+- // TODO: re-work so that FreeType is set-up and selected by the SkFontMgr.
+- SkAutoMutexAcquire ama(gFTMutex);
+- ref_ft_library();
+- if (!gFTLibrary->isLCDSupported()) {
+- // If the runtime Freetype library doesn't support LCD, disable it here.
+- rec->fMaskFormat = SkMask::kA8_Format;
+- }
+- unref_ft_library();
+- }
+-
+ SkPaint::Hinting h = rec->getHinting();
+ if (SkPaint::kFull_Hinting == h && !isLCD(*rec)) {
+ // collapse full->normal hinting if we're not doing LCD
+@@ -1115,11 +1092,11 @@
+ void SkScalerContext_FreeType::updateGlyphIfLCD(SkGlyph* glyph) {
+ if (isLCD(fRec)) {
+ if (fLCDIsVert) {
+- glyph->fHeight += gFTLibrary->lcdExtra();
+- glyph->fTop -= gFTLibrary->lcdExtra() >> 1;
++ glyph->fHeight += 2;
++ glyph->fTop -= 1;
+ } else {
+- glyph->fWidth += gFTLibrary->lcdExtra();
+- glyph->fLeft -= gFTLibrary->lcdExtra() >> 1;
++ glyph->fWidth += 2;
++ glyph->fLeft -= 1;
+ }
+ }
+ }
diff --git a/chromium-system-icu.patch b/chromium-system-icu.patch
new file mode 100644
index 000000000000..89a7b0037820
--- /dev/null
+++ b/chromium-system-icu.patch
@@ -0,0 +1,19 @@
+diff --git a/third_party/blink/renderer/platform/text/character_property_data_generator.h b/third_party/blink/renderer/platform/text/character_property_data_generator.h
+index 28fb6a9..bb4dbd7 100644
+--- a/third_party/blink/renderer/platform/text/character_property_data_generator.h
++++ b/third_party/blink/renderer/platform/text/character_property_data_generator.h
+@@ -244,10 +244,12 @@ static const UChar32 kIsHangulRanges[] = {
+ 0xD7B0, 0xD7FF,
+ // Halfwidth Hangul Jamo
+ // https://www.unicode.org/charts/nameslist/c_FF00.html
+- 0xFFA0, 0xFFDC,
++ 0xFFA0, 0xFFDB,
+ };
+
+-static const UChar32 kIsHangulArray[] = {};
++static const UChar32 kIsHangulArray[] = {
++ 0xFFDC,
++};
+
+ } // namespace blink
+
diff --git a/default_app-icon.patch b/default_app-icon.patch
new file mode 100644
index 000000000000..c7894429972e
--- /dev/null
+++ b/default_app-icon.patch
@@ -0,0 +1,21 @@
+--- a/electron/default_app/default_app.js
++++ b/electron/default_app/default_app.js
+@@ -27,7 +27,7 @@
+ }
+
+ if (process.platform === 'linux') {
+- options.icon = path.join(__dirname, 'icon.png')
++ options.icon = '/usr/share/pixmaps/electron.png'
+ }
+
+ mainWindow = new BrowserWindow(options)
+--- a/electron/filenames.gni
++++ b/electron/filenames.gni
+@@ -95,7 +95,6 @@
+
+ default_app_sources = [
+ "default_app/default_app.js",
+- "default_app/icon.png",
+ "default_app/index.html",
+ "default_app/main.js",
+ "default_app/menu.js",
diff --git a/electron4.desktop b/electron4.desktop
new file mode 100644
index 000000000000..b62648a8663d
--- /dev/null
+++ b/electron4.desktop
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Type=Application
+Name=Electron 4
+Icon=electron4
+Exec=electron4 %u
+Categories=Development;GTK;
+StartupNotify=true
diff --git a/fix-cfi-icall-failure-with-use_system_libjpeg-true.patch b/fix-cfi-icall-failure-with-use_system_libjpeg-true.patch
new file mode 100644
index 000000000000..3c27898ed2e1
--- /dev/null
+++ b/fix-cfi-icall-failure-with-use_system_libjpeg-true.patch
@@ -0,0 +1,52 @@
+From db82db1b609f30d144d45477f55697818bcd363c Mon Sep 17 00:00:00 2001
+From: Vlad Tsyrklevich <vtsyrklevich@chromium.org>
+Date: Tue, 31 Jul 2018 01:03:22 +0000
+Subject: [PATCH] Fix cfi-icall failure with use_system_libjpeg=true
+
+JPEGImageReader::AllocateSampleArray() can call the function pointer
+(*info_.mem->alloc_sarray) which can be set by the systems non-CFI
+enabled libjpeg DSO when chromium is built with use_system_libjpeg=true.
+Disable cfi-icall for that method.
+
+Bug: 866290
+Change-Id: I6d9bbf08c514d6d5f48ad34c3802c63419ed1223
+Reviewed-on: https://chromium-review.googlesource.com/1155927
+Reviewed-by: Kentaro Hara <haraken@chromium.org>
+Commit-Queue: Vlad Tsyrklevich <vtsyrklevich@chromium.org>
+Cr-Commit-Position: refs/heads/master@{#579270}
+---
+ .../renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc | 2 +-
+ third_party/blink/renderer/platform/wtf/compiler.h | 2 ++
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc b/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc
+index a1e440f6eed5..fd4e72ba053c 100644
+--- a/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc
++++ b/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc
+@@ -643,7 +643,7 @@ class JPEGImageReader final {
+ IntSize UvSize() const { return uv_size_; }
+
+ private:
+- JSAMPARRAY AllocateSampleArray() {
++ NO_SANITIZE_CFI_ICALL JSAMPARRAY AllocateSampleArray() {
+ // Some output color spaces don't need the sample array: don't allocate in that
+ // case.
+ #if defined(TURBO_JPEG_RGB_SWIZZLE)
+diff --git a/third_party/blink/renderer/platform/wtf/compiler.h b/third_party/blink/renderer/platform/wtf/compiler.h
+index 51595afdc955..5225a70309d6 100644
+--- a/third_party/blink/renderer/platform/wtf/compiler.h
++++ b/third_party/blink/renderer/platform/wtf/compiler.h
+@@ -57,8 +57,10 @@
+ #if defined(__clang__)
+ #define NO_SANITIZE_UNRELATED_CAST \
+ __attribute__((no_sanitize("cfi-unrelated-cast", "vptr")))
++#define NO_SANITIZE_CFI_ICALL __attribute__((no_sanitize("cfi-icall")))
+ #else
+ #define NO_SANITIZE_UNRELATED_CAST
++#define NO_SANITIZE_CFI_ICALL
+ #endif
+
+ #endif /* WTF_Compiler_h */
+--
+2.18.0
+
diff --git a/only-disable-cfi-icall-when-use_system_libjpeg-true.patch b/only-disable-cfi-icall-when-use_system_libjpeg-true.patch
new file mode 100644
index 000000000000..3a71f8c05719
--- /dev/null
+++ b/only-disable-cfi-icall-when-use_system_libjpeg-true.patch
@@ -0,0 +1,34 @@
+From 20f81a066ffdf6bd30fb4b696b8b3e101368e2f6 Mon Sep 17 00:00:00 2001
+From: Vlad Tsyrklevich <vtsyrklevich@chromium.org>
+Date: Tue, 31 Jul 2018 23:21:09 +0000
+Subject: [PATCH] Only disable cfi-icall when use_system_libjpeg=true
+
+Bug: 866290
+Change-Id: Ic5d175b3b854665f50781650406d599d09ee9849
+Reviewed-on: https://chromium-review.googlesource.com/1157136
+Reviewed-by: Kentaro Hara <haraken@chromium.org>
+Commit-Queue: Vlad Tsyrklevich <vtsyrklevich@chromium.org>
+Cr-Commit-Position: refs/heads/master@{#579614}
+---
+ .../platform/image-decoders/jpeg/jpeg_image_decoder.cc | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc b/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc
+index fd4e72ba053c..afa90d83efee 100644
+--- a/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc
++++ b/third_party/blink/renderer/platform/image-decoders/jpeg/jpeg_image_decoder.cc
+@@ -643,7 +643,10 @@ class JPEGImageReader final {
+ IntSize UvSize() const { return uv_size_; }
+
+ private:
+- NO_SANITIZE_CFI_ICALL JSAMPARRAY AllocateSampleArray() {
++#if defined(USE_SYSTEM_LIBJPEG)
++ NO_SANITIZE_CFI_ICALL
++#endif
++ JSAMPARRAY AllocateSampleArray() {
+ // Some output color spaces don't need the sample array: don't allocate in that
+ // case.
+ #if defined(TURBO_JPEG_RGB_SWIZZLE)
+--
+2.18.0
+
diff --git a/use-system-libraries-in-node.patch b/use-system-libraries-in-node.patch
new file mode 100644
index 000000000000..7e32a4e65a0f
--- /dev/null
+++ b/use-system-libraries-in-node.patch
@@ -0,0 +1,54 @@
+--- a/third_party/electron_node/BUILD.gn
++++ b/third_party/electron_node/BUILD.gn
+@@ -42,6 +42,18 @@
+ node_release_urlbase = ""
+ }
+
++if (is_linux) {
++ import("//build/config/linux/pkg_config.gni")
++
++ pkg_config("cares") {
++ packages = [ "libcares" ]
++ }
++
++ pkg_config("nghttp2") {
++ packages = [ "libnghttp2" ]
++ }
++}
++
+ assert(!node_use_dtrace, "node_use_dtrace not supported in GN")
+ assert(!node_use_etw, "node_use_etw not supported in GN")
+ assert(!node_use_perfctr, "node_use_perfctr not supported in GN")
+@@ -128,10 +140,6 @@
+ component("node_lib") {
+ deps = [
+ ":node_js2c",
+- "deps/cares",
+- "deps/http_parser",
+- "deps/nghttp2",
+- "deps/zlib",
+ "//v8:v8_libplatform",
+ ]
+ public_deps = [
+@@ -141,6 +149,21 @@
+ public_configs = [ ":node_lib_config" ]
+ include_dirs = [ "src" ]
+ libs = []
++ if (is_linux) {
++ configs += [
++ ":cares",
++ ":nghttp2",
++ ]
++ deps += [ "//third_party/zlib" ]
++ libs += [ "http_parser" ]
++ } else {
++ deps += [
++ "deps/cares",
++ "deps/http_parser",
++ "deps/nghttp2",
++ "deps/zlib",
++ ]
++ }
+ cflags_cc = [
+ "-Wno-deprecated-declarations",
+ "-Wno-implicit-fallthrough",