Date: Tuesday, March 19, 2019 @ 07:01:47 Author: tensor5 Revision: 442581
archrelease: copy trunk to community-staging-x86_64 Added: electron/repos/community-staging-x86_64/ electron/repos/community-staging-x86_64/PKGBUILD (from rev 442580, electron/trunk/PKGBUILD) electron/repos/community-staging-x86_64/chromium-skia-harmony.patch (from rev 442580, electron/trunk/chromium-skia-harmony.patch) electron/repos/community-staging-x86_64/chromium-system-icu.patch (from rev 442580, electron/trunk/chromium-system-icu.patch) electron/repos/community-staging-x86_64/default_app-icon.patch (from rev 442580, electron/trunk/default_app-icon.patch) electron/repos/community-staging-x86_64/electron.desktop (from rev 442580, electron/trunk/electron.desktop) electron/repos/community-staging-x86_64/fix-cfi-icall-failure-with-use_system_libjpeg-true.patch (from rev 442580, electron/trunk/fix-cfi-icall-failure-with-use_system_libjpeg-true.patch) electron/repos/community-staging-x86_64/only-disable-cfi-icall-when-use_system_libjpeg-true.patch (from rev 442580, electron/trunk/only-disable-cfi-icall-when-use_system_libjpeg-true.patch) electron/repos/community-staging-x86_64/use-system-libraries-in-node.patch (from rev 442580, electron/trunk/use-system-libraries-in-node.patch) -----------------------------------------------------------+ PKGBUILD | 176 ++++++++++++ chromium-skia-harmony.patch | 77 +++++ chromium-system-icu.patch | 19 + default_app-icon.patch | 21 + electron.desktop | 7 fix-cfi-icall-failure-with-use_system_libjpeg-true.patch | 52 +++ only-disable-cfi-icall-when-use_system_libjpeg-true.patch | 34 ++ use-system-libraries-in-node.patch | 54 +++ 8 files changed, 440 insertions(+) Copied: electron/repos/community-staging-x86_64/PKGBUILD (from rev 442580, electron/trunk/PKGBUILD) =================================================================== --- community-staging-x86_64/PKGBUILD (rev 0) +++ community-staging-x86_64/PKGBUILD 2019-03-19 07:01:47 UTC (rev 442581) @@ -0,0 +1,176 @@ +# Maintainer: Nicola Squartini <tens...@gmail.com> + +_commit=6c4ee661655ad75f315d21d307b641ee8a257cdc +#_chromiumver=69.0.3497.128 +_chromiumver=69.0.3497.120 +pkgname=electron +pkgver=4.1.0 +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' + "https://commondatastorage.googleapis.com/chromium-browser-official/chromium-${_chromiumver}.tar.xz" + 'git+https://chromium.googlesource.com/chromium/tools/depot_tools.git' + 'electron.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' + '26ee15090b7ce50b96218ead2b721ce703271f1eea947027147073f4533ba321' + 'SKIP' + '5270db01f3f8aaa5137dec275a02caa832b7f2e37942e068cba8d28b3a29df39' + '2a8944ec0be45c5cf3c86558a56b704613e95718b781477a89ff0d03c5b530cd' + '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" + + mv chromium-${_chromiumver} src + + 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/electron/script/apply_all_patches.py \ + src/electron/patches/common/config.json + cd src/electron + npm install + cd .. + # Create sysmlink to system Node.js + mkdir -p third_party/node/linux/node-linux-x64/bin + ln -sf /usr/bin/node third_party/node/linux/node-linux-x64/bin + + 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/electron" + bsdtar -xf src/out/Release/dist.zip -C "${pkgdir}/usr/lib/electron" + + install -dm755 "${pkgdir}/usr/share/licenses/${pkgname}" + for l in "${pkgdir}/usr/lib/electron"/{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/electron/electron "${pkgdir}"/usr/bin + + # Install .desktop and icon file (see default_app-icon.patch) + install -Dm644 -t "${pkgdir}/usr/share/applications" electron.desktop + install -Dm644 src/electron/default_app/icon.png \ + "${pkgdir}/usr/share/pixmaps/electron.png" # hicolor has no 1024x1024 +} Copied: electron/repos/community-staging-x86_64/chromium-skia-harmony.patch (from rev 442580, electron/trunk/chromium-skia-harmony.patch) =================================================================== --- community-staging-x86_64/chromium-skia-harmony.patch (rev 0) +++ community-staging-x86_64/chromium-skia-harmony.patch 2019-03-19 07:01:47 UTC (rev 442581) @@ -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; + } + } + } Copied: electron/repos/community-staging-x86_64/chromium-system-icu.patch (from rev 442580, electron/trunk/chromium-system-icu.patch) =================================================================== --- community-staging-x86_64/chromium-system-icu.patch (rev 0) +++ community-staging-x86_64/chromium-system-icu.patch 2019-03-19 07:01:47 UTC (rev 442581) @@ -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 + Copied: electron/repos/community-staging-x86_64/default_app-icon.patch (from rev 442580, electron/trunk/default_app-icon.patch) =================================================================== --- community-staging-x86_64/default_app-icon.patch (rev 0) +++ community-staging-x86_64/default_app-icon.patch 2019-03-19 07:01:47 UTC (rev 442581) @@ -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 +@@ -94,7 +94,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", Copied: electron/repos/community-staging-x86_64/electron.desktop (from rev 442580, electron/trunk/electron.desktop) =================================================================== --- community-staging-x86_64/electron.desktop (rev 0) +++ community-staging-x86_64/electron.desktop 2019-03-19 07:01:47 UTC (rev 442581) @@ -0,0 +1,7 @@ +[Desktop Entry] +Type=Application +Name=Electron +Icon=electron +Exec=electron %u +Categories=Development;GTK; +StartupNotify=true Copied: electron/repos/community-staging-x86_64/fix-cfi-icall-failure-with-use_system_libjpeg-true.patch (from rev 442580, electron/trunk/fix-cfi-icall-failure-with-use_system_libjpeg-true.patch) =================================================================== --- community-staging-x86_64/fix-cfi-icall-failure-with-use_system_libjpeg-true.patch (rev 0) +++ community-staging-x86_64/fix-cfi-icall-failure-with-use_system_libjpeg-true.patch 2019-03-19 07:01:47 UTC (rev 442581) @@ -0,0 +1,52 @@ +From db82db1b609f30d144d45477f55697818bcd363c Mon Sep 17 00:00:00 2001 +From: Vlad Tsyrklevich <vtsyrklev...@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 <hara...@chromium.org> +Commit-Queue: Vlad Tsyrklevich <vtsyrklev...@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 + Copied: electron/repos/community-staging-x86_64/only-disable-cfi-icall-when-use_system_libjpeg-true.patch (from rev 442580, electron/trunk/only-disable-cfi-icall-when-use_system_libjpeg-true.patch) =================================================================== --- community-staging-x86_64/only-disable-cfi-icall-when-use_system_libjpeg-true.patch (rev 0) +++ community-staging-x86_64/only-disable-cfi-icall-when-use_system_libjpeg-true.patch 2019-03-19 07:01:47 UTC (rev 442581) @@ -0,0 +1,34 @@ +From 20f81a066ffdf6bd30fb4b696b8b3e101368e2f6 Mon Sep 17 00:00:00 2001 +From: Vlad Tsyrklevich <vtsyrklev...@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 <hara...@chromium.org> +Commit-Queue: Vlad Tsyrklevich <vtsyrklev...@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 + Copied: electron/repos/community-staging-x86_64/use-system-libraries-in-node.patch (from rev 442580, electron/trunk/use-system-libraries-in-node.patch) =================================================================== --- community-staging-x86_64/use-system-libraries-in-node.patch (rev 0) +++ community-staging-x86_64/use-system-libraries-in-node.patch 2019-03-19 07:01:47 UTC (rev 442581) @@ -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",