@@ -3,13 +3,23 @@ TERMUX_PKG_DESCRIPTION="Build cross-platform desktop apps with JavaScript, HTML,
33TERMUX_PKG_LICENSE=" MIT, BSD 3-Clause"
44TERMUX_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
77TERMUX_PKG_SRCURL=git+https://github.com/electron/electron
88TERMUX_PKG_DEPENDS=" electron-deps"
99TERMUX_PKG_BUILD_DEPENDS=" libnotify, libffi-static"
1010# Chromium doesn't support i686 on Linux.
1111TERMUX_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+
1323termux_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
6772termux_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
233242termux_step_make () {
0 commit comments