Skip to content

Commit d17ebfc

Browse files
authored
electron-21: bump to 21.4.4 (#24)
[skip ci]
1 parent edae926 commit d17ebfc

File tree

5 files changed

+139
-22
lines changed

5 files changed

+139
-22
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
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
Origin: https://sources.debian.org/src/chromium/107.0.5304.110-2/debian/patches/fixes/angle-wayland.patch/
2+
description: this is just wayland-client-core.h diffed against /usr/include/wayland-client-core.h in sid
3+
author: Andres Salomon <[email protected]>
4+
5+
ANGLE upstream broke wayland inclusion stuff when building against system
6+
libwayland. It's fine in bullseye (where libwayland is older), but breaks
7+
in sid. This brings the header in chromium/angle with what's in sid.
8+
9+
Drop this once ANGLE gets updated.
10+
11+
12+
--- a/third_party/wayland/src/src/wayland-client-core.h
13+
+++ b/third_party/wayland/src/src/wayland-client-core.h
14+
@@ -119,9 +119,27 @@ struct wl_display;
15+
*/
16+
struct wl_event_queue;
17+
18+
+/** Destroy proxy after marshalling
19+
+ * @ingroup wl_proxy
20+
+ */
21+
+#define WL_MARSHAL_FLAG_DESTROY (1 << 0)
22+
+
23+
void
24+
wl_event_queue_destroy(struct wl_event_queue *queue);
25+
26+
+struct wl_proxy *
27+
+wl_proxy_marshal_flags(struct wl_proxy *proxy, uint32_t opcode,
28+
+ const struct wl_interface *interface,
29+
+ uint32_t version,
30+
+ uint32_t flags, ...);
31+
+
32+
+struct wl_proxy *
33+
+wl_proxy_marshal_array_flags(struct wl_proxy *proxy, uint32_t opcode,
34+
+ const struct wl_interface *interface,
35+
+ uint32_t version,
36+
+ uint32_t flags,
37+
+ union wl_argument *args);
38+
+
39+
void
40+
wl_proxy_marshal(struct wl_proxy *p, uint32_t opcode, ...);
41+

tur-electron/electron-21/build.sh

Lines changed: 46 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,38 @@ 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=106.0.5249.199
6-
TERMUX_PKG_VERSION=21.4.0
6+
TERMUX_PKG_VERSION=21.4.4
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+
23+
_setup_nodejs_16() {
24+
local NODEJS_VERSION=16.19.0
25+
local NODEJS_FOLDER=${TERMUX_PKG_CACHEDIR}/build-tools/nodejs-${NODEJS_VERSION}
26+
27+
if [ ! -x "$NODEJS_FOLDER/bin/node" ]; then
28+
mkdir -p "$NODEJS_FOLDER"
29+
local NODEJS_TAR_FILE=$TERMUX_PKG_TMPDIR/nodejs-$NODEJS_VERSION.tar.xz
30+
termux_download https://nodejs.org/dist/v${NODEJS_VERSION}/node-v${NODEJS_VERSION}-linux-x64.tar.xz \
31+
"$NODEJS_TAR_FILE" \
32+
c88b52497ab38a3ddf526e5b46a41270320409109c3f74171b241132984fd08f
33+
tar -xf "$NODEJS_TAR_FILE" -C "$NODEJS_FOLDER" --strip-components=1
34+
fi
35+
export PATH=$NODEJS_FOLDER/bin:$PATH
36+
}
37+
1338
termux_step_get_source() {
1439
# Check whether we need to get source
1540
if [ -f "$TERMUX_PKG_CACHEDIR/.electron-source-fetched" ]; then
@@ -31,15 +56,10 @@ termux_step_get_source() {
3156
fi
3257

3358
# 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"
59+
__tur_setup_depot_tools
4060

4161
# Install nodejs
42-
termux_setup_nodejs
62+
_setup_nodejs_16
4363

4464
# Get source
4565
rm -rf "$TERMUX_PKG_CACHEDIR/tmp-checkout"
@@ -66,9 +86,9 @@ termux_step_post_get_source() {
6686

6787
termux_step_configure() {
6888
cd $TERMUX_PKG_SRCDIR
69-
termux_setup_gn
7089
termux_setup_ninja
71-
termux_setup_nodejs
90+
_setup_nodejs_16
91+
__tur_setup_depot_tools
7292

7393
# Remove termux's dummy pkg-config
7494
local _target_pkg_config=$(command -v pkg-config)
@@ -79,8 +99,9 @@ termux_step_configure() {
7999
export PATH="$TERMUX_PKG_TMPDIR/host-pkg-config-bin:$PATH"
80100

81101
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
102+
env -i PATH="$PATH" sudo apt install lsb-release -yq
103+
env -i PATH="$PATH" sudo apt install libfontconfig1 libffi7 libfontconfig1:i386 libffi7:i386 -yq
104+
env -i PATH="$PATH" sudo ./build/install-build-deps.sh --lib32 --no-syms --no-arm --no-chromeos-fonts --no-nacl --no-prompt --unsupported
84105

85106
# Install amd64 rootfs if necessary, it should have been installed by source hooks.
86107
build/linux/sysroot_scripts/install-sysroot.py --arch=amd64
@@ -127,8 +148,11 @@ termux_step_configure() {
127148
popd
128149

129150
# Construct args
130-
local _target_cpu _v8_current_cpu _v8_sysroot_path
131-
local _v8_toolchain_name _target_sysroot="$TERMUX_PKG_TMPDIR/sysroot"
151+
local _clang_base_path="/usr/lib/llvm-16"
152+
local _host_cc="$_clang_base_path/bin/clang"
153+
local _host_cxx="$_clang_base_path/bin/clang++"
154+
local _target_cpu _target_sysroot="$TERMUX_PKG_TMPDIR/sysroot"
155+
local _v8_toolchain_name _v8_current_cpu _v8_sysroot_path
132156
if [ "$TERMUX_ARCH" = "aarch64" ]; then
133157
_target_cpu="arm64"
134158
_v8_current_cpu="x64"
@@ -203,18 +227,18 @@ use_thin_lto=false
203227
# Use custom toolchain
204228
mkdir -p $TERMUX_PKG_CACHEDIR/custom-toolchain
205229
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-13)|g
207-
s|@HOST_CXX@|$(command -v clang++-13)|g
208-
s|@HOST_LD@|$(command -v clang++-13)|g
230+
sed -i "s|@HOST_CC@|$_host_cc|g
231+
s|@HOST_CXX@|$_host_cxx|g
232+
s|@HOST_LD@|$_host_cxx|g
209233
s|@HOST_AR@|$(command -v llvm-ar)|g
210234
s|@HOST_NM@|$(command -v llvm-nm)|g
211235
s|@HOST_IS_CLANG@|true|g
212236
s|@HOST_USE_GOLD@|false|g
213237
s|@HOST_SYSROOT@|$_amd64_sysroot_path|g
214238
" $TERMUX_PKG_CACHEDIR/custom-toolchain/BUILD.gn
215-
sed -i "s|@V8_CC@|$(command -v clang-13)|g
216-
s|@V8_CXX@|$(command -v clang++-13)|g
217-
s|@V8_LD@|$(command -v clang++-13)|g
239+
sed -i "s|@V8_CC@|$_host_cc|g
240+
s|@V8_CXX@|$_host_cxx|g
241+
s|@V8_LD@|$_host_cxx|g
218242
s|@V8_AR@|$(command -v llvm-ar)|g
219243
s|@V8_NM@|$(command -v llvm-nm)|g
220244
s|@V8_TOOLCHAIN_NAME@|$_v8_toolchain_name|g
@@ -227,12 +251,12 @@ use_thin_lto=false
227251

228252
mkdir -p $TERMUX_PKG_BUILDDIR/out/Release
229253
cat $_common_args_file > $TERMUX_PKG_BUILDDIR/out/Release/args.gn
230-
gn gen $TERMUX_PKG_BUILDDIR/out/Release --export-compile-commands || bash
254+
gn gen $TERMUX_PKG_BUILDDIR/out/Release
231255
}
232256

233257
termux_step_make() {
234258
cd $TERMUX_PKG_BUILDDIR
235-
ninja -C $TERMUX_PKG_BUILDDIR/out/Release electron electron_license chromium_licenses || bash
259+
ninja -C $TERMUX_PKG_BUILDDIR/out/Release electron electron_license chromium_licenses
236260
}
237261

238262
termux_step_make_install() {

0 commit comments

Comments
 (0)