From 7d21c3cca8bffd4823ef30e26016326ee1e5253c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Nogueira?= Date: Mon, 18 Oct 2021 16:15:53 -0300 Subject: [PATCH] thunderbird: update to 91.2.0. --- srcpkgs/thunderbird/files/mozconfig | 1 - .../patches/avoid-redefinition.patch | 15 ++ srcpkgs/thunderbird/patches/fix-cross.patch | 16 --- .../patches/fix-fortify-inline.patch | 11 -- .../thunderbird/patches/fix-wasm-arm.patch | 15 -- .../patches/fix-webrtc-glibcisms.patch | 4 +- .../patches/musl-rust.configure.patch | 26 ---- .../thunderbird/patches/rust-configure.patch | 132 ++++++++++++++---- .../thunderbird/patches/rust-has-i128.patch | 21 --- .../thunderbird/patches/sandbox-fork.patch | 4 +- srcpkgs/thunderbird/patches/sndio.patch | 14 +- srcpkgs/thunderbird/template | 7 +- 12 files changed, 133 insertions(+), 133 deletions(-) create mode 100644 srcpkgs/thunderbird/patches/avoid-redefinition.patch delete mode 100644 srcpkgs/thunderbird/patches/fix-cross.patch delete mode 100644 srcpkgs/thunderbird/patches/fix-fortify-inline.patch delete mode 100644 srcpkgs/thunderbird/patches/fix-wasm-arm.patch delete mode 100644 srcpkgs/thunderbird/patches/musl-rust.configure.patch delete mode 100644 srcpkgs/thunderbird/patches/rust-has-i128.patch diff --git a/srcpkgs/thunderbird/files/mozconfig b/srcpkgs/thunderbird/files/mozconfig index b30e8fc4886..44c45a8f6f3 100644 --- a/srcpkgs/thunderbird/files/mozconfig +++ b/srcpkgs/thunderbird/files/mozconfig @@ -32,6 +32,5 @@ ac_add_options --enable-optimize="$CFLAGS" ac_add_options --enable-official-branding ac_add_options --enable-application=comm/mail -ac_add_options --enable-calendar ac_add_options --allow-addon-sideload diff --git a/srcpkgs/thunderbird/patches/avoid-redefinition.patch b/srcpkgs/thunderbird/patches/avoid-redefinition.patch new file mode 100644 index 00000000000..867d37c62a9 --- /dev/null +++ b/srcpkgs/thunderbird/patches/avoid-redefinition.patch @@ -0,0 +1,15 @@ +Author: Rasmus Thomsen +Reason: FF is mixing userspace net headers (net/if.h) and kernelspace ones +(linux/if.h), leading to redefinitions. We need to include net/if.h before +linux/if.h because linux/if.h has redifinition guards whereas net/if.h doesnt +Upstream: No +--- a/dom/media/webrtc/transport/third_party/nICEr/src/stun/addrs-netlink.c 2020-07-28 19:24:32.359751046 +0200 ++++ b/dom/media/webrtc/transport/third_party/nICEr/src/stun/addrs-netlink.c 2020-07-28 19:24:37.856343751 +0200 +@@ -31,6 +31,7 @@ + */ + + #if defined(LINUX) ++#include + #include "addrs-netlink.h" + #include + #include diff --git a/srcpkgs/thunderbird/patches/fix-cross.patch b/srcpkgs/thunderbird/patches/fix-cross.patch deleted file mode 100644 index fad8f9060c4..00000000000 --- a/srcpkgs/thunderbird/patches/fix-cross.patch +++ /dev/null @@ -1,16 +0,0 @@ -terrible hack to fix cross builds -overwrite HOST_* flags to get rid of -MF - -note: this patch was used from firefox-77 until 80, dropped with the update to 81 - ---- a/third_party/rust/glslopt/build.rs -+++ b/third_party/rust/glslopt/build.rs -@@ -28,6 +28,8 @@ - env::remove_var(format!("CXXFLAGS_{}", &target)); - env::remove_var(format!("CFLAGS_{}", target.replace("-", "_"))); - env::remove_var(format!("CXXFLAGS_{}", target.replace("-", "_"))); -+ env::set_var("HOST_CFLAGS", "-O2"); -+ env::set_var("HOST_CXXFLAGS", "-O2"); - - configure(&mut cc::Build::new()) - .warnings(false) diff --git a/srcpkgs/thunderbird/patches/fix-fortify-inline.patch b/srcpkgs/thunderbird/patches/fix-fortify-inline.patch deleted file mode 100644 index 2498c57fc73..00000000000 --- a/srcpkgs/thunderbird/patches/fix-fortify-inline.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/media/webrtc/signaling/src/sdp/sipcc/sdp_os_defs.h -+++ b/media/webrtc/signaling/src/sdp/sipcc/sdp_os_defs.h -@@ -27,8 +27,5 @@ - typedef int16_t int16; - typedef unsigned short ushort; - typedef unsigned long ulong; --#ifndef __GNUC_STDC_INLINE__ --#define inline --#endif - - #endif /* _SDP_OS_DEFS_H_ */ diff --git a/srcpkgs/thunderbird/patches/fix-wasm-arm.patch b/srcpkgs/thunderbird/patches/fix-wasm-arm.patch deleted file mode 100644 index a6035e87616..00000000000 --- a/srcpkgs/thunderbird/patches/fix-wasm-arm.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/js/src/wasm/WasmSignalHandlers.cpp -+++ b/js/src/wasm/WasmSignalHandlers.cpp -@@ -243,9 +243,9 @@ - // If you run into compile problems on a tier-3 platform, you can disable the - // emulation here. - --#if defined(__linux__) && defined(__arm__) --# define WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS --#endif -+// #if defined(__linux__) && defined(__arm__) -+// # define WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS -+// #endif - - #ifdef WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS - # include diff --git a/srcpkgs/thunderbird/patches/fix-webrtc-glibcisms.patch b/srcpkgs/thunderbird/patches/fix-webrtc-glibcisms.patch index 70910da5861..5d17021a99f 100644 --- a/srcpkgs/thunderbird/patches/fix-webrtc-glibcisms.patch +++ b/srcpkgs/thunderbird/patches/fix-webrtc-glibcisms.patch @@ -1,5 +1,5 @@ ---- a/media/webrtc/trunk/webrtc/system_wrappers/source/cpu_features_linux.c 2019-01-29 11:20:52.298793223 +0100 -+++ b/media/webrtc/trunk/webrtc/system_wrappers/source/cpu_features_linux.c 2019-01-29 11:21:48.250250850 +0100 +--- a/third_party/libwebrtc/webrtc/system_wrappers/source/cpu_features_linux.c 2019-01-29 11:20:52.298793223 +0100 ++++ b/third_party/libwebrtc/webrtc/system_wrappers/source/cpu_features_linux.c 2019-01-29 11:21:48.250250850 +0100 @@ -14,7 +14,7 @@ #ifndef __GLIBC_PREREQ #define __GLIBC_PREREQ(a, b) 0 diff --git a/srcpkgs/thunderbird/patches/musl-rust.configure.patch b/srcpkgs/thunderbird/patches/musl-rust.configure.patch deleted file mode 100644 index 0b2f7dee1d3..00000000000 --- a/srcpkgs/thunderbird/patches/musl-rust.configure.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- a/build/moz.configure/rust.configure 2019-10-28 12:05:04.930404603 +0700 -+++ b/build/moz.configure/rust.configure 2019-10-28 12:09:42.742338957 +0700 -@@ -297,11 +297,20 @@ - suffix = 'hf' - else: - suffix = '' -+ -+ narrowed = [] - for p in prefixes: - for c in candidates: -- if c.rust_target.startswith('{}-'.format(p)) and \ -- c.rust_target.endswith(suffix): -- return c.rust_target -+ if c.rust_target.startswith('{}-'.format(p)): -+ narrowed.append(c.rust_target) -+ -+ for target in narrowed: -+ if target.endswith(host_or_target.raw_os): -+ return target -+ -+ for target in narrowed: -+ if target.endswith(suffix): -+ return target - - # See if we can narrow down on the exact alias - narrowed = [c for c in candidates if c.target.alias == host_or_target.alias] diff --git a/srcpkgs/thunderbird/patches/rust-configure.patch b/srcpkgs/thunderbird/patches/rust-configure.patch index 07b98d6c7ca..61fb2ba891d 100644 --- a/srcpkgs/thunderbird/patches/rust-configure.patch +++ b/srcpkgs/thunderbird/patches/rust-configure.patch @@ -1,42 +1,112 @@ Mozilla rustc check does not support crossbuild: let's remove it Remove calls to unwrap_rustup, they fail if rustup isn't present ---- a/build/moz.configure/rust.configure 2019-10-17 04:19:59.000000000 +0700 -+++ b/build/moz.configure/rust.configure 2019-10-22 11:48:55.616022140 +0700 -@@ -78,9 +78,6 @@ - +Do not try to figure out the rust target as it is broken on musl +instead use what is set in RUST_TARGET + +Skip extra checks on cross builds (broken for arm*) + +--- a/build/moz.configure/rust.configure 2020-12-12 01:35:33.000000000 +0100 ++++ b/build/moz.configure/rust.configure 2020-12-15 19:45:16.467750787 +0100 +@@ -91,9 +91,6 @@ return unwrap --rustc = unwrap_rustup(rustc, 'rustc') --cargo = unwrap_rustup(cargo, 'cargo') + +-rustc = unwrap_rustup(rustc, "rustc") +-cargo = unwrap_rustup(cargo, "cargo") - - set_config('CARGO', cargo) - set_config('RUSTC', rustc) -@@ -348,26 +345,6 @@ + set_config("CARGO", cargo) + set_config("RUSTC", rustc) +@@ -260,7 +257,9 @@ + data.setdefault(key, []).append(namespace(rust_target=t, target=info)) + return data - os.write(in_fd, source) - os.close(in_fd) - -- cmd = [ -- rustc, -- '--crate-type', 'staticlib', -- target_arg, -- '-o', out_path, -- in_path, -- ] ++@imports('os') ++@imports(_from='mozbuild.util', _import='ensure_unicode') ++@imports(_from='mozbuild.util', _import='system_encoding') + def detect_rustc_target( + host_or_target, compiler_info, arm_target, rust_supported_targets + ): +@@ -382,12 +381,12 @@ + + return None + +- rustc_target = find_candidate(candidates) ++ rustc_target = os.environ['RUST_TARGET'] + + if rustc_target is None: + die("Don't know how to translate {} for rustc".format(host_or_target.alias)) + +- return rustc_target ++ return ensure_unicode(rustc_target, system_encoding) + + + @imports("os") +@@ -410,35 +409,6 @@ + + os.write(in_fd, ensure_binary(source)) + os.close(in_fd) - -- def failed(): -- die(dedent('''\ -- Cannot compile for {} with {} -- The target may be unsupported, or you may not have -- a rust std library for that target installed. Try: +- cmd = [ +- rustc, +- "--crate-type", +- "staticlib", +- target_arg, +- "-o", +- out_path, +- in_path, +- ] - -- rustup target add {} -- '''.format(host_or_target.alias, rustc, rustc_target))) -- check_cmd_output(*cmd, onerror=failed) -- if not os.path.exists(out_path) or os.path.getsize(out_path) == 0: -- failed() - finally: - os.remove(in_path) - os.remove(out_path) +- def failed(): +- die( +- dedent( +- """\ +- Cannot compile for {} with {} +- The target may be unsupported, or you may not have +- a rust std library for that target installed. Try: +- +- rustup target add {} +- """.format( +- host_or_target.alias, rustc, rustc_target +- ) +- ) +- ) +- +- check_cmd_output(*cmd, onerror=failed) +- if not os.path.exists(out_path) or os.path.getsize(out_path) == 0: +- failed() + finally: + os.remove(in_path) + os.remove(out_path) +@@ -462,28 +432,7 @@ + host, compiler_info, arm_target, rust_supported_targets + ) + if rustc_target != rustc_host: +- if host.alias == rustc_target: +- configure_host = host.alias +- else: +- configure_host = "{}/{}".format(host.alias, rustc_target) +- die( +- dedent( +- """\ +- The rust compiler host ({rustc}) is not suitable for the configure host ({configure}). +- +- You can solve this by: +- * Set your configure host to match the rust compiler host by editing your +- mozconfig and adding "ac_add_options --host={rustc}". +- * Or, install the rust toolchain for {configure}, if supported, by running +- "rustup default stable-{rustc_target}" +- """.format( +- rustc=rustc_host, +- configure=configure_host, +- rustc_target=rustc_target, +- ) +- ) +- ) +- assert_rust_compile(host, rustc_target, rustc) ++ return rustc_host + return rustc_target + + diff --git a/srcpkgs/thunderbird/patches/rust-has-i128.patch b/srcpkgs/thunderbird/patches/rust-has-i128.patch deleted file mode 100644 index c25a185c1c1..00000000000 --- a/srcpkgs/thunderbird/patches/rust-has-i128.patch +++ /dev/null @@ -1,21 +0,0 @@ -The configure check fails for cross builds. -i128 is supported since rust-1.26, so it is safe for us to assume it is always present - ---- a/third_party/rust/num-traits/build.rs 2020-02-14 23:57:25.985355610 +0100 -+++ b/third_party/rust/num-traits/build.rs 2020-02-14 23:58:36.255710188 +0100 -@@ -1,14 +1,5 @@ --extern crate autocfg; -- --use std::env; -- - fn main() { -- let ac = autocfg::new(); -- if ac.probe_type("i128") { -- println!("cargo:rustc-cfg=has_i128"); -- } else if env::var_os("CARGO_FEATURE_I128").is_some() { -- panic!("i128 support was not detected!"); -- } -+ println!("cargo:rustc-cfg=has_i128"); - - autocfg::rerun_path("build.rs"); - } diff --git a/srcpkgs/thunderbird/patches/sandbox-fork.patch b/srcpkgs/thunderbird/patches/sandbox-fork.patch index 328943cb001..d4584e74b91 100644 --- a/srcpkgs/thunderbird/patches/sandbox-fork.patch +++ b/srcpkgs/thunderbird/patches/sandbox-fork.patch @@ -2,12 +2,14 @@ make SYS_fork non-fatal, musl uses it for fork(2) --- a/security/sandbox/linux/SandboxFilter.cpp +++ b/security/sandbox/linux/SandboxFilter.cpp -@@ -1253,6 +1253,8 @@ +@@ -1420,6 +1420,10 @@ // usually do something reasonable on error. case __NR_clone: return ClonePolicy(Error(EPERM)); ++# ifdef __NR_fork + case __NR_fork: + return Error(ENOSYS); ++# endif # ifdef __NR_fadvise64 case __NR_fadvise64: diff --git a/srcpkgs/thunderbird/patches/sndio.patch b/srcpkgs/thunderbird/patches/sndio.patch index 959fc1ec913..68628bea8d8 100644 --- a/srcpkgs/thunderbird/patches/sndio.patch +++ b/srcpkgs/thunderbird/patches/sndio.patch @@ -42,11 +42,11 @@ if CONFIG['OS_TARGET'] == 'Darwin': --- a/build/moz.configure/old.configure 2020-06-30 12:17:04.087609070 +0200 +++ b/build/moz.configure/old.configure 2020-06-30 12:17:04.087609070 +0200 -@@ -210,6 +210,7 @@ +@@ -88,6 +88,7 @@ @old_configure_options( - '--cache-file', - '--datadir', -+ '--enable-sndio', - '--enable-crashreporter', - '--enable-dbus', - '--enable-debug-js-modules', + "--cache-file", + "--datadir", ++ "--enable-sndio", + "--enable-crashreporter", + "--enable-dbus", + "--enable-debug-js-modules", diff --git a/srcpkgs/thunderbird/template b/srcpkgs/thunderbird/template index b6192f7bf02..b8cb35ad19e 100644 --- a/srcpkgs/thunderbird/template +++ b/srcpkgs/thunderbird/template @@ -3,7 +3,7 @@ # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/thunderbird-i18n". # pkgname=thunderbird -version=78.13.0 +version=91.2.0 revision=1 build_helper="rust" short_desc="Standalone Mail/News reader" @@ -11,7 +11,7 @@ maintainer="Érico Nogueira " license="MPL-2.0, GPL-2.0-or-later, LGPL-2.1-or-later" homepage="https://www.thunderbird.net/" distfiles="${MOZILLA_SITE}/${pkgname}/releases/${version}/source/${pkgname}-${version}.source.tar.xz" -checksum=b7e4076e5ce561b06ad9cd89005989ed71fd724ce83c4888cf569dc2930d90e9 +checksum=30476803f0bd4a46d2516ac5cbb831fc580b81d5d704af17c7df81e2bb6ee075 lib32disabled=yes @@ -159,6 +159,7 @@ do_build() { export MOZ_MAKE_FLAGS="${makejobs}" export MOZ_NOSPAM=1 export MOZBUILD_STATE_PATH="${wrksrc}/mozbuild" + export MACH_USE_SYSTEM_PYTHON=1 export AS=$CC @@ -179,6 +180,8 @@ ac_add_options --enable-default-toolkit=$(vopt_if wayland 'cairo-gtk3-wayland' ' ./mach build } do_install() { + export MACH_USE_SYSTEM_PYTHON=1 + export MOZBUILD_STATE_PATH="${wrksrc}/mozbuild" DESTDIR="$DESTDIR" ./mach install vinstall ${FILESDIR}/vendor.js 644 usr/lib/thunderbird/defaults/preferences