Skip to content

Commit

Permalink
upgpatch: electron24
Browse files Browse the repository at this point in the history
- Remove llvm15 hack.
- Pin depot_tools to the commit specified in DEPS file.
  I mentioned this to Arch in https://bugs.archlinux.org/task/79336,
  though it didn't catch their attention.
- Add a new patch. (From OpenSUSE)
  • Loading branch information
kxxt authored and felixonmars committed Sep 11, 2023
1 parent 3c371bf commit 5295c51
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 21 deletions.
3 changes: 3 additions & 0 deletions electron24/electron24-deps-parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
esbuild_ver_full = deps.deps["src/third_party/devtools-frontend/src/third_party/esbuild"]["packages"][0]["version"]
esbuild_ver = re.match("^(.+)\.chromium.*$", esbuild_ver_full.split("@")[-1])[1]
print(esbuild_ver)
case 'depot_tools':
depot_tools_rev = deps.deps['src/third_party/depot_tools'].split('@')[-1]
print(depot_tools_rev)
case _:
print("Unsupported arguments!", file=sys.stderr)
sys.exit(-1)
13 changes: 13 additions & 0 deletions electron24/electron24-riscv-base.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Index: src/base/system/sys_info.cc
===================================================================
--- src.orig/base/system/sys_info.cc
+++ src/base/system/sys_info.cc
@@ -131,6 +131,8 @@ std::string SysInfo::ProcessCPUArchitect
return "ARM";
#elif defined(ARCH_CPU_ARM64)
return "ARM_64";
+#elif defined(ARCH_CPU_RISCV64)
+ return "RISCV_64";
#else
return std::string();
#endif
11 changes: 0 additions & 11 deletions electron24/electron24-swiftshader-llvm-15.patch

This file was deleted.

30 changes: 20 additions & 10 deletions electron24/riscv64.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
+++ PKGBUILD
@@ -12,7 +12,9 @@ _chromiumver=112.0.5615.204
# shellcheck disable=SC2034
pkgrel=2
pkgrel=1

+_build_profile=Release
_major_ver=${pkgver%%.*}
Expand Down Expand Up @@ -31,9 +31,9 @@
+ "$_electron-riscv-sandbox.patch"
+ "$_electron-riscv-crashpad.patch"
+ "$_electron-riscv-dav1d.patch"
+ "$_electron-riscv-base.patch"
+ "$_electron-swiftshader-use-system-llvm.patch"
+ "$_electron-swiftshader-LLVMJIT-AddressSanitizerPass-dead-code-remove.patch"
+ "$_electron-swiftshader-llvm-15.patch"
+ "$_electron-gclient-ignore-prebuilt-platform-specific-deps.patch"
+ "$_electron-deps-parser.py"
+ "$_electron-partition_alloc.gni-add-missing-riscv64-definition.patch"
Expand All @@ -53,16 +53,26 @@
+ '1816d36eb6a17cd10ec310d2f81aac94b3fb27ad715e172e2c754e027dcf991d'
+ '85644fd6b1a64e7cf76f690f1427010cdf773938987f7e1a93b2977873707a4f'
+ '32811636eecd187dd386bbdd0fa1216728d6010f96fae8f1714dded04a95a5f4'
+ 'aab631f5b6ea316b08bd290b52f60ed7715fceabd5c8de67535271fbbe2ae794'
+ 'd901e905a9b4303e6334bf39475bcbcdf22959796954de66507857108d53570f'
+ 'cf80c0d70f8933a4495c71d7be681c1457a69d26e95d2ad41da4bb02b7cbee4c'
+ '89db820524e8d524c86461ee4fa08433d361f40b42f1b5c488ebdaa0e0491990'
+ 'b28b64181c46549e94e8c26d5401b0036991c18c60040c444a262484addd0d0d'
+ 'cb8c2d8d620f95053e5de17b2234099b56c8ae6fa5868a38dbb0dbaf322e19a5'
+ '4b04b17c997b0f22b4d9ea1940809fbc29dea230c14643cf97a65a4e154bcb3a'
+ 'a3c65ced08a4b8975036b7b5f17aba21352af785a278066049c8417a9d85fc10')

# Possible replacements are listed in build/linux/unbundle/replace_gn_files.py
# Keys are the names in the above script; values are the dependencies in Arch
@@ -168,11 +197,34 @@ EOF
@@ -162,17 +191,44 @@ solutions = [
]
EOF

+ # Pin depot_tools
+ local _depot_tools_rev="$(python "$_electron-deps-parser.py" depot_tools chromium-mirror/DEPS)"
+ git -C depot_tools checkout $_depot_tools_rev
+
export PATH+=":$PWD/depot_tools" DEPOT_TOOLS_UPDATE=0
export VPYTHON_BYPASS='manually managed python not supported by chrome operations'

echo "Linking chromium from sources..."
ln -s chromium-mirror src

Expand Down Expand Up @@ -97,14 +107,15 @@
(
cd src/electron || exit
patch -Np1 -i ../../std-vector-non-const.patch
@@ -232,6 +284,23 @@ EOF
@@ -232,6 +288,23 @@ EOF
patch -Np1 -i "${srcdir}/use-system-libraries-in-node.patch"
patch -Np1 -i "${srcdir}/default_app-icon.patch" # Icon from .desktop file

+ patch -Rp1 -i ../REVERT-problematic-signal-handling-workaround.patch
+
+ # RISC-V Patches
+ patch -Np1 -d third_party/crashpad/crashpad < "${srcdir}/$_electron-riscv-crashpad.patch"
+ patch -Np1 -i ../$_electron-riscv-base.patch
+ patch -Np1 -i ../$_electron-riscv-angle.patch
+ patch -Np1 -i ../$_electron-riscv-sandbox.patch
+ patch -Np1 -i ../$_electron-riscv-dav1d.patch
Expand All @@ -115,13 +126,12 @@
+ # Build failes with the bundled LLVM 10.
+ patch -Np1 -i ../$_electron-swiftshader-use-system-llvm.patch
+ patch -Np1 -i ../$_electron-swiftshader-LLVMJIT-AddressSanitizerPass-dead-code-remove.patch
+ patch -Np0 -i ../$_electron-swiftshader-llvm-15.patch
+
+
# Allow building against system libraries in official builds
echo "Patching Chromium for using system libraries..."
sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \
@@ -268,6 +337,10 @@ build() {
@@ -268,6 +341,10 @@ build() {
CXXFLAGS+=' -Wno-builtin-macro-redefined'
CPPFLAGS+=' -D__DATE__= -D__TIME__= -D__TIMESTAMP__='

Expand All @@ -132,15 +142,15 @@
# Let Chromium set its own symbol level
CFLAGS=${CFLAGS/-g }
CXXFLAGS=${CXXFLAGS/-g }
@@ -297,7 +370,6 @@ build() {
@@ -297,7 +374,6 @@ build() {
host_toolchain = "//build/toolchain/linux/unbundle:default"
clang_base_path = "/usr"
clang_use_chrome_plugins = false
- symbol_level = 0 # sufficient for backtraces on x86(_64)
chrome_pgo_phase = 0
treat_warnings_as_errors = false
disable_fieldtrial_testing_config = true
@@ -311,17 +383,18 @@ build() {
@@ -311,17 +387,18 @@ build() {
use_system_libffi = true
icu_use_data_file = false
is_component_ffmpeg = false
Expand Down

0 comments on commit 5295c51

Please sign in to comment.