Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions tur-chromium/chromium-stable/1001-chromium-disable-sandbox.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/content/shell/app/shell_main_delegate.cc
+++ b/content/shell/app/shell_main_delegate.cc
@@ -90,6 +90,10 @@
@@ -92,6 +92,10 @@
#include "content/shell/app/ios/shell_application_ios.h"
#endif

Expand All @@ -10,11 +10,11 @@
+
namespace {

#if !BUILDFLAG(IS_FUCHSIA)
@@ -210,6 +214,15 @@
base::CPU cpu_info;
#endif
enum class LoggingDest {
@@ -256,6 +260,15 @@
}

void ShellMainDelegate::PreSandboxStartup() {
+// Disable sandbox on Termux.
+#ifdef __TERMUX__
+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
Expand All @@ -26,7 +26,7 @@
+
// Disable platform crash handling and initialize the crash reporter, if
// requested.
// TODO(crbug.com/1226159): Implement crash reporter integration for Fuchsia.
// TODO(crbug.com/40188745): Implement crash reporter integration for Fuchsia.
--- a/chrome/browser/ui/startup/bad_flags_prompt.cc
+++ b/chrome/browser/ui/startup/bad_flags_prompt.cc
@@ -60,10 +60,12 @@
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_address_space.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_address_space.cc
@@ -36,6 +36,11 @@
#include <sys/mman.h>
#endif

+#if defined(__ANDROID__) && __ANDROID_API__ < 30
+#include <sys/syscall.h>
+#define memfd_create(name,flags) syscall(SYS_memfd_create,name,flags)
+#endif
+
namespace partition_alloc::internal {

#if PA_BUILDFLAG(HAS_64_BIT_POINTERS)
--- a/base/allocator/partition_allocator/src/partition_alloc/partition_root.cc
+++ b/base/allocator/partition_allocator/src/partition_alloc/partition_root.cc
@@ -51,6 +51,11 @@
#endif // PA_CONFIG(ENABLE_SHADOW_METADATA)
#endif // PA_BUILDFLAG(IS_LINUX) || PA_BUILDFLAG(IS_CHROMEOS)

+#if defined(__ANDROID__) && __ANDROID_API__ < 30
+#include <sys/syscall.h>
+#define memfd_create(name,flags) syscall(SYS_memfd_create,name,flags)
+#endif
+
namespace partition_alloc::internal {

#if PA_BUILDFLAG(RECORD_ALLOC_INFO)
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--- a/chrome/browser/ui/startup/infobar_utils.cc
+++ b/chrome/browser/ui/startup/infobar_utils.cc
@@ -154,7 +154,11 @@
infobars::ContentInfoBarManager* infobar_manager =
infobars::ContentInfoBarManager::FromWebContents(web_contents);

+#ifdef __TERMUX__
+ if (0) {
+#else
if (!google_apis::HasAPIKeyConfigured()) {
+#endif
GoogleApiKeysInfoBarDelegate::Create(infobar_manager);
}

6 changes: 3 additions & 3 deletions tur-chromium/chromium-stable/2010-dav1d-no-get-affinity.patch
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
--- a/third_party/dav1d/libdav1d/src/cpu.c
+++ b/third_party/dav1d/libdav1d/src/cpu.c
@@ -87,7 +87,7 @@
@@ -91,7 +91,7 @@
GetNativeSystemInfo(&system_info);
return system_info.dwNumberOfProcessors;
#endif
-#elif defined(HAVE_PTHREAD_GETAFFINITY_NP) && defined(CPU_COUNT)
+#elif defined(HAVE_PTHREAD_GETAFFINITY_NP) && defined(CPU_COUNT) && !defined(__ANDROID__)
-#elif HAVE_PTHREAD_GETAFFINITY_NP && defined(CPU_COUNT)
+#elif HAVE_PTHREAD_GETAFFINITY_NP && defined(CPU_COUNT) && !defined(__ANDROID__)
cpu_set_t affinity;
if (!pthread_getaffinity_np(pthread_self(), sizeof(affinity), &affinity))
return CPU_COUNT(&affinity);
10 changes: 5 additions & 5 deletions tur-chromium/chromium-stable/2017-vk-layers-no-android-log.patch
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@

-#if defined(__ANDROID__)
+#if defined(__ANDROID__) && !defined(__TERMUX__)
static std::string GetAndroidProperty(const char *name) {
std::string output;
const prop_info *pi = __system_property_find(name);
@@ -51,7 +51,7 @@
/*
* Use the __system_property_read_callback API that appeared in
* Android API level 26. If not avaible use the old __system_property_get function.
@@ -68,7 +68,7 @@
#endif

static std::string GetEnvironment(const char *variable) {
Expand All @@ -53,7 +53,7 @@
std::string result = GetAndroidProperty(variable);
// Workaround for screenshot layer backward compatibility
if (result.empty() && std::string(variable) == "debug.vulkan.screenshot.frames") {
@@ -199,7 +199,7 @@
@@ -214,7 +214,7 @@
}
#endif

Expand Down
14 changes: 8 additions & 6 deletions tur-chromium/chromium-stable/2020-dav1d-config.patch
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Aarch64 Android compiles as `armv8-a` and don't have so much extensions.

#define CONFIG_16BPC 1

@@ -41,15 +41,15 @@
@@ -45,15 +45,15 @@

#define HAVE_ASM 1

Expand All @@ -32,29 +32,31 @@ Aarch64 Android compiles as `armv8-a` and don't have so much extensions.

#define HAVE_AS_FUNC 0

@@ -59,11 +59,11 @@
@@ -63,13 +63,13 @@

#define HAVE_DLSYM 1

-#define HAVE_DOTPROD 1
+// #define HAVE_DOTPROD 1

#define HAVE_ELF_AUX_INFO 0

#define HAVE_GETAUXVAL 1

-#define HAVE_I8MM 1
+// #define HAVE_I8MM 1

#define HAVE_POSIX_MEMALIGN 1
#define HAVE_IO_H 0

@@ -71,9 +71,9 @@
@@ -87,9 +87,9 @@

// #define HAVE_PTHREAD_SETAFFINITY_NP 1 -- Controlled by Chomium
#define HAVE_PTHREAD_SET_NAME_NP 0

-#define HAVE_SVE 1
+// #define HAVE_SVE 1

-#define HAVE_SVE2 1
+// #define HAVE_SVE2 1

#define HAVE_UNISTD_H 1
#define HAVE_SYS_TYPES_H 1

11 changes: 0 additions & 11 deletions tur-chromium/chromium-stable/8001-blink-include-bitset-2.patch

This file was deleted.

11 changes: 0 additions & 11 deletions tur-chromium/chromium-stable/8003-gfx-include-bitset.patch

This file was deleted.

10 changes: 0 additions & 10 deletions tur-chromium/chromium-stable/8004-blink-include-stack.patch

This file was deleted.

86 changes: 52 additions & 34 deletions tur-chromium/chromium-stable/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ TERMUX_PKG_HOMEPAGE=https://www.chromium.org/Home
TERMUX_PKG_DESCRIPTION="Chromium web browser"
TERMUX_PKG_LICENSE="BSD 3-Clause"
TERMUX_PKG_MAINTAINER="Chongyun Lee <[email protected]>"
TERMUX_PKG_VERSION=130.0.6723.116
TERMUX_PKG_VERSION=131.0.6778.264
TERMUX_PKG_SRCURL=https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$TERMUX_PKG_VERSION.tar.xz
TERMUX_PKG_SHA256=968799e41158fdcc85af6f5547d3dd4730d6e51219e43aa2f1ab6ab5e00582ba
TERMUX_PKG_SHA256=7e02c65865a3095180d60838d2d7a912873d8d4f582c27c2afb9ef876152f2a5
TERMUX_PKG_DEPENDS="atk, cups, dbus, fontconfig, gtk3, krb5, libc++, libdrm, libevdev, libxkbcommon, libminizip, libnss, libwayland, libx11, mesa, openssl, pango, pulseaudio, zlib"
# Chromium doesn't support i686 on Linux.
TERMUX_PKG_BLACKLISTED_ARCHES="i686"
Expand Down Expand Up @@ -33,14 +33,6 @@ termux_step_configure() {
fi
export PATH="$TERMUX_PKG_CACHEDIR/depot_tools:$PATH"

################################################################
# Please dont use these keys outside of Termux User Repository #
# You can create your own at: #
# http://www.chromium.org/developers/how-tos/api-keys #
################################################################
local _google_api_key _google_default_client_id _google_default_client_secret
eval "$(base64 -d < $TERMUX_PKG_BUILDER_DIR/google-api-keys.base64enc)"

# Remove termux's dummy pkg-config
local _target_pkg_config=$(command -v pkg-config)
local _host_pkg_config="$(cat $_target_pkg_config | grep exec | awk '{print $2}')"
Expand Down Expand Up @@ -113,13 +105,16 @@ termux_step_configure() {
local _host_cc="$_clang_base_path/bin/clang"
local _host_cxx="$_clang_base_path/bin/clang++"
local _host_clang_version=$($_host_cc --version | grep -m1 version | sed -E 's|.*\bclang version ([0-9]+).*|\1|')
local _target_clang_base_path="$TERMUX_STANDALONE_TOOLCHAIN"
local _target_cc="$_target_clang_base_path/bin/clang"
local _target_clang_version=$($_target_cc --version | grep -m1 version | sed -E 's|.*\bclang version ([0-9]+).*|\1|')
local _target_cpu _target_sysroot="$TERMUX_PKG_CACHEDIR/sysroot-$TERMUX_ARCH"
local _v8_toolchain_name _v8_current_cpu _v8_sysroot_path
if [ "$TERMUX_ARCH" = "aarch64" ]; then
_target_cpu="arm64"
_v8_current_cpu="x64"
_v8_current_cpu="arm64"
_v8_sysroot_path="$_amd64_sysroot_path"
_v8_toolchain_name="clang_x64_v8_arm64"
_v8_toolchain_name="host"
elif [ "$TERMUX_ARCH" = "arm" ]; then
# Install i386 rootfs and deps
env -i PATH="$PATH" sudo apt install libfontconfig1:i386 libffi8:i386 -yq
Expand All @@ -134,19 +129,14 @@ termux_step_configure() {
_target_cpu="x64"
_v8_current_cpu="x64"
_v8_sysroot_path="$_amd64_sysroot_path"
_v8_toolchain_name="clang_x64"
_v8_toolchain_name="host"
fi

local _common_args_file=$TERMUX_PKG_TMPDIR/common-args-file
rm -f $_common_args_file
touch $_common_args_file

echo "
# Set google key to disable the warning slogan
# Please DO NOT USE THIS KEY OUTSIDE OF TUR!
google_api_key = \"$_google_api_key\"
google_default_client_id = \"$_google_default_client_id\"
google_default_client_secret = \"$_google_default_client_secret\"
# Do official build to decrease file size
is_official_build = true
is_debug = false
Expand All @@ -158,8 +148,8 @@ target_cpu = \"$_target_cpu\"
target_rpath = \"$TERMUX_PREFIX/lib\"
target_sysroot = \"$_target_sysroot\"
custom_toolchain = \"//build/toolchain/linux/unbundle:default\"
custom_toolchain_clang_base_path = \"$TERMUX_STANDALONE_TOOLCHAIN\"
custom_toolchain_clang_version = "18"
custom_toolchain_clang_base_path = \"$_target_clang_base_path\"
custom_toolchain_clang_version = \"$_target_clang_version\"
host_toolchain = \"$TERMUX_PKG_CACHEDIR/custom-toolchain:host\"
v8_snapshot_toolchain = \"$TERMUX_PKG_CACHEDIR/custom-toolchain:$_v8_toolchain_name\"
clang_use_chrome_plugins = false
Expand Down Expand Up @@ -219,27 +209,32 @@ exclude_unwind_tables = false
fi

# Use custom toolchain
rm -rf $TERMUX_PKG_CACHEDIR/custom-toolchain
mkdir -p $TERMUX_PKG_CACHEDIR/custom-toolchain
cp -f $TERMUX_PKG_BUILDER_DIR/toolchain.gn.in $TERMUX_PKG_CACHEDIR/custom-toolchain/BUILD.gn
cp -f $TERMUX_PKG_BUILDER_DIR/toolchain-template/host-toolchain.gn.in $TERMUX_PKG_CACHEDIR/custom-toolchain/BUILD.gn
sed -i "s|@HOST_CC@|$_host_cc|g
s|@HOST_CXX@|$_host_cxx|g
s|@HOST_LD@|$_host_cxx|g
s|@HOST_AR@|$(command -v llvm-ar)|g
s|@HOST_NM@|$(command -v llvm-nm)|g
s|@HOST_IS_CLANG@|true|g
s|@HOST_SYSROOT@|$_amd64_sysroot_path|g
s|@V8_CURRENT_CPU@|$_target_cpu|g
" $TERMUX_PKG_CACHEDIR/custom-toolchain/BUILD.gn
sed -i "s|@V8_CC@|$_host_cc|g
s|@V8_CXX@|$_host_cxx|g
s|@V8_LD@|$_host_cxx|g
s|@V8_AR@|$(command -v llvm-ar)|g
s|@V8_NM@|$(command -v llvm-nm)|g
s|@V8_TOOLCHAIN_NAME@|$_v8_toolchain_name|g
s|@V8_CURRENT_CPU@|$_v8_current_cpu|g
s|@V8_V8_CURRENT_CPU@|$_target_cpu|g
s|@V8_IS_CLANG@|true|g
s|@V8_SYSROOT@|$_v8_sysroot_path|g
" $TERMUX_PKG_CACHEDIR/custom-toolchain/BUILD.gn
if [ "$_v8_toolchain_name" != "host" ]; then
cat $TERMUX_PKG_BUILDER_DIR/toolchain-template/v8-toolchain.gn.in >> $TERMUX_PKG_CACHEDIR/custom-toolchain/BUILD.gn
sed -i "s|@V8_CC@|$_host_cc|g
s|@V8_CXX@|$_host_cxx|g
s|@V8_LD@|$_host_cxx|g
s|@V8_AR@|$(command -v llvm-ar)|g
s|@V8_NM@|$(command -v llvm-nm)|g
s|@V8_TOOLCHAIN_NAME@|$_v8_toolchain_name|g
s|@V8_CURRENT_CPU@|$_v8_current_cpu|g
s|@V8_V8_CURRENT_CPU@|$_target_cpu|g
s|@V8_IS_CLANG@|true|g
s|@V8_SYSROOT@|$_v8_sysroot_path|g
" $TERMUX_PKG_CACHEDIR/custom-toolchain/BUILD.gn
fi

# Generate ninja files
mkdir -p $TERMUX_PKG_BUILDDIR/out/Release
Expand All @@ -249,8 +244,31 @@ exclude_unwind_tables = false

termux_step_make() {
cd $TERMUX_PKG_BUILDDIR
ninja -C out/Release chromedriver chrome chrome_crashpad_handler headless_shell -k 0
rm -rf "$TERMUX_PKG_CACHEDIR/sysroot-$TERMUX_ARCH"

# Build v8 snapshot and tools
time ninja -C out/Release \
v8_context_snapshot \
run_mksnapshot_default \
run_torque \
generate_bytecode_builtins_list \
v8:run_gen-regexp-special-case

# Build host tools
time ninja -C out/Release \
generate_top_domain_list_variables_file \
generate_chrome_colors_info \
character_data \
gen_root_store_inc \
generate_transport_security_state \
generate_top_domains_trie

# Build swiftshader
time ninja -C out/Release \
third_party/swiftshader/src/Vulkan:icd_file \
third_party/swiftshader/src/Vulkan:swiftshader_libvulkan

# Build other components
ninja -C out/Release chromedriver chrome chrome_crashpad_handler headless_shell
}

termux_step_make_install() {
Expand Down
10 changes: 0 additions & 10 deletions tur-chromium/chromium-stable/google-api-keys.base64enc

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,8 @@ gcc_toolchain("host") {
toolchain_args = {
current_os = "linux"
current_cpu = "x64"
v8_current_cpu = "@V8_CURRENT_CPU@"
is_clang = @HOST_IS_CLANG@
sysroot = "@HOST_SYSROOT@"
}
}
gcc_toolchain("@V8_TOOLCHAIN_NAME@") {
cc = "@V8_CC@"
cxx = "@V8_CXX@"
ld = "@V8_LD@"
ar = "@V8_AR@"
nm = "@V8_NM@"
toolchain_args = {
current_os = "linux"
current_cpu = "@V8_CURRENT_CPU@"
v8_current_cpu = "@V8_V8_CURRENT_CPU@"
is_clang = @V8_IS_CLANG@
sysroot = "@V8_SYSROOT@"
}
}
Loading
Loading