summaryrefslogtreecommitdiff
path: root/mail/thunderbird/patches
diff options
context:
space:
mode:
Diffstat (limited to 'mail/thunderbird/patches')
-rw-r--r--mail/thunderbird/patches/patch-mail_app_nsMailApp.cpp12
-rw-r--r--mail/thunderbird/patches/patch-mozilla_browser_installer_package-manifest.in22
-rw-r--r--mail/thunderbird/patches/patch-mozilla_build_autoconf_compiler-opts.m419
-rw-r--r--mail/thunderbird/patches/patch-mozilla_build_autoconf_nss.m446
-rw-r--r--mail/thunderbird/patches/patch-mozilla_build_gyp.mozbuild25
-rw-r--r--mail/thunderbird/patches/patch-mozilla_build_moz.configure_init.configure37
-rw-r--r--mail/thunderbird/patches/patch-mozilla_build_moz.configure_keyfiles.configure21
-rw-r--r--mail/thunderbird/patches/patch-mozilla_build_moz.configure_memory.configure13
-rw-r--r--mail/thunderbird/patches/patch-mozilla_build_moz.configure_old.configure25
-rw-r--r--mail/thunderbird/patches/patch-mozilla_config_Makefile.in38
-rw-r--r--mail/thunderbird/patches/patch-mozilla_config_external_moz.build41
-rw-r--r--mail/thunderbird/patches/patch-mozilla_config_rules.mk12
-rw-r--r--mail/thunderbird/patches/patch-mozilla_config_system-headers86
-rw-r--r--mail/thunderbird/patches/patch-mozilla_config_system__wrappers_unwind.h9
-rw-r--r--mail/thunderbird/patches/patch-mozilla_dom_base_DOMRequest.cpp12
-rw-r--r--mail/thunderbird/patches/patch-mozilla_dom_base_moz.build20
-rw-r--r--mail/thunderbird/patches/patch-mozilla_dom_filesystem_compat_FileSystemDirectoryReader.h12
-rw-r--r--mail/thunderbird/patches/patch-mozilla_dom_media_AudioStream.cpp38
-rw-r--r--mail/thunderbird/patches/patch-mozilla_dom_media_AudioStream.h28
-rw-r--r--mail/thunderbird/patches/patch-mozilla_dom_media_gstreamer_GStreamerAllocator.cpp12
-rw-r--r--mail/thunderbird/patches/patch-mozilla_dom_media_moz.build32
-rw-r--r--mail/thunderbird/patches/patch-mozilla_dom_media_platforms_ffmpeg_ffvpx_FFVPXRuntimeLinker.cpp39
-rw-r--r--mail/thunderbird/patches/patch-mozilla_dom_plugins_ipc_PluginProcessChild.cpp13
-rw-r--r--mail/thunderbird/patches/patch-mozilla_dom_system_OSFileConstants.cpp55
-rw-r--r--mail/thunderbird/patches/patch-mozilla_extensions_spellcheck_hunspell_glue_mozHunspell.cpp8
-rw-r--r--mail/thunderbird/patches/patch-mozilla_gfx_graphite2_moz-gr-update.sh30
-rw-r--r--mail/thunderbird/patches/patch-mozilla_gfx_moz.build8
-rw-r--r--mail/thunderbird/patches/patch-mozilla_gfx_skia_generate__mozbuild.py17
-rw-r--r--mail/thunderbird/patches/patch-mozilla_gfx_skia_moz.build17
-rw-r--r--mail/thunderbird/patches/patch-mozilla_gfx_skia_skia_src_core_SkUtilsArm.cpp45
-rw-r--r--mail/thunderbird/patches/patch-mozilla_gfx_skia_skia_src_opts_SkBitmapProcState__opts__arm.cpp28
-rw-r--r--mail/thunderbird/patches/patch-mozilla_gfx_skia_skia_src_opts_memset.arm.S49
-rw-r--r--mail/thunderbird/patches/patch-mozilla_gfx_thebes_moz.build32
-rw-r--r--mail/thunderbird/patches/patch-mozilla_gfx_ycbcr_yuv__row__arm.S331
-rw-r--r--mail/thunderbird/patches/patch-mozilla_image_Downscaler.h33
-rw-r--r--mail/thunderbird/patches/patch-mozilla_image_decoders_nsJPEGDecoder.cpp18
-rw-r--r--mail/thunderbird/patches/patch-mozilla_intl_unicharutil_util_moz.build12
-rw-r--r--mail/thunderbird/patches/patch-mozilla_ipc_chromium_src_base_file__util__posix.cc21
-rw-r--r--mail/thunderbird/patches/patch-mozilla_ipc_chromium_src_base_message__loop.cc38
-rw-r--r--mail/thunderbird/patches/patch-mozilla_ipc_chromium_src_base_platform__thread__posix.cc73
-rw-r--r--mail/thunderbird/patches/patch-mozilla_ipc_chromium_src_base_process__util__bsd.cc15
-rw-r--r--mail/thunderbird/patches/patch-mozilla_ipc_chromium_src_base_scoped__nsautorelease__pool.h42
-rw-r--r--mail/thunderbird/patches/patch-mozilla_ipc_glue_StringUtil.cpp21
-rw-r--r--mail/thunderbird/patches/patch-mozilla_ipc_glue_moz.build13
-rw-r--r--mail/thunderbird/patches/patch-mozilla_js_src_configure.in40
-rw-r--r--mail/thunderbird/patches/patch-mozilla_js_src_ctypes_CTypes.h28
-rw-r--r--mail/thunderbird/patches/patch-mozilla_js_src_frontend_ParseMaps.cpp12
-rw-r--r--mail/thunderbird/patches/patch-mozilla_js_src_jit_LIR.cpp13
-rw-r--r--mail/thunderbird/patches/patch-mozilla_js_src_jit_MIR.cpp13
-rw-r--r--mail/thunderbird/patches/patch-mozilla_js_src_jit_arm_Architecture-arm.cpp6
-rw-r--r--mail/thunderbird/patches/patch-mozilla_js_src_jit_none_AtomicOperations-sparc.h259
-rw-r--r--mail/thunderbird/patches/patch-mozilla_js_src_jsdate.cpp15
-rw-r--r--mail/thunderbird/patches/patch-mozilla_js_src_jskwgen.cpp13
-rw-r--r--mail/thunderbird/patches/patch-mozilla_js_src_jsmath.cpp13
-rw-r--r--mail/thunderbird/patches/patch-mozilla_js_src_jsnativestack.cpp13
-rw-r--r--mail/thunderbird/patches/patch-mozilla_js_src_moz.build15
-rw-r--r--mail/thunderbird/patches/patch-mozilla_js_src_old-configure.in32
-rw-r--r--mail/thunderbird/patches/patch-mozilla_js_src_shell_jsoptparse.cpp13
-rw-r--r--mail/thunderbird/patches/patch-mozilla_js_src_vm_SPSProfiler.cpp13
-rw-r--r--mail/thunderbird/patches/patch-mozilla_js_xpconnect_src_xpcprivate.h8
-rw-r--r--mail/thunderbird/patches/patch-mozilla_media_libcubeb_src_cubeb.c12
-rw-r--r--mail/thunderbird/patches/patch-mozilla_media_libcubeb_src_cubeb__alsa.c274
-rw-r--r--mail/thunderbird/patches/patch-mozilla_media_libcubeb_src_cubeb__oss.c68
-rw-r--r--mail/thunderbird/patches/patch-mozilla_media_libcubeb_src_moz.build30
-rw-r--r--mail/thunderbird/patches/patch-mozilla_media_libcubeb_tests_moz.build12
-rw-r--r--mail/thunderbird/patches/patch-mozilla_media_libcubeb_update.sh12
-rw-r--r--mail/thunderbird/patches/patch-mozilla_media_libpng_pngpriv.h12
-rw-r--r--mail/thunderbird/patches/patch-mozilla_media_libsoundtouch_src_soundtouch__perms.h14
-rw-r--r--mail/thunderbird/patches/patch-mozilla_media_libstagefright_frameworks_av_include_media_stagefright_foundation_AString.h12
-rw-r--r--mail/thunderbird/patches/patch-mozilla_media_libstagefright_frameworks_av_media_libstagefright_foundation_AString.cpp22
-rw-r--r--mail/thunderbird/patches/patch-mozilla_media_libstagefright_system_core_liblog_fake__log__device.c27
-rw-r--r--mail/thunderbird/patches/patch-mozilla_media_libstagefright_system_core_liblog_logprint.c22
-rw-r--r--mail/thunderbird/patches/patch-mozilla_media_libtheora_lib_info.c13
-rw-r--r--mail/thunderbird/patches/patch-mozilla_media_libtheora_moz.build8
-rw-r--r--mail/thunderbird/patches/patch-mozilla_media_libtremor_Makefile.in14
-rw-r--r--mail/thunderbird/patches/patch-mozilla_media_libtremor_moz.build6
-rw-r--r--mail/thunderbird/patches/patch-mozilla_media_libvorbis_Makefile.in14
-rw-r--r--mail/thunderbird/patches/patch-mozilla_media_libvorbis_lib_vorbis__info.c13
-rw-r--r--mail/thunderbird/patches/patch-mozilla_media_libvorbis_moz.build6
-rw-r--r--mail/thunderbird/patches/patch-mozilla_media_libyuv_include_libyuv_scale__row.h17
-rw-r--r--mail/thunderbird/patches/patch-mozilla_media_libyuv_source_mjpeg__decoder.cc12
-rw-r--r--mail/thunderbird/patches/patch-mozilla_media_mtransport_third__party_nICEr_src_util_mbslen.c18
-rw-r--r--mail/thunderbird/patches/patch-mozilla_media_mtransport_third__party_nrappkit_src_port_generic_include_sys_queue.h19
-rw-r--r--mail/thunderbird/patches/patch-mozilla_media_webrtc_signaling_test_common.build15
-rw-r--r--mail/thunderbird/patches/patch-mozilla_media_webrtc_trunk_webrtc_build_common.gypi13
-rw-r--r--mail/thunderbird/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_audio__coding_neteq_neteq.gypi28
-rw-r--r--mail/thunderbird/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_desktop__capture_screen__capturer.cc13
-rw-r--r--mail/thunderbird/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_desktop__capture_screen__capturer.h13
-rw-r--r--mail/thunderbird/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_linux_device__info__linux.cc14
-rw-r--r--mail/thunderbird/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_video__capture.gypi57
-rw-r--r--mail/thunderbird/patches/patch-mozilla_media_webrtc_trunk_webrtc_system__wrappers_source_spreadsortlib_spreadsort.hpp43
-rw-r--r--mail/thunderbird/patches/patch-mozilla_memory_build_mozjemalloc__compat.c53
-rw-r--r--mail/thunderbird/patches/patch-mozilla_memory_volatile_VolatileBufferOSX.cpp19
-rw-r--r--mail/thunderbird/patches/patch-mozilla_mfbt_Attributes.h30
-rw-r--r--mail/thunderbird/patches/patch-mozilla_mobile_android_installer_Makefile.in15
-rw-r--r--mail/thunderbird/patches/patch-mozilla_modules_libpref_init_all.js13
-rw-r--r--mail/thunderbird/patches/patch-mozilla_mozglue_build_arm.cpp18
-rw-r--r--mail/thunderbird/patches/patch-mozilla_netwerk_dns_moz.build12
-rw-r--r--mail/thunderbird/patches/patch-mozilla_old-configure.in (renamed from mail/thunderbird/patches/patch-mozilla_configure.in)237
-rw-r--r--mail/thunderbird/patches/patch-mozilla_storage_SQLiteMutex.h24
-rw-r--r--mail/thunderbird/patches/patch-mozilla_toolkit_components_osfile_modules_osfile__unix__back.jsm15
-rw-r--r--mail/thunderbird/patches/patch-mozilla_toolkit_components_osfile_modules_osfile__unix__front.jsm13
-rw-r--r--mail/thunderbird/patches/patch-mozilla_toolkit_components_protobuf_src_google_protobuf_stubs_atomicops.h10
-rw-r--r--mail/thunderbird/patches/patch-mozilla_toolkit_components_terminator_nsTerminator.cpp25
-rw-r--r--mail/thunderbird/patches/patch-mozilla_toolkit_library_moz.build59
-rw-r--r--mail/thunderbird/patches/patch-mozilla_toolkit_modules_GMPUtils.jsm12
-rw-r--r--mail/thunderbird/patches/patch-mozilla_toolkit_moz.configure31
-rw-r--r--mail/thunderbird/patches/patch-mozilla_toolkit_mozapps_extensions_test_browser_browser__gmpProvider.js12
-rw-r--r--mail/thunderbird/patches/patch-mozilla_toolkit_mozapps_installer_packager.mk10
-rw-r--r--mail/thunderbird/patches/patch-mozilla_toolkit_xre_nsAppRunner.cpp31
-rw-r--r--mail/thunderbird/patches/patch-mozilla_webapprt_moz.build13
-rw-r--r--mail/thunderbird/patches/patch-mozilla_xpcom_build_PoisonIOInterposer.h55
-rw-r--r--mail/thunderbird/patches/patch-mozilla_xpcom_build_XPCOMInit.cpp28
-rw-r--r--mail/thunderbird/patches/patch-mozilla_xpcom_components_Module.h13
-rw-r--r--mail/thunderbird/patches/patch-mozilla_xpcom_reflect_xptcall_md_unix_moz.build22
-rw-r--r--mail/thunderbird/patches/patch-mozilla_xpcom_reflect_xptcall_md_unix_xptcinvoke__gcc__x86__unix.cpp13
-rw-r--r--mail/thunderbird/patches/patch-mozilla_xpcom_reflect_xptcall_md_unix_xptcstubs__gcc__x86__unix.cpp13
-rw-r--r--mail/thunderbird/patches/patch-mozilla_xulrunner_installer_Makefile.in13
-rw-r--r--mail/thunderbird/patches/patch-mozilla_xulrunner_installer_libxul-embedding.pc.in12
-rw-r--r--mail/thunderbird/patches/patch-mozilla_xulrunner_installer_libxul.pc.in11
120 files changed, 1293 insertions, 2416 deletions
diff --git a/mail/thunderbird/patches/patch-mail_app_nsMailApp.cpp b/mail/thunderbird/patches/patch-mail_app_nsMailApp.cpp
index 0c4baa903a6..cd4e6323a45 100644
--- a/mail/thunderbird/patches/patch-mail_app_nsMailApp.cpp
+++ b/mail/thunderbird/patches/patch-mail_app_nsMailApp.cpp
@@ -1,8 +1,8 @@
-$NetBSD: patch-mail_app_nsMailApp.cpp,v 1.1 2016/04/17 18:33:50 ryoon Exp $
+$NetBSD: patch-mail_app_nsMailApp.cpp,v 1.2 2017/04/27 13:32:40 ryoon Exp $
---- mail/app/nsMailApp.cpp.orig 2016-04-07 21:14:22.000000000 +0000
+--- mail/app/nsMailApp.cpp.orig 2017-04-14 04:52:45.000000000 +0000
+++ mail/app/nsMailApp.cpp
-@@ -15,6 +15,26 @@
+@@ -14,6 +14,26 @@
#include <sys/resource.h>
#include <unistd.h>
#endif
@@ -27,9 +27,9 @@ $NetBSD: patch-mail_app_nsMailApp.cpp,v 1.1 2016/04/17 18:33:50 ryoon Exp $
+ fprintf(stderr, "warning: setrlimit failed\n");
+ }
- #ifdef XP_MACOSX
- #include "MacQuirks.h"
-@@ -213,6 +233,7 @@ FileExists(const char *path)
+ #include <stdio.h>
+ #include <stdarg.h>
+@@ -261,6 +281,7 @@ FileExists(const char *path)
static nsresult
InitXPCOMGlue(const char *argv0, nsIFile **xreDirectory)
{
diff --git a/mail/thunderbird/patches/patch-mozilla_browser_installer_package-manifest.in b/mail/thunderbird/patches/patch-mozilla_browser_installer_package-manifest.in
deleted file mode 100644
index aa935d80fdc..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_browser_installer_package-manifest.in
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD: patch-mozilla_browser_installer_package-manifest.in,v 1.4 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/browser/installer/package-manifest.in.orig 2016-04-07 21:33:17.000000000 +0000
-+++ mozilla/browser/installer/package-manifest.in
-@@ -606,7 +606,7 @@
- @RESPATH@/components/MozKeyboard.js
- @RESPATH@/components/InputMethod.manifest
-
--#ifdef MOZ_DEBUG
-+#if defined(ENABLE_TESTS) && defined(MOZ_DEBUG)
- @RESPATH@/components/TestInterfaceJS.js
- @RESPATH@/components/TestInterfaceJS.manifest
- @RESPATH@/components/TestInterfaceJSMaplike.js
-@@ -824,7 +824,7 @@
- #endif
-
- ; for Solaris SPARC
--#ifdef SOLARIS
-+#if defined(SOLARIS) && defined(SPARC)
- bin/libfreebl_32fpu_3.so
- bin/libfreebl_32int_3.so
- bin/libfreebl_32int64_3.so
diff --git a/mail/thunderbird/patches/patch-mozilla_build_autoconf_compiler-opts.m4 b/mail/thunderbird/patches/patch-mozilla_build_autoconf_compiler-opts.m4
deleted file mode 100644
index bdaeddc8643..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_build_autoconf_compiler-opts.m4
+++ /dev/null
@@ -1,19 +0,0 @@
-$NetBSD: patch-mozilla_build_autoconf_compiler-opts.m4,v 1.2 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/build/autoconf/compiler-opts.m4.orig 2016-04-07 21:33:17.000000000 +0000
-+++ mozilla/build/autoconf/compiler-opts.m4
-@@ -53,14 +53,6 @@ case "$target" in
- if test -z "$CXX"; then
- MOZ_PATH_PROGS(CXX, clang++)
- fi
-- IS_GCC=$($CC -v 2>&1 | grep gcc)
-- if test -n "$IS_GCC"
-- then
-- echo gcc is known to be broken on OS X, please use clang.
-- echo see http://developer.mozilla.org/en-US/docs/Developer_Guide/Build_Instructions/Mac_OS_X_Prerequisites
-- echo for more information.
-- exit 1
-- fi
- ;;
- esac
- fi
diff --git a/mail/thunderbird/patches/patch-mozilla_build_autoconf_nss.m4 b/mail/thunderbird/patches/patch-mozilla_build_autoconf_nss.m4
deleted file mode 100644
index 7ad03bd470e..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_build_autoconf_nss.m4
+++ /dev/null
@@ -1,46 +0,0 @@
-$NetBSD: patch-mozilla_build_autoconf_nss.m4,v 1.5 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/build/autoconf/nss.m4.orig 2016-04-07 21:33:17.000000000 +0000
-+++ mozilla/build/autoconf/nss.m4
-@@ -22,18 +22,18 @@ AC_ARG_WITH(nss-exec-prefix,
- if test -n "$nss_config_exec_prefix"; then
- nss_config_args="$nss_config_args --exec-prefix=$nss_config_exec_prefix"
- if test -z "$NSS_CONFIG"; then
-- NSS_CONFIG=$nss_config_exec_prefix/bin/nss-config
-+ NSS_CONFIG=$nss_config_exec_prefix/bin/pkg-config
- fi
- fi
- if test -n "$nss_config_prefix"; then
- nss_config_args="$nss_config_args --prefix=$nss_config_prefix"
- if test -z "$NSS_CONFIG"; then
-- NSS_CONFIG=$nss_config_prefix/bin/nss-config
-+ NSS_CONFIG=$nss_config_prefix/bin/pkg-config
- fi
- fi
-
- unset ac_cv_path_NSS_CONFIG
-- AC_PATH_PROG(NSS_CONFIG, nss-config, no)
-+ AC_PATH_PROG(NSS_CONFIG, pkg-config, no)
- min_nss_version=ifelse([$1], ,3.0.0,$1)
- AC_MSG_CHECKING(for NSS - version >= $min_nss_version)
-
-@@ -41,14 +41,14 @@ AC_ARG_WITH(nss-exec-prefix,
- if test "$NSS_CONFIG" = "no"; then
- no_nss="yes"
- else
-- NSS_CFLAGS=`$NSS_CONFIG $nss_config_args --cflags`
-- NSS_LIBS=`$NSS_CONFIG $nss_config_args --libs`
-+ NSS_CFLAGS=`$NSS_CONFIG $nss_config_args nss --cflags`
-+ NSS_LIBS=`$NSS_CONFIG $nss_config_args nss --libs`
-
-- nss_config_major_version=`$NSS_CONFIG $nss_config_args --version | \
-+ nss_config_major_version=`$NSS_CONFIG $nss_config_args nss --modversion | \
- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\(\.\([[0-9]]*\)\)\{0,1\}/\1/'`
-- nss_config_minor_version=`$NSS_CONFIG $nss_config_args --version | \
-+ nss_config_minor_version=`$NSS_CONFIG $nss_config_args nss --modversion | \
- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\(\.\([[0-9]]*\)\)\{0,1\}/\2/'`
-- nss_config_micro_version=`$NSS_CONFIG $nss_config_args --version | \
-+ nss_config_micro_version=`$NSS_CONFIG $nss_config_args nss --modversion | \
- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\(\.\([[0-9]]*\)\)\{0,1\}/\4/'`
- if test -z "$nss_config_micro_version"; then
- nss_config_micro_version="0"
diff --git a/mail/thunderbird/patches/patch-mozilla_build_gyp.mozbuild b/mail/thunderbird/patches/patch-mozilla_build_gyp.mozbuild
index 1f7a9e5ad69..d01755f94ff 100644
--- a/mail/thunderbird/patches/patch-mozilla_build_gyp.mozbuild
+++ b/mail/thunderbird/patches/patch-mozilla_build_gyp.mozbuild
@@ -1,6 +1,6 @@
-$NetBSD: patch-mozilla_build_gyp.mozbuild,v 1.3 2016/04/17 18:33:50 ryoon Exp $
+$NetBSD: patch-mozilla_build_gyp.mozbuild,v 1.4 2017/04/27 13:32:40 ryoon Exp $
---- mozilla/build/gyp.mozbuild.orig 2016-04-07 21:33:17.000000000 +0000
+--- mozilla/build/gyp.mozbuild.orig 2017-04-14 04:53:01.000000000 +0000
+++ mozilla/build/gyp.mozbuild
@@ -14,6 +14,7 @@ gyp_vars = {
'have_ethtool_cmd_speed_hi': 1 if CONFIG['MOZ_WEBRTC_HAVE_ETHTOOL_SPEED_HI'] else 0,
@@ -10,24 +10,3 @@ $NetBSD: patch-mozilla_build_gyp.mozbuild,v 1.3 2016/04/17 18:33:50 ryoon Exp $
# basic stuff for everything
'include_internal_video_render': 0,
'clang_use_chrome_plugins': 0,
-@@ -96,7 +97,7 @@ flavors = {
- 'WINNT': 'win',
- 'Android': 'linux' if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk' else 'android',
- 'Linux': 'linux',
-- 'Darwin': 'mac' if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa' else 'ios',
-+ 'Darwin': 'ios' if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cairo-uikit' else 'mac',
- 'SunOS': 'solaris',
- 'GNU/kFreeBSD': 'freebsd',
- 'DragonFly': 'dragonfly',
-@@ -131,5 +132,11 @@ if CONFIG['INTEL_ARCHITECTURE']:
- if not CONFIG['HAVE_TOOLCHAIN_SUPPORT_MSSSE3'] or not CONFIG['HAVE_TOOLCHAIN_SUPPORT_MSSE4_1']:
- gyp_vars['yuv_disable_asm'] = 1
-
-+# MacOS X SDK version should be able to configure with ./configure
-+# --enable-macos-target=VER
-+if CONFIG['MACOSX_DEPLOYMENT_TARGET']:
-+ gyp_vars['mac_sdk_min'] = CONFIG['MACOSX_DEPLOYMENT_TARGET']
-+ gyp_vars['mac_deployment_target'] = CONFIG['MACOSX_DEPLOYMENT_TARGET']
-+
- if CONFIG['MACOS_SDK_DIR']:
- gyp_vars['mac_sdk_path'] = CONFIG['MACOS_SDK_DIR']
diff --git a/mail/thunderbird/patches/patch-mozilla_build_moz.configure_init.configure b/mail/thunderbird/patches/patch-mozilla_build_moz.configure_init.configure
new file mode 100644
index 00000000000..36be3f477e8
--- /dev/null
+++ b/mail/thunderbird/patches/patch-mozilla_build_moz.configure_init.configure
@@ -0,0 +1,37 @@
+$NetBSD: patch-mozilla_build_moz.configure_init.configure,v 1.1 2017/04/27 13:32:40 ryoon Exp $
+
+--- mozilla/build/moz.configure/init.configure.orig 2017-04-14 04:53:01.000000000 +0000
++++ mozilla/build/moz.configure/init.configure
+@@ -134,6 +134,7 @@ option(env='PYTHON', nargs=1, help='Pyth
+ @imports(_from='mozbuild.configure.util', _import='LineIO')
+ @imports(_from='mozbuild.virtualenv', _import='VirtualenvManager')
+ @imports(_from='mozbuild.virtualenv', _import='verify_python_version')
++@imports(_from='__builtin__', _import='KeyError')
+ @imports('distutils.sysconfig')
+ def virtualenv_python(env_python, build_env, mozconfig, help):
+ if help:
+@@ -153,6 +154,12 @@ def virtualenv_python(env_python, build_
+ python = mozconfig['vars']['added']['PYTHON']
+ elif 'PYTHON' in mozconfig['vars']['modified']:
+ python = mozconfig['vars']['modified']['PYTHON'][1]
++ for i in ('env', 'vars'):
++ for j in ('added', 'modified'):
++ try:
++ del mozconfig[i][j]['PYTHON']
++ except KeyError:
++ pass
+
+ with LineIO(lambda l: log.error(l)) as out:
+ verify_python_version(out)
+@@ -188,7 +195,10 @@ def virtualenv_python(env_python, build_
+ if python != normsep(sys.executable):
+ log.info('Reexecuting in the virtualenv')
+ if env_python:
+- del os.environ['PYTHON']
++ try:
++ del os.environ['PYTHON']
++ except KeyError:
++ pass
+ # One would prefer to use os.execl, but that's completely borked on
+ # Windows.
+ sys.exit(subprocess.call([python] + sys.argv))
diff --git a/mail/thunderbird/patches/patch-mozilla_build_moz.configure_keyfiles.configure b/mail/thunderbird/patches/patch-mozilla_build_moz.configure_keyfiles.configure
new file mode 100644
index 00000000000..beae376e972
--- /dev/null
+++ b/mail/thunderbird/patches/patch-mozilla_build_moz.configure_keyfiles.configure
@@ -0,0 +1,21 @@
+$NetBSD: patch-mozilla_build_moz.configure_keyfiles.configure,v 1.1 2017/04/27 13:32:40 ryoon Exp $
+
+--- mozilla/build/moz.configure/keyfiles.configure.orig 2017-04-14 04:53:01.000000000 +0000
++++ mozilla/build/moz.configure/keyfiles.configure
+@@ -18,6 +18,7 @@ def keyfile(desc, help=None, callback=la
+ @checking('for the %s key' % desc, lambda x: x and x is not no_key)
+ @imports(_from='__builtin__', _import='open')
+ @imports(_from='__builtin__', _import='IOError')
++ @imports(_from='os', _import='environ')
+ def keyfile(value):
+ if value:
+ try:
+@@ -28,7 +29,7 @@ def keyfile(desc, help=None, callback=la
+ raise FatalCheckError("'%s' is empty." % value[0])
+ except IOError as e:
+ raise FatalCheckError("'%s': %s." % (value[0], e.strerror))
+- return no_key
++ return environ.get('MOZ_%s_KEY' % desc.upper().replace(' ', '_')) or no_key
+
+ return keyfile
+
diff --git a/mail/thunderbird/patches/patch-mozilla_build_moz.configure_memory.configure b/mail/thunderbird/patches/patch-mozilla_build_moz.configure_memory.configure
new file mode 100644
index 00000000000..c60629b9518
--- /dev/null
+++ b/mail/thunderbird/patches/patch-mozilla_build_moz.configure_memory.configure
@@ -0,0 +1,13 @@
+$NetBSD: patch-mozilla_build_moz.configure_memory.configure,v 1.1 2017/04/27 13:32:40 ryoon Exp $
+
+--- mozilla/build/moz.configure/memory.configure.orig 2017-04-14 04:53:01.000000000 +0000
++++ mozilla/build/moz.configure/memory.configure
+@@ -66,7 +66,7 @@ def jemalloc_os_define(jemalloc, jemallo
+ return 'MOZ_MEMORY_LINUX'
+ if target.kernel == 'Darwin':
+ return 'MOZ_MEMORY_DARWIN'
+- if target.kernel in ('kFreeBSD', 'FreeBSD', 'NetBSD'):
++ if target.kernel in ('kFreeBSD', 'FreeBSD', 'NetBSD', 'DragonFly'):
+ return 'MOZ_MEMORY_BSD'
+ die('--enable-jemalloc is not supported on %s', target.kernel)
+
diff --git a/mail/thunderbird/patches/patch-mozilla_build_moz.configure_old.configure b/mail/thunderbird/patches/patch-mozilla_build_moz.configure_old.configure
new file mode 100644
index 00000000000..2d056edbd86
--- /dev/null
+++ b/mail/thunderbird/patches/patch-mozilla_build_moz.configure_old.configure
@@ -0,0 +1,25 @@
+$NetBSD: patch-mozilla_build_moz.configure_old.configure,v 1.1 2017/04/27 13:32:40 ryoon Exp $
+
+--- mozilla/build/moz.configure/old.configure.orig 2017-04-14 04:53:01.000000000 +0000
++++ mozilla/build/moz.configure/old.configure
+@@ -276,6 +276,7 @@ def old_configure_options(*options):
+ '--with-nspr-prefix',
+ '--with-nss-exec-prefix',
+ '--with-nss-prefix',
++ '--with-oss',
+ '--with-pthreads',
+ '--with-qemu-exe',
+ '--with-sixgill',
+@@ -287,7 +288,12 @@ def old_configure_options(*options):
+ '--with-system-libvpx',
+ '--with-system-nspr',
+ '--with-system-nss',
++ '--with-system-ogg',
+ '--with-system-png',
++ '--with-system-soundtouch',
++ '--with-system-theora',
++ '--with-system-tremor',
++ '--with-system-vorbis',
+ '--with-system-zlib',
+ '--with-thumb',
+ '--with-thumb-interwork',
diff --git a/mail/thunderbird/patches/patch-mozilla_config_Makefile.in b/mail/thunderbird/patches/patch-mozilla_config_Makefile.in
index 03f4a9293c1..cf20d363e10 100644
--- a/mail/thunderbird/patches/patch-mozilla_config_Makefile.in
+++ b/mail/thunderbird/patches/patch-mozilla_config_Makefile.in
@@ -1,21 +1,25 @@
-$NetBSD: patch-mozilla_config_Makefile.in,v 1.4 2016/04/17 18:33:50 ryoon Exp $
+$NetBSD: patch-mozilla_config_Makefile.in,v 1.5 2017/04/27 13:32:40 ryoon Exp $
---- mozilla/config/Makefile.in.orig 2016-04-07 21:33:18.000000000 +0000
+--- mozilla/config/Makefile.in.orig 2017-04-14 04:53:01.000000000 +0000
+++ mozilla/config/Makefile.in
-@@ -73,6 +73,16 @@ export:: $(export-preqs)
- -DMOZ_NATIVE_LIBEVENT=$(MOZ_NATIVE_LIBEVENT) \
- -DMOZ_NATIVE_LIBVPX=$(MOZ_NATIVE_LIBVPX) \
- -DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \
-+ -DMOZ_NATIVE_GRAPHITE2=$(MOZ_NATIVE_GRAPHITE2) \
-+ -DMOZ_NATIVE_HARFBUZZ=$(MOZ_NATIVE_HARFBUZZ) \
-+ -DMOZ_NATIVE_OGG=$(MOZ_NATIVE_OGG) \
-+ -DMOZ_NATIVE_THEORA=$(MOZ_NATIVE_THEORA) \
-+ -DMOZ_NATIVE_VORBIS=$(MOZ_NATIVE_VORBIS) \
-+ -DMOZ_NATIVE_TREMOR=$(MOZ_NATIVE_TREMOR) \
-+ -DMOZ_NATIVE_CELT=$(MOZ_NATIVE_CELT) \
-+ -DMOZ_NATIVE_OPUS=$(MOZ_NATIVE_OPUS) \
-+ -DMOZ_NATIVE_SPEEX=$(MOZ_NATIVE_SPEEX) \
-+ -DMOZ_NATIVE_SOUNDTOUCH=$(MOZ_NATIVE_SOUNDTOUCH) \
- $(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers
+@@ -41,6 +41,8 @@ export:: $(export-preqs)
+ $(PYTHON) -m mozbuild.action.preprocessor $(DEFINES) $(ACDEFINES) \
+ -DMOZ_TREE_CAIRO=$(MOZ_TREE_CAIRO) \
+ -DMOZ_TREE_PIXMAN=$(MOZ_TREE_PIXMAN) \
++ -DMOZ_SYSTEM_GRAPHITE2=$(MOZ_SYSTEM_GRAPHITE2) \
++ -DMOZ_SYSTEM_HARFBUZZ=$(MOZ_SYSTEM_HARFBUZZ) \
+ -DMOZ_SYSTEM_HUNSPELL=$(MOZ_SYSTEM_HUNSPELL) \
+ -DMOZ_SYSTEM_BZ2=$(MOZ_SYSTEM_BZ2) \
+ -DMOZ_SYSTEM_ZLIB=$(MOZ_SYSTEM_ZLIB) \
+@@ -49,6 +51,11 @@ export:: $(export-preqs)
+ -DMOZ_SYSTEM_LIBEVENT=$(MOZ_SYSTEM_LIBEVENT) \
+ -DMOZ_SYSTEM_LIBVPX=$(MOZ_SYSTEM_LIBVPX) \
+ -DMOZ_SYSTEM_ICU=$(MOZ_SYSTEM_ICU) \
++ -DMOZ_SYSTEM_OGG=$(MOZ_SYSTEM_OGG) \
++ -DMOZ_SYSTEM_THEORA=$(MOZ_SYSTEM_THEORA) \
++ -DMOZ_SYSTEM_VORBIS=$(MOZ_SYSTEM_VORBIS) \
++ -DMOZ_SYSTEM_TREMOR=$(MOZ_SYSTEM_TREMOR) \
++ -DMOZ_SYSTEM_SOUNDTOUCH=$(MOZ_SYSTEM_SOUNDTOUCH) \
+ $(srcdir)/system-headers $(srcdir)/stl-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers
$(INSTALL) system_wrappers $(DIST)
diff --git a/mail/thunderbird/patches/patch-mozilla_config_external_moz.build b/mail/thunderbird/patches/patch-mozilla_config_external_moz.build
index 60d95e54aeb..c4b85a87b59 100644
--- a/mail/thunderbird/patches/patch-mozilla_config_external_moz.build
+++ b/mail/thunderbird/patches/patch-mozilla_config_external_moz.build
@@ -1,36 +1,41 @@
-$NetBSD: patch-mozilla_config_external_moz.build,v 1.3 2016/04/17 18:33:50 ryoon Exp $
+$NetBSD: patch-mozilla_config_external_moz.build,v 1.4 2017/04/27 13:32:40 ryoon Exp $
---- mozilla/config/external/moz.build.orig 2016-04-07 21:33:18.000000000 +0000
+--- mozilla/config/external/moz.build.orig 2017-04-14 04:53:01.000000000 +0000
+++ mozilla/config/external/moz.build
-@@ -20,10 +20,19 @@ if CONFIG['MOZ_UPDATER']:
- # There's no "native brotli" yet, but probably in the future...
+@@ -21,12 +21,21 @@ if CONFIG['MOZ_UPDATER']:
external_dirs += ['modules/brotli']
+ external_dirs += ['modules/woff2']
-if CONFIG['MOZ_VORBIS']:
-+if not CONFIG['MOZ_NATIVE_OGG']:
++if not CONFIG['MOZ_SYSTEM_OGG']:
+ external_dirs += ['media/libogg']
+
-+if not CONFIG['MOZ_NATIVE_CELT'] or not CONFIG['MOZ_NATIVE_OPUS']:
-+ external_dirs += ['media/libopus']
-+
-+if not CONFIG['MOZ_NATIVE_THEORA']:
-+ external_dirs += ['media/libtheora']
-+
-+if CONFIG['MOZ_VORBIS'] and not CONFIG['MOZ_NATIVE_VORBIS']:
++if CONFIG['MOZ_VORBIS'] and not CONFIG['MOZ_SYSTEM_VORBIS']:
external_dirs += ['media/libvorbis']
-if CONFIG['MOZ_TREMOR']:
-+if CONFIG['MOZ_TREMOR'] and not CONFIG['MOZ_NATIVE_TREMOR']:
++if CONFIG['MOZ_TREMOR'] and not CONFIG['MOZ_SYSTEM_TREMOR']:
external_dirs += ['media/libtremor']
- if CONFIG['MOZ_WEBM']:
-@@ -50,9 +59,6 @@ if CONFIG['MOZ_WEBSPEECH_POCKETSPHINX']:
- external_dirs += [
++if not CONFIG['MOZ_SYSTEM_THEORA']:
++ external_dirs += ['media/libtheora']
++
++if not CONFIG['MOZ_SYSTEM_SOUNDTOUCH']:
++ external_dirs += ['media/libsoundtouch']
++
+ if CONFIG['MOZ_WEBM_ENCODER']:
+ external_dirs += ['media/libmkv']
+
+@@ -52,12 +61,9 @@ external_dirs += [
'media/kiss_fft',
'media/libcubeb',
+ 'media/libnestegg',
- 'media/libogg',
-- 'media/libopus',
+ 'media/libopus',
- 'media/libtheora',
'media/libspeex_resampler',
'media/libstagefright',
- 'media/libsoundtouch',
+- 'media/libsoundtouch',
+ 'media/psshparser'
+ ]
+
diff --git a/mail/thunderbird/patches/patch-mozilla_config_rules.mk b/mail/thunderbird/patches/patch-mozilla_config_rules.mk
deleted file mode 100644
index 949006985a8..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_config_rules.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-$NetBSD: patch-mozilla_config_rules.mk,v 1.1 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/config/rules.mk.orig 2016-04-07 21:33:18.000000000 +0000
-+++ mozilla/config/rules.mk
-@@ -773,6 +773,7 @@ endif
- ifdef DTRACE_PROBE_OBJ
- EXTRA_DEPS += $(DTRACE_PROBE_OBJ)
- OBJS += $(DTRACE_PROBE_OBJ)
-+EXCLUDED_OBJS += $(DTRACE_PROBE_OBJ)
- endif
-
- $(filter %.$(LIB_SUFFIX),$(LIBRARY)): $(OBJS) $(STATIC_LIBS_DEPS) $(filter %.$(LIB_SUFFIX),$(EXTRA_LIBS)) $(EXTRA_DEPS) $(GLOBAL_DEPS)
diff --git a/mail/thunderbird/patches/patch-mozilla_config_system-headers b/mail/thunderbird/patches/patch-mozilla_config_system-headers
index bf92ca482d6..eda0ff65b65 100644
--- a/mail/thunderbird/patches/patch-mozilla_config_system-headers
+++ b/mail/thunderbird/patches/patch-mozilla_config_system-headers
@@ -1,90 +1,46 @@
-$NetBSD: patch-mozilla_config_system-headers,v 1.10 2016/04/17 18:33:50 ryoon Exp $
+$NetBSD: patch-mozilla_config_system-headers,v 1.11 2017/04/27 13:32:40 ryoon Exp $
---- mozilla/config/system-headers.orig 2016-04-07 21:33:18.000000000 +0000
+--- mozilla/config/system-headers.orig 2017-04-14 04:53:01.000000000 +0000
+++ mozilla/config/system-headers
-@@ -628,6 +628,7 @@ libgnome/libgnome.h
+@@ -624,6 +624,7 @@ libgnome/libgnome.h
libgnomeui/gnome-icon-lookup.h
libgnomeui/gnome-icon-theme.h
libgnomeui/gnome-ui-init.h
+libv4l2.h
- lib$routines.h
- limits
limits.h
-@@ -722,6 +723,7 @@ mapiutil.h
- mapix.h
- Math64.h
- math.h
-+complex
- mbstring.h
+ link.h
#ifdef ANDROID
- media/AudioEffect.h
-@@ -1314,6 +1316,25 @@ vpx/vp8cx.h
- vpx/vp8dx.h
- vpx_mem/vpx_mem.h
+@@ -1267,6 +1268,15 @@ libsn/sn-launcher.h
+ libsn/sn-monitor.h
+ libsn/sn-util.h
#endif
-+#ifdef GKMEDIAS_SHARED_LIBRARY
-+vpx/vpx_codec.h
-+vpx/vpx_decoder.h
-+vpx/vpx_encoder.h
-+vpx/vp8cx.h
-+vpx/vp8dx.h
-+vpx_mem/vpx_mem.h
-+vorbis/codec.h
-+theora/theoradec.h
-+tremor/ivorbiscodec.h
-+speex/speex_resampler.h
-+soundtouch/SoundTouch.h
-+ogg/ogg.h
-+ogg/os_types.h
-+nestegg/nestegg.h
-+cubeb/cubeb.h
-+speex/speex_resampler.h
-+soundtouch/SoundTouch.h
-+#endif
- gst/gst.h
- gst/app/gstappsink.h
- gst/app/gstappsrc.h
-@@ -1344,3 +1365,43 @@ unicode/utypes.h
- #endif
- libutil.h
- unwind.h
-+#if MOZ_NATIVE_GRAPHITE2==1
++#if MOZ_SYSTEM_GRAPHITE2==1
+graphite2/Font.h
+graphite2/Segment.h
+#endif
-+#if MOZ_NATIVE_HARFBUZZ==1
++#if MOZ_SYSTEM_HARFBUZZ==1
++harfbuzz/hb-glib.h
+harfbuzz/hb-ot.h
+harfbuzz/hb.h
+#endif
-+#if MOZ_NATIVE_OGG==1
+ #if MOZ_SYSTEM_HUNSPELL==1
+ hunspell.hxx
+ #endif
+@@ -1335,3 +1345,17 @@ unicode/utypes.h
+ libutil.h
+ unwind.h
+ fenv.h
++#if MOZ_SYSTEM_OGG==1
+ogg/ogg.h
+ogg/os_types.h
+#endif
-+#if MOZ_NATIVE_THEORA==1
++#if MOZ_SYSTEM_THEORA==1
+theora/theoradec.h
+#endif
-+#if MOZ_NATIVE_VORBIS==1
++#if MOZ_SYSTEM_VORBIS==1
+vorbis/codec.h
+vorbis/vorbisenc.h
+#endif
-+#if MOZ_NATIVE_TREMOR==1
++#if MOZ_SYSTEM_TREMOR==1
+tremor/ivorbiscodec.h
+#endif
-+#if MOZ_NATIVE_CELT==1
-+celt.h
-+celt_header.h
-+celt/celt.h
-+celt/celt_header.h
-+#endif
-+#if MOZ_NATIVE_OPUS==1
-+opus.h
-+opus_multistream.h
-+opus/opus.h
-+opus/opus_multistream.h
-+#endif
-+#if MOZ_NATIVE_SPEEX==1
-+speex/speex_resampler.h
-+#endif
-+#if MOZ_NATIVE_SOUNDTOUCH==1
-+soundtouch/SoundTouch.h
-+#endif
diff --git a/mail/thunderbird/patches/patch-mozilla_config_system__wrappers_unwind.h b/mail/thunderbird/patches/patch-mozilla_config_system__wrappers_unwind.h
new file mode 100644
index 00000000000..e9400c94f9d
--- /dev/null
+++ b/mail/thunderbird/patches/patch-mozilla_config_system__wrappers_unwind.h
@@ -0,0 +1,9 @@
+$NetBSD: patch-mozilla_config_system__wrappers_unwind.h,v 1.5 2017/04/27 13:32:40 ryoon Exp $
+
+--- mozilla/config/system_wrappers/unwind.h.orig 2017-04-25 12:22:45.864950181 +0000
++++ mozilla/config/system_wrappers/unwind.h
+@@ -0,0 +1,4 @@
++#pragma GCC system_header
++#pragma GCC visibility push(default)
++#include_next <unwind.h>
++#pragma GCC visibility pop
diff --git a/mail/thunderbird/patches/patch-mozilla_dom_base_DOMRequest.cpp b/mail/thunderbird/patches/patch-mozilla_dom_base_DOMRequest.cpp
deleted file mode 100644
index ff05b994fd1..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_dom_base_DOMRequest.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-$NetBSD: patch-mozilla_dom_base_DOMRequest.cpp,v 1.1 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/dom/base/DOMRequest.cpp.orig 2016-04-07 21:33:22.000000000 +0000
-+++ mozilla/dom/base/DOMRequest.cpp
-@@ -20,7 +20,6 @@ using mozilla::dom::DOMError;
- using mozilla::dom::DOMRequest;
- using mozilla::dom::DOMRequestService;
- using mozilla::dom::DOMCursor;
--using mozilla::dom::Promise;
- using mozilla::dom::AutoJSAPI;
-
- DOMRequest::DOMRequest(nsPIDOMWindow* aWindow)
diff --git a/mail/thunderbird/patches/patch-mozilla_dom_base_moz.build b/mail/thunderbird/patches/patch-mozilla_dom_base_moz.build
index 7140c46a05f..189a91d951f 100644
--- a/mail/thunderbird/patches/patch-mozilla_dom_base_moz.build
+++ b/mail/thunderbird/patches/patch-mozilla_dom_base_moz.build
@@ -1,14 +1,14 @@
-$NetBSD: patch-mozilla_dom_base_moz.build,v 1.2 2016/04/17 18:33:50 ryoon Exp $
+$NetBSD: patch-mozilla_dom_base_moz.build,v 1.3 2017/04/27 13:32:40 ryoon Exp $
---- mozilla/dom/base/moz.build.orig 2016-04-07 21:33:22.000000000 +0000
+--- mozilla/dom/base/moz.build.orig 2017-04-14 04:53:03.000000000 +0000
+++ mozilla/dom/base/moz.build
-@@ -393,6 +393,9 @@ if CONFIG['INTEL_ARCHITECTURE']:
- SOURCES += ['nsTextFragmentSSE2.cpp']
- SOURCES['nsTextFragmentSSE2.cpp'].flags += CONFIG['SSE2_FLAGS']
+@@ -478,6 +478,9 @@ if CONFIG['MOZ_BUILD_APP'] in ['browser'
+ if CONFIG['MOZ_X11']:
+ CXXFLAGS += CONFIG['TK_CFLAGS']
-+if CONFIG['MOZ_NATIVE_HARFBUZZ']:
-+ SOURCES['nsContentUtils.cpp'].flags += CONFIG['MOZ_HARFBUZZ_CFLAGS']
++if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
++ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
+
- EXTRA_COMPONENTS += [
- 'ConsoleAPI.manifest',
- 'ConsoleAPIStorage.js',
+ GENERATED_FILES += [
+ 'PropertyUseCounterMap.inc',
+ 'UseCounterList.h',
diff --git a/mail/thunderbird/patches/patch-mozilla_dom_filesystem_compat_FileSystemDirectoryReader.h b/mail/thunderbird/patches/patch-mozilla_dom_filesystem_compat_FileSystemDirectoryReader.h
new file mode 100644
index 00000000000..86d71eecc31
--- /dev/null
+++ b/mail/thunderbird/patches/patch-mozilla_dom_filesystem_compat_FileSystemDirectoryReader.h
@@ -0,0 +1,12 @@
+$NetBSD: patch-mozilla_dom_filesystem_compat_FileSystemDirectoryReader.h,v 1.1 2017/04/27 13:32:40 ryoon Exp $
+
+--- mozilla/dom/filesystem/compat/FileSystemDirectoryReader.h.orig 2017-04-14 04:53:05.000000000 +0000
++++ mozilla/dom/filesystem/compat/FileSystemDirectoryReader.h
+@@ -11,6 +11,7 @@
+ #include "mozilla/ErrorResult.h"
+ #include "mozilla/dom/BindingDeclarations.h"
+ #include "nsCycleCollectionParticipant.h"
++#include "mozilla/dom/FileSystemDirectoryEntry.h"
+ #include "nsWrapperCache.h"
+
+ namespace mozilla {
diff --git a/mail/thunderbird/patches/patch-mozilla_dom_media_AudioStream.cpp b/mail/thunderbird/patches/patch-mozilla_dom_media_AudioStream.cpp
new file mode 100644
index 00000000000..05975c870e0
--- /dev/null
+++ b/mail/thunderbird/patches/patch-mozilla_dom_media_AudioStream.cpp
@@ -0,0 +1,38 @@
+$NetBSD: patch-mozilla_dom_media_AudioStream.cpp,v 1.1 2017/04/27 13:32:40 ryoon Exp $
+
+--- mozilla/dom/media/AudioStream.cpp.orig 2017-04-14 04:53:05.000000000 +0000
++++ mozilla/dom/media/AudioStream.cpp
+@@ -115,7 +115,9 @@ AudioStream::AudioStream(DataSource& aSo
+ : mMonitor("AudioStream")
+ , mChannels(0)
+ , mOutChannels(0)
++#ifndef MOZ_SYSTEM_SOUNDTOUCH
+ , mTimeStretcher(nullptr)
++#endif
+ , mDumpFile(nullptr)
+ , mState(INITIALIZED)
+ , mDataSource(aSource)
+@@ -130,9 +132,11 @@ AudioStream::~AudioStream()
+ if (mDumpFile) {
+ fclose(mDumpFile);
+ }
++#ifndef MOZ_SYSTEM_SOUNDTOUCH
+ if (mTimeStretcher) {
+ soundtouch::destroySoundTouchObj(mTimeStretcher);
+ }
++#endif
+ }
+
+ size_t
+@@ -151,7 +155,11 @@ nsresult AudioStream::EnsureTimeStretche
+ {
+ mMonitor.AssertCurrentThreadOwns();
+ if (!mTimeStretcher) {
++#ifdef MOZ_SYSTEM_SOUNDTOUCH
++ mTimeStretcher = new soundtouch::SoundTouch();
++#else
+ mTimeStretcher = soundtouch::createSoundTouchObj();
++#endif
+ mTimeStretcher->setSampleRate(mAudioClock.GetInputRate());
+ mTimeStretcher->setChannels(mOutChannels);
+ mTimeStretcher->setPitch(1.0);
diff --git a/mail/thunderbird/patches/patch-mozilla_dom_media_AudioStream.h b/mail/thunderbird/patches/patch-mozilla_dom_media_AudioStream.h
new file mode 100644
index 00000000000..adf16a591b2
--- /dev/null
+++ b/mail/thunderbird/patches/patch-mozilla_dom_media_AudioStream.h
@@ -0,0 +1,28 @@
+$NetBSD: patch-mozilla_dom_media_AudioStream.h,v 1.3 2017/04/27 13:32:40 ryoon Exp $
+
+--- mozilla/dom/media/AudioStream.h.orig 2017-04-14 04:53:05.000000000 +0000
++++ mozilla/dom/media/AudioStream.h
+@@ -16,7 +16,11 @@
+ #include "mozilla/TimeStamp.h"
+ #include "mozilla/UniquePtr.h"
+ #include "CubebUtils.h"
++#ifdef MOZ_SYSTEM_SOUNDTOUCH
++#include "soundtouch/SoundTouch.h"
++#else
+ #include "soundtouch/SoundTouchFactory.h"
++#endif
+
+ namespace mozilla {
+
+@@ -281,7 +285,11 @@ private:
+ uint32_t mChannels;
+ uint32_t mOutChannels;
+ AudioClock mAudioClock;
++#ifdef MOZ_SYSTEM_SOUNDTOUCH
++ nsAutoPtr<soundtouch::SoundTouch> mTimeStretcher;
++#else
+ soundtouch::SoundTouch* mTimeStretcher;
++#endif
+
+ // Output file for dumping audio
+ FILE* mDumpFile;
diff --git a/mail/thunderbird/patches/patch-mozilla_dom_media_gstreamer_GStreamerAllocator.cpp b/mail/thunderbird/patches/patch-mozilla_dom_media_gstreamer_GStreamerAllocator.cpp
deleted file mode 100644
index 8d9c8554581..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_dom_media_gstreamer_GStreamerAllocator.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-$NetBSD: patch-mozilla_dom_media_gstreamer_GStreamerAllocator.cpp,v 1.2 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/dom/media/gstreamer/GStreamerAllocator.cpp.orig 2016-04-07 21:33:27.000000000 +0000
-+++ mozilla/dom/media/gstreamer/GStreamerAllocator.cpp
-@@ -51,7 +51,6 @@ typedef struct
- #pragma GCC diagnostic ignored "-Wunused-function"
- G_DEFINE_TYPE(MozGfxMemoryAllocator, moz_gfx_memory_allocator, GST_TYPE_ALLOCATOR);
- G_DEFINE_TYPE(MozGfxBufferPool, moz_gfx_buffer_pool, GST_TYPE_VIDEO_BUFFER_POOL);
--#pragma GCC diagnostic pop
-
- void
- moz_gfx_memory_reset(MozGfxMemory *mem)
diff --git a/mail/thunderbird/patches/patch-mozilla_dom_media_moz.build b/mail/thunderbird/patches/patch-mozilla_dom_media_moz.build
index f34064245c2..0627d4f0a50 100644
--- a/mail/thunderbird/patches/patch-mozilla_dom_media_moz.build
+++ b/mail/thunderbird/patches/patch-mozilla_dom_media_moz.build
@@ -1,32 +1,26 @@
-$NetBSD: patch-mozilla_dom_media_moz.build,v 1.2 2016/04/17 18:33:50 ryoon Exp $
+$NetBSD: patch-mozilla_dom_media_moz.build,v 1.3 2017/04/27 13:32:40 ryoon Exp $
---- mozilla/dom/media/moz.build.orig 2016-04-07 21:33:27.000000000 +0000
+--- mozilla/dom/media/moz.build.orig 2017-04-14 04:53:05.000000000 +0000
+++ mozilla/dom/media/moz.build
-@@ -319,6 +319,27 @@ if CONFIG['MOZ_GONK_MEDIACODEC']:
- CFLAGS += CONFIG['GSTREAMER_CFLAGS']
- CXXFLAGS += CONFIG['GSTREAMER_CFLAGS']
+@@ -315,6 +315,21 @@ if CONFIG['MOZ_WEBRTC']:
-+if CONFIG['MOZ_NATIVE_OGG']:
+ DEFINES['MOZILLA_INTERNAL_API'] = True
+
++if CONFIG['MOZ_SYSTEM_OGG']:
+ CXXFLAGS += CONFIG['MOZ_OGG_CFLAGS']
+
-+if CONFIG['MOZ_NATIVE_THEORA']:
++if CONFIG['MOZ_SYSTEM_THEORA']:
+ CXXFLAGS += CONFIG['MOZ_THEORA_CFLAGS']
+
-+if CONFIG['MOZ_NATIVE_VORBIS']:
++if CONFIG['MOZ_SYSTEM_VORBIS']:
+ CXXFLAGS += CONFIG['MOZ_VORBIS_CFLAGS']
+
-+if CONFIG['MOZ_NATIVE_TREMOR']:
++if CONFIG['MOZ_SYSTEM_TREMOR']:
+ CXXFLAGS += CONFIG['MOZ_TREMOR_CFLAGS']
+
-+if CONFIG['MOZ_NATIVE_OPUS']:
-+ CXXFLAGS += CONFIG['MOZ_OPUS_CFLAGS']
-+
-+if CONFIG['MOZ_NATIVE_SPEEX']:
-+ CXXFLAGS += CONFIG['MOZ_SPEEX_CFLAGS']
-+
-+if CONFIG['MOZ_NATIVE_SOUNDTOUCH']:
++if CONFIG['MOZ_SYSTEM_SOUNDTOUCH']:
+ CXXFLAGS += CONFIG['MOZ_SOUNDTOUCH_CFLAGS']
+
- include('/ipc/chromium/chromium-config.mozbuild')
-
- # Suppress some GCC warnings being treated as errors:
+ if CONFIG['OS_TARGET'] == 'WINNT':
+ DEFINES['WEBRTC_WIN'] = True
+ else:
diff --git a/mail/thunderbird/patches/patch-mozilla_dom_media_platforms_ffmpeg_ffvpx_FFVPXRuntimeLinker.cpp b/mail/thunderbird/patches/patch-mozilla_dom_media_platforms_ffmpeg_ffvpx_FFVPXRuntimeLinker.cpp
new file mode 100644
index 00000000000..3802f2ec174
--- /dev/null
+++ b/mail/thunderbird/patches/patch-mozilla_dom_media_platforms_ffmpeg_ffvpx_FFVPXRuntimeLinker.cpp
@@ -0,0 +1,39 @@
+$NetBSD: patch-mozilla_dom_media_platforms_ffmpeg_ffvpx_FFVPXRuntimeLinker.cpp,v 1.1 2017/04/27 13:32:40 ryoon Exp $
+
+--- mozilla/dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp.orig 2017-04-14 04:53:06.000000000 +0000
++++ mozilla/dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp
+@@ -11,9 +11,13 @@
+ #include "prmem.h"
+ #include "prlink.h"
+
++#ifdef MOZ_SYSTEM_SOUNDTOUCH
++#include "nsXPCOMPrivate.h" // for XUL_DLL
++#else
+ // We use a known symbol located in lgpllibs to determine its location.
+ // soundtouch happens to be always included in lgpllibs
+ #include "soundtouch/SoundTouch.h"
++#endif
+
+ namespace mozilla
+ {
+@@ -51,6 +55,12 @@ FFVPXRuntimeLinker::Init()
+
+ sLinkStatus = LinkStatus_FAILED;
+
++#ifdef MOZ_SYSTEM_SOUNDTOUCH
++ // We retrieve the path of the XUL library as this is where mozavcodec and
++ // mozavutil libs are located.
++ char* path =
++ PR_GetLibraryFilePathname(XUL_DLL, (PRFuncPtr)&FFVPXRuntimeLinker::Init);
++#else
+ // We retrieve the path of the lgpllibs library as this is where mozavcodec
+ // and mozavutil libs are located.
+ char* lgpllibsname = PR_GetLibraryName(nullptr, "lgpllibs");
+@@ -61,6 +71,7 @@ FFVPXRuntimeLinker::Init()
+ PR_GetLibraryFilePathname(lgpllibsname,
+ (PRFuncPtr)&soundtouch::SoundTouch::getVersionId);
+ PR_FreeLibraryName(lgpllibsname);
++#endif
+ if (!path) {
+ return false;
+ }
diff --git a/mail/thunderbird/patches/patch-mozilla_dom_plugins_ipc_PluginProcessChild.cpp b/mail/thunderbird/patches/patch-mozilla_dom_plugins_ipc_PluginProcessChild.cpp
deleted file mode 100644
index 0400f742825..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_dom_plugins_ipc_PluginProcessChild.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-mozilla_dom_plugins_ipc_PluginProcessChild.cpp,v 1.3 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/dom/plugins/ipc/PluginProcessChild.cpp.orig 2016-04-07 21:33:30.000000000 +0000
-+++ mozilla/dom/plugins/ipc/PluginProcessChild.cpp
-@@ -46,7 +46,7 @@ PluginProcessChild::Init()
- {
- nsDebugImpl::SetMultiprocessMode("NPAPI");
-
--#if defined(XP_MACOSX)
-+#if defined(MOZ_WIDGET_COCOA)
- // Remove the trigger for "dyld interposing" that we added in
- // GeckoChildProcessHost::PerformAsyncLaunchInternal(), in the host
- // process just before we were launched. Dyld interposing will still
diff --git a/mail/thunderbird/patches/patch-mozilla_dom_system_OSFileConstants.cpp b/mail/thunderbird/patches/patch-mozilla_dom_system_OSFileConstants.cpp
index bd6d124d99a..b5f1a55492d 100644
--- a/mail/thunderbird/patches/patch-mozilla_dom_system_OSFileConstants.cpp
+++ b/mail/thunderbird/patches/patch-mozilla_dom_system_OSFileConstants.cpp
@@ -1,46 +1,33 @@
-$NetBSD: patch-mozilla_dom_system_OSFileConstants.cpp,v 1.3 2016/04/17 18:33:50 ryoon Exp $
+$NetBSD: patch-mozilla_dom_system_OSFileConstants.cpp,v 1.4 2017/04/27 13:32:40 ryoon Exp $
---- mozilla/dom/system/OSFileConstants.cpp.orig 2016-04-07 21:33:31.000000000 +0000
+--- mozilla/dom/system/OSFileConstants.cpp.orig 2017-04-14 04:53:07.000000000 +0000
+++ mozilla/dom/system/OSFileConstants.cpp
-@@ -11,6 +11,10 @@
-
- #include "prsystem.h"
-
-+#if defined(__NetBSD__)
-+#include <sys/param.h>
-+#endif
-+
- #if defined(XP_UNIX)
- #include "unistd.h"
+@@ -16,14 +16,17 @@
#include "dirent.h"
-@@ -20,7 +24,9 @@
+ #include "poll.h"
+ #include "sys/stat.h"
+-#if defined(ANDROID)
++#if defined(XP_LINUX)
+ #include <sys/vfs.h>
#define statvfs statfs
++#define f_frsize f_bsize
#else
#include "sys/statvfs.h"
-+#if !(defined(__NetBSD__) && (__NetBSD_Version__ < 600000000))
++#endif // defined(XP_LINUX)
++#if !defined(ANDROID)
+ #include "sys/wait.h"
#include <spawn.h>
-+#endif // !NetBSD 5.*
- #endif // defined(ANDROID)
+-#endif // defined(ANDROID)
++#endif // !defined(ANDROID)
#endif // defined(XP_UNIX)
-@@ -28,9 +34,9 @@
- #include <linux/fadvise.h>
- #endif // defined(XP_LINUX)
+ #if defined(XP_LINUX)
+@@ -699,7 +702,7 @@ static const dom::ConstantSpec gLibcProp
--#if defined(XP_MACOSX)
-+#if defined(XP_DARWIN)
- #include "copyfile.h"
--#endif // defined(XP_MACOSX)
-+#endif // defined(XP_DARWIN)
+ { "OSFILE_SIZEOF_STATVFS", JS::Int32Value(sizeof (struct statvfs)) },
- #if defined(XP_WIN)
- #include <windows.h>
-@@ -590,7 +596,7 @@ static const dom::ConstantSpec gLibcProp
- // The size of |fsblkcnt_t|.
- { "OSFILE_SIZEOF_FSBLKCNT_T", JS::Int32Value(sizeof (fsblkcnt_t)) },
+- { "OSFILE_OFFSETOF_STATVFS_F_BSIZE", JS::Int32Value(offsetof (struct statvfs, f_bsize)) },
++ { "OSFILE_OFFSETOF_STATVFS_F_FRSIZE", JS::Int32Value(offsetof (struct statvfs, f_frsize)) },
+ { "OSFILE_OFFSETOF_STATVFS_F_BAVAIL", JS::Int32Value(offsetof (struct statvfs, f_bavail)) },
--#if !defined(ANDROID)
-+#if !defined(ANDROID) && !(defined(__NetBSD__) && (__NetBSD_Version__ < 600000000))
- // The size of |posix_spawn_file_actions_t|.
- { "OSFILE_SIZEOF_POSIX_SPAWN_FILE_ACTIONS_T", JS::Int32Value(sizeof (posix_spawn_file_actions_t)) },
- #endif // !defined(ANDROID)
+ #endif // defined(XP_UNIX)
diff --git a/mail/thunderbird/patches/patch-mozilla_extensions_spellcheck_hunspell_glue_mozHunspell.cpp b/mail/thunderbird/patches/patch-mozilla_extensions_spellcheck_hunspell_glue_mozHunspell.cpp
index 3fedddfced1..f48129509cd 100644
--- a/mail/thunderbird/patches/patch-mozilla_extensions_spellcheck_hunspell_glue_mozHunspell.cpp
+++ b/mail/thunderbird/patches/patch-mozilla_extensions_spellcheck_hunspell_glue_mozHunspell.cpp
@@ -1,14 +1,14 @@
-$NetBSD: patch-mozilla_extensions_spellcheck_hunspell_glue_mozHunspell.cpp,v 1.1 2016/04/17 18:33:50 ryoon Exp $
+$NetBSD: patch-mozilla_extensions_spellcheck_hunspell_glue_mozHunspell.cpp,v 1.2 2017/04/27 13:32:40 ryoon Exp $
---- mozilla/extensions/spellcheck/hunspell/glue/mozHunspell.cpp.orig 2016-04-07 21:33:34.000000000 +0000
+--- mozilla/extensions/spellcheck/hunspell/glue/mozHunspell.cpp.orig 2017-04-14 04:53:08.000000000 +0000
+++ mozilla/extensions/spellcheck/hunspell/glue/mozHunspell.cpp
-@@ -358,6 +358,14 @@ mozHunspell::LoadDictionaryList(bool aNo
+@@ -381,6 +381,14 @@ mozHunspell::LoadDictionaryList(bool aNo
}
}
+ // load system hunspell dictionaries
+ nsCOMPtr<nsIFile> hunDir;
-+ NS_NewNativeLocalFile(NS_LITERAL_CSTRING("@PREFIX@/share/hunspell"),
++ NS_NewNativeLocalFile(NS_LITERAL_CSTRING("%%LOCALBASE%%/share/hunspell"),
+ true, getter_AddRefs(hunDir));
+ if (hunDir) {
+ LoadDictionariesFromDir(hunDir);
diff --git a/mail/thunderbird/patches/patch-mozilla_gfx_graphite2_moz-gr-update.sh b/mail/thunderbird/patches/patch-mozilla_gfx_graphite2_moz-gr-update.sh
new file mode 100644
index 00000000000..e74c42294ad
--- /dev/null
+++ b/mail/thunderbird/patches/patch-mozilla_gfx_graphite2_moz-gr-update.sh
@@ -0,0 +1,30 @@
+$NetBSD: patch-mozilla_gfx_graphite2_moz-gr-update.sh,v 1.3 2017/04/27 13:32:40 ryoon Exp $
+
+--- mozilla/gfx/graphite2/moz-gr-update.sh.orig 2017-04-14 04:53:08.000000000 +0000
++++ mozilla/gfx/graphite2/moz-gr-update.sh
+@@ -1,6 +1,7 @@
+ #!/bin/bash
+
+ # Script used to update the Graphite2 library in the mozilla source tree
++# and bump version for --with-system-graphite2
+
+ # This script lives in gfx/graphite2, along with the library source,
+ # but must be run from the top level of the mozilla-central tree.
+@@ -37,12 +38,16 @@ echo "See" $0 "for update procedure." >>
+ #find gfx/graphite2/ -name "*.cpp" -exec perl -p -i -e "s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \;
+ #find gfx/graphite2/ -name "*.h" -exec perl -p -i -e "s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \;
+
++# chase version for --with-system-graphite2
++perl -p -i -e "s/[0-9]+\,[0-9]+\,[0-9]+/$RELEASE/ and tr/./,/ \
++ if /GR2_VERSION_REQUIRE/" old-configure.in
++
+ # summarize what's been touched
+ echo Updated to $RELEASE.
+ echo Here is what changed in the gfx/graphite2 directory:
+ echo
+
+-hg stat gfx/graphite2
++hg stat old-configure.in gfx/graphite2
+
+ echo
+ echo If gfx/graphite2/src/files.mk has changed, please make corresponding
diff --git a/mail/thunderbird/patches/patch-mozilla_gfx_moz.build b/mail/thunderbird/patches/patch-mozilla_gfx_moz.build
index 3ab06c0214f..899a9fc1e4e 100644
--- a/mail/thunderbird/patches/patch-mozilla_gfx_moz.build
+++ b/mail/thunderbird/patches/patch-mozilla_gfx_moz.build
@@ -1,15 +1,15 @@
-$NetBSD: patch-mozilla_gfx_moz.build,v 1.2 2016/04/17 18:33:50 ryoon Exp $
+$NetBSD: patch-mozilla_gfx_moz.build,v 1.3 2017/04/27 13:32:40 ryoon Exp $
---- mozilla/gfx/moz.build.orig 2016-04-07 21:33:14.000000000 +0000
+--- mozilla/gfx/moz.build.orig 2017-04-14 04:53:08.000000000 +0000
+++ mozilla/gfx/moz.build
@@ -7,6 +7,12 @@
if CONFIG['MOZ_TREE_CAIRO']:
DIRS += ['cairo']
-+if not CONFIG['MOZ_NATIVE_GRAPHITE2']:
++if not CONFIG['MOZ_SYSTEM_GRAPHITE2']:
+ DIRS += ['graphite2/src' ]
+
-+if not CONFIG['MOZ_NATIVE_HARFBUZZ']:
++if not CONFIG['MOZ_SYSTEM_HARFBUZZ']:
+ DIRS += ['harfbuzz/src']
+
DIRS += [
diff --git a/mail/thunderbird/patches/patch-mozilla_gfx_skia_generate__mozbuild.py b/mail/thunderbird/patches/patch-mozilla_gfx_skia_generate__mozbuild.py
index 849c51bcd78..a638683242c 100644
--- a/mail/thunderbird/patches/patch-mozilla_gfx_skia_generate__mozbuild.py
+++ b/mail/thunderbird/patches/patch-mozilla_gfx_skia_generate__mozbuild.py
@@ -1,17 +1,14 @@
-$NetBSD: patch-mozilla_gfx_skia_generate__mozbuild.py,v 1.2 2016/04/17 18:33:50 ryoon Exp $
+$NetBSD: patch-mozilla_gfx_skia_generate__mozbuild.py,v 1.3 2017/04/27 13:32:40 ryoon Exp $
---- mozilla/gfx/skia/generate_mozbuild.py.orig 2016-04-07 21:33:14.000000000 +0000
+--- mozilla/gfx/skia/generate_mozbuild.py.orig 2017-04-14 04:53:08.000000000 +0000
+++ mozilla/gfx/skia/generate_mozbuild.py
-@@ -155,6 +155,12 @@ if CONFIG['GNU_CXX']:
- if CONFIG['CPU_ARCH'] == 'arm':
- SOURCES['skia/src/opts/SkBlitRow_opts_arm.cpp'].flags += ['-fomit-frame-pointer']
+@@ -140,6 +140,9 @@ if CONFIG['CLANG_CXX'] or CONFIG['CLANG_
+ '-Wno-unused-private-field',
+ ]
-+if CONFIG['MOZ_NATIVE_HARFBUZZ']:
++if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
+
-+if CONFIG['MOZ_NATIVE_HARFBUZZ']:
-+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
-+
- if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3', 'android', 'gonk', 'qt'):
+ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3', 'android'):
CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
diff --git a/mail/thunderbird/patches/patch-mozilla_gfx_skia_moz.build b/mail/thunderbird/patches/patch-mozilla_gfx_skia_moz.build
index f0e1a8c1b30..1d55987c476 100644
--- a/mail/thunderbird/patches/patch-mozilla_gfx_skia_moz.build
+++ b/mail/thunderbird/patches/patch-mozilla_gfx_skia_moz.build
@@ -1,17 +1,14 @@
-$NetBSD: patch-mozilla_gfx_skia_moz.build,v 1.4 2016/04/17 18:33:50 ryoon Exp $
+$NetBSD: patch-mozilla_gfx_skia_moz.build,v 1.5 2017/04/27 13:32:40 ryoon Exp $
---- mozilla/gfx/skia/moz.build.orig 2016-04-07 21:33:14.000000000 +0000
+--- mozilla/gfx/skia/moz.build.orig 2017-04-14 04:53:08.000000000 +0000
+++ mozilla/gfx/skia/moz.build
-@@ -684,6 +684,12 @@ if CONFIG['GNU_CXX']:
- if CONFIG['CPU_ARCH'] == 'arm':
- SOURCES['skia/src/opts/SkBlitRow_opts_arm.cpp'].flags += ['-fomit-frame-pointer']
+@@ -750,6 +750,9 @@ if CONFIG['CLANG_CXX'] or CONFIG['CLANG_
+ '-Wno-unused-private-field',
+ ]
-+if CONFIG['MOZ_NATIVE_HARFBUZZ']:
++if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
+
-+if CONFIG['MOZ_NATIVE_HARFBUZZ']:
-+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
-+
- if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3', 'android', 'gonk', 'qt'):
+ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3', 'android'):
CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
diff --git a/mail/thunderbird/patches/patch-mozilla_gfx_skia_skia_src_core_SkUtilsArm.cpp b/mail/thunderbird/patches/patch-mozilla_gfx_skia_skia_src_core_SkUtilsArm.cpp
deleted file mode 100644
index 5ecee19313e..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_gfx_skia_skia_src_core_SkUtilsArm.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-$NetBSD: patch-mozilla_gfx_skia_skia_src_core_SkUtilsArm.cpp,v 1.1 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/gfx/skia/skia/src/core/SkUtilsArm.cpp.orig 2016-04-07 21:33:15.000000000 +0000
-+++ mozilla/gfx/skia/skia/src/core/SkUtilsArm.cpp
-@@ -16,6 +16,10 @@
- #include <string.h>
- #include <pthread.h>
-
-+#if defined(__NetBSD__)
-+#include <sys/sysctl.h>
-+#endif
-+
- // Set USE_ANDROID_NDK_CPU_FEATURES to use the Android NDK's
- // cpu-features helper library to detect NEON at runtime. See
- // http://crbug.com/164154 to see why this is needed in Chromium
-@@ -47,6 +51,11 @@
- # endif
- #endif
-
-+#if !defined(TEMP_FAILURE_RETRY)
-+ // TEMP_FAILURE_RETRY is glibc specific
-+# define TEMP_FAILURE_RETRY
-+#endif
-+
- // A function used to determine at runtime if the target CPU supports
- // the ARM NEON instruction set. This implementation is Linux-specific.
- static bool sk_cpu_arm_check_neon(void) {
-@@ -82,6 +91,17 @@ static bool sk_cpu_arm_check_neon(void)
-
- result = (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0;
-
-+#elif defined(__NetBSD__)
-+
-+ size_t len;
-+ int flag;
-+ len = sizeof(flag);
-+ if (sysctlbyname("machdep.neon_present", &flag, &len, NULL, 0) == 0) {
-+ result = flag != 0;
-+ } else {
-+ result = false;
-+ }
-+
- #else // USE_ANDROID_NDK_CPU_FEATURES
-
- // There is no user-accessible CPUID instruction on ARM that we can use.
diff --git a/mail/thunderbird/patches/patch-mozilla_gfx_skia_skia_src_opts_SkBitmapProcState__opts__arm.cpp b/mail/thunderbird/patches/patch-mozilla_gfx_skia_skia_src_opts_SkBitmapProcState__opts__arm.cpp
deleted file mode 100644
index 49e8c424934..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_gfx_skia_skia_src_opts_SkBitmapProcState__opts__arm.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-$NetBSD: patch-mozilla_gfx_skia_skia_src_opts_SkBitmapProcState__opts__arm.cpp,v 1.1 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/gfx/skia/skia/src/opts/SkBitmapProcState_opts_arm.cpp.orig 2016-04-07 21:33:15.000000000 +0000
-+++ mozilla/gfx/skia/skia/src/opts/SkBitmapProcState_opts_arm.cpp
-@@ -97,7 +97,11 @@ void SI8_D16_nofilter_DX_arm(const SkBit
- "2: \n\t"
- : [xx] "+r" (xx), [count8] "+r" (count8), [colors] "+r" (colors)
- : [table] "r" (table), [srcAddr] "r" (srcAddr)
-+#if defined(__NetBSD__)
-+ : "memory", "cc", "r4", "r5", "r6", "r7", "r8", "r9", "r10"
-+#else
- : "memory", "cc", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11"
-+#endif
- );
-
- for (i = (count & 7); i > 0; --i) {
-@@ -181,7 +185,11 @@ void SI8_opaque_D32_nofilter_DX_arm(cons
- "4: \n\t" // exit
- : [xx] "+r" (xx), [count] "+r" (count), [colors] "+r" (colors)
- : [table] "r" (table), [srcAddr] "r" (srcAddr)
-+#if defined(__NetBSD__)
-+ : "memory", "cc", "r4", "r5", "r6", "r7", "r8", "r9", "r10"
-+#else
- : "memory", "cc", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11"
-+#endif
- );
- }
-
diff --git a/mail/thunderbird/patches/patch-mozilla_gfx_skia_skia_src_opts_memset.arm.S b/mail/thunderbird/patches/patch-mozilla_gfx_skia_skia_src_opts_memset.arm.S
deleted file mode 100644
index 2130cdaba94..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_gfx_skia_skia_src_opts_memset.arm.S
+++ /dev/null
@@ -1,49 +0,0 @@
-$NetBSD: patch-mozilla_gfx_skia_skia_src_opts_memset.arm.S,v 1.1 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/gfx/skia/skia/src/opts/memset.arm.S.orig 2016-04-07 21:33:15.000000000 +0000
-+++ mozilla/gfx/skia/skia/src/opts/memset.arm.S
-@@ -13,6 +13,12 @@
- * to aid future maintenance.
- */
-
-+#if defined(__ARM_EABI__) && !defined(__ARM_DWARF_EH__)
-+#define UNWIND
-+#else
-+#define UNWIND @
-+#endif
-+
- .text
- .align 4
- .syntax unified
-@@ -30,7 +36,8 @@
- *
- */
- arm_memset16:
-- .fnstart
-+ .cfi_startproc
-+ UNWIND .fnstart
- push {lr}
-
- /* if count is equal to zero then abort */
-@@ -51,10 +58,12 @@ arm_memset16:
-
- /* Now jump into the main loop below. */
- b .Lwork_32
-- .fnend
-+ UNWIND .fnend
-+ .cfi_endproc
-
- arm_memset32:
-- .fnstart
-+ .cfi_startproc
-+ UNWIND .fnstart
- push {lr}
-
- /* if count is equal to zero then abort */
-@@ -108,4 +117,5 @@ arm_memset32:
-
- .Lfinish:
- pop {pc}
-- .fnend
-+ UNWIND .fnend
-+ .cfi_endproc
diff --git a/mail/thunderbird/patches/patch-mozilla_gfx_thebes_moz.build b/mail/thunderbird/patches/patch-mozilla_gfx_thebes_moz.build
index a34e0f29f6a..4362989dd6f 100644
--- a/mail/thunderbird/patches/patch-mozilla_gfx_thebes_moz.build
+++ b/mail/thunderbird/patches/patch-mozilla_gfx_thebes_moz.build
@@ -1,25 +1,19 @@
-$NetBSD: patch-mozilla_gfx_thebes_moz.build,v 1.3 2016/04/17 18:33:50 ryoon Exp $
+$NetBSD: patch-mozilla_gfx_thebes_moz.build,v 1.4 2017/04/27 13:32:40 ryoon Exp $
---- mozilla/gfx/thebes/moz.build.orig 2016-04-07 21:33:15.000000000 +0000
+--- mozilla/gfx/thebes/moz.build.orig 2017-04-14 04:53:09.000000000 +0000
+++ mozilla/gfx/thebes/moz.build
-@@ -293,6 +293,12 @@ CXXFLAGS += CONFIG['TK_CFLAGS']
- CFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
- CFLAGS += CONFIG['TK_CFLAGS']
+@@ -266,7 +266,13 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk
+ LOCAL_INCLUDES += CONFIG['SKIA_INCLUDES']
+ LOCAL_INCLUDES += ['/media/libyuv/include']
-+if CONFIG['MOZ_NATIVE_HARFBUZZ']:
-+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
-+
-+if CONFIG['MOZ_NATIVE_GRAPHITE2']:
+-DEFINES['GRAPHITE2_STATIC'] = True
++if CONFIG['MOZ_SYSTEM_GRAPHITE2']:
+ CXXFLAGS += CONFIG['MOZ_GRAPHITE2_CFLAGS']
++else:
++ DEFINES['GRAPHITE2_STATIC'] = True
+
- if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gonk', 'qt'):
- CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
-
-@@ -306,7 +312,5 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk
-
- LOCAL_INCLUDES += CONFIG['SKIA_INCLUDES']
++if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
++ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
--DEFINES['GRAPHITE2_STATIC'] = True
--
- if CONFIG['OS_ARCH'] == 'WINNT':
- del DEFINES['UNICODE']
+ if CONFIG['CLANG_CXX']:
+ # Suppress warnings from Skia header files.
diff --git a/mail/thunderbird/patches/patch-mozilla_gfx_ycbcr_yuv__row__arm.S b/mail/thunderbird/patches/patch-mozilla_gfx_ycbcr_yuv__row__arm.S
index 38a054fc533..a1f266185a4 100644
--- a/mail/thunderbird/patches/patch-mozilla_gfx_ycbcr_yuv__row__arm.S
+++ b/mail/thunderbird/patches/patch-mozilla_gfx_ycbcr_yuv__row__arm.S
@@ -1,317 +1,40 @@
-$NetBSD: patch-mozilla_gfx_ycbcr_yuv__row__arm.S,v 1.2 2016/04/17 18:33:50 ryoon Exp $
+$NetBSD: patch-mozilla_gfx_ycbcr_yuv__row__arm.S,v 1.3 2017/04/27 13:32:40 ryoon Exp $
---- mozilla/gfx/ycbcr/yuv_row_arm.S.orig 2016-04-17 13:47:46.265685842 +0000
+--- mozilla/gfx/ycbcr/yuv_row_arm.S.orig 2017-04-14 04:53:09.000000000 +0000
+++ mozilla/gfx/ycbcr/yuv_row_arm.S
-@@ -0,0 +1,312 @@
-+/* This Source Code Form is subject to the terms of the Mozilla Public
-+ * License, v. 2.0. If a copy of the MPL was not distributed with this
-+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-+
+@@ -2,6 +2,12 @@
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#if defined(__ARM_EABI__) && !defined(__ARM_DWARF_EH__)
+#define UNWIND
+#else
+#define UNWIND @
+#endif
+
-+ .arch armv7-a
-+ .fpu neon
-+/* Allow to build on targets not supporting neon, and force the object file
-+ * target to avoid bumping the final binary target */
-+ .object_arch armv4t
-+ .text
-+ .align
-+
-+ .balign 64
-+YCbCr42xToRGB565_DITHER03_CONSTS_NEON:
-+ .short -14240
-+ .short -14240+384
-+ .short 8672
-+ .short 8672+192
-+ .short -17696
-+ .short -17696+384
-+ .byte 102
-+ .byte 25
-+ .byte 52
-+ .byte 129
-+YCbCr42xToRGB565_DITHER12_CONSTS_NEON:
-+ .short -14240+128
-+ .short -14240+256
-+ .short 8672+64
-+ .short 8672+128
-+ .short -17696+128
-+ .short -17696+256
-+ .byte 102
-+ .byte 25
-+ .byte 52
-+ .byte 129
-+YCbCr42xToRGB565_DITHER21_CONSTS_NEON:
-+ .short -14240+256
-+ .short -14240+128
-+ .short 8672+128
-+ .short 8672+64
-+ .short -17696+256
-+ .short -17696+128
-+ .byte 102
-+ .byte 25
-+ .byte 52
-+ .byte 129
-+YCbCr42xToRGB565_DITHER30_CONSTS_NEON:
-+ .short -14240+384
-+ .short -14240
-+ .short 8672+192
-+ .short 8672
-+ .short -17696+384
-+ .short -17696
-+ .byte 102
-+ .byte 25
-+ .byte 52
-+ .byte 129
-+
-+@ void ScaleYCbCr42xToRGB565_BilinearY_Row_NEON(
-+@ yuv2rgb565_row_scale_bilinear_ctx *ctx, int dither);
-+@
-+@ ctx = {
-+@ uint16_t *rgb_row; /*r0*/
-+@ const uint8_t *y_row; /*r1*/
-+@ const uint8_t *u_row; /*r2*/
-+@ const uint8_t *v_row; /*r3*/
-+@ int y_yweight; /*r4*/
-+@ int y_pitch; /*r5*/
-+@ int width; /*r6*/
-+@ int source_x0_q16; /*r7*/
-+@ int source_dx_q16; /*r8*/
-+@ int source_uv_xoffs_q16; /*r9*/
-+@ };
-+ .global ScaleYCbCr42xToRGB565_BilinearY_Row_NEON
-+ .type ScaleYCbCr42xToRGB565_BilinearY_Row_NEON, %function
-+ .balign 64
+ .arch armv7-a
+ .fpu neon
+ /* Allow to build on targets not supporting neon, and force the object file
+@@ -74,7 +80,8 @@ YCbCr42xToRGB565_DITHER30_CONSTS_NEON:
+ .global ScaleYCbCr42xToRGB565_BilinearY_Row_NEON
+ .type ScaleYCbCr42xToRGB565_BilinearY_Row_NEON, %function
+ .balign 64
+- .fnstart
+ .cfi_startproc
+ UNWIND .fnstart
-+ScaleYCbCr42xToRGB565_BilinearY_Row_NEON:
-+ STMFD r13!,{r4-r9,r14} @ 8 words.
-+ ADR r14,YCbCr42xToRGB565_DITHER03_CONSTS_NEON
-+ VPUSH {Q4-Q7} @ 16 words.
-+ ADD r14,r14,r1, LSL #4 @ Select the dither table to use
-+ LDMIA r0, {r0-r9}
-+ @ Set up image index registers.
-+ ADD r12,r8, r8
-+ VMOV.I32 D16,#0 @ Q8 = < 2| 2| 0| 0>*source_dx_q16
-+ VDUP.32 D17,r12
-+ ADD r12,r12,r12
-+ VTRN.32 D16,D17 @ Q2 = < 2| 0| 2| 0>*source_dx_q16
-+ VDUP.32 D19,r12 @ Q9 = < 4| 4| ?| ?>*source_dx_q16
-+ ADD r12,r12,r12
-+ VDUP.32 Q0, r7 @ Q0 = < 1| 1| 1| 1>*source_x0_q16
-+ VADD.I32 D17,D17,D19 @ Q8 = < 6| 4| 2| 0>*source_dx_q16
-+ CMP r8, #0 @ If source_dx_q16 is negative...
-+ VDUP.32 Q9, r12 @ Q9 = < 8| 8| 8| 8>*source_dx_q16
-+ ADDLT r7, r7, r8, LSL #4 @ Make r7 point to the end of the block
-+ VADD.I32 Q0, Q0, Q8 @ Q0 = < 6| 4| 2| 0>*source_dx_q16+source_x0_q16
-+ SUBLT r7, r7, r8 @ (i.e., the lowest address we'll use)
-+ VADD.I32 Q1, Q0, Q9 @ Q1 = <14|12|10| 8>*source_dx_q16+source_x0_q16
-+ VDUP.I32 Q9, r8 @ Q8 = < 1| 1| 1| 1>*source_dx_q16
-+ VADD.I32 Q2, Q0, Q9 @ Q2 = < 7| 5| 3| 1>*source_dx_q16+source_x0_q16
-+ VADD.I32 Q3, Q1, Q9 @ Q3 = <15|13|11| 9>*source_dx_q16+source_x0_q16
-+ VLD1.64 {D30,D31},[r14,:128] @ Load some constants
-+ VMOV.I8 D28,#52
-+ VMOV.I8 D29,#129
-+ @ The basic idea here is to do aligned loads of a block of data and then
-+ @ index into it using VTBL to extract the data from the source X
-+ @ coordinate corresponding to each destination pixel.
-+ @ This is significantly less code and significantly fewer cycles than doing
-+ @ a series of single-lane loads, but it means that the X step between
-+ @ pixels must be limited to 2.0 or less, otherwise we couldn't guarantee
-+ @ that we could read 8 pixels from a single aligned 32-byte block of data.
-+ @ Q0...Q3 contain the 16.16 fixed-point X coordinates of each pixel,
-+ @ separated into even pixels and odd pixels to make extracting offsets and
-+ @ weights easier.
-+ @ We then pull out two bytes from the middle of each coordinate: the top
-+ @ byte corresponds to the integer part of the X coordinate, and the bottom
-+ @ byte corresponds to the weight to use for bilinear blending.
-+ @ These are separated out into different registers with VTRN.
-+ @ Then by subtracting the integer X coordinate of the first pixel in the
-+ @ data block we loaded, we produce an index register suitable for use by
-+ @ VTBL.
-+s42xbily_neon_loop:
-+ @ Load the Y' data.
-+ MOV r12,r7, ASR #16
-+ VRSHRN.S32 D16,Q0, #8
-+ AND r12,r12,#~15 @ Read 16-byte aligned blocks
-+ VDUP.I8 D20,r12
-+ ADD r12,r1, r12 @ r12 = y_row+(source_x&~7)
-+ VRSHRN.S32 D17,Q1, #8
-+ PLD [r12,#64]
-+ VLD1.64 {D8, D9, D10,D11},[r12,:128],r5 @ Load Y' top row
-+ ADD r14,r7, r8, LSL #3
-+ VRSHRN.S32 D18,Q2, #8
-+ MOV r14,r14,ASR #16
-+ VRSHRN.S32 D19,Q3, #8
-+ AND r14,r14,#~15 @ Read 16-byte aligned blocks
-+ VLD1.64 {D12,D13,D14,D15},[r12,:128] @ Load Y' bottom row
-+ PLD [r12,#64]
-+ VDUP.I8 D21,r14
-+ ADD r14,r1, r14 @ r14 = y_row+(source_x&~7)
-+ VMOV.I8 Q13,#1
-+ PLD [r14,#64]
-+ VTRN.8 Q8, Q9 @ Q8 = <wFwEwDwCwBwAw9w8w7w6w5w4w3w2w1w0>
-+ @ Q9 = <xFxExDxCxBxAx9x8x7x6x5x4x3x2x1x0>
-+ VSUB.S8 Q9, Q9, Q10 @ Make offsets relative to the data we loaded.
-+ @ First 8 Y' pixels
-+ VTBL.8 D20,{D8, D9, D10,D11},D18 @ Index top row at source_x
-+ VTBL.8 D24,{D12,D13,D14,D15},D18 @ Index bottom row at source_x
-+ VADD.S8 Q13,Q9, Q13 @ Add 1 to source_x
-+ VTBL.8 D22,{D8, D9, D10,D11},D26 @ Index top row at source_x+1
-+ VTBL.8 D26,{D12,D13,D14,D15},D26 @ Index bottom row at source_x+1
-+ @ Next 8 Y' pixels
-+ VLD1.64 {D8, D9, D10,D11},[r14,:128],r5 @ Load Y' top row
-+ VLD1.64 {D12,D13,D14,D15},[r14,:128] @ Load Y' bottom row
-+ PLD [r14,#64]
-+ VTBL.8 D21,{D8, D9, D10,D11},D19 @ Index top row at source_x
-+ VTBL.8 D25,{D12,D13,D14,D15},D19 @ Index bottom row at source_x
-+ VTBL.8 D23,{D8, D9, D10,D11},D27 @ Index top row at source_x+1
-+ VTBL.8 D27,{D12,D13,D14,D15},D27 @ Index bottom row at source_x+1
-+ @ Blend Y'.
-+ VDUP.I16 Q9, r4 @ Load the y weights.
-+ VSUBL.U8 Q4, D24,D20 @ Q5:Q4 = c-a
-+ VSUBL.U8 Q5, D25,D21
-+ VSUBL.U8 Q6, D26,D22 @ Q7:Q6 = d-b
-+ VSUBL.U8 Q7, D27,D23
-+ VMUL.S16 Q4, Q4, Q9 @ Q5:Q4 = (c-a)*yweight
-+ VMUL.S16 Q5, Q5, Q9
-+ VMUL.S16 Q6, Q6, Q9 @ Q7:Q6 = (d-b)*yweight
-+ VMUL.S16 Q7, Q7, Q9
-+ VMOVL.U8 Q12,D16 @ Promote the x weights to 16 bits.
-+ VMOVL.U8 Q13,D17 @ Sadly, there's no VMULW.
-+ VRSHRN.S16 D8, Q4, #8 @ Q4 = (c-a)*yweight+128>>8
-+ VRSHRN.S16 D9, Q5, #8
-+ VRSHRN.S16 D12,Q6, #8 @ Q6 = (d-b)*yweight+128>>8
-+ VRSHRN.S16 D13,Q7, #8
-+ VADD.I8 Q10,Q10,Q4 @ Q10 = a+((c-a)*yweight+128>>8)
-+ VADD.I8 Q11,Q11,Q6 @ Q11 = b+((d-b)*yweight+128>>8)
-+ VSUBL.U8 Q4, D22,D20 @ Q5:Q4 = b-a
-+ VSUBL.U8 Q5, D23,D21
-+ VMUL.S16 Q4, Q4, Q12 @ Q5:Q4 = (b-a)*xweight
-+ VMUL.S16 Q5, Q5, Q13
-+ VRSHRN.S16 D8, Q4, #8 @ Q4 = (b-a)*xweight+128>>8
-+ ADD r12,r7, r9
-+ VRSHRN.S16 D9, Q5, #8
-+ MOV r12,r12,ASR #17
-+ VADD.I8 Q8, Q10,Q4 @ Q8 = a+((b-a)*xweight+128>>8)
-+ @ Start extracting the chroma x coordinates, and load Cb and Cr.
-+ AND r12,r12,#~15 @ Read 16-byte aligned blocks
-+ VDUP.I32 Q9, r9 @ Q9 = source_uv_xoffs_q16 x 4
-+ ADD r14,r2, r12
-+ VADD.I32 Q10,Q0, Q9
-+ VLD1.64 {D8, D9, D10,D11},[r14,:128] @ Load Cb
-+ PLD [r14,#64]
-+ VADD.I32 Q11,Q1, Q9
-+ ADD r14,r3, r12
-+ VADD.I32 Q12,Q2, Q9
-+ VLD1.64 {D12,D13,D14,D15},[r14,:128] @ Load Cr
-+ PLD [r14,#64]
-+ VADD.I32 Q13,Q3, Q9
-+ VRSHRN.S32 D20,Q10,#9 @ Q10 = <xEwExCwCxAwAx8w8x6w6x4w4x2w2x0w0>
-+ VRSHRN.S32 D21,Q11,#9
-+ VDUP.I8 Q9, r12
-+ VRSHRN.S32 D22,Q12,#9 @ Q11 = <xFwFxDwDxBwBx9w9x7w7x5w5x3w3x1w1>
-+ VRSHRN.S32 D23,Q13,#9
-+ @ We don't actually need the x weights, but we get them for free.
-+ @ Free ALU slot
-+ VTRN.8 Q10,Q11 @ Q10 = <wFwEwDwCwBwAw9w8w7w6w5w4w3w2w1w0>
-+ @ Free ALU slot @ Q11 = <xFxExDxCxBxAx9x8x7x6x5x4x3x2x1x0>
-+ VSUB.S8 Q11,Q11,Q9 @ Make offsets relative to the data we loaded.
-+ VTBL.8 D18,{D8, D9, D10,D11},D22 @ Index Cb at source_x
-+ VMOV.I8 D24,#74
-+ VTBL.8 D19,{D8, D9, D10,D11},D23
-+ VMOV.I8 D26,#102
-+ VTBL.8 D20,{D12,D13,D14,D15},D22 @ Index Cr at source_x
-+ VMOV.I8 D27,#25
-+ VTBL.8 D21,{D12,D13,D14,D15},D23
-+ @ We now have Y' in Q8, Cb in Q9, and Cr in Q10
-+ @ We use VDUP to expand constants, because it's a permute instruction, so
-+ @ it can dual issue on the A8.
-+ SUBS r6, r6, #16 @ width -= 16
-+ VMULL.U8 Q4, D16,D24 @ Q5:Q4 = Y'*74
-+ VDUP.32 Q6, D30[1] @ Q7:Q6 = bias_G
-+ VMULL.U8 Q5, D17,D24
-+ VDUP.32 Q7, D30[1]
-+ VMLSL.U8 Q6, D18,D27 @ Q7:Q6 = -25*Cb+bias_G
-+ VDUP.32 Q11,D30[0] @ Q12:Q11 = bias_R
-+ VMLSL.U8 Q7, D19,D27
-+ VDUP.32 Q12,D30[0]
-+ VMLAL.U8 Q11,D20,D26 @ Q12:Q11 = 102*Cr+bias_R
-+ VDUP.32 Q8, D31[0] @ Q13:Q8 = bias_B
-+ VMLAL.U8 Q12,D21,D26
-+ VDUP.32 Q13,D31[0]
-+ VMLAL.U8 Q8, D18,D29 @ Q13:Q8 = 129*Cb+bias_B
-+ VMLAL.U8 Q13,D19,D29
-+ VMLSL.U8 Q6, D20,D28 @ Q7:Q6 = -25*Cb-52*Cr+bias_G
-+ VMLSL.U8 Q7, D21,D28
-+ VADD.S16 Q11,Q4, Q11 @ Q12:Q11 = 74*Y'+102*Cr+bias_R
-+ VADD.S16 Q12,Q5, Q12
-+ VQADD.S16 Q8, Q4, Q8 @ Q13:Q8 = 74*Y'+129*Cr+bias_B
-+ VQADD.S16 Q13,Q5, Q13
-+ VADD.S16 Q6, Q4, Q6 @ Q7:Q6 = 74*Y'-25*Cb-52*Cr+bias_G
-+ VADD.S16 Q7, Q5, Q7
-+ @ Push each value to the top of its word and saturate it.
-+ VQSHLU.S16 Q11,Q11,#2
-+ VQSHLU.S16 Q12,Q12,#2
-+ VQSHLU.S16 Q6, Q6, #2
-+ VQSHLU.S16 Q7, Q7, #2
-+ VQSHLU.S16 Q8, Q8, #2
-+ VQSHLU.S16 Q13,Q13,#2
-+ @ Merge G and B into R.
-+ VSRI.U16 Q11,Q6, #5
-+ VSRI.U16 Q12,Q7, #5
-+ VSRI.U16 Q11,Q8, #11
-+ MOV r14,r8, LSL #4
-+ VSRI.U16 Q12,Q13,#11
-+ BLT s42xbily_neon_tail
-+ VDUP.I32 Q13,r14
-+ @ Store the result.
-+ VST1.16 {D22,D23,D24,D25},[r0]!
-+ BEQ s42xbily_neon_done
-+ @ Advance the x coordinates.
-+ VADD.I32 Q0, Q0, Q13
-+ VADD.I32 Q1, Q1, Q13
-+ ADD r7, r14
-+ VADD.I32 Q2, Q2, Q13
-+ VADD.I32 Q3, Q3, Q13
-+ B s42xbily_neon_loop
-+s42xbily_neon_tail:
-+ @ We have between 1 and 15 pixels left to write.
-+ @ -r6 == the number of pixels we need to skip writing.
-+ @ Adjust r0 to point to the last one we need to write, because we're going
-+ @ to write them in reverse order.
-+ ADD r0, r0, r6, LSL #1
-+ MOV r14,#-2
-+ ADD r0, r0, #30
-+ @ Skip past the ones we don't need to write.
-+ SUB PC, PC, r6, LSL #2
-+ ORR r0, r0, r0
-+ VST1.16 {D25[3]},[r0,:16],r14
-+ VST1.16 {D25[2]},[r0,:16],r14
-+ VST1.16 {D25[1]},[r0,:16],r14
-+ VST1.16 {D25[0]},[r0,:16],r14
-+ VST1.16 {D24[3]},[r0,:16],r14
-+ VST1.16 {D24[2]},[r0,:16],r14
-+ VST1.16 {D24[1]},[r0,:16],r14
-+ VST1.16 {D24[0]},[r0,:16],r14
-+ VST1.16 {D23[3]},[r0,:16],r14
-+ VST1.16 {D23[2]},[r0,:16],r14
-+ VST1.16 {D23[1]},[r0,:16],r14
-+ VST1.16 {D23[0]},[r0,:16],r14
-+ VST1.16 {D22[3]},[r0,:16],r14
-+ VST1.16 {D22[2]},[r0,:16],r14
-+ VST1.16 {D22[1]},[r0,:16],r14
-+ VST1.16 {D22[0]},[r0,:16]
-+s42xbily_neon_done:
-+ VPOP {Q4-Q7} @ 16 words.
-+ LDMFD r13!,{r4-r9,PC} @ 8 words.
+ ScaleYCbCr42xToRGB565_BilinearY_Row_NEON:
+ STMFD r13!,{r4-r9,r14} @ 8 words.
+ ADR r14,YCbCr42xToRGB565_DITHER03_CONSTS_NEON
+@@ -296,9 +303,10 @@ s42xbily_neon_tail:
+ s42xbily_neon_done:
+ VPOP {Q4-Q7} @ 16 words.
+ LDMFD r13!,{r4-r9,PC} @ 8 words.
+- .fnend
+ UNWIND .fnend
+ .cfi_endproc
-+ .size ScaleYCbCr42xToRGB565_BilinearY_Row_NEON, .-ScaleYCbCr42xToRGB565_BilinearY_Row_NEON
-+
+ .size ScaleYCbCr42xToRGB565_BilinearY_Row_NEON, .-ScaleYCbCr42xToRGB565_BilinearY_Row_NEON
+
+-#if defined(__ELF__)&&defined(__linux__)
+#if defined(__ELF__)&&(defined(__linux__) || defined(__NetBSD__))
-+ .section .note.GNU-stack,"",%progbits
-+#endif
+ .section .note.GNU-stack,"",%progbits
+ #endif
diff --git a/mail/thunderbird/patches/patch-mozilla_image_Downscaler.h b/mail/thunderbird/patches/patch-mozilla_image_Downscaler.h
new file mode 100644
index 00000000000..12234f20efb
--- /dev/null
+++ b/mail/thunderbird/patches/patch-mozilla_image_Downscaler.h
@@ -0,0 +1,33 @@
+$NetBSD: patch-mozilla_image_Downscaler.h,v 1.1 2017/04/27 13:32:40 ryoon Exp $
+
+--- mozilla/image/Downscaler.h.orig 2017-04-14 04:53:09.000000000 +0000
++++ mozilla/image/Downscaler.h
+@@ -154,14 +154,14 @@ private:
+ class Downscaler
+ {
+ public:
+- explicit Downscaler(const nsIntSize&)
++ explicit Downscaler(const nsIntSize&) : mScale(1.0, 1.0)
+ {
+ MOZ_RELEASE_ASSERT(false, "Skia is not enabled");
+ }
+
+- const nsIntSize& OriginalSize() const { return nsIntSize(); }
+- const nsIntSize& TargetSize() const { return nsIntSize(); }
+- const gfxSize& Scale() const { return gfxSize(1.0, 1.0); }
++ const nsIntSize& OriginalSize() const { return mSize; }
++ const nsIntSize& TargetSize() const { return mSize; }
++ const gfxSize& Scale() const { return mScale; }
+
+ nsresult BeginFrame(const nsIntSize&, const Maybe<nsIntRect>&, uint8_t*, bool, bool = false)
+ {
+@@ -177,6 +177,9 @@ public:
+ DownscalerInvalidRect TakeInvalidRect() { return DownscalerInvalidRect(); }
+ void ResetForNextProgressivePass() { }
+ const nsIntSize FrameSize() const { return nsIntSize(0, 0); }
++private:
++ nsIntSize mSize;
++ gfxSize mScale;
+ };
+
+ #endif // MOZ_ENABLE_SKIA
diff --git a/mail/thunderbird/patches/patch-mozilla_image_decoders_nsJPEGDecoder.cpp b/mail/thunderbird/patches/patch-mozilla_image_decoders_nsJPEGDecoder.cpp
index 3973697b622..6c825858aad 100644
--- a/mail/thunderbird/patches/patch-mozilla_image_decoders_nsJPEGDecoder.cpp
+++ b/mail/thunderbird/patches/patch-mozilla_image_decoders_nsJPEGDecoder.cpp
@@ -1,8 +1,8 @@
-$NetBSD: patch-mozilla_image_decoders_nsJPEGDecoder.cpp,v 1.3 2016/04/17 18:33:50 ryoon Exp $
+$NetBSD: patch-mozilla_image_decoders_nsJPEGDecoder.cpp,v 1.4 2017/04/27 13:32:40 ryoon Exp $
---- mozilla/image/decoders/nsJPEGDecoder.cpp.orig 2016-04-07 21:33:16.000000000 +0000
+--- mozilla/image/decoders/nsJPEGDecoder.cpp.orig 2017-04-14 04:53:09.000000000 +0000
+++ mozilla/image/decoders/nsJPEGDecoder.cpp
-@@ -23,13 +23,28 @@
+@@ -28,13 +28,28 @@
extern "C" {
#include "iccjpeg.h"
@@ -32,7 +32,7 @@ $NetBSD: patch-mozilla_image_decoders_nsJPEGDecoder.cpp,v 1.3 2016/04/17 18:33:5
static void cmyk_convert_rgb(JSAMPROW row, JDIMENSION width);
-@@ -339,6 +354,7 @@ nsJPEGDecoder::WriteInternal(const char*
+@@ -360,6 +375,7 @@ nsJPEGDecoder::ReadJPEGData(const char*
case JCS_GRAYSCALE:
case JCS_RGB:
case JCS_YCbCr:
@@ -40,7 +40,7 @@ $NetBSD: patch-mozilla_image_decoders_nsJPEGDecoder.cpp,v 1.3 2016/04/17 18:33:5
// if we're not color managing we can decode directly to
// MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB
if (mCMSMode != eCMSMode_All) {
-@@ -347,6 +363,9 @@ nsJPEGDecoder::WriteInternal(const char*
+@@ -368,6 +384,9 @@ nsJPEGDecoder::ReadJPEGData(const char*
} else {
mInfo.out_color_space = JCS_RGB;
}
@@ -50,8 +50,8 @@ $NetBSD: patch-mozilla_image_decoders_nsJPEGDecoder.cpp,v 1.3 2016/04/17 18:33:5
break;
case JCS_CMYK:
case JCS_YCCK:
-@@ -420,6 +439,16 @@ nsJPEGDecoder::WriteInternal(const char*
- return; // I/O suspension
+@@ -439,6 +458,16 @@ nsJPEGDecoder::ReadJPEGData(const char*
+ return Transition::ContinueUnbuffered(State::JPEG_DATA); // I/O suspension
}
+#ifndef JCS_EXTENSIONS
@@ -67,7 +67,7 @@ $NetBSD: patch-mozilla_image_decoders_nsJPEGDecoder.cpp,v 1.3 2016/04/17 18:33:5
// If this is a progressive JPEG ...
mState = mInfo.buffered_image ?
JPEG_DECOMPRESS_PROGRESSIVE : JPEG_DECOMPRESS_SEQUENTIAL;
-@@ -601,7 +630,11 @@ nsJPEGDecoder::OutputScanlines(bool* sus
+@@ -636,7 +665,11 @@ nsJPEGDecoder::OutputScanlines(bool* sus
MOZ_ASSERT(imageRow, "Should have a row buffer here");
@@ -79,7 +79,7 @@ $NetBSD: patch-mozilla_image_decoders_nsJPEGDecoder.cpp,v 1.3 2016/04/17 18:33:5
// Special case: scanline will be directly converted into packed ARGB
if (jpeg_read_scanlines(&mInfo, (JSAMPARRAY)&imageRow, 1) != 1) {
*suspend = true; // suspend
-@@ -925,6 +958,282 @@ term_source (j_decompress_ptr jd)
+@@ -960,6 +993,282 @@ term_source (j_decompress_ptr jd)
} // namespace image
} // namespace mozilla
diff --git a/mail/thunderbird/patches/patch-mozilla_intl_unicharutil_util_moz.build b/mail/thunderbird/patches/patch-mozilla_intl_unicharutil_util_moz.build
new file mode 100644
index 00000000000..0829d7c02dd
--- /dev/null
+++ b/mail/thunderbird/patches/patch-mozilla_intl_unicharutil_util_moz.build
@@ -0,0 +1,12 @@
+$NetBSD: patch-mozilla_intl_unicharutil_util_moz.build,v 1.3 2017/04/27 13:32:40 ryoon Exp $
+
+--- mozilla/intl/unicharutil/util/moz.build.orig 2017-04-14 04:53:10.000000000 +0000
++++ mozilla/intl/unicharutil/util/moz.build
+@@ -42,4 +42,7 @@ if CONFIG['_MSC_VER']:
+ if CONFIG['ENABLE_INTL_API']:
+ USE_LIBS += ['icu']
+
++if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
++ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
++
+ DIST_INSTALL = True
diff --git a/mail/thunderbird/patches/patch-mozilla_ipc_chromium_src_base_file__util__posix.cc b/mail/thunderbird/patches/patch-mozilla_ipc_chromium_src_base_file__util__posix.cc
deleted file mode 100644
index ff0dc9c5c41..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_ipc_chromium_src_base_file__util__posix.cc
+++ /dev/null
@@ -1,21 +0,0 @@
-$NetBSD: patch-mozilla_ipc_chromium_src_base_file__util__posix.cc,v 1.1 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/ipc/chromium/src/base/file_util_posix.cc.orig 2016-04-07 21:33:19.000000000 +0000
-+++ mozilla/ipc/chromium/src/base/file_util_posix.cc
-@@ -266,7 +266,7 @@ bool SetCurrentDirectory(const FilePath&
- return !ret;
- }
-
--#if !defined(OS_MACOSX)
-+#if !defined(MOZ_WIDGET_COCOA)
- bool GetTempDir(FilePath* path) {
- const char* tmp = getenv("TMPDIR");
- if (tmp)
-@@ -330,6 +330,6 @@ bool CopyFile(const FilePath& from_path,
-
- return result;
- }
--#endif // !defined(OS_MACOSX)
-+#endif // !defined(MOZ_WIDGET_COCOA)
-
- } // namespace file_util
diff --git a/mail/thunderbird/patches/patch-mozilla_ipc_chromium_src_base_message__loop.cc b/mail/thunderbird/patches/patch-mozilla_ipc_chromium_src_base_message__loop.cc
deleted file mode 100644
index accadeac0b6..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_ipc_chromium_src_base_message__loop.cc
+++ /dev/null
@@ -1,38 +0,0 @@
-$NetBSD: patch-mozilla_ipc_chromium_src_base_message__loop.cc,v 1.6 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/ipc/chromium/src/base/message_loop.cc.orig 2016-04-07 21:33:19.000000000 +0000
-+++ mozilla/ipc/chromium/src/base/message_loop.cc
-@@ -13,20 +13,18 @@
- #include "base/string_util.h"
- #include "base/thread_local.h"
-
--#if defined(OS_MACOSX)
-+#if defined(MOZ_WIDGET_COCOA)
- #include "base/message_pump_mac.h"
- #endif
- #if defined(OS_POSIX)
- #include "base/message_pump_libevent.h"
- #endif
--#if defined(OS_LINUX) || defined(OS_BSD)
- #if defined(MOZ_WIDGET_GTK)
- #include "base/message_pump_glib.h"
- #endif
- #ifdef MOZ_WIDGET_QT
- #include "base/message_pump_qt.h"
- #endif
--#endif
- #ifdef ANDROID
- #include "base/message_pump_android.h"
- #endif
-@@ -143,9 +141,9 @@ MessageLoop::MessageLoop(Type type)
- }
- #elif defined(OS_POSIX)
- if (type_ == TYPE_UI) {
--#if defined(OS_MACOSX)
-+#if defined(MOZ_WIDGET_COCOA)
- pump_ = base::MessagePumpMac::Create();
--#elif defined(OS_LINUX) || defined(OS_BSD)
-+#elif defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_QT)
- pump_ = new base::MessagePumpForUI();
- #endif // OS_LINUX
- } else if (type_ == TYPE_IO) {
diff --git a/mail/thunderbird/patches/patch-mozilla_ipc_chromium_src_base_platform__thread__posix.cc b/mail/thunderbird/patches/patch-mozilla_ipc_chromium_src_base_platform__thread__posix.cc
index 138888ccef3..334e71c50ef 100644
--- a/mail/thunderbird/patches/patch-mozilla_ipc_chromium_src_base_platform__thread__posix.cc
+++ b/mail/thunderbird/patches/patch-mozilla_ipc_chromium_src_base_platform__thread__posix.cc
@@ -1,13 +1,10 @@
-$NetBSD: patch-mozilla_ipc_chromium_src_base_platform__thread__posix.cc,v 1.1 2016/04/17 18:33:50 ryoon Exp $
+$NetBSD: patch-mozilla_ipc_chromium_src_base_platform__thread__posix.cc,v 1.2 2017/04/27 13:32:40 ryoon Exp $
---- mozilla/ipc/chromium/src/base/platform_thread_posix.cc.orig 2016-04-07 21:33:19.000000000 +0000
+--- mozilla/ipc/chromium/src/base/platform_thread_posix.cc.orig 2017-04-14 04:53:10.000000000 +0000
+++ mozilla/ipc/chromium/src/base/platform_thread_posix.cc
-@@ -9,22 +9,24 @@
-
+@@ -12,7 +12,9 @@
#if defined(OS_MACOSX)
#include <mach/mach.h>
-+#include <dlfcn.h>
-+#include <string>
#elif defined(OS_NETBSD)
+_Pragma("GCC visibility push(default)")
#include <lwp.h>
@@ -15,73 +12,13 @@ $NetBSD: patch-mozilla_ipc_chromium_src_base_platform__thread__posix.cc,v 1.1 20
#elif defined(OS_LINUX)
#include <sys/syscall.h>
#include <sys/prctl.h>
- #endif
-
--#if !defined(OS_MACOSX)
- #include <unistd.h>
--#endif
-
- #if defined(OS_BSD) && !defined(OS_NETBSD) && !defined(__GLIBC__)
- #include <pthread_np.h>
- #endif
-
--#if defined(OS_MACOSX)
-+#if defined(MOZ_WIDGET_COCOA)
- namespace base {
- void InitThreading();
- } // namespace
-@@ -82,7 +84,7 @@ void PlatformThread::Sleep(int duration_
- sleep_time = remaining;
- }
-
--#ifndef OS_MACOSX
-+#ifndef MOZ_WIDGET_COCOA
- // Mac is implemented in platform_thread_mac.mm.
-
- // static
-@@ -105,19 +107,41 @@ void PlatformThread::SetName(const char*
+@@ -107,7 +109,8 @@ void PlatformThread::SetName(const char*
pthread_setname_np(pthread_self(), "%s", (void *)name);
#elif defined(OS_BSD) && !defined(__GLIBC__)
pthread_set_name_np(pthread_self(), name);
-#else
-+#elif defined(OS_MACOSX)
-+ // Copied from platform_thread_mac.mm
-+
-+ // pthread_setname_np is only available in 10.6 or later, so test
-+ // for it at runtime.
-+ int (*dynamic_pthread_setname_np)(const char*);
-+ *reinterpret_cast<void**>(&dynamic_pthread_setname_np) =
-+ dlsym(RTLD_DEFAULT, "pthread_setname_np");
-+ if (!dynamic_pthread_setname_np)
-+ return;
-+
-+ // Mac OS X does not expose the length limit of the name, so
-+ // hardcode it.
-+ const int kMaxNameLength = 63;
-+ std::string shortened_name = std::string(name).substr(0, kMaxNameLength);
-+ // pthread_setname() fails (harmlessly) in the sandbox, ignore when it does.
-+ // See http://crbug.com/47058
-+
-+ // The name parameter is copied thus it's safe to release it after calling.
-+ // Checked against the bionic implementation in bionic/libc/bionic/pthread.c
-+ dynamic_pthread_setname_np(shortened_name.c_str());
+#elif !defined(OS_SOLARIS)
+ prctl(PR_SET_NAME, reinterpret_cast<uintptr_t>(name), 0, 0, 0);
#endif
}
--#endif // !OS_MACOSX
-+#endif // !MOZ_WIDGET_COCOA
-
- namespace {
-
- bool CreateThread(size_t stack_size, bool joinable,
- PlatformThread::Delegate* delegate,
- PlatformThreadHandle* thread_handle) {
--#if defined(OS_MACOSX)
-+#if defined(MOZ_WIDGET_COCOA)
- base::InitThreading();
--#endif // OS_MACOSX
-+#endif // MOZ_WIDGET_COCOA
-
- bool success = false;
- pthread_attr_t attributes;
+ #endif // !OS_MACOSX
diff --git a/mail/thunderbird/patches/patch-mozilla_ipc_chromium_src_base_process__util__bsd.cc b/mail/thunderbird/patches/patch-mozilla_ipc_chromium_src_base_process__util__bsd.cc
deleted file mode 100644
index 9b2cbf89825..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_ipc_chromium_src_base_process__util__bsd.cc
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD: patch-mozilla_ipc_chromium_src_base_process__util__bsd.cc,v 1.10 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/ipc/chromium/src/base/process_util_bsd.cc.orig 2016-04-07 21:33:19.000000000 +0000
-+++ mozilla/ipc/chromium/src/base/process_util_bsd.cc
-@@ -10,6 +10,10 @@
- #include <spawn.h>
- #include <sys/wait.h>
-
-+#if defined(OS_BSD)
-+#include <kvm.h>
-+#endif
-+
- #include <string>
-
- #include "base/eintr_wrapper.h"
diff --git a/mail/thunderbird/patches/patch-mozilla_ipc_chromium_src_base_scoped__nsautorelease__pool.h b/mail/thunderbird/patches/patch-mozilla_ipc_chromium_src_base_scoped__nsautorelease__pool.h
deleted file mode 100644
index 3eea38c8d03..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_ipc_chromium_src_base_scoped__nsautorelease__pool.h
+++ /dev/null
@@ -1,42 +0,0 @@
-$NetBSD: patch-mozilla_ipc_chromium_src_base_scoped__nsautorelease__pool.h,v 1.2 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/ipc/chromium/src/base/scoped_nsautorelease_pool.h.orig 2016-04-07 21:33:19.000000000 +0000
-+++ mozilla/ipc/chromium/src/base/scoped_nsautorelease_pool.h
-@@ -7,13 +7,13 @@
-
- #include "base/basictypes.h"
-
--#if defined(OS_MACOSX)
-+#if defined(MOZ_WIDGET_COCOA)
- #if defined(__OBJC__)
- @class NSAutoreleasePool;
- #else // __OBJC__
- class NSAutoreleasePool;
- #endif // __OBJC__
--#endif // OS_MACOSX
-+#endif // MOZ_WIDGET_COCOA
-
- namespace base {
-
-@@ -27,10 +27,10 @@ namespace base {
- // ugly #ifdefs.
- class ScopedNSAutoreleasePool {
- public:
--#if !defined(OS_MACOSX)
-+#if !defined(MOZ_WIDGET_COCOA)
- ScopedNSAutoreleasePool() {}
- void Recycle() { }
--#else // OS_MACOSX
-+#else // MOZ_WIDGET_COCOA
- ScopedNSAutoreleasePool();
- ~ScopedNSAutoreleasePool();
-
-@@ -41,7 +41,7 @@ class ScopedNSAutoreleasePool {
- void Recycle();
- private:
- NSAutoreleasePool* autorelease_pool_;
--#endif // OS_MACOSX
-+#endif // MOZ_WIDGET_COCOA
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ScopedNSAutoreleasePool);
diff --git a/mail/thunderbird/patches/patch-mozilla_ipc_glue_StringUtil.cpp b/mail/thunderbird/patches/patch-mozilla_ipc_glue_StringUtil.cpp
deleted file mode 100644
index ae516eb7818..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_ipc_glue_StringUtil.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-$NetBSD: patch-mozilla_ipc_glue_StringUtil.cpp,v 1.2 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/ipc/glue/StringUtil.cpp.orig 2016-04-07 21:33:19.000000000 +0000
-+++ mozilla/ipc/glue/StringUtil.cpp
-@@ -65,14 +65,14 @@ namespace base {
- // converters, and implementing the one that doesn't exist for OS X
- // and Windows.
-
--#if !defined(OS_MACOSX) && !defined(OS_WIN)
-+#if !defined(MOZ_WIDGET_COCOA) && !defined(OS_WIN)
- std::string SysWideToUTF8(const std::wstring& wide) {
- // FIXME/cjones: do this with iconv
- return GhettoStringConvert<std::wstring, std::string>(wide);
- }
- #endif
-
--#if !defined(OS_MACOSX) && !defined(OS_WIN)
-+#if !defined(MOZ_WIDGET_COCOA) && !defined(OS_WIN)
- std::wstring SysUTF8ToWide(const StringPiece& utf8) {
- // FIXME/cjones: do this with iconv
- return GhettoStringConvert<StringPiece, std::wstring>(utf8);
diff --git a/mail/thunderbird/patches/patch-mozilla_ipc_glue_moz.build b/mail/thunderbird/patches/patch-mozilla_ipc_glue_moz.build
deleted file mode 100644
index a6baf8385f2..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_ipc_glue_moz.build
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-mozilla_ipc_glue_moz.build,v 1.2 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/ipc/glue/moz.build.orig 2016-04-07 21:33:19.000000000 +0000
-+++ mozilla/ipc/glue/moz.build
-@@ -95,7 +95,7 @@ elif CONFIG['OS_ARCH'] in ('DragonFly',
- UNIFIED_SOURCES += [
- 'ProcessUtils_bsd.cpp'
- ]
--elif CONFIG['OS_ARCH'] == 'Darwin':
-+elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
- UNIFIED_SOURCES += [
- 'ProcessUtils_mac.mm'
- ]
diff --git a/mail/thunderbird/patches/patch-mozilla_js_src_configure.in b/mail/thunderbird/patches/patch-mozilla_js_src_configure.in
deleted file mode 100644
index dc902bd3bac..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_js_src_configure.in
+++ /dev/null
@@ -1,40 +0,0 @@
-$NetBSD: patch-mozilla_js_src_configure.in,v 1.1 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/js/src/configure.in.orig 2016-04-07 21:33:20.000000000 +0000
-+++ mozilla/js/src/configure.in
-@@ -2114,8 +2114,7 @@ AC_LANG_CPLUSPLUS
-
- MOZ_CXX11
-
--dnl Check for .hidden assembler directive and visibility attribute.
--dnl Borrowed from glibc configure.in
-+dnl Setup default hidden visibility and wrapped system headers.
- dnl ===============================================================
- if test "$GNU_CC" -a "$OS_TARGET" != WINNT; then
- AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
-@@ -2951,7 +2950,7 @@ if test "$MOZ_MEMORY"; then
- *-darwin*)
- AC_DEFINE(MOZ_MEMORY_DARWIN)
- ;;
-- *-*freebsd*)
-+ *-*freebsd*|*-*dragonfly*)
- AC_DEFINE(MOZ_MEMORY_BSD)
- ;;
- *-android*|*-linuxandroid*)
-@@ -3818,6 +3817,16 @@ MOZ_SUBCONFIGURE_ICU()
- dnl ========================================================
- dnl JavaScript shell
- dnl ========================================================
-+ICU_LIB_NAMES=
-+MOZ_NATIVE_ICU=
-+MOZ_ARG_WITH_BOOL(system-icu,
-+[ --with-system-icu
-+ Use system icu (located with pkgconfig)],
-+ MOZ_NATIVE_ICU=1)
-+
-+if test -n "$MOZ_NATIVE_ICU"; then
-+ PKG_CHECK_MODULES(MOZ_ICU, icu-i18n >= 50.1)
-+fi
-
- MOZ_CHECK_ALLOCATOR
-
diff --git a/mail/thunderbird/patches/patch-mozilla_js_src_ctypes_CTypes.h b/mail/thunderbird/patches/patch-mozilla_js_src_ctypes_CTypes.h
deleted file mode 100644
index aed61921a80..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_js_src_ctypes_CTypes.h
+++ /dev/null
@@ -1,28 +0,0 @@
-$NetBSD: patch-mozilla_js_src_ctypes_CTypes.h,v 1.3 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/js/src/ctypes/CTypes.h.orig 2016-04-07 21:33:20.000000000 +0000
-+++ mozilla/js/src/ctypes/CTypes.h
-@@ -19,6 +19,23 @@
- #include "js/Vector.h"
- #include "vm/String.h"
-
-+#if defined(__NetBSD__)
-+#include <stdint.h>
-+/* XXX why do we have those funky __ #defines in stdint.h? */
-+#warning this is a retarded workaround
-+#define uint8_t uint8_t
-+#define uint16_t uint16_t
-+#define uint32_t uint32_t
-+#define uint64_t uint64_t
-+#define int8_t int8_t
-+#define int16_t int16_t
-+#define int32_t int32_t
-+#define int64_t int64_t
-+#define intptr_t intptr_t
-+#define uintptr_t uintptr_t
-+#define off_t off_t
-+#endif
-+
- namespace js {
- namespace ctypes {
-
diff --git a/mail/thunderbird/patches/patch-mozilla_js_src_frontend_ParseMaps.cpp b/mail/thunderbird/patches/patch-mozilla_js_src_frontend_ParseMaps.cpp
deleted file mode 100644
index a9cdb5aa050..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_js_src_frontend_ParseMaps.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-$NetBSD: patch-mozilla_js_src_frontend_ParseMaps.cpp,v 1.2 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/js/src/frontend/ParseMaps.cpp.orig 2016-04-07 21:33:20.000000000 +0000
-+++ mozilla/js/src/frontend/ParseMaps.cpp
-@@ -133,5 +133,5 @@ frontend::InitAtomMap(frontend::AtomInde
- }
- }
-
--template class js::frontend::AtomDecls<FullParseHandler>;
--template class js::frontend::AtomDecls<SyntaxParseHandler>;
-+template class frontend::AtomDecls<FullParseHandler>;
-+template class frontend::AtomDecls<SyntaxParseHandler>;
diff --git a/mail/thunderbird/patches/patch-mozilla_js_src_jit_LIR.cpp b/mail/thunderbird/patches/patch-mozilla_js_src_jit_LIR.cpp
deleted file mode 100644
index 843c54720d7..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_js_src_jit_LIR.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-mozilla_js_src_jit_LIR.cpp,v 1.2 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/js/src/jit/LIR.cpp.orig 2016-04-07 21:33:24.000000000 +0000
-+++ mozilla/js/src/jit/LIR.cpp
-@@ -322,7 +322,7 @@ LNode::printName(GenericPrinter& out, Op
- const char* name = names[op];
- size_t len = strlen(name);
- for (size_t i = 0; i < len; i++)
-- out.printf("%c", tolower(name[i]));
-+ out.printf("%c", tolower((unsigned char)name[i]));
- }
-
- void
diff --git a/mail/thunderbird/patches/patch-mozilla_js_src_jit_MIR.cpp b/mail/thunderbird/patches/patch-mozilla_js_src_jit_MIR.cpp
deleted file mode 100644
index 860d19dfbb0..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_js_src_jit_MIR.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-mozilla_js_src_jit_MIR.cpp,v 1.2 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/js/src/jit/MIR.cpp.orig 2016-04-07 21:33:24.000000000 +0000
-+++ mozilla/js/src/jit/MIR.cpp
-@@ -75,7 +75,7 @@ MDefinition::PrintOpcodeName(GenericPrin
- const char* name = names[op];
- size_t len = strlen(name);
- for (size_t i = 0; i < len; i++)
-- out.printf("%c", tolower(name[i]));
-+ out.printf("%c", tolower((unsigned char)name[i]));
- }
-
- const Value&
diff --git a/mail/thunderbird/patches/patch-mozilla_js_src_jit_arm_Architecture-arm.cpp b/mail/thunderbird/patches/patch-mozilla_js_src_jit_arm_Architecture-arm.cpp
index 6d4b144cbdc..6c505b686d6 100644
--- a/mail/thunderbird/patches/patch-mozilla_js_src_jit_arm_Architecture-arm.cpp
+++ b/mail/thunderbird/patches/patch-mozilla_js_src_jit_arm_Architecture-arm.cpp
@@ -1,13 +1,13 @@
-$NetBSD: patch-mozilla_js_src_jit_arm_Architecture-arm.cpp,v 1.2 2016/04/17 18:33:50 ryoon Exp $
+$NetBSD: patch-mozilla_js_src_jit_arm_Architecture-arm.cpp,v 1.3 2017/04/27 13:32:40 ryoon Exp $
---- mozilla/js/src/jit/arm/Architecture-arm.cpp.orig 2016-04-07 21:33:24.000000000 +0000
+--- mozilla/js/src/jit/arm/Architecture-arm.cpp.orig 2017-04-14 04:53:12.000000000 +0000
+++ mozilla/js/src/jit/arm/Architecture-arm.cpp
@@ -16,7 +16,7 @@
#include "jit/arm/Assembler-arm.h"
#include "jit/RegisterSets.h"
-#if !defined(__linux__) || defined(ANDROID) || defined(JS_SIMULATOR_ARM)
-+#if !defined(__linux__) || defined(ANDROID) || defined(JS_ARM_SIMULATOR) || defined(__NetBSD__)
++#if !defined(__linux__) || defined(ANDROID) || defined(JS_SIMULATOR_ARM) || defined(__NetBSD__)
// The Android NDK and B2G do not include the hwcap.h kernel header, and it is not
// defined when building the simulator, so inline the header defines we need.
# define HWCAP_VFP (1 << 6)
diff --git a/mail/thunderbird/patches/patch-mozilla_js_src_jit_none_AtomicOperations-sparc.h b/mail/thunderbird/patches/patch-mozilla_js_src_jit_none_AtomicOperations-sparc.h
new file mode 100644
index 00000000000..f3f5b331bfb
--- /dev/null
+++ b/mail/thunderbird/patches/patch-mozilla_js_src_jit_none_AtomicOperations-sparc.h
@@ -0,0 +1,259 @@
+$NetBSD: patch-mozilla_js_src_jit_none_AtomicOperations-sparc.h,v 1.1 2017/04/27 13:32:40 ryoon Exp $
+
+--- mozilla/js/src/jit/none/AtomicOperations-sparc.h.orig 2017-04-14 04:53:11.000000000 +0000
++++ mozilla/js/src/jit/none/AtomicOperations-sparc.h
+@@ -249,3 +249,254 @@ js::jit::RegionLock::release(void* addr)
+ #endif
+
+ #endif // jit_sparc_AtomicOperations_sparc_h
++/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
++ * vim: set ts=8 sts=4 et sw=4 tw=99:
++ * This Source Code Form is subject to the terms of the Mozilla Public
++ * License, v. 2.0. If a copy of the MPL was not distributed with this
++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
++
++/* For documentation, see jit/AtomicOperations.h */
++
++#ifndef jit_sparc_AtomicOperations_sparc_h
++#define jit_sparc_AtomicOperations_sparc_h
++
++#include "mozilla/Assertions.h"
++#include "mozilla/Types.h"
++
++#if defined(__clang__) || defined(__GNUC__)
++
++// The default implementation tactic for gcc/clang is to use the newer
++// __atomic intrinsics added for use in C++11 <atomic>. Where that
++// isn't available, we use GCC's older __sync functions instead.
++//
++// ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS is kept as a backward
++// compatible option for older compilers: enable this to use GCC's old
++// __sync functions instead of the newer __atomic functions. This
++// will be required for GCC 4.6.x and earlier, and probably for Clang
++// 3.1, should we need to use those versions.
++
++//#define ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS
++
++inline bool
++js::jit::AtomicOperations::isLockfree8()
++{
++# ifndef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS
++ MOZ_ASSERT(__atomic_always_lock_free(sizeof(int8_t), 0));
++ MOZ_ASSERT(__atomic_always_lock_free(sizeof(int16_t), 0));
++ MOZ_ASSERT(__atomic_always_lock_free(sizeof(int32_t), 0));
++# if defined(__LP64__)
++ MOZ_ASSERT(__atomic_always_lock_free(sizeof(int64_t), 0));
++# endif
++ return true;
++# else
++ return false;
++# endif
++}
++
++inline void
++js::jit::AtomicOperations::fenceSeqCst()
++{
++# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS
++ __sync_synchronize();
++# else
++ __atomic_thread_fence(__ATOMIC_SEQ_CST);
++# endif
++}
++
++template<typename T>
++inline T
++js::jit::AtomicOperations::loadSeqCst(T* addr)
++{
++ MOZ_ASSERT(sizeof(T) < 8 || isLockfree8());
++# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS
++ __sync_synchronize();
++ T v = *addr;
++ __sync_synchronize();
++# else
++ T v;
++ __atomic_load(addr, &v, __ATOMIC_SEQ_CST);
++# endif
++ return v;
++}
++
++template<typename T>
++inline void
++js::jit::AtomicOperations::storeSeqCst(T* addr, T val)
++{
++ MOZ_ASSERT(sizeof(T) < 8 || isLockfree8());
++# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS
++ __sync_synchronize();
++ *addr = val;
++ __sync_synchronize();
++# else
++ __atomic_store(addr, &val, __ATOMIC_SEQ_CST);
++# endif
++}
++
++template<typename T>
++inline T
++js::jit::AtomicOperations::compareExchangeSeqCst(T* addr, T oldval, T newval)
++{
++ MOZ_ASSERT(sizeof(T) < 8 || isLockfree8());
++# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS
++ return __sync_val_compare_and_swap(addr, oldval, newval);
++# else
++ __atomic_compare_exchange(addr, &oldval, &newval, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
++ return oldval;
++# endif
++}
++
++template<typename T>
++inline T
++js::jit::AtomicOperations::fetchAddSeqCst(T* addr, T val)
++{
++#if !defined( __LP64__)
++ static_assert(sizeof(T) <= 4, "not available for 8-byte values yet");
++#endif
++# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS
++ return __sync_fetch_and_add(addr, val);
++# else
++ return __atomic_fetch_add(addr, val, __ATOMIC_SEQ_CST);
++# endif
++}
++
++template<typename T>
++inline T
++js::jit::AtomicOperations::fetchSubSeqCst(T* addr, T val)
++{
++#if !defined( __LP64__)
++ static_assert(sizeof(T) <= 4, "not available for 8-byte values yet");
++#endif
++# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS
++ return __sync_fetch_and_sub(addr, val);
++# else
++ return __atomic_fetch_sub(addr, val, __ATOMIC_SEQ_CST);
++# endif
++}
++
++template<typename T>
++inline T
++js::jit::AtomicOperations::fetchAndSeqCst(T* addr, T val)
++{
++#if !defined( __LP64__)
++ static_assert(sizeof(T) <= 4, "not available for 8-byte values yet");
++#endif
++# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS
++ return __sync_fetch_and_and(addr, val);
++# else
++ return __atomic_fetch_and(addr, val, __ATOMIC_SEQ_CST);
++# endif
++}
++
++template<typename T>
++inline T
++js::jit::AtomicOperations::fetchOrSeqCst(T* addr, T val)
++{
++#if !defined( __LP64__)
++ static_assert(sizeof(T) <= 4, "not available for 8-byte values yet");
++#endif
++# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS
++ return __sync_fetch_and_or(addr, val);
++# else
++ return __atomic_fetch_or(addr, val, __ATOMIC_SEQ_CST);
++# endif
++}
++
++template<typename T>
++inline T
++js::jit::AtomicOperations::fetchXorSeqCst(T* addr, T val)
++{
++#if !defined( __LP64__)
++ static_assert(sizeof(T) <= 4, "not available for 8-byte values yet");
++#endif
++# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS
++ return __sync_fetch_and_xor(addr, val);
++# else
++ return __atomic_fetch_xor(addr, val, __ATOMIC_SEQ_CST);
++# endif
++}
++
++template<typename T>
++inline T
++js::jit::AtomicOperations::loadSafeWhenRacy(T* addr)
++{
++ return *addr; // FIXME (1208663): not yet safe
++}
++
++template<typename T>
++inline void
++js::jit::AtomicOperations::storeSafeWhenRacy(T* addr, T val)
++{
++ *addr = val; // FIXME (1208663): not yet safe
++}
++
++inline void
++js::jit::AtomicOperations::memcpySafeWhenRacy(void* dest, const void* src, size_t nbytes)
++{
++ ::memcpy(dest, src, nbytes); // FIXME (1208663): not yet safe
++}
++
++inline void
++js::jit::AtomicOperations::memmoveSafeWhenRacy(void* dest, const void* src, size_t nbytes)
++{
++ ::memmove(dest, src, nbytes); // FIXME (1208663): not yet safe
++}
++
++template<typename T>
++inline T
++js::jit::AtomicOperations::exchangeSeqCst(T* addr, T val)
++{
++ MOZ_ASSERT(sizeof(T) < 8 || isLockfree8());
++# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS
++ T v;
++ __sync_synchronize();
++ do {
++ v = *addr;
++ } while (__sync_val_compare_and_swap(addr, v, val) != v);
++ return v;
++# else
++ T v;
++ __atomic_exchange(addr, &val, &v, __ATOMIC_SEQ_CST);
++ return v;
++# endif
++}
++
++template<size_t nbytes>
++inline void
++js::jit::RegionLock::acquire(void* addr)
++{
++# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS
++ while (!__sync_bool_compare_and_swap(&spinlock, 0, 1))
++ ;
++# else
++ uint32_t zero = 0;
++ uint32_t one = 1;
++ while (!__atomic_compare_exchange(&spinlock, &zero, &one, false, __ATOMIC_ACQUIRE, __ATOMIC_ACQUIRE)) {
++ zero = 0;
++ continue;
++ }
++# endif
++}
++
++template<size_t nbytes>
++inline void
++js::jit::RegionLock::release(void* addr)
++{
++ MOZ_ASSERT(AtomicOperations::loadSeqCst(&spinlock) == 1, "releasing unlocked region lock");
++# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS
++ __sync_sub_and_fetch(&spinlock, 1);
++# else
++ uint32_t zero = 0;
++ __atomic_store(&spinlock, &zero, __ATOMIC_SEQ_CST);
++# endif
++}
++
++# undef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS
++
++#elif defined(ENABLE_SHARED_ARRAY_BUFFER)
++
++# error "Either disable JS shared memory, use GCC or Clang, or add code here"
++
++#endif
++
++#endif // jit_sparc_AtomicOperations_sparc_h
diff --git a/mail/thunderbird/patches/patch-mozilla_js_src_jsdate.cpp b/mail/thunderbird/patches/patch-mozilla_js_src_jsdate.cpp
deleted file mode 100644
index 9dfe30cd839..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_js_src_jsdate.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD: patch-mozilla_js_src_jsdate.cpp,v 1.2 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/js/src/jsdate.cpp.orig 2016-04-07 21:33:24.000000000 +0000
-+++ mozilla/js/src/jsdate.cpp
-@@ -2672,8 +2672,8 @@ ToLocaleFormatHelper(JSContext* cx, Hand
- if (strcmp(format, "%x") == 0 && result_len >= 6 &&
- /* Format %x means use OS settings, which may have 2-digit yr, so
- hack end of 3/11/22 or 11.03.22 or 11Mar22 to use 4-digit yr...*/
-- !isdigit(buf[result_len - 3]) &&
-- isdigit(buf[result_len - 2]) && isdigit(buf[result_len - 1]) &&
-+ !isdigit(((unsigned char)buf[result_len - 3])) &&
-+ isdigit(((unsigned char)buf[result_len - 2])) && isdigit(((unsigned char)buf[result_len - 1])) &&
- /* ...but not if starts with 4-digit year, like 2022/3/11. */
- !(isdigit(buf[0]) && isdigit(buf[1]) &&
- isdigit(buf[2]) && isdigit(buf[3]))) {
diff --git a/mail/thunderbird/patches/patch-mozilla_js_src_jskwgen.cpp b/mail/thunderbird/patches/patch-mozilla_js_src_jskwgen.cpp
deleted file mode 100644
index 830ab0d270d..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_js_src_jskwgen.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-mozilla_js_src_jskwgen.cpp,v 1.2 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/js/src/jskwgen.cpp.orig 2016-04-07 21:33:24.000000000 +0000
-+++ mozilla/js/src/jskwgen.cpp
-@@ -181,7 +181,7 @@ qchar(char c, char* quoted_buffer)
- *s++ = '\\';
- break;
- default:
-- if (!isprint(c)) {
-+ if (!isprint(((unsigned char)c))) {
- *s++ = '\\';
- *s++ = (char)('0' + (0x3 & (((unsigned char)c) >> 6)));
- *s++ = (char)('0' + (0x7 & (((unsigned char)c) >> 3)));
diff --git a/mail/thunderbird/patches/patch-mozilla_js_src_jsmath.cpp b/mail/thunderbird/patches/patch-mozilla_js_src_jsmath.cpp
deleted file mode 100644
index d21d440710e..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_js_src_jsmath.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-mozilla_js_src_jsmath.cpp,v 1.2 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/js/src/jsmath.cpp.orig 2016-04-07 21:33:24.000000000 +0000
-+++ mozilla/js/src/jsmath.cpp
-@@ -272,7 +272,7 @@ js::ecmaAtan2(double y, double x)
- }
- #endif
-
--#if defined(SOLARIS) && defined(__GNUC__)
-+#if defined(notSOLARIS) && defined(__GNUC__)
- if (y == 0) {
- if (IsNegativeZero(x))
- return js_copysign(M_PI, y);
diff --git a/mail/thunderbird/patches/patch-mozilla_js_src_jsnativestack.cpp b/mail/thunderbird/patches/patch-mozilla_js_src_jsnativestack.cpp
deleted file mode 100644
index d7e614ff390..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_js_src_jsnativestack.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-mozilla_js_src_jsnativestack.cpp,v 1.1 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/js/src/jsnativestack.cpp.orig 2016-04-07 21:33:24.000000000 +0000
-+++ mozilla/js/src/jsnativestack.cpp
-@@ -102,7 +102,7 @@ js::GetNativeStackBaseImpl()
- pthread_attr_init(&sattr);
- # if defined(__OpenBSD__)
- stack_t ss;
--# elif defined(PTHREAD_NP_H) || defined(_PTHREAD_NP_H_) || defined(NETBSD)
-+# elif defined(PTHREAD_NP_H) || defined(_PTHREAD_NP_H_) || defined(__DragonFly__) || defined(NETBSD) || defined(__NetBSD__) /* XXX tnn not sure why NETBSD isn't defined, it looks like it should be ... */
- /* e.g. on FreeBSD 4.8 or newer, neundorf@kde.org */
- pthread_attr_get_np(thread, &sattr);
- # else
diff --git a/mail/thunderbird/patches/patch-mozilla_js_src_moz.build b/mail/thunderbird/patches/patch-mozilla_js_src_moz.build
new file mode 100644
index 00000000000..8bee2a4b566
--- /dev/null
+++ b/mail/thunderbird/patches/patch-mozilla_js_src_moz.build
@@ -0,0 +1,15 @@
+$NetBSD: patch-mozilla_js_src_moz.build,v 1.1 2017/04/27 13:32:40 ryoon Exp $
+
+--- mozilla/js/src/moz.build.orig 2017-04-14 04:53:12.000000000 +0000
++++ mozilla/js/src/moz.build
+@@ -735,10 +735,6 @@ OS_LIBS += CONFIG['REALTIME_LIBS']
+ CFLAGS += CONFIG['MOZ_ICU_CFLAGS']
+ CXXFLAGS += CONFIG['MOZ_ICU_CFLAGS']
+
+-NO_EXPAND_LIBS = True
+-
+-DIST_INSTALL = True
+-
+ # Prepare self-hosted JS code for embedding
+ GENERATED_FILES += [('selfhosted.out.h', 'selfhosted.js')]
+ selfhosted = GENERATED_FILES[('selfhosted.out.h', 'selfhosted.js')]
diff --git a/mail/thunderbird/patches/patch-mozilla_js_src_old-configure.in b/mail/thunderbird/patches/patch-mozilla_js_src_old-configure.in
new file mode 100644
index 00000000000..46051737899
--- /dev/null
+++ b/mail/thunderbird/patches/patch-mozilla_js_src_old-configure.in
@@ -0,0 +1,32 @@
+$NetBSD: patch-mozilla_js_src_old-configure.in,v 1.1 2017/04/27 13:32:40 ryoon Exp $
+
+--- mozilla/js/src/old-configure.in.orig 2017-04-14 04:53:11.000000000 +0000
++++ mozilla/js/src/old-configure.in
+@@ -140,6 +140,9 @@ fi
+
+ MOZ_TOOL_VARIABLES
+
++AC_PROG_CPP
++AC_PROG_CXXCPP
++
+ dnl Special win32 checks
+ dnl ========================================================
+
+@@ -1024,7 +1027,7 @@ dnl Checks for header files.
+ dnl ========================================================
+ AC_HEADER_DIRENT
+ case "$target_os" in
+-freebsd*)
++freebsd*|*-*-dragonfly*)
+ # for stuff like -lXshm
+ CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}"
+ ;;
+@@ -1155,7 +1158,7 @@ then
+ fi
+
+ case "$target" in
+- *-*-freebsd*)
++ *-*-freebsd*|*-*-dragonfly*)
+ AC_DEFINE(_REENTRANT)
+ AC_DEFINE(_THREAD_SAFE)
+ dnl -pthread links in -lpthread, so don't specify it explicitly.
diff --git a/mail/thunderbird/patches/patch-mozilla_js_src_shell_jsoptparse.cpp b/mail/thunderbird/patches/patch-mozilla_js_src_shell_jsoptparse.cpp
deleted file mode 100644
index b26c29c642f..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_js_src_shell_jsoptparse.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-mozilla_js_src_shell_jsoptparse.cpp,v 1.2 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/js/src/shell/jsoptparse.cpp.orig 2016-04-07 21:33:25.000000000 +0000
-+++ mozilla/js/src/shell/jsoptparse.cpp
-@@ -95,7 +95,7 @@ PrintParagraph(const char* text, unsigne
- ++it;
-
- while (*it != '\0') {
-- MOZ_ASSERT(!isspace(*it));
-+ MOZ_ASSERT(!isspace((unsigned char)*it));
-
- /* Delimit the current token. */
- const char* limit = it;
diff --git a/mail/thunderbird/patches/patch-mozilla_js_src_vm_SPSProfiler.cpp b/mail/thunderbird/patches/patch-mozilla_js_src_vm_SPSProfiler.cpp
deleted file mode 100644
index ed907a0f38f..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_js_src_vm_SPSProfiler.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-mozilla_js_src_vm_SPSProfiler.cpp,v 1.3 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/js/src/vm/SPSProfiler.cpp.orig 2016-04-07 21:33:28.000000000 +0000
-+++ mozilla/js/src/vm/SPSProfiler.cpp
-@@ -4,6 +4,8 @@
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-+#include "jscntxtinlines.h"
-+
- #include "vm/SPSProfiler.h"
-
- #include "mozilla/DebugOnly.h"
diff --git a/mail/thunderbird/patches/patch-mozilla_js_xpconnect_src_xpcprivate.h b/mail/thunderbird/patches/patch-mozilla_js_xpconnect_src_xpcprivate.h
index 097963dfc4f..215aa946b4a 100644
--- a/mail/thunderbird/patches/patch-mozilla_js_xpconnect_src_xpcprivate.h
+++ b/mail/thunderbird/patches/patch-mozilla_js_xpconnect_src_xpcprivate.h
@@ -1,8 +1,8 @@
-$NetBSD: patch-mozilla_js_xpconnect_src_xpcprivate.h,v 1.2 2016/04/17 18:33:50 ryoon Exp $
+$NetBSD: patch-mozilla_js_xpconnect_src_xpcprivate.h,v 1.3 2017/04/27 13:32:41 ryoon Exp $
---- mozilla/js/xpconnect/src/xpcprivate.h.orig 2016-04-07 21:33:28.000000000 +0000
+--- mozilla/js/xpconnect/src/xpcprivate.h.orig 2017-04-14 04:53:14.000000000 +0000
+++ mozilla/js/xpconnect/src/xpcprivate.h
-@@ -999,6 +999,8 @@ typedef nsTArray<InterpositionWhitelistP
+@@ -843,6 +843,8 @@ typedef nsTArray<InterpositionWhitelistP
/***************************************************************************/
// XPCWrappedNativeScope is one-to-one with a JS global object.
@@ -10,4 +10,4 @@ $NetBSD: patch-mozilla_js_xpconnect_src_xpcprivate.h,v 1.2 2016/04/17 18:33:50 r
+
class nsIAddonInterposition;
class nsXPCComponentsBase;
- class XPCWrappedNativeScope : public PRCList
+ class XPCWrappedNativeScope final : public PRCList
diff --git a/mail/thunderbird/patches/patch-mozilla_media_libcubeb_src_cubeb.c b/mail/thunderbird/patches/patch-mozilla_media_libcubeb_src_cubeb.c
index e540071a7e5..229c57094a7 100644
--- a/mail/thunderbird/patches/patch-mozilla_media_libcubeb_src_cubeb.c
+++ b/mail/thunderbird/patches/patch-mozilla_media_libcubeb_src_cubeb.c
@@ -1,8 +1,8 @@
-$NetBSD: patch-mozilla_media_libcubeb_src_cubeb.c,v 1.2 2016/04/17 18:33:50 ryoon Exp $
+$NetBSD: patch-mozilla_media_libcubeb_src_cubeb.c,v 1.3 2017/04/27 13:32:41 ryoon Exp $
---- mozilla/media/libcubeb/src/cubeb.c.orig 2016-04-07 21:33:21.000000000 +0000
+--- mozilla/media/libcubeb/src/cubeb.c.orig 2017-04-14 04:53:18.000000000 +0000
+++ mozilla/media/libcubeb/src/cubeb.c
-@@ -60,6 +60,9 @@ int audiotrack_init(cubeb ** context, ch
+@@ -54,6 +54,9 @@ int audiotrack_init(cubeb ** context, ch
#if defined(USE_KAI)
int kai_init(cubeb ** context, char const * context_name);
#endif
@@ -10,9 +10,9 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb.c,v 1.2 2016/04/17 18:33:50 ryoo
+int oss_init(cubeb ** context, char const * context_name);
+#endif
- int
- validate_stream_params(cubeb_stream_params stream_params)
-@@ -129,6 +132,9 @@ cubeb_init(cubeb ** context, char const
+
+ static int
+@@ -141,6 +144,9 @@ cubeb_init(cubeb ** context, char const
#if defined(USE_KAI)
kai_init,
#endif
diff --git a/mail/thunderbird/patches/patch-mozilla_media_libcubeb_src_cubeb__alsa.c b/mail/thunderbird/patches/patch-mozilla_media_libcubeb_src_cubeb__alsa.c
index 5b232542dc5..9f0f9dfaa4a 100644
--- a/mail/thunderbird/patches/patch-mozilla_media_libcubeb_src_cubeb__alsa.c
+++ b/mail/thunderbird/patches/patch-mozilla_media_libcubeb_src_cubeb__alsa.c
@@ -1,8 +1,8 @@
-$NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.3 2016/04/17 18:33:50 ryoon Exp $
+$NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.4 2017/04/27 13:32:41 ryoon Exp $
---- mozilla/media/libcubeb/src/cubeb_alsa.c.orig 2016-04-07 21:33:21.000000000 +0000
+--- mozilla/media/libcubeb/src/cubeb_alsa.c.orig 2017-04-14 04:53:17.000000000 +0000
+++ mozilla/media/libcubeb/src/cubeb_alsa.c
-@@ -7,12 +7,18 @@
+@@ -7,11 +7,15 @@
#undef NDEBUG
#define _DEFAULT_SOURCE
#define _BSD_SOURCE
@@ -16,12 +16,9 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.3 2016/04/17 18:33:5
#include <limits.h>
+#include <dlfcn.h>
#include <poll.h>
-+#include <stdlib.h>
-+#include <stdio.h>
#include <unistd.h>
#include <alsa/asoundlib.h>
- #include "cubeb/cubeb.h"
-@@ -25,6 +31,51 @@
+@@ -25,6 +29,50 @@
#define ALSA_PA_PLUGIN "ALSA <-> PulseAudio PCM I/O Plugin"
@@ -44,7 +41,6 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.3 2016/04/17 18:33:5
+MAKE_TYPEDEF(snd_pcm_close);
+MAKE_TYPEDEF(snd_pcm_delay);
+MAKE_TYPEDEF(snd_pcm_drain);
-+MAKE_TYPEDEF(snd_pcm_forward);
+MAKE_TYPEDEF(snd_pcm_frames_to_bytes);
+MAKE_TYPEDEF(snd_pcm_get_params);
+/* snd_pcm_hw_params_alloca is actually a macro */
@@ -73,7 +69,7 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.3 2016/04/17 18:33:5
/* ALSA is not thread-safe. snd_pcm_t instances are individually protected
by the owning cubeb_stream's mutex. snd_pcm_t creation and destruction
is not thread-safe until ALSA 1.0.24 (see alsa-lib.git commit 91c9c8f1),
-@@ -65,6 +116,8 @@ struct cubeb {
+@@ -65,6 +113,8 @@ struct cubeb {
workaround is not required. */
snd_config_t * local_config;
int is_pa;
@@ -82,74 +78,22 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.3 2016/04/17 18:33:5
};
enum stream_state {
-@@ -258,32 +311,35 @@ alsa_refill_stream(cubeb_stream * stm)
- long got;
- void * p;
- int draining;
-+ unsigned pipefailures, againfailures;
-
- draining = 0;
+@@ -260,10 +310,10 @@ alsa_refill_stream(cubeb_stream * stm)
pthread_mutex_lock(&stm->mutex);
-- r = snd_pcm_poll_descriptors_revents(stm->pcm, stm->fds, stm->nfds, &revents);
-- if (r < 0 || revents != POLLOUT) {
-- /* This should be a stream error; it makes no sense for poll(2) to wake
-- for this stream and then have the stream report that it's not ready.
-- Unfortunately, this does happen, so just bail out and try again. */
-- pthread_mutex_unlock(&stm->mutex);
-- return RUNNING;
-- }
--
- avail = snd_pcm_avail_update(stm->pcm);
-- if (avail == -EPIPE) {
++ avail = WRAP(snd_pcm_avail_update)(stm->pcm);
+ if (avail < 0) {
- snd_pcm_recover(stm->pcm, avail, 1);
- avail = snd_pcm_avail_update(stm->pcm);
-- }
-+ for (pipefailures = 0;;) {
-+ r = WRAP(snd_pcm_poll_descriptors_revents)(stm->pcm, stm->fds, stm->nfds, &revents);
-+ if (r < 0 || revents != POLLOUT ||
-+ (avail = WRAP(snd_pcm_avail_update)(stm->pcm)) == 0) {
-+ /* This should be a stream error; it makes no sense for poll(2) to wake
-+ for this stream and then have the stream report that it's not ready.
-+ Unfortunately, this does happen, so just bail out and try again. */
-+ pthread_mutex_unlock(&stm->mutex);
-+ return RUNNING;
-+ }
-
-- /* Failed to recover from an xrun, this stream must be broken. */
-- if (avail < 0) {
-- pthread_mutex_unlock(&stm->mutex);
-- stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_ERROR);
-- return ERROR;
-+ if (avail > 0)
-+ break;
-+ if (pipefailures++ > 11) {
-+ fprintf(stderr, "%s: repeated failures from snd_pcm_avail_update, "
-+ "giving up\n", __func__);
-+ pthread_mutex_unlock(&stm->mutex);
-+ stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_ERROR);
-+ return ERROR;
-+ }
+ WRAP(snd_pcm_recover)(stm->pcm, avail, 1);
- }
-+ pipefailures = againfailures = 0;
-
- /* This should never happen. */
- if ((unsigned int) avail > stm->buffer_size) {
-@@ -294,8 +350,8 @@ alsa_refill_stream(cubeb_stream * stm)
- available to write. If avail is still zero here, the stream must be in
- a funky state, so recover and try again. */
- if (avail == 0) {
-- snd_pcm_recover(stm->pcm, -EPIPE, 1);
-- avail = snd_pcm_avail_update(stm->pcm);
-+ WRAP(snd_pcm_recover)(stm->pcm, -EPIPE, 1);
+ avail = WRAP(snd_pcm_avail_update)(stm->pcm);
- if (avail <= 0) {
- pthread_mutex_unlock(&stm->mutex);
- stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_ERROR);
-@@ -303,7 +359,7 @@ alsa_refill_stream(cubeb_stream * stm)
- }
+ }
+
+ /* Failed to recover from an xrun, this stream must be broken. */
+@@ -286,7 +336,7 @@ alsa_refill_stream(cubeb_stream * stm)
+ return RUNNING;
}
- p = calloc(1, snd_pcm_frames_to_bytes(stm->pcm, avail));
@@ -157,95 +101,21 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.3 2016/04/17 18:33:5
assert(p);
pthread_mutex_unlock(&stm->mutex);
-@@ -312,10 +368,11 @@ alsa_refill_stream(cubeb_stream * stm)
- if (got < 0) {
- pthread_mutex_unlock(&stm->mutex);
- stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_ERROR);
-+ free(p);
- return ERROR;
- }
- if (got > 0) {
-- snd_pcm_sframes_t wrote;
-+ snd_pcm_sframes_t wrote, towrite = got;
-
- if (stm->params.format == CUBEB_SAMPLE_FLOAT32NE) {
- float * b = (float *) p;
-@@ -328,14 +385,66 @@ alsa_refill_stream(cubeb_stream * stm)
+@@ -312,10 +362,10 @@ alsa_refill_stream(cubeb_stream * stm)
b[i] *= stm->volume;
}
}
- wrote = snd_pcm_writei(stm->pcm, p, got);
-- if (wrote == -EPIPE) {
++ wrote = WRAP(snd_pcm_writei)(stm->pcm, p, got);
+ if (wrote < 0) {
- snd_pcm_recover(stm->pcm, wrote, 1);
- wrote = snd_pcm_writei(stm->pcm, p, got);
-- }
-- assert(wrote >= 0 && wrote == got);
-- stm->write_position += wrote;
-- gettimeofday(&stm->last_activity, NULL);
-+ for (;;) {
-+ wrote = WRAP(snd_pcm_writei)(stm->pcm, p,
-+ towrite > avail ? avail : towrite);
-+ switch(wrote) {
-+ case -EPIPE:
-+ if (pipefailures++ > 3) {
-+ fprintf(stderr, "%s: Too many underflows, giving up\n", __func__);
-+ stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_ERROR);
-+ pthread_mutex_unlock(&stm->mutex);
-+ free(p);
-+ return ERROR;
-+ }
-+ WRAP(snd_pcm_recover)(stm->pcm, wrote, 1);
-+ continue;
-+ case -EAGAIN:
-+ if (againfailures++ > 3) {
-+ fprintf(stderr, "%s: Too many -EAGAIN errors from snd_pcm_writei, "
-+ "giving up\n", __func__);
-+ stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_ERROR);
-+ pthread_mutex_unlock(&stm->mutex);
-+ free(p);
-+ return ERROR;
-+ }
-+ continue;
-+#if __linux__
-+ case -EBADFD:
-+#else
-+ case -EBADF:
-+#endif
-+ fprintf(stderr, "%s: snc_pcm_writei returned -%s, giving up\n",
-+ __func__, "EBADFD");
-+ free(p);
-+ stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_ERROR);
-+ pthread_mutex_unlock(&stm->mutex);
-+ return ERROR;
-+ }
-+ if (wrote < 0) {
-+ fprintf(stderr, "%s: snc_pcm_writei returned unexpected error %lld, "
-+ "giving up\n", __func__, (long long)wrote);
-+ free(p);
-+ stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_ERROR);
-+ pthread_mutex_unlock(&stm->mutex);
-+ return ERROR;
-+ }
-+ pipefailures = againfailures = 0;
-+ stm->write_position += wrote;
-+ gettimeofday(&stm->last_activity, NULL);
-+ if (wrote > towrite) {
-+ fprintf(stderr, "%s: snc_pcm_writei wrote %lld frames, which was more "
-+ "than we requested (%lld). This should not happen, giving up\n",
-+ __func__, (long long)wrote, (long long)towrite);
-+ free(p);
-+ stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_ERROR);
-+ pthread_mutex_unlock(&stm->mutex);
-+ return ERROR;
-+ }
-+ if (towrite == wrote)
-+ break;
-+ towrite -= wrote;
-+ }
- }
- if (got != avail) {
- long buffer_fill = stm->buffer_size - (avail - got);
-@@ -343,7 +452,7 @@ alsa_refill_stream(cubeb_stream * stm)
++ WRAP(snd_pcm_recover)(stm->pcm, wrote, 1);
++ wrote = WRAP(snd_pcm_writei)(stm->pcm, p, got);
+ }
+ assert(wrote >= 0 && wrote == got);
+ stm->write_position += wrote;
+@@ -327,7 +377,7 @@ alsa_refill_stream(cubeb_stream * stm)
/* Fill the remaining buffer with silence to guarantee one full period
has been written. */
@@ -254,7 +124,7 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.3 2016/04/17 18:33:5
set_timeout(&stm->drain_timeout, buffer_time * 1000);
-@@ -454,26 +563,26 @@ get_slave_pcm_node(snd_config_t * lconf,
+@@ -440,26 +490,26 @@ get_slave_pcm_node(snd_config_t * lconf,
slave_def = NULL;
@@ -286,7 +156,7 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.3 2016/04/17 18:33:5
if (r < 0) {
break;
}
-@@ -482,7 +591,7 @@ get_slave_pcm_node(snd_config_t * lconf,
+@@ -468,7 +518,7 @@ get_slave_pcm_node(snd_config_t * lconf,
if (r < 0 || r > (int) sizeof(node_name)) {
break;
}
@@ -295,7 +165,7 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.3 2016/04/17 18:33:5
if (r < 0) {
break;
}
-@@ -491,7 +600,7 @@ get_slave_pcm_node(snd_config_t * lconf,
+@@ -477,7 +527,7 @@ get_slave_pcm_node(snd_config_t * lconf,
} while (0);
if (slave_def) {
@@ -304,7 +174,7 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.3 2016/04/17 18:33:5
}
return NULL;
-@@ -514,22 +623,22 @@ init_local_config_with_workaround(char c
+@@ -500,22 +550,22 @@ init_local_config_with_workaround(char c
lconf = NULL;
@@ -331,7 +201,7 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.3 2016/04/17 18:33:5
if (r < 0) {
break;
}
-@@ -538,7 +647,7 @@ init_local_config_with_workaround(char c
+@@ -524,7 +574,7 @@ init_local_config_with_workaround(char c
if (r < 0 || r > (int) sizeof(node_name)) {
break;
}
@@ -340,7 +210,7 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.3 2016/04/17 18:33:5
if (r < 0) {
break;
}
-@@ -549,12 +658,12 @@ init_local_config_with_workaround(char c
+@@ -535,12 +585,12 @@ init_local_config_with_workaround(char c
}
/* Fetch the PCM node's type, and bail out if it's not the PulseAudio plugin. */
@@ -355,7 +225,7 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.3 2016/04/17 18:33:5
if (r < 0) {
break;
}
-@@ -565,18 +674,18 @@ init_local_config_with_workaround(char c
+@@ -551,18 +601,18 @@ init_local_config_with_workaround(char c
/* Don't clobber an explicit existing handle_underrun value, set it only
if it doesn't already exist. */
@@ -377,7 +247,7 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.3 2016/04/17 18:33:5
if (r < 0) {
break;
}
-@@ -584,7 +693,7 @@ init_local_config_with_workaround(char c
+@@ -570,7 +620,7 @@ init_local_config_with_workaround(char c
return lconf;
} while (0);
@@ -386,7 +256,7 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.3 2016/04/17 18:33:5
return NULL;
}
-@@ -596,9 +705,9 @@ alsa_locked_pcm_open(snd_pcm_t ** pcm, s
+@@ -582,9 +632,9 @@ alsa_locked_pcm_open(snd_pcm_t ** pcm, s
pthread_mutex_lock(&cubeb_alsa_mutex);
if (local_config) {
@@ -398,7 +268,7 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.3 2016/04/17 18:33:5
}
pthread_mutex_unlock(&cubeb_alsa_mutex);
-@@ -611,7 +720,7 @@ alsa_locked_pcm_close(snd_pcm_t * pcm)
+@@ -597,7 +647,7 @@ alsa_locked_pcm_close(snd_pcm_t * pcm)
int r;
pthread_mutex_lock(&cubeb_alsa_mutex);
@@ -407,7 +277,7 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.3 2016/04/17 18:33:5
pthread_mutex_unlock(&cubeb_alsa_mutex);
return r;
-@@ -668,12 +777,65 @@ alsa_init(cubeb ** context, char const *
+@@ -660,12 +710,65 @@ alsa_init(cubeb ** context, char const *
pthread_attr_t attr;
snd_pcm_t * dummy;
@@ -474,7 +344,7 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.3 2016/04/17 18:33:5
cubeb_alsa_error_handler_set = 1;
}
pthread_mutex_unlock(&cubeb_alsa_mutex);
-@@ -681,6 +843,8 @@ alsa_init(cubeb ** context, char const *
+@@ -673,6 +776,8 @@ alsa_init(cubeb ** context, char const *
ctx = calloc(1, sizeof(*ctx));
assert(ctx);
@@ -483,7 +353,7 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.3 2016/04/17 18:33:5
ctx->ops = &alsa_ops;
r = pthread_mutex_init(&ctx->mutex, NULL);
-@@ -730,7 +894,7 @@ alsa_init(cubeb ** context, char const *
+@@ -722,7 +827,7 @@ alsa_init(cubeb ** context, char const *
config fails with EINVAL, the PA PCM is too old for this workaround. */
if (r == -EINVAL) {
pthread_mutex_lock(&cubeb_alsa_mutex);
@@ -492,7 +362,7 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.3 2016/04/17 18:33:5
pthread_mutex_unlock(&cubeb_alsa_mutex);
ctx->local_config = NULL;
} else if (r >= 0) {
-@@ -769,9 +933,13 @@ alsa_destroy(cubeb * ctx)
+@@ -762,9 +867,13 @@ alsa_destroy(cubeb * ctx)
pthread_mutex_destroy(&ctx->mutex);
free(ctx->fds);
@@ -507,7 +377,16 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.3 2016/04/17 18:33:5
pthread_mutex_unlock(&cubeb_alsa_mutex);
}
-@@ -839,7 +1007,7 @@ alsa_stream_init(cubeb * ctx, cubeb_stre
+@@ -844,13 +953,16 @@ alsa_stream_init(cubeb * ctx, cubeb_stre
+ r = pthread_mutex_init(&stm->mutex, NULL);
+ assert(r == 0);
+
++ r = pthread_cond_init(&stm->cond, NULL);
++ assert(r == 0);
++
+ r = alsa_locked_pcm_open(&stm->pcm, SND_PCM_STREAM_PLAYBACK, ctx->local_config);
+ if (r < 0) {
+ alsa_stream_destroy(stm);
return CUBEB_ERROR;
}
@@ -515,24 +394,22 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.3 2016/04/17 18:33:5
+ r = WRAP(snd_pcm_nonblock)(stm->pcm, 1);
assert(r == 0);
- /* Ugly hack: the PA ALSA plugin allows buffer configurations that can't
-@@ -849,23 +1017,23 @@ alsa_stream_init(cubeb * ctx, cubeb_stre
- latency = latency < 500 ? 500 : latency;
+ latency_us = latency_frames * 1e6 / stm->params.rate;
+@@ -863,7 +975,7 @@ alsa_stream_init(cubeb * ctx, cubeb_stre
+ latency_us = latency_us < min_latency ? min_latency: latency_us;
}
- r = snd_pcm_set_params(stm->pcm, format, SND_PCM_ACCESS_RW_INTERLEAVED,
-- stm->params.channels, stm->params.rate, 1,
-- latency * 1000);
+ r = WRAP(snd_pcm_set_params)(stm->pcm, format, SND_PCM_ACCESS_RW_INTERLEAVED,
-+ stm->params.channels, stm->params.rate, 1,
-+ latency * 1000);
+ stm->params.channels, stm->params.rate, 1,
+ latency_us);
if (r < 0) {
- alsa_stream_destroy(stm);
+@@ -871,20 +983,17 @@ alsa_stream_init(cubeb * ctx, cubeb_stre
return CUBEB_ERROR_INVALID_FORMAT;
}
-- r = snd_pcm_get_params(stm->pcm, &stm->buffer_size, &stm->period_size);
-+ r = WRAP(snd_pcm_get_params)(stm->pcm, &stm->buffer_size, &stm->period_size);
+- r = snd_pcm_get_params(stm->pcm, &stm->buffer_size, &period_size);
++ r = WRAP(snd_pcm_get_params)(stm->pcm, &stm->buffer_size, &period_size);
assert(r == 0);
- stm->nfds = snd_pcm_poll_descriptors_count(stm->pcm);
@@ -545,8 +422,13 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.3 2016/04/17 18:33:5
+ r = WRAP(snd_pcm_poll_descriptors)(stm->pcm, stm->saved_fds, stm->nfds);
assert((nfds_t) r == stm->nfds);
- r = pthread_cond_init(&stm->cond, NULL);
-@@ -896,7 +1064,7 @@ alsa_stream_destroy(cubeb_stream * stm)
+- r = pthread_cond_init(&stm->cond, NULL);
+- assert(r == 0);
+-
+ if (alsa_register_stream(ctx, stm) != 0) {
+ alsa_stream_destroy(stm);
+ return CUBEB_ERROR;
+@@ -910,7 +1019,7 @@ alsa_stream_destroy(cubeb_stream * stm)
pthread_mutex_lock(&stm->mutex);
if (stm->pcm) {
if (stm->state == DRAINING) {
@@ -555,19 +437,7 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.3 2016/04/17 18:33:5
}
alsa_locked_pcm_close(stm->pcm);
stm->pcm = NULL;
-@@ -906,7 +1074,10 @@ alsa_stream_destroy(cubeb_stream * stm)
- pthread_mutex_destroy(&stm->mutex);
-
- r = pthread_cond_destroy(&stm->cond);
-- assert(r == 0);
-+ if (r != 0) { /* XXX stopgap until someone figures out the real reason */
-+ fprintf(stderr,"alsa_stream_destroy: pthread_cond_destroy failed: %s",
-+ strerror(r));
-+ }
-
- alsa_unregister_stream(stm);
-
-@@ -938,12 +1109,12 @@ alsa_get_max_channel_count(cubeb * ctx,
+@@ -952,12 +1061,12 @@ alsa_get_max_channel_count(cubeb * ctx,
return CUBEB_ERROR;
}
@@ -582,12 +452,12 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.3 2016/04/17 18:33:5
if (r < 0) {
return CUBEB_ERROR;
}
-@@ -963,34 +1134,34 @@ alsa_get_preferred_sample_rate(cubeb * c
+@@ -978,34 +1087,34 @@ alsa_get_preferred_sample_rate(cubeb * c
/* get a pcm, disabling resampling, so we get a rate the
* hardware/dmix/pulse/etc. supports. */
-- r = snd_pcm_open(&pcm, CUBEB_ALSA_PCM_NAME, SND_PCM_STREAM_PLAYBACK | SND_PCM_NO_AUTO_RESAMPLE, 0);
-+ r = WRAP(snd_pcm_open)(&pcm, CUBEB_ALSA_PCM_NAME, SND_PCM_STREAM_PLAYBACK | SND_PCM_NO_AUTO_RESAMPLE, 0);
+- r = snd_pcm_open(&pcm, CUBEB_ALSA_PCM_NAME, SND_PCM_STREAM_PLAYBACK, SND_PCM_NO_AUTO_RESAMPLE);
++ r = WRAP(snd_pcm_open)(&pcm, CUBEB_ALSA_PCM_NAME, SND_PCM_STREAM_PLAYBACK, SND_PCM_NO_AUTO_RESAMPLE);
if (r < 0) {
return CUBEB_ERROR;
}
@@ -625,7 +495,7 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.3 2016/04/17 18:33:5
return CUBEB_OK;
}
-@@ -1014,7 +1185,7 @@ alsa_stream_start(cubeb_stream * stm)
+@@ -1030,7 +1139,7 @@ alsa_stream_start(cubeb_stream * stm)
ctx = stm->context;
pthread_mutex_lock(&stm->mutex);
@@ -634,7 +504,7 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.3 2016/04/17 18:33:5
gettimeofday(&stm->last_activity, NULL);
pthread_mutex_unlock(&stm->mutex);
-@@ -1048,7 +1219,7 @@ alsa_stream_stop(cubeb_stream * stm)
+@@ -1064,7 +1173,7 @@ alsa_stream_stop(cubeb_stream * stm)
pthread_mutex_unlock(&ctx->mutex);
pthread_mutex_lock(&stm->mutex);
@@ -643,7 +513,7 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.3 2016/04/17 18:33:5
pthread_mutex_unlock(&stm->mutex);
return CUBEB_OK;
-@@ -1064,14 +1235,17 @@ alsa_stream_get_position(cubeb_stream *
+@@ -1080,14 +1189,15 @@ alsa_stream_get_position(cubeb_stream *
pthread_mutex_lock(&stm->mutex);
delay = -1;
@@ -657,14 +527,12 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.3 2016/04/17 18:33:5
}
- assert(delay >= 0);
-+ if (delay < 0) {
-+ WRAP(snd_pcm_forward)(stm->pcm, -delay);
-+ delay = 0;
-+ }
++ // Comment out to enable alsa-plugins-oss audio playback
++ // assert(delay >= 0);
*position = 0;
if (stm->write_position >= (snd_pcm_uframes_t) delay) {
-@@ -1090,7 +1264,7 @@ alsa_stream_get_latency(cubeb_stream * s
+@@ -1106,7 +1216,7 @@ alsa_stream_get_latency(cubeb_stream * s
snd_pcm_sframes_t delay;
/* This function returns the delay in frames until a frame written using
snd_pcm_writei is sent to the DAC. The DAC delay should be < 1ms anyways. */
diff --git a/mail/thunderbird/patches/patch-mozilla_media_libcubeb_src_cubeb__oss.c b/mail/thunderbird/patches/patch-mozilla_media_libcubeb_src_cubeb__oss.c
index 70b4e8e4c03..42eb4874a70 100644
--- a/mail/thunderbird/patches/patch-mozilla_media_libcubeb_src_cubeb__oss.c
+++ b/mail/thunderbird/patches/patch-mozilla_media_libcubeb_src_cubeb__oss.c
@@ -1,8 +1,8 @@
-$NetBSD: patch-mozilla_media_libcubeb_src_cubeb__oss.c,v 1.2 2016/04/17 18:33:50 ryoon Exp $
+$NetBSD: patch-mozilla_media_libcubeb_src_cubeb__oss.c,v 1.3 2017/04/27 13:32:41 ryoon Exp $
---- mozilla/media/libcubeb/src/cubeb_oss.c.orig 2016-04-17 13:47:46.296872813 +0000
+--- mozilla/media/libcubeb/src/cubeb_oss.c.orig 2017-04-25 12:22:46.009415040 +0000
+++ mozilla/media/libcubeb/src/cubeb_oss.c
-@@ -0,0 +1,402 @@
+@@ -0,0 +1,442 @@
+/*
+ * Copyright © 2014 Mozilla Foundation
+ *
@@ -23,6 +23,7 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__oss.c,v 1.2 2016/04/17 18:33:50
+#include <errno.h>
+#include <pthread.h>
+#include <stdio.h>
++#include <assert.h>
+
+#include "cubeb/cubeb.h"
+#include "cubeb-internal.h"
@@ -121,15 +122,15 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__oss.c,v 1.2 2016/04/17 18:33:50
+ pthread_mutex_lock(&stream->state_mutex);
+ if (stream->data_callback && stream->running && !stream->stopped) {
+ pthread_mutex_unlock(&stream->state_mutex);
-+ got = stream->data_callback(stream, stream->user_ptr, buffer, nframes);
++ got = stream->data_callback(stream, stream->user_ptr, NULL, buffer, nframes);
+ } else {
+ pthread_mutex_unlock(&stream->state_mutex);
+ }
+ return got;
+}
+
-+static void apply_volume(int16_t* buffer, unsigned int n,
-+ float volume, float panning)
++static void apply_volume_int(int16_t* buffer, unsigned int n,
++ float volume, float panning)
+{
+ float left = volume;
+ float right = volume;
@@ -147,6 +148,26 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__oss.c,v 1.2 2016/04/17 18:33:50
+ }
+}
+
++static void apply_volume_float(float* buffer, unsigned int n,
++ float volume, float panning)
++{
++ float left = volume;
++ float right = volume;
++ unsigned int i;
++ float pan[2];
++ if (panning<0) {
++ right *= (1+panning);
++ } else {
++ left *= (1-panning);
++ }
++ pan[0] = left;
++ pan[1] = right;
++ for(i=0; i<n; i++){
++ buffer[i] = buffer[i]*pan[i%2];
++ }
++}
++
++
+static void *writer(void *stm)
+{
+ cubeb_stream* stream = (cubeb_stream*)stm;
@@ -171,15 +192,25 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__oss.c,v 1.2 2016/04/17 18:33:50
+ if (stream->floating) {
+ got = run_data_callback(stream, f_buffer,
+ OSS_BUFFER_SIZE/stream->params.channels);
++ apply_volume_float(f_buffer, got*stream->params.channels,
++ stream->volume, stream->panning);
+ for (i=0; i<((unsigned long)got)*stream->params.channels; i++) {
-+ buffer[i] = f_buffer[i]*32767.0;
++ /* Clipping is prefered to overflow */
++ if(f_buffer[i]>=1.0){
++ f_buffer[i]=1.0;
++ }
++ if(f_buffer[i]<=-1.0){
++ f_buffer[i]=-1.0;
++ }
++ /* One might think that multipling by 32767.0 is logical but results in clipping */
++ buffer[i] = f_buffer[i]*32767.0;
+ }
+ } else {
+ got = run_data_callback(stream, buffer,
+ OSS_BUFFER_SIZE/stream->params.channels);
++ apply_volume_int(buffer, got*stream->params.channels,
++ stream->volume, stream->panning);
+ }
-+ apply_volume(buffer, got*stream->params.channels,
-+ stream->volume, stream->panning);
+ if (got<0) {
+ run_state_callback(stream, CUBEB_STATE_ERROR);
+ break;
@@ -221,7 +252,10 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__oss.c,v 1.2 2016/04/17 18:33:50
+
+static int oss_stream_init(cubeb * context, cubeb_stream ** stm,
+ char const * stream_name,
-+ cubeb_stream_params stream_params,
++ cubeb_devid input_device,
++ cubeb_stream_params * input_stream_params,
++ cubeb_devid output_device,
++ cubeb_stream_params * output_stream_params,
+ unsigned int latency,
+ cubeb_data_callback data_callback,
+ cubeb_state_callback state_callback, void * user_ptr)
@@ -232,6 +266,12 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__oss.c,v 1.2 2016/04/17 18:33:50
+ stream->state_callback = state_callback;
+ stream->user_ptr = user_ptr;
+
++ assert(!input_stream_params && "not supported.");
++ if (input_device || output_device) {
++ /* Device selection not yet implemented. */
++ return CUBEB_ERROR_DEVICE_UNAVAILABLE;
++ }
++
+ if ((stream->fd = open(CUBEB_OSS_DEFAULT_OUTPUT, O_WRONLY)) == -1) {
+ free(stream);
+ return CUBEB_ERROR;
@@ -243,16 +283,16 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__oss.c,v 1.2 2016/04/17 18:33:50
+ free(stream); \
+ return CUBEB_ERROR_INVALID_FORMAT; } } while (0)
+
-+ stream->params = stream_params;
++ stream->params = *output_stream_params;
+ stream->volume = 1.0;
+ stream->panning = 0.0;
+
+ oss_try_set_latency(stream, latency);
+
+ stream->floating = 0;
-+ SET(SNDCTL_DSP_CHANNELS, stream_params.channels);
-+ SET(SNDCTL_DSP_SPEED, stream_params.rate);
-+ switch (stream_params.format) {
++ SET(SNDCTL_DSP_CHANNELS, stream->params.channels);
++ SET(SNDCTL_DSP_SPEED, stream->params.rate);
++ switch (stream->params.format) {
+ case CUBEB_SAMPLE_S16LE:
+ SET(SNDCTL_DSP_SETFMT, AFMT_S16_LE);
+ break;
diff --git a/mail/thunderbird/patches/patch-mozilla_media_libcubeb_src_moz.build b/mail/thunderbird/patches/patch-mozilla_media_libcubeb_src_moz.build
index 5c878087b20..3dbbd133b48 100644
--- a/mail/thunderbird/patches/patch-mozilla_media_libcubeb_src_moz.build
+++ b/mail/thunderbird/patches/patch-mozilla_media_libcubeb_src_moz.build
@@ -1,10 +1,10 @@
-$NetBSD: patch-mozilla_media_libcubeb_src_moz.build,v 1.3 2016/04/17 18:33:50 ryoon Exp $
+$NetBSD: patch-mozilla_media_libcubeb_src_moz.build,v 1.4 2017/04/27 13:32:41 ryoon Exp $
---- mozilla/media/libcubeb/src/moz.build.orig 2016-04-07 21:33:21.000000000 +0000
+--- mozilla/media/libcubeb/src/moz.build.orig 2017-04-14 04:53:18.000000000 +0000
+++ mozilla/media/libcubeb/src/moz.build
-@@ -17,6 +17,12 @@ if CONFIG['MOZ_ALSA']:
+@@ -24,6 +24,12 @@ if CONFIG['MOZ_PULSEAUDIO'] or CONFIG['M
+ 'cubeb_resampler.cpp',
]
- DEFINES['USE_ALSA'] = True
+if CONFIG['MOZ_OSS']:
+ SOURCES += [
@@ -15,29 +15,11 @@ $NetBSD: patch-mozilla_media_libcubeb_src_moz.build,v 1.3 2016/04/17 18:33:50 ry
if CONFIG['MOZ_PULSEAUDIO']:
SOURCES += [
'cubeb_pulse.c',
-@@ -31,7 +37,7 @@ if CONFIG['OS_ARCH'] == 'OpenBSD':
- ]
- DEFINES['USE_SNDIO'] = True
-
--if CONFIG['OS_TARGET'] == 'Darwin':
-+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
- SOURCES += [
- 'cubeb_audiounit.c',
- ]
-@@ -64,6 +70,9 @@ if CONFIG['OS_TARGET'] == 'Android':
+@@ -81,6 +87,7 @@ if CONFIG['OS_TARGET'] == 'Android':
FINAL_LIBRARY = 'gkmedias'
-+if CONFIG['MOZ_NATIVE_SPEEX']:
-+ SOURCES['cubeb_resampler.cpp'].flags += CONFIG['MOZ_SPEEX_CFLAGS']
-+
++CFLAGS += CONFIG['MOZ_OSS_CFLAGS']
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
if CONFIG['ANDROID_VERSION'] >= '17':
LOCAL_INCLUDES += [
-@@ -74,5 +83,6 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk
- '%' + '%s/system/media/wilhelm/include' % CONFIG['ANDROID_SOURCE'],
- ]
-
-+CFLAGS += CONFIG['MOZ_OSS_CFLAGS']
- CFLAGS += CONFIG['MOZ_ALSA_CFLAGS']
- CFLAGS += CONFIG['MOZ_PULSEAUDIO_CFLAGS']
diff --git a/mail/thunderbird/patches/patch-mozilla_media_libcubeb_tests_moz.build b/mail/thunderbird/patches/patch-mozilla_media_libcubeb_tests_moz.build
new file mode 100644
index 00000000000..1d774c23e8b
--- /dev/null
+++ b/mail/thunderbird/patches/patch-mozilla_media_libcubeb_tests_moz.build
@@ -0,0 +1,12 @@
+$NetBSD: patch-mozilla_media_libcubeb_tests_moz.build,v 1.1 2017/04/27 13:32:41 ryoon Exp $
+
+--- mozilla/media/libcubeb/tests/moz.build.orig 2017-04-14 04:53:18.000000000 +0000
++++ mozilla/media/libcubeb/tests/moz.build
+@@ -73,7 +73,6 @@ elif CONFIG['OS_TARGET'] == 'OpenBSD':
+ 'sndio',
+ ]
+ else:
+- OS_LIBS += CONFIG['MOZ_ALSA_LIBS']
+ OS_LIBS += CONFIG['MOZ_PULSEAUDIO_LIBS']
+
+ if CONFIG['GNU_CXX']:
diff --git a/mail/thunderbird/patches/patch-mozilla_media_libcubeb_update.sh b/mail/thunderbird/patches/patch-mozilla_media_libcubeb_update.sh
new file mode 100644
index 00000000000..58fb81b9880
--- /dev/null
+++ b/mail/thunderbird/patches/patch-mozilla_media_libcubeb_update.sh
@@ -0,0 +1,12 @@
+$NetBSD: patch-mozilla_media_libcubeb_update.sh,v 1.1 2017/04/27 13:32:41 ryoon Exp $
+
+--- mozilla/media/libcubeb/update.sh.orig 2017-04-14 04:53:18.000000000 +0000
++++ mozilla/media/libcubeb/update.sh
+@@ -17,6 +17,7 @@ cp $1/src/cubeb_audiounit.cpp src
+ cp $1/src/cubeb_osx_run_loop.h src
+ cp $1/src/cubeb_jack.cpp src
+ cp $1/src/cubeb_opensl.c src
++cp $1/src/cubeb_oss.c src
+ cp $1/src/cubeb_panner.cpp src
+ cp $1/src/cubeb_panner.h src
+ cp $1/src/cubeb_pulse.c src
diff --git a/mail/thunderbird/patches/patch-mozilla_media_libpng_pngpriv.h b/mail/thunderbird/patches/patch-mozilla_media_libpng_pngpriv.h
deleted file mode 100644
index 061a3378c0d..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_media_libpng_pngpriv.h
+++ /dev/null
@@ -1,12 +0,0 @@
-$NetBSD: patch-mozilla_media_libpng_pngpriv.h,v 1.3 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/media/libpng/pngpriv.h.orig 2016-04-07 21:33:21.000000000 +0000
-+++ mozilla/media/libpng/pngpriv.h
-@@ -36,6 +36,7 @@
- * still required (as of 2011-05-02.)
- */
- #define _POSIX_SOURCE 1 /* Just the POSIX 1003.1 and C89 APIs */
-+#define _XOPEN_SOURCE 600
-
- #ifndef PNG_VERSION_INFO_ONLY
- /* Standard library headers not required by png.h: */
diff --git a/mail/thunderbird/patches/patch-mozilla_media_libsoundtouch_src_soundtouch__perms.h b/mail/thunderbird/patches/patch-mozilla_media_libsoundtouch_src_soundtouch__perms.h
new file mode 100644
index 00000000000..5cb574a599c
--- /dev/null
+++ b/mail/thunderbird/patches/patch-mozilla_media_libsoundtouch_src_soundtouch__perms.h
@@ -0,0 +1,14 @@
+$NetBSD: patch-mozilla_media_libsoundtouch_src_soundtouch__perms.h,v 1.1 2017/04/27 13:32:41 ryoon Exp $
+
+--- mozilla/media/libsoundtouch/src/soundtouch_perms.h.orig 2017-04-14 04:53:17.000000000 +0000
++++ mozilla/media/libsoundtouch/src/soundtouch_perms.h
+@@ -12,7 +12,9 @@
+
+ #pragma GCC visibility push(default)
+ #include "SoundTouch.h"
++#ifndef MOZ_SYSTEM_SOUNDTOUCH
+ #include "SoundTouchFactory.h"
++#endif
+ #pragma GCC visibility pop
+
+ #endif // MOZILLA_SOUNDTOUCH_PERMS_H
diff --git a/mail/thunderbird/patches/patch-mozilla_media_libstagefright_frameworks_av_include_media_stagefright_foundation_AString.h b/mail/thunderbird/patches/patch-mozilla_media_libstagefright_frameworks_av_include_media_stagefright_foundation_AString.h
deleted file mode 100644
index bf520b2c7e5..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_media_libstagefright_frameworks_av_include_media_stagefright_foundation_AString.h
+++ /dev/null
@@ -1,12 +0,0 @@
-$NetBSD: patch-mozilla_media_libstagefright_frameworks_av_include_media_stagefright_foundation_AString.h,v 1.1 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/media/libstagefright/frameworks/av/include/media/stagefright/foundation/AString.h.orig 2016-04-07 21:33:21.000000000 +0000
-+++ mozilla/media/libstagefright/frameworks/av/include/media/stagefright/foundation/AString.h
-@@ -18,6 +18,7 @@
-
- #define A_STRING_H_
-
-+#include <cctype>
- #include <sys/types.h>
-
- namespace stagefright {
diff --git a/mail/thunderbird/patches/patch-mozilla_media_libstagefright_frameworks_av_media_libstagefright_foundation_AString.cpp b/mail/thunderbird/patches/patch-mozilla_media_libstagefright_frameworks_av_media_libstagefright_foundation_AString.cpp
deleted file mode 100644
index bde1e40da1b..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_media_libstagefright_frameworks_av_media_libstagefright_foundation_AString.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD: patch-mozilla_media_libstagefright_frameworks_av_media_libstagefright_foundation_AString.cpp,v 1.2 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/media/libstagefright/frameworks/av/media/libstagefright/foundation/AString.cpp.orig 2016-04-07 21:33:21.000000000 +0000
-+++ mozilla/media/libstagefright/frameworks/av/media/libstagefright/foundation/AString.cpp
-@@ -23,6 +23,17 @@
- #include "ADebug.h"
- #include "AString.h"
-
-+#ifdef __FreeBSD__
-+# include <osreldate.h>
-+# if __FreeBSD_version < 900506
-+# undef tolower
-+# endif
-+#endif
-+
-+#if defined(__NetBSD__) && defined(tolower)
-+#undef tolower
-+#endif
-+
- namespace stagefright {
-
- // static
diff --git a/mail/thunderbird/patches/patch-mozilla_media_libstagefright_system_core_liblog_fake__log__device.c b/mail/thunderbird/patches/patch-mozilla_media_libstagefright_system_core_liblog_fake__log__device.c
deleted file mode 100644
index 376bc6a620e..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_media_libstagefright_system_core_liblog_fake__log__device.c
+++ /dev/null
@@ -1,27 +0,0 @@
-$NetBSD: patch-mozilla_media_libstagefright_system_core_liblog_fake__log__device.c,v 1.2 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/media/libstagefright/system/core/liblog/fake_log_device.c.orig 2016-04-07 21:33:21.000000000 +0000
-+++ mozilla/media/libstagefright/system/core/liblog/fake_log_device.c
-@@ -231,11 +231,11 @@ static void configureInitialState(const
- char tagName[kMaxTagLen];
- int i, minPrio;
-
-- while (isspace(*tags))
-+ while (isspace((unsigned char)*tags))
- tags++;
-
- i = 0;
-- while (*tags != '\0' && !isspace(*tags) && *tags != ':' &&
-+ while (*tags != '\0' && !isspace((unsigned char)*tags) && *tags != ':' &&
- i < kMaxTagLen)
- {
- tagName[i++] = *tags++;
-@@ -274,7 +274,7 @@ static void configureInitialState(const
- }
-
- tags++;
-- if (*tags != '\0' && !isspace(*tags)) {
-+ if (*tags != '\0' && !isspace((unsigned char)*tags)) {
- TRACE("ERROR: garbage in tag env; expected whitespace\n");
- TRACE(" env='%s'\n", tags);
- return;
diff --git a/mail/thunderbird/patches/patch-mozilla_media_libstagefright_system_core_liblog_logprint.c b/mail/thunderbird/patches/patch-mozilla_media_libstagefright_system_core_liblog_logprint.c
deleted file mode 100644
index 76660a0eeca..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_media_libstagefright_system_core_liblog_logprint.c
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD: patch-mozilla_media_libstagefright_system_core_liblog_logprint.c,v 1.2 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/media/libstagefright/system/core/liblog/logprint.c.orig 2016-04-07 21:33:21.000000000 +0000
-+++ mozilla/media/libstagefright/system/core/liblog/logprint.c
-@@ -103,7 +103,7 @@ static android_LogPriority filterCharToP
- {
- android_LogPriority pri;
-
-- c = tolower(c);
-+ c = tolower((unsigned char)c);
-
- if (c >= '0' && c <= '9') {
- if (c >= ('0'+ANDROID_LOG_SILENT)) {
-@@ -372,7 +372,7 @@ static inline char * strip_end(char *str
- {
- char *end = str + strlen(str) - 1;
-
-- while (end >= str && isspace(*end))
-+ while (end >= str && isspace((unsigned char)*end))
- *end-- = '\0';
- return str;
- }
diff --git a/mail/thunderbird/patches/patch-mozilla_media_libtheora_lib_info.c b/mail/thunderbird/patches/patch-mozilla_media_libtheora_lib_info.c
deleted file mode 100644
index 59cda061e09..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_media_libtheora_lib_info.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-mozilla_media_libtheora_lib_info.c,v 1.2 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/media/libtheora/lib/info.c.orig 2016-04-07 21:33:21.000000000 +0000
-+++ mozilla/media/libtheora/lib/info.c
-@@ -29,7 +29,7 @@
- static int oc_tagcompare(const char *_s1,const char *_s2,int _n){
- int c;
- for(c=0;c<_n;c++){
-- if(toupper(_s1[c])!=toupper(_s2[c]))return !0;
-+ if(toupper((unsigned char)_s1[c])!=toupper((unsigned char)_s2[c]))return !0;
- }
- return _s1[c]!='=';
- }
diff --git a/mail/thunderbird/patches/patch-mozilla_media_libtheora_moz.build b/mail/thunderbird/patches/patch-mozilla_media_libtheora_moz.build
index f2264daaeff..ecb3a74f5c3 100644
--- a/mail/thunderbird/patches/patch-mozilla_media_libtheora_moz.build
+++ b/mail/thunderbird/patches/patch-mozilla_media_libtheora_moz.build
@@ -1,14 +1,14 @@
-$NetBSD: patch-mozilla_media_libtheora_moz.build,v 1.2 2016/04/17 18:33:50 ryoon Exp $
+$NetBSD: patch-mozilla_media_libtheora_moz.build,v 1.3 2017/04/27 13:32:41 ryoon Exp $
---- mozilla/media/libtheora/moz.build.orig 2016-04-07 21:33:21.000000000 +0000
+--- mozilla/media/libtheora/moz.build.orig 2017-04-14 04:53:17.000000000 +0000
+++ mozilla/media/libtheora/moz.build
@@ -21,6 +21,9 @@ FINAL_LIBRARY = 'gkmedias'
# The encoder is currently not included.
DEFINES['THEORA_DISABLE_ENCODE'] = True
-+if CONFIG['MOZ_NATIVE_OGG']:
++if CONFIG['MOZ_SYSTEM_OGG']:
+ CFLAGS += CONFIG['MOZ_OGG_CFLAGS']
+
# Suppress warnings in third-party code.
- if CONFIG['GNU_CC']:
+ if CONFIG['GNU_CC'] or CONFIG['CLANG_CL']:
CFLAGS += ['-Wno-type-limits']
diff --git a/mail/thunderbird/patches/patch-mozilla_media_libtremor_Makefile.in b/mail/thunderbird/patches/patch-mozilla_media_libtremor_Makefile.in
deleted file mode 100644
index fab82aed223..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_media_libtremor_Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-$NetBSD: patch-mozilla_media_libtremor_Makefile.in,v 1.2 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/media/libtremor/Makefile.in.orig 2016-04-17 13:47:46.300311547 +0000
-+++ mozilla/media/libtremor/Makefile.in
-@@ -0,0 +1,9 @@
-+# This Source Code Form is subject to the terms of the Mozilla Public
-+# License, v. 2.0. If a copy of the MPL was not distributed with this
-+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-+
-+include $(topsrcdir)/config/rules.mk
-+
-+ifdef MOZ_NATIVE_OGG
-+CFLAGS += $(MOZ_OGG_CFLAGS)
-+endif
diff --git a/mail/thunderbird/patches/patch-mozilla_media_libtremor_moz.build b/mail/thunderbird/patches/patch-mozilla_media_libtremor_moz.build
index 6bb920ffae1..6a77100f262 100644
--- a/mail/thunderbird/patches/patch-mozilla_media_libtremor_moz.build
+++ b/mail/thunderbird/patches/patch-mozilla_media_libtremor_moz.build
@@ -1,10 +1,10 @@
-$NetBSD: patch-mozilla_media_libtremor_moz.build,v 1.2 2016/04/17 18:33:50 ryoon Exp $
+$NetBSD: patch-mozilla_media_libtremor_moz.build,v 1.3 2017/04/27 13:32:41 ryoon Exp $
---- mozilla/media/libtremor/moz.build.orig 2016-04-07 21:33:21.000000000 +0000
+--- mozilla/media/libtremor/moz.build.orig 2017-04-14 04:53:18.000000000 +0000
+++ mozilla/media/libtremor/moz.build
@@ -9,3 +9,5 @@ with Files('*'):
DIRS += ['include/tremor', 'lib']
-+if CONFIG['MOZ_NATIVE_OGG']:
++if CONFIG['MOZ_SYSTEM_OGG']:
+ CFLAGS += CONFIG['MOZ_OGG_CFLAGS']
diff --git a/mail/thunderbird/patches/patch-mozilla_media_libvorbis_Makefile.in b/mail/thunderbird/patches/patch-mozilla_media_libvorbis_Makefile.in
deleted file mode 100644
index c9c6cea3774..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_media_libvorbis_Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-$NetBSD: patch-mozilla_media_libvorbis_Makefile.in,v 1.2 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/media/libvorbis/Makefile.in.orig 2016-04-17 13:47:46.301306422 +0000
-+++ mozilla/media/libvorbis/Makefile.in
-@@ -0,0 +1,9 @@
-+# This Source Code Form is subject to the terms of the Mozilla Public
-+# License, v. 2.0. If a copy of the MPL was not distributed with this
-+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-+
-+include $(topsrcdir)/config/rules.mk
-+
-+ifdef MOZ_NATIVE_OGG
-+CFLAGS += $(MOZ_OGG_CFLAGS)
-+endif
diff --git a/mail/thunderbird/patches/patch-mozilla_media_libvorbis_lib_vorbis__info.c b/mail/thunderbird/patches/patch-mozilla_media_libvorbis_lib_vorbis__info.c
deleted file mode 100644
index 202e5c6397f..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_media_libvorbis_lib_vorbis__info.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-mozilla_media_libvorbis_lib_vorbis__info.c,v 1.2 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/media/libvorbis/lib/vorbis_info.c.orig 2016-04-07 21:33:21.000000000 +0000
-+++ mozilla/media/libvorbis/lib/vorbis_info.c
-@@ -77,7 +77,7 @@ void vorbis_comment_add_tag(vorbis_comme
- static int tagcompare(const char *s1, const char *s2, int n){
- int c=0;
- while(c < n){
-- if(toupper(s1[c]) != toupper(s2[c]))
-+ if(toupper((unsigned char)s1[c]) != toupper((unsigned char)s2[c]))
- return !0;
- c++;
- }
diff --git a/mail/thunderbird/patches/patch-mozilla_media_libvorbis_moz.build b/mail/thunderbird/patches/patch-mozilla_media_libvorbis_moz.build
index 65593c5535c..150f01b6a50 100644
--- a/mail/thunderbird/patches/patch-mozilla_media_libvorbis_moz.build
+++ b/mail/thunderbird/patches/patch-mozilla_media_libvorbis_moz.build
@@ -1,11 +1,11 @@
-$NetBSD: patch-mozilla_media_libvorbis_moz.build,v 1.2 2016/04/17 18:33:50 ryoon Exp $
+$NetBSD: patch-mozilla_media_libvorbis_moz.build,v 1.3 2017/04/27 13:32:41 ryoon Exp $
---- mozilla/media/libvorbis/moz.build.orig 2016-04-07 21:33:21.000000000 +0000
+--- mozilla/media/libvorbis/moz.build.orig 2017-04-14 04:53:19.000000000 +0000
+++ mozilla/media/libvorbis/moz.build
@@ -56,3 +56,6 @@ FINAL_LIBRARY = 'gkmedias'
# Suppress warnings in third-party code.
if CONFIG['GNU_CC']:
CFLAGS += ['-Wno-uninitialized']
+
-+if CONFIG['MOZ_NATIVE_OGG']:
++if CONFIG['MOZ_SYSTEM_OGG']:
+ CFLAGS += CONFIG['MOZ_OGG_CFLAGS']
diff --git a/mail/thunderbird/patches/patch-mozilla_media_libyuv_include_libyuv_scale__row.h b/mail/thunderbird/patches/patch-mozilla_media_libyuv_include_libyuv_scale__row.h
deleted file mode 100644
index abab917bfb9..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_media_libyuv_include_libyuv_scale__row.h
+++ /dev/null
@@ -1,17 +0,0 @@
-$NetBSD: patch-mozilla_media_libyuv_include_libyuv_scale__row.h,v 1.2 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/media/libyuv/include/libyuv/scale_row.h.orig 2016-04-07 21:33:22.000000000 +0000
-+++ mozilla/media/libyuv/include/libyuv/scale_row.h
-@@ -219,10 +219,10 @@ void ScaleARGBFilterCols_SSSE3(uint8* ds
- void ScaleARGBColsUp2_SSE2(uint8* dst_argb, const uint8* src_argb,
- int dst_width, int x, int dx);
- // Row functions.
--void ScaleARGBRowDownEven_NEON(const uint8* src_argb, int src_stride,
-+void ScaleARGBRowDownEven_NEON(const uint8* src_argb, ptrdiff_t src_stride,
- int src_stepx,
- uint8* dst_argb, int dst_width);
--void ScaleARGBRowDownEvenBox_NEON(const uint8* src_argb, int src_stride,
-+void ScaleARGBRowDownEvenBox_NEON(const uint8* src_argb, ptrdiff_t src_stride,
- int src_stepx,
- uint8* dst_argb, int dst_width);
- void ScaleARGBRowDown2_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
diff --git a/mail/thunderbird/patches/patch-mozilla_media_libyuv_source_mjpeg__decoder.cc b/mail/thunderbird/patches/patch-mozilla_media_libyuv_source_mjpeg__decoder.cc
new file mode 100644
index 00000000000..8b372885205
--- /dev/null
+++ b/mail/thunderbird/patches/patch-mozilla_media_libyuv_source_mjpeg__decoder.cc
@@ -0,0 +1,12 @@
+$NetBSD: patch-mozilla_media_libyuv_source_mjpeg__decoder.cc,v 1.1 2017/04/27 13:32:41 ryoon Exp $
+
+--- mozilla/media/libyuv/source/mjpeg_decoder.cc.orig 2017-04-14 04:53:19.000000000 +0000
++++ mozilla/media/libyuv/source/mjpeg_decoder.cc
+@@ -25,7 +25,6 @@
+ #endif
+
+ #endif
+-struct FILE; // For jpeglib.h.
+
+ // C++ build requires extern C for jpeg internals.
+ #ifdef __cplusplus
diff --git a/mail/thunderbird/patches/patch-mozilla_media_mtransport_third__party_nICEr_src_util_mbslen.c b/mail/thunderbird/patches/patch-mozilla_media_mtransport_third__party_nICEr_src_util_mbslen.c
deleted file mode 100644
index f7df8b8e4cd..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_media_mtransport_third__party_nICEr_src_util_mbslen.c
+++ /dev/null
@@ -1,18 +0,0 @@
-$NetBSD: patch-mozilla_media_mtransport_third__party_nICEr_src_util_mbslen.c,v 1.3 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/media/mtransport/third_party/nICEr/src/util/mbslen.c.orig 2016-04-07 21:33:22.000000000 +0000
-+++ mozilla/media/mtransport/third_party/nICEr/src/util/mbslen.c
-@@ -47,6 +47,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- #define HAVE_XLOCALE
- #endif
-
-+#ifdef __DragonFly__
-+#include <osreldate.h>
-+# if __DragonFly_version > 300502
-+# define HAVE_XLOCALE
-+# endif
-+#endif
-+
- #ifdef HAVE_XLOCALE
- #include <xlocale.h>
- #endif /* HAVE_XLOCALE */
diff --git a/mail/thunderbird/patches/patch-mozilla_media_mtransport_third__party_nrappkit_src_port_generic_include_sys_queue.h b/mail/thunderbird/patches/patch-mozilla_media_mtransport_third__party_nrappkit_src_port_generic_include_sys_queue.h
deleted file mode 100644
index 2354370971c..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_media_mtransport_third__party_nrappkit_src_port_generic_include_sys_queue.h
+++ /dev/null
@@ -1,19 +0,0 @@
-$NetBSD: patch-mozilla_media_mtransport_third__party_nrappkit_src_port_generic_include_sys_queue.h,v 1.3 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/media/mtransport/third_party/nrappkit/src/port/generic/include/sys/queue.h.orig 2016-04-07 21:33:22.000000000 +0000
-+++ mozilla/media/mtransport/third_party/nrappkit/src/port/generic/include/sys/queue.h
-@@ -30,7 +30,13 @@
- * $FreeBSD: src/sys/sys/queue.h,v 1.58 2004/04/07 04:19:49 imp Exp $
- */
-
--#ifndef _SYS_QUEUE_H_
-+#if (defined(BSD) && !defined(__OpenBSD__)) || defined(DARWIN)
-+#include_next <sys/queue.h>
-+# if defined(__DragonFly__)
-+#define STAILQ_FOREACH_SAFE STAILQ_FOREACH_MUTABLE
-+#define TAILQ_FOREACH_SAFE TAILQ_FOREACH_MUTABLE
-+# endif
-+#elif !defined(_SYS_QUEUE_H_)
- #define _SYS_QUEUE_H_
-
- #include <stddef.h>
diff --git a/mail/thunderbird/patches/patch-mozilla_media_webrtc_signaling_test_common.build b/mail/thunderbird/patches/patch-mozilla_media_webrtc_signaling_test_common.build
index 3cc1f56a82b..2d08bc876c4 100644
--- a/mail/thunderbird/patches/patch-mozilla_media_webrtc_signaling_test_common.build
+++ b/mail/thunderbird/patches/patch-mozilla_media_webrtc_signaling_test_common.build
@@ -1,8 +1,8 @@
-$NetBSD: patch-mozilla_media_webrtc_signaling_test_common.build,v 1.1 2016/04/17 18:33:50 ryoon Exp $
+$NetBSD: patch-mozilla_media_webrtc_signaling_test_common.build,v 1.2 2017/04/27 13:32:41 ryoon Exp $
---- mozilla/media/webrtc/signaling/test/common.build.orig 2016-04-07 21:33:22.000000000 +0000
+--- mozilla/media/webrtc/signaling/test/common.build.orig 2017-04-14 04:53:18.000000000 +0000
+++ mozilla/media/webrtc/signaling/test/common.build
-@@ -99,15 +99,19 @@ if CONFIG['JS_SHARED_LIBRARY']:
+@@ -96,11 +96,12 @@ if CONFIG['JS_SHARED_LIBRARY']:
USE_LIBS += ['mozglue']
@@ -15,12 +15,5 @@ $NetBSD: patch-mozilla_media_webrtc_signaling_test_common.build,v 1.1 2016/04/17
+if CONFIG['MOZ_OSS']:
+ OS_LIBS += CONFIG['MOZ_OSS_LIBS']
- if CONFIG['MOZ_NATIVE_JPEG']:
+ if CONFIG['MOZ_SYSTEM_JPEG']:
OS_LIBS += CONFIG['MOZ_JPEG_LIBS']
-
-+if CONFIG['MOZ_NATIVE_OPUS']:
-+ OS_LIBS += CONFIG['MOZ_OPUS_LIBS']
-+
- if CONFIG['MOZ_NATIVE_LIBVPX']:
- OS_LIBS += CONFIG['MOZ_LIBVPX_LIBS']
-
diff --git a/mail/thunderbird/patches/patch-mozilla_media_webrtc_trunk_webrtc_build_common.gypi b/mail/thunderbird/patches/patch-mozilla_media_webrtc_trunk_webrtc_build_common.gypi
deleted file mode 100644
index e1d1c29c083..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_media_webrtc_trunk_webrtc_build_common.gypi
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-mozilla_media_webrtc_trunk_webrtc_build_common.gypi,v 1.3 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/media/webrtc/trunk/webrtc/build/common.gypi.orig 2016-04-07 21:33:23.000000000 +0000
-+++ mozilla/media/webrtc/trunk/webrtc/build/common.gypi
-@@ -335,7 +335,7 @@
- }],
- ['OS=="dragonfly" or OS=="netbsd"', {
- 'defines': [
-- # doesn't support pthread_condattr_setclock
-+ # doesn't support pthread_condattr_setclock, NetBSD 6 supports it.
- 'WEBRTC_CLOCK_TYPE_REALTIME',
- ],
- }],
diff --git a/mail/thunderbird/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_audio__coding_neteq_neteq.gypi b/mail/thunderbird/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_audio__coding_neteq_neteq.gypi
deleted file mode 100644
index 862326e9b57..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_audio__coding_neteq_neteq.gypi
+++ /dev/null
@@ -1,28 +0,0 @@
-$NetBSD: patch-mozilla_media_webrtc_trunk_webrtc_modules_audio__coding_neteq_neteq.gypi,v 1.2 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/media/webrtc/trunk/webrtc/modules/audio_coding/neteq/neteq.gypi.orig 2016-04-07 21:33:23.000000000 +0000
-+++ mozilla/media/webrtc/trunk/webrtc/modules/audio_coding/neteq/neteq.gypi
-@@ -85,19 +85,11 @@
- ],
- }],
- ['build_with_mozilla==1', {
-- 'include_dirs': [
-- # Need Opus header files for the audio classifier.
-- '<(DEPTH)/../../../media/opus/celt',
--# '<(DEPTH)/third_party/opus/src/src',
-+ 'cflags_mozilla': [
-+ '$(filter -I%, $(MOZ_CELT_CFLAGS))/celt',
-+ '$(MOZ_OPUS_CFLAGS)',
-+ '$(filter -I%, $(MOZ_OPUS_CFLAGS))/../src',
- ],
-- 'direct_dependent_settings': {
-- 'include_dirs': [
-- '../../../../../../media/opus/celt',
-- # Need Opus header files for the audio classifier.
-- '<(DEPTH)/../../../media/opus/celt',
--# '<(DEPTH)/third_party/opus/src/src',
-- ],
-- },
- }],
- ],
- 'sources': [
diff --git a/mail/thunderbird/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_desktop__capture_screen__capturer.cc b/mail/thunderbird/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_desktop__capture_screen__capturer.cc
deleted file mode 100644
index 8bf47e42480..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_desktop__capture_screen__capturer.cc
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-mozilla_media_webrtc_trunk_webrtc_modules_desktop__capture_screen__capturer.cc,v 1.2 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer.cc.orig 2016-04-07 21:33:24.000000000 +0000
-+++ mozilla/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer.cc
-@@ -18,7 +18,7 @@ ScreenCapturer* ScreenCapturer::Create()
- return Create(DesktopCaptureOptions::CreateDefault());
- }
-
--#if defined(WEBRTC_LINUX)
-+#if defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)
- ScreenCapturer* ScreenCapturer::CreateWithXDamage(
- bool use_update_notifications) {
- DesktopCaptureOptions options;
diff --git a/mail/thunderbird/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_desktop__capture_screen__capturer.h b/mail/thunderbird/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_desktop__capture_screen__capturer.h
deleted file mode 100644
index c1a656882f5..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_desktop__capture_screen__capturer.h
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-mozilla_media_webrtc_trunk_webrtc_modules_desktop__capture_screen__capturer.h,v 1.2 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer.h.orig 2016-04-07 21:33:24.000000000 +0000
-+++ mozilla/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer.h
-@@ -63,7 +63,7 @@ class ScreenCapturer : public DesktopCap
- static ScreenCapturer* Create(const DesktopCaptureOptions& options);
- static ScreenCapturer* Create();
-
--#if defined(WEBRTC_LINUX)
-+#if defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)
- // Creates platform-specific capturer and instructs it whether it should use
- // X DAMAGE support.
- static ScreenCapturer* CreateWithXDamage(bool use_x_damage);
diff --git a/mail/thunderbird/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_linux_device__info__linux.cc b/mail/thunderbird/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_linux_device__info__linux.cc
index e7ae8c05b71..3ff40c9f2be 100644
--- a/mail/thunderbird/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_linux_device__info__linux.cc
+++ b/mail/thunderbird/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_linux_device__info__linux.cc
@@ -1,8 +1,8 @@
-$NetBSD: patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_linux_device__info__linux.cc,v 1.3 2016/04/17 18:33:50 ryoon Exp $
+$NetBSD: patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_linux_device__info__linux.cc,v 1.4 2017/04/27 13:32:41 ryoon Exp $
---- mozilla/media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc.orig 2016-04-07 21:33:24.000000000 +0000
+--- mozilla/media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc.orig 2017-04-14 04:53:19.000000000 +0000
+++ mozilla/media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc
-@@ -25,10 +25,21 @@
+@@ -25,6 +25,9 @@
#else
#include <linux/videodev2.h>
#endif
@@ -12,6 +12,9 @@ $NetBSD: patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_linux_de
#include "webrtc/system_wrappers/interface/ref_count.h"
#include "webrtc/system_wrappers/interface/trace.h"
+@@ -34,6 +37,15 @@
+ #define BUF_LEN ( 1024 * ( EVENT_SIZE + 16 ) )
+ #endif
+#ifdef HAVE_LIBV4L2
+#define open v4l2_open
@@ -21,10 +24,11 @@ $NetBSD: patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_linux_de
+#define mmap v4l2_mmap
+#define munmap v4l2_munmap
+#endif
-
++
namespace webrtc
{
-@@ -136,6 +147,11 @@ int32_t DeviceInfoLinux::GetDeviceName(
+ namespace videocapturemodule
+@@ -274,6 +286,11 @@ int32_t DeviceInfoLinux::GetDeviceName(
memset(deviceNameUTF8, 0, deviceNameLength);
memcpy(cameraName, cap.card, sizeof(cap.card));
diff --git a/mail/thunderbird/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_video__capture.gypi b/mail/thunderbird/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_video__capture.gypi
index ec8ce153b2b..bf5dd970bef 100644
--- a/mail/thunderbird/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_video__capture.gypi
+++ b/mail/thunderbird/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_video__capture.gypi
@@ -1,6 +1,6 @@
-$NetBSD: patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_video__capture.gypi,v 1.3 2016/04/17 18:33:50 ryoon Exp $
+$NetBSD: patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_video__capture.gypi,v 1.4 2017/04/27 13:32:41 ryoon Exp $
---- mozilla/media/webrtc/trunk/webrtc/modules/video_capture/video_capture.gypi.orig 2016-04-07 21:33:24.000000000 +0000
+--- mozilla/media/webrtc/trunk/webrtc/modules/video_capture/video_capture.gypi.orig 2017-04-14 04:53:19.000000000 +0000
+++ mozilla/media/webrtc/trunk/webrtc/modules/video_capture/video_capture.gypi
@@ -7,6 +7,9 @@
# be found in the AUTHORS file in the root of the source tree.
@@ -12,38 +12,23 @@ $NetBSD: patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_video__c
'targets': [
{
# Note this library is missing an implementation for the video capture.
-@@ -64,8 +67,32 @@
- 'video_capture_module',
- '<(webrtc_root)/common.gyp:webrtc_common',
- ],
-- 'cflags_mozilla': [
-- '$(NSPR_CFLAGS)',
-+ 'conditions': [
-+ ['use_libv4l2==1', {
-+ 'defines': [
-+ 'HAVE_LIBV4L2',
+@@ -75,6 +78,19 @@
+ 'linux/video_capture_linux.cc',
+ 'linux/video_capture_linux.h',
+ ],
++ 'conditions': [
++ ['use_libv4l2==1', {
++ 'defines': [
++ 'HAVE_LIBV4L2',
++ ],
++ 'cflags_mozilla': [
++ '$(MOZ_LIBV4L2_CFLAGS)',
++ ],
++ 'libraries': [
++ '-lv4l2',
++ ],
++ }],
+ ],
-+ 'cflags_mozilla': [
-+ '$(MOZ_LIBV4L2_CFLAGS)',
-+ ],
-+ 'libraries': [
-+ '-lv4l2',
-+ ],
-+ }],
-+ ],
-+ }], # linux
-+ ['OS=="mac"', {
-+ 'sources': [
-+ 'mac/qtkit/video_capture_qtkit.h',
-+ 'mac/qtkit/video_capture_qtkit.mm',
-+ 'mac/qtkit/video_capture_qtkit_info.h',
-+ 'mac/qtkit/video_capture_qtkit_info.mm',
-+ 'mac/qtkit/video_capture_qtkit_info_objc.h',
-+ 'mac/qtkit/video_capture_qtkit_info_objc.mm',
-+ 'mac/qtkit/video_capture_qtkit_objc.h',
-+ 'mac/qtkit/video_capture_qtkit_objc.mm',
-+ 'mac/qtkit/video_capture_qtkit_utility.h',
-+ 'mac/video_capture_mac.mm',
- ],
- 'conditions': [
- ['include_v4l2_video_capture==1', {
+ }], # linux
+ ['OS=="mac"', {
+ 'sources': [
diff --git a/mail/thunderbird/patches/patch-mozilla_media_webrtc_trunk_webrtc_system__wrappers_source_spreadsortlib_spreadsort.hpp b/mail/thunderbird/patches/patch-mozilla_media_webrtc_trunk_webrtc_system__wrappers_source_spreadsortlib_spreadsort.hpp
deleted file mode 100644
index 7fdbc688d48..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_media_webrtc_trunk_webrtc_system__wrappers_source_spreadsortlib_spreadsort.hpp
+++ /dev/null
@@ -1,43 +0,0 @@
-$NetBSD: patch-mozilla_media_webrtc_trunk_webrtc_system__wrappers_source_spreadsortlib_spreadsort.hpp,v 1.4 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/media/webrtc/trunk/webrtc/system_wrappers/source/spreadsortlib/spreadsort.hpp.orig 2016-04-07 21:33:24.000000000 +0000
-+++ mozilla/media/webrtc/trunk/webrtc/system_wrappers/source/spreadsortlib/spreadsort.hpp
-@@ -14,6 +14,13 @@ Cygwin fix provided by:
- Scott McMurray
- */
-
-+#ifdef __FreeBSD__
-+# include <osreldate.h>
-+# if __FreeBSD_version < 900506
-+# define getchar boost_getchar
-+# endif
-+#endif
-+
- #ifndef BOOST_SPREAD_SORT_H
- #define BOOST_SPREAD_SORT_H
- #include <algorithm>
-@@ -21,10 +28,24 @@ Scott McMurray
- #include <vector>
- #include "webrtc/system_wrappers/source/spreadsortlib/constants.hpp"
-
-+#ifdef __FreeBSD__
-+# include <osreldate.h>
-+# if __FreeBSD_version < 900506
-+# define getchar boost_getchar
-+# endif
-+#endif
-+
- #ifdef getchar
- #undef getchar
- #endif
-
-+#ifdef __FreeBSD__
-+# include <osreldate.h>
-+# if __FreeBSD_version < 900506
-+# define getchar boost_getchar
-+# endif
-+#endif
-+
- namespace boost {
- namespace detail {
- //This only works on unsigned data types
diff --git a/mail/thunderbird/patches/patch-mozilla_memory_build_mozjemalloc__compat.c b/mail/thunderbird/patches/patch-mozilla_memory_build_mozjemalloc__compat.c
deleted file mode 100644
index 7b6974e5112..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_memory_build_mozjemalloc__compat.c
+++ /dev/null
@@ -1,53 +0,0 @@
-$NetBSD: patch-mozilla_memory_build_mozjemalloc__compat.c,v 1.2 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/memory/build/mozjemalloc_compat.c.orig 2016-04-07 21:33:25.000000000 +0000
-+++ mozilla/memory/build/mozjemalloc_compat.c
-@@ -131,6 +131,48 @@ compute_bin_unused_and_bookkeeping(jemal
- stats->bin_unused = bin_unused;
- }
-
-+static size_t
-+compute_bin_unused(unsigned int narenas)
-+{
-+ size_t bin_unused = 0;
-+
-+ uint32_t nregs; // number of regions per run in the j-th bin
-+ size_t reg_size; // size of regions served by the j-th bin
-+ size_t curruns; // number of runs belonging to a bin
-+ size_t curregs; // number of allocated regions in a bin
-+
-+ unsigned int nbins; // number of bins per arena
-+ unsigned int i, j;
-+
-+ // curruns and curregs are not defined for uninitialized arenas,
-+ // so we skip them when computing bin_unused. However, initialized
-+ // arenas are not guaranteed to be sequential, so we must test each
-+ // one when iterating below.
-+ bool initialized[100]; // should be narenas, but MSVC doesn't have VLAs
-+ size_t isz = sizeof(initialized) / sizeof(initialized[0]);
-+
-+ je_(mallctl)("arenas.initialized", initialized, &isz, NULL, 0);
-+ CTL_GET("arenas.nbins", nbins);
-+
-+ for (j = 0; j < nbins; j++) {
-+ CTL_I_GET("arenas.bin.0.nregs", nregs, j);
-+ CTL_I_GET("arenas.bin.0.size", reg_size, j);
-+
-+ for (i = 0; i < narenas; i++) {
-+ if (!initialized[i]) {
-+ continue;
-+ }
-+
-+ CTL_IJ_GET("stats.arenas.0.bins.0.curruns", curruns, i, j);
-+ CTL_IJ_GET("stats.arenas.0.bins.0.curregs", curregs, i, j);
-+
-+ bin_unused += (nregs * curruns - curregs) * reg_size;
-+ }
-+ }
-+
-+ return bin_unused;
-+}
-+
- MOZ_JEMALLOC_API void
- jemalloc_stats_impl(jemalloc_stats_t *stats)
- {
diff --git a/mail/thunderbird/patches/patch-mozilla_memory_volatile_VolatileBufferOSX.cpp b/mail/thunderbird/patches/patch-mozilla_memory_volatile_VolatileBufferOSX.cpp
deleted file mode 100644
index d3217aa9d87..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_memory_volatile_VolatileBufferOSX.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
-$NetBSD: patch-mozilla_memory_volatile_VolatileBufferOSX.cpp,v 1.2 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/memory/volatile/VolatileBufferOSX.cpp.orig 2016-04-07 21:33:25.000000000 +0000
-+++ mozilla/memory/volatile/VolatileBufferOSX.cpp
-@@ -47,7 +47,14 @@ VolatileBuffer::Init(size_t aSize, size_
- }
-
- heap_alloc:
-+#if defined(HAVE_POSIX_MEMALIGN)
- (void)moz_posix_memalign(&mBuf, aAlignment, aSize);
-+#else
-+ MOZ_RELEASE_ASSERT(
-+ !(aAlignment > (size_t)getpagesize()),
-+ "Cannot fallback to valloc(3): alignment is larger than the page size");
-+ mBuf = valloc(aSize);
-+#endif
- mHeap = true;
- return !!mBuf;
- }
diff --git a/mail/thunderbird/patches/patch-mozilla_mfbt_Attributes.h b/mail/thunderbird/patches/patch-mozilla_mfbt_Attributes.h
deleted file mode 100644
index 3a7b929ffbb..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_mfbt_Attributes.h
+++ /dev/null
@@ -1,30 +0,0 @@
-$NetBSD: patch-mozilla_mfbt_Attributes.h,v 1.3 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/mfbt/Attributes.h.orig 2016-04-07 21:33:25.000000000 +0000
-+++ mozilla/mfbt/Attributes.h
-@@ -50,6 +50,7 @@
- * don't indicate support for them here, due to
- * http://stackoverflow.com/questions/20498142/visual-studio-2013-explicit-keyword-bug
- */
-+# define MOZ_HAVE_CXX11_ALIGNAS
- # define MOZ_HAVE_NEVER_INLINE __declspec(noinline)
- # define MOZ_HAVE_NORETURN __declspec(noreturn)
- # if _MSC_VER >= 1900
-@@ -75,6 +76,9 @@
- # ifndef __has_extension
- # define __has_extension __has_feature /* compatibility, for older versions of clang */
- # endif
-+# if __has_extension(cxx_alignas)
-+# define MOZ_HAVE_CXX11_ALIGNAS
-+# endif
- # if __has_extension(cxx_constexpr)
- # define MOZ_HAVE_CXX11_CONSTEXPR
- # endif
-@@ -91,6 +95,7 @@
- # if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
- # define MOZ_HAVE_CXX11_CONSTEXPR
- # if MOZ_GCC_VERSION_AT_LEAST(4, 8, 0)
-+# define MOZ_HAVE_CXX11_ALIGNAS
- # define MOZ_HAVE_CXX11_CONSTEXPR_IN_TEMPLATES
- # endif
- # define MOZ_HAVE_EXPLICIT_CONVERSION
diff --git a/mail/thunderbird/patches/patch-mozilla_mobile_android_installer_Makefile.in b/mail/thunderbird/patches/patch-mozilla_mobile_android_installer_Makefile.in
new file mode 100644
index 00000000000..dbbcc8a4dc9
--- /dev/null
+++ b/mail/thunderbird/patches/patch-mozilla_mobile_android_installer_Makefile.in
@@ -0,0 +1,15 @@
+$NetBSD: patch-mozilla_mobile_android_installer_Makefile.in,v 1.3 2017/04/27 13:32:41 ryoon Exp $
+
+--- mozilla/mobile/android/installer/Makefile.in.orig 2017-04-14 04:53:19.000000000 +0000
++++ mozilla/mobile/android/installer/Makefile.in
+@@ -74,6 +74,10 @@ BINPATH = bin
+ endif
+ DEFINES += -DBINPATH=$(BINPATH)
+
++ifdef MOZ_DEBUG
++DEFINES += -DMOZ_DEBUG=1
++endif
++
+ ifdef ENABLE_MARIONETTE
+ DEFINES += -DENABLE_MARIONETTE=1
+ endif
diff --git a/mail/thunderbird/patches/patch-mozilla_modules_libpref_init_all.js b/mail/thunderbird/patches/patch-mozilla_modules_libpref_init_all.js
deleted file mode 100644
index 3f0b05c0929..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_modules_libpref_init_all.js
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-mozilla_modules_libpref_init_all.js,v 1.1 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/modules/libpref/init/all.js.orig 2016-04-07 21:33:29.000000000 +0000
-+++ mozilla/modules/libpref/init/all.js
-@@ -4332,7 +4332,7 @@ pref("layers.max-active", -1);
- pref("layers.tiles.adjust", true);
-
- // Set the default values, and then override per-platform as needed
--pref("layers.offmainthreadcomposition.enabled", true);
-+pref("layers.offmainthreadcomposition.enabled", false);
- // Compositor target frame rate. NOTE: If vsync is enabled the compositor
- // frame rate will still be capped.
- // -1 -> default (match layout.frame_rate or 60 FPS)
diff --git a/mail/thunderbird/patches/patch-mozilla_mozglue_build_arm.cpp b/mail/thunderbird/patches/patch-mozilla_mozglue_build_arm.cpp
index e74d5c77e34..be0a189cc37 100644
--- a/mail/thunderbird/patches/patch-mozilla_mozglue_build_arm.cpp
+++ b/mail/thunderbird/patches/patch-mozilla_mozglue_build_arm.cpp
@@ -1,13 +1,13 @@
-$NetBSD: patch-mozilla_mozglue_build_arm.cpp,v 1.1 2016/04/17 18:33:50 ryoon Exp $
+$NetBSD: patch-mozilla_mozglue_build_arm.cpp,v 1.2 2017/04/27 13:32:41 ryoon Exp $
---- mozilla/mozglue/build/arm.cpp.orig 2016-04-07 21:33:29.000000000 +0000
+--- mozilla/mozglue/build/arm.cpp.orig 2017-04-14 04:53:21.000000000 +0000
+++ mozilla/mozglue/build/arm.cpp
-@@ -102,10 +102,13 @@ check_neon(void)
- }
- # endif // !MOZILLA_PRESUME_NEON
+@@ -13,10 +13,13 @@
+ // we don't compile one of these detection methods. The detection code here is
+ // based on the CPU detection in libtheora.
--# elif defined(__linux__) || defined(ANDROID)
-+# elif defined(__linux__) || defined(ANDROID) || defined(__NetBSD__)
+-# if defined(__linux__) || defined(ANDROID)
++# if defined(__linux__) || defined(ANDROID) || defined(__NetBSD__)
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
@@ -17,7 +17,7 @@ $NetBSD: patch-mozilla_mozglue_build_arm.cpp,v 1.1 2016/04/17 18:33:50 ryoon Exp
enum{
MOZILLA_HAS_EDSP_FLAG=1,
-@@ -114,6 +117,29 @@ enum{
+@@ -25,6 +28,29 @@ enum{
MOZILLA_HAS_NEON_FLAG=8
};
@@ -47,7 +47,7 @@ $NetBSD: patch-mozilla_mozglue_build_arm.cpp,v 1.1 2016/04/17 18:33:50 ryoon Exp
static unsigned
get_arm_cpu_flags(void)
{
-@@ -178,6 +204,7 @@ get_arm_cpu_flags(void)
+@@ -89,6 +115,7 @@ get_arm_cpu_flags(void)
}
return flags;
}
diff --git a/mail/thunderbird/patches/patch-mozilla_netwerk_dns_moz.build b/mail/thunderbird/patches/patch-mozilla_netwerk_dns_moz.build
index e260aec39e5..ff0c61c3b46 100644
--- a/mail/thunderbird/patches/patch-mozilla_netwerk_dns_moz.build
+++ b/mail/thunderbird/patches/patch-mozilla_netwerk_dns_moz.build
@@ -1,14 +1,14 @@
-$NetBSD: patch-mozilla_netwerk_dns_moz.build,v 1.2 2016/04/17 18:33:50 ryoon Exp $
+$NetBSD: patch-mozilla_netwerk_dns_moz.build,v 1.3 2017/04/27 13:32:41 ryoon Exp $
---- mozilla/netwerk/dns/moz.build.orig 2016-04-07 21:33:29.000000000 +0000
+--- mozilla/netwerk/dns/moz.build.orig 2017-04-14 04:53:21.000000000 +0000
+++ mozilla/netwerk/dns/moz.build
@@ -66,6 +66,9 @@ LOCAL_INCLUDES += [
'/netwerk/base',
]
-+if CONFIG['MOZ_NATIVE_HARFBUZZ']:
++if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
+
- if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk' and CONFIG['ANDROID_VERSION'] > '19':
- LOCAL_INCLUDES += ['%' + '%s/bionic/libc/dns/include' % CONFIG['ANDROID_SOURCE']]
-
+ if CONFIG['ENABLE_INTL_API']:
+ DEFINES['IDNA2008'] = True
+ USE_LIBS += ['icu']
diff --git a/mail/thunderbird/patches/patch-mozilla_configure.in b/mail/thunderbird/patches/patch-mozilla_old-configure.in
index bb23a160db0..5025b16dc6f 100644
--- a/mail/thunderbird/patches/patch-mozilla_configure.in
+++ b/mail/thunderbird/patches/patch-mozilla_old-configure.in
@@ -1,50 +1,8 @@
-$NetBSD: patch-mozilla_configure.in,v 1.1 2016/04/17 18:33:50 ryoon Exp $
+$NetBSD: patch-mozilla_old-configure.in,v 1.1 2017/04/27 13:32:41 ryoon Exp $
---- mozilla/configure.in.orig 2016-04-07 21:33:18.000000000 +0000
-+++ mozilla/configure.in
-@@ -1746,7 +1746,7 @@ fi
- dnl ========================================================
- dnl SPS Profiler
- dnl ========================================================
--MOZ_ENABLE_PROFILER_SPS=1
-+MOZ_ENABLE_PROFILER_SPS=
-
- case "${OS_TARGET}" in
- Android)
-@@ -1996,7 +1996,6 @@ case "$target" in
- _PLATFORM_DEFAULT_TOOLKIT='cairo-uikit'
- direct_nspr_config=1
- else
-- AC_DEFINE(XP_MACOSX)
- AC_DEFINE(XP_DARWIN)
- _PLATFORM_DEFAULT_TOOLKIT='cairo-cocoa'
- # The ExceptionHandling framework is needed for Objective-C exception
-@@ -2580,8 +2579,7 @@ MOZ_CXX11
-
- AC_LANG_C
-
--dnl Check for .hidden assembler directive and visibility attribute.
--dnl Borrowed from glibc configure.in
-+dnl Setup default hidden visibility and wrapped system headers.
- dnl ===============================================================
- if test "$GNU_CC" -a "$OS_TARGET" != WINNT; then
- AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
-@@ -3476,6 +3474,14 @@ if test -n "$YASM"; then
- _YASM_BUILD=` echo ${YASM_VERSION} | $AWK -F\. '{ print $4 }'`
- fi
-
-+if test -n "${LIBXUL_SDK_DIR}"; then
-+ AC_MSG_WARN([pkgsrc: LIBXUL_SDK_DIR is set; assuming we want nss and nspr from xulrunner.])
-+ NSPR_CFLAGS="-I${prefix}/include/xulrunner/unstable `pkg-config --cflags nspr`"
-+ NSPR_LIBS="`pkg-config --libs nspr`"
-+ NSS_CFLAGS="`pkg-config --cflags nss`"
-+ NSS_LIBS="`pkg-config --libs nss`"
-+fi
-+
- if test -z "$SKIP_LIBRARY_CHECKS"; then
- dnl system JPEG support
- dnl ========================================================
-@@ -3503,11 +3509,7 @@ if test "$MOZ_NATIVE_JPEG" = 1; then
+--- mozilla/old-configure.in.orig 2017-04-14 04:53:22.000000000 +0000
++++ mozilla/old-configure.in
+@@ -2159,11 +2159,7 @@ if test "$MOZ_SYSTEM_JPEG" = 1; then
#include <jpeglib.h> ],
[ #if JPEG_LIB_VERSION < $MOZJPEG
#error "Insufficient JPEG library version ($MOZJPEG required)."
@@ -54,22 +12,11 @@ $NetBSD: patch-mozilla_configure.in,v 1.1 2016/04/17 18:33:50 ryoon Exp $
- #endif
- ],
+ #endif ],
- MOZ_NATIVE_JPEG=1,
+ MOZ_SYSTEM_JPEG=1,
AC_MSG_ERROR([Insufficient JPEG library version for --with-system-jpeg]))
fi
-@@ -4260,6 +4262,10 @@ cairo-gonk)
-
- esac
-
-+if test "$MOZ_WIDGET_TOOLKIT" = "cocoa"; then
-+ AC_DEFINE(XP_MACOSX)
-+fi
-+
- AC_SUBST(MOZ_PDF_PRINTING)
- if test "$MOZ_PDF_PRINTING"; then
- PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
-@@ -5018,6 +5024,9 @@ if test -n "$MOZ_WEBRTC"; then
- MOZ_VPX=1
+@@ -2894,6 +2890,9 @@ if test -n "$MOZ_WEBRTC"; then
+ MOZ_RAW=1
MOZ_VPX_ERROR_CONCEALMENT=1
+ dnl with libv4l2 we can support more cameras
@@ -78,20 +25,30 @@ $NetBSD: patch-mozilla_configure.in,v 1.1 2016/04/17 18:33:50 ryoon Exp $
dnl enable once Signaling lands
MOZ_WEBRTC_SIGNALING=1
AC_DEFINE(MOZ_WEBRTC_SIGNALING)
-@@ -5161,6 +5170,142 @@ if test "${ac_cv_c_attribute_aligned}" !
+@@ -2936,7 +2935,7 @@ dnl Use integers over floats for audio o
+ dnl (regarless of the CPU architecture, because audio
+ dnl backends for those platforms don't support floats. We also
+ dnl use integers on ARM with other OS, because it's more efficient.
+-if test "$OS_TARGET" = "Android" -o "$CPU_ARCH" = "arm"; then
++if test -n "$MOZ_INTEGER_SAMPLES"; then
+ MOZ_SAMPLE_TYPE_S16=1
+ AC_DEFINE(MOZ_SAMPLE_TYPE_S16)
+ AC_SUBST(MOZ_SAMPLE_TYPE_S16)
+@@ -3044,6 +3043,111 @@ if test -n "$MOZ_OMX_PLUGIN"; then
+ fi
fi
- dnl ========================================================
++dnl ========================================================
+dnl Check for libogg
+dnl ========================================================
+
+MOZ_ARG_WITH_BOOL(system-ogg,
+[ --with-system-ogg Use system libogg (located with pkgconfig)],
-+MOZ_NATIVE_OGG=1,
-+MOZ_NATIVE_OGG=)
++MOZ_SYSTEM_OGG=1,
++MOZ_SYSTEM_OGG=)
+
-+if test -n "$MOZ_NATIVE_OGG"; then
-+ PKG_CHECK_MODULES(MOZ_OGG, ogg >= 1.2.1)
++if test -n "$MOZ_SYSTEM_OGG"; then
++ PKG_CHECK_MODULES(MOZ_OGG, ogg >= 1.3.0)
+
+ _SAVE_LIBS=$LIBS
+ LIBS="$LIBS $MOZ_OGG_LIBS"
@@ -100,7 +57,7 @@ $NetBSD: patch-mozilla_configure.in,v 1.1 2016/04/17 18:33:50 ryoon Exp $
+ LIBS=$_SAVE_LIBS
+fi
+
-+AC_SUBST(MOZ_NATIVE_OGG)
++AC_SUBST(MOZ_SYSTEM_OGG)
+
+dnl ========================================================
+dnl Check for libvorbis
@@ -108,14 +65,14 @@ $NetBSD: patch-mozilla_configure.in,v 1.1 2016/04/17 18:33:50 ryoon Exp $
+
+MOZ_ARG_WITH_BOOL(system-vorbis,
+[ --with-system-vorbis Use system libvorbis (located with pkgconfig)],
-+MOZ_NATIVE_VORBIS=1,
-+MOZ_NATIVE_VORBIS=)
++MOZ_SYSTEM_VORBIS=1,
++MOZ_SYSTEM_VORBIS=)
+
-+if test -n "$MOZ_NATIVE_VORBIS"; then
++if test -n "$MOZ_SYSTEM_VORBIS"; then
+ PKG_CHECK_MODULES(MOZ_VORBIS, vorbis vorbisenc >= 1.3.5)
+fi
+
-+AC_SUBST(MOZ_NATIVE_VORBIS)
++AC_SUBST(MOZ_SYSTEM_VORBIS)
+
+dnl ========================================================
+dnl Check for integer-only libvorbis aka tremor
@@ -123,48 +80,14 @@ $NetBSD: patch-mozilla_configure.in,v 1.1 2016/04/17 18:33:50 ryoon Exp $
+
+MOZ_ARG_WITH_BOOL(system-tremor,
+[ --with-system-tremor Use system libtremor (located with pkgconfig)],
-+MOZ_NATIVE_TREMOR=1,
-+MOZ_NATIVE_TREMOR=)
++MOZ_SYSTEM_TREMOR=1,
++MOZ_SYSTEM_TREMOR=)
+
-+if test -n "$MOZ_NATIVE_TREMOR"; then
++if test -n "$MOZ_SYSTEM_TREMOR"; then
+ PKG_CHECK_MODULES(MOZ_TREMOR, vorbisidec >= 1.2.1)
+fi
+
-+AC_SUBST(MOZ_NATIVE_TREMOR)
-+
-+dnl ========================================================
-+dnl Check for libcelt
-+dnl ========================================================
-+
-+MOZ_ARG_WITH_BOOL(system-celt,
-+[ --with-system-celt Use system libcelt (located with pkgconfig)],
-+MOZ_NATIVE_CELT=1,
-+MOZ_NATIVE_CELT=)
-+
-+if test -n "$MOZ_NATIVE_CELT"; then
-+ PKG_CHECK_MODULES(MOZ_CELT, celt)
-+else
-+ MOZ_CELT_CFLAGS='-I$(topsrcdir)/media/libopus'
-+fi
-+
-+AC_SUBST(MOZ_NATIVE_CELT)
-+
-+dnl ========================================================
-+dnl Check for libopus
-+dnl ========================================================
-+
-+MOZ_ARG_WITH_BOOL(system-opus,
-+[ --with-system-opus Use system libopus (located with pkgconfig)],
-+MOZ_NATIVE_OPUS=1,
-+MOZ_NATIVE_OPUS=)
-+
-+if test -n "$MOZ_NATIVE_OPUS"; then
-+ PKG_CHECK_MODULES(MOZ_OPUS, opus >= 1.1)
-+else
-+ MOZ_OPUS_CFLAGS='-I$(topsrcdir)/media/libopus/include'
-+fi
-+
-+AC_SUBST(MOZ_NATIVE_OPUS)
++AC_SUBST(MOZ_SYSTEM_TREMOR)
+
+dnl ========================================================
+dnl Check for libtheora
@@ -172,26 +95,26 @@ $NetBSD: patch-mozilla_configure.in,v 1.1 2016/04/17 18:33:50 ryoon Exp $
+
+MOZ_ARG_WITH_BOOL(system-theora,
+[ --with-system-theora Use system libtheora (located with pkgconfig)],
-+MOZ_NATIVE_THEORA=1,
-+MOZ_NATIVE_THEORA=)
++MOZ_SYSTEM_THEORA=1,
++MOZ_SYSTEM_THEORA=)
+
-+if test -n "$MOZ_NATIVE_THEORA"; then
++if test -n "$MOZ_SYSTEM_THEORA"; then
+ PKG_CHECK_MODULES(MOZ_THEORA, theora >= 1.2)
+fi
+
-+AC_SUBST(MOZ_NATIVE_THEORA)
++AC_SUBST(MOZ_SYSTEM_THEORA)
+
+dnl ========================================================
-+dnl Check for libsoundtouch
++dnl Check for libSoundTouch
+dnl ========================================================
+
+MOZ_ARG_WITH_BOOL(system-soundtouch,
-+[ --with-system-soundtouch Use system libsoundtouch (located with pkgconfig)],
-+MOZ_NATIVE_SOUNDTOUCH=1,
-+MOZ_NATIVE_SOUNDTOUCH=)
++[ --with-system-soundtouch Use system libSoundTouch (located with pkgconfig)],
++MOZ_SYSTEM_SOUNDTOUCH=1,
++MOZ_SYSTEM_SOUNDTOUCH=)
+
-+if test -n "$MOZ_NATIVE_SOUNDTOUCH"; then
-+ PKG_CHECK_MODULES(MOZ_SOUNDTOUCH, soundtouch >= 1.8.0)
++if test -n "$MOZ_SYSTEM_SOUNDTOUCH"; then
++ PKG_CHECK_MODULES(MOZ_SOUNDTOUCH, soundtouch >= 1.9.0)
+
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
@@ -215,13 +138,15 @@ $NetBSD: patch-mozilla_configure.in,v 1.1 2016/04/17 18:33:50 ryoon Exp $
+ fi
+fi
+
-+AC_SUBST(MOZ_NATIVE_SOUNDTOUCH)
++if test -n "$MOZ_SYSTEM_SOUNDTOUCH"; then
++ AC_DEFINE(MOZ_SYSTEM_SOUNDTOUCH)
++fi
++AC_SUBST(MOZ_SYSTEM_SOUNDTOUCH)
+
-+dnl ========================================================
- dnl = Disable VP8 decoder support
+ dnl system libvpx Support
dnl ========================================================
- MOZ_ARG_DISABLE_BOOL(webm,
-@@ -5563,6 +5708,67 @@ fi
+ MOZ_ARG_WITH_BOOL(system-libvpx,
+@@ -3208,6 +3312,67 @@ AC_DEFINE(MOZ_WEBM_ENCODER)
AC_SUBST(MOZ_WEBM_ENCODER)
dnl ==================================
@@ -230,7 +155,7 @@ $NetBSD: patch-mozilla_configure.in,v 1.1 2016/04/17 18:33:50 ryoon Exp $
+
+dnl If using Linux, Solaris or BSDs, ensure that OSS is available
+case "$OS_TARGET" in
-+Linux|SunOS|DragonFly|FreeBSD|GNU/kFreeBSD)
++Linux|SunOS|DragonFly|FreeBSD|NetBSD|GNU/kFreeBSD)
+ MOZ_OSS=1
+ ;;
+esac
@@ -253,7 +178,7 @@ $NetBSD: patch-mozilla_configure.in,v 1.1 2016/04/17 18:33:50 ryoon Exp $
+ dnl Prefer 4Front implementation
+ AC_MSG_CHECKING([MOZ_OSS_CFLAGS])
+ if test "$OSSPREFIX" != "yes"; then
-+ oss_conf=${OSSPREFIX}/etc/oss.conf
++ oss_conf=${OSSPREFIX%/usr}/etc/oss.conf
+ if test -f "$oss_conf"; then
+ . "$oss_conf"
+ else
@@ -270,7 +195,7 @@ $NetBSD: patch-mozilla_configure.in,v 1.1 2016/04/17 18:33:50 ryoon Exp $
+
+ if test "$ac_cv_header_sys_soundcard_h" != "yes" -a \
+ "$ac_cv_header_soundcard_h" != "yes"; then
-+ AC_MSG_ERROR([Need OSS for Ogg, Wave or WebM decoding on $OS_TARGET. Disable with --disable-ogg --disable-wave --disable-webm.])
++ AC_MSG_ERROR([Need OSS for Ogg, Wave or WebM decoding on $OS_TARGET. Disable with --without-oss.])
+ fi
+
+ dnl Assume NetBSD implementation over SunAudio
@@ -289,76 +214,30 @@ $NetBSD: patch-mozilla_configure.in,v 1.1 2016/04/17 18:33:50 ryoon Exp $
dnl = Check alsa availability on Linux
dnl ==================================
-@@ -5576,12 +5782,23 @@ MOZ_ARG_ENABLE_BOOL(alsa,
- MOZ_ALSA=1,
- MOZ_ALSA=)
-
-+MOZ_ARG_DISABLE_BOOL(alsa-dlopen,
-+[ --disable-alsa-dlopen Disable runtime linking of libasound.so],
-+ DISABLE_LIBASOUND_DLOPEN=1,
-+ DISABLE_LIBASOUND_DLOPEN=)
-+
- if test -n "$MOZ_ALSA"; then
- PKG_CHECK_MODULES(MOZ_ALSA, alsa, ,
- [echo "$MOZ_ALSA_PKG_ERRORS"
- AC_MSG_ERROR([Need alsa for audio output on Linux. (On Ubuntu, you might try installing the package libasound2-dev.)])])
+@@ -5023,6 +5188,27 @@ if test "$USE_FC_FREETYPE"; then
fi
-+if test -n "$DISABLE_LIBASOUND_DLOPEN"; then
-+ AC_DEFINE(DISABLE_LIBASOUND_DLOPEN)
-+else
-+ MOZ_ALSA_LIBS=
-+fi
-+
- AC_SUBST(MOZ_ALSA)
-
dnl ========================================================
-@@ -8139,6 +8356,49 @@ if test "$USE_FC_FREETYPE"; then
- fi
-
- dnl ========================================================
-+dnl Check for harfbuzz
-+dnl ========================================================
-+
-+MOZ_ARG_WITH_BOOL(system-harfbuzz,
-+[ --with-system-harfbuzz Use system harfbuzz (located with pkgconfig)],
-+MOZ_NATIVE_HARFBUZZ=1,
-+MOZ_NATIVE_HARFBUZZ=)
-+
-+if test -n "$MOZ_NATIVE_HARFBUZZ"; then
-+ PKG_CHECK_MODULES(MOZ_HARFBUZZ, harfbuzz >= 0.9.34)
-+fi
-+
-+AC_SUBST(MOZ_NATIVE_HARFBUZZ)
-+
-+dnl ========================================================
+dnl Check for graphite2
+dnl ========================================================
-+
-+MOZ_ARG_WITH_BOOL(system-graphite2,
-+[ --with-system-graphite2 Use system graphite2 (located with pkgconfig)],
-+MOZ_NATIVE_GRAPHITE2=1,
-+MOZ_NATIVE_GRAPHITE2=)
-+
-+if test -n "$MOZ_NATIVE_GRAPHITE2"; then
-+ PKG_CHECK_MODULES(MOZ_GRAPHITE2, graphite2)
-+
++if test -n "$MOZ_SYSTEM_GRAPHITE2"; then
+ dnl graphite2.pc has bogus version, check manually
++ _SAVE_CFLAGS=$CFLAGS
++ CFLAGS="$CFLAGS $MOZ_GRAPHITE2_CFLAGS"
+ AC_TRY_COMPILE([ #include <graphite2/Font.h>
+ #define GR2_VERSION_REQUIRE(major,minor,bugfix) \
+ ( GR2_VERSION_MAJOR * 10000 + GR2_VERSION_MINOR \
+ * 100 + GR2_VERSION_BUGFIX >= \
+ (major) * 10000 + (minor) * 100 + (bugfix) )
+ ], [
-+ #if !GR2_VERSION_REQUIRE(1,2,4)
++ #if !GR2_VERSION_REQUIRE(1,3,8)
+ #error "Insufficient graphite2 version."
+ #endif
+ ], [],
+ [AC_MSG_ERROR([--with-system-graphite2 requested but no working libgraphite2 found])])
++ CFLAGS=$_SAVE_CFLAGS
+fi
+
-+AC_SUBST(MOZ_NATIVE_GRAPHITE2)
-+
+dnl ========================================================
dnl Check for pixman and cairo
dnl ========================================================
diff --git a/mail/thunderbird/patches/patch-mozilla_storage_SQLiteMutex.h b/mail/thunderbird/patches/patch-mozilla_storage_SQLiteMutex.h
deleted file mode 100644
index ac15b742ae8..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_storage_SQLiteMutex.h
+++ /dev/null
@@ -1,24 +0,0 @@
-$NetBSD: patch-mozilla_storage_SQLiteMutex.h,v 1.1 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/storage/SQLiteMutex.h.orig 2016-04-07 21:33:16.000000000 +0000
-+++ mozilla/storage/SQLiteMutex.h
-@@ -107,15 +107,19 @@ public:
- void assertCurrentThreadOwns()
- {
- NS_ASSERTION(mMutex, "No mutex associated with this wrapper!");
-+#if 0
- NS_ASSERTION(sqlite3_mutex_held(mMutex),
- "Mutex is not held, but we expect it to be!");
-+#endif
- }
-
- void assertNotCurrentThreadOwns()
- {
- NS_ASSERTION(mMutex, "No mutex associated with this wrapper!");
-+#if 0
- NS_ASSERTION(sqlite3_mutex_notheld(mMutex),
- "Mutex is held, but we expect it to not be!");
-+#endif
- }
- #endif // ifndef DEBUG
-
diff --git a/mail/thunderbird/patches/patch-mozilla_toolkit_components_osfile_modules_osfile__unix__back.jsm b/mail/thunderbird/patches/patch-mozilla_toolkit_components_osfile_modules_osfile__unix__back.jsm
new file mode 100644
index 00000000000..b5bbb55051f
--- /dev/null
+++ b/mail/thunderbird/patches/patch-mozilla_toolkit_components_osfile_modules_osfile__unix__back.jsm
@@ -0,0 +1,15 @@
+$NetBSD: patch-mozilla_toolkit_components_osfile_modules_osfile__unix__back.jsm,v 1.3 2017/04/27 13:32:41 ryoon Exp $
+
+--- mozilla/toolkit/components/osfile/modules/osfile_unix_back.jsm.orig 2017-04-14 04:53:29.000000000 +0000
++++ mozilla/toolkit/components/osfile/modules/osfile_unix_back.jsm
+@@ -228,8 +228,8 @@
+ let statvfs = new SharedAll.HollowStructure("statvfs",
+ Const.OSFILE_SIZEOF_STATVFS);
+
+- statvfs.add_field_at(Const.OSFILE_OFFSETOF_STATVFS_F_BSIZE,
+- "f_bsize", Type.unsigned_long.implementation);
++ statvfs.add_field_at(Const.OSFILE_OFFSETOF_STATVFS_F_FRSIZE,
++ "f_frsize", Type.unsigned_long.implementation);
+ statvfs.add_field_at(Const.OSFILE_OFFSETOF_STATVFS_F_BAVAIL,
+ "f_bavail", Type.fsblkcnt_t.implementation);
+
diff --git a/mail/thunderbird/patches/patch-mozilla_toolkit_components_osfile_modules_osfile__unix__front.jsm b/mail/thunderbird/patches/patch-mozilla_toolkit_components_osfile_modules_osfile__unix__front.jsm
new file mode 100644
index 00000000000..4dc58ebbf6e
--- /dev/null
+++ b/mail/thunderbird/patches/patch-mozilla_toolkit_components_osfile_modules_osfile__unix__front.jsm
@@ -0,0 +1,13 @@
+$NetBSD: patch-mozilla_toolkit_components_osfile_modules_osfile__unix__front.jsm,v 1.4 2017/04/27 13:32:41 ryoon Exp $
+
+--- mozilla/toolkit/components/osfile/modules/osfile_unix_front.jsm.orig 2017-04-14 04:53:28.000000000 +0000
++++ mozilla/toolkit/components/osfile/modules/osfile_unix_front.jsm
+@@ -399,7 +399,7 @@
+ throw_on_negative("statvfs", (UnixFile.statvfs || UnixFile.statfs)(sourcePath, fileSystemInfoPtr));
+
+ let bytes = new Type.uint64_t.implementation(
+- fileSystemInfo.f_bsize * fileSystemInfo.f_bavail);
++ fileSystemInfo.f_frsize * fileSystemInfo.f_bavail);
+
+ return bytes.value;
+ };
diff --git a/mail/thunderbird/patches/patch-mozilla_toolkit_components_protobuf_src_google_protobuf_stubs_atomicops.h b/mail/thunderbird/patches/patch-mozilla_toolkit_components_protobuf_src_google_protobuf_stubs_atomicops.h
index 4cf21e221ae..8c146823c98 100644
--- a/mail/thunderbird/patches/patch-mozilla_toolkit_components_protobuf_src_google_protobuf_stubs_atomicops.h
+++ b/mail/thunderbird/patches/patch-mozilla_toolkit_components_protobuf_src_google_protobuf_stubs_atomicops.h
@@ -1,8 +1,8 @@
-$NetBSD: patch-mozilla_toolkit_components_protobuf_src_google_protobuf_stubs_atomicops.h,v 1.1 2016/04/17 18:33:50 ryoon Exp $
+$NetBSD: patch-mozilla_toolkit_components_protobuf_src_google_protobuf_stubs_atomicops.h,v 1.2 2017/04/27 13:32:41 ryoon Exp $
---- mozilla/toolkit/components/protobuf/src/google/protobuf/stubs/atomicops.h.orig 2016-04-07 21:33:32.000000000 +0000
+--- mozilla/toolkit/components/protobuf/src/google/protobuf/stubs/atomicops.h.orig 2017-04-14 04:53:29.000000000 +0000
+++ mozilla/toolkit/components/protobuf/src/google/protobuf/stubs/atomicops.h
-@@ -76,9 +76,15 @@ typedef intptr_t Atomic64;
+@@ -76,6 +76,11 @@ typedef intptr_t Atomic64;
#endif
#endif
@@ -13,7 +13,11 @@ $NetBSD: patch-mozilla_toolkit_components_protobuf_src_google_protobuf_stubs_ato
+#else
// Use AtomicWord for a machine-sized pointer. It will use the Atomic32 or
// Atomic64 routines below, depending on your architecture.
+ #if defined(__OpenBSD__) && !defined(GOOGLE_PROTOBUF_ARCH_64_BIT)
+@@ -83,6 +88,7 @@ typedef Atomic32 AtomicWord;
+ #else
typedef intptr_t AtomicWord;
+ #endif
+#endif
// Atomically execute:
diff --git a/mail/thunderbird/patches/patch-mozilla_toolkit_components_terminator_nsTerminator.cpp b/mail/thunderbird/patches/patch-mozilla_toolkit_components_terminator_nsTerminator.cpp
new file mode 100644
index 00000000000..49dd5fdceb6
--- /dev/null
+++ b/mail/thunderbird/patches/patch-mozilla_toolkit_components_terminator_nsTerminator.cpp
@@ -0,0 +1,25 @@
+$NetBSD: patch-mozilla_toolkit_components_terminator_nsTerminator.cpp,v 1.1 2017/04/27 13:32:41 ryoon Exp $
+
+--- mozilla/toolkit/components/terminator/nsTerminator.cpp.orig 2017-04-14 04:53:28.000000000 +0000
++++ mozilla/toolkit/components/terminator/nsTerminator.cpp
+@@ -36,7 +36,7 @@
+ #if defined(XP_WIN)
+ #include <windows.h>
+ #else
+-#include <unistd.h>
++#include <time.h>
+ #endif
+
+ #include "mozilla/ArrayUtils.h"
+@@ -147,7 +147,10 @@ RunWatchdog(void* arg)
+ #if defined(XP_WIN)
+ Sleep(1000 /* ms */);
+ #else
+- usleep(1000000 /* usec */);
++ struct timespec tickd;
++ tickd.tv_sec = 1;
++ tickd.tv_nsec = 0;
++ nanosleep(&tickd, NULL);
+ #endif
+
+ if (gHeartbeat++ < timeToLive) {
diff --git a/mail/thunderbird/patches/patch-mozilla_toolkit_library_moz.build b/mail/thunderbird/patches/patch-mozilla_toolkit_library_moz.build
index 141128dc091..e8fed79c191 100644
--- a/mail/thunderbird/patches/patch-mozilla_toolkit_library_moz.build
+++ b/mail/thunderbird/patches/patch-mozilla_toolkit_library_moz.build
@@ -1,69 +1,54 @@
-$NetBSD: patch-mozilla_toolkit_library_moz.build,v 1.2 2016/04/17 18:33:50 ryoon Exp $
+$NetBSD: patch-mozilla_toolkit_library_moz.build,v 1.3 2017/04/27 13:32:41 ryoon Exp $
---- mozilla/toolkit/library/moz.build.orig 2016-04-07 21:33:33.000000000 +0000
+--- mozilla/toolkit/library/moz.build.orig 2017-04-14 04:53:29.000000000 +0000
+++ mozilla/toolkit/library/moz.build
-@@ -211,6 +211,7 @@ if CONFIG['OS_ARCH'] == 'Linux' and CONF
+@@ -215,6 +215,7 @@ if CONFIG['OS_ARCH'] == 'Linux' and CONF
]
OS_LIBS += CONFIG['MOZ_CAIRO_OSLIBS']
+OS_LIBS += CONFIG['MOZ_LIBV4L2_LIBS']
OS_LIBS += CONFIG['MOZ_WEBRTC_X11_LIBS']
- if CONFIG['MOZ_NATIVE_JPEG']:
-@@ -222,6 +223,30 @@ if CONFIG['MOZ_NATIVE_PNG']:
- if CONFIG['MOZ_NATIVE_HUNSPELL']:
+ if CONFIG['SERVO_TARGET_DIR']:
+@@ -229,9 +230,30 @@ if CONFIG['MOZ_SYSTEM_JPEG']:
+ if CONFIG['MOZ_SYSTEM_PNG']:
+ OS_LIBS += CONFIG['MOZ_PNG_LIBS']
+
++if CONFIG['MOZ_SYSTEM_GRAPHITE2']:
++ OS_LIBS += CONFIG['MOZ_GRAPHITE2_LIBS']
++
++if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
++ OS_LIBS += CONFIG['MOZ_HARFBUZZ_LIBS']
++
+ if CONFIG['MOZ_SYSTEM_HUNSPELL']:
OS_LIBS += CONFIG['MOZ_HUNSPELL_LIBS']
-+if CONFIG['MOZ_NATIVE_OGG']:
++if CONFIG['MOZ_SYSTEM_OGG']:
+ OS_LIBS += CONFIG['MOZ_OGG_LIBS']
+
-+if CONFIG['MOZ_NATIVE_THEORA']:
++if CONFIG['MOZ_SYSTEM_THEORA']:
+ OS_LIBS += CONFIG['MOZ_THEORA_LIBS']
+
-+if CONFIG['MOZ_NATIVE_VORBIS']:
++if CONFIG['MOZ_SYSTEM_VORBIS']:
+ OS_LIBS += CONFIG['MOZ_VORBIS_LIBS']
+
-+if CONFIG['MOZ_NATIVE_TREMOR']:
++if CONFIG['MOZ_SYSTEM_TREMOR']:
+ OS_LIBS += CONFIG['MOZ_TREMOR_LIBS']
+
-+if CONFIG['MOZ_NATIVE_CELT']:
-+ OS_LIBS += CONFIG['MOZ_CELT_LIBS']
-+
-+if CONFIG['MOZ_NATIVE_OPUS']:
-+ OS_LIBS += CONFIG['MOZ_OPUS_LIBS']
-+
-+if CONFIG['MOZ_NATIVE_SPEEX']:
-+ OS_LIBS += CONFIG['MOZ_SPEEX_LIBS']
-+
-+if CONFIG['MOZ_NATIVE_SOUNDTOUCH']:
++if CONFIG['MOZ_SYSTEM_SOUNDTOUCH']:
+ OS_LIBS += CONFIG['MOZ_SOUNDTOUCH_LIBS']
+
- if CONFIG['MOZ_NATIVE_LIBEVENT']:
+ if CONFIG['MOZ_SYSTEM_LIBEVENT']:
OS_LIBS += CONFIG['MOZ_LIBEVENT_LIBS']
-@@ -231,8 +256,14 @@ if CONFIG['MOZ_NATIVE_LIBVPX']:
+@@ -241,8 +263,8 @@ if CONFIG['MOZ_SYSTEM_LIBVPX']:
if not CONFIG['MOZ_TREE_PIXMAN']:
OS_LIBS += CONFIG['MOZ_PIXMAN_LIBS']
-if CONFIG['MOZ_ALSA']:
- OS_LIBS += CONFIG['MOZ_ALSA_LIBS']
-+if CONFIG['MOZ_NATIVE_GRAPHITE2']:
-+ OS_LIBS += CONFIG['MOZ_GRAPHITE2_LIBS']
-+
-+if CONFIG['MOZ_NATIVE_HARFBUZZ']:
-+ OS_LIBS += CONFIG['MOZ_HARFBUZZ_LIBS']
-+
+if CONFIG['MOZ_OSS']:
+ OS_LIBS += CONFIG['MOZ_OSS_LIBS']
if CONFIG['HAVE_CLOCK_MONOTONIC']:
OS_LIBS += CONFIG['REALTIME_LIBS']
-@@ -368,7 +399,7 @@ if CONFIG['OS_ARCH'] == 'WINNT':
- if CONFIG['MOZ_ENABLE_QT']:
- OS_LIBS += CONFIG['XEXT_LIBS']
-
--if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa' and CONFIG['MOZ_GSTREAMER']:
-+if CONFIG['OS_ARCH'] == 'Darwin' and CONFIG['MOZ_GSTREAMER']:
- OS_LIBS += CONFIG['GSTREAMER_LIBS']
-
- if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
diff --git a/mail/thunderbird/patches/patch-mozilla_toolkit_modules_GMPUtils.jsm b/mail/thunderbird/patches/patch-mozilla_toolkit_modules_GMPUtils.jsm
new file mode 100644
index 00000000000..a7fc26a1325
--- /dev/null
+++ b/mail/thunderbird/patches/patch-mozilla_toolkit_modules_GMPUtils.jsm
@@ -0,0 +1,12 @@
+$NetBSD: patch-mozilla_toolkit_modules_GMPUtils.jsm,v 1.3 2017/04/27 13:32:41 ryoon Exp $
+
+--- mozilla/toolkit/modules/GMPUtils.jsm.orig 2017-04-14 04:53:29.000000000 +0000
++++ mozilla/toolkit/modules/GMPUtils.jsm
+@@ -80,6 +80,7 @@ this.GMPUtils = {
+ // Mac OSX, and Linux.
+ return AppConstants.isPlatformAndVersionAtLeast("win", "6") ||
+ AppConstants.platform == "macosx" ||
++ AppConstants.platform == "netbsd" ||
+ AppConstants.platform == "linux";
+ }
+
diff --git a/mail/thunderbird/patches/patch-mozilla_toolkit_moz.configure b/mail/thunderbird/patches/patch-mozilla_toolkit_moz.configure
new file mode 100644
index 00000000000..02b4c8b1a61
--- /dev/null
+++ b/mail/thunderbird/patches/patch-mozilla_toolkit_moz.configure
@@ -0,0 +1,31 @@
+$NetBSD: patch-mozilla_toolkit_moz.configure,v 1.1 2017/04/27 13:32:41 ryoon Exp $
+
+--- mozilla/toolkit/moz.configure.orig 2017-04-14 04:53:29.000000000 +0000
++++ mozilla/toolkit/moz.configure
+@@ -338,6 +338,26 @@ add_old_configure_assignment('FT2_LIBS',
+ add_old_configure_assignment('FT2_CFLAGS',
+ delayed_getattr(ft2_info, 'cflags'))
+
++# Graphite2
++# ==============================================================
++option('--with-system-graphite2',
++ help="Use system graphite2 (located with pkgconfig)")
++
++system_graphite2 = pkg_check_modules('MOZ_GRAPHITE2', 'graphite2',
++ when='--with-system-graphite2')
++
++set_config('MOZ_SYSTEM_GRAPHITE2', depends_if(system_graphite2)(lambda _: True))
++
++# HarfBuzz
++# ==============================================================
++option('--with-system-harfbuzz',
++ help="Use system harfbuzz (located with pkgconfig)")
++
++system_harfbuzz = pkg_check_modules('MOZ_HARFBUZZ', 'harfbuzz >= 1.4.1',
++ when='--with-system-harfbuzz')
++
++set_config('MOZ_SYSTEM_HARFBUZZ', depends_if(system_harfbuzz)(lambda _: True))
++
+ # Apple platform decoder support
+ # ==============================================================
+ @depends(toolkit)
diff --git a/mail/thunderbird/patches/patch-mozilla_toolkit_mozapps_extensions_test_browser_browser__gmpProvider.js b/mail/thunderbird/patches/patch-mozilla_toolkit_mozapps_extensions_test_browser_browser__gmpProvider.js
new file mode 100644
index 00000000000..90f2d349998
--- /dev/null
+++ b/mail/thunderbird/patches/patch-mozilla_toolkit_mozapps_extensions_test_browser_browser__gmpProvider.js
@@ -0,0 +1,12 @@
+$NetBSD: patch-mozilla_toolkit_mozapps_extensions_test_browser_browser__gmpProvider.js,v 1.1 2017/04/27 13:32:41 ryoon Exp $
+
+--- mozilla/toolkit/mozapps/extensions/test/browser/browser_gmpProvider.js.orig 2017-04-14 04:53:29.000000000 +0000
++++ mozilla/toolkit/mozapps/extensions/test/browser/browser_gmpProvider.js
+@@ -393,6 +393,7 @@ add_task(function* testEmeSupport() {
+ } else if (addon.id == GMPScope.WIDEVINE_ID) {
+ if (AppConstants.isPlatformAndVersionAtLeast("win", "6") ||
+ AppConstants.platform == "macosx" ||
++ AppConstants.platform == "netbsd" ||
+ AppConstants.platform == "linux") {
+ Assert.ok(item, "Widevine supported, found add-on element.");
+ } else {
diff --git a/mail/thunderbird/patches/patch-mozilla_toolkit_mozapps_installer_packager.mk b/mail/thunderbird/patches/patch-mozilla_toolkit_mozapps_installer_packager.mk
index 81b4c822cac..de7c212bf03 100644
--- a/mail/thunderbird/patches/patch-mozilla_toolkit_mozapps_installer_packager.mk
+++ b/mail/thunderbird/patches/patch-mozilla_toolkit_mozapps_installer_packager.mk
@@ -1,12 +1,14 @@
-$NetBSD: patch-mozilla_toolkit_mozapps_installer_packager.mk,v 1.1 2016/04/17 18:33:50 ryoon Exp $
+$NetBSD: patch-mozilla_toolkit_mozapps_installer_packager.mk,v 1.2 2017/04/27 13:32:41 ryoon Exp $
---- mozilla/toolkit/mozapps/installer/packager.mk.orig 2016-04-07 21:33:34.000000000 +0000
+--- mozilla/toolkit/mozapps/installer/packager.mk.orig 2017-04-14 04:53:30.000000000 +0000
+++ mozilla/toolkit/mozapps/installer/packager.mk
-@@ -133,7 +133,7 @@ endif
+@@ -139,8 +139,8 @@ endif
+ (cd $(DESTDIR)$(installdir) && tar -xf -)
$(NSINSTALL) -D $(DESTDIR)$(bindir)
$(RM) -f $(DESTDIR)$(bindir)/$(MOZ_APP_NAME)
- ln -s $(installdir)/$(MOZ_APP_NAME) $(DESTDIR)$(bindir)
+- ln -s $(installdir)/$(MOZ_APP_NAME) $(DESTDIR)$(bindir)
-ifdef INSTALL_SDK # Here comes the hard part
++ ln -s $(installdir)/$(MOZ_APP_NAME) $(DESTDIR)$(bindir)/${MOZILLA_PKG_NAME}
+ifeq ($(MOZ_APP_NAME),xulrunner)
$(NSINSTALL) -D $(DESTDIR)$(includedir)
(cd $(DIST)/include && $(TAR) $(TAR_CREATE_FLAGS) - .) | \
diff --git a/mail/thunderbird/patches/patch-mozilla_toolkit_xre_nsAppRunner.cpp b/mail/thunderbird/patches/patch-mozilla_toolkit_xre_nsAppRunner.cpp
deleted file mode 100644
index 94889cd4356..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_toolkit_xre_nsAppRunner.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-$NetBSD: patch-mozilla_toolkit_xre_nsAppRunner.cpp,v 1.2 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/toolkit/xre/nsAppRunner.cpp.orig 2016-04-07 21:33:34.000000000 +0000
-+++ mozilla/toolkit/xre/nsAppRunner.cpp
-@@ -1893,6 +1893,18 @@ static nsresult LaunchChild(nsINativeApp
- if (NS_FAILED(rv))
- return rv;
-
-+#if defined(XP_DARWIN)
-+ pid_t pid = vfork();
-+ if (pid == 0) { // child
-+ if (execv(exePath.get(), gRestartArgv) == -1) {
-+ _exit(1);
-+ }
-+ }
-+ else if (pid == -1) {
-+ return NS_ERROR_FAILURE;
-+ }
-+#else
-+
- #if defined(XP_UNIX)
- if (execv(exePath.get(), gRestartArgv) == -1)
- return NS_ERROR_FAILURE;
-@@ -1906,6 +1918,7 @@ static nsresult LaunchChild(nsINativeApp
- if (failed || exitCode)
- return NS_ERROR_FAILURE;
- #endif // XP_UNIX
-+#endif // XP_DARWIN
- #endif // WP_WIN
- #endif // WP_MACOSX
- #endif // MOZ_WIDGET_ANDROID
diff --git a/mail/thunderbird/patches/patch-mozilla_webapprt_moz.build b/mail/thunderbird/patches/patch-mozilla_webapprt_moz.build
deleted file mode 100644
index b181bf90c41..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_webapprt_moz.build
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-mozilla_webapprt_moz.build,v 1.3 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/webapprt/moz.build.orig 2016-04-07 21:33:35.000000000 +0000
-+++ mozilla/webapprt/moz.build
-@@ -9,7 +9,7 @@ with Files('**'):
-
- if CONFIG['OS_ARCH'] == 'WINNT':
- DIRS += ['win']
--elif CONFIG['OS_ARCH'] == 'Darwin':
-+elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
- DIRS += ['mac']
- elif CONFIG['MOZ_ENABLE_GTK']:
- DIRS += ['gtk']
diff --git a/mail/thunderbird/patches/patch-mozilla_xpcom_build_PoisonIOInterposer.h b/mail/thunderbird/patches/patch-mozilla_xpcom_build_PoisonIOInterposer.h
deleted file mode 100644
index d521f95aa07..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_xpcom_build_PoisonIOInterposer.h
+++ /dev/null
@@ -1,55 +0,0 @@
-$NetBSD: patch-mozilla_xpcom_build_PoisonIOInterposer.h,v 1.3 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/xpcom/build/PoisonIOInterposer.h.orig 2016-04-07 21:33:35.000000000 +0000
-+++ mozilla/xpcom/build/PoisonIOInterposer.h
-@@ -36,7 +36,7 @@ void MozillaUnRegisterDebugFILE(FILE* aF
-
- MOZ_END_EXTERN_C
-
--#if defined(XP_WIN) || defined(XP_MACOSX)
-+#if defined(XP_WIN) || defined(XP_DARWIN)
-
- #ifdef __cplusplus
- namespace mozilla {
-@@ -54,7 +54,7 @@ bool IsDebugFile(intptr_t aFileID);
- */
- void InitPoisonIOInterposer();
-
--#ifdef XP_MACOSX
-+#ifdef XP_DARWIN
- /**
- * Check that writes are dirty before reporting I/O (Mac OS X only)
- * This is necessary for late-write checks on Mac OS X, but reading the buffer
-@@ -62,7 +62,7 @@ void InitPoisonIOInterposer();
- * to do this for everything else that uses
- */
- void OnlyReportDirtyWrites();
--#endif /* XP_MACOSX */
-+#endif /* XP_DARWIN */
-
- /**
- * Clear IO poisoning, this is only safe to do on the main-thread when no other
-@@ -73,19 +73,19 @@ void ClearPoisonIOInterposer();
- } // namespace mozilla
- #endif /* __cplusplus */
-
--#else /* XP_WIN || XP_MACOSX */
-+#else /* XP_WIN || XP_DARWIN */
-
- #ifdef __cplusplus
- namespace mozilla {
- inline bool IsDebugFile(intptr_t aFileID) { return true; }
- inline void InitPoisonIOInterposer() {}
- inline void ClearPoisonIOInterposer() {}
--#ifdef XP_MACOSX
-+#ifdef XP_DARWIN
- inline void OnlyReportDirtyWrites() {}
--#endif /* XP_MACOSX */
-+#endif /* XP_DARWIN */
- } // namespace mozilla
- #endif /* __cplusplus */
-
--#endif /* XP_WIN || XP_MACOSX */
-+#endif /* XP_WIN || XP_DARWIN */
-
- #endif // mozilla_PoisonIOInterposer_h
diff --git a/mail/thunderbird/patches/patch-mozilla_xpcom_build_XPCOMInit.cpp b/mail/thunderbird/patches/patch-mozilla_xpcom_build_XPCOMInit.cpp
new file mode 100644
index 00000000000..153da4a9b62
--- /dev/null
+++ b/mail/thunderbird/patches/patch-mozilla_xpcom_build_XPCOMInit.cpp
@@ -0,0 +1,28 @@
+$NetBSD: patch-mozilla_xpcom_build_XPCOMInit.cpp,v 1.3 2017/04/27 13:32:41 ryoon Exp $
+
+--- mozilla/xpcom/build/XPCOMInit.cpp.orig 2017-04-14 04:53:30.000000000 +0000
++++ mozilla/xpcom/build/XPCOMInit.cpp
+@@ -154,7 +154,9 @@ extern nsresult nsStringInputStreamConst
+
+ #include "mozilla/ipc/GeckoChildProcessHost.h"
+
++#ifndef MOZ_OGG_NO_MEM_REPORTING
+ #include "ogg/ogg.h"
++#endif
+ #if defined(MOZ_VPX) && !defined(MOZ_VPX_NO_MEM_REPORTING)
+ #if defined(HAVE_STDINT_H)
+ // mozilla-config.h defines HAVE_STDINT_H, and then it's defined *again* in
+@@ -675,11 +677,13 @@ NS_InitXPCOM2(nsIServiceManager** aResul
+ // this oddness.
+ mozilla::SetICUMemoryFunctions();
+
++#ifndef MOZ_OGG_NO_MEM_REPORTING
+ // Do the same for libogg.
+ ogg_set_mem_functions(OggReporter::CountingMalloc,
+ OggReporter::CountingCalloc,
+ OggReporter::CountingRealloc,
+ OggReporter::CountingFree);
++#endif
+
+ #if defined(MOZ_VPX) && !defined(MOZ_VPX_NO_MEM_REPORTING)
+ // And for VPX.
diff --git a/mail/thunderbird/patches/patch-mozilla_xpcom_components_Module.h b/mail/thunderbird/patches/patch-mozilla_xpcom_components_Module.h
deleted file mode 100644
index 718bc6468c8..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_xpcom_components_Module.h
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-mozilla_xpcom_components_Module.h,v 1.2 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/xpcom/components/Module.h.orig 2016-04-07 21:33:35.000000000 +0000
-+++ mozilla/xpcom/components/Module.h
-@@ -125,7 +125,7 @@ struct Module
- # define NSMODULE_SECTION __declspec(allocate(".kPStaticModules$M"), dllexport)
- # elif defined(__GNUC__)
- # if defined(__ELF__)
--# define NSMODULE_SECTION __attribute__((section(".kPStaticModules"), visibility("protected")))
-+# define NSMODULE_SECTION __attribute__((section(".kPStaticModules"), visibility("default")))
- # elif defined(__MACH__)
- # define NSMODULE_SECTION __attribute__((section("__DATA, .kPStaticModules"), visibility("default")))
- # elif defined (_WIN32)
diff --git a/mail/thunderbird/patches/patch-mozilla_xpcom_reflect_xptcall_md_unix_moz.build b/mail/thunderbird/patches/patch-mozilla_xpcom_reflect_xptcall_md_unix_moz.build
deleted file mode 100644
index a177ec6962b..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_xpcom_reflect_xptcall_md_unix_moz.build
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD: patch-mozilla_xpcom_reflect_xptcall_md_unix_moz.build,v 1.2 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/xpcom/reflect/xptcall/md/unix/moz.build.orig 2016-04-07 21:33:35.000000000 +0000
-+++ mozilla/xpcom/reflect/xptcall/md/unix/moz.build
-@@ -9,7 +9,7 @@ if CONFIG['OS_ARCH'] == 'Darwin':
- 'xptcinvoke_darwin.cpp',
- 'xptcstubs_darwin.cpp',
- ]
-- if CONFIG['OS_TEST'] == 'powerpc':
-+ if CONFIG['OS_TEST'] == 'ppc':
- SOURCES += [
- '!xptcstubs_asm_ppc_darwin.s',
- 'xptcinvoke_asm_ppc_rhapsody.s',
-@@ -24,7 +24,7 @@ if CONFIG['OS_ARCH'] == 'GNU':
- 'xptcstubs_gcc_x86_unix.cpp'
- ]
-
--if CONFIG['OS_ARCH'] in ('Linux', 'FreeBSD', 'NetBSD', 'OpenBSD') or \
-+if CONFIG['OS_ARCH'] in ('Linux', 'FreeBSD', 'NetBSD', 'OpenBSD', 'DragonFly') or \
- CONFIG['OS_ARCH'].startswith('GNU_'):
- if CONFIG['OS_TEST'] == 'x86_64':
- SOURCES += [
diff --git a/mail/thunderbird/patches/patch-mozilla_xpcom_reflect_xptcall_md_unix_xptcinvoke__gcc__x86__unix.cpp b/mail/thunderbird/patches/patch-mozilla_xpcom_reflect_xptcall_md_unix_xptcinvoke__gcc__x86__unix.cpp
deleted file mode 100644
index 3e84374e7a4..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_xpcom_reflect_xptcall_md_unix_xptcinvoke__gcc__x86__unix.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-mozilla_xpcom_reflect_xptcall_md_unix_xptcinvoke__gcc__x86__unix.cpp,v 1.2 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/xpcom/reflect/xptcall/md/unix/xptcinvoke_gcc_x86_unix.cpp.orig 2016-04-07 21:33:35.000000000 +0000
-+++ mozilla/xpcom/reflect/xptcall/md/unix/xptcinvoke_gcc_x86_unix.cpp
-@@ -9,7 +9,7 @@
- #include "xptc_gcc_x86_unix.h"
-
- extern "C" {
--static void ATTRIBUTE_USED __attribute__ ((regparm(3)))
-+void ATTRIBUTE_USED __attribute__ ((regparm(3)))
- invoke_copy_to_stack(uint32_t paramCount, nsXPTCVariant* s, uint32_t* d)
- {
- for(uint32_t i = paramCount; i >0; i--, d++, s++)
diff --git a/mail/thunderbird/patches/patch-mozilla_xpcom_reflect_xptcall_md_unix_xptcstubs__gcc__x86__unix.cpp b/mail/thunderbird/patches/patch-mozilla_xpcom_reflect_xptcall_md_unix_xptcstubs__gcc__x86__unix.cpp
deleted file mode 100644
index 88c469d1846..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_xpcom_reflect_xptcall_md_unix_xptcstubs__gcc__x86__unix.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-mozilla_xpcom_reflect_xptcall_md_unix_xptcstubs__gcc__x86__unix.cpp,v 1.2 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/xpcom/reflect/xptcall/md/unix/xptcstubs_gcc_x86_unix.cpp.orig 2016-04-07 21:33:35.000000000 +0000
-+++ mozilla/xpcom/reflect/xptcall/md/unix/xptcstubs_gcc_x86_unix.cpp
-@@ -10,7 +10,7 @@
- #include "xptc_gcc_x86_unix.h"
-
- extern "C" {
--static nsresult ATTRIBUTE_USED
-+nsresult ATTRIBUTE_USED
- __attribute__ ((regparm (3)))
- PrepareAndDispatch(uint32_t methodIndex, nsXPTCStubBase* self, uint32_t* args)
- {
diff --git a/mail/thunderbird/patches/patch-mozilla_xulrunner_installer_Makefile.in b/mail/thunderbird/patches/patch-mozilla_xulrunner_installer_Makefile.in
deleted file mode 100644
index f4601fb6076..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_xulrunner_installer_Makefile.in
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-mozilla_xulrunner_installer_Makefile.in,v 1.2 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/xulrunner/installer/Makefile.in.orig 2016-04-07 21:33:35.000000000 +0000
-+++ mozilla/xulrunner/installer/Makefile.in
-@@ -88,7 +88,7 @@ endif
-
- install:: $(pkg_config_files)
- @echo pkg_config_file: $(pkg_config_files)
-- $(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(libdir)/pkgconfig
-+ $(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)${PREFIX}/lib/${MOZILLA_PKG_NAME}/pkgconfig
-
- GARBAGE += $(pkg_config_files)
-
diff --git a/mail/thunderbird/patches/patch-mozilla_xulrunner_installer_libxul-embedding.pc.in b/mail/thunderbird/patches/patch-mozilla_xulrunner_installer_libxul-embedding.pc.in
deleted file mode 100644
index 09d67ef18b9..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_xulrunner_installer_libxul-embedding.pc.in
+++ /dev/null
@@ -1,12 +0,0 @@
-$NetBSD: patch-mozilla_xulrunner_installer_libxul-embedding.pc.in,v 1.1 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/xulrunner/installer/libxul-embedding.pc.in.orig 2016-04-07 21:33:35.000000000 +0000
-+++ mozilla/xulrunner/installer/libxul-embedding.pc.in
-@@ -6,5 +6,6 @@ idldir=%idldir%
- Name: libxul-embedding
- Description: Static library for version-independent embedding of the Mozilla runtime
- Version: %MOZILLA_VERSION%
--Libs: -L${sdkdir}/lib -lxpcomglue -ldl
-+# XXXtnn -ldl removed
-+Libs: -Wl,-R${prefix}/lib/xulrunner -Wl,-R${prefix}/lib/xulrunner -Wl,-R${prefix}/lib/xulrunner -Wl,-R${prefix}/lib/xulrunner -L${prefix}/lib/xulrunner -lxpcomglue
- Cflags: -DXPCOM_GLUE -I${includedir} %WCHAR_CFLAGS%
diff --git a/mail/thunderbird/patches/patch-mozilla_xulrunner_installer_libxul.pc.in b/mail/thunderbird/patches/patch-mozilla_xulrunner_installer_libxul.pc.in
deleted file mode 100644
index 5a35ea4c2d5..00000000000
--- a/mail/thunderbird/patches/patch-mozilla_xulrunner_installer_libxul.pc.in
+++ /dev/null
@@ -1,11 +0,0 @@
-$NetBSD: patch-mozilla_xulrunner_installer_libxul.pc.in,v 1.1 2016/04/17 18:33:50 ryoon Exp $
-
---- mozilla/xulrunner/installer/libxul.pc.in.orig 2016-04-07 21:33:35.000000000 +0000
-+++ mozilla/xulrunner/installer/libxul.pc.in
-@@ -7,5 +7,5 @@ Name: libxul
- Description: The Mozilla Runtime and Embedding Engine
- Version: %MOZILLA_VERSION%
- Requires: %NSPR_NAME% >= %NSPR_VERSION%
--Libs: -L${sdkdir}/lib %MOZ_XUL_LINK%
-+Libs: -Wl,-R${prefix}/lib/xulrunner -Wl,-R${prefix}/lib/xulrunner -Wl,-R${prefix}/lib/xulrunner -Wl,-R${prefix}/lib/xulrunner -L${prefix}/lib/xulrunner %MOZ_XUL_LINK%
- Cflags: -I${includedir} %WCHAR_CFLAGS%