diff --git a/tur-chromium/chromium-stable/1022-chromium-disable-google-api-warnings.patch b/tur-chromium/chromium-stable/1022-chromium-disable-google-api-warnings.patch deleted file mode 100644 index c5f33c8..0000000 --- a/tur-chromium/chromium-stable/1022-chromium-disable-google-api-warnings.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- 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); - } - diff --git a/tur-chromium/chromium-stable/1504-v8-memfd_create.patch b/tur-chromium/chromium-stable/1504-v8-memfd_create.patch new file mode 100644 index 0000000..9027801 --- /dev/null +++ b/tur-chromium/chromium-stable/1504-v8-memfd_create.patch @@ -0,0 +1,14 @@ +--- a/v8/src/wasm/wasm-objects.cc ++++ b/v8/src/wasm/wasm-objects.cc +@@ -11,6 +11,11 @@ + #undef MAP_TYPE + #endif // V8_TARGET_OS_LINUX + ++#if defined __ANDROID__ && __ANDROID_API__ < 30 ++#include ++#define memfd_create(name,flags) syscall(SYS_memfd_create,name,flags) ++#endif ++ + #include "src/wasm/wasm-objects.h" + + #include diff --git a/tur-chromium/chromium-stable/7004-argument-deduction-pdfium-wrapper.patch b/tur-chromium/chromium-stable/7002-argument-deduction-pdfium-wrapper.patch similarity index 100% rename from tur-chromium/chromium-stable/7004-argument-deduction-pdfium-wrapper.patch rename to tur-chromium/chromium-stable/7002-argument-deduction-pdfium-wrapper.patch diff --git a/tur-chromium/chromium-stable/7002-blink-cxx11-narrowing.patch b/tur-chromium/chromium-stable/7002-blink-cxx11-narrowing.patch deleted file mode 100644 index 0223478..0000000 --- a/tur-chromium/chromium-stable/7002-blink-cxx11-narrowing.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/chrome/browser/performance_manager/user_tuning/cpu_health_tracker.cc -+++ b/chrome/browser/performance_manager/user_tuning/cpu_health_tracker.cc -@@ -222,8 +222,9 @@ - return; - } - -- const CpuPercent total_system_cpu_usage{cpu_sample.value().cpu_utilization * -- 100}; -+ const CpuPercent total_system_cpu_usage{ -+ static_cast(cpu_sample.value().cpu_utilization * 100)}; -+ - if (GetHealthLevelForMeasurement(total_system_cpu_usage) != - HealthLevel::kHealthy) { - // Query for tab CPU usage to determine actionability diff --git a/tur-chromium/chromium-stable/7004-no-constexpr-in-requires-base-containers-span.patch b/tur-chromium/chromium-stable/7004-no-constexpr-in-requires-base-containers-span.patch new file mode 100644 index 0000000..b96ed87 --- /dev/null +++ b/tur-chromium/chromium-stable/7004-no-constexpr-in-requires-base-containers-span.patch @@ -0,0 +1,20 @@ +--- a/base/containers/span.h ++++ b/base/containers/span.h +@@ -785,7 +785,7 @@ + template +- requires((OtherExtent == dynamic_extent || extent == OtherExtent) && ++ requires((OtherExtent == dynamic_extent || Extent == OtherExtent) && + std::equality_comparable_with) + friend constexpr bool operator==( +@@ -820,7 +820,7 @@ + template +- requires((OtherExtent == dynamic_extent || extent == OtherExtent) && ++ requires((OtherExtent == dynamic_extent || Extent == OtherExtent) && + std::three_way_comparable_with) + friend constexpr auto operator<=>( diff --git a/tur-chromium/chromium-stable/7005-polyfill-atomic_ref-base-atomicops.patch b/tur-chromium/chromium-stable/7005-polyfill-atomic_ref-base-atomicops.patch new file mode 100644 index 0000000..1dd4364 --- /dev/null +++ b/tur-chromium/chromium-stable/7005-polyfill-atomic_ref-base-atomicops.patch @@ -0,0 +1,497 @@ +`atomic_ref` is not landed in NDK r27c + +--- a/base/__termux_header_only_atomic_ref_polyfill.h ++++ b/base/__termux_header_only_atomic_ref_polyfill.h +@@ -0,0 +1,436 @@ ++// Origin: https://github.com/avakar/atomic_ref ++// Origin Description: Header-only implementation of std::atomic_ref for C++14 ++// Origin LICENSE: MIT ++// MIT License ++ ++// Permission is hereby granted, free of charge, to any person obtaining a copy ++// of this software and associated documentation files (the "Software"), to deal ++// in the Software without restriction, including without limitation the rights ++// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ++// copies of the Software, and to permit persons to whom the Software is ++// furnished to do so, subject to the following conditions: ++ ++// The above copyright notice and this permission notice shall be included in all ++// copies or substantial portions of the Software. ++ ++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ++// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ++// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ++// SOFTWARE. ++ ++#ifndef TERMUX_HEADER_ONLY_ATOMIC_REF_POLYFILL_H ++#define TERMUX_HEADER_ONLY_ATOMIC_REF_POLYFILL_H ++ ++// INCLUDE: https://github.com/avakar/atomic_ref/blob/bf1b16afbf3c98754d33fd601c3e53b892cd7cab/src/atomic_ref.gcc.h ++#include ++#include ++ ++namespace _avakar { ++namespace atomic_ref { ++ ++template ++struct is_always_lock_free ++ : std::integral_constant ++{ ++}; ++ ++template ++struct is_always_wait_free ++ : std::false_type ++{ ++}; ++ ++template ++std::enable_if_t::value, T> load(T const & obj, std::memory_order order) noexcept ++{ ++ return (T)__atomic_load_n((std::underlying_type_t const *)&obj, (int)order); ++} ++ ++template ++std::enable_if_t::value, T> load(T const & obj, std::memory_order order) noexcept ++{ ++ return __atomic_load_n(&obj, (int)order); ++} ++ ++template ++void store(T & obj, T desired, std::memory_order order) noexcept ++{ ++ __atomic_store(&obj, &desired, (int)order); ++} ++ ++template ++T exchange(T & obj, T desired, std::memory_order order) noexcept ++{ ++ return __atomic_exchange_n(&obj, desired, (int)order); ++} ++ ++template ++bool compare_exchange_weak(T & obj, T & expected, T desired, std::memory_order success, std::memory_order failure) noexcept ++{ ++ return __atomic_compare_exchange(&obj, &expected, &desired, true, (int)success, (int)failure); ++} ++ ++template ++bool compare_exchange_strong(T & obj, T & expected, T desired, std::memory_order success, std::memory_order failure) noexcept ++{ ++ return __atomic_compare_exchange(&obj, &expected, &desired, false, (int)success, (int)failure); ++} ++ ++template ++T fetch_add(T & obj, T arg, std::memory_order order) noexcept ++{ ++ return __atomic_fetch_add(&obj, arg, (int)order); ++} ++ ++template ++T fetch_sub(T & obj, T arg, std::memory_order order) noexcept ++{ ++ return __atomic_fetch_sub(&obj, arg, (int)order); ++} ++ ++template ++T fetch_and(T & obj, T arg, std::memory_order order) noexcept ++{ ++ return __atomic_fetch_and(&obj, arg, order); ++} ++ ++template ++T fetch_or(T & obj, T arg, std::memory_order order) noexcept ++{ ++ return __atomic_fetch_or(&obj, arg, (int)order); ++} ++ ++template ++T fetch_xor(T & obj, T arg, std::memory_order order) noexcept ++{ ++ return __atomic_fetch_xor(&obj, arg, (int)order); ++} ++ ++template ++auto fetch_add(T * & obj, std::ptrdiff_t arg, std::memory_order order) noexcept ++{ ++ return __atomic_fetch_add(&obj, arg * sizeof(T), (int)order); ++} ++ ++template ++auto fetch_sub(T * & obj, std::ptrdiff_t arg, std::memory_order order) noexcept ++{ ++ return __atomic_fetch_sub(&obj, arg * sizeof(T), (int)order); ++} ++ ++} ++} ++ ++// INCLUDE: https://github.com/avakar/atomic_ref/blob/bf1b16afbf3c98754d33fd601c3e53b892cd7cab/include/avakar/atomic_ref.h ++#include ++#include ++ ++namespace avakar { ++ ++template ++struct _atomic_ref; ++ ++template ++using safe_atomic_ref = _atomic_ref; ++ ++template ++struct atomic_ref ++ : _atomic_ref ++{ ++ using difference_type = typename _atomic_ref::difference_type; ++ ++ explicit atomic_ref(T & obj) ++ : _atomic_ref(obj) ++ { ++ } ++ ++ operator T() const noexcept ++ { ++ return this->load(); ++ } ++ ++ T operator=(T desired) const noexcept ++ { ++ this->store(desired); ++ return desired; ++ } ++ ++ T operator++() const noexcept ++ { ++ return this->fetch_add(1) + T(1); ++ } ++ ++ T operator++(int) const noexcept ++ { ++ return this->fetch_add(1); ++ } ++ ++ T operator--() const noexcept ++ { ++ return this->fetch_sub(1) - T(1); ++ } ++ ++ T operator--(int) const noexcept ++ { ++ return this->fetch_sub(1); ++ } ++ ++ T operator+=(difference_type arg) const noexcept ++ { ++ return this->fetch_add(arg) + arg; ++ } ++ ++ T operator-=(difference_type arg) const noexcept ++ { ++ return this->fetch_sub(arg) - arg; ++ } ++ ++ T operator&=(T arg) const noexcept ++ { ++ return this->fetch_and(arg) & arg; ++ } ++ ++ T operator|=(T arg) const noexcept ++ { ++ return this->fetch_or(arg) | arg; ++ } ++ ++ T operator^=(T arg) const noexcept ++ { ++ return this->fetch_xor(arg) ^ arg; ++ } ++}; ++ ++ ++template ++struct _atomic_ref ++{ ++ static_assert(std::is_trivially_copyable::value, "T must be TriviallyCopyable"); ++ ++ static constexpr bool is_always_lock_free = _avakar::atomic_ref::is_always_lock_free::value; ++ static constexpr bool is_always_wait_free = _avakar::atomic_ref::is_always_wait_free::value; ++ static constexpr std::size_t required_alignment = alignof(T); ++ ++ using value_type = T; ++ ++ explicit _atomic_ref(value_type & obj) ++ : _obj(obj) ++ { ++ } ++ ++ value_type load(std::memory_order order = std::memory_order_seq_cst) const noexcept ++ { ++ return _avakar::atomic_ref::load(_obj, order); ++ } ++ ++ void store(value_type desired, std::memory_order order = std::memory_order_seq_cst) noexcept ++ { ++ _avakar::atomic_ref::store(_obj, desired, order); ++ } ++ ++ value_type exchange(value_type desired, std::memory_order order = std::memory_order_seq_cst) const noexcept ++ { ++ return _avakar::atomic_ref::exchange(_obj, desired, order); ++ } ++ ++ bool compare_exchange_weak(value_type & expected, value_type desired, std::memory_order order = std::memory_order_seq_cst) const noexcept ++ { ++ return this->compare_exchange_weak(expected, desired, order, order); ++ } ++ ++ bool compare_exchange_weak( ++ value_type & expected, value_type desired, ++ std::memory_order success, ++ std::memory_order failure) const noexcept ++ { ++ return _avakar::atomic_ref::compare_exchange_weak(_obj, expected, desired, success, failure); ++ } ++ ++ bool compare_exchange_strong(value_type & expected, value_type desired, std::memory_order order = std::memory_order_seq_cst) const noexcept ++ { ++ return this->compare_exchange_strong(expected, desired, order, order); ++ } ++ ++ bool compare_exchange_strong( ++ value_type & expected, value_type desired, ++ std::memory_order success, ++ std::memory_order failure) const noexcept ++ { ++ return _avakar::atomic_ref::compare_exchange_strong(_obj, expected, desired, success, failure); ++ } ++ ++ _atomic_ref & operator=(_atomic_ref const &) = delete; ++ ++private: ++ value_type & _obj; ++}; ++ ++template ++struct _atomic_ref ++{ ++ static_assert(std::is_trivially_copyable::value, "T must be TriviallyCopyable"); ++ ++ static constexpr bool is_always_lock_free = _avakar::atomic_ref::is_always_lock_free::value; ++ static constexpr bool is_always_wait_free = _avakar::atomic_ref::is_always_wait_free::value; ++ static constexpr std::size_t required_alignment = alignof(T); ++ ++ using value_type = T *; ++ using difference_type = std::ptrdiff_t; ++ ++ explicit _atomic_ref(value_type & obj) ++ : _obj(obj) ++ { ++ } ++ ++ value_type load(std::memory_order order = std::memory_order_seq_cst) const noexcept ++ { ++ return _avakar::atomic_ref::load(_obj, order); ++ } ++ ++ void store(value_type desired, std::memory_order order = std::memory_order_seq_cst) noexcept ++ { ++ _avakar::atomic_ref::store(_obj, desired, order); ++ } ++ ++ value_type exchange(value_type desired, std::memory_order order = std::memory_order_seq_cst) const noexcept ++ { ++ return _avakar::atomic_ref::exchange(_obj, desired, order); ++ } ++ ++ bool compare_exchange_weak(value_type & expected, value_type desired, std::memory_order order = std::memory_order_seq_cst) const noexcept ++ { ++ return this->compare_exchange_weak(expected, desired, order, order); ++ } ++ ++ bool compare_exchange_weak( ++ value_type & expected, value_type desired, ++ std::memory_order success, ++ std::memory_order failure) const noexcept ++ { ++ return _avakar::atomic_ref::compare_exchange_weak(_obj, expected, desired, success, failure); ++ } ++ ++ bool compare_exchange_strong(value_type & expected, value_type desired, std::memory_order order = std::memory_order_seq_cst) const noexcept ++ { ++ return this->compare_exchange_strong(expected, desired, order, order); ++ } ++ ++ bool compare_exchange_strong( ++ value_type & expected, value_type desired, ++ std::memory_order success, ++ std::memory_order failure) const noexcept ++ { ++ return _avakar::atomic_ref::compare_exchange_strong(_obj, expected, desired, success, failure); ++ } ++ ++ value_type fetch_add(difference_type arg, std::memory_order order = std::memory_order_seq_cst) const noexcept ++ { ++ return _avakar::atomic_ref::fetch_add(_obj, arg, order); ++ } ++ ++ value_type fetch_sub(difference_type arg, std::memory_order order = std::memory_order_seq_cst) const noexcept ++ { ++ return _avakar::atomic_ref::fetch_sub(_obj, arg, order); ++ } ++ ++ _atomic_ref & operator=(_atomic_ref const &) = delete; ++ ++private: ++ value_type & _obj; ++}; ++ ++template ++struct _atomic_ref::value>> ++{ ++ static_assert(std::is_trivially_copyable::value, "T must be TriviallyCopyable"); ++ ++ static constexpr bool is_always_lock_free = _avakar::atomic_ref::is_always_lock_free::value; ++ static constexpr bool is_always_wait_free = _avakar::atomic_ref::is_always_wait_free::value; ++ static constexpr std::size_t required_alignment = alignof(T); ++ ++ using value_type = T; ++ using difference_type = T; ++ ++ explicit _atomic_ref(value_type & obj) ++ : _obj(obj) ++ { ++ } ++ ++ value_type load(std::memory_order order = std::memory_order_seq_cst) const noexcept ++ { ++ return _avakar::atomic_ref::load(_obj, order); ++ } ++ ++ void store(value_type desired, std::memory_order order = std::memory_order_seq_cst) noexcept ++ { ++ _avakar::atomic_ref::store(_obj, desired, order); ++ } ++ ++ value_type exchange(value_type desired, std::memory_order order = std::memory_order_seq_cst) const noexcept ++ { ++ return _avakar::atomic_ref::exchange(_obj, desired, order); ++ } ++ ++ bool compare_exchange_weak(value_type & expected, value_type desired, std::memory_order order = std::memory_order_seq_cst) const noexcept ++ { ++ return this->compare_exchange_weak(expected, desired, order, order); ++ } ++ ++ bool compare_exchange_weak( ++ value_type & expected, value_type desired, ++ std::memory_order success, ++ std::memory_order failure) const noexcept ++ { ++ return _avakar::atomic_ref::compare_exchange_weak(_obj, expected, desired, success, failure); ++ } ++ ++ bool compare_exchange_strong(value_type & expected, value_type desired, std::memory_order order = std::memory_order_seq_cst) const noexcept ++ { ++ return this->compare_exchange_strong(expected, desired, order, order); ++ } ++ ++ bool compare_exchange_strong( ++ value_type & expected, value_type desired, ++ std::memory_order success, ++ std::memory_order failure) const noexcept ++ { ++ return _avakar::atomic_ref::compare_exchange_strong(_obj, expected, desired, success, failure); ++ } ++ ++ value_type fetch_add(difference_type arg, std::memory_order order = std::memory_order_seq_cst) const noexcept ++ { ++ return _avakar::atomic_ref::fetch_add(_obj, arg, order); ++ } ++ ++ value_type fetch_sub(difference_type arg, std::memory_order order = std::memory_order_seq_cst) const noexcept ++ { ++ return _avakar::atomic_ref::fetch_sub(_obj, arg, order); ++ } ++ ++ value_type fetch_and(difference_type arg, std::memory_order order = std::memory_order_seq_cst) const noexcept ++ { ++ return _avakar::atomic_ref::fetch_and(_obj, arg, order); ++ } ++ ++ value_type fetch_or(difference_type arg, std::memory_order order = std::memory_order_seq_cst) const noexcept ++ { ++ return _avakar::atomic_ref::fetch_or(_obj, arg, order); ++ } ++ ++ value_type fetch_xor(difference_type arg, std::memory_order order = std::memory_order_seq_cst) const noexcept ++ { ++ return _avakar::atomic_ref::fetch_xor(_obj, arg, order); ++ } ++ ++ _atomic_ref & operator=(_atomic_ref const &) = delete; ++ ++private: ++ value_type & _obj; ++}; ++ ++} ++ ++#endif // TERMUX_HEADER_ONLY_ATOMIC_REF_POLYFILL_H +--- a/base/atomicops.cc ++++ b/base/atomicops.cc +@@ -8,6 +8,15 @@ + + #include "base/memory/aligned_memory.h" + ++#ifdef __TERMUX__ ++#include "base/__termux_header_only_atomic_ref_polyfill.h" ++template ++using __my_atomic_ref = avakar::safe_atomic_ref; ++#else ++template ++using __my_atomic_ref = std::atomic_ref; ++#endif ++ + namespace base::subtle { + + void RelaxedAtomicWriteMemcpy(base::span dst, +@@ -17,16 +26,16 @@ + uint8_t* dst_byte_ptr = dst.data(); + const uint8_t* src_byte_ptr = src.data(); + // Make sure that we can at least copy byte by byte with atomics. +- static_assert(std::atomic_ref::required_alignment == 1); ++ static_assert(__my_atomic_ref::required_alignment == 1); + + // Alignment for uintmax_t atomics that we use in the happy case. + constexpr size_t kDesiredAlignment = +- std::atomic_ref::required_alignment; ++ __my_atomic_ref::required_alignment; + + // Copy byte-by-byte until `dst_byte_ptr` is not properly aligned for + // the happy case. + while (bytes > 0 && !IsAligned(dst_byte_ptr, kDesiredAlignment)) { +- std::atomic_ref(*dst_byte_ptr) ++ __my_atomic_ref(*dst_byte_ptr) + .store(*src_byte_ptr, std::memory_order_relaxed); + // SAFETY: We check above that `dst_byte_ptr` and `src_byte_ptr` point + // to spans of sufficient size. +@@ -39,7 +48,7 @@ + // aligned and the largest possible atomic is used for copying. + if (IsAligned(src_byte_ptr, kDesiredAlignment)) { + while (bytes >= sizeof(uintmax_t)) { +- std::atomic_ref(*reinterpret_cast(dst_byte_ptr)) ++ __my_atomic_ref(*reinterpret_cast(dst_byte_ptr)) + .store(*reinterpret_cast(src_byte_ptr), + std::memory_order_relaxed); + // SAFETY: We check above that `dst_byte_ptr` and `src_byte_ptr` point +@@ -52,7 +61,7 @@ + + // Copy what's left after the happy-case byte-by-byte. + while (bytes > 0) { +- std::atomic_ref(*dst_byte_ptr) ++ __my_atomic_ref(*dst_byte_ptr) + .store(*src_byte_ptr, std::memory_order_relaxed); + // SAFETY: We check above that `dst_byte_ptr` and `src_byte_ptr` point + // to spans of sufficient size. diff --git a/tur-chromium/chromium-stable/7006-argument-deduction-compose_session.patch b/tur-chromium/chromium-stable/7006-argument-deduction-compose_session.patch new file mode 100644 index 0000000..1acca54 --- /dev/null +++ b/tur-chromium/chromium-stable/7006-argument-deduction-compose_session.patch @@ -0,0 +1,11 @@ +--- a/chrome/browser/compose/compose_session.cc ++++ b/chrome/browser/compose/compose_session.cc +@@ -543,7 +543,7 @@ + // execution in case request fails. + compose::LogComposeRequestReason(request_reason); + +- optimization_guide::ModelExecutionSessionCallbackWithLogging callback = ++ optimization_guide::ModelExecutionSessionCallbackWithLogging callback = + base::BindRepeating(&ComposeSession::ModelExecutionCallback, + weak_ptr_factory_.GetWeakPtr(), + std::move(request_timer), request_id_, request_reason, diff --git a/tur-chromium/chromium-stable/build.sh b/tur-chromium/chromium-stable/build.sh index aa34399..d51377e 100644 --- a/tur-chromium/chromium-stable/build.sh +++ b/tur-chromium/chromium-stable/build.sh @@ -2,12 +2,12 @@ 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 " -TERMUX_PKG_VERSION=132.0.6834.159 +TERMUX_PKG_VERSION=133.0.6943.141 TERMUX_PKG_SRCURL=https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$TERMUX_PKG_VERSION.tar.xz -TERMUX_PKG_SHA256=564cc8a258b16d1c6151721a2a72e43ba80642326b33aa79439bba354e686068 +TERMUX_PKG_SHA256=0b3b15aa03f128a6b3d7ff67a7492bfaa2ffbb4acd80664b9ff320fd470c68be 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" +TERMUX_PKG_EXCLUDED_ARCHES="i686" SYSTEM_LIBRARIES=" fontconfig" # TERMUX_PKG_DEPENDS="fontconfig" @@ -43,9 +43,7 @@ termux_step_configure() { # Install amd64 rootfs and deps env -i PATH="$PATH" sudo apt update - env -i PATH="$PATH" sudo apt install lsb-release -yq - env -i PATH="$PATH" sudo apt install libfontconfig1 libffi8 -yq - env -i PATH="$PATH" sudo ./build/install-build-deps.sh --no-syms --no-android --no-arm --no-chromeos-fonts --no-nacl --no-prompt + env -i PATH="$PATH" sudo apt install libfontconfig1 libcups2-dev -yq build/linux/sysroot_scripts/install-sysroot.py --arch=amd64 local _amd64_sysroot_path="$(pwd)/build/linux/$(ls build/linux | grep 'amd64-sysroot')" @@ -117,8 +115,7 @@ termux_step_configure() { _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 - env -i PATH="$PATH" sudo ./build/install-build-deps.sh --lib32 --no-syms --no-android --no-arm --no-chromeos-fonts --no-nacl --no-prompt + env -i PATH="$PATH" sudo apt install libfontconfig1:i386 libexpat1:i386 libglib2.0-0t64:i386 -yq build/linux/sysroot_scripts/install-sysroot.py --arch=i386 local _i386_sysroot_path="$(pwd)/build/linux/$(ls build/linux | grep 'i386-sysroot')" _target_cpu="arm" diff --git a/tur-chromium/chromium-stable/try_patch.py b/tur-chromium/chromium-stable/try_patch.py new file mode 100644 index 0000000..3665695 --- /dev/null +++ b/tur-chromium/chromium-stable/try_patch.py @@ -0,0 +1,102 @@ +#!/usr/bin/env python3 +# apply-chromium-patches.py - Apply patches for chromium based on versions. + +import argparse +import glob +import logging +import os +import subprocess + +PATCHES_DIR = os.path.join(os.path.dirname(__file__)) +logger = logging.getLogger(__name__) + +def execute_patch(patch_file, dry_run, verbose=0, revert=False): + patch_args = ["patch"] + suffix_args = ["-p1", "-i", patch_file] + additional_args = [] + if revert: + patch_args += ["-R"] + if verbose < 1: + additional_args += ["-s"] + try: + subprocess.check_call( + patch_args + additional_args + ["--dry-run"] + suffix_args, + stdin=subprocess.DEVNULL + ) + except: + return False + if dry_run: return True + subprocess.check_call(patch_args + ["-s"] + suffix_args) + return True + +def execute(args, p): + is_revert_mode = args.revert + is_dry_run_mode = args.dry_run + verbose_level = args.verbose + patches = sorted(glob.glob(os.path.join(PATCHES_DIR, "*.patch"))) + applied_patches = [] + need_revert = False + for patch_path in patches: + ope_str = "revert" if is_revert_mode else "apply" + patch_name = os.path.basename(patch_path) + logger.info("%sing %s...", ope_str.capitalize(), patch_name) + if not execute_patch(patch_path, is_dry_run_mode, verbose_level, is_revert_mode): + need_revert = True + logger.error("Failed to apply %s", patch_path) + break + else: + applied_patches.append(patch_path) + if need_revert and not is_dry_run_mode: + ope_str = "re-apply" if is_revert_mode else "revert" + logger.info("%sing patches due to previous error...", ope_str.capitalize()) + for patch_path in applied_patches[::-1]: + patch_name = os.path.basename(patch_path) + logger.info("%sing %s...", ope_str.capitalize(), patch_name) + execute_patch(os.path.join(PATCHES_DIR, patch_path), is_dry_run_mode, verbose_level, not is_revert_mode) + exit(1) + +def main(): + p = argparse.ArgumentParser(description="Apply/Revert patches for chromium based applications.") + p.add_argument( + "-v", + "--verbose", + action="count", + dest="verbose", + default=0, + help="Give more output. Option is additive", + ) + p.add_argument( + "-R", + "--revert", + action="store_true", + dest="revert", + default=False, + help="Set to revert mode.", + ) + p.add_argument( + "--dry-run", + action="store_true", + dest="dry_run", + default=False, + help="Set to dry-run mode.", + ) + p.add_argument( + "-C", + "--chdir", + action="store", + dest="workdir", + default=None, + help="Change workdir.", + ) + args = p.parse_args() + logging.disable(logging.NOTSET) + if args.verbose >= 1: + logging.basicConfig(level=logging.DEBUG) + else: + logging.basicConfig(level=logging.INFO) + if args.workdir: + os.chdir(args.workdir) + execute(args, p) + +if __name__ == '__main__': + main()