Skip to content

Commit

Permalink
Update patches for electron31(chromium 126, node 20)
Browse files Browse the repository at this point in the history
  • Loading branch information
kxxt committed Jun 11, 2024
1 parent c7231f8 commit c8e556a
Show file tree
Hide file tree
Showing 13 changed files with 1,727 additions and 870 deletions.
2 changes: 1 addition & 1 deletion patches/chromium/.patches
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
0001-clang-add-riscv64-support-to-package-script.patch
0001-rust-toolchain-fix-float-target-abi-for-riscv64.patch
0001-extensions-common-api-runtime.json-riscv64-support.patch
0002-Add-support-for-riscv64-linux.patch
0004-installer-add-riscv64-support.patch
0005-Fix-Rust-target-triple-for-riscv64.patch
0006-abseil-cpp-fix-signedness-conversion.patch
0007-clang-toolchain-riscv64-support.patch
0008-sysroot-riscv64-support.patch
0001-media-ffmpeg-add-riscv64-support.patch
build_gn.patch
accelerator.patch
blink_file_path.patch
Expand Down
74 changes: 74 additions & 0 deletions patches/chromium/0001-media-ffmpeg-add-riscv64-support.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
From 8c1cb3b1cc25d522fbbb22a4e4f3346361bfe744 Mon Sep 17 00:00:00 2001
From: Levi Zim <rsworktech@outlook.com>
Date: Tue, 11 Jun 2024 04:14:28 +0200
Subject: [PATCH] media/ffmpeg: add riscv64 support

---
media/ffmpeg/scripts/build_ffmpeg.py | 16 +++++++++++++++-
media/ffmpeg/scripts/generate_gn.py | 2 +-
media/ffmpeg/scripts/robo_lib/config.py | 2 +-
3 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/media/ffmpeg/scripts/build_ffmpeg.py b/media/ffmpeg/scripts/build_ffmpeg.py
index 75589ce6a2181..548dd13a22be7 100755
--- a/media/ffmpeg/scripts/build_ffmpeg.py
+++ b/media/ffmpeg/scripts/build_ffmpeg.py
@@ -43,7 +43,7 @@ BRANDINGS = [

ARCH_MAP = {
'android': ['ia32', 'x64', 'arm-neon', 'arm64'],
- 'linux': ['ia32', 'x64', 'noasm-x64', 'arm', 'arm-neon', 'arm64'],
+ 'linux': ['ia32', 'x64', 'noasm-x64', 'arm', 'arm-neon', 'arm64', 'riscv64'],
'mac': ['x64', 'arm64'],
'win': ['ia32', 'x64', 'arm64'],
}
@@ -898,6 +898,20 @@ def ConfigureAndBuild(target_arch, target_os, host_os, host_arch,
'--extra-cflags=--target=mips64el-linux-gnuabi64',
'--extra-ldflags=--target=mips64el-linux-gnuabi64',
])
+ elif target_arch == "riscv64":
+ configure_flags['Common'].extend([
+ '--arch=riscv64',
+ '--extra-cflags=-march=rv64gc',
+ ])
+ if target_os == 'linux':
+ configure_flags['Common'].extend([
+ '--enable-cross-compile',
+ '--target-os=linux',
+ '--sysroot=' + os.path.join(
+ CHROMIUM_ROOT_DIR, 'build/linux/debian_sid_riscv64-sysroot'),
+ '--extra-cflags=--target=riscv64-linux-gnu',
+ '--extra-ldflags=--target=riscv64-linux-gnu',
+ ])
else:
print('Error: Unknown target arch %r for target OS %r!' %
(target_arch, target_os),
diff --git a/media/ffmpeg/scripts/generate_gn.py b/media/ffmpeg/scripts/generate_gn.py
index e2d6b7ef211c7..41824671fed0c 100755
--- a/media/ffmpeg/scripts/generate_gn.py
+++ b/media/ffmpeg/scripts/generate_gn.py
@@ -80,7 +80,7 @@ GN_SOURCE_END = """]
_Attrs = ('ARCHITECTURE', 'TARGET', 'PLATFORM')
Attr = collections.namedtuple('Attr', _Attrs)(*_Attrs)
SUPPORT_MATRIX = {
- Attr.ARCHITECTURE: set(['ia32', 'x64', 'arm', 'arm64', 'arm-neon']),
+ Attr.ARCHITECTURE: set(['ia32', 'x64', 'arm', 'arm64', 'arm-neon', 'riscv64']),
Attr.TARGET: set(['Chromium', 'Chrome', 'ChromeOS']),
Attr.PLATFORM: set(['android', 'linux', 'win', 'mac'])
}
diff --git a/media/ffmpeg/scripts/robo_lib/config.py b/media/ffmpeg/scripts/robo_lib/config.py
index 84a6bf5196d95..7f0c3d0a7f221 100644
--- a/media/ffmpeg/scripts/robo_lib/config.py
+++ b/media/ffmpeg/scripts/robo_lib/config.py
@@ -204,7 +204,7 @@ class RoboConfiguration:
self._host_operating_system = "linux"

try:
- with open("/etc/lsb-release", "r") as f:
+ with open("/etc/os-release", "r") as f:
result = f.read()
if "Ubuntu" in result or "Debian" in result:
self._os_flavor = packages.OsFlavor.Debian
--
2.45.2

This file was deleted.

Loading

0 comments on commit c8e556a

Please sign in to comment.