diff --git a/electron24/electron24-deps-parser.py b/electron24/electron24-deps-parser.py index b040f9b55..3a46b14e0 100644 --- a/electron24/electron24-deps-parser.py +++ b/electron24/electron24-deps-parser.py @@ -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) diff --git a/electron24/electron24-riscv-base.patch b/electron24/electron24-riscv-base.patch new file mode 100644 index 000000000..8cb26e364 --- /dev/null +++ b/electron24/electron24-riscv-base.patch @@ -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 diff --git a/electron24/electron24-swiftshader-llvm-15.patch b/electron24/electron24-swiftshader-llvm-15.patch deleted file mode 100644 index a0ad63243..000000000 --- a/electron24/electron24-swiftshader-llvm-15.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- third_party/swiftshader/src/Reactor/LLVMJIT.cpp.orig 2023-08-02 16:08:02.766446876 +0200 -+++ third_party/swiftshader/src/Reactor/LLVMJIT.cpp 2023-08-02 16:19:42.081633379 +0200 -@@ -922,7 +922,7 @@ - - if(optimizationLevel > 0) - { -- fpm.addPass(llvm::SROAPass(llvm::SROAOptions::PreserveCFG)); -+ fpm.addPass(llvm::SROAPass()); - fpm.addPass(llvm::InstCombinePass()); - } - diff --git a/electron24/riscv64.patch b/electron24/riscv64.patch index 28df13c50..104cdc083 100644 --- a/electron24/riscv64.patch +++ b/electron24/riscv64.patch @@ -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%%.*} @@ -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" @@ -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 @@ -97,7 +107,7 @@ ( 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 @@ -105,6 +115,7 @@ + + # 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 @@ -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__=' @@ -132,7 +142,7 @@ # 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 @@ -140,7 +150,7 @@ 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