summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Playfair Cal2020-01-13 03:12:22 +1100
committerDaniel Playfair Cal2020-01-13 03:12:22 +1100
commit5d5bfbcbb761c80ee7a5c891ef40ef2aa7aec0ec (patch)
treef6f8f9af0faf4b9d5bcfbbbd36dd968c8f66da72
downloadaur-5d5bfbcbb761c80ee7a5c891ef40ef2aa7aec0ec.tar.gz
electron-ozone 7.1.8-1
-rw-r--r--.SRCINFO64
-rw-r--r--PKGBUILD225
-rw-r--r--chromium-skia-harmony.patch14
-rw-r--r--chromium-system-icu.patch20
-rw-r--r--chromium-system-zlib.patch13
-rw-r--r--default_app-icon.patch21
-rw-r--r--electron.desktop7
-rw-r--r--icu65.patch64
-rw-r--r--use-system-libraries-in-node.patch56
9 files changed, 484 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..55e2d824b4d6
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,64 @@
+pkgbase = electron-ozone
+ pkgdesc = Electron compiled with wayland support via Ozone
+ pkgver = 7.1.8
+ 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 = java-runtime-headless
+ makedepends = jsoncpp
+ makedepends = libnotify
+ makedepends = lld
+ makedepends = llvm
+ makedepends = ninja
+ makedepends = npm
+ makedepends = pciutils
+ makedepends = yarn
+ 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 = libappindicator-gtk3: StatusNotifierItem support
+ optdepends = trash-cli: file deletion support (trash-put)
+ optdepends = xdg-utils: open URLs with desktop's default (xdg-email, xdg-open)
+ provides = electron
+ conflicts = electron
+ source = git+https://github.com/hedgepigdaniel/electron.git#branch=arch7.1.8-1
+ source = git+https://chromium.googlesource.com/chromium/tools/depot_tools.git
+ source = electron.desktop
+ source = default_app-icon.patch
+ source = use-system-libraries-in-node.patch
+ source = chromium-skia-harmony.patch
+ source = icu65.patch
+ source = chromium-system-icu.patch
+ source = chromium-system-zlib.patch
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = 5270db01f3f8aaa5137dec275a02caa832b7f2e37942e068cba8d28b3a29df39
+ sha256sums = 51d6e4239b51084a1e9df87ed4d94dcaa22f8d4f332e941eb56fe71b834e9a7a
+ sha256sums = c7eadac877179e586d0cce7f898aa1462b4c207733e68ecc17de9754b691713a
+ sha256sums = 771292942c0901092a402cc60ee883877a99fb804cb54d568c8c6c94565a48e1
+ sha256sums = 1de9bdbfed482295dda45c7d4e323cee55a34e42f66b892da1c1a778682b7a41
+ sha256sums = e73cc2ee8d3ea35aab18c478d76fdfc68ca4463e1e10306fa1e738c03b3f26b5
+ sha256sums = eb67eda4945a89c3b90473fa8dc20637511ca4dcb58879a8ed6bf403700ca9c8
+
+pkgname = electron-ozone
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..e5af4faa4853
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,225 @@
+# Maintainer: Nicola Squartini <tensor5@gmail.com>
+
+pkgname=electron-ozone
+pkgver=7.1.8
+provides=('electron')
+conflicts=('electron')
+_commit=30a94ac944127293d3fd54ede2e3882a871ea8ec
+_chromiumver=78.0.3904.130
+pkgrel=1
+pkgdesc='Electron compiled with wayland support via Ozone'
+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' 'java-runtime-headless'
+ 'jsoncpp' 'libnotify' 'lld' 'llvm' 'ninja' 'npm' 'pciutils' 'yarn'
+ 'python2' 'wget' 'yasm')
+optdepends=('kde-cli-tools: file deletion support (kioclient5)'
+ 'libappindicator-gtk3: StatusNotifierItem support'
+ 'trash-cli: file deletion support (trash-put)'
+ "xdg-utils: open URLs with desktop's default (xdg-email, xdg-open)")
+source=('git+https://github.com/hedgepigdaniel/electron.git#branch=arch7.1.8-1'
+ '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'
+ 'icu65.patch'
+ 'chromium-system-icu.patch'
+ 'chromium-system-zlib.patch'
+ )
+sha256sums=('SKIP'
+ 'SKIP'
+ '5270db01f3f8aaa5137dec275a02caa832b7f2e37942e068cba8d28b3a29df39'
+ '51d6e4239b51084a1e9df87ed4d94dcaa22f8d4f332e941eb56fe71b834e9a7a'
+ 'c7eadac877179e586d0cce7f898aa1462b4c207733e68ecc17de9754b691713a'
+ '771292942c0901092a402cc60ee883877a99fb804cb54d568c8c6c94565a48e1'
+ '1de9bdbfed482295dda45c7d4e323cee55a34e42f66b892da1c1a778682b7a41'
+ 'e73cc2ee8d3ea35aab18c478d76fdfc68ca4463e1e10306fa1e738c03b3f26b5'
+ 'eb67eda4945a89c3b90473fa8dc20637511ca4dcb58879a8ed6bf403700ca9c8')
+
+_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/tools/download_cros_provided_profile.py \
+ --newest_state=src/chrome/android/profiles/newest.txt \
+ --local_state=src/chrome/android/profiles/local.txt \
+ --output_name=src/chrome/android/profiles/afdo.prof \
+ --gs_url_base=chromeos-prebuilt/afdo-job/llvm
+ python2 src/electron/script/apply_all_patches.py \
+ src/electron/patches/config.json
+ cd src/electron
+ yarn install --frozen-lockfile
+ 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 -Np0 -i ../chromium-skia-harmony.patch
+ patch -Np1 -i ../icu65.patch
+ patch -Np1 -i ../chromium-system-icu.patch
+ patch -Np1 -i ../chromium-system-zlib.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
+
+ # Do not warn about unknown warning options
+ CFLAGS+=' -Wno-unknown-warning-option'
+ CXXFLAGS+=' -Wno-unknown-warning-option'
+
+ cd src
+ export CHROMIUM_BUILDTOOLS_PATH="${PWD}/buildtools"
+ local _flags=(
+ 'blink_symbol_level = 0'
+ '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'
+ 'treat_warnings_as_errors = false'
+ 'use_custom_libcxx = false'
+ 'use_gnome_keyring = false'
+ 'use_sysroot = false'
+ 'use_ozone = true'
+ 'ozone_auto_platforms = false'
+ 'ozone_platform_wayland = true'
+ 'ozone_platform_x11 = true'
+ 'use_xkbcommon = true'
+ 'use_system_libwayland = true'
+ 'use_system_minigbm = true'
+ 'use_system_libdrm = true'
+ 'use_glib = true'
+ )
+
+ if check_buildoption ccache y; then
+ # Avoid falling back to preprocessor mode when sources contain time macros
+ export CCACHE_SLOPPINESS=time_macros
+ _flags+=('cc_wrapper="ccache"')
+ fi
+
+ if check_option strip y; then
+ _flags+=('symbol_level=0')
+ else
+ _flags+=('symbol_level=1')
+ fi
+
+ gn gen out/Release \
+ --args="import(\"//electron/build/args/release.gn\") ${_flags[*]}"
+ ninja -C out/Release electron
+ # Strip before zip to avoid
+ # zipfile.LargeZipFile: Filesize would require ZIP64 extensions
+ strip -s out/Release/electron
+ 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"
+
+ chmod u+s "${pkgdir}/usr/lib/electron/chrome-sandbox"
+
+ 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
+}
diff --git a/chromium-skia-harmony.patch b/chromium-skia-harmony.patch
new file mode 100644
index 000000000000..c96d07e11489
--- /dev/null
+++ b/chromium-skia-harmony.patch
@@ -0,0 +1,14 @@
+--- third_party/skia/src/ports/SkFontHost_FreeType.cpp.orig 2019-07-19 11:08:34.770972665 +0000
++++ third_party/skia/src/ports/SkFontHost_FreeType.cpp 2019-07-19 11:08:44.274442065 +0000
+@@ -128,9 +128,9 @@ public:
+ : fGetVarDesignCoordinates(nullptr)
+ , fGetVarAxisFlags(nullptr)
+ , fLibrary(nullptr)
+- , fIsLCDSupported(false)
++ , fIsLCDSupported(true)
+ , fLightHintingIsYOnly(false)
+- , fLCDExtra(0)
++ , fLCDExtra(2)
+ {
+ if (FT_New_Library(&gFTMemory, &fLibrary)) {
+ return;
diff --git a/chromium-system-icu.patch b/chromium-system-icu.patch
new file mode 100644
index 000000000000..1f848d7ee2be
--- /dev/null
+++ b/chromium-system-icu.patch
@@ -0,0 +1,20 @@
+diff --git a/build/linux/unbundle/icu.gn b/build/linux/unbundle/icu.gn
+index 4450e40..9ca36dd 100644
+--- a/build/linux/unbundle/icu.gn
++++ b/build/linux/unbundle/icu.gn
+@@ -96,6 +96,7 @@ shim_headers("icui18n_shim") {
+ "unicode/fpositer.h",
+ "unicode/gender.h",
+ "unicode/gregocal.h",
++ "unicode/listformatter.h",
+ "unicode/measfmt.h",
+ "unicode/measunit.h",
+ "unicode/measure.h",
+@@ -178,7 +179,6 @@ shim_headers("icuuc_shim") {
+ "unicode/icudataver.h",
+ "unicode/icuplug.h",
+ "unicode/idna.h",
+- "unicode/listformatter.h",
+ "unicode/localpointer.h",
+ "unicode/locdspnm.h",
+ "unicode/locid.h",
diff --git a/chromium-system-zlib.patch b/chromium-system-zlib.patch
new file mode 100644
index 000000000000..951a2adb196a
--- /dev/null
+++ b/chromium-system-zlib.patch
@@ -0,0 +1,13 @@
+diff --git a/third_party/perfetto/gn/BUILD.gn b/third_party/perfetto/gn/BUILD.gn
+index 3bc618a..e0ddf6d 100644
+--- a/third_party/perfetto/gn/BUILD.gn
++++ b/third_party/perfetto/gn/BUILD.gn
+@@ -244,7 +244,7 @@ if (enable_perfetto_trace_processor || perfetto_build_standalone ||
+ "//buildtools:zlib",
+ ]
+ } else {
+- public_configs = [ "//third_party/zlib:zlib_config" ]
++ public_configs = [ "//third_party/zlib:system_zlib" ]
+ public_deps = [
+ "//third_party/zlib",
+ ]
diff --git a/default_app-icon.patch b/default_app-icon.patch
new file mode 100644
index 000000000000..33ee87ff9540
--- /dev/null
+++ b/default_app-icon.patch
@@ -0,0 +1,21 @@
+--- a/electron/default_app/default_app.ts
++++ b/electron/default_app/default_app.ts
+@@ -60,7 +60,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
+@@ -6,7 +6,6 @@
+ ]
+
+ default_app_static_sources = [
+- "default_app/icon.png",
+ "default_app/index.html",
+ "default_app/package.json",
+ "default_app/styles.css",
diff --git a/electron.desktop b/electron.desktop
new file mode 100644
index 000000000000..e29e4d6ce9a7
--- /dev/null
+++ b/electron.desktop
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Type=Application
+Name=Electron
+Icon=electron
+Exec=electron %u
+Categories=Development;GTK;
+StartupNotify=true
diff --git a/icu65.patch b/icu65.patch
new file mode 100644
index 000000000000..811d56286a98
--- /dev/null
+++ b/icu65.patch
@@ -0,0 +1,64 @@
+From 5679c3c191ed62b62d8db22f1657a296ee9bfe8e Mon Sep 17 00:00:00 2001
+From: Frank Tang <ftang@chromium.org>
+Date: Wed, 30 Oct 2019 22:49:47 +0000
+Subject: [PATCH] Update ICU to 65.1 from 64 and fix broken tests
+
+ICU 65-1 release note
+http://site.icu-project.org/download/65
+
+CLDR 36 release blog
+http://blog.unicode.org/2019/10/unicode-cldr-version-36-languagelocale.html
+
+Most of the test expectation change is due to CLDR 36 update
+of Grapheme Cluster for Indic languages
+See the following for related changes in ICU 65.1 in this area:
+https://unicode-org.atlassian.net/browse/CLDR-10994
+https://unicode-org.atlassian.net/browse/ICU-13637
+https://github.com/unicode-org/cldr/blob/master/common/properties/segments/readme.txt
+
+Bug: chromium:1014272, chromium:1017047
+Change-Id: I9fc6d4620bf2a4c189940d06d8c79893502db3dd
+Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng_disabled
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1866059
+Reviewed-by: Jungshik Shin <jshin@chromium.org>
+Reviewed-by: Doug Turner <dougt@chromium.org>
+Reviewed-by: Michael Wasserman <msw@chromium.org>
+Reviewed-by: Kent Tamura <tkent@chromium.org>
+Reviewed-by: Trent Apted <tapted@chromium.org>
+Reviewed-by: Mason Freed <masonfreed@chromium.org>
+Commit-Queue: Frank Tang <ftang@chromium.org>
+Cr-Commit-Position: refs/heads/master@{#711027}
+---
+ third_party/blink/renderer/core/dom/document.cc | 2 +-
+ ui/gfx/render_text_harfbuzz.cc | 5 ++++-
+ 2 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc
+index 511aac29086..f188cf548a6 100644
+--- a/third_party/blink/renderer/core/dom/document.cc
++++ b/third_party/blink/renderer/core/dom/document.cc
+@@ -6191,7 +6191,7 @@ static ParseQualifiedNameResult ParseQualifiedNameInternal(
+
+ for (unsigned i = 0; i < length;) {
+ UChar32 c;
+- U16_NEXT(characters, i, length, c)
++ U16_NEXT(characters, i, length, c);
+ if (c == ':') {
+ if (saw_colon)
+ return ParseQualifiedNameResult(kQNMultipleColons);
+diff --git a/ui/gfx/render_text_harfbuzz.cc b/ui/gfx/render_text_harfbuzz.cc
+index 50e86af6b97..0339ff3ff8e 100644
+--- a/ui/gfx/render_text_harfbuzz.cc
++++ b/ui/gfx/render_text_harfbuzz.cc
+@@ -971,7 +971,10 @@ RangeF TextRunHarfBuzz::GetGraphemeBounds(RenderTextHarfBuzz* render_text,
+ ++total;
+ }
+ }
+- DCHECK_GT(total, 0);
++ // With ICU 65.1, DCHECK_GT() below fails.
++ // See https://crbug.com/1017047 for more details.
++ //
++ // DCHECK_GT(total, 0);
+
+ // It's possible for |text_index| to point to a diacritical mark, at the end
+ // of |chars|. In this case all the grapheme boundaries come before it. Just
diff --git a/use-system-libraries-in-node.patch b/use-system-libraries-in-node.patch
new file mode 100644
index 000000000000..660c89ea2390
--- /dev/null
+++ b/use-system-libraries-in-node.patch
@@ -0,0 +1,56 @@
+--- a/third_party/electron_node/BUILD.gn
++++ b/third_party/electron_node/BUILD.gn
+@@ -42,6 +42,18 @@
+ node_module_version = ""
+ }
+
++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")
+
+@@ -203,12 +215,8 @@
+ component("node_lib") {
+ deps = [
+ ":node_js2c",
+- "deps/cares",
+ "deps/histogram",
+- "deps/http_parser",
+ "deps/llhttp",
+- "deps/nghttp2",
+- "deps/zlib",
+ "//third_party/brotli:dec",
+ "//third_party/brotli:enc",
+ "//v8:v8_libplatform",
+@@ -222,6 +230,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",