Skip to content

Commit f2d9c79

Browse files
authored
electron-22: bump to 22.3.27 (#25)
[skip ci]
1 parent beda49c commit f2d9c79

File tree

4 files changed

+80
-19
lines changed

4 files changed

+80
-19
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--- a/build/install-build-deps.sh
2+
+++ b/build/install-build-deps.sh
3+
@@ -395,6 +395,7 @@
4+
msttcorefonts
5+
python-dev
6+
python-setuptools
7+
+ snapcraft
8+
ttf-dejavu-core
9+
ttf-indic-fonts
10+
ttf-kochi-gothic
11+
@@ -580,9 +581,6 @@
12+
if package_exists libinput-dev; then
13+
dev_list="${dev_list} libinput-dev"
14+
fi
15+
-if package_exists snapcraft; then
16+
- dev_list="${dev_list} snapcraft"
17+
-fi
18+
19+
# Cross-toolchain strip is needed for building the sysroots.
20+
if package_exists binutils-arm-linux-gnueabihf; then
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
https://github.com/chromium/chromium/commit/9f43d823b6b4cdea62f0cc7563ff01f9239b8970
2+
3+
--- a/third_party/crc32c/BUILD.gn
4+
+++ b/third_party/crc32c/BUILD.gn
5+
@@ -122,6 +122,10 @@
6+
"-target-feature",
7+
"-Xclang",
8+
"+crypto",
9+
+ "-Xclang",
10+
+ "-target-feature",
11+
+ "-Xclang",
12+
+ "+aes",
13+
]
14+
} else {
15+
cflags = [ "-march=armv8-a+crc+crypto" ]
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
https://github.com//chromium/chromium/commit/42406b91d36d32a979dad47dd8f0e1974c81c1fa
2+
3+
--- a/build/config/compiler/BUILD.gn
4+
+++ b/build/config/compiler/BUILD.gn
5+
@@ -738,6 +738,12 @@ config("compiler") {
6+
ldflags += [ "-Wl,--no-rosegment" ]
7+
}
8+
9+
+ # TODO(crbug.com/1374347): Cleanup undefined symbol errors caught by
10+
+ # --no-undefined-version.
11+
+ if (use_lld && !is_win && !is_mac && !is_ios) {
12+
+ ldflags += [ "-Wl,--undefined-version" ]
13+
+ }
14+
+
15+
# LLD does call-graph-sorted binary layout by default when profile data is
16+
# present. On Android this increases binary size due to more thinks for long
17+
# jumps. Turn it off by default and enable selectively for targets where it's

tur-electron/electron-22/build.sh

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,23 @@ TERMUX_PKG_DESCRIPTION="Build cross-platform desktop apps with JavaScript, HTML,
33
TERMUX_PKG_LICENSE="MIT, BSD 3-Clause"
44
TERMUX_PKG_MAINTAINER="Chongyun Lee <[email protected]>"
55
_CHROMIUM_VERSION=108.0.5359.215
6-
TERMUX_PKG_VERSION=22.3.18
6+
TERMUX_PKG_VERSION=22.3.27
77
TERMUX_PKG_SRCURL=git+https://github.com/electron/electron
88
TERMUX_PKG_DEPENDS="electron-deps"
99
TERMUX_PKG_BUILD_DEPENDS="libnotify, libffi-static"
1010
# Chromium doesn't support i686 on Linux.
1111
TERMUX_PKG_BLACKLISTED_ARCHES="i686"
1212

13+
__tur_setup_depot_tools() {
14+
export DEPOT_TOOLS_UPDATE=0
15+
if [ ! -f "$TERMUX_PKG_CACHEDIR/.depot_tools-fetched" ];then
16+
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git $TERMUX_PKG_CACHEDIR/depot_tools
17+
touch "$TERMUX_PKG_CACHEDIR/.depot_tools-fetched"
18+
fi
19+
export PATH="$TERMUX_PKG_CACHEDIR/depot_tools:$PATH"
20+
export CHROMIUM_BUILDTOOLS_PATH="$TERMUX_PKG_SRCDIR/buildtools"
21+
}
22+
1323
termux_step_get_source() {
1424
# Check whether we need to get source
1525
if [ -f "$TERMUX_PKG_CACHEDIR/.electron-source-fetched" ]; then
@@ -31,12 +41,7 @@ termux_step_get_source() {
3141
fi
3242

3343
# Fetch depot_tools
34-
export DEPOT_TOOLS_UPDATE=0
35-
if [ ! -f "$TERMUX_PKG_CACHEDIR/.depot_tools-fetched" ];then
36-
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git $TERMUX_PKG_CACHEDIR/depot_tools
37-
touch "$TERMUX_PKG_CACHEDIR/.depot_tools-fetched"
38-
fi
39-
export PATH="$TERMUX_PKG_CACHEDIR/depot_tools:$PATH"
44+
__tur_setup_depot_tools
4045

4146
# Install nodejs
4247
termux_setup_nodejs
@@ -66,9 +71,9 @@ termux_step_post_get_source() {
6671

6772
termux_step_configure() {
6873
cd $TERMUX_PKG_SRCDIR
69-
termux_setup_gn
7074
termux_setup_ninja
7175
termux_setup_nodejs
76+
__tur_setup_depot_tools
7277

7378
# Remove termux's dummy pkg-config
7479
local _target_pkg_config=$(command -v pkg-config)
@@ -79,8 +84,9 @@ termux_step_configure() {
7984
export PATH="$TERMUX_PKG_TMPDIR/host-pkg-config-bin:$PATH"
8085

8186
env -i PATH="$PATH" sudo apt update
82-
env -i PATH="$PATH" sudo apt install libdrm-dev libjpeg-turbo8-dev libpng-dev fontconfig libfontconfig-dev libfontconfig1-dev libfreetype6-dev zlib1g-dev libcups2-dev libxkbcommon-dev libglib2.0-dev -yq
83-
env -i PATH="$PATH" sudo apt install libdrm-dev:i386 libjpeg-turbo8-dev:i386 libpng-dev:i386 libfontconfig-dev:i386 libfontconfig1-dev:i386 libfreetype6-dev:i386 zlib1g-dev:i386 libcups2-dev:i386 libglib2.0-dev:i386 libxkbcommon-dev:i386 -yq
87+
env -i PATH="$PATH" sudo apt install lsb-release -yq
88+
env -i PATH="$PATH" sudo apt install libfontconfig1 libffi7 libfontconfig1:i386 libffi7:i386 -yq
89+
env -i PATH="$PATH" sudo ./build/install-build-deps.sh --lib32 --no-syms --no-arm --no-chromeos-fonts --no-nacl --no-prompt --unsupported
8490

8591
# Install amd64 rootfs if necessary, it should have been installed by source hooks.
8692
build/linux/sysroot_scripts/install-sysroot.py --arch=amd64
@@ -127,8 +133,11 @@ termux_step_configure() {
127133
popd
128134

129135
# Construct args
130-
local _target_cpu _v8_current_cpu _v8_sysroot_path
131-
local _v8_toolchain_name _target_sysroot="$TERMUX_PKG_TMPDIR/sysroot"
136+
local _clang_base_path="/usr/lib/llvm-16"
137+
local _host_cc="$_clang_base_path/bin/clang"
138+
local _host_cxx="$_clang_base_path/bin/clang++"
139+
local _target_cpu _target_sysroot="$TERMUX_PKG_TMPDIR/sysroot"
140+
local _v8_toolchain_name _v8_current_cpu _v8_sysroot_path
132141
if [ "$TERMUX_ARCH" = "aarch64" ]; then
133142
_target_cpu="arm64"
134143
_v8_current_cpu="x64"
@@ -203,18 +212,18 @@ use_thin_lto=false
203212
# Use custom toolchain
204213
mkdir -p $TERMUX_PKG_CACHEDIR/custom-toolchain
205214
cp -f $TERMUX_PKG_BUILDER_DIR/toolchain.gn.in $TERMUX_PKG_CACHEDIR/custom-toolchain/BUILD.gn
206-
sed -i "s|@HOST_CC@|$(command -v clang-14)|g
207-
s|@HOST_CXX@|$(command -v clang++-14)|g
208-
s|@HOST_LD@|$(command -v clang++-14)|g
215+
sed -i "s|@HOST_CC@|$_host_cc|g
216+
s|@HOST_CXX@|$_host_cxx|g
217+
s|@HOST_LD@|$_host_cxx|g
209218
s|@HOST_AR@|$(command -v llvm-ar)|g
210219
s|@HOST_NM@|$(command -v llvm-nm)|g
211220
s|@HOST_IS_CLANG@|true|g
212221
s|@HOST_USE_GOLD@|false|g
213222
s|@HOST_SYSROOT@|$_amd64_sysroot_path|g
214223
" $TERMUX_PKG_CACHEDIR/custom-toolchain/BUILD.gn
215-
sed -i "s|@V8_CC@|$(command -v clang-14)|g
216-
s|@V8_CXX@|$(command -v clang++-14)|g
217-
s|@V8_LD@|$(command -v clang++-14)|g
224+
sed -i "s|@V8_CC@|$_host_cc|g
225+
s|@V8_CXX@|$_host_cxx|g
226+
s|@V8_LD@|$_host_cxx|g
218227
s|@V8_AR@|$(command -v llvm-ar)|g
219228
s|@V8_NM@|$(command -v llvm-nm)|g
220229
s|@V8_TOOLCHAIN_NAME@|$_v8_toolchain_name|g
@@ -227,7 +236,7 @@ use_thin_lto=false
227236

228237
mkdir -p $TERMUX_PKG_BUILDDIR/out/Release
229238
cat $_common_args_file > $TERMUX_PKG_BUILDDIR/out/Release/args.gn
230-
gn gen $TERMUX_PKG_BUILDDIR/out/Release --export-compile-commands
239+
gn gen $TERMUX_PKG_BUILDDIR/out/Release
231240
}
232241

233242
termux_step_make() {

0 commit comments

Comments
 (0)