termux-packages/x11-packages/firefox/firefox.patch

425 lines
18 KiB
Diff

diff -uNr firefox-105.0.3/browser/moz.configure firefox-105.0.3.mod/browser/moz.configure
--- firefox-105.0.3/browser/moz.configure 2022-10-07 22:37:47.000000000 +0900
+++ firefox-105.0.3.mod/browser/moz.configure 2022-10-15 22:21:38.317020036 +0900
@@ -5,11 +5,11 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
imply_option("MOZ_PLACES", True)
-imply_option("MOZ_SERVICES_HEALTHREPORT", True)
+imply_option("MOZ_SERVICES_HEALTHREPORT", False)
imply_option("MOZ_SERVICES_SYNC", True)
imply_option("MOZ_DEDICATED_PROFILES", True)
imply_option("MOZ_BLOCK_PROFILE_DOWNGRADE", True)
-imply_option("MOZ_NORMANDY", True)
+imply_option("MOZ_NORMANDY", False)
with only_when(target_is_linux & compile_environment):
option(env="MOZ_NO_PIE_COMPAT", help="Enable non-PIE wrapper")
diff -uNr firefox-105.0.3/build/autoconf/android.m4 firefox-105.0.3.mod/build/autoconf/android.m4
--- firefox-105.0.3/build/autoconf/android.m4 2022-10-07 22:37:47.000000000 +0900
+++ firefox-105.0.3.mod/build/autoconf/android.m4 2022-10-15 09:48:55.153535797 +0900
@@ -6,7 +6,7 @@
[
case "$target" in
-*-android*|*-linuxandroid*)
+no-android)
dnl $extra_android_flags will be set for us by Python configure.
LDFLAGS="$extra_android_flags $LDFLAGS"
CPPFLAGS="$extra_android_flags $CPPFLAGS"
diff -uNr firefox-105.0.3/build/moz.configure/init.configure firefox-105.0.3.mod/build/moz.configure/init.configure
--- firefox-105.0.3/build/moz.configure/init.configure 2022-10-08 00:40:07.000000000 +0900
+++ firefox-105.0.3.mod/build/moz.configure/init.configure 2022-10-15 09:48:55.153535797 +0900
@@ -466,7 +466,7 @@
# which presumably has a cleaner and leaner output. Let's refine later.
os = os.replace("/", "_")
if "android" in os:
- canonical_os = "Android"
+ canonical_os = "GNU"
canonical_kernel = "Linux"
elif os.startswith("linux"):
canonical_os = "GNU"
diff -uNr firefox-105.0.3/build/moz.configure/pkg.configure firefox-105.0.3.mod/build/moz.configure/pkg.configure
--- firefox-105.0.3/build/moz.configure/pkg.configure 2022-10-07 22:37:47.000000000 +0900
+++ firefox-105.0.3.mod/build/moz.configure/pkg.configure 2022-10-15 09:48:55.153535797 +0900
@@ -56,7 +56,7 @@
@imports(_from="os", _import="environ")
@imports(_from="os", _import="pathsep")
def pkg_config_vars(target, sysroot_path, multiarch_dir):
- if sysroot_path and target.kernel != "Darwin":
+ if False:
return namespace(
PKG_CONFIG_PATH="",
PKG_CONFIG_SYSROOT_DIR=sysroot_path,
diff -uNr firefox-105.0.3/build/moz.configure/toolchain.configure firefox-105.0.3.mod/build/moz.configure/toolchain.configure
--- firefox-105.0.3/build/moz.configure/toolchain.configure 2022-10-08 00:40:07.000000000 +0900
+++ firefox-105.0.3.mod/build/moz.configure/toolchain.configure 2022-10-15 17:25:19.398719772 +0900
@@ -1175,7 +1175,7 @@
):
wrapper = list(compiler_wrapper or ())
flags = []
- if sysroot.path:
+ if False:
if host_or_target.kernel == "Darwin":
# While --sysroot and -isysroot are roughly equivalent, when not using
# -isysroot on mac, clang takes the SDKROOT environment variable into
@@ -1763,17 +1761,7 @@
@depends(cxx_compiler, target)
def needs_libstdcxx_newness_check(cxx_compiler, target):
- # We only have to care about this on Linux and MinGW.
- if cxx_compiler.type == "clang-cl":
- return
-
- if target.kernel not in ("Linux", "WINNT"):
- return
-
- if target.os == "Android":
- return
-
- return True
+ return
def die_on_old_libstdcxx():
diff -uNr firefox-105.0.3/dom/media/CubebUtils.cpp firefox-105.0.3.mod/dom/media/CubebUtils.cpp
--- firefox-105.0.3/dom/media/CubebUtils.cpp 2022-10-08 00:40:07.000000000 +0900
+++ firefox-105.0.3.mod/dom/media/CubebUtils.cpp 2022-10-15 21:46:22.863734976 +0900
@@ -61,7 +61,7 @@
#define PREF_AUDIOIPC_STACK_SIZE "media.audioipc.stack_size"
#define PREF_AUDIOIPC_SHM_AREA_SIZE "media.audioipc.shm_area_size"
-#if (defined(XP_LINUX) && !defined(MOZ_WIDGET_ANDROID)) || \
+#if (defined(XP_LINUX) && !defined(__TERMUX__)) || \
defined(XP_MACOSX) || defined(XP_WIN)
# define MOZ_CUBEB_REMOTING
#endif
diff -uNr firefox-105.0.3/dom/media/moz.build firefox-105.0.3.mod/dom/media/moz.build
--- firefox-105.0.3/dom/media/moz.build 2022-10-08 00:40:07.000000000 +0900
+++ firefox-105.0.3.mod/dom/media/moz.build 2022-10-15 21:24:09.117086889 +0900
@@ -318,7 +318,7 @@
"XiphExtradata.cpp",
]
-if CONFIG["OS_TARGET"] == "Linux":
+if False:
UNIFIED_SOURCES += ["UnderrunHandlerLinux.cpp"]
else:
UNIFIED_SOURCES += ["UnderrunHandlerNoop.cpp"]
diff -uNr firefox-105.0.3/dom/media/systemservices/VideoEngine.cpp firefox-105.0.3.mod/dom/media/systemservices/VideoEngine.cpp
--- firefox-105.0.3/dom/media/systemservices/VideoEngine.cpp 2022-10-08 00:40:07.000000000 +0900
+++ firefox-105.0.3.mod/dom/media/systemservices/VideoEngine.cpp 2022-10-15 09:48:55.153535797 +0900
@@ -24,7 +24,7 @@
#define LOG(args) MOZ_LOG(gVideoEngineLog, mozilla::LogLevel::Debug, args)
#define LOG_ENABLED() MOZ_LOG_TEST(gVideoEngineLog, mozilla::LogLevel::Debug)
-#if defined(ANDROID)
+#if defined(ANDROID) && !defined(__TERMUX__)
int VideoEngine::SetAndroidObjects() {
LOG(("%s", __PRETTY_FUNCTION__));
diff -uNr firefox-105.0.3/dom/system/OSFileConstants.cpp firefox-105.0.3.mod/dom/system/OSFileConstants.cpp
--- firefox-105.0.3/dom/system/OSFileConstants.cpp 2022-10-08 00:25:40.000000000 +0900
+++ firefox-105.0.3.mod/dom/system/OSFileConstants.cpp 2022-10-15 09:48:55.157535800 +0900
@@ -32,7 +32,7 @@
# else
# include "sys/statvfs.h"
# endif // defined(XP_LINUX)
-# if !defined(ANDROID)
+# if !defined(__TERMUX__)
# include "sys/wait.h"
# include <spawn.h>
# endif // !defined(ANDROID)
@@ -523,7 +523,7 @@
// The size of |fsblkcnt_t|.
{"OSFILE_SIZEOF_FSBLKCNT_T", JS::Int32Value(sizeof(fsblkcnt_t))},
-# if !defined(ANDROID)
+# if !defined(__TERMUX__)
// The size of |posix_spawn_file_actions_t|.
{"OSFILE_SIZEOF_POSIX_SPAWN_FILE_ACTIONS_T",
JS::Int32Value(sizeof(posix_spawn_file_actions_t))},
diff -uNr firefox-105.0.3/ipc/chromium/src/base/lock_impl_posix.cc firefox-105.0.3.mod/ipc/chromium/src/base/lock_impl_posix.cc
--- firefox-105.0.3/ipc/chromium/src/base/lock_impl_posix.cc 2022-10-07 22:37:49.000000000 +0900
+++ firefox-105.0.3.mod/ipc/chromium/src/base/lock_impl_posix.cc 2022-10-15 13:56:29.736757665 +0900
@@ -22,7 +22,7 @@
// Lock::PriorityInheritanceAvailable still must be checked as the code may
// compile but the underlying platform still may not correctly support priority
// inheritance locks.
-#if defined(OS_NACL) || defined(OS_ANDROID)
+#if defined(OS_NACL) || defined(__TERMUX__)
# define PRIORITY_INHERITANCE_LOCKS_POSSIBLE() 0
#else
# define PRIORITY_INHERITANCE_LOCKS_POSSIBLE() 1
diff -uNr firefox-105.0.3/memory/build/malloc_decls.h firefox-105.0.3.mod/memory/build/malloc_decls.h
--- firefox-105.0.3/memory/build/malloc_decls.h 2022-10-07 22:37:53.000000000 +0900
+++ firefox-105.0.3.mod/memory/build/malloc_decls.h 2022-10-15 09:48:55.157535800 +0900
@@ -39,7 +39,7 @@
// consistent declare certain functions as `throw()`, though.
// Bionic and OS X don't seem to care about `throw()`ness.
-# if defined(ANDROID) || defined(XP_DARWIN)
+# if defined(__TERMUX__) || defined(XP_DARWIN)
# undef NOTHROW_MALLOC_DECL
# define NOTHROW_MALLOC_DECL MALLOC_DECL
// Some places don't care about the distinction.
diff -uNr firefox-105.0.3/memory/build/Mutex.h firefox-105.0.3.mod/memory/build/Mutex.h
--- firefox-105.0.3/memory/build/Mutex.h 2022-10-08 00:40:08.000000000 +0900
+++ firefox-105.0.3.mod/memory/build/Mutex.h 2022-10-15 09:48:55.157535800 +0900
@@ -55,7 +55,7 @@
}
#elif defined(XP_DARWIN)
mMutex = OS_UNFAIR_LOCK_INIT;
-#elif defined(XP_LINUX) && !defined(ANDROID)
+#elif defined(XP_LINUX) && !defined(__TERMUX__)
pthread_mutexattr_t attr;
if (pthread_mutexattr_init(&attr) != 0) {
return false;
@@ -169,7 +169,7 @@
# if defined(XP_DARWIN)
# define STATIC_MUTEX_INIT OS_UNFAIR_LOCK_INIT
-# elif defined(XP_LINUX) && !defined(ANDROID)
+# elif defined(XP_LINUX) && !defined(__TERMUX__)
# define STATIC_MUTEX_INIT PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
# else
# define STATIC_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER
diff -uNr firefox-105.0.3/mozglue/misc/ConditionVariable_posix.cpp firefox-105.0.3.mod/mozglue/misc/ConditionVariable_posix.cpp
--- firefox-105.0.3/mozglue/misc/ConditionVariable_posix.cpp 2022-10-07 22:37:53.000000000 +0900
+++ firefox-105.0.3.mod/mozglue/misc/ConditionVariable_posix.cpp 2022-10-15 23:45:03.008285261 +0900
@@ -23,7 +23,7 @@
// Android 32-bit & macOS 10.12 has the clock functions, but not
// pthread_condattr_setclock.
#if defined(HAVE_CLOCK_MONOTONIC) && \
- !(defined(__ANDROID__) && !defined(__LP64__)) && !defined(__APPLE__)
+ defined(__TERMUX__)
# define CV_USE_CLOCK_API
#endif
diff -uNr firefox-105.0.3/mozglue/misc/StackWalk.cpp firefox-105.0.3.mod/mozglue/misc/StackWalk.cpp
--- firefox-105.0.3/mozglue/misc/StackWalk.cpp 2022-10-08 00:25:41.000000000 +0900
+++ firefox-105.0.3.mod/mozglue/misc/StackWalk.cpp 2022-10-15 09:48:55.157535800 +0900
@@ -692,7 +692,7 @@
stackEnd = __libc_stack_end;
# elif defined(XP_DARWIN)
stackEnd = pthread_get_stackaddr_np(pthread_self());
-# elif defined(ANDROID)
+# elif defined(__TERMUX__)
pthread_attr_t sattr;
pthread_attr_init(&sattr);
pthread_getattr_np(pthread_self(), &sattr);
diff -uNr firefox-105.0.3/nsprpub/pr/src/pthreads/ptsynch.c firefox-105.0.3.mod/nsprpub/pr/src/pthreads/ptsynch.c
--- firefox-105.0.3/nsprpub/pr/src/pthreads/ptsynch.c 2022-10-07 22:37:53.000000000 +0900
+++ firefox-105.0.3.mod/nsprpub/pr/src/pthreads/ptsynch.c 2022-10-15 09:48:55.157535800 +0900
@@ -953,7 +953,7 @@
#if (defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)) \
|| (defined(FREEBSD) && __FreeBSD_version < 1200059) \
|| defined(OPENBSD) || defined(BSDI) \
- || defined(DARWIN)
+ || defined(DARWIN) || defined(__TERMUX__)
/* union semun is defined by including <sys/sem.h> */
#else
/* according to X/OPEN we have to define it ourselves */
diff -uNr firefox-105.0.3/toolkit/components/extensions/storage/moz.build firefox-105.0.3.mod/toolkit/components/extensions/storage/moz.build
--- firefox-105.0.3/toolkit/components/extensions/storage/moz.build 2022-10-07 22:38:01.000000000 +0900
+++ firefox-105.0.3.mod/toolkit/components/extensions/storage/moz.build 2022-10-15 15:38:46.759393613 +0900
@@ -17,7 +17,7 @@
# a delegate for consumers to use instead. Android Components can then provide
# an implementation of the delegate that's backed by the Rust component. For
# details, please see bug 1626506, comment 4.
-if CONFIG["MOZ_WIDGET_TOOLKIT"] != "android":
+if False:
EXPORTS.mozilla.extensions.storage += [
"ExtensionStorageComponents.h",
]
--- a/toolkit/library/rust/shared/Cargo.toml
+++ b/toolkit/library/rust/shared/Cargo.toml
@@ -113,11 +113,12 @@
# This happens to work around issues the older code has with 1.65.
fallible_collections = { version = "0.4", features = ["rust_1_57"] }
-[target.'cfg(not(target_os = "android"))'.dependencies]
viaduct = "0.1"
-webext_storage_bridge = { path = "../../../components/extensions/storage/webext_storage_bridge" }
tabs = { version = "0.1" }
+[target.'cfg(not(target_os = "android"))'.dependencies]
+webext_storage_bridge = { path = "../../../components/extensions/storage/webext_storage_bridge" }
+
[target.'cfg(target_os = "windows")'.dependencies]
detect_win32k_conflicts = { path = "../../../xre/detect_win32k_conflicts" }
--- a/toolkit/library/rust/shared/lib.rs
+++ b/toolkit/library/rust/shared/lib.rs
@@ -57,10 +57,8 @@
#[cfg(not(target_os = "android"))]
extern crate webext_storage_bridge;
-#[cfg(not(target_os = "android"))]
extern crate tabs;
-#[cfg(not(target_os = "android"))]
mod reexport_tabs {
tabs::uniffi_reexport_scaffolding!();
}
@@ -89,7 +87,6 @@
extern crate l10nregistry_ffi;
extern crate localization_ffi;
-#[cfg(not(target_os = "android"))]
extern crate viaduct;
extern crate gecko_logger;
diff -uNr firefox-105.0.3/toolkit/moz.configure firefox-105.0.3.mod/toolkit/moz.configure
--- firefox-105.0.3/toolkit/moz.configure 2022-10-08 00:40:08.000000000 +0900
+++ firefox-105.0.3.mod/toolkit/moz.configure 2022-10-18 01:42:19.379553089 +0900
@@ -173,7 +173,7 @@
@depends(target)
def midir_linux_support(target):
return (
- target.kernel == "Linux" and target.os != "Android" and target.cpu != "riscv64"
+ False
)
@@ -225,7 +225,7 @@
@depends("--enable-audio-backends", target)
def imply_aaudio(values, target):
- if any("aaudio" in value for value in values) and target.os != "Android":
+ if any("aaudio" in value for value in values) and False:
die("Cannot enable AAudio on %s", target.os)
return any("aaudio" in value for value in values) or None
@@ -259,7 +259,7 @@
@depends("--enable-audio-backends", target)
def imply_opensl(values, target):
- if any("opensl" in value for value in values) and target.os != "Android":
+ if any("opensl" in value for value in values) and False:
die("Cannot enable OpenSL on %s", target.os)
return any("opensl" in value for value in values) or None
set_config("MOZ_PDF_PRINTING", pdf_printing)
@@ -1167,9 +1166,7 @@
@depends(target, tree_freetype, freetype2_info)
def enable_cairo_ft(target, tree_freetype, freetype2_info):
- # Avoid defining MOZ_ENABLE_CAIRO_FT on Windows platforms because
- # "cairo-ft-font.c" includes <dlfcn.h>, which only exists on posix platforms
- return freetype2_info or (tree_freetype and target.os != "WINNT")
+ return
set_config("MOZ_ENABLE_CAIRO_FT", True, when=enable_cairo_ft)
@@ -2776,8 +2773,6 @@
# ==============================================================
@depends(target)
def oxidized_breakpad(target):
- if target.kernel == "Linux" and target.os != "Android":
- return target.cpu in ("x86", "x86_64")
return False
@@ -2901,7 +2901,7 @@
"MOZ_NORMANDY",
)
def data_reporting(telemetry, healthreport, crashreporter, normandy):
- return telemetry or healthreport or crashreporter or normandy
+ return False
set_config("MOZ_DATA_REPORTING", True, when=data_reporting)
@@ -2968,8 +2963,8 @@
# Enable runtime logging
# ==============================================================
-set_define("MOZ_LOGGING", True)
-set_define("FORCE_PR_LOG", True)
+set_define("MOZ_LOGGING", 0)
+set_define("FORCE_PR_LOG", 0)
# This will enable logging of addref, release, ctor, dtor.
# ==============================================================
@@ -3157,7 +3152,7 @@
option(
env="MOZ_LINKER",
default=depends(target.os, when="--enable-jemalloc")(
- lambda os: os == "Android"
+ lambda os: True
),
help="{Enable|Disable} custom dynamic linker",
)
@@ -3189,7 +3184,7 @@
"Can't find header linux/joystick.h, needed for gamepad support."
" Please install Linux kernel headers."
),
- when=target_is_linux & compile_environment,
+ when=False,
)
# Smart card support
--- a/toolkit/xre/glxtest/glxtest.cpp
+++ b/toolkit/xre/glxtest/glxtest.cpp
@@ -946,7 +946,9 @@
log("GLX_TEST: childgltest start\n");
// Get a list of all GPUs from the PCI bus.
+#if !defined(__TERMUX__)
get_pci_status();
+#endif
#ifdef MOZ_WAYLAND
if (aWayland) {
diff -uNr firefox-105.0.3/js/src/ctypes/libffi/src/closures.c firefox-105.0.3.mod/js/src/ctypes/libffi/src/closures.c
--- firefox-105.0.3/js/src/ctypes/libffi/src/closures.c 2022-10-07 22:37:49.000000000 +0900
+++ firefox-105.0.3.mod/js/src/ctypes/libffi/src/closures.c 2022-10-17 19:42:34.472896402 +0900
@@ -112,7 +112,7 @@
#else /* !NetBSD with PROT_MPROTECT */
#if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
-# if __linux__ && !defined(__ANDROID__)
+# if __linux__ && !defined(__TERMUX__)
/* This macro indicates it may be forbidden to map anonymous memory
with both write and execute permission. Code compiled when this
option is defined will attempt to map such pages once, but if it
diff -uNr firefox-105.0.3/modules/zlib/src/gzguts.h firefox-105.0.3.mod/modules/zlib/src/gzguts.h
--- firefox-105.0.3/modules/zlib/src/gzguts.h 2022-10-07 22:37:53.000000000 +0900
+++ firefox-105.0.3.mod/modules/zlib/src/gzguts.h 2022-10-17 23:15:15.124694789 +0900
@@ -3,6 +3,8 @@
* For conditions of distribution and use, see copyright notice in zlib.h
*/
+#include <unistd.h>
+
#ifdef _LARGEFILE64_SOURCE
# ifndef _LARGEFILE_SOURCE
# define _LARGEFILE_SOURCE 1
diff -uNr firefox-105.0.3/nsprpub/pr/src/pthreads/ptthread.c firefox-105.0.3.mod/nsprpub/pr/src/pthreads/ptthread.c
--- firefox-105.0.3/nsprpub/pr/src/pthreads/ptthread.c 2022-10-07 22:37:53.000000000 +0900
+++ firefox-105.0.3.mod/nsprpub/pr/src/pthreads/ptthread.c 2022-10-17 23:22:02.822992745 +0900
@@ -37,6 +37,10 @@
#endif
#endif
+#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && defined(__TERMUX__)
+#undef _POSIX_THREAD_PRIORITY_SCHEDULING
+#endif
+
/*
* Record whether or not we have the privilege to set the scheduling
* policy and priority of threads. 0 means that privilege is available.
diff -uNr firefox-105.0.3/old-configure.in firefox-105.0.3.mod/old-configure.in
--- firefox-105.0.3/old-configure.in 2022-10-07 22:37:53.000000000 +0900
+++ firefox-105.0.3.mod/old-configure.in 2022-10-18 11:44:37.005989967 +0900
@@ -242,9 +242,6 @@
AC_MSG_CHECKING([for --noexecstack option to as])
_SAVE_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Wa,--noexecstack"
- AC_TRY_COMPILE(,,AC_MSG_RESULT([yes])
- [ASFLAGS="$ASFLAGS -Wa,--noexecstack"],
- AC_MSG_RESULT([no]))
CFLAGS=$_SAVE_CFLAGS
AC_MSG_CHECKING([for -z noexecstack option to ld])
_SAVE_LDFLAGS=$LDFLAGS