summaryrefslogtreecommitdiff
path: root/www/seamonkey/patches
diff options
context:
space:
mode:
authorryoon <ryoon@pkgsrc.org>2017-08-18 23:55:07 +0000
committerryoon <ryoon@pkgsrc.org>2017-08-18 23:55:07 +0000
commitd33e4d2ec594072d47da5750adeb3e9cf6160d32 (patch)
tree73c522373654bd8ef83b8e95966ba10b7189998a /www/seamonkey/patches
parent4f8d5bb9819f6ba63d973f38cab27286ae53f94b (diff)
downloadpkgsrc-d33e4d2ec594072d47da5750adeb3e9cf6160d32.tar.gz
Update to 2.48
* Based on Gecko 51.0.2
Diffstat (limited to 'www/seamonkey/patches')
-rw-r--r--www/seamonkey/patches/patch-bf13
-rw-r--r--www/seamonkey/patches/patch-mozilla_browser_components_nsBrowserGlue.js15
-rw-r--r--www/seamonkey/patches/patch-mozilla_browser_installer_package-manifest.in15
-rw-r--r--www/seamonkey/patches/patch-mozilla_browser_themes_shared_icon-colors.inc.svg13
-rw-r--r--www/seamonkey/patches/patch-mozilla_build_autoconf_compiler-opts.m419
-rw-r--r--www/seamonkey/patches/patch-mozilla_build_autoconf_toolchain.m419
-rw-r--r--www/seamonkey/patches/patch-mozilla_build_moz.configure_init.configure37
-rw-r--r--www/seamonkey/patches/patch-mozilla_build_moz.configure_old.configure20
-rw-r--r--www/seamonkey/patches/patch-mozilla_build_moz.configure_toolchain.configure28
-rw-r--r--www/seamonkey/patches/patch-mozilla_build_pgo_profileserver.py13
-rw-r--r--www/seamonkey/patches/patch-mozilla_config_Makefile.in13
-rw-r--r--www/seamonkey/patches/patch-mozilla_config_external_moz.build29
-rw-r--r--www/seamonkey/patches/patch-mozilla_config_system-headers44
-rw-r--r--www/seamonkey/patches/patch-mozilla_dom_base_moz.build14
-rw-r--r--www/seamonkey/patches/patch-mozilla_dom_bindings_GenerateCSS2PropertiesWebIDL.py13
-rw-r--r--www/seamonkey/patches/patch-mozilla_dom_media_AudioStream.cpp38
-rw-r--r--www/seamonkey/patches/patch-mozilla_dom_media_AudioStream.h28
-rw-r--r--www/seamonkey/patches/patch-mozilla_dom_media_moz.build22
-rw-r--r--www/seamonkey/patches/patch-mozilla_dom_system_OSFileConstants.cpp13
-rw-r--r--www/seamonkey/patches/patch-mozilla_gfx_graphite2_moz-gr-update.sh30
-rw-r--r--www/seamonkey/patches/patch-mozilla_gfx_moz.build26
-rw-r--r--www/seamonkey/patches/patch-mozilla_gfx_skia_generate__mozbuild.py14
-rw-r--r--www/seamonkey/patches/patch-mozilla_gfx_skia_moz.build14
-rw-r--r--www/seamonkey/patches/patch-mozilla_gfx_thebes_gfxFontUtils.cpp49
-rw-r--r--www/seamonkey/patches/patch-mozilla_gfx_thebes_moz.build19
-rw-r--r--www/seamonkey/patches/patch-mozilla_image_Downscaler.h33
-rw-r--r--www/seamonkey/patches/patch-mozilla_image_decoders_nsIconDecoder.cpp14
-rw-r--r--www/seamonkey/patches/patch-mozilla_image_decoders_nsJPEGDecoder.cpp21
-rw-r--r--www/seamonkey/patches/patch-mozilla_intl_lwbrk_nsJISx4051LineBreaker.cpp40
-rw-r--r--www/seamonkey/patches/patch-mozilla_intl_unicharutil_util_moz.build12
-rw-r--r--www/seamonkey/patches/patch-mozilla_ios8
-rw-r--r--www/seamonkey/patches/patch-mozilla_js_src_jsdate.cpp15
-rw-r--r--www/seamonkey/patches/patch-mozilla_js_src_jskwgen.cpp13
-rw-r--r--www/seamonkey/patches/patch-mozilla_js_src_moz.build15
-rw-r--r--www/seamonkey/patches/patch-mozilla_js_src_old-configure.in33
-rw-r--r--www/seamonkey/patches/patch-mozilla_js_xpconnect_src_xpcprivate.h8
-rw-r--r--www/seamonkey/patches/patch-mozilla_layout_style_GenerateCSSPropsGenerated.py13
-rw-r--r--www/seamonkey/patches/patch-mozilla_media_libcubeb_src_cubeb__alsa.c260
-rw-r--r--www/seamonkey/patches/patch-mozilla_media_libcubeb_src_cubeb__oss.c54
-rw-r--r--www/seamonkey/patches/patch-mozilla_media_libcubeb_src_moz.build22
-rw-r--r--www/seamonkey/patches/patch-mozilla_media_libcubeb_tests_moz.build12
-rw-r--r--www/seamonkey/patches/patch-mozilla_media_libcubeb_update.sh12
-rw-r--r--www/seamonkey/patches/patch-mozilla_media_libsoundtouch_src_soundtouch__perms.h14
-rw-r--r--www/seamonkey/patches/patch-mozilla_media_libyuv_include_libyuv_scale__row.h17
-rw-r--r--www/seamonkey/patches/patch-mozilla_media_libyuv_source_mjpeg__decoder.cc12
-rw-r--r--www/seamonkey/patches/patch-mozilla_media_webrtc_signaling_test_common.build12
-rw-r--r--www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_linux_device__info__linux.cc38
-rw-r--r--www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_linux_video__capture__linux.cc30
-rw-r--r--www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_video__capture.gypi34
-rw-r--r--www/seamonkey/patches/patch-mozilla_mfbt_Attributes.h22
-rw-r--r--www/seamonkey/patches/patch-mozilla_mobile_android_installer_Makefile.in15
-rw-r--r--www/seamonkey/patches/patch-mozilla_mobile_android_installer_package-manifest.in13
-rw-r--r--www/seamonkey/patches/patch-mozilla_modules_libmar_tests_moz.build29
-rw-r--r--www/seamonkey/patches/patch-mozilla_modules_woff2_src_store__bytes.h35
-rw-r--r--www/seamonkey/patches/patch-mozilla_modules_woff2_src_woff2__common.cc20
-rw-r--r--www/seamonkey/patches/patch-mozilla_moz.configure35
-rw-r--r--www/seamonkey/patches/patch-mozilla_netwerk_dns_moz.build14
-rw-r--r--www/seamonkey/patches/patch-mozilla_netwerk_protocol_http_Http2Session.cpp18
-rw-r--r--www/seamonkey/patches/patch-mozilla_old-configure.in276
-rw-r--r--www/seamonkey/patches/patch-mozilla_ostream8
-rw-r--r--www/seamonkey/patches/patch-mozilla_toolkit_components_osfile_modules_osfile__unix__back.jsm15
-rw-r--r--www/seamonkey/patches/patch-mozilla_toolkit_components_osfile_modules_osfile__unix__front.jsm13
-rw-r--r--www/seamonkey/patches/patch-mozilla_toolkit_library_moz.build25
-rw-r--r--www/seamonkey/patches/patch-mozilla_unwind.h9
-rw-r--r--www/seamonkey/patches/patch-mozilla_xpcom_build_XPCOMInit.cpp28
-rw-r--r--www/seamonkey/patches/patch-mozilla_xpcom_reflect_xptcall_md_unix_moz.build20
66 files changed, 1380 insertions, 515 deletions
diff --git a/www/seamonkey/patches/patch-bf b/www/seamonkey/patches/patch-bf
deleted file mode 100644
index c9238828ff9..00000000000
--- a/www/seamonkey/patches/patch-bf
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-bf,v 1.13 2013/09/28 14:37:05 ryoon Exp $
-
---- mozilla/js/src/jsnativestack.cpp.orig 2013-09-16 18:26:41.000000000 +0000
-+++ mozilla/js/src/jsnativestack.cpp
-@@ -114,7 +114,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/www/seamonkey/patches/patch-mozilla_browser_components_nsBrowserGlue.js b/www/seamonkey/patches/patch-mozilla_browser_components_nsBrowserGlue.js
new file mode 100644
index 00000000000..907fd3e05eb
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_browser_components_nsBrowserGlue.js
@@ -0,0 +1,15 @@
+$NetBSD: patch-mozilla_browser_components_nsBrowserGlue.js,v 1.1 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/browser/components/nsBrowserGlue.js.orig 2017-07-07 05:35:43.000000000 +0000
++++ mozilla/browser/components/nsBrowserGlue.js
+@@ -931,7 +931,9 @@ BrowserGlue.prototype = {
+ }
+ if (SCALING_PROBE_NAME) {
+ let scaling = aWindow.devicePixelRatio * 100;
+- Services.telemetry.getHistogramById(SCALING_PROBE_NAME).add(scaling);
++ try {
++ Services.telemetry.getHistogramById(SCALING_PROBE_NAME).add(scaling);
++ } catch (ex) {}
+ }
+ },
+
diff --git a/www/seamonkey/patches/patch-mozilla_browser_installer_package-manifest.in b/www/seamonkey/patches/patch-mozilla_browser_installer_package-manifest.in
index eabafd801ba..af491d37a8c 100644
--- a/www/seamonkey/patches/patch-mozilla_browser_installer_package-manifest.in
+++ b/www/seamonkey/patches/patch-mozilla_browser_installer_package-manifest.in
@@ -1,8 +1,8 @@
-$NetBSD: patch-mozilla_browser_installer_package-manifest.in,v 1.5 2015/12/03 12:22:27 ryoon Exp $
+$NetBSD: patch-mozilla_browser_installer_package-manifest.in,v 1.6 2017/08/18 23:55:07 ryoon Exp $
---- mozilla/browser/installer/package-manifest.in.orig 2015-11-04 01:56:07.000000000 +0000
+--- mozilla/browser/installer/package-manifest.in.orig 2017-07-07 05:35:46.000000000 +0000
+++ mozilla/browser/installer/package-manifest.in
-@@ -620,7 +620,7 @@
+@@ -582,7 +582,7 @@
@RESPATH@/components/MozKeyboard.js
@RESPATH@/components/InputMethod.manifest
@@ -11,12 +11,3 @@ $NetBSD: patch-mozilla_browser_installer_package-manifest.in,v 1.5 2015/12/03 12
@RESPATH@/components/TestInterfaceJS.js
@RESPATH@/components/TestInterfaceJS.manifest
@RESPATH@/components/TestInterfaceJSMaplike.js
-@@ -822,7 +822,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/www/seamonkey/patches/patch-mozilla_browser_themes_shared_icon-colors.inc.svg b/www/seamonkey/patches/patch-mozilla_browser_themes_shared_icon-colors.inc.svg
new file mode 100644
index 00000000000..e0c7a87b41f
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_browser_themes_shared_icon-colors.inc.svg
@@ -0,0 +1,13 @@
+$NetBSD: patch-mozilla_browser_themes_shared_icon-colors.inc.svg,v 1.1 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/browser/themes/shared/icon-colors.inc.svg.orig 2017-07-07 05:35:48.000000000 +0000
++++ mozilla/browser/themes/shared/icon-colors.inc.svg
+@@ -2,7 +2,7 @@
+
+ .fieldtext {
+ fill: -moz-fieldtext;
+-#ifdef XP_LINUX
++#ifdef MOZ_WIDGET_GTK
+ /* The fill-opacity needs to be sufficient for high-contrast settings, and
+ pathological Gtk themes where -moz-fieldtext provides low contrast by
+ default. */
diff --git a/www/seamonkey/patches/patch-mozilla_build_autoconf_compiler-opts.m4 b/www/seamonkey/patches/patch-mozilla_build_autoconf_compiler-opts.m4
deleted file mode 100644
index e713b95dbf9..00000000000
--- a/www/seamonkey/patches/patch-mozilla_build_autoconf_compiler-opts.m4
+++ /dev/null
@@ -1,19 +0,0 @@
-$NetBSD: patch-mozilla_build_autoconf_compiler-opts.m4,v 1.1 2014/06/22 08:54:39 ryoon Exp $
-
---- mozilla/build/autoconf/compiler-opts.m4.orig 2014-06-13 00:45:18.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/www/seamonkey/patches/patch-mozilla_build_autoconf_toolchain.m4 b/www/seamonkey/patches/patch-mozilla_build_autoconf_toolchain.m4
new file mode 100644
index 00000000000..20223b79400
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_build_autoconf_toolchain.m4
@@ -0,0 +1,19 @@
+$NetBSD: patch-mozilla_build_autoconf_toolchain.m4,v 1.1 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/build/autoconf/toolchain.m4.orig 2017-07-07 05:35:47.000000000 +0000
++++ mozilla/build/autoconf/toolchain.m4
+@@ -2,14 +2,6 @@ dnl This Source Code Form is subject to
+ dnl License, v. 2.0. If a copy of the MPL was not distributed with this
+ dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+-dnl Several autoconf functions AC_REQUIRE AC_PROG_CPP/AC_PROG_CXXCPP,
+-dnl meaning they are called even when we don't call them explicitly.
+-dnl However, theses checks are not necessary and python configure sets
+-dnl the corresponding variables already, so just skip those tests
+-dnl entirely.
+-define([AC_PROG_CPP],[])
+-define([AC_PROG_CXXCPP],[])
+-
+ AC_DEFUN([MOZ_TOOL_VARIABLES],
+ [
+ GNU_AS=
diff --git a/www/seamonkey/patches/patch-mozilla_build_moz.configure_init.configure b/www/seamonkey/patches/patch-mozilla_build_moz.configure_init.configure
new file mode 100644
index 00000000000..33af778a830
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_build_moz.configure_init.configure
@@ -0,0 +1,37 @@
+$NetBSD: patch-mozilla_build_moz.configure_init.configure,v 1.1 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/build/moz.configure/init.configure.orig 2017-07-07 05:35:47.000000000 +0000
++++ mozilla/build/moz.configure/init.configure
+@@ -149,6 +149,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:
+@@ -168,6 +169,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)
+@@ -203,7 +210,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/www/seamonkey/patches/patch-mozilla_build_moz.configure_old.configure b/www/seamonkey/patches/patch-mozilla_build_moz.configure_old.configure
index 5a7c8db300b..854042f01a1 100644
--- a/www/seamonkey/patches/patch-mozilla_build_moz.configure_old.configure
+++ b/www/seamonkey/patches/patch-mozilla_build_moz.configure_old.configure
@@ -1,6 +1,6 @@
-$NetBSD: patch-mozilla_build_moz.configure_old.configure,v 1.1 2017/01/01 16:14:07 ryoon Exp $
+$NetBSD: patch-mozilla_build_moz.configure_old.configure,v 1.2 2017/08/18 23:55:07 ryoon Exp $
---- mozilla/build/moz.configure/old.configure.orig 2016-12-14 02:09:43.000000000 +0000
+--- mozilla/build/moz.configure/old.configure.orig 2017-07-07 05:35:47.000000000 +0000
+++ mozilla/build/moz.configure/old.configure
@@ -159,6 +159,7 @@ def old_configure_options(*options):
'--enable-accessibility',
@@ -8,25 +8,23 @@ $NetBSD: patch-mozilla_build_moz.configure_old.configure,v 1.1 2017/01/01 16:14:
'--enable-alsa',
+ '--enable-alsa-dlopen',
'--enable-android-omx',
- '--enable-approximate-location',
'--enable-b2g-bt',
-@@ -262,6 +263,7 @@ def old_configure_options(*options):
+ '--enable-b2g-camera',
+@@ -241,6 +242,7 @@ def old_configure_options(*options):
+ '--enable-url-classifier',
+ '--enable-valgrind',
'--enable-verify-mar',
- '--enable-warnings-as-errors',
- '--enable-webapp-runtime',
+ '--enable-webm',
'--enable-webrtc',
- '--enable-websms-backend',
- '--enable-webspeech',
-@@ -310,6 +312,7 @@ def old_configure_options(*options):
+ '--enable-xul',
+ '--enable-zipwriter',
+@@ -279,18 +281,26 @@ def old_configure_options(*options):
'--with-nspr-prefix',
'--with-nss-exec-prefix',
'--with-nss-prefix',
+ '--with-oss',
'--with-pthreads',
'--with-qemu-exe',
- '--with-qtdir',
-@@ -317,13 +320,20 @@ def old_configure_options(*options):
'--with-sixgill',
'--with-soft-float',
'--with-system-bz2',
diff --git a/www/seamonkey/patches/patch-mozilla_build_moz.configure_toolchain.configure b/www/seamonkey/patches/patch-mozilla_build_moz.configure_toolchain.configure
new file mode 100644
index 00000000000..f73865be755
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_build_moz.configure_toolchain.configure
@@ -0,0 +1,28 @@
+$NetBSD: patch-mozilla_build_moz.configure_toolchain.configure,v 1.1 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/build/moz.configure/toolchain.configure.orig 2017-07-07 05:35:47.000000000 +0000
++++ mozilla/build/moz.configure/toolchain.configure
+@@ -756,23 +756,6 @@ def compiler(language, host_or_target, c
+ valid_compiler.try_compile(check_msg='%s works' % what,
+ onerror=compiler_error)
+
+-
+- # Set CPP/CXXCPP for both the build system and old-configure. We don't
+- # need to check this works for preprocessing, because we already relied
+- # on $CC -E/$CXX -E doing preprocessing work to validate the compiler
+- # in the first place.
+- if host_or_target == target:
+- pp_var = {
+- 'C': 'CPP',
+- 'C++': 'CXXCPP',
+- }[language]
+-
+- preprocessor = depends_if(valid_compiler)(
+- lambda x: list(x.wrapper) + [x.compiler, '-E'] + list(x.flags))
+-
+- set_config(pp_var, preprocessor)
+- add_old_configure_assignment(pp_var, preprocessor)
+-
+ return valid_compiler
+
+
diff --git a/www/seamonkey/patches/patch-mozilla_build_pgo_profileserver.py b/www/seamonkey/patches/patch-mozilla_build_pgo_profileserver.py
new file mode 100644
index 00000000000..99afd714e1c
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_build_pgo_profileserver.py
@@ -0,0 +1,13 @@
+$NetBSD: patch-mozilla_build_pgo_profileserver.py,v 1.5 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/build/pgo/profileserver.py.orig 2017-07-07 05:26:08.000000000 +0000
++++ mozilla/build/pgo/profileserver.py
+@@ -80,7 +80,7 @@ if __name__ == '__main__':
+ env["MOZ_JAR_LOG_FILE"] = os.path.abspath(jarlog)
+ print "jarlog: %s" % env["MOZ_JAR_LOG_FILE"]
+
+- cmdargs = ["http://localhost:%d/index.html" % PORT]
++ cmdargs = ["http://127.0.0.1:%d/index.html" % PORT]
+ runner = FirefoxRunner(profile=profile,
+ binary=build.get_binary_path(where="staged-package"),
+ cmdargs=cmdargs,
diff --git a/www/seamonkey/patches/patch-mozilla_config_Makefile.in b/www/seamonkey/patches/patch-mozilla_config_Makefile.in
index 2b086847305..6f05f75eb0e 100644
--- a/www/seamonkey/patches/patch-mozilla_config_Makefile.in
+++ b/www/seamonkey/patches/patch-mozilla_config_Makefile.in
@@ -1,19 +1,18 @@
-$NetBSD: patch-mozilla_config_Makefile.in,v 1.6 2017/01/01 16:14:07 ryoon Exp $
+$NetBSD: patch-mozilla_config_Makefile.in,v 1.7 2017/08/18 23:55:07 ryoon Exp $
---- mozilla/config/Makefile.in.orig 2016-12-14 02:09:46.000000000 +0000
+--- mozilla/config/Makefile.in.orig 2017-07-07 05:35:48.000000000 +0000
+++ mozilla/config/Makefile.in
-@@ -49,6 +49,14 @@ export:: $(export-preqs)
+@@ -49,6 +49,13 @@ export:: $(export-preqs)
-DMOZ_SYSTEM_LIBEVENT=$(MOZ_SYSTEM_LIBEVENT) \
-DMOZ_SYSTEM_LIBVPX=$(MOZ_SYSTEM_LIBVPX) \
-DMOZ_SYSTEM_ICU=$(MOZ_SYSTEM_ICU) \
++ -DMOZ_SYSTEM_GRAPHITE2=$(MOZ_SYSTEM_GRAPHITE2) \
++ -DMOZ_SYSTEM_HARFBUZZ=$(MOZ_SYSTEM_HARFBUZZ) \
+ -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_CELT=$(MOZ_SYSTEM_CELT) \
-+ -DMOZ_SYSTEM_OPUS=$(MOZ_SYSTEM_OPUS) \
-+ -DMOZ_SYSTEM_SPEEX=$(MOZ_SYSTEM_SPEEX) \
+ -DMOZ_SYSTEM_SOUNDTOUCH=$(MOZ_SYSTEM_SOUNDTOUCH) \
- $(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers
+ $(srcdir)/system-headers $(srcdir)/stl-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers
$(INSTALL) system_wrappers $(DIST)
diff --git a/www/seamonkey/patches/patch-mozilla_config_external_moz.build b/www/seamonkey/patches/patch-mozilla_config_external_moz.build
index a10af6e85b7..cb387f3050f 100644
--- a/www/seamonkey/patches/patch-mozilla_config_external_moz.build
+++ b/www/seamonkey/patches/patch-mozilla_config_external_moz.build
@@ -1,8 +1,8 @@
-$NetBSD: patch-mozilla_config_external_moz.build,v 1.8 2017/01/01 16:14:07 ryoon Exp $
+$NetBSD: patch-mozilla_config_external_moz.build,v 1.9 2017/08/18 23:55:07 ryoon Exp $
---- mozilla/config/external/moz.build.orig 2016-12-14 02:09:46.000000000 +0000
+--- mozilla/config/external/moz.build.orig 2017-07-07 05:35:48.000000000 +0000
+++ mozilla/config/external/moz.build
-@@ -21,10 +21,19 @@ if CONFIG['MOZ_UPDATER']:
+@@ -21,12 +21,21 @@ if CONFIG['MOZ_UPDATER']:
external_dirs += ['modules/brotli']
external_dirs += ['modules/woff2']
@@ -10,12 +10,6 @@ $NetBSD: patch-mozilla_config_external_moz.build,v 1.8 2017/01/01 16:14:07 ryoon
+if not CONFIG['MOZ_SYSTEM_OGG']:
+ external_dirs += ['media/libogg']
+
-+if not CONFIG['MOZ_SYSTEM_CELT'] or not CONFIG['MOZ_SYSTEM_OPUS']:
-+ external_dirs += ['media/libopus']
-+
-+if not CONFIG['MOZ_SYSTEM_THEORA']:
-+ external_dirs += ['media/libtheora']
-+
+if CONFIG['MOZ_VORBIS'] and not CONFIG['MOZ_SYSTEM_VORBIS']:
external_dirs += ['media/libvorbis']
@@ -23,14 +17,25 @@ $NetBSD: patch-mozilla_config_external_moz.build,v 1.8 2017/01/01 16:14:07 ryoon
+if CONFIG['MOZ_TREMOR'] and not CONFIG['MOZ_SYSTEM_TREMOR']:
external_dirs += ['media/libtremor']
++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']:
-@@ -52,9 +61,6 @@ external_dirs += [
+ 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',
+ ]
+
+ DIRS += ['../../' + i for i in external_dirs]
diff --git a/www/seamonkey/patches/patch-mozilla_config_system-headers b/www/seamonkey/patches/patch-mozilla_config_system-headers
index c8633ab2ba7..eb169406a0b 100644
--- a/www/seamonkey/patches/patch-mozilla_config_system-headers
+++ b/www/seamonkey/patches/patch-mozilla_config_system-headers
@@ -1,24 +1,25 @@
-$NetBSD: patch-mozilla_config_system-headers,v 1.22 2017/01/01 16:14:07 ryoon Exp $
+$NetBSD: patch-mozilla_config_system-headers,v 1.23 2017/08/18 23:55:07 ryoon Exp $
---- mozilla/config/system-headers.orig 2016-12-14 02:09:46.000000000 +0000
+--- mozilla/config/system-headers.orig 2017-07-07 05:35:48.000000000 +0000
+++ mozilla/config/system-headers
-@@ -632,6 +632,7 @@ libgnome/libgnome.h
+@@ -624,6 +624,8 @@ libgnome/libgnome.h
libgnomeui/gnome-icon-lookup.h
libgnomeui/gnome-icon-theme.h
libgnomeui/gnome-ui-init.h
+libv4l2.h
- limits
++limits
limits.h
link.h
-@@ -725,6 +726,7 @@ mapiutil.h
+ #ifdef ANDROID
+@@ -714,6 +716,7 @@ mapiutil.h
mapix.h
Math64.h
math.h
+complex
mbstring.h
#ifdef ANDROID
- media/AudioEffect.h
-@@ -1317,6 +1319,25 @@ vpx/vp8cx.h
+ android/native_window.h
+@@ -1302,6 +1305,25 @@ vpx/vp8cx.h
vpx/vp8dx.h
vpx_mem/vpx_mem.h
#endif
@@ -44,10 +45,19 @@ $NetBSD: patch-mozilla_config_system-headers,v 1.22 2017/01/01 16:14:07 ryoon Ex
gst/gst.h
gst/app/gstappsink.h
gst/app/gstappsrc.h
-@@ -1347,3 +1368,35 @@ unicode/utypes.h
+@@ -1332,3 +1354,26 @@ unicode/utypes.h
#endif
libutil.h
unwind.h
++#if MOZ_SYSTEM_GRAPHITE2==1
++graphite2/Font.h
++graphite2/Segment.h
++#endif
++#if MOZ_SYSTEM_HARFBUZZ==1
++harfbuzz/hb-glib.h
++harfbuzz/hb-ot.h
++harfbuzz/hb.h
++#endif
+#if MOZ_SYSTEM_OGG==1
+ogg/ogg.h
+ogg/os_types.h
@@ -62,21 +72,3 @@ $NetBSD: patch-mozilla_config_system-headers,v 1.22 2017/01/01 16:14:07 ryoon Ex
+#if MOZ_SYSTEM_TREMOR==1
+tremor/ivorbiscodec.h
+#endif
-+#if MOZ_SYSTEM_CELT==1
-+celt.h
-+celt_header.h
-+celt/celt.h
-+celt/celt_header.h
-+#endif
-+#if MOZ_SYSTEM_OPUS==1
-+opus.h
-+opus_multistream.h
-+opus/opus.h
-+opus/opus_multistream.h
-+#endif
-+#if MOZ_SYSTEM_SPEEX==1
-+speex/speex_resampler.h
-+#endif
-+#if MOZ_SYSTEM_SOUNDTOUCH==1
-+soundtouch/SoundTouch.h
-+#endif
diff --git a/www/seamonkey/patches/patch-mozilla_dom_base_moz.build b/www/seamonkey/patches/patch-mozilla_dom_base_moz.build
new file mode 100644
index 00000000000..a9efd0be62b
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_dom_base_moz.build
@@ -0,0 +1,14 @@
+$NetBSD: patch-mozilla_dom_base_moz.build,v 1.3 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/dom/base/moz.build.orig 2017-07-07 05:36:00.000000000 +0000
++++ mozilla/dom/base/moz.build
+@@ -458,6 +458,9 @@ if CONFIG['MOZ_BUILD_APP'] in ['browser'
+ if CONFIG['MOZ_X11']:
+ CXXFLAGS += CONFIG['TK_CFLAGS']
+
++if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
++ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
++
+ GENERATED_FILES += [
+ 'PropertyUseCounterMap.inc',
+ 'UseCounterList.h',
diff --git a/www/seamonkey/patches/patch-mozilla_dom_bindings_GenerateCSS2PropertiesWebIDL.py b/www/seamonkey/patches/patch-mozilla_dom_bindings_GenerateCSS2PropertiesWebIDL.py
new file mode 100644
index 00000000000..db93163999d
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_dom_bindings_GenerateCSS2PropertiesWebIDL.py
@@ -0,0 +1,13 @@
+$NetBSD: patch-mozilla_dom_bindings_GenerateCSS2PropertiesWebIDL.py,v 1.1 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/dom/bindings/GenerateCSS2PropertiesWebIDL.py.orig 2017-07-07 05:26:25.000000000 +0000
++++ mozilla/dom/bindings/GenerateCSS2PropertiesWebIDL.py
+@@ -16,7 +16,7 @@ def generateLine(propName, extendedAttrs
+ return " [%s] attribute DOMString %s;\n" % (", ".join(extendedAttrs),
+ propName)
+ def generate(output, idlFilename, preprocessorHeader):
+- cpp = list(buildconfig.substs['CPP'])
++ cpp = shellutil.split(buildconfig.substs['CPP'])
+ cpp += shellutil.split(buildconfig.substs['ACDEFINES'])
+ cpp.append(preprocessorHeader)
+ preprocessed = subprocess.check_output(cpp)
diff --git a/www/seamonkey/patches/patch-mozilla_dom_media_AudioStream.cpp b/www/seamonkey/patches/patch-mozilla_dom_media_AudioStream.cpp
new file mode 100644
index 00000000000..17add84bbee
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_dom_media_AudioStream.cpp
@@ -0,0 +1,38 @@
+$NetBSD: patch-mozilla_dom_media_AudioStream.cpp,v 1.1 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/dom/media/AudioStream.cpp.orig 2017-07-07 05:36:08.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/www/seamonkey/patches/patch-mozilla_dom_media_AudioStream.h b/www/seamonkey/patches/patch-mozilla_dom_media_AudioStream.h
new file mode 100644
index 00000000000..1502fe86a3f
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_dom_media_AudioStream.h
@@ -0,0 +1,28 @@
+$NetBSD: patch-mozilla_dom_media_AudioStream.h,v 1.3 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/dom/media/AudioStream.h.orig 2017-07-07 05:36:09.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/www/seamonkey/patches/patch-mozilla_dom_media_moz.build b/www/seamonkey/patches/patch-mozilla_dom_media_moz.build
index 5c07ac089fd..90ddbb178e7 100644
--- a/www/seamonkey/patches/patch-mozilla_dom_media_moz.build
+++ b/www/seamonkey/patches/patch-mozilla_dom_media_moz.build
@@ -1,10 +1,10 @@
-$NetBSD: patch-mozilla_dom_media_moz.build,v 1.3 2017/01/01 16:14:07 ryoon Exp $
+$NetBSD: patch-mozilla_dom_media_moz.build,v 1.4 2017/08/18 23:55:07 ryoon Exp $
---- mozilla/dom/media/moz.build.orig 2016-12-14 02:09:32.000000000 +0000
+--- mozilla/dom/media/moz.build.orig 2017-07-07 05:36:09.000000000 +0000
+++ mozilla/dom/media/moz.build
-@@ -333,6 +333,27 @@ if CONFIG['ANDROID_VERSION'] > '15':
- if CONFIG['MOZ_GONK_MEDIACODEC']:
- DEFINES['MOZ_GONK_MEDIACODEC'] = True
+@@ -316,6 +316,21 @@ if CONFIG['MOZ_WEBRTC']:
+
+ DEFINES['MOZILLA_INTERNAL_API'] = True
+if CONFIG['MOZ_SYSTEM_OGG']:
+ CXXFLAGS += CONFIG['MOZ_OGG_CFLAGS']
@@ -18,15 +18,9 @@ $NetBSD: patch-mozilla_dom_media_moz.build,v 1.3 2017/01/01 16:14:07 ryoon Exp $
+if CONFIG['MOZ_SYSTEM_TREMOR']:
+ CXXFLAGS += CONFIG['MOZ_TREMOR_CFLAGS']
+
-+if CONFIG['MOZ_SYSTEM_OPUS']:
-+ CXXFLAGS += CONFIG['MOZ_OPUS_CFLAGS']
-+
-+if CONFIG['MOZ_SYSTEM_SPEEX']:
-+ CXXFLAGS += CONFIG['MOZ_SPEEX_CFLAGS']
-+
+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/www/seamonkey/patches/patch-mozilla_dom_system_OSFileConstants.cpp b/www/seamonkey/patches/patch-mozilla_dom_system_OSFileConstants.cpp
new file mode 100644
index 00000000000..a0a02ecc983
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_dom_system_OSFileConstants.cpp
@@ -0,0 +1,13 @@
+$NetBSD: patch-mozilla_dom_system_OSFileConstants.cpp,v 1.9 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/dom/system/OSFileConstants.cpp.orig 2017-07-07 05:36:18.000000000 +0000
++++ mozilla/dom/system/OSFileConstants.cpp
+@@ -699,7 +699,7 @@ static const dom::ConstantSpec gLibcProp
+
+ { "OSFILE_SIZEOF_STATVFS", JS::Int32Value(sizeof (struct statvfs)) },
+
+- { "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)) },
+
+ #endif // defined(XP_UNIX)
diff --git a/www/seamonkey/patches/patch-mozilla_gfx_graphite2_moz-gr-update.sh b/www/seamonkey/patches/patch-mozilla_gfx_graphite2_moz-gr-update.sh
new file mode 100644
index 00000000000..c279fc93ff9
--- /dev/null
+++ b/www/seamonkey/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/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/gfx/graphite2/moz-gr-update.sh.orig 2017-07-07 05:27:00.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/www/seamonkey/patches/patch-mozilla_gfx_moz.build b/www/seamonkey/patches/patch-mozilla_gfx_moz.build
new file mode 100644
index 00000000000..af38819ff66
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_gfx_moz.build
@@ -0,0 +1,26 @@
+$NetBSD: patch-mozilla_gfx_moz.build,v 1.3 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/gfx/moz.build.orig 2017-07-07 05:36:34.000000000 +0000
++++ mozilla/gfx/moz.build
+@@ -7,6 +7,12 @@
+ if CONFIG['MOZ_TREE_CAIRO']:
+ DIRS += ['cairo']
+
++if not CONFIG['MOZ_SYSTEM_GRAPHITE2']:
++ DIRS += ['graphite2/src' ]
++
++if not CONFIG['MOZ_SYSTEM_HARFBUZZ']:
++ DIRS += ['harfbuzz/src']
++
+ DIRS += [
+ '2d',
+ 'ycbcr',
+@@ -15,8 +21,6 @@ DIRS += [
+ 'qcms',
+ 'gl',
+ 'layers',
+- 'graphite2/src',
+- 'harfbuzz/src',
+ 'ots/src',
+ 'thebes',
+ 'ipc',
diff --git a/www/seamonkey/patches/patch-mozilla_gfx_skia_generate__mozbuild.py b/www/seamonkey/patches/patch-mozilla_gfx_skia_generate__mozbuild.py
new file mode 100644
index 00000000000..4e08a7120d8
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_gfx_skia_generate__mozbuild.py
@@ -0,0 +1,14 @@
+$NetBSD: patch-mozilla_gfx_skia_generate__mozbuild.py,v 1.5 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/gfx/skia/generate_mozbuild.py.orig 2017-07-07 05:36:33.000000000 +0000
++++ mozilla/gfx/skia/generate_mozbuild.py
+@@ -140,6 +140,9 @@ if CONFIG['CLANG_CXX'] or CONFIG['CLANG_
+ '-Wno-unused-private-field',
+ ]
+
++if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
++ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
++
+ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3', 'android', 'gonk'):
+ CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
+ CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
diff --git a/www/seamonkey/patches/patch-mozilla_gfx_skia_moz.build b/www/seamonkey/patches/patch-mozilla_gfx_skia_moz.build
new file mode 100644
index 00000000000..9b40624f572
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_gfx_skia_moz.build
@@ -0,0 +1,14 @@
+$NetBSD: patch-mozilla_gfx_skia_moz.build,v 1.9 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/gfx/skia/moz.build.orig 2017-07-07 05:36:33.000000000 +0000
++++ mozilla/gfx/skia/moz.build
+@@ -664,6 +664,9 @@ if CONFIG['CLANG_CXX'] or CONFIG['CLANG_
+ '-Wno-unused-private-field',
+ ]
+
++if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
++ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
++
+ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3', 'android', 'gonk'):
+ CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
+ CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
diff --git a/www/seamonkey/patches/patch-mozilla_gfx_thebes_gfxFontUtils.cpp b/www/seamonkey/patches/patch-mozilla_gfx_thebes_gfxFontUtils.cpp
new file mode 100644
index 00000000000..ee2c2b7af73
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_gfx_thebes_gfxFontUtils.cpp
@@ -0,0 +1,49 @@
+$NetBSD: patch-mozilla_gfx_thebes_gfxFontUtils.cpp,v 1.1 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/gfx/thebes/gfxFontUtils.cpp.orig 2017-07-07 05:36:36.000000000 +0000
++++ mozilla/gfx/thebes/gfxFontUtils.cpp
+@@ -918,16 +918,18 @@ IsValidSFNTVersion(uint32_t version)
+ version == TRUETYPE_TAG('t','r','u','e');
+ }
+
+-// copy and swap UTF-16 values, assume no surrogate pairs, can be in place
++// Copy and swap UTF-16 values, assume no surrogate pairs, can be in place.
++// aInBuf and aOutBuf are NOT necessarily 16-bit-aligned, so we should avoid
++// accessing them directly as uint16_t* values.
++// aLen is count of UTF-16 values, so the byte buffers are twice that.
+ static void
+-CopySwapUTF16(const uint16_t *aInBuf, uint16_t *aOutBuf, uint32_t aLen)
++CopySwapUTF16(const char* aInBuf, char* aOutBuf, uint32_t aLen)
+ {
+- const uint16_t *end = aInBuf + aLen;
++ const char* end = aInBuf + aLen * 2;
+ while (aInBuf < end) {
+- uint16_t value = *aInBuf;
+- *aOutBuf = (value >> 8) | (value & 0xff) << 8;
+- aOutBuf++;
+- aInBuf++;
++ uint8_t b0 = *aInBuf++;
++ *aOutBuf++ = *aInBuf++;
++ *aOutBuf++ = b0;
+ }
+ }
+
+@@ -1446,13 +1448,13 @@ gfxFontUtils::DecodeFontName(const char
+ if (csName[0] == 0) {
+ // empty charset name: data is utf16be, no need to instantiate a converter
+ uint32_t strLen = aByteLen / 2;
+-#ifdef IS_LITTLE_ENDIAN
+ aName.SetLength(strLen);
+- CopySwapUTF16(reinterpret_cast<const uint16_t*>(aNameData),
+- reinterpret_cast<uint16_t*>(aName.BeginWriting()), strLen);
++#ifdef IS_LITTLE_ENDIAN
++ CopySwapUTF16(aNameData, reinterpret_cast<char*>(aName.BeginWriting()),
++ strLen);
+ #else
+- aName.Assign(reinterpret_cast<const char16_t*>(aNameData), strLen);
+-#endif
++ memcpy(aName.BeginWriting(), aNameData, strLen * 2);
++#endif
+ return true;
+ }
+
diff --git a/www/seamonkey/patches/patch-mozilla_gfx_thebes_moz.build b/www/seamonkey/patches/patch-mozilla_gfx_thebes_moz.build
new file mode 100644
index 00000000000..9813de7ced1
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_gfx_thebes_moz.build
@@ -0,0 +1,19 @@
+$NetBSD: patch-mozilla_gfx_thebes_moz.build,v 1.5 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/gfx/thebes/moz.build.orig 2017-07-07 05:36:36.000000000 +0000
++++ mozilla/gfx/thebes/moz.build
+@@ -286,7 +286,13 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk
+ LOCAL_INCLUDES += CONFIG['SKIA_INCLUDES']
+ LOCAL_INCLUDES += ['/media/libyuv/include']
+
+-DEFINES['GRAPHITE2_STATIC'] = True
++if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
++ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
++
++if CONFIG['MOZ_SYSTEM_GRAPHITE2']:
++ CXXFLAGS += CONFIG['MOZ_GRAPHITE2_CFLAGS']
++else:
++ DEFINES['GRAPHITE2_STATIC'] = True
+
+ if CONFIG['CLANG_CXX']:
+ # Suppress warnings from Skia header files.
diff --git a/www/seamonkey/patches/patch-mozilla_image_Downscaler.h b/www/seamonkey/patches/patch-mozilla_image_Downscaler.h
new file mode 100644
index 00000000000..362840b4227
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_image_Downscaler.h
@@ -0,0 +1,33 @@
+$NetBSD: patch-mozilla_image_Downscaler.h,v 1.1 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/image/Downscaler.h.orig 2017-07-07 05:36:37.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/www/seamonkey/patches/patch-mozilla_image_decoders_nsIconDecoder.cpp b/www/seamonkey/patches/patch-mozilla_image_decoders_nsIconDecoder.cpp
new file mode 100644
index 00000000000..7f21ce4a889
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_image_decoders_nsIconDecoder.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-mozilla_image_decoders_nsIconDecoder.cpp,v 1.1 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/image/decoders/nsIconDecoder.cpp.orig 2017-07-07 05:36:37.000000000 +0000
++++ mozilla/image/decoders/nsIconDecoder.cpp
+@@ -94,7 +94,8 @@ nsIconDecoder::ReadRowOfPixels(const cha
+ return AsVariant(WriteState::NEED_MORE_DATA); // Done with this row.
+ }
+
+- uint32_t pixel = *reinterpret_cast<const uint32_t*>(aData);
++ uint32_t pixel;
++ memcpy(&pixel, aData, 4);
+ aData += 4;
+ aLength -= 4;
+
diff --git a/www/seamonkey/patches/patch-mozilla_image_decoders_nsJPEGDecoder.cpp b/www/seamonkey/patches/patch-mozilla_image_decoders_nsJPEGDecoder.cpp
index 9e269e4f5d1..a943171d983 100644
--- a/www/seamonkey/patches/patch-mozilla_image_decoders_nsJPEGDecoder.cpp
+++ b/www/seamonkey/patches/patch-mozilla_image_decoders_nsJPEGDecoder.cpp
@@ -1,8 +1,8 @@
-$NetBSD: patch-mozilla_image_decoders_nsJPEGDecoder.cpp,v 1.5 2017/01/01 16:14:07 ryoon Exp $
+$NetBSD: patch-mozilla_image_decoders_nsJPEGDecoder.cpp,v 1.6 2017/08/18 23:55:07 ryoon Exp $
---- mozilla/image/decoders/nsJPEGDecoder.cpp.orig 2016-12-14 02:09:42.000000000 +0000
+--- mozilla/image/decoders/nsJPEGDecoder.cpp.orig 2017-07-07 05:36:37.000000000 +0000
+++ mozilla/image/decoders/nsJPEGDecoder.cpp
-@@ -24,13 +24,28 @@
+@@ -28,13 +28,28 @@
extern "C" {
#include "iccjpeg.h"
@@ -32,7 +32,7 @@ $NetBSD: patch-mozilla_image_decoders_nsJPEGDecoder.cpp,v 1.5 2017/01/01 16:14:0
static void cmyk_convert_rgb(JSAMPROW row, JDIMENSION width);
-@@ -340,6 +355,7 @@ nsJPEGDecoder::WriteInternal(const char*
+@@ -360,6 +375,7 @@ nsJPEGDecoder::ReadJPEGData(const char*
case JCS_GRAYSCALE:
case JCS_RGB:
case JCS_YCbCr:
@@ -40,18 +40,18 @@ $NetBSD: patch-mozilla_image_decoders_nsJPEGDecoder.cpp,v 1.5 2017/01/01 16:14:0
// if we're not color managing we can decode directly to
// MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB
if (mCMSMode != eCMSMode_All) {
-@@ -348,6 +364,9 @@ nsJPEGDecoder::WriteInternal(const char*
+@@ -368,6 +384,9 @@ nsJPEGDecoder::ReadJPEGData(const char*
} else {
mInfo.out_color_space = JCS_RGB;
}
+#else
-+ mInfo.out_color_space = JCS_RGB;
++ mInfo.out_color_space = JCS_RGB;
+#endif
break;
case JCS_CMYK:
case JCS_YCCK:
-@@ -422,6 +441,15 @@ 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
@@ -63,10 +63,11 @@ $NetBSD: patch-mozilla_image_decoders_nsJPEGDecoder.cpp,v 1.5 2017/01/01 16:14:0
+ mInfo.cconvert->color_convert = ycc_rgb_convert_argb;
+ }
+#endif
++
// If this is a progressive JPEG ...
mState = mInfo.buffered_image ?
JPEG_DECOMPRESS_PROGRESSIVE : JPEG_DECOMPRESS_SEQUENTIAL;
-@@ -606,7 +634,11 @@ nsJPEGDecoder::OutputScanlines(bool* sus
+@@ -636,7 +665,11 @@ nsJPEGDecoder::OutputScanlines(bool* sus
MOZ_ASSERT(imageRow, "Should have a row buffer here");
@@ -78,7 +79,7 @@ $NetBSD: patch-mozilla_image_decoders_nsJPEGDecoder.cpp,v 1.5 2017/01/01 16:14:0
// Special case: scanline will be directly converted into packed ARGB
if (jpeg_read_scanlines(&mInfo, (JSAMPARRAY)&imageRow, 1) != 1) {
*suspend = true; // suspend
-@@ -930,6 +962,282 @@ term_source (j_decompress_ptr jd)
+@@ -960,6 +993,282 @@ term_source (j_decompress_ptr jd)
} // namespace image
} // namespace mozilla
diff --git a/www/seamonkey/patches/patch-mozilla_intl_lwbrk_nsJISx4051LineBreaker.cpp b/www/seamonkey/patches/patch-mozilla_intl_lwbrk_nsJISx4051LineBreaker.cpp
new file mode 100644
index 00000000000..49542094051
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_intl_lwbrk_nsJISx4051LineBreaker.cpp
@@ -0,0 +1,40 @@
+$NetBSD: patch-mozilla_intl_lwbrk_nsJISx4051LineBreaker.cpp,v 1.1 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/intl/lwbrk/nsJISx4051LineBreaker.cpp.orig 2017-07-07 05:36:43.000000000 +0000
++++ mozilla/intl/lwbrk/nsJISx4051LineBreaker.cpp
+@@ -12,6 +12,10 @@
+ #include "nsTArray.h"
+ #include "nsUnicodeProperties.h"
+
++#if ENABLE_INTL_API
++#include "unicode/uchar.h" // for U_LB_COUNT until bug 1305700
++#endif
++
+ /*
+
+ Simplification of Pair Table in JIS X 4051
+@@ -547,10 +551,22 @@ GetClass(uint32_t u)
+ /* CLOSE_PARENTHESIS = 36, [CP] */ CLASS_CLOSE_LIKE_CHARACTER,
+ /* CONDITIONAL_JAPANESE_STARTER = 37, [CJ] */ CLASS_CLOSE,
+ /* HEBREW_LETTER = 38, [HL] */ CLASS_CHARACTER,
+- /* REGIONAL_INDICATOR = 39, [RI] */ CLASS_CHARACTER
++ /* REGIONAL_INDICATOR = 39, [RI] */ CLASS_CHARACTER,
++#if U_ICU_VERSION_MAJOR_NUM > 57
++ /* E_BASE = 40, [EB] */ CLASS_BREAKABLE,
++ /* E_MODIFIER = 41, [EM] */ CLASS_CHARACTER,
++ /* ZWJ = 42, [ZWJ]*/ CLASS_CHARACTER,
++#endif
+ };
+
+- return sUnicodeLineBreakToClass[mozilla::unicode::GetLineBreakClass(u)];
++#if ENABLE_INTL_API
++ static_assert(U_LB_COUNT == mozilla::ArrayLength(sUnicodeLineBreakToClass),
++ "Gecko vs ICU LineBreak class mismatch");
++#endif
++
++ auto cls = mozilla::unicode::GetLineBreakClass(u);
++ MOZ_ASSERT(cls < mozilla::ArrayLength(sUnicodeLineBreakToClass));
++ return sUnicodeLineBreakToClass[cls];
+ }
+
+ static bool
diff --git a/www/seamonkey/patches/patch-mozilla_intl_unicharutil_util_moz.build b/www/seamonkey/patches/patch-mozilla_intl_unicharutil_util_moz.build
new file mode 100644
index 00000000000..e146bd85861
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_intl_unicharutil_util_moz.build
@@ -0,0 +1,12 @@
+$NetBSD: patch-mozilla_intl_unicharutil_util_moz.build,v 1.5 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/intl/unicharutil/util/moz.build.orig 2017-07-07 05:36:44.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/www/seamonkey/patches/patch-mozilla_ios b/www/seamonkey/patches/patch-mozilla_ios
new file mode 100644
index 00000000000..c80bb6986f1
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_ios
@@ -0,0 +1,8 @@
+$NetBSD: patch-mozilla_ios,v 1.5 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/ios.orig 2017-08-18 14:25:23.037120171 +0000
++++ mozilla/ios
+@@ -0,0 +1,3 @@
++#pragma GCC visibility push(default)
++#include_next <ios>
++#pragma GCC visibility pop
diff --git a/www/seamonkey/patches/patch-mozilla_js_src_jsdate.cpp b/www/seamonkey/patches/patch-mozilla_js_src_jsdate.cpp
deleted file mode 100644
index dfc011abc80..00000000000
--- a/www/seamonkey/patches/patch-mozilla_js_src_jsdate.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD: patch-mozilla_js_src_jsdate.cpp,v 1.2 2017/01/01 16:14:08 ryoon Exp $
-
---- mozilla/js/src/jsdate.cpp.orig 2016-12-14 02:09:44.000000000 +0000
-+++ mozilla/js/src/jsdate.cpp
-@@ -2721,8 +2721,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/www/seamonkey/patches/patch-mozilla_js_src_jskwgen.cpp b/www/seamonkey/patches/patch-mozilla_js_src_jskwgen.cpp
deleted file mode 100644
index f9d74bb8724..00000000000
--- a/www/seamonkey/patches/patch-mozilla_js_src_jskwgen.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-mozilla_js_src_jskwgen.cpp,v 1.1 2015/03/17 19:50:42 ryoon Exp $
-
---- mozilla/js/src/jskwgen.cpp.orig 2015-03-09 05:34:39.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/www/seamonkey/patches/patch-mozilla_js_src_moz.build b/www/seamonkey/patches/patch-mozilla_js_src_moz.build
new file mode 100644
index 00000000000..45a551d041f
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_js_src_moz.build
@@ -0,0 +1,15 @@
+$NetBSD: patch-mozilla_js_src_moz.build,v 1.1 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/js/src/moz.build.orig 2017-07-07 05:36:52.000000000 +0000
++++ mozilla/js/src/moz.build
+@@ -734,10 +734,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 = GENERATED_FILES['selfhosted.out.h']
diff --git a/www/seamonkey/patches/patch-mozilla_js_src_old-configure.in b/www/seamonkey/patches/patch-mozilla_js_src_old-configure.in
index 7d6975f94b7..2bc2e1ff1fa 100644
--- a/www/seamonkey/patches/patch-mozilla_js_src_old-configure.in
+++ b/www/seamonkey/patches/patch-mozilla_js_src_old-configure.in
@@ -1,31 +1,14 @@
-$NetBSD: patch-mozilla_js_src_old-configure.in,v 1.1 2017/01/01 16:14:08 ryoon Exp $
+$NetBSD: patch-mozilla_js_src_old-configure.in,v 1.2 2017/08/18 23:55:07 ryoon Exp $
---- mozilla/js/src/old-configure.in.orig 2016-12-14 02:09:44.000000000 +0000
+--- mozilla/js/src/old-configure.in.orig 2017-07-07 05:36:52.000000000 +0000
+++ mozilla/js/src/old-configure.in
-@@ -1272,8 +1272,7 @@ AC_LANG_CPLUSPLUS
+@@ -140,6 +140,9 @@ fi
- MOZ_CXX11
+ MOZ_TOOL_VARIABLES
--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)
-@@ -2593,6 +2592,16 @@ MOZ_CONFIG_ICU()
- dnl ========================================================
- dnl JavaScript shell
- dnl ========================================================
-+ICU_LIB_NAMES=
-+MOZ_SYSTEM_ICU=
-+MOZ_ARG_WITH_BOOL(system-icu,
-+[ --with-system-icu
-+ Use system icu (located with pkgconfig)],
-+ MOZ_SYSTEM_ICU=1)
++AC_PROG_CPP
++AC_PROG_CXXCPP
+
-+if test -n "$MOZ_SYSTEM_ICU"; then
-+ PKG_CHECK_MODULES(MOZ_ICU, icu-i18n >= 50.1)
-+fi
-
- MOZ_CHECK_ALLOCATOR
+ dnl Special win32 checks
+ dnl ========================================================
diff --git a/www/seamonkey/patches/patch-mozilla_js_xpconnect_src_xpcprivate.h b/www/seamonkey/patches/patch-mozilla_js_xpconnect_src_xpcprivate.h
index 118b972ceb7..a3cb29ce184 100644
--- a/www/seamonkey/patches/patch-mozilla_js_xpconnect_src_xpcprivate.h
+++ b/www/seamonkey/patches/patch-mozilla_js_xpconnect_src_xpcprivate.h
@@ -1,8 +1,8 @@
-$NetBSD: patch-mozilla_js_xpconnect_src_xpcprivate.h,v 1.2 2015/02/15 02:11:03 ryoon Exp $
+$NetBSD: patch-mozilla_js_xpconnect_src_xpcprivate.h,v 1.3 2017/08/18 23:55:07 ryoon Exp $
---- mozilla/js/xpconnect/src/xpcprivate.h.orig 2015-02-05 04:39:06.000000000 +0000
+--- mozilla/js/xpconnect/src/xpcprivate.h.orig 2017-07-07 05:36:59.000000000 +0000
+++ mozilla/js/xpconnect/src/xpcprivate.h
-@@ -1016,6 +1016,8 @@ static inline bool IS_PROTO_CLASS(const
+@@ -842,6 +842,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 2015/02/15 02:11:03 r
+
class nsIAddonInterposition;
class nsXPCComponentsBase;
- class XPCWrappedNativeScope : public PRCList
+ class XPCWrappedNativeScope final : public PRCList
diff --git a/www/seamonkey/patches/patch-mozilla_layout_style_GenerateCSSPropsGenerated.py b/www/seamonkey/patches/patch-mozilla_layout_style_GenerateCSSPropsGenerated.py
new file mode 100644
index 00000000000..24ef24a1638
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_layout_style_GenerateCSSPropsGenerated.py
@@ -0,0 +1,13 @@
+$NetBSD: patch-mozilla_layout_style_GenerateCSSPropsGenerated.py,v 1.1 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/layout/style/GenerateCSSPropsGenerated.py.orig 2017-07-07 05:28:56.000000000 +0000
++++ mozilla/layout/style/GenerateCSSPropsGenerated.py
+@@ -10,7 +10,7 @@ import buildconfig
+ from mozbuild import shellutil
+
+ def get_properties(preprocessorHeader):
+- cpp = list(buildconfig.substs['CPP'])
++ cpp = shellutil.split(buildconfig.substs['CPP'])
+ cpp += shellutil.split(buildconfig.substs['ACDEFINES'])
+ cpp.append(preprocessorHeader)
+ preprocessed = subprocess.check_output(cpp)
diff --git a/www/seamonkey/patches/patch-mozilla_media_libcubeb_src_cubeb__alsa.c b/www/seamonkey/patches/patch-mozilla_media_libcubeb_src_cubeb__alsa.c
index b9a13fdc108..a6b29ba966b 100644
--- a/www/seamonkey/patches/patch-mozilla_media_libcubeb_src_cubeb__alsa.c
+++ b/www/seamonkey/patches/patch-mozilla_media_libcubeb_src_cubeb__alsa.c
@@ -1,8 +1,8 @@
-$NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.8 2017/01/01 16:14:08 ryoon Exp $
+$NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.9 2017/08/18 23:55:07 ryoon Exp $
---- mozilla/media/libcubeb/src/cubeb_alsa.c.orig 2016-12-14 02:09:53.000000000 +0000
+--- mozilla/media/libcubeb/src/cubeb_alsa.c.orig 2017-07-07 05:37:16.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.8 2017/01/01 16:14:0
#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.8 2017/01/01 16:14:0
+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.8 2017/01/01 16:14:0
/* 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.8 2017/01/01 16:14:0
};
enum stream_state {
-@@ -257,32 +310,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) {
-@@ -293,8 +349,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);
-@@ -302,7 +358,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.8 2017/01/01 16:14:0
assert(p);
pthread_mutex_unlock(&stm->mutex);
-@@ -311,10 +367,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;
-@@ -327,14 +384,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);
-@@ -342,7 +451,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.8 2017/01/01 16:14:0
set_timeout(&stm->drain_timeout, buffer_time * 1000);
-@@ -453,26 +562,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.8 2017/01/01 16:14:0
if (r < 0) {
break;
}
-@@ -481,7 +590,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.8 2017/01/01 16:14:0
if (r < 0) {
break;
}
-@@ -490,7 +599,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.8 2017/01/01 16:14:0
}
return NULL;
-@@ -513,22 +622,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.8 2017/01/01 16:14:0
if (r < 0) {
break;
}
-@@ -537,7 +646,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.8 2017/01/01 16:14:0
if (r < 0) {
break;
}
-@@ -548,12 +657,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.8 2017/01/01 16:14:0
if (r < 0) {
break;
}
-@@ -564,18 +673,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.8 2017/01/01 16:14:0
if (r < 0) {
break;
}
-@@ -583,7 +692,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.8 2017/01/01 16:14:0
return NULL;
}
-@@ -595,9 +704,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.8 2017/01/01 16:14:0
}
pthread_mutex_unlock(&cubeb_alsa_mutex);
-@@ -610,7 +719,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.8 2017/01/01 16:14:0
pthread_mutex_unlock(&cubeb_alsa_mutex);
return r;
-@@ -667,12 +776,65 @@ alsa_init(cubeb ** context, char const *
+@@ -654,12 +704,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.8 2017/01/01 16:14:0
cubeb_alsa_error_handler_set = 1;
}
pthread_mutex_unlock(&cubeb_alsa_mutex);
-@@ -680,6 +842,8 @@ alsa_init(cubeb ** context, char const *
+@@ -667,6 +770,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.8 2017/01/01 16:14:0
ctx->ops = &alsa_ops;
r = pthread_mutex_init(&ctx->mutex, NULL);
-@@ -729,7 +893,7 @@ alsa_init(cubeb ** context, char const *
+@@ -716,7 +821,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.8 2017/01/01 16:14:0
pthread_mutex_unlock(&cubeb_alsa_mutex);
ctx->local_config = NULL;
} else if (r >= 0) {
-@@ -768,9 +932,13 @@ alsa_destroy(cubeb * ctx)
+@@ -755,9 +860,13 @@ alsa_destroy(cubeb * ctx)
pthread_mutex_destroy(&ctx->mutex);
free(ctx->fds);
@@ -507,7 +377,7 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.8 2017/01/01 16:14:0
pthread_mutex_unlock(&cubeb_alsa_mutex);
}
-@@ -853,7 +1021,7 @@ alsa_stream_init(cubeb * ctx, cubeb_stre
+@@ -842,7 +951,7 @@ alsa_stream_init(cubeb * ctx, cubeb_stre
return CUBEB_ERROR;
}
@@ -515,24 +385,22 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.8 2017/01/01 16:14:0
+ r = WRAP(snd_pcm_nonblock)(stm->pcm, 1);
assert(r == 0);
- /* Ugly hack: the PA ALSA plugin allows buffer configurations that can't
-@@ -863,23 +1031,23 @@ alsa_stream_init(cubeb * ctx, cubeb_stre
- latency = latency < 500 ? 500 : latency;
+ latency_us = latency_frames * 1e6 / stm->params.rate;
+@@ -855,7 +964,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);
+@@ -863,15 +972,15 @@ alsa_stream_init(cubeb * ctx, cubeb_stre
return CUBEB_ERROR_INVALID_FORMAT;
}
- r = snd_pcm_get_params(stm->pcm, &stm->buffer_size, &period_size);
-+ r = WRAP(snd_pcm_get_params)(stm->pcm, &stm->buffer_size, &stm->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);
@@ -546,7 +414,7 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.8 2017/01/01 16:14:0
assert((nfds_t) r == stm->nfds);
r = pthread_cond_init(&stm->cond, NULL);
-@@ -910,7 +1078,7 @@ alsa_stream_destroy(cubeb_stream * stm)
+@@ -902,7 +1011,7 @@ alsa_stream_destroy(cubeb_stream * stm)
pthread_mutex_lock(&stm->mutex);
if (stm->pcm) {
if (stm->state == DRAINING) {
@@ -555,19 +423,7 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.8 2017/01/01 16:14:0
}
alsa_locked_pcm_close(stm->pcm);
stm->pcm = NULL;
-@@ -920,7 +1088,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);
-
-@@ -952,12 +1123,12 @@ alsa_get_max_channel_count(cubeb * ctx,
+@@ -944,12 +1053,12 @@ alsa_get_max_channel_count(cubeb * ctx,
return CUBEB_ERROR;
}
@@ -582,12 +438,12 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.8 2017/01/01 16:14:0
if (r < 0) {
return CUBEB_ERROR;
}
-@@ -977,34 +1148,34 @@ alsa_get_preferred_sample_rate(cubeb * c
+@@ -969,34 +1078,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 +481,7 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.8 2017/01/01 16:14:0
return CUBEB_OK;
}
-@@ -1028,7 +1199,7 @@ alsa_stream_start(cubeb_stream * stm)
+@@ -1020,7 +1129,7 @@ alsa_stream_start(cubeb_stream * stm)
ctx = stm->context;
pthread_mutex_lock(&stm->mutex);
@@ -634,7 +490,7 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.8 2017/01/01 16:14:0
gettimeofday(&stm->last_activity, NULL);
pthread_mutex_unlock(&stm->mutex);
-@@ -1062,7 +1233,7 @@ alsa_stream_stop(cubeb_stream * stm)
+@@ -1054,7 +1163,7 @@ alsa_stream_stop(cubeb_stream * stm)
pthread_mutex_unlock(&ctx->mutex);
pthread_mutex_lock(&stm->mutex);
@@ -643,7 +499,7 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.8 2017/01/01 16:14:0
pthread_mutex_unlock(&stm->mutex);
return CUBEB_OK;
-@@ -1078,14 +1249,17 @@ alsa_stream_get_position(cubeb_stream *
+@@ -1070,8 +1179,8 @@ alsa_stream_get_position(cubeb_stream *
pthread_mutex_lock(&stm->mutex);
delay = -1;
@@ -654,17 +510,7 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__alsa.c,v 1.8 2017/01/01 16:14:0
*position = stm->last_position;
pthread_mutex_unlock(&stm->mutex);
return CUBEB_OK;
- }
-
-- assert(delay >= 0);
-+ if (delay < 0) {
-+ WRAP(snd_pcm_forward)(stm->pcm, -delay);
-+ delay = 0;
-+ }
-
- *position = 0;
- if (stm->write_position >= (snd_pcm_uframes_t) delay) {
-@@ -1104,7 +1278,7 @@ alsa_stream_get_latency(cubeb_stream * s
+@@ -1096,7 +1205,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/www/seamonkey/patches/patch-mozilla_media_libcubeb_src_cubeb__oss.c b/www/seamonkey/patches/patch-mozilla_media_libcubeb_src_cubeb__oss.c
index 98d525ffa6c..e59ff20be2a 100644
--- a/www/seamonkey/patches/patch-mozilla_media_libcubeb_src_cubeb__oss.c
+++ b/www/seamonkey/patches/patch-mozilla_media_libcubeb_src_cubeb__oss.c
@@ -1,10 +1,10 @@
-$NetBSD: patch-mozilla_media_libcubeb_src_cubeb__oss.c,v 1.4 2017/01/01 16:14:08 ryoon Exp $
+$NetBSD: patch-mozilla_media_libcubeb_src_cubeb__oss.c,v 1.5 2017/08/18 23:55:07 ryoon Exp $
---- mozilla/media/libcubeb/src/cubeb_oss.c.orig 2017-01-01 10:19:05.010110210 +0000
+--- mozilla/media/libcubeb/src/cubeb_oss.c.orig 2017-08-18 14:25:23.144584317 +0000
+++ mozilla/media/libcubeb/src/cubeb_oss.c
-@@ -0,0 +1,412 @@
+@@ -0,0 +1,442 @@
+/*
-+ * Copyright © 2014 Mozilla Foundation
++ * Copyright © 2014 Mozilla Foundation
+ *
+ * This program is made available under an ISC-style license. See the
+ * accompanying file LICENSE for details.
@@ -129,8 +129,8 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__oss.c,v 1.4 2017/01/01 16:14:08
+ 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;
@@ -148,6 +148,26 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__oss.c,v 1.4 2017/01/01 16:14:08
+ }
+}
+
++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;
@@ -172,15 +192,25 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__oss.c,v 1.4 2017/01/01 16:14:08
+ 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;
@@ -260,9 +290,9 @@ $NetBSD: patch-mozilla_media_libcubeb_src_cubeb__oss.c,v 1.4 2017/01/01 16:14:08
+ oss_try_set_latency(stream, latency);
+
+ stream->floating = 0;
-+ SET(SNDCTL_DSP_CHANNELS, output_stream_params->channels);
-+ SET(SNDCTL_DSP_SPEED, output_stream_params->rate);
-+ switch (output_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/www/seamonkey/patches/patch-mozilla_media_libcubeb_src_moz.build b/www/seamonkey/patches/patch-mozilla_media_libcubeb_src_moz.build
index d27d1113d35..7b9533327bd 100644
--- a/www/seamonkey/patches/patch-mozilla_media_libcubeb_src_moz.build
+++ b/www/seamonkey/patches/patch-mozilla_media_libcubeb_src_moz.build
@@ -1,10 +1,10 @@
-$NetBSD: patch-mozilla_media_libcubeb_src_moz.build,v 1.6 2017/01/01 16:14:08 ryoon Exp $
+$NetBSD: patch-mozilla_media_libcubeb_src_moz.build,v 1.7 2017/08/18 23:55:07 ryoon Exp $
---- mozilla/media/libcubeb/src/moz.build.orig 2016-12-14 02:09:53.000000000 +0000
+--- mozilla/media/libcubeb/src/moz.build.orig 2017-07-07 05:37:16.000000000 +0000
+++ mozilla/media/libcubeb/src/moz.build
-@@ -19,6 +19,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,21 +15,11 @@ $NetBSD: patch-mozilla_media_libcubeb_src_moz.build,v 1.6 2017/01/01 16:14:08 ry
if CONFIG['MOZ_PULSEAUDIO']:
SOURCES += [
'cubeb_pulse.c',
-@@ -68,6 +74,9 @@ if CONFIG['OS_TARGET'] == 'Android':
+@@ -81,6 +87,7 @@ if CONFIG['OS_TARGET'] == 'Android':
FINAL_LIBRARY = 'gkmedias'
-+if CONFIG['MOZ_SYSTEM_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 += [
-@@ -78,6 +87,7 @@ 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/www/seamonkey/patches/patch-mozilla_media_libcubeb_tests_moz.build b/www/seamonkey/patches/patch-mozilla_media_libcubeb_tests_moz.build
new file mode 100644
index 00000000000..07fe6e41247
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_media_libcubeb_tests_moz.build
@@ -0,0 +1,12 @@
+$NetBSD: patch-mozilla_media_libcubeb_tests_moz.build,v 1.1 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/media/libcubeb/tests/moz.build.orig 2017-07-07 05:37:16.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/www/seamonkey/patches/patch-mozilla_media_libcubeb_update.sh b/www/seamonkey/patches/patch-mozilla_media_libcubeb_update.sh
new file mode 100644
index 00000000000..1c1bcb5eeda
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_media_libcubeb_update.sh
@@ -0,0 +1,12 @@
+$NetBSD: patch-mozilla_media_libcubeb_update.sh,v 1.1 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/media/libcubeb/update.sh.orig 2017-07-07 05:37:16.000000000 +0000
++++ mozilla/media/libcubeb/update.sh
+@@ -16,6 +16,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/www/seamonkey/patches/patch-mozilla_media_libsoundtouch_src_soundtouch__perms.h b/www/seamonkey/patches/patch-mozilla_media_libsoundtouch_src_soundtouch__perms.h
new file mode 100644
index 00000000000..1f943f34efb
--- /dev/null
+++ b/www/seamonkey/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/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/media/libsoundtouch/src/soundtouch_perms.h.orig 2017-07-07 05:28:55.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/www/seamonkey/patches/patch-mozilla_media_libyuv_include_libyuv_scale__row.h b/www/seamonkey/patches/patch-mozilla_media_libyuv_include_libyuv_scale__row.h
deleted file mode 100644
index 1ecd8ed6bfa..00000000000
--- a/www/seamonkey/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.1 2015/01/02 04:26:21 ryoon Exp $
-
---- mozilla/media/libyuv/include/libyuv/scale_row.h.orig 2014-12-03 06:23:09.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/www/seamonkey/patches/patch-mozilla_media_libyuv_source_mjpeg__decoder.cc b/www/seamonkey/patches/patch-mozilla_media_libyuv_source_mjpeg__decoder.cc
new file mode 100644
index 00000000000..fa854683fbf
--- /dev/null
+++ b/www/seamonkey/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/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/media/libyuv/source/mjpeg_decoder.cc.orig 2017-07-07 05:37:17.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/www/seamonkey/patches/patch-mozilla_media_webrtc_signaling_test_common.build b/www/seamonkey/patches/patch-mozilla_media_webrtc_signaling_test_common.build
new file mode 100644
index 00000000000..8a6c6bbfccc
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_media_webrtc_signaling_test_common.build
@@ -0,0 +1,12 @@
+$NetBSD: patch-mozilla_media_webrtc_signaling_test_common.build,v 1.3 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/media/webrtc/signaling/test/common.build.orig 2017-07-07 05:29:00.000000000 +0000
++++ mozilla/media/webrtc/signaling/test/common.build
+@@ -96,6 +96,7 @@ if CONFIG['JS_SHARED_LIBRARY']:
+
+ USE_LIBS += ['mozglue']
+
++OS_LIBS += CONFIG['MOZ_LIBV4L2_LIBS']
+ OS_LIBS += CONFIG['MOZ_WEBRTC_X11_LIBS']
+ OS_LIBS += CONFIG['REALTIME_LIBS']
+
diff --git a/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_linux_device__info__linux.cc b/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_linux_device__info__linux.cc
new file mode 100644
index 00000000000..8919946fcfd
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_linux_device__info__linux.cc
@@ -0,0 +1,38 @@
+$NetBSD: patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_linux_device__info__linux.cc,v 1.8 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc.orig 2017-07-07 05:37:23.000000000 +0000
++++ mozilla/media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc
+@@ -25,10 +25,21 @@
+ #else
+ #include <linux/videodev2.h>
+ #endif
++#ifdef HAVE_LIBV4L2
++#include <libv4l2.h>
++#endif
+
+ #include "webrtc/system_wrappers/interface/ref_count.h"
+ #include "webrtc/system_wrappers/interface/trace.h"
+
++#ifdef HAVE_LIBV4L2
++#define open v4l2_open
++#define close v4l2_close
++#define dup v4l2_dup
++#define ioctl v4l2_ioctl
++#define mmap v4l2_mmap
++#define munmap v4l2_munmap
++#endif
+
+ namespace webrtc
+ {
+@@ -136,6 +147,11 @@ int32_t DeviceInfoLinux::GetDeviceName(
+ memset(deviceNameUTF8, 0, deviceNameLength);
+ memcpy(cameraName, cap.card, sizeof(cap.card));
+
++ if (cameraName[0] == '\0')
++ {
++ sprintf(cameraName, "Camera at /dev/video%d", deviceNumber);
++ }
++
+ if (deviceNameLength >= strlen(cameraName))
+ {
+ memcpy(deviceNameUTF8, cameraName, strlen(cameraName));
diff --git a/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_linux_video__capture__linux.cc b/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_linux_video__capture__linux.cc
new file mode 100644
index 00000000000..1740d04e221
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_linux_video__capture__linux.cc
@@ -0,0 +1,30 @@
+$NetBSD: patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_linux_video__capture__linux.cc,v 1.8 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/media/webrtc/trunk/webrtc/modules/video_capture/linux/video_capture_linux.cc.orig 2017-07-07 05:37:21.000000000 +0000
++++ mozilla/media/webrtc/trunk/webrtc/modules/video_capture/linux/video_capture_linux.cc
+@@ -25,6 +25,9 @@
+ #else
+ #include <linux/videodev2.h>
+ #endif
++#ifdef HAVE_LIBV4L2
++#include <libv4l2.h>
++#endif
+
+ #include <new>
+
+@@ -33,6 +36,15 @@
+ #include "webrtc/system_wrappers/interface/ref_count.h"
+ #include "webrtc/system_wrappers/interface/trace.h"
+
++#ifdef HAVE_LIBV4L2
++#define open v4l2_open
++#define close v4l2_close
++#define dup v4l2_dup
++#define ioctl v4l2_ioctl
++#define mmap v4l2_mmap
++#define munmap v4l2_munmap
++#endif
++
+ namespace webrtc
+ {
+ namespace videocapturemodule
diff --git a/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_video__capture.gypi b/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_video__capture.gypi
new file mode 100644
index 00000000000..930a50afd04
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_video__capture.gypi
@@ -0,0 +1,34 @@
+$NetBSD: patch-mozilla_media_webrtc_trunk_webrtc_modules_video__capture_video__capture.gypi,v 1.6 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/media/webrtc/trunk/webrtc/modules/video_capture/video_capture.gypi.orig 2017-07-07 05:37:23.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.
+
+ {
++ 'variables': {
++ 'use_libv4l2%': 0,
++ },
+ 'targets': [
+ {
+ # Note this library is missing an implementation for the video capture.
+@@ -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',
++ ],
++ }],
++ ],
+ }], # linux
+ ['OS=="mac"', {
+ 'sources': [
diff --git a/www/seamonkey/patches/patch-mozilla_mfbt_Attributes.h b/www/seamonkey/patches/patch-mozilla_mfbt_Attributes.h
deleted file mode 100644
index 7ad0bd65dc8..00000000000
--- a/www/seamonkey/patches/patch-mozilla_mfbt_Attributes.h
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD: patch-mozilla_mfbt_Attributes.h,v 1.5 2017/01/01 16:14:08 ryoon Exp $
-
---- mozilla/mfbt/Attributes.h.orig 2016-12-14 02:09:55.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
-@@ -72,6 +73,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
diff --git a/www/seamonkey/patches/patch-mozilla_mobile_android_installer_Makefile.in b/www/seamonkey/patches/patch-mozilla_mobile_android_installer_Makefile.in
new file mode 100644
index 00000000000..516fbaea243
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_mobile_android_installer_Makefile.in
@@ -0,0 +1,15 @@
+$NetBSD: patch-mozilla_mobile_android_installer_Makefile.in,v 1.5 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/mobile/android/installer/Makefile.in.orig 2017-07-07 05:37:48.000000000 +0000
++++ mozilla/mobile/android/installer/Makefile.in
+@@ -73,6 +73,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/www/seamonkey/patches/patch-mozilla_mobile_android_installer_package-manifest.in b/www/seamonkey/patches/patch-mozilla_mobile_android_installer_package-manifest.in
new file mode 100644
index 00000000000..ceb90b53ab4
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_mobile_android_installer_package-manifest.in
@@ -0,0 +1,13 @@
+$NetBSD: patch-mozilla_mobile_android_installer_package-manifest.in,v 1.5 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/mobile/android/installer/package-manifest.in.orig 2017-07-07 05:37:48.000000000 +0000
++++ mozilla/mobile/android/installer/package-manifest.in
+@@ -395,7 +395,7 @@
+ @BINPATH@/components/dom_webspeechsynth.xpt
+ #endif
+
+-#ifdef MOZ_DEBUG
++#if defined(ENABLE_TESTS) && defined(MOZ_DEBUG)
+ @BINPATH@/components/TestInterfaceJS.js
+ @BINPATH@/components/TestInterfaceJS.manifest
+ @BINPATH@/components/TestInterfaceJSMaplike.js
diff --git a/www/seamonkey/patches/patch-mozilla_modules_libmar_tests_moz.build b/www/seamonkey/patches/patch-mozilla_modules_libmar_tests_moz.build
new file mode 100644
index 00000000000..a69d223f6cd
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_modules_libmar_tests_moz.build
@@ -0,0 +1,29 @@
+$NetBSD: patch-mozilla_modules_libmar_tests_moz.build,v 1.1 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/modules/libmar/tests/moz.build.orig 2017-07-07 05:37:30.000000000 +0000
++++ mozilla/modules/libmar/tests/moz.build
+@@ -6,24 +6,7 @@
+
+ XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini']
+
+-DEFINES['BIN_SUFFIX'] = CONFIG['BIN_SUFFIX']
+-
+ if CONFIG['OS_TARGET'] != 'Android':
+- nss_files = ['nss3']
+- if not CONFIG['MOZ_FOLD_LIBS']:
+- nss_files.extend([
+- 'nssutil3',
+- 'plc4',
+- 'nspr4',
+- 'plds4',
+- ])
+- TEST_HARNESS_FILES.xpcshell.modules.libmar.tests.unit += sorted(
+- ['!/dist/bin/%s%s%s' % (
+- CONFIG['DLL_PREFIX'],
+- name,
+- CONFIG['DLL_SUFFIX'],
+- ) for name in nss_files]
+- )
+ TEST_HARNESS_FILES.xpcshell.modules.libmar.tests.unit += [
+ '!../tool/signmar%s' % CONFIG['BIN_SUFFIX'],
+ ]
diff --git a/www/seamonkey/patches/patch-mozilla_modules_woff2_src_store__bytes.h b/www/seamonkey/patches/patch-mozilla_modules_woff2_src_store__bytes.h
new file mode 100644
index 00000000000..4d864dfe5db
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_modules_woff2_src_store__bytes.h
@@ -0,0 +1,35 @@
+$NetBSD: patch-mozilla_modules_woff2_src_store__bytes.h,v 1.1 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/modules/woff2/src/store_bytes.h.orig 2017-07-07 05:37:30.000000000 +0000
++++ mozilla/modules/woff2/src/store_bytes.h
+@@ -34,10 +34,11 @@ inline size_t StoreU32(uint8_t* dst, siz
+
+ inline size_t Store16(uint8_t* dst, size_t offset, int x) {
+ #if (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__))
+- *reinterpret_cast<uint16_t*>(dst + offset) =
+- ((x & 0xFF) << 8) | ((x & 0xFF00) >> 8);
++ uint16_t v = ((x & 0xFF) << 8) | ((x & 0xFF00) >> 8);
++ memcpy(dst + offset, &v, 2);
+ #elif (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__))
+- *reinterpret_cast<uint16_t*>(dst + offset) = static_cast<uint16_t>(x);
++ uint16_t v = static_cast<uint16_t>(x);
++ memcpy(dst + offset, &v, 2);
+ #else
+ dst[offset] = x >> 8;
+ dst[offset + 1] = x;
+@@ -54,11 +55,13 @@ inline void StoreU32(uint32_t val, size_
+
+ inline void Store16(int val, size_t* offset, uint8_t* dst) {
+ #if (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__))
+- *reinterpret_cast<uint16_t*>(dst + *offset) =
++ uint16_t v = ((val & 0xFF) << 8) | ((val & 0xFF00) >> 8);
++ memcpy(dst + *offset, &v, 2);
+ ((val & 0xFF) << 8) | ((val & 0xFF00) >> 8);
+ *offset += 2;
+ #elif (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__))
+- *reinterpret_cast<uint16_t*>(dst + *offset) = static_cast<uint16_t>(val);
++ uint16_t v = static_cast<uint16_t>(val);
++ memcpy(dst + *offset, &v, 2);
+ *offset += 2;
+ #else
+ dst[(*offset)++] = val >> 8;
diff --git a/www/seamonkey/patches/patch-mozilla_modules_woff2_src_woff2__common.cc b/www/seamonkey/patches/patch-mozilla_modules_woff2_src_woff2__common.cc
new file mode 100644
index 00000000000..d2b7b279fac
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_modules_woff2_src_woff2__common.cc
@@ -0,0 +1,20 @@
+$NetBSD: patch-mozilla_modules_woff2_src_woff2__common.cc,v 1.1 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/modules/woff2/src/woff2_common.cc.orig 2017-07-07 05:37:53.000000000 +0000
++++ mozilla/modules/woff2/src/woff2_common.cc
+@@ -25,12 +25,13 @@ uint32_t ComputeULongSum(const uint8_t*
+ uint32_t checksum = 0;
+ size_t aligned_size = size & ~3;
+ for (size_t i = 0; i < aligned_size; i += 4) {
++ uint32_t v;
++ memcpy(&v, buf + i, 4);
+ #if (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__))
+- uint32_t v = *reinterpret_cast<const uint32_t*>(buf + i);
+ checksum += (((v & 0xFF) << 24) | ((v & 0xFF00) << 8) |
+ ((v & 0xFF0000) >> 8) | ((v & 0xFF000000) >> 24));
+ #elif (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__))
+- checksum += *reinterpret_cast<const uint32_t*>(buf + i);
++ checksum += v;
+ #else
+ checksum += (buf[i] << 24) | (buf[i + 1] << 16) |
+ (buf[i + 2] << 8) | buf[i + 3];
diff --git a/www/seamonkey/patches/patch-mozilla_moz.configure b/www/seamonkey/patches/patch-mozilla_moz.configure
new file mode 100644
index 00000000000..8cf5955e982
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_moz.configure
@@ -0,0 +1,35 @@
+$NetBSD: patch-mozilla_moz.configure,v 1.1 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/moz.configure.orig 2017-07-07 05:37:53.000000000 +0000
++++ mozilla/moz.configure
+@@ -278,6 +278,30 @@ check_prog('GENISOIMAGE', delayed_getatt
+ check_prog('RPMBUILD', delayed_getattr(extra_programs, 'RPMBUILD'),
+ allow_missing=True)
+
++option('--with-system-graphite2',
++ help="Use system graphite2 (located with pkgconfig)")
++
++@depends('--with-system-graphite2', compile_environment)
++def check_for_graphite2(value, compile_env):
++ return value and compile_env
++
++system_graphite2 = pkg_check_modules('MOZ_GRAPHITE2', 'graphite2',
++ check_for_graphite2)
++
++set_config('MOZ_SYSTEM_GRAPHITE2', system_graphite2)
++
++option('--with-system-harfbuzz',
++ help="Use system harfbuzz (located with pkgconfig)")
++
++@depends('--with-system-harfbuzz', compile_environment)
++def check_for_harfbuzz(value, compile_env):
++ return value and compile_env
++
++system_harfbuzz = pkg_check_modules('MOZ_HARFBUZZ', 'harfbuzz >= 1.2.6',
++ check_for_harfbuzz)
++
++set_config('MOZ_SYSTEM_HARFBUZZ', system_harfbuzz)
++
+ option('--enable-system-hunspell',
+ help="Use system hunspell (located with pkgconfig)")
+
diff --git a/www/seamonkey/patches/patch-mozilla_netwerk_dns_moz.build b/www/seamonkey/patches/patch-mozilla_netwerk_dns_moz.build
new file mode 100644
index 00000000000..3c2c69092ea
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_netwerk_dns_moz.build
@@ -0,0 +1,14 @@
+$NetBSD: patch-mozilla_netwerk_dns_moz.build,v 1.4 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/netwerk/dns/moz.build.orig 2017-07-07 05:37:31.000000000 +0000
++++ mozilla/netwerk/dns/moz.build
+@@ -66,6 +66,9 @@ LOCAL_INCLUDES += [
+ '/netwerk/base',
+ ]
+
++if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
++ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
++
+ if CONFIG['ENABLE_INTL_API']:
+ DEFINES['IDNA2008'] = True
+ USE_LIBS += ['icu']
diff --git a/www/seamonkey/patches/patch-mozilla_netwerk_protocol_http_Http2Session.cpp b/www/seamonkey/patches/patch-mozilla_netwerk_protocol_http_Http2Session.cpp
deleted file mode 100644
index e0f1f8c61f7..00000000000
--- a/www/seamonkey/patches/patch-mozilla_netwerk_protocol_http_Http2Session.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-$NetBSD: patch-mozilla_netwerk_protocol_http_Http2Session.cpp,v 1.4 2017/01/24 13:31:37 ryoon Exp $
-
-Fix an insecure connection error with NSS 3.28 or later in HTTP2 case
-https://hg.mozilla.org/mozilla-central/rev/361ac226da2a
-
---- mozilla/netwerk/protocol/http/Http2Session.cpp.orig 2016-12-14 02:10:00.000000000 +0000
-+++ mozilla/netwerk/protocol/http/Http2Session.cpp
-@@ -3542,8 +3542,8 @@ Http2Session::ConfirmTLSProfile()
- LOG3(("Http2Session::ConfirmTLSProfile %p FAILED due to DH %d < 2048\n",
- this, keybits));
- RETURN_SESSION_ERROR(this, INADEQUATE_SECURITY);
-- } else if (kea == ssl_kea_ecdh && keybits < 256) { // 256 bits is "security level" of 128
-- LOG3(("Http2Session::ConfirmTLSProfile %p FAILED due to ECDH %d < 256\n",
-+ } else if (kea == ssl_kea_ecdh && keybits < 224) { // see rfc7540 9.2.1.
-+ LOG3(("Http2Session::ConfirmTLSProfile %p FAILED due to ECDH %d < 224\n",
- this, keybits));
- RETURN_SESSION_ERROR(this, INADEQUATE_SECURITY);
- }
diff --git a/www/seamonkey/patches/patch-mozilla_old-configure.in b/www/seamonkey/patches/patch-mozilla_old-configure.in
index a4a56b8387a..9c1152817d1 100644
--- a/www/seamonkey/patches/patch-mozilla_old-configure.in
+++ b/www/seamonkey/patches/patch-mozilla_old-configure.in
@@ -1,8 +1,8 @@
-$NetBSD: patch-mozilla_old-configure.in,v 1.1 2017/01/01 16:14:08 ryoon Exp $
+$NetBSD: patch-mozilla_old-configure.in,v 1.2 2017/08/18 23:55:07 ryoon Exp $
---- mozilla/old-configure.in.orig 2016-12-14 02:10:00.000000000 +0000
+--- mozilla/old-configure.in.orig 2017-07-07 05:37:32.000000000 +0000
+++ mozilla/old-configure.in
-@@ -2489,11 +2489,7 @@ if test "$MOZ_SYSTEM_JPEG" = 1; then
+@@ -2195,11 +2195,7 @@ if test "$MOZ_SYSTEM_JPEG" = 1; then
#include <jpeglib.h> ],
[ #if JPEG_LIB_VERSION < $MOZJPEG
#error "Insufficient JPEG library version ($MOZJPEG required)."
@@ -15,7 +15,7 @@ $NetBSD: patch-mozilla_old-configure.in,v 1.1 2017/01/01 16:14:08 ryoon Exp $
MOZ_SYSTEM_JPEG=1,
AC_MSG_ERROR([Insufficient JPEG library version for --with-system-jpeg]))
fi
-@@ -3576,6 +3572,9 @@ if test -n "$MOZ_WEBRTC"; then
+@@ -2938,6 +2934,9 @@ if test -n "$MOZ_WEBRTC"; then
MOZ_RAW=1
MOZ_VPX_ERROR_CONCEALMENT=1
@@ -25,8 +25,17 @@ $NetBSD: patch-mozilla_old-configure.in,v 1.1 2017/01/01 16:14:08 ryoon Exp $
dnl enable once Signaling lands
MOZ_WEBRTC_SIGNALING=1
AC_DEFINE(MOZ_WEBRTC_SIGNALING)
-@@ -3718,6 +3717,155 @@ if test "${ac_cv_c_attribute_aligned}" !
- fi
+@@ -2980,7 +2979,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)
+@@ -3005,6 +3004,155 @@ fi
+ AC_SUBST(MOZ_RAW)
dnl ========================================================
+dnl Check for libogg
@@ -181,7 +190,224 @@ $NetBSD: patch-mozilla_old-configure.in,v 1.1 2017/01/01 16:14:08 ryoon Exp $
dnl = Apple platform decoder support
dnl ========================================================
if test "$COMPILE_ENVIRONMENT"; then
-@@ -3965,6 +4113,67 @@ AC_DEFINE(MOZ_WEBM_ENCODER)
+@@ -3088,6 +3236,216 @@ if test -n "$MOZ_OMX_PLUGIN"; then
+ fi
+ fi
+
++dnl ========================================================
++dnl Check for libogg
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-ogg,
++[ --with-system-ogg Use system libogg (located with pkgconfig)],
++MOZ_SYSTEM_OGG=1,
++MOZ_SYSTEM_OGG=)
++
++if test -n "$MOZ_SYSTEM_OGG"; then
++ PKG_CHECK_MODULES(MOZ_OGG, ogg >= 1.2.1)
++
++ _SAVE_LIBS=$LIBS
++ LIBS="$LIBS $MOZ_OGG_LIBS"
++ AC_CHECK_FUNC(ogg_set_mem_functions, [],
++ [AC_DEFINE(MOZ_OGG_NO_MEM_REPORTING)])
++ LIBS=$_SAVE_LIBS
++fi
++
++AC_SUBST(MOZ_SYSTEM_OGG)
++
++dnl ========================================================
++dnl Check for libvorbis
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-vorbis,
++[ --with-system-vorbis Use system libvorbis (located with pkgconfig)],
++MOZ_SYSTEM_VORBIS=1,
++MOZ_SYSTEM_VORBIS=)
++
++if test -n "$MOZ_SYSTEM_VORBIS"; then
++ PKG_CHECK_MODULES(MOZ_VORBIS, vorbis vorbisenc >= 1.3.5)
++fi
++
++AC_SUBST(MOZ_SYSTEM_VORBIS)
++
++dnl ========================================================
++dnl Check for integer-only libvorbis aka tremor
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-tremor,
++[ --with-system-tremor Use system libtremor (located with pkgconfig)],
++MOZ_SYSTEM_TREMOR=1,
++MOZ_SYSTEM_TREMOR=)
++
++if test -n "$MOZ_SYSTEM_TREMOR"; then
++ PKG_CHECK_MODULES(MOZ_TREMOR, vorbisidec >= 1.2.1)
++fi
++
++AC_SUBST(MOZ_SYSTEM_TREMOR)
++
++dnl ========================================================
++dnl Check for libtheora
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-theora,
++[ --with-system-theora Use system libtheora (located with pkgconfig)],
++MOZ_SYSTEM_THEORA=1,
++MOZ_SYSTEM_THEORA=)
++
++if test -n "$MOZ_SYSTEM_THEORA"; then
++ PKG_CHECK_MODULES(MOZ_THEORA, theora >= 1.2)
++fi
++
++AC_SUBST(MOZ_SYSTEM_THEORA)
++
++dnl ========================================================
++dnl Check for libSoundTouch
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-soundtouch,
++[ --with-system-soundtouch Use system libSoundTouch (located with pkgconfig)],
++MOZ_SYSTEM_SOUNDTOUCH=1,
++MOZ_SYSTEM_SOUNDTOUCH=)
++
++if test -n "$MOZ_SYSTEM_SOUNDTOUCH"; then
++ PKG_CHECK_MODULES(MOZ_SOUNDTOUCH, soundtouch >= 1.9.0)
++
++ AC_LANG_SAVE
++ AC_LANG_CPLUSPLUS
++ _SAVE_CXXFLAGS=$CXXFLAGS
++ CXXFLAGS="$CXXFLAGS $MOZ_SOUNDTOUCH_CFLAGS"
++ AC_CACHE_CHECK(for soundtouch sample type,
++ ac_cv_soundtouch_sample_type,
++ [AC_TRY_COMPILE([#include <SoundTouch.h>
++ #ifndef SOUNDTOUCH_INTEGER_SAMPLES
++ #error soundtouch expects float samples
++ #endif],
++ [],
++ [ac_cv_soundtouch_sample_type=short],
++ [ac_cv_soundtouch_sample_type=float])])
++ CXXFLAGS=$_SAVE_CXXFLAGS
++ AC_LANG_RESTORE
++
++ if test \( -n "$MOZ_SAMPLE_TYPE_S16" -a "$ac_cv_soundtouch_sample_type" != short \) \
++ -o \( -n "$MOZ_SAMPLE_TYPE_FLOAT32" -a "$ac_cv_soundtouch_sample_type" != float \) ; then
++ AC_MSG_ERROR([SoundTouch library is built with incompatible sample type. Either rebuild the library with/without --enable-integer-samples, chase default Mozilla sample type or remove --with-system-soundtouch.])
++ fi
++fi
++
++if test -n "$MOZ_SYSTEM_SOUNDTOUCH"; then
++ AC_DEFINE(MOZ_SYSTEM_SOUNDTOUCH)
++fi
++AC_SUBST(MOZ_SYSTEM_SOUNDTOUCH)
++
++dnl ========================================================
++dnl Check for libogg
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-ogg,
++[ --with-system-ogg Use system libogg (located with pkgconfig)],
++MOZ_SYSTEM_OGG=1,
++MOZ_SYSTEM_OGG=)
++
++if test -n "$MOZ_SYSTEM_OGG"; then
++ PKG_CHECK_MODULES(MOZ_OGG, ogg >= 1.2.1)
++
++ _SAVE_LIBS=$LIBS
++ LIBS="$LIBS $MOZ_OGG_LIBS"
++ AC_CHECK_FUNC(ogg_set_mem_functions, [],
++ [AC_DEFINE(MOZ_OGG_NO_MEM_REPORTING)])
++ LIBS=$_SAVE_LIBS
++fi
++
++AC_SUBST(MOZ_SYSTEM_OGG)
++
++dnl ========================================================
++dnl Check for libvorbis
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-vorbis,
++[ --with-system-vorbis Use system libvorbis (located with pkgconfig)],
++MOZ_SYSTEM_VORBIS=1,
++MOZ_SYSTEM_VORBIS=)
++
++if test -n "$MOZ_SYSTEM_VORBIS"; then
++ PKG_CHECK_MODULES(MOZ_VORBIS, vorbis vorbisenc >= 1.3.5)
++fi
++
++AC_SUBST(MOZ_SYSTEM_VORBIS)
++
++dnl ========================================================
++dnl Check for integer-only libvorbis aka tremor
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-tremor,
++[ --with-system-tremor Use system libtremor (located with pkgconfig)],
++MOZ_SYSTEM_TREMOR=1,
++MOZ_SYSTEM_TREMOR=)
++
++if test -n "$MOZ_SYSTEM_TREMOR"; then
++ PKG_CHECK_MODULES(MOZ_TREMOR, vorbisidec >= 1.2.1)
++fi
++
++AC_SUBST(MOZ_SYSTEM_TREMOR)
++
++dnl ========================================================
++dnl Check for libtheora
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-theora,
++[ --with-system-theora Use system libtheora (located with pkgconfig)],
++MOZ_SYSTEM_THEORA=1,
++MOZ_SYSTEM_THEORA=)
++
++if test -n "$MOZ_SYSTEM_THEORA"; then
++ PKG_CHECK_MODULES(MOZ_THEORA, theora >= 1.2)
++fi
++
++AC_SUBST(MOZ_SYSTEM_THEORA)
++
++dnl ========================================================
++dnl Check for libSoundTouch
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-soundtouch,
++[ --with-system-soundtouch Use system libSoundTouch (located with pkgconfig)],
++MOZ_SYSTEM_SOUNDTOUCH=1,
++MOZ_SYSTEM_SOUNDTOUCH=)
++
++if test -n "$MOZ_SYSTEM_SOUNDTOUCH"; then
++ PKG_CHECK_MODULES(MOZ_SOUNDTOUCH, soundtouch >= 1.9.0)
++
++ AC_LANG_SAVE
++ AC_LANG_CPLUSPLUS
++ _SAVE_CXXFLAGS=$CXXFLAGS
++ CXXFLAGS="$CXXFLAGS $MOZ_SOUNDTOUCH_CFLAGS"
++ AC_CACHE_CHECK(for soundtouch sample type,
++ ac_cv_soundtouch_sample_type,
++ [AC_TRY_COMPILE([#include <SoundTouch.h>
++ #ifndef SOUNDTOUCH_INTEGER_SAMPLES
++ #error soundtouch expects float samples
++ #endif],
++ [],
++ [ac_cv_soundtouch_sample_type=short],
++ [ac_cv_soundtouch_sample_type=float])])
++ CXXFLAGS=$_SAVE_CXXFLAGS
++ AC_LANG_RESTORE
++
++ if test \( -n "$MOZ_SAMPLE_TYPE_S16" -a "$ac_cv_soundtouch_sample_type" != short \) \
++ -o \( -n "$MOZ_SAMPLE_TYPE_FLOAT32" -a "$ac_cv_soundtouch_sample_type" != float \) ; then
++ AC_MSG_ERROR([SoundTouch library is built with incompatible sample type. Either rebuild the library with/without --enable-integer-samples, chase default Mozilla sample type or remove --with-system-soundtouch.])
++ fi
++fi
++
++if test -n "$MOZ_SYSTEM_SOUNDTOUCH"; then
++ AC_DEFINE(MOZ_SYSTEM_SOUNDTOUCH)
++fi
++AC_SUBST(MOZ_SYSTEM_SOUNDTOUCH)
++
+ dnl system libvpx Support
+ dnl ========================================================
+ MOZ_ARG_WITH_BOOL(system-libvpx,
+@@ -3252,6 +3610,67 @@ AC_DEFINE(MOZ_WEBM_ENCODER)
AC_SUBST(MOZ_WEBM_ENCODER)
dnl ==================================
@@ -190,7 +416,7 @@ $NetBSD: patch-mozilla_old-configure.in,v 1.1 2017/01/01 16:14:08 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
@@ -213,7 +439,7 @@ $NetBSD: patch-mozilla_old-configure.in,v 1.1 2017/01/01 16:14:08 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
@@ -230,7 +456,7 @@ $NetBSD: patch-mozilla_old-configure.in,v 1.1 2017/01/01 16:14:08 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
@@ -249,7 +475,7 @@ $NetBSD: patch-mozilla_old-configure.in,v 1.1 2017/01/01 16:14:08 ryoon Exp $
dnl = Check alsa availability on Linux
dnl ==================================
-@@ -3978,12 +4187,23 @@ MOZ_ARG_ENABLE_BOOL(alsa,
+@@ -3265,12 +3684,23 @@ MOZ_ARG_ENABLE_BOOL(alsa,
MOZ_ALSA=1,
MOZ_ALSA=)
@@ -273,3 +499,31 @@ $NetBSD: patch-mozilla_old-configure.in,v 1.1 2017/01/01 16:14:08 ryoon Exp $
AC_SUBST(MOZ_ALSA)
dnl ========================================================
+@@ -5220,6 +5650,27 @@ if test "$USE_FC_FREETYPE"; then
+ fi
+
+ dnl ========================================================
++dnl Check for graphite2
++dnl ========================================================
++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,3,8)
++ #error "Insufficient graphite2 version."
++ #endif
++ ], [],
++ [AC_MSG_ERROR([--with-system-graphite2 requested but no working libgraphite2 found])])
++ CFLAGS=$_SAVE_CFLAGS
++fi
++
++dnl ========================================================
+ dnl Check for pixman and cairo
+ dnl ========================================================
+
diff --git a/www/seamonkey/patches/patch-mozilla_ostream b/www/seamonkey/patches/patch-mozilla_ostream
new file mode 100644
index 00000000000..1f56300ee62
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_ostream
@@ -0,0 +1,8 @@
+$NetBSD: patch-mozilla_ostream,v 1.7 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/ostream.orig 2017-08-18 14:25:23.037964312 +0000
++++ mozilla/ostream
+@@ -0,0 +1,3 @@
++#pragma GCC visibility push(default)
++#include_next <ostream>
++#pragma GCC visibility pop
diff --git a/www/seamonkey/patches/patch-mozilla_toolkit_components_osfile_modules_osfile__unix__back.jsm b/www/seamonkey/patches/patch-mozilla_toolkit_components_osfile_modules_osfile__unix__back.jsm
new file mode 100644
index 00000000000..501c8577c8e
--- /dev/null
+++ b/www/seamonkey/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.6 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/toolkit/components/osfile/modules/osfile_unix_back.jsm.orig 2017-07-07 05:31:58.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/www/seamonkey/patches/patch-mozilla_toolkit_components_osfile_modules_osfile__unix__front.jsm b/www/seamonkey/patches/patch-mozilla_toolkit_components_osfile_modules_osfile__unix__front.jsm
new file mode 100644
index 00000000000..7986dd4794c
--- /dev/null
+++ b/www/seamonkey/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.5 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/toolkit/components/osfile/modules/osfile_unix_front.jsm.orig 2017-07-07 05:38:21.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/www/seamonkey/patches/patch-mozilla_toolkit_library_moz.build b/www/seamonkey/patches/patch-mozilla_toolkit_library_moz.build
index 78961b05692..b850c17da54 100644
--- a/www/seamonkey/patches/patch-mozilla_toolkit_library_moz.build
+++ b/www/seamonkey/patches/patch-mozilla_toolkit_library_moz.build
@@ -1,16 +1,8 @@
-$NetBSD: patch-mozilla_toolkit_library_moz.build,v 1.5 2017/01/01 16:14:08 ryoon Exp $
+$NetBSD: patch-mozilla_toolkit_library_moz.build,v 1.6 2017/08/18 23:55:07 ryoon Exp $
---- mozilla/toolkit/library/moz.build.orig 2016-12-14 02:09:56.000000000 +0000
+--- mozilla/toolkit/library/moz.build.orig 2017-07-07 05:38:25.000000000 +0000
+++ mozilla/toolkit/library/moz.build
-@@ -210,6 +210,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']
- OS_LIBS += CONFIG['MOZ_SERVO_LIBS']
-
-@@ -222,6 +223,30 @@ if CONFIG['MOZ_SYSTEM_PNG']:
+@@ -237,6 +237,21 @@ if CONFIG['MOZ_SYSTEM_PNG']:
if CONFIG['MOZ_SYSTEM_HUNSPELL']:
OS_LIBS += CONFIG['MOZ_HUNSPELL_LIBS']
@@ -26,22 +18,13 @@ $NetBSD: patch-mozilla_toolkit_library_moz.build,v 1.5 2017/01/01 16:14:08 ryoon
+if CONFIG['MOZ_SYSTEM_TREMOR']:
+ OS_LIBS += CONFIG['MOZ_TREMOR_LIBS']
+
-+if CONFIG['MOZ_SYSTEM_CELT']:
-+ OS_LIBS += CONFIG['MOZ_CELT_LIBS']
-+
-+if CONFIG['MOZ_SYSTEM_OPUS']:
-+ OS_LIBS += CONFIG['MOZ_OPUS_LIBS']
-+
-+if CONFIG['MOZ_SYSTEM_SPEEX']:
-+ OS_LIBS += CONFIG['MOZ_SPEEX_LIBS']
-+
+if CONFIG['MOZ_SYSTEM_SOUNDTOUCH']:
+ OS_LIBS += CONFIG['MOZ_SOUNDTOUCH_LIBS']
+
if CONFIG['MOZ_SYSTEM_LIBEVENT']:
OS_LIBS += CONFIG['MOZ_LIBEVENT_LIBS']
-@@ -234,6 +259,9 @@ if not CONFIG['MOZ_TREE_PIXMAN']:
+@@ -249,6 +264,9 @@ if not CONFIG['MOZ_TREE_PIXMAN']:
if CONFIG['MOZ_ALSA']:
OS_LIBS += CONFIG['MOZ_ALSA_LIBS']
diff --git a/www/seamonkey/patches/patch-mozilla_unwind.h b/www/seamonkey/patches/patch-mozilla_unwind.h
new file mode 100644
index 00000000000..0b1b41a150c
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_unwind.h
@@ -0,0 +1,9 @@
+$NetBSD: patch-mozilla_unwind.h,v 1.7 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/unwind.h.orig 2017-08-18 14:25:23.038713577 +0000
++++ mozilla/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/www/seamonkey/patches/patch-mozilla_xpcom_build_XPCOMInit.cpp b/www/seamonkey/patches/patch-mozilla_xpcom_build_XPCOMInit.cpp
new file mode 100644
index 00000000000..48ea15fe682
--- /dev/null
+++ b/www/seamonkey/patches/patch-mozilla_xpcom_build_XPCOMInit.cpp
@@ -0,0 +1,28 @@
+$NetBSD: patch-mozilla_xpcom_build_XPCOMInit.cpp,v 1.4 2017/08/18 23:55:07 ryoon Exp $
+
+--- mozilla/xpcom/build/XPCOMInit.cpp.orig 2017-07-07 05:38:29.000000000 +0000
++++ mozilla/xpcom/build/XPCOMInit.cpp
+@@ -137,7 +137,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
+@@ -658,11 +660,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/www/seamonkey/patches/patch-mozilla_xpcom_reflect_xptcall_md_unix_moz.build b/www/seamonkey/patches/patch-mozilla_xpcom_reflect_xptcall_md_unix_moz.build
index ad378c356d1..10b12e6faa0 100644
--- a/www/seamonkey/patches/patch-mozilla_xpcom_reflect_xptcall_md_unix_moz.build
+++ b/www/seamonkey/patches/patch-mozilla_xpcom_reflect_xptcall_md_unix_moz.build
@@ -1,13 +1,13 @@
-$NetBSD: patch-mozilla_xpcom_reflect_xptcall_md_unix_moz.build,v 1.5 2017/01/01 16:14:08 ryoon Exp $
+$NetBSD: patch-mozilla_xpcom_reflect_xptcall_md_unix_moz.build,v 1.6 2017/08/18 23:55:07 ryoon Exp $
---- mozilla/xpcom/reflect/xptcall/md/unix/moz.build.orig 2016-12-14 02:10:01.000000000 +0000
+--- mozilla/xpcom/reflect/xptcall/md/unix/moz.build.orig 2017-07-07 05:38:29.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':
+@@ -145,7 +145,7 @@ if CONFIG['OS_ARCH'] == 'NetBSD':
+ 'xptcstubs_netbsd_m68k.cpp'
+ ]
+
+-if CONFIG['OS_ARCH'] == 'Linux':
++if CONFIG['OS_ARCH'] in ('Linux', 'FreeBSD', 'NetBSD', 'OpenBSD'):
+ if CONFIG['OS_TEST'] == 'aarch64':
SOURCES += [
- '!xptcstubs_asm_ppc_darwin.s',
- 'xptcinvoke_asm_ppc_rhapsody.s',
+ 'xptcinvoke_aarch64.cpp',