summaryrefslogtreecommitdiff
path: root/www/firefox24/patches
diff options
context:
space:
mode:
authorryoon <ryoon@pkgsrc.org>2013-11-03 04:51:59 +0000
committerryoon <ryoon@pkgsrc.org>2013-11-03 04:51:59 +0000
commit6253c7806bf1d9292b18a51d5c92608d96e7860b (patch)
treea34d541b9214967bfe9a09c21cb30fe0c82e6b07 /www/firefox24/patches
parente7d39d6b344e28bae19336645b615aa2dd32dbf4 (diff)
downloadpkgsrc-6253c7806bf1d9292b18a51d5c92608d96e7860b.tar.gz
Import firefox24-24.1.0 as www/firefox24.
Mozilla Firefox is a free, open-source and cross-platform web browser for Windows, Linux, MacOS X and many other operating systems. It is fast and easy to use, and offers many advantages over other web browsers, such as tabbed browsing and the ability to block pop-up windows. Firefox also offers excellent bookmark and history management, and it can be extended by developers using industry standards such as XML, CSS, JavaScript, C++, etc. Many extensions are available. This package tracks 24 extended support release branch.
Diffstat (limited to 'www/firefox24/patches')
-rw-r--r--www/firefox24/patches/patch-aa244
-rw-r--r--www/firefox24/patches/patch-ak13
-rw-r--r--www/firefox24/patches/patch-al16
-rw-r--r--www/firefox24/patches/patch-ao15
-rw-r--r--www/firefox24/patches/patch-as141
-rw-r--r--www/firefox24/patches/patch-bf13
-rw-r--r--www/firefox24/patches/patch-bg24
-rw-r--r--www/firefox24/patches/patch-bi12
-rw-r--r--www/firefox24/patches/patch-browser_app_profile_firefox.js12
-rw-r--r--www/firefox24/patches/patch-browser_installer_package-manifest.in15
-rw-r--r--www/firefox24/patches/patch-browser_locales_en-US_chrome_browser-region_region.properties12
-rw-r--r--www/firefox24/patches/patch-browser_locales_en-US_searchplugins_duckduckgo.xml16
-rw-r--r--www/firefox24/patches/patch-browser_locales_en-US_searchplugins_list.txt11
-rw-r--r--www/firefox24/patches/patch-build_autoconf_nss.m446
-rw-r--r--www/firefox24/patches/patch-build_pgo_profileserver.py13
-rw-r--r--www/firefox24/patches/patch-config_Makefile.in12
-rw-r--r--www/firefox24/patches/patch-config_baseconfig.mk18
-rw-r--r--www/firefox24/patches/patch-config_stl__wrappers_ios8
-rw-r--r--www/firefox24/patches/patch-config_stl__wrappers_ostream8
-rw-r--r--www/firefox24/patches/patch-config_system-headers19
-rw-r--r--www/firefox24/patches/patch-config_system__wrappers_unwind.h9
-rw-r--r--www/firefox24/patches/patch-content_media_gstreamer_GStreamerFormatHelper.cpp166
-rw-r--r--www/firefox24/patches/patch-dom_plugins_ipc_PluginModuleChild.cpp31
-rw-r--r--www/firefox24/patches/patch-dom_plugins_ipc_PluginModuleChild.h13
-rw-r--r--www/firefox24/patches/patch-extensions_auth_nsAuthGSSAPI.cpp14
-rw-r--r--www/firefox24/patches/patch-extensions_spellcheck_hunspell_src_mozHunspell.cpp17
-rw-r--r--www/firefox24/patches/patch-gfx__skia__include__core__SkPreConfig.h16
-rw-r--r--www/firefox24/patches/patch-gfx_graphite2_src_Bidi.cpp16
-rw-r--r--www/firefox24/patches/patch-gfx_skia_moz.build16
-rw-r--r--www/firefox24/patches/patch-gfx_skia_src_sfnt_SkOTTable__head.h24
-rw-r--r--www/firefox24/patches/patch-gfx_skia_src_sfnt_SkOTTable__name.h24
-rw-r--r--www/firefox24/patches/patch-gfx_skia_src_sfnt_SkSFNTHeader.h24
-rw-r--r--www/firefox24/patches/patch-image_decoders_nsJPEGDecoder.cpp363
-rw-r--r--www/firefox24/patches/patch-intl_hyphenation_src_hnjalloc.h14
-rw-r--r--www/firefox24/patches/patch-ipc_chromium_Makefile.in49
-rw-r--r--www/firefox24/patches/patch-ipc_chromium_chromium-config.mk25
-rw-r--r--www/firefox24/patches/patch-ipc_chromium_src_base_base__paths.h13
-rw-r--r--www/firefox24/patches/patch-ipc_chromium_src_base_debug__util__posix.cc13
-rw-r--r--www/firefox24/patches/patch-ipc_chromium_src_base_file__util.h23
-rw-r--r--www/firefox24/patches/patch-ipc_chromium_src_base_file__util__posix.cc58
-rw-r--r--www/firefox24/patches/patch-ipc_chromium_src_base_file__version__info.h15
-rw-r--r--www/firefox24/patches/patch-ipc_chromium_src_base_message__pump__libevent.cc13
-rw-r--r--www/firefox24/patches/patch-ipc_chromium_src_base_platform__thread.h14
-rw-r--r--www/firefox24/patches/patch-ipc_chromium_src_base_platform__thread__posix.cc24
-rw-r--r--www/firefox24/patches/patch-ipc_chromium_src_base_process__util.h32
-rw-r--r--www/firefox24/patches/patch-ipc_chromium_src_base_process__util__posix.cc22
-rw-r--r--www/firefox24/patches/patch-ipc_chromium_src_base_sys__info__posix.cc40
-rw-r--r--www/firefox24/patches/patch-ipc_chromium_src_base_time__posix.cc15
-rw-r--r--www/firefox24/patches/patch-ipc_chromium_src_build_build__config.h22
-rw-r--r--www/firefox24/patches/patch-ipc_chromium_src_chrome_common_transport__dib.h13
-rw-r--r--www/firefox24/patches/patch-ipc_glue_AsyncChannel.cpp22
-rw-r--r--www/firefox24/patches/patch-ipc_glue_GeckoChildProcessHost.cpp54
-rw-r--r--www/firefox24/patches/patch-ipc_ipdl_ipdl_lower.py13
-rw-r--r--www/firefox24/patches/patch-js__src__vm__SPSProfiler.cpp16
-rw-r--r--www/firefox24/patches/patch-js_src_Makefile.in62
-rw-r--r--www/firefox24/patches/patch-js_src_config_Makefile.in12
-rw-r--r--www/firefox24/patches/patch-js_src_config_system-headers19
-rw-r--r--www/firefox24/patches/patch-js_src_ctypes_CTypes.h28
-rw-r--r--www/firefox24/patches/patch-js_src_frontend_ParseMaps.cpp12
-rw-r--r--www/firefox24/patches/patch-js_src_gdb_Makefile.in15
-rw-r--r--www/firefox24/patches/patch-js_src_jit_AsmJSSignalHandlers.cpp28
-rw-r--r--www/firefox24/patches/patch-js_src_jsapi-tests_Makefile.in15
-rw-r--r--www/firefox24/patches/patch-js_src_jscompartment.h16
-rw-r--r--www/firefox24/patches/patch-js_src_jsmath.cpp13
-rw-r--r--www/firefox24/patches/patch-js_src_shell_Makefile.in14
-rw-r--r--www/firefox24/patches/patch-js_src_vm_ObjectImpl-inl.h31
-rw-r--r--www/firefox24/patches/patch-mb27
-rw-r--r--www/firefox24/patches/patch-media_libpng_pngpriv.h12
-rw-r--r--www/firefox24/patches/patch-media_libsoundtouch_src_cpu__detect__x86.cpp14
-rw-r--r--www/firefox24/patches/patch-media_mtransport_objs.mk22
-rw-r--r--www/firefox24/patches/patch-media_mtransport_test_Makefile.in20
-rw-r--r--www/firefox24/patches/patch-media_mtransport_third__party_nICEr_nicer.gyp33
-rw-r--r--www/firefox24/patches/patch-media_mtransport_third__party_nICEr_src_stun_addrs.c36
-rw-r--r--www/firefox24/patches/patch-media_mtransport_third__party_nICEr_src_stun_stun.h20
-rw-r--r--www/firefox24/patches/patch-media_mtransport_third__party_nICEr_src_util_mbslen.c78
-rw-r--r--www/firefox24/patches/patch-media_mtransport_third__party_nrappkit_nrappkit.gyp32
-rw-r--r--www/firefox24/patches/patch-media_mtransport_third__party_nrappkit_src_log_r__log.c12
-rw-r--r--www/firefox24/patches/patch-media_mtransport_third__party_nrappkit_src_port_generic_include_sys_queue.h13
-rw-r--r--www/firefox24/patches/patch-media_mtransport_third__party_nrappkit_src_util_util.c12
-rw-r--r--www/firefox24/patches/patch-media_webrtc_signaling_signaling.gyp49
-rw-r--r--www/firefox24/patches/patch-media_webrtc_signaling_src_sipcc_cpr_darwin_cpr__darwin__ipc.c20
-rw-r--r--www/firefox24/patches/patch-media_webrtc_signaling_test_Makefile.in21
-rw-r--r--www/firefox24/patches/patch-media_webrtc_trunk_build_build__config.h41
-rw-r--r--www/firefox24/patches/patch-media_webrtc_trunk_tools_gyp_pylib_gyp_generator_mozmake.py55
-rw-r--r--www/firefox24/patches/patch-media_webrtc_trunk_webrtc_build_common.gypi25
-rw-r--r--www/firefox24/patches/patch-media_webrtc_trunk_webrtc_modules_audio__device_audio__device__impl.cc71
-rw-r--r--www/firefox24/patches/patch-media_webrtc_trunk_webrtc_modules_audio__device_test_audio__device__test__api.cc31
-rw-r--r--www/firefox24/patches/patch-media_webrtc_trunk_webrtc_modules_video__capture_linux_device__info__linux.cc47
-rw-r--r--www/firefox24/patches/patch-media_webrtc_trunk_webrtc_modules_video__capture_linux_video__capture__linux.cc30
-rw-r--r--www/firefox24/patches/patch-media_webrtc_trunk_webrtc_modules_video__capture_video__capture.gypi31
-rw-r--r--www/firefox24/patches/patch-media_webrtc_trunk_webrtc_modules_video__capture_video__capture__factory.cc15
-rw-r--r--www/firefox24/patches/patch-media_webrtc_trunk_webrtc_system__wrappers_source_condition__variable.cc13
-rw-r--r--www/firefox24/patches/patch-media_webrtc_trunk_webrtc_system__wrappers_source_spreadsortlib_spreadsort.hpp18
-rw-r--r--www/firefox24/patches/patch-media_webrtc_trunk_webrtc_system__wrappers_source_thread__posix.cc48
-rw-r--r--www/firefox24/patches/patch-memory_mozalloc_mozalloc__abort.cpp16
-rw-r--r--www/firefox24/patches/patch-mfbt_Atomics.h13
-rw-r--r--www/firefox24/patches/patch-mfbt_Poison.cpp20
-rw-r--r--www/firefox24/patches/patch-modules_libjar_nsZipArchive.cpp15
-rw-r--r--www/firefox24/patches/patch-modules_libpref_src_init_all.js13
-rw-r--r--www/firefox24/patches/patch-netwerk_sctp_src_netinet6_sctp6__usrreq.c13
-rw-r--r--www/firefox24/patches/patch-netwerk_sctp_src_netinet_sctp__os__userspace.h41
-rw-r--r--www/firefox24/patches/patch-netwerk_sctp_src_netinet_sctp__usrreq.c13
-rw-r--r--www/firefox24/patches/patch-netwerk_sctp_src_user__recv__thread.c13
-rw-r--r--www/firefox24/patches/patch-netwerk_sctp_src_user__socket.c53
-rw-r--r--www/firefox24/patches/patch-netwerk_sctp_src_user__socketvar.h27
-rw-r--r--www/firefox24/patches/patch-netwerk_wifi_Makefile.in13
-rw-r--r--www/firefox24/patches/patch-netwerk_wifi_moz.build24
-rw-r--r--www/firefox24/patches/patch-netwerk_wifi_nsWifiScannerFreeBSD.cpp177
-rw-r--r--www/firefox24/patches/patch-pb11
-rw-r--r--www/firefox24/patches/patch-pc12
-rw-r--r--www/firefox24/patches/patch-rc14
-rw-r--r--www/firefox24/patches/patch-security_manager_ssl_src_JARSignatureVerification.cpp17
-rw-r--r--www/firefox24/patches/patch-security_manager_ssl_src_nsNSSComponent.cpp12
-rw-r--r--www/firefox24/patches/patch-toolkit_components_osfile_osfile__unix__allthreads.jsm13
-rw-r--r--www/firefox24/patches/patch-toolkit_library_Makefile.in12
-rw-r--r--www/firefox24/patches/patch-toolkit_mozapps_update_updater_updater.cpp16
-rw-r--r--www/firefox24/patches/patch-toolkit_toolkit.mozbuild13
-rw-r--r--www/firefox24/patches/patch-toolkit_xre_Makefile.in10
-rw-r--r--www/firefox24/patches/patch-toolkit_xre_nsEmbedFunctions.cpp22
-rw-r--r--www/firefox24/patches/patch-xb91
-rw-r--r--www/firefox24/patches/patch-xc73
-rw-r--r--www/firefox24/patches/patch-xe75
-rw-r--r--www/firefox24/patches/patch-xf43
-rw-r--r--www/firefox24/patches/patch-xg33
-rw-r--r--www/firefox24/patches/patch-xj128
-rw-r--r--www/firefox24/patches/patch-xk72
-rw-r--r--www/firefox24/patches/patch-xl74
-rw-r--r--www/firefox24/patches/patch-xm49
-rw-r--r--www/firefox24/patches/patch-xn52
-rw-r--r--www/firefox24/patches/patch-xo52
-rw-r--r--www/firefox24/patches/patch-xpcom_base_nsStackWalk.cpp13
-rw-r--r--www/firefox24/patches/patch-xpcom_ds_TimeStamp.h20
-rw-r--r--www/firefox24/patches/patch-xpcom_ds_moz.build24
-rw-r--r--www/firefox24/patches/patch-xpcom_reflect_xptcall_src_md_unix_moz.build23
-rw-r--r--www/firefox24/patches/patch-xpcom_reflect_xptcall_src_md_unix_xptcinvoke__gcc__x86__unix.cpp13
-rw-r--r--www/firefox24/patches/patch-xpcom_reflect_xptcall_src_md_unix_xptcstubs__gcc__x86__unix.cpp13
-rw-r--r--www/firefox24/patches/patch-xpcom_string_public_nsAlgorithm.h16
-rw-r--r--www/firefox24/patches/patch-xulrunner_installer_Makefile.in15
138 files changed, 4504 insertions, 0 deletions
diff --git a/www/firefox24/patches/patch-aa b/www/firefox24/patches/patch-aa
new file mode 100644
index 00000000000..347be79aca5
--- /dev/null
+++ b/www/firefox24/patches/patch-aa
@@ -0,0 +1,244 @@
+$NetBSD: patch-aa,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- configure.in.orig 2013-09-10 03:43:23.000000000 +0000
++++ configure.in
+@@ -1370,6 +1370,17 @@ if test "$GNU_CC"; then
+ CFLAGS=$_SAVE_CFLAGS
+ AC_SUBST(HAVE_TOOLCHAIN_SUPPORT_MSSE4_1)
+
++ # Check for -msse4.1 on $CC
++ AC_MSG_CHECKING([if toolchain supports -msse4.1 option])
++ HAVE_TOOLCHAIN_SUPPORT_MSSE4_1=
++ _SAVE_CFLAGS=$CFLAGS
++ CFLAGS="$CFLAGS -msse4.1"
++ AC_TRY_COMPILE([asm ("pmulld %xmm6,%xmm0");],,AC_MSG_RESULT([yes])
++ [HAVE_TOOLCHAIN_SUPPORT_MSSE4_1=1],
++ AC_MSG_RESULT([no]))
++ CFLAGS=$_SAVE_CFLAGS
++ AC_SUBST(HAVE_TOOLCHAIN_SUPPORT_MSSE4_1)
++
+ # Turn on GNU-specific warnings:
+ # -Wall - turn on a lot of warnings
+ # -Wpointer-arith - good to have
+@@ -2047,6 +2058,9 @@ ia64*-hpux*)
+ if test -z "$MC"; then
+ MC=mc.exe
+ fi
++ if test "$LIBRUNPATH"; then
++ DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
++ fi
+ ;;
+ *-mingw*)
+ DSO_CFLAGS=
+@@ -2843,6 +2857,7 @@ EOF
+ #pragma GCC visibility push(hidden)
+ #pragma GCC visibility push(default)
+ #include <string.h>
++#include <iterator>
+ #pragma GCC visibility pop
+
+ __attribute__ ((visibility ("default"))) void Func() {
+@@ -2851,7 +2866,7 @@ __attribute__ ((visibility ("default")))
+ }
+ EOF
+ ac_cv_have_visibility_builtin_bug=no
+- if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
++ if ! ${CXX-c++} ${CXXFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
+ ac_cv_have_visibility_builtin_bug=yes
+ else
+ if test `grep -c "@PLT" conftest.S` = 0; then
+@@ -3017,6 +3032,9 @@ dnl ====================================
+ case $target in
+ *-hpux11.*)
+ ;;
++*-dragonfly*)
++ AC_CHECK_LIB(c, gethostbyname_r)
++ ;;
+ *)
+ AC_CHECK_LIB(c_r, gethostbyname_r)
+ ;;
+@@ -3319,6 +3337,9 @@ AC_CACHE_CHECK(
+ #ifdef linux
+ #define _BSD_SOURCE 1
+ #endif
++ #ifdef __NetBSD__
++ #error use of global _res variable in threaded programs is not portable
++ #endif
+ #include <resolv.h>
+ ],
+ [int foo = res_ninit(&_res);],
+@@ -3973,6 +3994,14 @@ if test -n "$YASM"; then
+ _YASM_BUILD=` echo ${YASM_VERSION} | $AWK -F\. '{ print $4 }'`
+ fi
+
++if test -n "${LIBXUL_SDK_DIR}"; then
++ AC_MSG_WARN([pkgsrc: LIBXUL_SDK_DIR is set; assuming we want nss and nspr from xulrunner.])
++ NSPR_CFLAGS="-I${prefix}/include/xulrunner/unstable `pkg-config --cflags mozilla-nspr`"
++ NSPR_LIBS="`pkg-config --libs mozilla-nspr`"
++ NSS_CFLAGS="`pkg-config --cflags mozilla-nss`"
++ NSS_LIBS="`pkg-config --libs mozilla-nss`"
++fi
++
+ if test -z "$SKIP_LIBRARY_CHECKS"; then
+ dnl system JPEG support
+ dnl ========================================================
+@@ -4000,11 +4029,7 @@ if test "$MOZ_NATIVE_JPEG" = 1; then
+ #include <jpeglib.h> ],
+ [ #if JPEG_LIB_VERSION < $MOZJPEG
+ #error "Insufficient JPEG library version ($MOZJPEG required)."
+- #endif
+- #ifndef JCS_EXTENSIONS
+- #error "libjpeg-turbo JCS_EXTENSIONS required"
+- #endif
+- ],
++ #endif ],
+ MOZ_NATIVE_JPEG=1,
+ AC_MSG_ERROR([Insufficient JPEG library version for --with-system-jpeg]))
+ fi
+@@ -4139,6 +4164,22 @@ if test -n "$MOZ_NATIVE_FFI"; then
+ fi
+
+ dnl ========================================================
++dnl system icu support
++dnl ========================================================
++MOZ_NATIVE_ICU=
++MOZ_ARG_WITH_BOOL(system-icu,
++[ --with-system-icu
++ Use system icu (located with pkgconfig)],
++ MOZ_NATIVE_ICU=1)
++
++if test -n "$MOZ_NATIVE_ICU"; then
++ PKG_CHECK_MODULES(MOZ_ICU, icu-i18n >= 50.1)
++ MOZ_JS_STATIC_LIBS="$MOZ_JS_STATIC_LIBS $MOZ_ICU_LIBS"
++fi
++
++AC_SUBST(MOZ_NATIVE_ICU)
++
++dnl ========================================================
+ dnl Java SDK support
+ dnl ========================================================
+
+@@ -5297,7 +5338,7 @@ dnl --enable-webrtc to override. Can di
+ dnl the master list above.
+ if test -n "$MOZ_WEBRTC"; then
+ case "$target" in
+- *-linux*|*-mingw*|*-darwin*|*-android*|*-linuxandroid*)
++ *-linux*|*-mingw*|*-darwin*|*-android*|*-linuxandroid*|*-dragonfly*|*-freebsd*|*-netbsd*|*-openbsd*)
+ dnl Leave enabled
+ ;;
+ *)
+@@ -5353,6 +5394,9 @@ if test -n "$MOZ_WEBRTC"; then
+ MOZ_VP8_ENCODER=1
+ MOZ_VP8_ERROR_CONCEALMENT=1
+
++ dnl with libv4l2 we can support more cameras
++ PKG_CHECK_MODULES(MOZ_LIBV4L2, libv4l2)
++
+ dnl enable once Signaling lands
+ MOZ_WEBRTC_SIGNALING=1
+ AC_DEFINE(MOZ_WEBRTC_SIGNALING)
+@@ -5379,15 +5423,18 @@ AC_SUBST(MOZ_SRTP)
+
+ dnl Use integers over floats for audio on B2G and Android, because audio
+ dnl backends for those platforms don't support floats.
+-if test "$OS_TARGET" = "Android"; then
++case "$target" in
++*-android*|*-linuxandroid*|*-dragonfly*|*-freebsd*|*-netbsd*|*-openbsd*)
+ MOZ_SAMPLE_TYPE_S16=1
+ AC_DEFINE(MOZ_SAMPLE_TYPE_S16)
+ AC_SUBST(MOZ_SAMPLE_TYPE_S16)
+-else
++;;
++*)
+ MOZ_SAMPLE_TYPE_FLOAT32=1
+ AC_DEFINE(MOZ_SAMPLE_TYPE_FLOAT32)
+ AC_SUBST(MOZ_SAMPLE_TYPE_FLOAT32)
+-fi
++;;
++esac
+
+ dnl ========================================================
+ dnl = Disable Speech API code
+@@ -5737,7 +5784,7 @@ MOZ_ALSA=)
+
+ if test -n "$MOZ_ALSA"; then
+ AC_DEFINE(MOZ_CUBEB)
+- PKG_CHECK_MODULES(MOZ_ALSA, alsa, ,
++ PKG_CHECK_MODULES(MOZ_ALSA, alsa, MOZ_ALSA=1,
+ [echo "$MOZ_ALSA_PKG_ERRORS"
+ AC_MSG_ERROR([Need alsa for Ogg, Wave or WebM decoding on Linux. Disable with --disable-ogg --disable-wave --disable-webm. (On Ubuntu, you might try installing the package libasound2-dev.)])])
+ fi
+@@ -8385,7 +8432,7 @@ if test "$MOZ_ENABLE_SKIA"; then
+ AC_DEFINE(GR_DLL)
+ fi
+
+- if test "${CPU_ARCH}" != "ppc" -a "${CPU_ARCH}" != "ppc64"; then
++ if test "${CPU_ARCH}" != "ppc" -a "${CPU_ARCH}" != "ppc64" -a "${CPU_ARCH}" != "sparc"; then
+ MOZ_ENABLE_SKIA_GPU=1
+ AC_DEFINE(USE_SKIA_GPU)
+ AC_SUBST(MOZ_ENABLE_SKIA_GPU)
+@@ -8466,16 +8513,26 @@ MOZ_ARG_DISABLE_BOOL(necko-wifi,
+ NECKO_WIFI=,
+ NECKO_WIFI=1)
+
+-if test "$OS_ARCH" = "OS2"; then
+- dnl OS/2 implementation of Necko-WiFi support will be added in bug 506566
+- NECKO_WIFI=
+-fi
+-if test "$NECKO_WIFI" -a \
+- "$OS_ARCH" != "Linux" -a \
+- "$OS_ARCH" != "Darwin" -a \
+- "$OS_ARCH" != "SunOS" -a \
+- "$OS_ARCH" != "WINNT"; then
+- AC_MSG_ERROR([Necko WiFi scanning not supported on your platform, use --disable-necko-wifi])
++if test "$NECKO_WIFI"; then
++ case "$OS_TARGET" in
++ Android)
++ ;;
++ Darwin)
++ ;;
++ SunOS)
++ ;;
++ WINNT)
++ ;;
++ OS2)
++ dnl OS/2 implementation of Necko-WiFi support will be added in bug 506566
++ NECKO_WIFI=
++ ;;
++ *)
++ if test -z "$MOZ_ENABLE_DBUS"; then
++ AC_MSG_ERROR([Necko WiFi scanning needs DBus on your platform, remove --disable-dbus or use --disable-necko-wifi])
++ fi
++ ;;
++ esac
+ fi
+
+ if test "$NECKO_WIFI"; then
+@@ -9186,6 +9243,27 @@ if test -z "$HAVE_TOOLCHAIN_SUPPORT_SSSE
+ EXTRA_GYP_DEFINES="$EXTRA_GYP_DEFINES -D yuv_disable_asm=1"
+ fi
+
++# Keep libcubeb and audio_device backends in sync
++if test -n "$MOZ_ALSA"; then
++ EXTRA_GYP_DEFINES="$EXTRA_GYP_DEFINES -D include_alsa_audio=1"
++else
++ EXTRA_GYP_DEFINES="$EXTRA_GYP_DEFINES -D include_alsa_audio=0"
++fi
++if test -n "$MOZ_PULSEAUDIO"; then
++ EXTRA_GYP_DEFINES="$EXTRA_GYP_DEFINES -D include_pulse_audio=1"
++else
++ EXTRA_GYP_DEFINES="$EXTRA_GYP_DEFINES -D include_pulse_audio=0"
++fi
++
++# Don't try to compile sse4.1 code if toolchain doesn't support
++if test -z "$HAVE_TOOLCHAIN_SUPPORT_MSSE4_1"; then
++ EXTRA_GYP_DEFINES="$EXTRA_GYP_DEFINES -D yuv_disable_asm=1"
++fi
++
++if test -n "$MOZ_LIBV4L2_LIBS"; then
++ EXTRA_GYP_DEFINES="$EXTRA_GYP_DEFINES -D use_libv4l2=1"
++fi
++
+ if test -n "$MOZ_WEBRTC"; then
+ AC_MSG_RESULT("generating WebRTC Makefiles...")
+
diff --git a/www/firefox24/patches/patch-ak b/www/firefox24/patches/patch-ak
new file mode 100644
index 00000000000..eab4221e313
--- /dev/null
+++ b/www/firefox24/patches/patch-ak
@@ -0,0 +1,13 @@
+$NetBSD: patch-ak,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- js/src/ctypes/libffi/configure.orig 2013-01-04 23:44:34.000000000 +0000
++++ js/src/ctypes/libffi/configure
+@@ -11278,7 +11278,7 @@ case "$host" in
+ powerpc-*-aix* | rs6000-*-aix*)
+ TARGET=POWERPC_AIX; TARGETDIR=powerpc
+ ;;
+- powerpc-*-freebsd* | powerpc-*-openbsd*)
++ powerpc-*-freebsd* | powerpc-*-openbsd* | powerpc-*-netbsd*)
+ TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc
+ ;;
+ powerpc*-*-rtems*)
diff --git a/www/firefox24/patches/patch-al b/www/firefox24/patches/patch-al
new file mode 100644
index 00000000000..8f23437a0bf
--- /dev/null
+++ b/www/firefox24/patches/patch-al
@@ -0,0 +1,16 @@
+$NetBSD: patch-al,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- storage/src/mozStorageConnection.cpp.orig 2013-01-04 23:44:44.000000000 +0000
++++ storage/src/mozStorageConnection.cpp
+@@ -584,6 +584,11 @@ Connection::initialize(nsIFile *aDatabas
+ break;
+ }
+
++ // XXX tnn: the configure script demands that sqlite3 is compiled with
++ // SECURE_DELETE on by default. sqlite3 in pkgsrc does not have that,
++ // so instead we enable secure_delete manually here.
++ (void)ExecuteSimpleSQL(NS_LITERAL_CSTRING("PRAGMA secure_delete = 1;"));
++
+ return NS_OK;
+ }
+
diff --git a/www/firefox24/patches/patch-ao b/www/firefox24/patches/patch-ao
new file mode 100644
index 00000000000..a2c504fc672
--- /dev/null
+++ b/www/firefox24/patches/patch-ao
@@ -0,0 +1,15 @@
+$NetBSD: patch-ao,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- toolkit/mozapps/installer/packager.mk.orig 2013-03-26 22:18:05.000000000 +0000
++++ toolkit/mozapps/installer/packager.mk
+@@ -911,8 +911,8 @@ endif
+ (cd $(DIST)/$(MOZ_PKG_DIR) && $(TAR) --exclude=precomplete $(TAR_CREATE_FLAGS) - .) | \
+ (cd $(DESTDIR)$(installdir) && tar -xf -)
+ $(NSINSTALL) -D $(DESTDIR)$(bindir)
+- $(RM) -f $(DESTDIR)$(bindir)/$(MOZ_APP_NAME)
+- ln -s $(installdir)/$(MOZ_APP_NAME) $(DESTDIR)$(bindir)
++ $(RM) -f $(DESTDIR)$(bindir)/$(MOZILLA_PKG_NAME)
++ ln -s $(installdir)/$(MOZ_APP_NAME) $(DESTDIR)$(bindir)/$(MOZILLA_PKG_NAME)
+ ifdef INSTALL_SDK # Here comes the hard part
+ $(NSINSTALL) -D $(DESTDIR)$(includedir)
+ (cd $(DIST)/include && $(TAR) $(TAR_CREATE_FLAGS) - .) | \
diff --git a/www/firefox24/patches/patch-as b/www/firefox24/patches/patch-as
new file mode 100644
index 00000000000..f5efac5d708
--- /dev/null
+++ b/www/firefox24/patches/patch-as
@@ -0,0 +1,141 @@
+$NetBSD: patch-as,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+Treat DragonFly like FreeBSD.
+
+--- js/src/configure.in.orig 2013-09-10 03:43:34.000000000 +0000
++++ js/src/configure.in
+@@ -2424,6 +2424,7 @@ EOF
+ #pragma GCC visibility push(hidden)
+ #pragma GCC visibility push(default)
+ #include <string.h>
++#include <iterator>
+ #pragma GCC visibility pop
+
+ __attribute__ ((visibility ("default"))) void Func() {
+@@ -2432,7 +2433,7 @@ __attribute__ ((visibility ("default")))
+ }
+ EOF
+ ac_cv_have_visibility_builtin_bug=no
+- if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
++ if ! ${CXX-c++} ${CXXFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
+ ac_cv_have_visibility_builtin_bug=yes
+ else
+ if test `grep -c "@PLT" conftest.S` = 0; then
+@@ -2657,7 +2658,7 @@ then
+ fi
+
+ case "$target" in
+- *-*-freebsd*)
++ *-*-freebsd*|*-dragonfly*)
+ AC_DEFINE(_REENTRANT)
+ AC_DEFINE(_THREAD_SAFE)
+ dnl -pthread links in -lpthread, so don't specify it explicitly.
+@@ -2736,14 +2737,19 @@ fi
+ AC_CACHE_CHECK(
+ [for res_ninit()],
+ ac_cv_func_res_ninit,
+- [AC_TRY_LINK([
++ [AC_TRY_RUN([
+ #ifdef linux
+ #define _BSD_SOURCE 1
+ #endif
++ #ifdef __NetBSD__
++ #error use of global _res variable in threaded programs is not portable
++ #endif
+ #include <resolv.h>
+- ],
+- [int foo = res_ninit(&_res);],
++ int main(int argc, char **argv){
++ int foo = res_ninit(&_res);
++ }],
+ [ac_cv_func_res_ninit=yes],
++ [ac_cv_func_res_ninit=no],
+ [ac_cv_func_res_ninit=no])
+ ])
+
+@@ -3517,7 +3523,7 @@ if test "$MOZ_MEMORY"; then
+ *-darwin*)
+ AC_DEFINE(MOZ_MEMORY_DARWIN)
+ ;;
+- *-*freebsd*)
++ *-*freebsd*|*-*dragonfly*)
+ AC_DEFINE(MOZ_MEMORY_BSD)
+ ;;
+ *-android*|*-linuxandroid*)
+@@ -4417,6 +4423,16 @@ fi
+ dnl ========================================================
+ dnl ECMAScript Internationalization API Support (uses ICU)
+ dnl ========================================================
++ICU_LIB_NAMES=
++MOZ_NATIVE_ICU=
++MOZ_ARG_WITH_BOOL(system-icu,
++[ --with-system-icu
++ Use system icu (located with pkgconfig)],
++ MOZ_NATIVE_ICU=1)
++
++if test -n "$MOZ_NATIVE_ICU"; then
++ PKG_CHECK_MODULES(MOZ_ICU, icu-i18n >= 50.1)
++fi
+
+ if test -n "$JS_STANDALONE"; then
+ ENABLE_INTL_API=1
+@@ -4429,37 +4445,36 @@ MOZ_ARG_ENABLE_BOOL(intl-api,
+ dnl Settings for the implementation of the ECMAScript Internationalization API
+ if test -n "$ENABLE_INTL_API"; then
+ AC_DEFINE(ENABLE_INTL_API)
+- # We build ICU as a static library.
+- AC_DEFINE(U_STATIC_IMPLEMENTATION)
+
+- case "$OS_TARGET" in
+- WINNT)
+- ICU_LIB_NAMES="icuin icuuc icudt"
+- ;;
+- Darwin|Linux)
+- ICU_LIB_NAMES="icui18n icuuc icudata"
+- ;;
+- *)
+- AC_MSG_ERROR([ECMAScript Internationalization API is not yet supported on this platform])
+- esac
+-
+- ICU_LIBS='$(call EXPAND_LIBNAME_PATH,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/lib)'
+-else
+- ICU_LIB_NAMES=
+- ICU_LIBS=
++ if test -z "$MOZ_NATIVE_ICU"; then
++ case "$OS_TARGET" in
++ WINNT)
++ ICU_LIB_NAMES="icuin icuuc icudt"
++ ;;
++ Darwin|Linux)
++ ICU_LIB_NAMES="icui18n icuuc icudata"
++ ;;
++ *)
++ AC_MSG_ERROR([ECMAScript Internationalization API is not yet supported on this platform])
++ esac
++ MOZ_ICU_LIBS='$(call EXPAND_LIBNAME_PATH,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/lib)'
++ fi
+ fi
+
+ AC_SUBST(ENABLE_INTL_API)
+ AC_SUBST(ICU_LIB_NAMES)
+-AC_SUBST(ICU_LIBS)
++AC_SUBST(MOZ_ICU_LIBS)
++AC_SUBST(MOZ_NATIVE_ICU)
+
+-dnl Source files that use ICU should have control over which parts of the ICU
+-dnl namespace they want to use.
+-AC_DEFINE(U_USING_ICU_NAMESPACE,0)
++dnl Settings for ICU
++if test -n "$ENABLE_INTL_API" -a -z "$MOZ_NATIVE_ICU"; then
++ dnl We build ICU as a static library.
++ AC_DEFINE(U_STATIC_IMPLEMENTATION)
+
++ dnl Source files that use ICU should have control over which parts of the ICU
++ dnl namespace they want to use.
++ AC_DEFINE(U_USING_ICU_NAMESPACE,0)
+
+-dnl Settings for ICU
+-if test -n "$ENABLE_INTL_API" ; then
+ # Set ICU compile options
+ ICU_CPPFLAGS=""
+ # don't use icu namespace automatically in client code
diff --git a/www/firefox24/patches/patch-bf b/www/firefox24/patches/patch-bf
new file mode 100644
index 00000000000..8e80bb12086
--- /dev/null
+++ b/www/firefox24/patches/patch-bf
@@ -0,0 +1,13 @@
+$NetBSD: patch-bf,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- js/src/jsnativestack.cpp.orig 2013-09-10 03:43:36.000000000 +0000
++++ 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/firefox24/patches/patch-bg b/www/firefox24/patches/patch-bg
new file mode 100644
index 00000000000..af2415b9a9c
--- /dev/null
+++ b/www/firefox24/patches/patch-bg
@@ -0,0 +1,24 @@
+$NetBSD: patch-bg,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- storage/src/SQLiteMutex.h.orig 2013-01-04 23:44:44.000000000 +0000
++++ storage/src/SQLiteMutex.h
+@@ -108,15 +108,19 @@ public:
+ void assertCurrentThreadOwns()
+ {
+ NS_ASSERTION(mMutex, "No mutex associated with this wrapper!");
++#if 0 /* XXX tnn: this breaks the debug build. */
+ NS_ASSERTION(sqlite3_mutex_held(mMutex),
+ "Mutex is not held, but we expect it to be!");
++#endif
+ }
+
+ void assertNotCurrentThreadOwns()
+ {
+ NS_ASSERTION(mMutex, "No mutex associated with this wrapper!");
++#if 0 /* XXX tnn: this breaks the debug build. */
+ NS_ASSERTION(sqlite3_mutex_notheld(mMutex),
+ "Mutex is held, but we expect it to not be!");
++#endif
+ }
+ #endif // ifndef DEBUG
+
diff --git a/www/firefox24/patches/patch-bi b/www/firefox24/patches/patch-bi
new file mode 100644
index 00000000000..d581f4962de
--- /dev/null
+++ b/www/firefox24/patches/patch-bi
@@ -0,0 +1,12 @@
+$NetBSD: patch-bi,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- gfx/angle/src/compiler/osinclude.h.orig 2013-01-04 23:44:32.000000000 +0000
++++ gfx/angle/src/compiler/osinclude.h
+@@ -16,6 +16,7 @@
+ #define ANGLE_OS_WIN
+ #elif defined(__APPLE__) || defined(__linux__) || \
+ defined(__FreeBSD__) || defined(__OpenBSD__) || \
++ defined(__NetBSD__) || defined(__DragonFly__) || \
+ defined(__sun) || defined(ANDROID) || \
+ defined(__GLIBC__) || defined(__GNU__) || \
+ defined(__QNX__)
diff --git a/www/firefox24/patches/patch-browser_app_profile_firefox.js b/www/firefox24/patches/patch-browser_app_profile_firefox.js
new file mode 100644
index 00000000000..3926c49a331
--- /dev/null
+++ b/www/firefox24/patches/patch-browser_app_profile_firefox.js
@@ -0,0 +1,12 @@
+$NetBSD: patch-browser_app_profile_firefox.js,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- browser/app/profile/firefox.js.orig 2013-09-10 03:43:20.000000000 +0000
++++ browser/app/profile/firefox.js
+@@ -354,6 +354,7 @@ pref("browser.search.log", false);
+ pref("browser.search.order.1", "chrome://browser-region/locale/region.properties");
+ pref("browser.search.order.2", "chrome://browser-region/locale/region.properties");
+ pref("browser.search.order.3", "chrome://browser-region/locale/region.properties");
++pref("browser.search.order.4", "chrome://browser-region/locale/region.properties");
+
+ // search bar results always open in a new tab
+ pref("browser.search.openintab", false);
diff --git a/www/firefox24/patches/patch-browser_installer_package-manifest.in b/www/firefox24/patches/patch-browser_installer_package-manifest.in
new file mode 100644
index 00000000000..1ab53e13c94
--- /dev/null
+++ b/www/firefox24/patches/patch-browser_installer_package-manifest.in
@@ -0,0 +1,15 @@
+$NetBSD: patch-browser_installer_package-manifest.in,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+Limit SPARC bits to just SPARC (untested, but fixes x86).
+
+--- browser/installer/package-manifest.in.orig 2013-06-18 11:01:12.000000000 +0000
++++ browser/installer/package-manifest.in
+@@ -690,7 +690,7 @@
+ @BINPATH@/components/pippki.xpt
+
+ ; 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/firefox24/patches/patch-browser_locales_en-US_chrome_browser-region_region.properties b/www/firefox24/patches/patch-browser_locales_en-US_chrome_browser-region_region.properties
new file mode 100644
index 00000000000..0ee74389f98
--- /dev/null
+++ b/www/firefox24/patches/patch-browser_locales_en-US_chrome_browser-region_region.properties
@@ -0,0 +1,12 @@
+$NetBSD: patch-browser_locales_en-US_chrome_browser-region_region.properties,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- browser/locales/en-US/chrome/browser-region/region.properties.orig 2013-09-10 03:43:22.000000000 +0000
++++ browser/locales/en-US/chrome/browser-region/region.properties
+@@ -9,6 +9,7 @@ browser.search.defaultenginename=Google
+ browser.search.order.1=Google
+ browser.search.order.2=Yahoo
+ browser.search.order.3=Bing
++browser.search.order.4=DuckDuckGo
+
+ # This is the default set of web based feed handlers shown in the reader
+ # selection UI
diff --git a/www/firefox24/patches/patch-browser_locales_en-US_searchplugins_duckduckgo.xml b/www/firefox24/patches/patch-browser_locales_en-US_searchplugins_duckduckgo.xml
new file mode 100644
index 00000000000..ee43b62e805
--- /dev/null
+++ b/www/firefox24/patches/patch-browser_locales_en-US_searchplugins_duckduckgo.xml
@@ -0,0 +1,16 @@
+$NetBSD: patch-browser_locales_en-US_searchplugins_duckduckgo.xml,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- browser/locales/en-US/searchplugins/duckduckgo.xml.orig 2013-09-14 15:17:46.000000000 +0000
++++ browser/locales/en-US/searchplugins/duckduckgo.xml
+@@ -0,0 +1,11 @@
++<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
++<ShortName>DuckDuckGo</ShortName>
++<Description>We believe in better search and not tracking.</Description>
++<InputEncoding>UTF-8</InputEncoding>
++<Image height="16" width="16" type="image/x-icon">data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAANcNAADXDQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJyDsJmlk8pf6+v3s/v7+++zr/fcnIOyzJyDsgCcg7CYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAnIOwBJyDscCcg7PZttJ7/7Pfs//////++xO7/S5GA/ycg7P8nIOz2JyDscCcg7AEAAAAAAAAAAAAAAAAnIOwBJyDstScg7P8nIOz/Y8p5/2fHZf9Yv0z/YcF2/1rBUv8nIOz/JyDs/ycg7P8nIOy1JyDsAQAAAAAAAAAAJyDscCcg7P8nIOz/JyDs/4jQoP/p9+n//////05X3v9LkYD/JyDs/ycg7P8nIOz/JyDs/ycg7HAAAAAAJyDsJicg7PYnIOz/JyDs/zUu7f/+/v////////////89N+7/JyDs/yUo7f8nIOz/JyDs/ycg7P8nIOz2JyDsJicg7IAnIOz/JyDs/ycg7P9hXPH////////////t/P//GIr2/wfD+/8Gyfz/DKv5/yM57/8nIOz/JyDs/ycg7H8nIOyzJyDs/ycg7P8nIOz/jov1////////////Otz9/w3G/P8cWfH/JSvt/ycg7P8nIOz/JyDs/ycg7P8nIOyzJyDs5icg7P8nIOz/JyDs/7u5+f///////////27l/v8E0v3/BNL9/wTQ/f8Oofn/IT7v/ycg7P8nIOz/JyDs5icg7OYnIOz/JyDs/ycg7P/p6P3/uWsC////////////5fr//6Po/f8Thfb/DKv5/w6f+f8nIOz/JyDs/ycg7OYnIOyzJyDs/ycg7P8nIOz/9/b+/////////////////7lrAv/V1Pv/JyDs/ycg7P8nIOz/JyDs/ycg7P8nIOyzJyDsgCcg7P8nIOz/JyDs/8/N+///////////////////////iIX1/ycg7P8nIOz/JyDs/ycg7P8nIOz/JyDsfycg7CYnIOz2JyDs/ycg7P9FP+7/q6n4/+7u/f/n5v3/fXn0/yoj7P8nIOz/JyDs/ycg7P8nIOz/JyDs9icg7CYAAAAAJyDscCcg7P8nIOz/wsD6/+no/f/Y1/z/eHTz/ycg7P8nIOz/JyDs/ycg7P8nIOz/JyDs/ycg7HAAAAAAAAAAACcg7AEnIOy1JyDs/ycg7P8nIOz/JyDs/ycg7P8nIOz/JyDs/ycg7P8nIOz/JyDs/ycg7LUnIOwBAAAAAAAAAAAAAAAAJyDsAScg7HAnIOz2JyDs/ycg7P8nIOz/JyDs/ycg7P8nIOz/JyDs9icg7HAnIOwBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJyDsJicg7IAnIOyzJyDs5icg7OYnIOyzJyDsgCcg7CYAAAAAAAAAAAAAAAAAAAAA+B8AAPAPAADAAwAAwAMAAIABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABAACAAQAAwAMAAMADAADwDwAA+B8AAA==</Image>
++<Url type="text/html" method="GET" template="https://duckduckgo.com/">
++<Param name="q" value="{searchTerms}"/>
++<Param name="t" value="freebsd"/>
++</Url>
++<SearchForm>https://duckduckgo.com/</SearchForm>
++</SearchPlugin>
diff --git a/www/firefox24/patches/patch-browser_locales_en-US_searchplugins_list.txt b/www/firefox24/patches/patch-browser_locales_en-US_searchplugins_list.txt
new file mode 100644
index 00000000000..ca3ae3042f0
--- /dev/null
+++ b/www/firefox24/patches/patch-browser_locales_en-US_searchplugins_list.txt
@@ -0,0 +1,11 @@
+$NetBSD: patch-browser_locales_en-US_searchplugins_list.txt,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- browser/locales/en-US/searchplugins/list.txt.orig 2013-09-10 03:43:22.000000000 +0000
++++ browser/locales/en-US/searchplugins/list.txt
+@@ -1,5 +1,6 @@
+ amazondotcom
+ bing
++duckduckgo
+ eBay
+ google
+ twitter
diff --git a/www/firefox24/patches/patch-build_autoconf_nss.m4 b/www/firefox24/patches/patch-build_autoconf_nss.m4
new file mode 100644
index 00000000000..d1622791e0b
--- /dev/null
+++ b/www/firefox24/patches/patch-build_autoconf_nss.m4
@@ -0,0 +1,46 @@
+$NetBSD: patch-build_autoconf_nss.m4,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- build/autoconf/nss.m4.orig 2013-01-04 23:44:28.000000000 +0000
++++ build/autoconf/nss.m4
+@@ -22,18 +22,18 @@ AC_ARG_WITH(nss-exec-prefix,
+ if test -n "$nss_config_exec_prefix"; then
+ nss_config_args="$nss_config_args --exec-prefix=$nss_config_exec_prefix"
+ if test -z "$NSS_CONFIG"; then
+- NSS_CONFIG=$nss_config_exec_prefix/bin/nss-config
++ NSS_CONFIG=$nss_config_exec_prefix/bin/pkg-config
+ fi
+ fi
+ if test -n "$nss_config_prefix"; then
+ nss_config_args="$nss_config_args --prefix=$nss_config_prefix"
+ if test -z "$NSS_CONFIG"; then
+- NSS_CONFIG=$nss_config_prefix/bin/nss-config
++ NSS_CONFIG=$nss_config_prefix/bin/pkg-config
+ fi
+ fi
+
+ unset ac_cv_path_NSS_CONFIG
+- AC_PATH_PROG(NSS_CONFIG, nss-config, no)
++ AC_PATH_PROG(NSS_CONFIG, pkg-config, no)
+ min_nss_version=ifelse([$1], ,3.0.0,$1)
+ AC_MSG_CHECKING(for NSS - version >= $min_nss_version)
+
+@@ -41,14 +41,14 @@ AC_ARG_WITH(nss-exec-prefix,
+ if test "$NSS_CONFIG" = "no"; then
+ no_nss="yes"
+ else
+- NSS_CFLAGS=`$NSS_CONFIG $nss_config_args --cflags`
+- NSS_LIBS=`$NSS_CONFIG $nss_config_args --libs`
++ NSS_CFLAGS=`$NSS_CONFIG $nss_config_args nss --cflags`
++ NSS_LIBS=`$NSS_CONFIG $nss_config_args nss --libs`
+
+- nss_config_major_version=`$NSS_CONFIG $nss_config_args --version | \
++ nss_config_major_version=`$NSS_CONFIG $nss_config_args nss --modversion | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+- nss_config_minor_version=`$NSS_CONFIG $nss_config_args --version | \
++ nss_config_minor_version=`$NSS_CONFIG $nss_config_args nss --modversion | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+- nss_config_micro_version=`$NSS_CONFIG $nss_config_args --version | \
++ nss_config_micro_version=`$NSS_CONFIG $nss_config_args nss --modversion | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+ min_nss_major_version=`echo $min_nss_version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
diff --git a/www/firefox24/patches/patch-build_pgo_profileserver.py b/www/firefox24/patches/patch-build_pgo_profileserver.py
new file mode 100644
index 00000000000..768147ffa19
--- /dev/null
+++ b/www/firefox24/patches/patch-build_pgo_profileserver.py
@@ -0,0 +1,13 @@
+$NetBSD: patch-build_pgo_profileserver.py,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- build/pgo/profileserver.py.orig 2013-09-10 03:43:22.000000000 +0000
++++ build/pgo/profileserver.py
+@@ -59,7 +59,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/firefox24/patches/patch-config_Makefile.in b/www/firefox24/patches/patch-config_Makefile.in
new file mode 100644
index 00000000000..b9780189bef
--- /dev/null
+++ b/www/firefox24/patches/patch-config_Makefile.in
@@ -0,0 +1,12 @@
+$NetBSD: patch-config_Makefile.in,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- config/Makefile.in.orig 2013-09-10 03:43:23.000000000 +0000
++++ config/Makefile.in
+@@ -102,6 +102,7 @@ export:: $(export-preqs)
+ -DMOZ_NATIVE_JPEG=$(MOZ_NATIVE_JPEG) \
+ -DMOZ_NATIVE_LIBEVENT=$(MOZ_NATIVE_LIBEVENT) \
+ -DMOZ_NATIVE_LIBVPX=$(MOZ_NATIVE_LIBVPX) \
++ -DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \
+ $(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers
+ $(INSTALL) system_wrappers $(DIST)
+
diff --git a/www/firefox24/patches/patch-config_baseconfig.mk b/www/firefox24/patches/patch-config_baseconfig.mk
new file mode 100644
index 00000000000..ebadca2b5d0
--- /dev/null
+++ b/www/firefox24/patches/patch-config_baseconfig.mk
@@ -0,0 +1,18 @@
+$NetBSD: patch-config_baseconfig.mk,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- config/baseconfig.mk.orig 2013-01-04 23:44:28.000000000 +0000
++++ config/baseconfig.mk
+@@ -1,9 +1,9 @@
+ INCLUDED_AUTOCONF_MK = 1
+
+-includedir := $(includedir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
+-idldir = $(datadir)/idl/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
+-installdir = $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
+-sdkdir = $(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION)
++includedir := $(includedir)/${MOZILLA_PKG_NAME}
++idldir = $(datadir)/idl/${MOZILLA_PKG_NAME}
++installdir = $(libdir)/${MOZILLA_PKG_NAME}
++sdkdir = $(libdir)/${MOZILLA_PKG_NAME}-sdk
+ DIST = $(DEPTH)/dist
+
+ # We do magic with OBJ_SUFFIX in config.mk, the following ensures we don't
diff --git a/www/firefox24/patches/patch-config_stl__wrappers_ios b/www/firefox24/patches/patch-config_stl__wrappers_ios
new file mode 100644
index 00000000000..75e9550a26f
--- /dev/null
+++ b/www/firefox24/patches/patch-config_stl__wrappers_ios
@@ -0,0 +1,8 @@
+$NetBSD: patch-config_stl__wrappers_ios,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- config/stl_wrappers/ios.orig 2013-05-13 18:23:07.000000000 +0000
++++ config/stl_wrappers/ios
+@@ -0,0 +1,3 @@
++#pragma GCC visibility push(default)
++#include_next <ios>
++#pragma GCC visibility pop
diff --git a/www/firefox24/patches/patch-config_stl__wrappers_ostream b/www/firefox24/patches/patch-config_stl__wrappers_ostream
new file mode 100644
index 00000000000..e87e8a0133b
--- /dev/null
+++ b/www/firefox24/patches/patch-config_stl__wrappers_ostream
@@ -0,0 +1,8 @@
+$NetBSD: patch-config_stl__wrappers_ostream,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- config/stl_wrappers/ostream.orig 2013-05-13 18:22:40.000000000 +0000
++++ config/stl_wrappers/ostream
+@@ -0,0 +1,3 @@
++#pragma GCC visibility push(default)
++#include_next <ostream>
++#pragma GCC visibility pop
diff --git a/www/firefox24/patches/patch-config_system-headers b/www/firefox24/patches/patch-config_system-headers
new file mode 100644
index 00000000000..27780514441
--- /dev/null
+++ b/www/firefox24/patches/patch-config_system-headers
@@ -0,0 +1,19 @@
+$NetBSD: patch-config_system-headers,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- config/system-headers.orig 2013-09-10 03:43:23.000000000 +0000
++++ config/system-headers
+@@ -1132,3 +1132,14 @@ kvm.h
+ spawn.h
+ err.h
+ xlocale.h
++#if MOZ_NATIVE_ICU==1
++unicode/locid.h
++unicode/numsys.h
++unicode/ucal.h
++unicode/ucol.h
++unicode/udat.h
++unicode/udatpg.h
++unicode/uenum.h
++unicode/unum.h
++unicode/ustring.h
++#endif
diff --git a/www/firefox24/patches/patch-config_system__wrappers_unwind.h b/www/firefox24/patches/patch-config_system__wrappers_unwind.h
new file mode 100644
index 00000000000..a6aca885a3c
--- /dev/null
+++ b/www/firefox24/patches/patch-config_system__wrappers_unwind.h
@@ -0,0 +1,9 @@
+$NetBSD: patch-config_system__wrappers_unwind.h,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- config/system_wrappers/unwind.h.orig 2013-05-13 19:56:18.000000000 +0000
++++ config/system_wrappers/unwind.h
+@@ -0,0 +1,4 @@
++#pragma GCC system_header
++#pragma GCC visibility push(default)
++#include_next <unwind.h>
++#pragma GCC visibility pop
diff --git a/www/firefox24/patches/patch-content_media_gstreamer_GStreamerFormatHelper.cpp b/www/firefox24/patches/patch-content_media_gstreamer_GStreamerFormatHelper.cpp
new file mode 100644
index 00000000000..ae150fb0333
--- /dev/null
+++ b/www/firefox24/patches/patch-content_media_gstreamer_GStreamerFormatHelper.cpp
@@ -0,0 +1,166 @@
+$NetBSD: patch-content_media_gstreamer_GStreamerFormatHelper.cpp,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- content/media/gstreamer/GStreamerFormatHelper.cpp.orig 2013-09-10 03:43:24.000000000 +0000
++++ content/media/gstreamer/GStreamerFormatHelper.cpp
+@@ -6,7 +6,7 @@
+
+ #include "GStreamerFormatHelper.h"
+ #include "nsCharSeparatedTokenizer.h"
+-#include "nsXPCOMStrings.h"
++#include "nsString.h"
+ #include "GStreamerLoader.h"
+
+ #define ENTRY_FORMAT(entry) entry[0]
+@@ -36,7 +36,7 @@ void GStreamerFormatHelper::Shutdown() {
+ }
+ }
+
+-char const *const GStreamerFormatHelper::mContainers[6][2] = {
++static char const *const sContainers[6][2] = {
+ {"video/mp4", "video/quicktime"},
+ {"video/quicktime", "video/quicktime"},
+ {"audio/mp4", "audio/x-m4a"},
+@@ -45,7 +45,7 @@ char const *const GStreamerFormatHelper:
+ {"audio/mp3", "audio/mpeg, mpegversion=(int)1"},
+ };
+
+-char const *const GStreamerFormatHelper::mCodecs[9][2] = {
++static char const *const sCodecs[9][2] = {
+ {"avc1.42E01E", "video/x-h264"},
+ {"avc1.42001E", "video/x-h264"},
+ {"avc1.58A01E", "video/x-h264"},
+@@ -57,6 +57,15 @@ char const *const GStreamerFormatHelper:
+ {"mp3", "audio/mpeg, mpegversion=(int)1"},
+ };
+
++static char const * const sDefaultCodecCaps[][2] = {
++ {"video/mp4", "video/x-h264"},
++ {"video/quicktime", "video/x-h264"},
++ {"audio/mp4", "audio/mpeg, mpegversion=(int)4"},
++ {"audio/x-m4a", "audio/mpeg, mpegversion=(int)4"},
++ {"audio/mp3", "audio/mpeg, layer=(int)3"},
++ {"audio/mpeg", "audio/mpeg, layer=(int)3"}
++};
++
+ GStreamerFormatHelper::GStreamerFormatHelper()
+ : mFactories(nullptr),
+ mCookie(static_cast<uint32_t>(-1))
+@@ -66,15 +75,15 @@ GStreamerFormatHelper::GStreamerFormatHe
+ }
+
+ mSupportedContainerCaps = gst_caps_new_empty();
+- for (unsigned int i = 0; i < G_N_ELEMENTS(mContainers); i++) {
+- const char* capsString = mContainers[i][1];
++ for (unsigned int i = 0; i < G_N_ELEMENTS(sContainers); i++) {
++ const char* capsString = sContainers[i][1];
+ GstCaps* caps = gst_caps_from_string(capsString);
+ gst_caps_append(mSupportedContainerCaps, caps);
+ }
+
+ mSupportedCodecCaps = gst_caps_new_empty();
+- for (unsigned int i = 0; i < G_N_ELEMENTS(mCodecs); i++) {
+- const char* capsString = mCodecs[i][1];
++ for (unsigned int i = 0; i < G_N_ELEMENTS(sCodecs); i++) {
++ const char* capsString = sCodecs[i][1];
+ GstCaps* caps = gst_caps_from_string(capsString);
+ gst_caps_append(mSupportedCodecCaps, caps);
+ }
+@@ -92,6 +101,41 @@ GStreamerFormatHelper::~GStreamerFormatH
+ g_list_free(mFactories);
+ }
+
++static GstCaps *
++GetContainerCapsFromMIMEType(const char *aType) {
++ /* convert aMIMEType to gst container caps */
++ const char* capsString = nullptr;
++ for (uint32_t i = 0; i < G_N_ELEMENTS(sContainers); i++) {
++ if (!strcmp(ENTRY_FORMAT(sContainers[i]), aType)) {
++ capsString = ENTRY_CAPS(sContainers[i]);
++ break;
++ }
++ }
++
++ if (!capsString) {
++ /* we couldn't find any matching caps */
++ return nullptr;
++ }
++
++ return gst_caps_from_string(capsString);
++}
++
++static GstCaps *
++GetDefaultCapsFromMIMEType(const char *aType) {
++ GstCaps *caps = GetContainerCapsFromMIMEType(aType);
++
++ for (uint32_t i = 0; i < G_N_ELEMENTS(sDefaultCodecCaps); i++) {
++ if (!strcmp(sDefaultCodecCaps[i][0], aType)) {
++ GstCaps *tmp = gst_caps_from_string(sDefaultCodecCaps[i][1]);
++
++ gst_caps_append(caps, tmp);
++ return caps;
++ }
++ }
++
++ return nullptr;
++}
++
+ bool GStreamerFormatHelper::CanHandleMediaType(const nsACString& aMIMEType,
+ const nsAString* aCodecs) {
+ if (!sLoadOK) {
+@@ -101,7 +145,15 @@ bool GStreamerFormatHelper::CanHandleMed
+ const char *type;
+ NS_CStringGetData(aMIMEType, &type, NULL);
+
+- GstCaps* caps = ConvertFormatsToCaps(type, aCodecs);
++ GstCaps *caps;
++ if (aCodecs && !aCodecs->IsEmpty()) {
++ caps = ConvertFormatsToCaps(type, aCodecs);
++ } else {
++ // Get a minimal set of codec caps for this MIME type we should support so
++ // that we don't overreport MIME types we are able to play.
++ caps = GetDefaultCapsFromMIMEType(type);
++ }
++
+ if (!caps) {
+ return false;
+ }
+@@ -118,21 +170,11 @@ GstCaps* GStreamerFormatHelper::ConvertF
+
+ unsigned int i;
+
+- /* convert aMIMEType to gst container caps */
+- const char* capsString = nullptr;
+- for (i = 0; i < G_N_ELEMENTS(mContainers); i++) {
+- if (!strcmp(ENTRY_FORMAT(mContainers[i]), aMIMEType)) {
+- capsString = ENTRY_CAPS(mContainers[i]);
+- break;
+- }
+- }
+-
+- if (!capsString) {
+- /* we couldn't find any matching caps */
++ GstCaps *caps = GetContainerCapsFromMIMEType(aMIMEType);
++ if (!caps) {
+ return nullptr;
+ }
+
+- GstCaps* caps = gst_caps_from_string(capsString);
+ /* container only */
+ if (!aCodecs) {
+ return caps;
+@@ -141,11 +183,11 @@ GstCaps* GStreamerFormatHelper::ConvertF
+ nsCharSeparatedTokenizer tokenizer(*aCodecs, ',');
+ while (tokenizer.hasMoreTokens()) {
+ const nsSubstring& codec = tokenizer.nextToken();
+- capsString = nullptr;
++ const char *capsString = nullptr;
+
+- for (i = 0; i < G_N_ELEMENTS(mCodecs); i++) {
+- if (codec.EqualsASCII(ENTRY_FORMAT(mCodecs[i]))) {
+- capsString = ENTRY_CAPS(mCodecs[i]);
++ for (i = 0; i < G_N_ELEMENTS(sCodecs); i++) {
++ if (codec.EqualsASCII(ENTRY_FORMAT(sCodecs[i]))) {
++ capsString = ENTRY_CAPS(sCodecs[i]);
+ break;
+ }
+ }
diff --git a/www/firefox24/patches/patch-dom_plugins_ipc_PluginModuleChild.cpp b/www/firefox24/patches/patch-dom_plugins_ipc_PluginModuleChild.cpp
new file mode 100644
index 00000000000..184a970604a
--- /dev/null
+++ b/www/firefox24/patches/patch-dom_plugins_ipc_PluginModuleChild.cpp
@@ -0,0 +1,31 @@
+$NetBSD: patch-dom_plugins_ipc_PluginModuleChild.cpp,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- dom/plugins/ipc/PluginModuleChild.cpp.orig 2013-05-11 19:19:27.000000000 +0000
++++ dom/plugins/ipc/PluginModuleChild.cpp
+@@ -201,7 +201,7 @@ PluginModuleChild::Init(const std::strin
+
+ // TODO: use PluginPRLibrary here
+
+-#if defined(OS_LINUX) || defined(OS_BSD)
++#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
+ mShutdownFunc =
+ (NP_PLUGINSHUTDOWN) PR_FindFunctionSymbol(mLibrary, "NP_Shutdown");
+
+@@ -1836,7 +1836,7 @@ PluginModuleChild::AnswerNP_GetEntryPoin
+ PLUGIN_LOG_DEBUG_METHOD;
+ AssertPluginThread();
+
+-#if defined(OS_LINUX) || defined(OS_BSD)
++#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
+ return true;
+ #elif defined(OS_WIN) || defined(OS_MACOSX)
+ *_retval = mGetEntryPointsFunc(&mFunctions);
+@@ -1865,7 +1865,7 @@ PluginModuleChild::AnswerNP_Initialize(c
+ SendBackUpXResources(FileDescriptor(xSocketFd));
+ #endif
+
+-#if defined(OS_LINUX) || defined(OS_BSD)
++#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
+ *_retval = mInitializeFunc(&sBrowserFuncs, &mFunctions);
+ return true;
+ #elif defined(OS_WIN) || defined(OS_MACOSX)
diff --git a/www/firefox24/patches/patch-dom_plugins_ipc_PluginModuleChild.h b/www/firefox24/patches/patch-dom_plugins_ipc_PluginModuleChild.h
new file mode 100644
index 00000000000..77b4644132e
--- /dev/null
+++ b/www/firefox24/patches/patch-dom_plugins_ipc_PluginModuleChild.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-dom_plugins_ipc_PluginModuleChild.h,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- dom/plugins/ipc/PluginModuleChild.h.orig 2013-05-11 19:19:27.000000000 +0000
++++ dom/plugins/ipc/PluginModuleChild.h
+@@ -325,7 +325,7 @@ private:
+
+ // we get this from the plugin
+ NP_PLUGINSHUTDOWN mShutdownFunc;
+-#if defined(OS_LINUX) || defined(OS_BSD)
++#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
+ NP_PLUGINUNIXINIT mInitializeFunc;
+ #elif defined(OS_WIN) || defined(OS_MACOSX)
+ NP_PLUGININIT mInitializeFunc;
diff --git a/www/firefox24/patches/patch-extensions_auth_nsAuthGSSAPI.cpp b/www/firefox24/patches/patch-extensions_auth_nsAuthGSSAPI.cpp
new file mode 100644
index 00000000000..b7fd5102852
--- /dev/null
+++ b/www/firefox24/patches/patch-extensions_auth_nsAuthGSSAPI.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-extensions_auth_nsAuthGSSAPI.cpp,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- extensions/auth/nsAuthGSSAPI.cpp.orig 2013-05-11 19:19:29.000000000 +0000
++++ extensions/auth/nsAuthGSSAPI.cpp
+@@ -39,6 +39,9 @@ typedef KLStatus (*KLCacheHasValidTicket
+ #endif
+
+ #if defined(HAVE_RES_NINIT)
++#include <sys/types.h>
++#include <netinet/in.h>
++#include <arpa/nameser.h>
+ #include <resolv.h>
+ #endif
+
diff --git a/www/firefox24/patches/patch-extensions_spellcheck_hunspell_src_mozHunspell.cpp b/www/firefox24/patches/patch-extensions_spellcheck_hunspell_src_mozHunspell.cpp
new file mode 100644
index 00000000000..66a7f7b4df0
--- /dev/null
+++ b/www/firefox24/patches/patch-extensions_spellcheck_hunspell_src_mozHunspell.cpp
@@ -0,0 +1,17 @@
+$NetBSD: patch-extensions_spellcheck_hunspell_src_mozHunspell.cpp,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- extensions/spellcheck/hunspell/src/mozHunspell.cpp.orig 2013-09-10 03:43:29.000000000 +0000
++++ extensions/spellcheck/hunspell/src/mozHunspell.cpp
+@@ -417,6 +417,12 @@ mozHunspell::LoadDictionaryList()
+ }
+ }
+
++ // load system hunspell dictionaries
++ nsIFile* hunDir;
++ NS_NewNativeLocalFile(NS_LITERAL_CSTRING("@PREFIX@/share/hunspell"),
++ true, &hunDir);
++ LoadDictionariesFromDir(hunDir);
++
+ // find dictionaries from extensions requiring restart
+ nsCOMPtr<nsISimpleEnumerator> dictDirs;
+ rv = dirSvc->Get(DICTIONARY_SEARCH_DIRECTORY_LIST,
diff --git a/www/firefox24/patches/patch-gfx__skia__include__core__SkPreConfig.h b/www/firefox24/patches/patch-gfx__skia__include__core__SkPreConfig.h
new file mode 100644
index 00000000000..1497a60bc30
--- /dev/null
+++ b/www/firefox24/patches/patch-gfx__skia__include__core__SkPreConfig.h
@@ -0,0 +1,16 @@
+$NetBSD: patch-gfx__skia__include__core__SkPreConfig.h,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+Configure sparc cpus as big endian (Bugzilla #884376)
+
+diff -r 581ea0e6531e gfx/skia/include/core/SkPreConfig.h
+--- gfx/skia/include/core/SkPreConfig.h Tue May 07 09:47:43 2013 -0400
++++ gfx/skia/include/core/SkPreConfig.h Tue Jun 18 17:36:55 2013 +0200
+@@ -94,7 +94,7 @@
+ //////////////////////////////////////////////////////////////////////
+
+ #if !defined(SK_CPU_BENDIAN) && !defined(SK_CPU_LENDIAN)
+-#if defined (__ppc__) || defined(__PPC__) || defined(__ppc64__) || defined(__PPC64__)
++#if defined (__ppc__) || defined(__PPC__) || defined(__ppc64__) || defined(__PPC64__) || defined(__sparc) || defined(__sparc__)
+ #define SK_CPU_BENDIAN
+ #else
+ #define SK_CPU_LENDIAN
diff --git a/www/firefox24/patches/patch-gfx_graphite2_src_Bidi.cpp b/www/firefox24/patches/patch-gfx_graphite2_src_Bidi.cpp
new file mode 100644
index 00000000000..683e071c543
--- /dev/null
+++ b/www/firefox24/patches/patch-gfx_graphite2_src_Bidi.cpp
@@ -0,0 +1,16 @@
+$NetBSD: patch-gfx_graphite2_src_Bidi.cpp,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- gfx/graphite2/src/Bidi.cpp.orig 2013-05-11 19:19:30.000000000 +0000
++++ gfx/graphite2/src/Bidi.cpp
+@@ -30,6 +30,11 @@ of the License or (at your option) any l
+
+ using namespace graphite2;
+
++#ifdef __sun
++#undef CS
++#undef ES
++#endif
++
+ enum DirCode { // Hungarian: dirc
+ Unk = -1,
+ N = 0, // other neutrals (default) - ON
diff --git a/www/firefox24/patches/patch-gfx_skia_moz.build b/www/firefox24/patches/patch-gfx_skia_moz.build
new file mode 100644
index 00000000000..07864703d60
--- /dev/null
+++ b/www/firefox24/patches/patch-gfx_skia_moz.build
@@ -0,0 +1,16 @@
+$NetBSD: patch-gfx_skia_moz.build,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- gfx/skia/moz.build.orig 2013-09-10 03:43:30.000000000 +0000
++++ gfx/skia/moz.build
+@@ -188,10 +188,9 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt
+ 'SkMMapStream.cpp',
+ 'SkOSFile.cpp',
+ ]
+- if CONFIG['OS_TARGET'] == 'Linux':
++ if CONFIG['MOZ_X11'] == 1 or CONFIG['OS_TARGET'] == 'Linux':
+ CPP_SOURCES += [
+ 'SkFontHost_linux.cpp',
+- 'SkFontHost_tables.cpp',
+ 'SkThread_pthread.cpp',
+ 'SkTime_Unix.cpp',
+ ]
diff --git a/www/firefox24/patches/patch-gfx_skia_src_sfnt_SkOTTable__head.h b/www/firefox24/patches/patch-gfx_skia_src_sfnt_SkOTTable__head.h
new file mode 100644
index 00000000000..48f3d4b956e
--- /dev/null
+++ b/www/firefox24/patches/patch-gfx_skia_src_sfnt_SkOTTable__head.h
@@ -0,0 +1,24 @@
+$NetBSD: patch-gfx_skia_src_sfnt_SkOTTable__head.h,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+* Fix build with NetBSD 5's gcc
+
+--- gfx/skia/src/sfnt/SkOTTable_head.h.orig 2013-01-04 23:44:33.000000000 +0000
++++ gfx/skia/src/sfnt/SkOTTable_head.h
+@@ -12,7 +12,7 @@
+ #include "SkOTTableTypes.h"
+ #include "SkTypedEnum.h"
+
+-#pragma pack(push, 1)
++#pragma pack(1)
+
+ struct SkOTTableHead {
+ static const SK_OT_CHAR TAG0 = 'h';
+@@ -140,7 +140,7 @@ struct SkOTTableHead {
+ } glyphDataFormat;
+ };
+
+-#pragma pack(pop)
++#pragma pack()
+
+
+ #include <stddef.h>
diff --git a/www/firefox24/patches/patch-gfx_skia_src_sfnt_SkOTTable__name.h b/www/firefox24/patches/patch-gfx_skia_src_sfnt_SkOTTable__name.h
new file mode 100644
index 00000000000..e37aca0cb28
--- /dev/null
+++ b/www/firefox24/patches/patch-gfx_skia_src_sfnt_SkOTTable__name.h
@@ -0,0 +1,24 @@
+$NetBSD: patch-gfx_skia_src_sfnt_SkOTTable__name.h,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+* Fix build with NetBSD 5's gcc
+
+--- gfx/skia/src/sfnt/SkOTTable_name.h.orig 2013-01-04 23:44:33.000000000 +0000
++++ gfx/skia/src/sfnt/SkOTTable_name.h
+@@ -12,7 +12,7 @@
+ #include "SkOTTableTypes.h"
+ #include "SkTypedEnum.h"
+
+-#pragma pack(push, 1)
++#pragma pack(1)
+
+ struct SkOTTableName {
+ static const SK_OT_CHAR TAG0 = 'n';
+@@ -499,7 +499,7 @@ struct SkOTTableNameRecord {
+ SK_OT_USHORT offset; //From start of storage area.
+ };
+
+-#pragma pack(pop)
++#pragma pack()
+
+
+ SK_COMPILE_ASSERT(sizeof(SkOTTableName) == 6, sizeof_SkOTTableName_not_6);
diff --git a/www/firefox24/patches/patch-gfx_skia_src_sfnt_SkSFNTHeader.h b/www/firefox24/patches/patch-gfx_skia_src_sfnt_SkSFNTHeader.h
new file mode 100644
index 00000000000..ce2e8f06d72
--- /dev/null
+++ b/www/firefox24/patches/patch-gfx_skia_src_sfnt_SkSFNTHeader.h
@@ -0,0 +1,24 @@
+$NetBSD: patch-gfx_skia_src_sfnt_SkSFNTHeader.h,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+* Fix build wth NetBSD 5's gcc
+
+--- gfx/skia/src/sfnt/SkSFNTHeader.h.orig 2013-01-04 23:44:33.000000000 +0000
++++ gfx/skia/src/sfnt/SkSFNTHeader.h
+@@ -15,7 +15,7 @@
+ typedef uint16_t SK_SFNT_USHORT;
+ typedef uint32_t SK_SFNT_ULONG;
+
+-#pragma pack(push, 1)
++#pragma pack(1)
+
+ struct SkSFNTHeader {
+ SK_SFNT_ULONG fontType;
+@@ -61,7 +61,7 @@ struct SkSFNTTableDirectoryEntry {
+ SK_SFNT_ULONG logicalLength;
+ };
+
+-#pragma pack(pop)
++#pragma pack()
+
+
+ SK_COMPILE_ASSERT(sizeof(SkSFNTHeader) == 12, sizeof_SkSFNTHeader_not_12);
diff --git a/www/firefox24/patches/patch-image_decoders_nsJPEGDecoder.cpp b/www/firefox24/patches/patch-image_decoders_nsJPEGDecoder.cpp
new file mode 100644
index 00000000000..96b10bfda00
--- /dev/null
+++ b/www/firefox24/patches/patch-image_decoders_nsJPEGDecoder.cpp
@@ -0,0 +1,363 @@
+$NetBSD: patch-image_decoders_nsJPEGDecoder.cpp,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- image/decoders/nsJPEGDecoder.cpp.orig 2013-05-11 19:19:31.000000000 +0000
++++ image/decoders/nsJPEGDecoder.cpp
+@@ -19,13 +19,28 @@
+
+ extern "C" {
+ #include "iccjpeg.h"
+-}
+
++#ifdef JCS_EXTENSIONS
+ #if defined(IS_BIG_ENDIAN)
+ #define MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB JCS_EXT_XRGB
+ #else
+ #define MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB JCS_EXT_BGRX
+ #endif
++#else
++/* Colorspace conversion (copied from jpegint.h) */
++struct jpeg_color_deconverter {
++ JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
++ JMETHOD(void, color_convert, (j_decompress_ptr cinfo,
++ JSAMPIMAGE input_buf, JDIMENSION input_row,
++ JSAMPARRAY output_buf, int num_rows));
++};
++
++METHODDEF(void)
++ycc_rgb_convert_argb (j_decompress_ptr cinfo,
++ JSAMPIMAGE input_buf, JDIMENSION input_row,
++ JSAMPARRAY output_buf, int num_rows);
++#endif
++}
+
+ static void cmyk_convert_rgb(JSAMPROW row, JDIMENSION width);
+
+@@ -338,6 +353,7 @@ nsJPEGDecoder::WriteInternal(const char
+ case JCS_GRAYSCALE:
+ case JCS_RGB:
+ case JCS_YCbCr:
++#ifdef JCS_EXTENSIONS
+ // if we're not color managing we can decode directly to
+ // MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB
+ if (mCMSMode != eCMSMode_All) {
+@@ -346,6 +362,9 @@ nsJPEGDecoder::WriteInternal(const char
+ } else {
+ mInfo.out_color_space = JCS_RGB;
+ }
++#else
++ mInfo.out_color_space = JCS_RGB;
++#endif
+ break;
+ case JCS_CMYK:
+ case JCS_YCCK:
+@@ -413,6 +432,15 @@ nsJPEGDecoder::WriteInternal(const char
+ return; /* I/O suspension */
+ }
+
++#ifndef JCS_EXTENSIONS
++ /* Force to use our YCbCr to Packed RGB converter when possible */
++ if (!mTransform && (mCMSMode != eCMSMode_All) &&
++ mInfo.jpeg_color_space == JCS_YCbCr && mInfo.out_color_space == JCS_RGB) {
++ /* Special case for the most common case: transform from YCbCr direct into packed ARGB */
++ mInfo.out_color_components = 4; /* Packed ARGB pixels are always 4 bytes...*/
++ 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;
+@@ -558,7 +586,11 @@ nsJPEGDecoder::OutputScanlines(bool* sus
+ uint32_t *imageRow = ((uint32_t*)mImageData) +
+ (mInfo.output_scanline * mInfo.output_width);
+
++#ifdef JCS_EXTENSIONS
+ if (mInfo.out_color_space == MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB) {
++#else
++ if (mInfo.cconvert->color_convert == ycc_rgb_convert_argb) {
++#endif
+ /* Special case: scanline will be directly converted into packed ARGB */
+ if (jpeg_read_scanlines(&mInfo, (JSAMPARRAY)&imageRow, 1) != 1) {
+ *suspend = true; /* suspend */
+@@ -868,6 +900,282 @@ term_source (j_decompress_ptr jd)
+ } // namespace mozilla
+
+
++#ifndef JCS_EXTENSIONS
++/**************** YCbCr -> Cairo's RGB24/ARGB32 conversion: most common case **************/
++
++/*
++ * YCbCr is defined per CCIR 601-1, except that Cb and Cr are
++ * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.
++ * The conversion equations to be implemented are therefore
++ * R = Y + 1.40200 * Cr
++ * G = Y - 0.34414 * Cb - 0.71414 * Cr
++ * B = Y + 1.77200 * Cb
++ * where Cb and Cr represent the incoming values less CENTERJSAMPLE.
++ * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.)
++ *
++ * To avoid floating-point arithmetic, we represent the fractional constants
++ * as integers scaled up by 2^16 (about 4 digits precision); we have to divide
++ * the products by 2^16, with appropriate rounding, to get the correct answer.
++ * Notice that Y, being an integral input, does not contribute any fraction
++ * so it need not participate in the rounding.
++ *
++ * For even more speed, we avoid doing any multiplications in the inner loop
++ * by precalculating the constants times Cb and Cr for all possible values.
++ * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table);
++ * for 12-bit samples it is still acceptable. It's not very reasonable for
++ * 16-bit samples, but if you want lossless storage you shouldn't be changing
++ * colorspace anyway.
++ * The Cr=>R and Cb=>B values can be rounded to integers in advance; the
++ * values for the G calculation are left scaled up, since we must add them
++ * together before rounding.
++ */
++
++#define SCALEBITS 16 /* speediest right-shift on some machines */
++
++/* Use static tables for color processing. */
++/* Four tables, each 256 entries of 4 bytes totals 4K which is not bad... */
++
++const int Cr_r_tab[(MAXJSAMPLE+1) * sizeof(int)] ={
++ -0xb3, -0xb2, -0xb1, -0xaf, -0xae, -0xac,
++ -0xab, -0xaa, -0xa8, -0xa7, -0xa5, -0xa4,
++ -0xa3, -0xa1, -0xa0, -0x9e, -0x9d, -0x9c,
++ -0x9a, -0x99, -0x97, -0x96, -0x95, -0x93,
++ -0x92, -0x90, -0x8f, -0x8e, -0x8c, -0x8b,
++ -0x89, -0x88, -0x87, -0x85, -0x84, -0x82,
++ -0x81, -0x80, -0x7e, -0x7d, -0x7b, -0x7a,
++ -0x79, -0x77, -0x76, -0x74, -0x73, -0x72,
++ -0x70, -0x6f, -0x6d, -0x6c, -0x6b, -0x69,
++ -0x68, -0x66, -0x65, -0x64, -0x62, -0x61,
++ -0x5f, -0x5e, -0x5d, -0x5b, -0x5a, -0x58,
++ -0x57, -0x56, -0x54, -0x53, -0x51, -0x50,
++ -0x4f, -0x4d, -0x4c, -0x4a, -0x49, -0x48,
++ -0x46, -0x45, -0x43, -0x42, -0x40, -0x3f,
++ -0x3e, -0x3c, -0x3b, -0x39, -0x38, -0x37,
++ -0x35, -0x34, -0x32, -0x31, -0x30, -0x2e,
++ -0x2d, -0x2b, -0x2a, -0x29, -0x27, -0x26,
++ -0x24, -0x23, -0x22, -0x20, -0x1f, -0x1d,
++ -0x1c, -0x1b, -0x19, -0x18, -0x16, -0x15,
++ -0x14, -0x12, -0x11, -0x0f, -0x0e, -0x0d,
++ -0x0b, -0x0a, -0x08, -0x07, -0x06, -0x04,
++ -0x03, -0x01, 0x00, 0x01, 0x03, 0x04,
++ 0x06, 0x07, 0x08, 0x0a, 0x0b, 0x0d,
++ 0x0e, 0x0f, 0x11, 0x12, 0x14, 0x15,
++ 0x16, 0x18, 0x19, 0x1b, 0x1c, 0x1d,
++ 0x1f, 0x20, 0x22, 0x23, 0x24, 0x26,
++ 0x27, 0x29, 0x2a, 0x2b, 0x2d, 0x2e,
++ 0x30, 0x31, 0x32, 0x34, 0x35, 0x37,
++ 0x38, 0x39, 0x3b, 0x3c, 0x3e, 0x3f,
++ 0x40, 0x42, 0x43, 0x45, 0x46, 0x48,
++ 0x49, 0x4a, 0x4c, 0x4d, 0x4f, 0x50,
++ 0x51, 0x53, 0x54, 0x56, 0x57, 0x58,
++ 0x5a, 0x5b, 0x5d, 0x5e, 0x5f, 0x61,
++ 0x62, 0x64, 0x65, 0x66, 0x68, 0x69,
++ 0x6b, 0x6c, 0x6d, 0x6f, 0x70, 0x72,
++ 0x73, 0x74, 0x76, 0x77, 0x79, 0x7a,
++ 0x7b, 0x7d, 0x7e, 0x80, 0x81, 0x82,
++ 0x84, 0x85, 0x87, 0x88, 0x89, 0x8b,
++ 0x8c, 0x8e, 0x8f, 0x90, 0x92, 0x93,
++ 0x95, 0x96, 0x97, 0x99, 0x9a, 0x9c,
++ 0x9d, 0x9e, 0xa0, 0xa1, 0xa3, 0xa4,
++ 0xa5, 0xa7, 0xa8, 0xaa, 0xab, 0xac,
++ 0xae, 0xaf, 0xb1, 0xb2,
++ };
++
++const int Cb_b_tab[(MAXJSAMPLE+1) * sizeof(int)] ={
++ -0xe3, -0xe1, -0xdf, -0xde, -0xdc, -0xda,
++ -0xd8, -0xd6, -0xd5, -0xd3, -0xd1, -0xcf,
++ -0xce, -0xcc, -0xca, -0xc8, -0xc6, -0xc5,
++ -0xc3, -0xc1, -0xbf, -0xbe, -0xbc, -0xba,
++ -0xb8, -0xb7, -0xb5, -0xb3, -0xb1, -0xaf,
++ -0xae, -0xac, -0xaa, -0xa8, -0xa7, -0xa5,
++ -0xa3, -0xa1, -0x9f, -0x9e, -0x9c, -0x9a,
++ -0x98, -0x97, -0x95, -0x93, -0x91, -0x90,
++ -0x8e, -0x8c, -0x8a, -0x88, -0x87, -0x85,
++ -0x83, -0x81, -0x80, -0x7e, -0x7c, -0x7a,
++ -0x78, -0x77, -0x75, -0x73, -0x71, -0x70,
++ -0x6e, -0x6c, -0x6a, -0x69, -0x67, -0x65,
++ -0x63, -0x61, -0x60, -0x5e, -0x5c, -0x5a,
++ -0x59, -0x57, -0x55, -0x53, -0x52, -0x50,
++ -0x4e, -0x4c, -0x4a, -0x49, -0x47, -0x45,
++ -0x43, -0x42, -0x40, -0x3e, -0x3c, -0x3a,
++ -0x39, -0x37, -0x35, -0x33, -0x32, -0x30,
++ -0x2e, -0x2c, -0x2b, -0x29, -0x27, -0x25,
++ -0x23, -0x22, -0x20, -0x1e, -0x1c, -0x1b,
++ -0x19, -0x17, -0x15, -0x13, -0x12, -0x10,
++ -0x0e, -0x0c, -0x0b, -0x09, -0x07, -0x05,
++ -0x04, -0x02, 0x00, 0x02, 0x04, 0x05,
++ 0x07, 0x09, 0x0b, 0x0c, 0x0e, 0x10,
++ 0x12, 0x13, 0x15, 0x17, 0x19, 0x1b,
++ 0x1c, 0x1e, 0x20, 0x22, 0x23, 0x25,
++ 0x27, 0x29, 0x2b, 0x2c, 0x2e, 0x30,
++ 0x32, 0x33, 0x35, 0x37, 0x39, 0x3a,
++ 0x3c, 0x3e, 0x40, 0x42, 0x43, 0x45,
++ 0x47, 0x49, 0x4a, 0x4c, 0x4e, 0x50,
++ 0x52, 0x53, 0x55, 0x57, 0x59, 0x5a,
++ 0x5c, 0x5e, 0x60, 0x61, 0x63, 0x65,
++ 0x67, 0x69, 0x6a, 0x6c, 0x6e, 0x70,
++ 0x71, 0x73, 0x75, 0x77, 0x78, 0x7a,
++ 0x7c, 0x7e, 0x80, 0x81, 0x83, 0x85,
++ 0x87, 0x88, 0x8a, 0x8c, 0x8e, 0x90,
++ 0x91, 0x93, 0x95, 0x97, 0x98, 0x9a,
++ 0x9c, 0x9e, 0x9f, 0xa1, 0xa3, 0xa5,
++ 0xa7, 0xa8, 0xaa, 0xac, 0xae, 0xaf,
++ 0xb1, 0xb3, 0xb5, 0xb7, 0xb8, 0xba,
++ 0xbc, 0xbe, 0xbf, 0xc1, 0xc3, 0xc5,
++ 0xc6, 0xc8, 0xca, 0xcc, 0xce, 0xcf,
++ 0xd1, 0xd3, 0xd5, 0xd6, 0xd8, 0xda,
++ 0xdc, 0xde, 0xdf, 0xe1,
++ };
++
++const int Cr_g_tab[(MAXJSAMPLE+1) * sizeof(int)] ={
++ 0x5b6900, 0x5ab22e, 0x59fb5c, 0x59448a, 0x588db8, 0x57d6e6,
++ 0x572014, 0x566942, 0x55b270, 0x54fb9e, 0x5444cc, 0x538dfa,
++ 0x52d728, 0x522056, 0x516984, 0x50b2b2, 0x4ffbe0, 0x4f450e,
++ 0x4e8e3c, 0x4dd76a, 0x4d2098, 0x4c69c6, 0x4bb2f4, 0x4afc22,
++ 0x4a4550, 0x498e7e, 0x48d7ac, 0x4820da, 0x476a08, 0x46b336,
++ 0x45fc64, 0x454592, 0x448ec0, 0x43d7ee, 0x43211c, 0x426a4a,
++ 0x41b378, 0x40fca6, 0x4045d4, 0x3f8f02, 0x3ed830, 0x3e215e,
++ 0x3d6a8c, 0x3cb3ba, 0x3bfce8, 0x3b4616, 0x3a8f44, 0x39d872,
++ 0x3921a0, 0x386ace, 0x37b3fc, 0x36fd2a, 0x364658, 0x358f86,
++ 0x34d8b4, 0x3421e2, 0x336b10, 0x32b43e, 0x31fd6c, 0x31469a,
++ 0x308fc8, 0x2fd8f6, 0x2f2224, 0x2e6b52, 0x2db480, 0x2cfdae,
++ 0x2c46dc, 0x2b900a, 0x2ad938, 0x2a2266, 0x296b94, 0x28b4c2,
++ 0x27fdf0, 0x27471e, 0x26904c, 0x25d97a, 0x2522a8, 0x246bd6,
++ 0x23b504, 0x22fe32, 0x224760, 0x21908e, 0x20d9bc, 0x2022ea,
++ 0x1f6c18, 0x1eb546, 0x1dfe74, 0x1d47a2, 0x1c90d0, 0x1bd9fe,
++ 0x1b232c, 0x1a6c5a, 0x19b588, 0x18feb6, 0x1847e4, 0x179112,
++ 0x16da40, 0x16236e, 0x156c9c, 0x14b5ca, 0x13fef8, 0x134826,
++ 0x129154, 0x11da82, 0x1123b0, 0x106cde, 0x0fb60c, 0x0eff3a,
++ 0x0e4868, 0x0d9196, 0x0cdac4, 0x0c23f2, 0x0b6d20, 0x0ab64e,
++ 0x09ff7c, 0x0948aa, 0x0891d8, 0x07db06, 0x072434, 0x066d62,
++ 0x05b690, 0x04ffbe, 0x0448ec, 0x03921a, 0x02db48, 0x022476,
++ 0x016da4, 0x00b6d2, 0x000000, -0x00b6d2, -0x016da4, -0x022476,
++ -0x02db48, -0x03921a, -0x0448ec, -0x04ffbe, -0x05b690, -0x066d62,
++ -0x072434, -0x07db06, -0x0891d8, -0x0948aa, -0x09ff7c, -0x0ab64e,
++ -0x0b6d20, -0x0c23f2, -0x0cdac4, -0x0d9196, -0x0e4868, -0x0eff3a,
++ -0x0fb60c, -0x106cde, -0x1123b0, -0x11da82, -0x129154, -0x134826,
++ -0x13fef8, -0x14b5ca, -0x156c9c, -0x16236e, -0x16da40, -0x179112,
++ -0x1847e4, -0x18feb6, -0x19b588, -0x1a6c5a, -0x1b232c, -0x1bd9fe,
++ -0x1c90d0, -0x1d47a2, -0x1dfe74, -0x1eb546, -0x1f6c18, -0x2022ea,
++ -0x20d9bc, -0x21908e, -0x224760, -0x22fe32, -0x23b504, -0x246bd6,
++ -0x2522a8, -0x25d97a, -0x26904c, -0x27471e, -0x27fdf0, -0x28b4c2,
++ -0x296b94, -0x2a2266, -0x2ad938, -0x2b900a, -0x2c46dc, -0x2cfdae,
++ -0x2db480, -0x2e6b52, -0x2f2224, -0x2fd8f6, -0x308fc8, -0x31469a,
++ -0x31fd6c, -0x32b43e, -0x336b10, -0x3421e2, -0x34d8b4, -0x358f86,
++ -0x364658, -0x36fd2a, -0x37b3fc, -0x386ace, -0x3921a0, -0x39d872,
++ -0x3a8f44, -0x3b4616, -0x3bfce8, -0x3cb3ba, -0x3d6a8c, -0x3e215e,
++ -0x3ed830, -0x3f8f02, -0x4045d4, -0x40fca6, -0x41b378, -0x426a4a,
++ -0x43211c, -0x43d7ee, -0x448ec0, -0x454592, -0x45fc64, -0x46b336,
++ -0x476a08, -0x4820da, -0x48d7ac, -0x498e7e, -0x4a4550, -0x4afc22,
++ -0x4bb2f4, -0x4c69c6, -0x4d2098, -0x4dd76a, -0x4e8e3c, -0x4f450e,
++ -0x4ffbe0, -0x50b2b2, -0x516984, -0x522056, -0x52d728, -0x538dfa,
++ -0x5444cc, -0x54fb9e, -0x55b270, -0x566942, -0x572014, -0x57d6e6,
++ -0x588db8, -0x59448a, -0x59fb5c, -0x5ab22e,
++ };
++
++const int Cb_g_tab[(MAXJSAMPLE+1) * sizeof(int)] ={
++ 0x2c8d00, 0x2c34e6, 0x2bdccc, 0x2b84b2, 0x2b2c98, 0x2ad47e,
++ 0x2a7c64, 0x2a244a, 0x29cc30, 0x297416, 0x291bfc, 0x28c3e2,
++ 0x286bc8, 0x2813ae, 0x27bb94, 0x27637a, 0x270b60, 0x26b346,
++ 0x265b2c, 0x260312, 0x25aaf8, 0x2552de, 0x24fac4, 0x24a2aa,
++ 0x244a90, 0x23f276, 0x239a5c, 0x234242, 0x22ea28, 0x22920e,
++ 0x2239f4, 0x21e1da, 0x2189c0, 0x2131a6, 0x20d98c, 0x208172,
++ 0x202958, 0x1fd13e, 0x1f7924, 0x1f210a, 0x1ec8f0, 0x1e70d6,
++ 0x1e18bc, 0x1dc0a2, 0x1d6888, 0x1d106e, 0x1cb854, 0x1c603a,
++ 0x1c0820, 0x1bb006, 0x1b57ec, 0x1affd2, 0x1aa7b8, 0x1a4f9e,
++ 0x19f784, 0x199f6a, 0x194750, 0x18ef36, 0x18971c, 0x183f02,
++ 0x17e6e8, 0x178ece, 0x1736b4, 0x16de9a, 0x168680, 0x162e66,
++ 0x15d64c, 0x157e32, 0x152618, 0x14cdfe, 0x1475e4, 0x141dca,
++ 0x13c5b0, 0x136d96, 0x13157c, 0x12bd62, 0x126548, 0x120d2e,
++ 0x11b514, 0x115cfa, 0x1104e0, 0x10acc6, 0x1054ac, 0x0ffc92,
++ 0x0fa478, 0x0f4c5e, 0x0ef444, 0x0e9c2a, 0x0e4410, 0x0debf6,
++ 0x0d93dc, 0x0d3bc2, 0x0ce3a8, 0x0c8b8e, 0x0c3374, 0x0bdb5a,
++ 0x0b8340, 0x0b2b26, 0x0ad30c, 0x0a7af2, 0x0a22d8, 0x09cabe,
++ 0x0972a4, 0x091a8a, 0x08c270, 0x086a56, 0x08123c, 0x07ba22,
++ 0x076208, 0x0709ee, 0x06b1d4, 0x0659ba, 0x0601a0, 0x05a986,
++ 0x05516c, 0x04f952, 0x04a138, 0x04491e, 0x03f104, 0x0398ea,
++ 0x0340d0, 0x02e8b6, 0x02909c, 0x023882, 0x01e068, 0x01884e,
++ 0x013034, 0x00d81a, 0x008000, 0x0027e6, -0x003034, -0x00884e,
++ -0x00e068, -0x013882, -0x01909c, -0x01e8b6, -0x0240d0, -0x0298ea,
++ -0x02f104, -0x03491e, -0x03a138, -0x03f952, -0x04516c, -0x04a986,
++ -0x0501a0, -0x0559ba, -0x05b1d4, -0x0609ee, -0x066208, -0x06ba22,
++ -0x07123c, -0x076a56, -0x07c270, -0x081a8a, -0x0872a4, -0x08cabe,
++ -0x0922d8, -0x097af2, -0x09d30c, -0x0a2b26, -0x0a8340, -0x0adb5a,
++ -0x0b3374, -0x0b8b8e, -0x0be3a8, -0x0c3bc2, -0x0c93dc, -0x0cebf6,
++ -0x0d4410, -0x0d9c2a, -0x0df444, -0x0e4c5e, -0x0ea478, -0x0efc92,
++ -0x0f54ac, -0x0facc6, -0x1004e0, -0x105cfa, -0x10b514, -0x110d2e,
++ -0x116548, -0x11bd62, -0x12157c, -0x126d96, -0x12c5b0, -0x131dca,
++ -0x1375e4, -0x13cdfe, -0x142618, -0x147e32, -0x14d64c, -0x152e66,
++ -0x158680, -0x15de9a, -0x1636b4, -0x168ece, -0x16e6e8, -0x173f02,
++ -0x17971c, -0x17ef36, -0x184750, -0x189f6a, -0x18f784, -0x194f9e,
++ -0x19a7b8, -0x19ffd2, -0x1a57ec, -0x1ab006, -0x1b0820, -0x1b603a,
++ -0x1bb854, -0x1c106e, -0x1c6888, -0x1cc0a2, -0x1d18bc, -0x1d70d6,
++ -0x1dc8f0, -0x1e210a, -0x1e7924, -0x1ed13e, -0x1f2958, -0x1f8172,
++ -0x1fd98c, -0x2031a6, -0x2089c0, -0x20e1da, -0x2139f4, -0x21920e,
++ -0x21ea28, -0x224242, -0x229a5c, -0x22f276, -0x234a90, -0x23a2aa,
++ -0x23fac4, -0x2452de, -0x24aaf8, -0x250312, -0x255b2c, -0x25b346,
++ -0x260b60, -0x26637a, -0x26bb94, -0x2713ae, -0x276bc8, -0x27c3e2,
++ -0x281bfc, -0x287416, -0x28cc30, -0x29244a, -0x297c64, -0x29d47e,
++ -0x2a2c98, -0x2a84b2, -0x2adccc, -0x2b34e6,
++ };
++
++
++/* We assume that right shift corresponds to signed division by 2 with
++ * rounding towards minus infinity. This is correct for typical "arithmetic
++ * shift" instructions that shift in copies of the sign bit. But some
++ * C compilers implement >> with an unsigned shift. For these machines you
++ * must define RIGHT_SHIFT_IS_UNSIGNED.
++ * RIGHT_SHIFT provides a proper signed right shift of an INT32 quantity.
++ * It is only applied with constant shift counts. SHIFT_TEMPS must be
++ * included in the variables of any routine using RIGHT_SHIFT.
++ */
++
++#ifdef RIGHT_SHIFT_IS_UNSIGNED
++#define SHIFT_TEMPS INT32 shift_temp;
++#define RIGHT_SHIFT(x,shft) \
++ ((shift_temp = (x)) < 0 ? \
++ (shift_temp >> (shft)) | ((~((INT32) 0)) << (32-(shft))) : \
++ (shift_temp >> (shft)))
++#else
++#define SHIFT_TEMPS
++#define RIGHT_SHIFT(x,shft) ((x) >> (shft))
++#endif
++
++
++METHODDEF(void)
++ycc_rgb_convert_argb (j_decompress_ptr cinfo,
++ JSAMPIMAGE input_buf, JDIMENSION input_row,
++ JSAMPARRAY output_buf, int num_rows)
++{
++ JDIMENSION num_cols = cinfo->output_width;
++ JSAMPLE * range_limit = cinfo->sample_range_limit;
++
++ SHIFT_TEMPS
++
++ /* This is used if we don't have SSE2 */
++
++ while (--num_rows >= 0) {
++ JSAMPROW inptr0 = input_buf[0][input_row];
++ JSAMPROW inptr1 = input_buf[1][input_row];
++ JSAMPROW inptr2 = input_buf[2][input_row];
++ input_row++;
++ uint32_t *outptr = (uint32_t *) *output_buf++;
++ for (JDIMENSION col = 0; col < num_cols; col++) {
++ int y = GETJSAMPLE(inptr0[col]);
++ int cb = GETJSAMPLE(inptr1[col]);
++ int cr = GETJSAMPLE(inptr2[col]);
++ JSAMPLE * range_limit_y = range_limit + y;
++ /* Range-limiting is essential due to noise introduced by DCT losses. */
++ outptr[col] = 0xFF000000 |
++ ( range_limit_y[Cr_r_tab[cr]] << 16 ) |
++ ( range_limit_y[((int) RIGHT_SHIFT(Cb_g_tab[cb] + Cr_g_tab[cr], SCALEBITS))] << 8 ) |
++ ( range_limit_y[Cb_b_tab[cb]] );
++ }
++ }
++}
++#endif
++
++
+ /**************** Inverted CMYK -> RGB conversion **************/
+ /*
+ * Input is (Inverted) CMYK stored as 4 bytes per pixel.
diff --git a/www/firefox24/patches/patch-intl_hyphenation_src_hnjalloc.h b/www/firefox24/patches/patch-intl_hyphenation_src_hnjalloc.h
new file mode 100644
index 00000000000..35b83582498
--- /dev/null
+++ b/www/firefox24/patches/patch-intl_hyphenation_src_hnjalloc.h
@@ -0,0 +1,14 @@
+$NetBSD: patch-intl_hyphenation_src_hnjalloc.h,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- intl/hyphenation/src/hnjalloc.h.orig 2013-05-11 19:19:31.000000000 +0000
++++ intl/hyphenation/src/hnjalloc.h
+@@ -56,6 +56,9 @@
+ */
+
+ #include <stdio.h> /* ensure stdio.h is loaded before our macros */
++#ifdef __sun
++#include <wchar.h>
++#endif
+
+ #undef FILE
+ #define FILE hnjFile
diff --git a/www/firefox24/patches/patch-ipc_chromium_Makefile.in b/www/firefox24/patches/patch-ipc_chromium_Makefile.in
new file mode 100644
index 00000000000..9667f92ccf8
--- /dev/null
+++ b/www/firefox24/patches/patch-ipc_chromium_Makefile.in
@@ -0,0 +1,49 @@
+$NetBSD: patch-ipc_chromium_Makefile.in,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- ipc/chromium/Makefile.in.orig 2013-09-10 03:43:34.000000000 +0000
++++ ipc/chromium/Makefile.in
+@@ -23,9 +23,7 @@ vpath %.c \
+ $(srcdir)/src/third_party/libevent \
+ $(NULL)
+ else # } else {
+-# message_pump_libevent.cc includes third_party/libevent/event.h,
+-# which we put in $(DIST), see export rule below
+-LOCAL_INCLUDES += -I$(DIST)
++LOCAL_INCLUDES += $(filter %/compat, $(MOZ_LIBEVENT_CFLAGS))
+ endif # }
+
+ vpath %.cc \
+@@ -68,6 +66,33 @@ CMMSRCS += \
+
+ endif # } OS_MACOSX
+
++ifdef OS_SOLARIS # {
++
++CPPSRCS += \
++ atomicops_internals_x86_gcc.cc \
++ process_util_linux.cc \
++ time_posix.cc \
++ $(NULL)
++
++ifdef MOZ_ENABLE_GTK2
++CPPSRCS += \
++ message_pump_glib.cc \
++ $(NULL)
++endif
++
++ifdef MOZ_ENABLE_QT
++MOCSRCS = \
++ moc_message_pump_qt.cc \
++ $(NULL)
++
++CPPSRCS += \
++ $(MOCSRCS) \
++ message_pump_qt.cc \
++ $(NULL)
++endif
++
++endif # } OS_SOLARIS
++
+ # libevent
+
+ ifndef MOZ_NATIVE_LIBEVENT # {
diff --git a/www/firefox24/patches/patch-ipc_chromium_chromium-config.mk b/www/firefox24/patches/patch-ipc_chromium_chromium-config.mk
new file mode 100644
index 00000000000..35a3e76e281
--- /dev/null
+++ b/www/firefox24/patches/patch-ipc_chromium_chromium-config.mk
@@ -0,0 +1,25 @@
+$NetBSD: patch-ipc_chromium_chromium-config.mk,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- ipc/chromium/chromium-config.mk.orig 2013-07-30 00:58:17.000000000 +0000
++++ ipc/chromium/chromium-config.mk
+@@ -105,6 +105,14 @@ DEFINES += \
+ $(NULL)
+
+ else # } {
++ifeq ($(OS_ARCH),SunOS) # {
++
++OS_SOLARIS = 1
++DEFINES += \
++ -DOS_SOLARIS=1 \
++ $(NULL)
++
++else # } {
+
+ OS_LINUX = 1
+ DEFINES += \
+@@ -117,4 +125,5 @@ endif # }
+ endif # }
+ endif # }
+ endif # }
++endif # }
+
diff --git a/www/firefox24/patches/patch-ipc_chromium_src_base_base__paths.h b/www/firefox24/patches/patch-ipc_chromium_src_base_base__paths.h
new file mode 100644
index 00000000000..30b581e71cc
--- /dev/null
+++ b/www/firefox24/patches/patch-ipc_chromium_src_base_base__paths.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-ipc_chromium_src_base_base__paths.h,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- ipc/chromium/src/base/base_paths.h.orig 2013-05-11 19:19:32.000000000 +0000
++++ ipc/chromium/src/base/base_paths.h
+@@ -13,7 +13,7 @@
+ #include "base/base_paths_win.h"
+ #elif defined(OS_MACOSX)
+ #include "base/base_paths_mac.h"
+-#elif defined(OS_LINUX) || defined(OS_BSD)
++#elif defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
+ #include "base/base_paths_linux.h"
+ #endif
+ #include "base/path_service.h"
diff --git a/www/firefox24/patches/patch-ipc_chromium_src_base_debug__util__posix.cc b/www/firefox24/patches/patch-ipc_chromium_src_base_debug__util__posix.cc
new file mode 100644
index 00000000000..8d2de635881
--- /dev/null
+++ b/www/firefox24/patches/patch-ipc_chromium_src_base_debug__util__posix.cc
@@ -0,0 +1,13 @@
+$NetBSD: patch-ipc_chromium_src_base_debug__util__posix.cc,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- ipc/chromium/src/base/debug_util_posix.cc.orig 2013-05-11 19:19:32.000000000 +0000
++++ ipc/chromium/src/base/debug_util_posix.cc
+@@ -107,7 +107,7 @@ bool DebugUtil::BeingDebugged() {
+ return being_debugged;
+ }
+
+-#elif defined(OS_LINUX)
++#elif defined(OS_LINUX) || defined(OS_SOLARIS)
+
+ // We can look in /proc/self/status for TracerPid. We are likely used in crash
+ // handling, so we are careful not to use the heap or have side effects.
diff --git a/www/firefox24/patches/patch-ipc_chromium_src_base_file__util.h b/www/firefox24/patches/patch-ipc_chromium_src_base_file__util.h
new file mode 100644
index 00000000000..d135fdd5887
--- /dev/null
+++ b/www/firefox24/patches/patch-ipc_chromium_src_base_file__util.h
@@ -0,0 +1,23 @@
+$NetBSD: patch-ipc_chromium_src_base_file__util.h,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- ipc/chromium/src/base/file_util.h.orig 2013-05-11 19:19:32.000000000 +0000
++++ ipc/chromium/src/base/file_util.h
+@@ -16,7 +16,9 @@
+ #include <sys/stat.h>
+ #elif defined(OS_POSIX)
+ #include <sys/types.h>
++#if !defined(OS_SOLARIS)
+ #include <fts.h>
++#endif
+ #include <sys/stat.h>
+ #endif
+
+@@ -466,7 +468,7 @@ class FileEnumerator {
+ #if defined(OS_WIN)
+ WIN32_FIND_DATA find_data_;
+ HANDLE find_handle_;
+-#elif defined(ANDROID)
++#elif defined(ANDROID) || defined(OS_SOLARIS)
+ void *fts_;
+ #elif defined(OS_POSIX)
+ FTS* fts_;
diff --git a/www/firefox24/patches/patch-ipc_chromium_src_base_file__util__posix.cc b/www/firefox24/patches/patch-ipc_chromium_src_base_file__util__posix.cc
new file mode 100644
index 00000000000..635bd44f4a4
--- /dev/null
+++ b/www/firefox24/patches/patch-ipc_chromium_src_base_file__util__posix.cc
@@ -0,0 +1,58 @@
+$NetBSD: patch-ipc_chromium_src_base_file__util__posix.cc,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- ipc/chromium/src/base/file_util_posix.cc.orig 2013-05-11 19:19:32.000000000 +0000
++++ ipc/chromium/src/base/file_util_posix.cc
+@@ -8,7 +8,7 @@
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <fnmatch.h>
+-#ifndef ANDROID
++#if !defined(ANDROID) && !defined(OS_SOLARIS)
+ #include <fts.h>
+ #endif
+ #include <libgen.h>
+@@ -121,7 +121,7 @@ bool Delete(const FilePath& path, bool r
+ if (!recursive)
+ return (rmdir(path_str) == 0);
+
+-#ifdef ANDROID
++#if defined(ANDROID) || defined(OS_SOLARIS)
+ // XXX Need ftsless impl for bionic
+ return false;
+ #else
+@@ -194,7 +194,7 @@ bool CopyDirectory(const FilePath& from_
+ return false;
+ }
+
+-#ifdef ANDROID
++#if defined(ANDROID) || defined(OS_SOLARIS)
+ // XXX Need ftsless impl for bionic
+ return false;
+ #else
+@@ -613,7 +613,7 @@ FileEnumerator::FileEnumerator(const Fil
+ }
+
+ FileEnumerator::~FileEnumerator() {
+-#ifndef ANDROID
++#if !defined(ANDROID) && !defined(OS_SOLARIS)
+ if (fts_)
+ fts_close(fts_);
+ #endif
+@@ -625,7 +625,7 @@ void FileEnumerator::GetFindInfo(FindInf
+ if (!is_in_find_op_)
+ return;
+
+-#ifndef ANDROID
++#if !defined(ANDROID) && !defined(OS_SOLARIS)
+ memcpy(&(info->stat), fts_ent_->fts_statp, sizeof(info->stat));
+ info->filename.assign(fts_ent_->fts_name);
+ #endif
+@@ -636,7 +636,7 @@ void FileEnumerator::GetFindInfo(FindInf
+ // large directories with many files this can be quite deep.
+ // TODO(erikkay) - get rid of this recursive pattern
+ FilePath FileEnumerator::Next() {
+-#ifdef ANDROID
++#if defined(ANDROID) || defined(OS_SOLARIS)
+ return FilePath();
+ #else
+ if (!is_in_find_op_) {
diff --git a/www/firefox24/patches/patch-ipc_chromium_src_base_file__version__info.h b/www/firefox24/patches/patch-ipc_chromium_src_base_file__version__info.h
new file mode 100644
index 00000000000..081cbb38e8b
--- /dev/null
+++ b/www/firefox24/patches/patch-ipc_chromium_src_base_file__version__info.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-ipc_chromium_src_base_file__version__info.h,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+* Treat Solaris/SunOS like Linux, fix build.
+
+--- ipc/chromium/src/base/file_version_info.h.orig 2013-09-11 03:22:31.000000000 +0000
++++ ipc/chromium/src/base/file_version_info.h
+@@ -86,7 +86,7 @@ class FileVersionInfo {
+ explicit FileVersionInfo(NSBundle *bundle);
+
+ NSBundle *bundle_;
+-#elif defined(OS_LINUX)
++#elif defined(OS_LINUX) || defined(OS_SOLARIS)
+ FileVersionInfo();
+ #endif
+
diff --git a/www/firefox24/patches/patch-ipc_chromium_src_base_message__pump__libevent.cc b/www/firefox24/patches/patch-ipc_chromium_src_base_message__pump__libevent.cc
new file mode 100644
index 00000000000..23f526af2bb
--- /dev/null
+++ b/www/firefox24/patches/patch-ipc_chromium_src_base_message__pump__libevent.cc
@@ -0,0 +1,13 @@
+$NetBSD: patch-ipc_chromium_src_base_message__pump__libevent.cc,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- ipc/chromium/src/base/message_pump_libevent.cc.orig 2013-05-11 19:19:32.000000000 +0000
++++ ipc/chromium/src/base/message_pump_libevent.cc
+@@ -16,7 +16,7 @@
+ #include "base/scoped_ptr.h"
+ #include "base/time.h"
+ #include "nsDependentSubstring.h"
+-#include "third_party/libevent/event.h"
++#include "event.h"
+
+ // Lifecycle of struct event
+ // Libevent uses two main data structures:
diff --git a/www/firefox24/patches/patch-ipc_chromium_src_base_platform__thread.h b/www/firefox24/patches/patch-ipc_chromium_src_base_platform__thread.h
new file mode 100644
index 00000000000..ffcf8dcca57
--- /dev/null
+++ b/www/firefox24/patches/patch-ipc_chromium_src_base_platform__thread.h
@@ -0,0 +1,14 @@
+$NetBSD: patch-ipc_chromium_src_base_platform__thread.h,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- ipc/chromium/src/base/platform_thread.h.orig 2013-09-10 03:43:34.000000000 +0000
++++ ipc/chromium/src/base/platform_thread.h
+@@ -25,6 +25,9 @@ typedef pthread_t PlatformThreadHandle;
+ #if defined(OS_LINUX) || defined(OS_OPENBSD) || defined(__GLIBC__)
+ #include <unistd.h>
+ typedef pid_t PlatformThreadId;
++#elif defined(OS_SOLARIS)
++#include <sys/lwp.h>
++typedef lwpid_t PlatformThreadId;
+ #elif defined(OS_BSD)
+ #include <sys/types.h>
+ typedef lwpid_t PlatformThreadId;
diff --git a/www/firefox24/patches/patch-ipc_chromium_src_base_platform__thread__posix.cc b/www/firefox24/patches/patch-ipc_chromium_src_base_platform__thread__posix.cc
new file mode 100644
index 00000000000..f563326a5a4
--- /dev/null
+++ b/www/firefox24/patches/patch-ipc_chromium_src_base_platform__thread__posix.cc
@@ -0,0 +1,24 @@
+$NetBSD: patch-ipc_chromium_src_base_platform__thread__posix.cc,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- ipc/chromium/src/base/platform_thread_posix.cc.orig 2013-09-10 03:43:34.000000000 +0000
++++ ipc/chromium/src/base/platform_thread_posix.cc
+@@ -10,7 +10,9 @@
+ #if defined(OS_MACOSX)
+ #include <mach/mach.h>
+ #elif defined(OS_NETBSD)
++_Pragma("GCC visibility push(default)")
+ #include <lwp.h>
++_Pragma("GCC visibility pop")
+ #elif defined(OS_LINUX)
+ #include <sys/syscall.h>
+ #include <sys/prctl.h>
+@@ -110,7 +112,8 @@ void PlatformThread::SetName(const char*
+ pthread_setname_np(pthread_self(), "%s", (void *)name);
+ #elif defined(OS_BSD) && !defined(__GLIBC__)
+ pthread_set_name_np(pthread_self(), name);
+-#else
++#elif !defined(OS_SOLARIS)
++ prctl(PR_SET_NAME, reinterpret_cast<uintptr_t>(name), 0, 0, 0);
+ #endif
+ }
+ #endif // !OS_MACOSX
diff --git a/www/firefox24/patches/patch-ipc_chromium_src_base_process__util.h b/www/firefox24/patches/patch-ipc_chromium_src_base_process__util.h
new file mode 100644
index 00000000000..779d3895566
--- /dev/null
+++ b/www/firefox24/patches/patch-ipc_chromium_src_base_process__util.h
@@ -0,0 +1,32 @@
+$NetBSD: patch-ipc_chromium_src_base_process__util.h,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- ipc/chromium/src/base/process_util.h.orig 2013-09-10 03:43:34.000000000 +0000
++++ ipc/chromium/src/base/process_util.h
+@@ -13,7 +13,7 @@
+ #if defined(OS_WIN)
+ #include <windows.h>
+ #include <tlhelp32.h>
+-#elif defined(OS_LINUX) || defined(__GLIBC__)
++#elif defined(OS_LINUX) || defined(__GLIBC__) || defined(OS_SOLARIS)
+ #include <dirent.h>
+ #include <limits.h>
+ #include <sys/types.h>
+@@ -32,6 +32,9 @@
+ typedef PROCESSENTRY32 ProcessEntry;
+ typedef IO_COUNTERS IoCounters;
+ #elif defined(OS_POSIX)
++#ifndef NAME_MAX
++#define NAME_MAX _POSIX_NAME_MAX
++#endif
+ // TODO(port): we should not rely on a Win32 structure.
+ struct ProcessEntry {
+ int pid;
+@@ -316,7 +319,7 @@ class NamedProcessIterator {
+ #if defined(OS_WIN)
+ HANDLE snapshot_;
+ bool started_iteration_;
+-#elif defined(OS_LINUX) || defined(__GLIBC__)
++#elif defined(OS_LINUX) || defined(__GLIBC__) || defined(OS_SOLARIS)
+ DIR *procfs_dir_;
+ #elif defined(OS_BSD)
+ std::vector<ProcessEntry> content;
diff --git a/www/firefox24/patches/patch-ipc_chromium_src_base_process__util__posix.cc b/www/firefox24/patches/patch-ipc_chromium_src_base_process__util__posix.cc
new file mode 100644
index 00000000000..ba91664e278
--- /dev/null
+++ b/www/firefox24/patches/patch-ipc_chromium_src_base_process__util__posix.cc
@@ -0,0 +1,22 @@
+$NetBSD: patch-ipc_chromium_src_base_process__util__posix.cc,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- ipc/chromium/src/base/process_util_posix.cc.orig 2013-05-11 19:19:32.000000000 +0000
++++ ipc/chromium/src/base/process_util_posix.cc
+@@ -110,7 +110,7 @@ void CloseSuperfluousFds(const base::Inj
+ #if defined(ANDROID)
+ static const rlim_t kSystemDefaultMaxFds = 1024;
+ static const char kFDDir[] = "/proc/self/fd";
+-#elif defined(OS_LINUX)
++#elif defined(OS_LINUX) || defined(OS_SOLARIS)
+ static const rlim_t kSystemDefaultMaxFds = 8192;
+ static const char kFDDir[] = "/proc/self/fd";
+ #elif defined(OS_MACOSX)
+@@ -202,7 +202,7 @@ void CloseSuperfluousFds(const base::Inj
+ // TODO(agl): Remove this function. It's fundamentally broken for multithreaded
+ // apps.
+ void SetAllFDsToCloseOnExec() {
+-#if defined(OS_LINUX)
++#if defined(OS_LINUX) || defined(OS_SOLARIS)
+ const char fd_dir[] = "/proc/self/fd";
+ #elif defined(OS_MACOSX) || defined(OS_BSD)
+ const char fd_dir[] = "/dev/fd";
diff --git a/www/firefox24/patches/patch-ipc_chromium_src_base_sys__info__posix.cc b/www/firefox24/patches/patch-ipc_chromium_src_base_sys__info__posix.cc
new file mode 100644
index 00000000000..36aaa595907
--- /dev/null
+++ b/www/firefox24/patches/patch-ipc_chromium_src_base_sys__info__posix.cc
@@ -0,0 +1,40 @@
+$NetBSD: patch-ipc_chromium_src_base_sys__info__posix.cc,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- ipc/chromium/src/base/sys_info_posix.cc.orig 2013-05-11 19:19:32.000000000 +0000
++++ ipc/chromium/src/base/sys_info_posix.cc
+@@ -119,7 +119,11 @@ std::wstring SysInfo::GetEnvVar(const wc
+
+ // static
+ std::string SysInfo::OperatingSystemName() {
++#ifdef OS_SOLARIS
++ struct utsname info;
++#else
+ utsname info;
++#endif
+ if (uname(&info) < 0) {
+ NOTREACHED();
+ return "";
+@@ -129,7 +133,11 @@ std::string SysInfo::OperatingSystemName
+
+ // static
+ std::string SysInfo::OperatingSystemVersion() {
++#ifdef OS_SOLARIS
++ struct utsname info;
++#else
+ utsname info;
++#endif
+ if (uname(&info) < 0) {
+ NOTREACHED();
+ return "";
+@@ -139,7 +147,11 @@ std::string SysInfo::OperatingSystemVers
+
+ // static
+ std::string SysInfo::CPUArchitecture() {
++#ifdef OS_SOLARIS
++ struct utsname info;
++#else
+ utsname info;
++#endif
+ if (uname(&info) < 0) {
+ NOTREACHED();
+ return "";
diff --git a/www/firefox24/patches/patch-ipc_chromium_src_base_time__posix.cc b/www/firefox24/patches/patch-ipc_chromium_src_base_time__posix.cc
new file mode 100644
index 00000000000..f33eec39c1b
--- /dev/null
+++ b/www/firefox24/patches/patch-ipc_chromium_src_base_time__posix.cc
@@ -0,0 +1,15 @@
+$NetBSD: patch-ipc_chromium_src_base_time__posix.cc,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- ipc/chromium/src/base/time_posix.cc.orig 2013-05-11 19:19:32.000000000 +0000
++++ ipc/chromium/src/base/time_posix.cc
+@@ -65,8 +65,10 @@ Time Time::FromExploded(bool is_local, c
+ timestruct.tm_wday = exploded.day_of_week; // mktime/timegm ignore this
+ timestruct.tm_yday = 0; // mktime/timegm ignore this
+ timestruct.tm_isdst = -1; // attempt to figure it out
++#ifndef OS_SOLARIS
+ timestruct.tm_gmtoff = 0; // not a POSIX field, so mktime/timegm ignore
+ timestruct.tm_zone = NULL; // not a POSIX field, so mktime/timegm ignore
++#endif
+
+ time_t seconds;
+ #ifdef ANDROID
diff --git a/www/firefox24/patches/patch-ipc_chromium_src_build_build__config.h b/www/firefox24/patches/patch-ipc_chromium_src_build_build__config.h
new file mode 100644
index 00000000000..3b3b2426318
--- /dev/null
+++ b/www/firefox24/patches/patch-ipc_chromium_src_build_build__config.h
@@ -0,0 +1,22 @@
+$NetBSD: patch-ipc_chromium_src_build_build__config.h,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- ipc/chromium/src/build/build_config.h.orig 2013-05-11 19:19:32.000000000 +0000
++++ ipc/chromium/src/build/build_config.h
+@@ -27,6 +27,8 @@
+ #define OS_NETBSD 1
+ #elif defined(__OpenBSD__)
+ #define OS_OPENBSD 1
++#elif defined(__sun)
++#define OS_SOLARIS 1
+ #elif defined(_WIN32)
+ #define OS_WIN 1
+ #else
+@@ -42,7 +44,7 @@
+
+ // For access to standard POSIX features, use OS_POSIX instead of a more
+ // specific macro.
+-#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD)
++#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
+ #define OS_POSIX 1
+ #endif
+
diff --git a/www/firefox24/patches/patch-ipc_chromium_src_chrome_common_transport__dib.h b/www/firefox24/patches/patch-ipc_chromium_src_chrome_common_transport__dib.h
new file mode 100644
index 00000000000..836731afc31
--- /dev/null
+++ b/www/firefox24/patches/patch-ipc_chromium_src_chrome_common_transport__dib.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-ipc_chromium_src_chrome_common_transport__dib.h,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- ipc/chromium/src/chrome/common/transport_dib.h.orig 2013-05-11 19:19:32.000000000 +0000
++++ ipc/chromium/src/chrome/common/transport_dib.h
+@@ -70,7 +70,7 @@ class TransportDIB {
+ typedef base::SharedMemoryHandle Handle;
+ // On Mac, the inode number of the backing file is used as an id.
+ typedef base::SharedMemoryId Id;
+-#elif defined(OS_LINUX)
++#elif defined(OS_LINUX) || defined(OS_SOLARIS)
+ typedef int Handle; // These two ints are SysV IPC shared memory keys
+ typedef int Id;
+ #endif
diff --git a/www/firefox24/patches/patch-ipc_glue_AsyncChannel.cpp b/www/firefox24/patches/patch-ipc_glue_AsyncChannel.cpp
new file mode 100644
index 00000000000..f04e0a9cb29
--- /dev/null
+++ b/www/firefox24/patches/patch-ipc_glue_AsyncChannel.cpp
@@ -0,0 +1,22 @@
+$NetBSD: patch-ipc_glue_AsyncChannel.cpp,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- ipc/glue/AsyncChannel.cpp.orig 2013-05-11 19:19:32.000000000 +0000
++++ ipc/glue/AsyncChannel.cpp
+@@ -682,7 +682,7 @@ AsyncChannel::ProcessLink::OnChannelOpen
+ mExistingListener = mTransport->set_listener(this);
+ #ifdef DEBUG
+ if (mExistingListener) {
+- queue<Message> pending;
++ std::queue<Message> pending;
+ mExistingListener->GetQueuedMessages(pending);
+ MOZ_ASSERT(pending.empty());
+ }
+@@ -699,7 +699,7 @@ AsyncChannel::ProcessLink::OnTakeConnect
+ {
+ AssertIOThread();
+
+- queue<Message> pending;
++ std::queue<Message> pending;
+ {
+ MonitorAutoLock lock(*mChan->mMonitor);
+
diff --git a/www/firefox24/patches/patch-ipc_glue_GeckoChildProcessHost.cpp b/www/firefox24/patches/patch-ipc_glue_GeckoChildProcessHost.cpp
new file mode 100644
index 00000000000..4e846c56d5c
--- /dev/null
+++ b/www/firefox24/patches/patch-ipc_glue_GeckoChildProcessHost.cpp
@@ -0,0 +1,54 @@
+$NetBSD: patch-ipc_glue_GeckoChildProcessHost.cpp,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- ipc/glue/GeckoChildProcessHost.cpp.orig 2013-07-30 00:58:17.000000000 +0000
++++ ipc/glue/GeckoChildProcessHost.cpp
+@@ -4,7 +4,13 @@
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
++#if defined(__NetBSD__)
++_Pragma("GCC visibility push(default)")
++#endif
+ #include "GeckoChildProcessHost.h"
++#if defined(__NetBSD__)
++_Pragma("GCC visibility pop")
++#endif
+
+ #include "base/command_line.h"
+ #include "base/path_service.h"
+@@ -490,7 +496,7 @@ GeckoChildProcessHost::PerformAsyncLaunc
+ // and passing wstrings from one config to the other is unsafe. So
+ // we split the logic here.
+
+-#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_BSD)
++#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_BSD) || defined(OS_SOLARIS)
+ base::environment_map newEnvVars;
+ ChildPrivileges privs = mPrivileges;
+ if (privs == base::PRIVILEGES_DEFAULT) {
+@@ -509,7 +515,7 @@ GeckoChildProcessHost::PerformAsyncLaunc
+ if (NS_SUCCEEDED(rv)) {
+ nsCString path;
+ greDir->GetNativePath(path);
+-# if defined(OS_LINUX) || defined(OS_BSD)
++# if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
+ # if defined(MOZ_WIDGET_ANDROID)
+ path += "/lib";
+ # endif // MOZ_WIDGET_ANDROID
+@@ -618,7 +624,7 @@ GeckoChildProcessHost::PerformAsyncLaunc
+ childArgv.push_back(pidstring);
+
+ #if defined(MOZ_CRASHREPORTER)
+-# if defined(OS_LINUX) || defined(OS_BSD)
++# if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
+ int childCrashFd, childCrashRemapFd;
+ if (!CrashReporter::CreateNotificationPipeForChild(
+ &childCrashFd, &childCrashRemapFd))
+@@ -651,7 +657,7 @@ GeckoChildProcessHost::PerformAsyncLaunc
+ childArgv.push_back(childProcessType);
+
+ base::LaunchApp(childArgv, mFileMap,
+-#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_BSD)
++#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_BSD) || defined(OS_SOLARIS)
+ newEnvVars, privs,
+ #endif
+ false, &process, arch);
diff --git a/www/firefox24/patches/patch-ipc_ipdl_ipdl_lower.py b/www/firefox24/patches/patch-ipc_ipdl_ipdl_lower.py
new file mode 100644
index 00000000000..5205fa86426
--- /dev/null
+++ b/www/firefox24/patches/patch-ipc_ipdl_ipdl_lower.py
@@ -0,0 +1,13 @@
+$NetBSD: patch-ipc_ipdl_ipdl_lower.py,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- ipc/ipdl/ipdl/lower.py.orig 2013-01-04 23:44:34.000000000 +0000
++++ ipc/ipdl/ipdl/lower.py
+@@ -1797,7 +1797,7 @@ def _generateMessageClass(clsname, msgid
+ StmtExpr(ExprCall(
+ ExprVar('StringAppendF'),
+ args=[ ExprAddrOf(msgvar),
+- ExprLiteral.String('[time:%" PRId64 "][%d]'),
++ ExprLiteral.String('[time:%\\" PRId64 \\"][%d]'),
+ ExprCall(ExprVar('PR_Now')),
+ ExprCall(ExprVar('base::GetCurrentProcId')) ])),
+ appendToMsg(pfxvar),
diff --git a/www/firefox24/patches/patch-js__src__vm__SPSProfiler.cpp b/www/firefox24/patches/patch-js__src__vm__SPSProfiler.cpp
new file mode 100644
index 00000000000..3bbc31eceb1
--- /dev/null
+++ b/www/firefox24/patches/patch-js__src__vm__SPSProfiler.cpp
@@ -0,0 +1,16 @@
+$NetBSD: patch-js__src__vm__SPSProfiler.cpp,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+Unclear fallout from our version of bug 840242, attachment v1: some architectures
+fail to link if we do not add the inlines here - might be compiler/arch specific.
+
+
+--- js/src/vm/SPSProfiler.cpp.orig 2013-09-10 03:43:39.000000000 +0000
++++ js/src/vm/SPSProfiler.cpp
+@@ -8,6 +8,7 @@
+
+ #include "jsnum.h"
+ #include "jsscript.h"
++#include "jscntxtinlines.h"
+
+ #include "vm/SPSProfiler.h"
+ #include "vm/StringBuffer.h"
diff --git a/www/firefox24/patches/patch-js_src_Makefile.in b/www/firefox24/patches/patch-js_src_Makefile.in
new file mode 100644
index 00000000000..98c3b6da6e4
--- /dev/null
+++ b/www/firefox24/patches/patch-js_src_Makefile.in
@@ -0,0 +1,62 @@
+$NetBSD: patch-js_src_Makefile.in,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- js/src/Makefile.in.orig 2013-10-22 06:19:02.000000000 +0000
++++ js/src/Makefile.in
+@@ -237,10 +237,14 @@ endif
+ # ICU headers need to be available whether we build with the complete
+ # Internationalization API or not - ICU stubs rely on them.
+
++ifdef MOZ_NATIVE_ICU
++LOCAL_INCLUDES += $(MOZ_ICU_CFLAGS)
++else
+ LOCAL_INCLUDES += \
+ -I$(topsrcdir)/../../intl/icu/source/common \
+ -I$(topsrcdir)/../../intl/icu/source/i18n \
+ $(NULL)
++endif
+
+ ifdef ENABLE_INTL_API
+
+@@ -260,6 +264,7 @@ else
+ ICU_MAKE = $(MAKE)
+ endif
+
++ifndef MOZ_NATIVE_ICU
+ # - Build ICU as part of the "export" target, so things get built
+ # in the right order.
+ # - ICU requires GNU make according to its readme.html. pymake can't be used
+@@ -274,6 +279,7 @@ export::
+
+ distclean clean::
+ $(call SUBMAKE,$@,intl/icu)
++endif
+
+ endif
+
+@@ -413,7 +419,11 @@ ifneq (,$(MOZ_ZLIB_LIBS)$(MOZ_GLUE_LDFLA
+ DEFINES += -DUSE_ZLIB
+ endif
+
+-SHARED_LIBRARY_LIBS += $(ICU_LIBS)
++ifdef MOZ_NATIVE_ICU
++EXTRA_DSO_LDOPTS += $(MOZ_ICU_LIBS)
++else
++SHARED_LIBRARY_LIBS += $(MOZ_ICU_LIBS)
++endif
+
+ # Prevent floating point errors caused by VC++ optimizations
+ ifdef _MSC_VER
+@@ -472,6 +482,13 @@ EXTRA_LIBS += -lposix4 -ldl -lnsl -lsock
+ endif
+ endif
+
++# clang 3.3 + -O2 makes jaeger crash in FixupArity
++ifdef CLANG_CXX
++ifndef MOZ_DEBUG
++Compiler.$(OBJ_SUFFIX): CXXFLAGS += -fno-inline-functions
++endif
++endif
++
+ # An AIX Optimization bug causes PR_dtoa() & JS_dtoa to produce wrong result.
+ # This suppresses optimization for this single compilation unit.
+ ifeq ($(OS_ARCH),AIX)
diff --git a/www/firefox24/patches/patch-js_src_config_Makefile.in b/www/firefox24/patches/patch-js_src_config_Makefile.in
new file mode 100644
index 00000000000..4fb7beaaebc
--- /dev/null
+++ b/www/firefox24/patches/patch-js_src_config_Makefile.in
@@ -0,0 +1,12 @@
+$NetBSD: patch-js_src_config_Makefile.in,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- js/src/config/Makefile.in.orig 2013-09-10 03:43:34.000000000 +0000
++++ js/src/config/Makefile.in
+@@ -59,6 +59,7 @@ export:: \
+ $(call mkdir_deps,system_wrappers_js) \
+ $(NULL)
+ $(PYTHON) $(srcdir)/Preprocessor.py $(DEFINES) $(ACDEFINES) \
++ -DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \
+ $(srcdir)/system-headers | $(PERL) $(srcdir)/make-system-wrappers.pl system_wrappers_js
+ $(INSTALL) system_wrappers_js $(DIST)
+
diff --git a/www/firefox24/patches/patch-js_src_config_system-headers b/www/firefox24/patches/patch-js_src_config_system-headers
new file mode 100644
index 00000000000..c9374d7c80a
--- /dev/null
+++ b/www/firefox24/patches/patch-js_src_config_system-headers
@@ -0,0 +1,19 @@
+$NetBSD: patch-js_src_config_system-headers,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- js/src/config/system-headers.orig 2013-09-10 03:43:34.000000000 +0000
++++ js/src/config/system-headers
+@@ -1132,3 +1132,14 @@ kvm.h
+ spawn.h
+ err.h
+ xlocale.h
++#if MOZ_NATIVE_ICU==1
++unicode/locid.h
++unicode/numsys.h
++unicode/ucal.h
++unicode/ucol.h
++unicode/udat.h
++unicode/udatpg.h
++unicode/uenum.h
++unicode/unum.h
++unicode/ustring.h
++#endif
diff --git a/www/firefox24/patches/patch-js_src_ctypes_CTypes.h b/www/firefox24/patches/patch-js_src_ctypes_CTypes.h
new file mode 100644
index 00000000000..8d7a50559f4
--- /dev/null
+++ b/www/firefox24/patches/patch-js_src_ctypes_CTypes.h
@@ -0,0 +1,28 @@
+$NetBSD: patch-js_src_ctypes_CTypes.h,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- js/src/ctypes/CTypes.h.orig 2013-09-10 03:43:34.000000000 +0000
++++ js/src/ctypes/CTypes.h
+@@ -13,6 +13,23 @@
+
+ #include "js/HashTable.h"
+
++#if defined(__NetBSD__)
++#include <stdint.h>
++/* XXX why do we have those funky __ #defines in stdint.h? */
++#warning this is a retarded workaround
++#define uint8_t uint8_t
++#define uint16_t uint16_t
++#define uint32_t uint32_t
++#define uint64_t uint64_t
++#define int8_t int8_t
++#define int16_t int16_t
++#define int32_t int32_t
++#define int64_t int64_t
++#define intptr_t intptr_t
++#define uintptr_t uintptr_t
++#define off_t off_t
++#endif
++
+ namespace js {
+ namespace ctypes {
+
diff --git a/www/firefox24/patches/patch-js_src_frontend_ParseMaps.cpp b/www/firefox24/patches/patch-js_src_frontend_ParseMaps.cpp
new file mode 100644
index 00000000000..12527fb79f8
--- /dev/null
+++ b/www/firefox24/patches/patch-js_src_frontend_ParseMaps.cpp
@@ -0,0 +1,12 @@
+$NetBSD: patch-js_src_frontend_ParseMaps.cpp,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- js/src/frontend/ParseMaps.cpp.orig 2013-09-10 03:43:34.000000000 +0000
++++ js/src/frontend/ParseMaps.cpp
+@@ -132,5 +132,5 @@ frontend::InitAtomMap(JSContext *cx, fro
+ }
+ }
+
+-template class js::frontend::AtomDecls<FullParseHandler>;
+-template class js::frontend::AtomDecls<SyntaxParseHandler>;
++template class frontend::AtomDecls<FullParseHandler>;
++template class frontend::AtomDecls<SyntaxParseHandler>;
diff --git a/www/firefox24/patches/patch-js_src_gdb_Makefile.in b/www/firefox24/patches/patch-js_src_gdb_Makefile.in
new file mode 100644
index 00000000000..87849a75d27
--- /dev/null
+++ b/www/firefox24/patches/patch-js_src_gdb_Makefile.in
@@ -0,0 +1,15 @@
+$NetBSD: patch-js_src_gdb_Makefile.in,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- js/src/gdb/Makefile.in.orig 2013-09-10 03:43:34.000000000 +0000
++++ js/src/gdb/Makefile.in
+@@ -19,6 +19,10 @@ LIBS = $(DEPTH)/$(LIB_PREFIX)js_static.$
+
+ LOCAL_INCLUDES += -I$(topsrcdir) -I..
+
++ifdef MOZ_NATIVE_ICU
++EXTRA_LIBS += $(MOZ_ICU_LIBS)
++endif
++
+ EXTRA_LIBS += $(MOZ_FFI_LIBS)
+
+ # Place a GDB Python auto-load file next to the gdb-tests executable, both
diff --git a/www/firefox24/patches/patch-js_src_jit_AsmJSSignalHandlers.cpp b/www/firefox24/patches/patch-js_src_jit_AsmJSSignalHandlers.cpp
new file mode 100644
index 00000000000..80cf3543d4d
--- /dev/null
+++ b/www/firefox24/patches/patch-js_src_jit_AsmJSSignalHandlers.cpp
@@ -0,0 +1,28 @@
+$NetBSD: patch-js_src_jit_AsmJSSignalHandlers.cpp,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+* REG_EIP is not defined on Solaris/SunOS, use REG_PC instead.
+
+--- js/src/jit/AsmJSSignalHandlers.cpp.orig 2013-09-11 03:22:33.000000000 +0000
++++ js/src/jit/AsmJSSignalHandlers.cpp
+@@ -59,10 +59,11 @@ using namespace mozilla;
+ #elif defined(__linux__) || defined(SOLARIS)
+ # if defined(__linux__)
+ # define XMM_sig(p,i) ((p)->uc_mcontext.fpregs->_xmm[i])
++# define EIP_sig(p) ((p)->uc_mcontext.gregs[REG_EIP])
+ # else
+ # define XMM_sig(p,i) ((p)->uc_mcontext.fpregs.fp_reg_set.fpchip_state.xmm[i])
++# define EIP_sig(p) ((p)->uc_mcontext.gregs[REG_PC])
+ # endif
+-# define EIP_sig(p) ((p)->uc_mcontext.gregs[REG_EIP])
+ # define RIP_sig(p) ((p)->uc_mcontext.gregs[REG_RIP])
+ # define PC_sig(p) ((p)->uc_mcontext.arm_pc)
+ # define RAX_sig(p) ((p)->uc_mcontext.gregs[REG_RAX])
+@@ -269,7 +270,7 @@ LookupHeapAccess(const AsmJSModule &modu
+ # if defined(JS_CPU_X64)
+ # if defined(__DragonFly__)
+ # include <machine/npx.h> // for union savefpu
+-# elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__FreeBSD_kernel__)
++# elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__)
+ # include <machine/fpu.h> // for struct savefpu/fxsave64
+ # endif
+ # endif
diff --git a/www/firefox24/patches/patch-js_src_jsapi-tests_Makefile.in b/www/firefox24/patches/patch-js_src_jsapi-tests_Makefile.in
new file mode 100644
index 00000000000..07c7213a9b1
--- /dev/null
+++ b/www/firefox24/patches/patch-js_src_jsapi-tests_Makefile.in
@@ -0,0 +1,15 @@
+$NetBSD: patch-js_src_jsapi-tests_Makefile.in,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- js/src/jsapi-tests/Makefile.in.orig 2013-09-10 03:43:36.000000000 +0000
++++ js/src/jsapi-tests/Makefile.in
+@@ -20,6 +20,10 @@ LIBS = $(DEPTH)/$(LIB_PREFIX)js_sta
+
+ LOCAL_INCLUDES += -I$(topsrcdir) -I..
+
++ifdef MOZ_NATIVE_ICU
++EXTRA_LIBS += $(MOZ_ICU_LIBS)
++endif
++
+ EXTRA_LIBS += $(MOZ_FFI_LIBS)
+
+ ifdef QEMU_EXE
diff --git a/www/firefox24/patches/patch-js_src_jscompartment.h b/www/firefox24/patches/patch-js_src_jscompartment.h
new file mode 100644
index 00000000000..53883fa8077
--- /dev/null
+++ b/www/firefox24/patches/patch-js_src_jscompartment.h
@@ -0,0 +1,16 @@
+$NetBSD: patch-js_src_jscompartment.h,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- js/src/jscompartment.h.orig 2013-06-17 22:13:11.000000000 +0000
++++ js/src/jscompartment.h
+@@ -396,9 +396,9 @@ class js::AutoDebugModeGC
+ GC(rt, GC_NORMAL, JS::gcreason::DEBUG_MODE_GC);
+ }
+
+- void scheduleGC(Zone *zone) {
++ void scheduleGC(JS::Zone *zone) {
+ JS_ASSERT(!rt->isHeapBusy());
+- PrepareZoneForGC(zone);
++ JS::PrepareZoneForGC(zone);
+ needGC = true;
+ }
+ };
diff --git a/www/firefox24/patches/patch-js_src_jsmath.cpp b/www/firefox24/patches/patch-js_src_jsmath.cpp
new file mode 100644
index 00000000000..f919b02661a
--- /dev/null
+++ b/www/firefox24/patches/patch-js_src_jsmath.cpp
@@ -0,0 +1,13 @@
+$NetBSD: patch-js_src_jsmath.cpp,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- js/src/jsmath.cpp.orig 2013-09-10 03:43:36.000000000 +0000
++++ js/src/jsmath.cpp
+@@ -244,7 +244,7 @@ js::ecmaAtan2(double y, double x)
+ }
+ #endif
+
+-#if defined(SOLARIS) && defined(__GNUC__)
++#if defined(notSOLARIS) && defined(__GNUC__)
+ if (y == 0) {
+ if (IsNegativeZero(x))
+ return js_copysign(M_PI, y);
diff --git a/www/firefox24/patches/patch-js_src_shell_Makefile.in b/www/firefox24/patches/patch-js_src_shell_Makefile.in
new file mode 100644
index 00000000000..18bad2ac83b
--- /dev/null
+++ b/www/firefox24/patches/patch-js_src_shell_Makefile.in
@@ -0,0 +1,14 @@
+$NetBSD: patch-js_src_shell_Makefile.in,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- js/src/shell/Makefile.in.orig 2013-09-10 03:43:36.000000000 +0000
++++ js/src/shell/Makefile.in
+@@ -27,6 +27,9 @@ LIBS = $(NSPR_LIBS) $(EDITLINE_LIBS
+ ifdef MOZ_NATIVE_FFI
+ EXTRA_LIBS += $(MOZ_FFI_LIBS)
+ endif
++ifdef MOZ_NATIVE_ICU
++EXTRA_LIBS += $(MOZ_ICU_LIBS)
++endif
+
+ LOCAL_INCLUDES += -I$(topsrcdir) -I..
+
diff --git a/www/firefox24/patches/patch-js_src_vm_ObjectImpl-inl.h b/www/firefox24/patches/patch-js_src_vm_ObjectImpl-inl.h
new file mode 100644
index 00000000000..59f9caed93e
--- /dev/null
+++ b/www/firefox24/patches/patch-js_src_vm_ObjectImpl-inl.h
@@ -0,0 +1,31 @@
+$NetBSD: patch-js_src_vm_ObjectImpl-inl.h,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- js/src/vm/ObjectImpl-inl.h.orig 2013-09-10 03:43:39.000000000 +0000
++++ js/src/vm/ObjectImpl-inl.h
+@@ -364,7 +364,7 @@ js::ObjectImpl::zone() const
+ js::ObjectImpl::readBarrier(ObjectImpl *obj)
+ {
+ #ifdef JSGC_INCREMENTAL
+- Zone *zone = obj->zone();
++ JS::Zone *zone = obj->zone();
+ if (zone->needsBarrier()) {
+ MOZ_ASSERT(!zone->rt->isHeapMajorCollecting());
+ JSObject *tmp = obj->asObjectPtr();
+@@ -378,7 +378,7 @@ inline void
+ js::ObjectImpl::privateWriteBarrierPre(void **old)
+ {
+ #ifdef JSGC_INCREMENTAL
+- Zone *zone = this->zone();
++ JS::Zone *zone = this->zone();
+ if (zone->needsBarrier()) {
+ if (*old && getClass()->trace)
+ getClass()->trace(zone->barrierTracer(), this->asObjectPtr());
+@@ -405,7 +405,7 @@ js::ObjectImpl::writeBarrierPre(ObjectIm
+ if (IsNullTaggedPointer(obj) || !obj->runtime()->needsBarrier())
+ return;
+
+- Zone *zone = obj->zone();
++ JS::Zone *zone = obj->zone();
+ if (zone->needsBarrier()) {
+ MOZ_ASSERT(!zone->rt->isHeapMajorCollecting());
+ JSObject *tmp = obj->asObjectPtr();
diff --git a/www/firefox24/patches/patch-mb b/www/firefox24/patches/patch-mb
new file mode 100644
index 00000000000..55d08db5919
--- /dev/null
+++ b/www/firefox24/patches/patch-mb
@@ -0,0 +1,27 @@
+$NetBSD: patch-mb,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- xpcom/reflect/xptcall/src/md/unix/Makefile.in.orig 2013-09-10 03:43:57.000000000 +0000
++++ xpcom/reflect/xptcall/src/md/unix/Makefile.in
+@@ -183,7 +183,7 @@ endif
+ #
+ # NetBSD/PPC
+ #
+-ifneq (,$(filter NetBSDmacppc NetBSDbebox NetBSDofppc NetBSDprep NetBSDamigappc,$(OS_ARCH)$(OS_TEST)))
++ifeq ($(OS_ARCH)$(OS_TEST),NetBSDpowerpc)
+ ASFILES := xptcinvoke_asm_ppc_netbsd.s xptcstubs_asm_ppc_netbsd.s
+ endif
+
+@@ -235,6 +235,13 @@ ifneq (,$(filter OpenBSDsparc64 FreeBSDs
+ ASFILES := xptcinvoke_asm_sparc64_openbsd.s xptcstubs_asm_sparc64_openbsd.s
+ endif
+ #
++# NetBSD/SPARC64
++#
++ifeq ($(OS_ARCH)$(OS_TEST),NetBSDsparc64)
++CPPSRCS := xptcinvoke_sparc64_netbsd.cpp xptcstubs_sparc64_openbsd.cpp
++ASFILES := xptcinvoke_asm_sparc64_openbsd.s xptcstubs_asm_sparc64_netbsd.s
++endif
++#
+ # Solaris/SPARC
+ #
+ ifeq ($(OS_ARCH),SunOS)
diff --git a/www/firefox24/patches/patch-media_libpng_pngpriv.h b/www/firefox24/patches/patch-media_libpng_pngpriv.h
new file mode 100644
index 00000000000..1375f873575
--- /dev/null
+++ b/www/firefox24/patches/patch-media_libpng_pngpriv.h
@@ -0,0 +1,12 @@
+$NetBSD: patch-media_libpng_pngpriv.h,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- media/libpng/pngpriv.h.orig 2013-07-30 00:58:46.000000000 +0000
++++ media/libpng/pngpriv.h
+@@ -38,6 +38,7 @@
+ * still required (as of 2011-05-02.)
+ */
+ #define _POSIX_SOURCE 1 /* Just the POSIX 1003.1 and C89 APIs */
++#define _XOPEN_SOURCE 600
+
+ #ifndef PNG_VERSION_INFO_ONLY
+ /* This is required for the definition of abort(), used as a last ditch
diff --git a/www/firefox24/patches/patch-media_libsoundtouch_src_cpu__detect__x86.cpp b/www/firefox24/patches/patch-media_libsoundtouch_src_cpu__detect__x86.cpp
new file mode 100644
index 00000000000..7a12e5335cb
--- /dev/null
+++ b/www/firefox24/patches/patch-media_libsoundtouch_src_cpu__detect__x86.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-media_libsoundtouch_src_cpu__detect__x86.cpp,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- media/libsoundtouch/src/cpu_detect_x86.cpp.orig 2013-06-17 22:13:19.000000000 +0000
++++ media/libsoundtouch/src/cpu_detect_x86.cpp
+@@ -131,6 +131,9 @@ uint detectCPUextensions(void)
+
+ return res & ~_dwDisabledISA;
+
++#elif defined(__GNUC__)
++ // No cpuid.h --> no cpuid support
++ return 0;
+ #else
+
+ /// One of these is true:
diff --git a/www/firefox24/patches/patch-media_mtransport_objs.mk b/www/firefox24/patches/patch-media_mtransport_objs.mk
new file mode 100644
index 00000000000..84154184029
--- /dev/null
+++ b/www/firefox24/patches/patch-media_mtransport_objs.mk
@@ -0,0 +1,22 @@
+$NetBSD: patch-media_mtransport_objs.mk,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- media/mtransport/objs.mk.orig 2013-05-11 19:19:43.000000000 +0000
++++ media/mtransport/objs.mk
+@@ -23,12 +23,16 @@ LOCAL_INCLUDES += \
+ -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/event \
+ $(NULL)
+
+-ifeq ($(OS_TARGET), Darwin)
++ifneq (,$(filter Darwin DragonFly FreeBSD NetBSD OpenBSD,$(OS_TARGET)))
+ LOCAL_INCLUDES += \
+ -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/darwin/include \
+ -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/generic/include \
+ $(NULL)
++ifeq ($(OS_TARGET), Darwin)
+ DEFINES += -DDARWIN
++else
++DEFINES += -DBSD
++endif
+ endif
+
+ ifeq ($(OS_TARGET), Linux)
diff --git a/www/firefox24/patches/patch-media_mtransport_test_Makefile.in b/www/firefox24/patches/patch-media_mtransport_test_Makefile.in
new file mode 100644
index 00000000000..5d9c460ef6b
--- /dev/null
+++ b/www/firefox24/patches/patch-media_mtransport_test_Makefile.in
@@ -0,0 +1,20 @@
+$NetBSD: patch-media_mtransport_test_Makefile.in,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- media/mtransport/test/Makefile.in.orig 2013-05-11 19:19:43.000000000 +0000
++++ media/mtransport/test/Makefile.in
+@@ -78,12 +78,14 @@ endif
+ endif
+ endif
+
+-ifeq ($(OS_TARGET), Darwin)
++ifneq (,$(filter Darwin DragonFly FreeBSD NetBSD OpenBSD,$(OS_TARGET)))
+ LOCAL_INCLUDES += -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/darwin/include
++ifeq ($(OS_TARGET), Darwin)
+ DEFINES += \
+ -DGTEST_USE_OWN_TR1_TUPLE=1 \
+ $(NULL)
+ endif
++endif
+
+ ifeq ($(OS_TARGET), Linux)
+ LOCAL_INCLUDES += -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/linux/include
diff --git a/www/firefox24/patches/patch-media_mtransport_third__party_nICEr_nicer.gyp b/www/firefox24/patches/patch-media_mtransport_third__party_nICEr_nicer.gyp
new file mode 100644
index 00000000000..8da80358800
--- /dev/null
+++ b/www/firefox24/patches/patch-media_mtransport_third__party_nICEr_nicer.gyp
@@ -0,0 +1,33 @@
+$NetBSD: patch-media_mtransport_third__party_nICEr_nicer.gyp,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- media/mtransport/third_party/nICEr/nicer.gyp.orig 2013-05-11 19:19:43.000000000 +0000
++++ media/mtransport/third_party/nICEr/nicer.gyp
+@@ -129,8 +129,19 @@
+ ],
+
+ 'conditions' : [
+- ## Mac
++ ## Mac and BSDs
+ [ 'OS == "mac"', {
++ 'defines' : [
++ 'DARWIN',
++ 'HAVE_XLOCALE',
++ ],
++ }],
++ [ 'os_bsd == 1', {
++ 'defines' : [
++ 'BSD',
++ ],
++ }],
++ [ 'OS == "mac" or os_bsd == 1', {
+ 'cflags_mozilla': [
+ '-Wall',
+ '-Wno-parentheses',
+@@ -138,7 +149,6 @@
+ '-Wmissing-prototypes',
+ ],
+ 'defines' : [
+- 'DARWIN',
+ 'HAVE_LIBM=1',
+ 'HAVE_STRDUP=1',
+ 'HAVE_STRLCPY=1',
diff --git a/www/firefox24/patches/patch-media_mtransport_third__party_nICEr_src_stun_addrs.c b/www/firefox24/patches/patch-media_mtransport_third__party_nICEr_src_stun_addrs.c
new file mode 100644
index 00000000000..80d73830717
--- /dev/null
+++ b/www/firefox24/patches/patch-media_mtransport_third__party_nICEr_src_stun_addrs.c
@@ -0,0 +1,36 @@
+$NetBSD: patch-media_mtransport_third__party_nICEr_src_stun_addrs.c,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- media/mtransport/third_party/nICEr/src/stun/addrs.c.orig 2013-09-10 03:43:46.000000000 +0000
++++ media/mtransport/third_party/nICEr/src/stun/addrs.c
+@@ -55,7 +55,13 @@ static char *RCSSTRING __UNUSED__="$Id:
+ #endif
+ #include <net/if.h>
+ #ifndef LINUX
++#if !defined(__OpenBSD__) && !defined(__NetBSD__)
+ #include <net/if_var.h>
++#endif
++#include <net/if_dl.h>
++#include <net/if_types.h>
++#include <sys/sockio.h>
++#elif defined(__NetBSD__)
+ #include <net/if_dl.h>
+ #include <net/if_types.h>
+ #include <sys/sockio.h>
+@@ -80,7 +86,7 @@ static char *RCSSTRING __UNUSED__="$Id:
+
+
+
+-#ifdef DARWIN
++#if defined(BSD) || defined(DARWIN)
+ /*
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
+@@ -695,7 +701,7 @@ nr_stun_get_addrs(nr_transport_addr addr
+ int _status=0;
+ int i;
+
+-#ifdef DARWIN
++#if defined(BSD) || defined(DARWIN)
+ _status = stun_get_mib_addrs(addrs, maxaddrs, count);
+ #elif defined(WIN32)
+ _status = stun_get_win32_addrs(addrs, maxaddrs, count);
diff --git a/www/firefox24/patches/patch-media_mtransport_third__party_nICEr_src_stun_stun.h b/www/firefox24/patches/patch-media_mtransport_third__party_nICEr_src_stun_stun.h
new file mode 100644
index 00000000000..28f6ee22530
--- /dev/null
+++ b/www/firefox24/patches/patch-media_mtransport_third__party_nICEr_src_stun_stun.h
@@ -0,0 +1,20 @@
+$NetBSD: patch-media_mtransport_third__party_nICEr_src_stun_stun.h,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- media/mtransport/third_party/nICEr/src/stun/stun.h.orig 2013-05-11 19:19:43.000000000 +0000
++++ media/mtransport/third_party/nICEr/src/stun/stun.h
+@@ -41,11 +41,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ #include <sys/socket.h>
+ #include <net/if.h>
+ #ifndef LINUX
++#if !defined(__OpenBSD__) && !defined(__NetBSD__)
+ #include <net/if_var.h>
++#endif
+ #include <net/if_dl.h>
+ #include <net/if_types.h>
+ #endif
++#ifndef BSD
+ #include <net/route.h>
++#endif
+ #include <netinet/in.h>
+ #ifndef LINUX
+ #include <netinet/in_var.h>
diff --git a/www/firefox24/patches/patch-media_mtransport_third__party_nICEr_src_util_mbslen.c b/www/firefox24/patches/patch-media_mtransport_third__party_nICEr_src_util_mbslen.c
new file mode 100644
index 00000000000..f7baad445e3
--- /dev/null
+++ b/www/firefox24/patches/patch-media_mtransport_third__party_nICEr_src_util_mbslen.c
@@ -0,0 +1,78 @@
+$NetBSD: patch-media_mtransport_third__party_nICEr_src_util_mbslen.c,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- media/mtransport/third_party/nICEr/src/util/mbslen.c.orig 2013-06-17 22:13:19.000000000 +0000
++++ media/mtransport/third_party/nICEr/src/util/mbslen.c
+@@ -43,9 +43,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ #include <locale.h>
+ #include <stdlib.h>
+ #include <wchar.h>
+-#ifdef DARWIN
++
++#ifdef __FreeBSD__
++#include <osreldate.h>
++# if __FreeBSD_version > 900505
++# define HAVE_XLOCALE
++# endif
++#endif
++
++#ifdef HAVE_XLOCALE
+ #include <xlocale.h>
+-#endif /* DARWIN */
++#endif /* HAVE_XLOCALE */
+
+ #include "nr_api.h"
+ #include "mbslen.h"
+@@ -54,10 +62,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ int
+ mbslen(const char *s, size_t *ncharsp)
+ {
+-#ifdef DARWIN
++#ifdef HAVE_XLOCALE
+ static locale_t loc = 0;
+ static int initialized = 0;
+-#endif /* DARWIN */
++#endif /* HAVE_XLOCALE */
+ #ifdef WIN32
+ char *my_locale=0;
+ unsigned int i;
+@@ -67,7 +75,7 @@ mbslen(const char *s, size_t *ncharsp)
+ int nchars;
+ mbstate_t mbs;
+
+-#ifdef DARWIN
++#ifdef HAVE_XLOCALE
+ if (! initialized) {
+ initialized = 1;
+ loc = newlocale(LC_CTYPE_MASK, "UTF-8", LC_GLOBAL_LOCALE);
+@@ -76,7 +84,7 @@ mbslen(const char *s, size_t *ncharsp)
+ if (loc == 0) {
+ /* unable to create the UTF-8 locale */
+ assert(loc != 0); /* should never happen */
+-#endif /* DARWIN */
++#endif /* HAVE_XLOCALE */
+
+ #ifdef WIN32
+ if (!setlocale(LC_CTYPE, 0))
+@@ -99,18 +107,18 @@ mbslen(const char *s, size_t *ncharsp)
+ ABORT(R_NOT_FOUND);
+ #endif
+
+-#ifdef DARWIN
++#ifdef HAVE_XLOCALE
+ }
+-#endif /* DARWIN */
++#endif /* HAVE_XLOCALE */
+
+ memset(&mbs, 0, sizeof(mbs));
+ nchars = 0;
+
+-#ifdef DARWIN
++#ifdef HAVE_XLOCALE
+ while (*s != '\0' && (nbytes = mbrlen_l(s, strlen(s), &mbs, loc)) != 0)
+ #else
+ while (*s != '\0' && (nbytes = mbrlen(s, strlen(s), &mbs)) != 0)
+-#endif /* DARWIN */
++#endif /* HAVE_XLOCALE */
+ {
+ if (nbytes == (size_t)-1) /* should never happen */ {
+ ABORT(R_INTERNAL);
diff --git a/www/firefox24/patches/patch-media_mtransport_third__party_nrappkit_nrappkit.gyp b/www/firefox24/patches/patch-media_mtransport_third__party_nrappkit_nrappkit.gyp
new file mode 100644
index 00000000000..ac9b3472645
--- /dev/null
+++ b/www/firefox24/patches/patch-media_mtransport_third__party_nrappkit_nrappkit.gyp
@@ -0,0 +1,32 @@
+$NetBSD: patch-media_mtransport_third__party_nrappkit_nrappkit.gyp,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- media/mtransport/third_party/nrappkit/nrappkit.gyp.orig 2013-05-11 19:19:43.000000000 +0000
++++ media/mtransport/third_party/nrappkit/nrappkit.gyp
+@@ -147,8 +147,18 @@
+ ],
+
+ 'conditions' : [
+- ## Mac
++ ## Mac and BSDs
+ [ 'OS == "mac"', {
++ 'defines' : [
++ 'DARWIN',
++ ],
++ }],
++ [ 'os_bsd == 1', {
++ 'defines' : [
++ 'BSD',
++ ],
++ }],
++ [ 'OS == "mac" or os_bsd == 1', {
+ 'cflags_mozilla': [
+ '-Wall',
+ '-Wno-parentheses',
+@@ -156,7 +166,6 @@
+ '-Wmissing-prototypes',
+ ],
+ 'defines' : [
+- 'DARWIN',
+ 'HAVE_LIBM=1',
+ 'HAVE_STRDUP=1',
+ 'HAVE_STRLCPY=1',
diff --git a/www/firefox24/patches/patch-media_mtransport_third__party_nrappkit_src_log_r__log.c b/www/firefox24/patches/patch-media_mtransport_third__party_nrappkit_src_log_r__log.c
new file mode 100644
index 00000000000..2a060e45b08
--- /dev/null
+++ b/www/firefox24/patches/patch-media_mtransport_third__party_nrappkit_src_log_r__log.c
@@ -0,0 +1,12 @@
+$NetBSD: patch-media_mtransport_third__party_nrappkit_src_log_r__log.c,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- media/mtransport/third_party/nrappkit/src/log/r_log.c.orig 2013-05-11 19:19:43.000000000 +0000
++++ media/mtransport/third_party/nrappkit/src/log/r_log.c
+@@ -48,6 +48,7 @@ static char *RCSSTRING __UNUSED__ ="$Id:
+ #include "hex.h"
+
+ #include <string.h>
++#include <errno.h>
+ #ifndef _MSC_VER
+ #include <strings.h>
+ #include <syslog.h>
diff --git a/www/firefox24/patches/patch-media_mtransport_third__party_nrappkit_src_port_generic_include_sys_queue.h b/www/firefox24/patches/patch-media_mtransport_third__party_nrappkit_src_port_generic_include_sys_queue.h
new file mode 100644
index 00000000000..30e1aaf557a
--- /dev/null
+++ b/www/firefox24/patches/patch-media_mtransport_third__party_nrappkit_src_port_generic_include_sys_queue.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-media_mtransport_third__party_nrappkit_src_port_generic_include_sys_queue.h,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- media/mtransport/third_party/nrappkit/src/port/generic/include/sys/queue.h.orig 2013-05-11 19:19:43.000000000 +0000
++++ media/mtransport/third_party/nrappkit/src/port/generic/include/sys/queue.h
+@@ -33,7 +33,7 @@
+ #ifndef _SYS_QUEUE_H_
+ #define _SYS_QUEUE_H_
+
+-#ifndef DARWIN
++#if !defined(__FreeBSD__) && !defined(DARWIN)
+ #include <stddef.h>
+ #define __offsetof offsetof
+ #endif
diff --git a/www/firefox24/patches/patch-media_mtransport_third__party_nrappkit_src_util_util.c b/www/firefox24/patches/patch-media_mtransport_third__party_nrappkit_src_util_util.c
new file mode 100644
index 00000000000..cb02612fe36
--- /dev/null
+++ b/www/firefox24/patches/patch-media_mtransport_third__party_nrappkit_src_util_util.c
@@ -0,0 +1,12 @@
+$NetBSD: patch-media_mtransport_third__party_nrappkit_src_util_util.c,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- media/mtransport/third_party/nrappkit/src/util/util.c.orig 2013-05-11 19:19:43.000000000 +0000
++++ media/mtransport/third_party/nrappkit/src/util/util.c
+@@ -45,6 +45,7 @@ static char *RCSSTRING __UNUSED__ ="$Id:
+ #include <dirent.h>
+ #endif
+ #include <string.h>
++#include <errno.h>
+ #include <ctype.h>
+ #include <sys/stat.h>
+ #ifdef OPENSSL
diff --git a/www/firefox24/patches/patch-media_webrtc_signaling_signaling.gyp b/www/firefox24/patches/patch-media_webrtc_signaling_signaling.gyp
new file mode 100644
index 00000000000..1461cfe157c
--- /dev/null
+++ b/www/firefox24/patches/patch-media_webrtc_signaling_signaling.gyp
@@ -0,0 +1,49 @@
+$NetBSD: patch-media_webrtc_signaling_signaling.gyp,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- media/webrtc/signaling/signaling.gyp.orig 2013-05-11 19:19:44.000000000 +0000
++++ media/webrtc/signaling/signaling.gyp
+@@ -217,6 +217,19 @@
+ 'cflags_mozilla': [
+ ],
+ }],
++ ['os_bsd==1', {
++ 'include_dirs': [
++ ],
++ 'defines': [
++ # avoiding pointless ifdef churn
++ 'SIP_OS_OSX',
++ 'OSX',
++ 'SECLIB_OPENSSL',
++ ],
++
++ 'cflags_mozilla': [
++ ],
++ }],
+ ['OS=="mac"', {
+ 'include_dirs': [
+ ],
+@@ -752,7 +765,7 @@
+ ],
+
+ }],
+- ['OS=="mac"', {
++ ['OS=="mac" or os_bsd==1', {
+
+ 'include_dirs': [
+ ],
+@@ -797,14 +810,13 @@
+
+ 'defines' : [
+ 'SIP_OS_OSX',
+- '_POSIX_SOURCE',
++ # using BSD extensions, leave _POSIX_SOURCE undefined
+ 'CPR_MEMORY_LITTLE_ENDIAN',
+ 'NO_SOCKET_POLLING',
+ 'USE_TIMER_SELECT_BASED',
+ 'FULL_BUILD',
+ 'STUBBED_OUT',
+ 'USE_PRINTF',
+- '_DARWIN_C_SOURCE',
+ 'NO_NSPR_10_SUPPORT',
+ ],
+
diff --git a/www/firefox24/patches/patch-media_webrtc_signaling_src_sipcc_cpr_darwin_cpr__darwin__ipc.c b/www/firefox24/patches/patch-media_webrtc_signaling_src_sipcc_cpr_darwin_cpr__darwin__ipc.c
new file mode 100644
index 00000000000..da4cc9b5e48
--- /dev/null
+++ b/www/firefox24/patches/patch-media_webrtc_signaling_src_sipcc_cpr_darwin_cpr__darwin__ipc.c
@@ -0,0 +1,20 @@
+$NetBSD: patch-media_webrtc_signaling_src_sipcc_cpr_darwin_cpr__darwin__ipc.c,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_ipc.c.orig 2013-05-11 19:19:44.000000000 +0000
++++ media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_ipc.c
+@@ -322,11 +322,15 @@ cprGetMessage (cprMsgQueue_t msgQueue, b
+ cpr_msgq_node_t *node;
+ struct timespec timeout;
+ struct timeval tv;
++#ifndef __APPLE__
++ struct timezone tz;
++#else
+ // On the iPhone, there is a DarwinAlias problem with "timezone"
+ struct _timezone {
+ int tz_minuteswest; /* of Greenwich */
+ int tz_dsttime; /* type of dst correction to apply */
+ } tz;
++#endif
+
+ /* Initialize ppUserData */
+ if (ppUserData) {
diff --git a/www/firefox24/patches/patch-media_webrtc_signaling_test_Makefile.in b/www/firefox24/patches/patch-media_webrtc_signaling_test_Makefile.in
new file mode 100644
index 00000000000..9447ad7b653
--- /dev/null
+++ b/www/firefox24/patches/patch-media_webrtc_signaling_test_Makefile.in
@@ -0,0 +1,21 @@
+$NetBSD: patch-media_webrtc_signaling_test_Makefile.in,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- media/webrtc/signaling/test/Makefile.in.orig 2013-05-11 19:19:44.000000000 +0000
++++ media/webrtc/signaling/test/Makefile.in
+@@ -17,6 +17,7 @@ LIBS = \
+ $(NSPR_LIBS) \
+ $(NSS_LIBS) \
+ $(REALTIME_LIBS) \
++ $(MOZ_LIBV4L2_LIBS) \
+ $(DEPTH)/xpcom/glue/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) \
+ $(DEPTH)/media/mtransport/standalone/$(LIB_PREFIX)mtransport_s.$(LIB_SUFFIX) \
+ $(DEPTH)/media/webrtc/signalingtest/signaling_ecc/$(LIB_PREFIX)ecc.$(LIB_SUFFIX) \
+@@ -86,7 +87,7 @@ LIBS += \
+ $(NULL)
+ endif
+
+-ifeq ($(OS_TARGET),Linux)
++ifneq (,$(filter Linux DragonFly FreeBSD NetBSD OpenBSD,$(OS_TARGET)))
+ LIBS += \
+ $(MOZ_CAIRO_OSLIBS) \
+ $(NULL)
diff --git a/www/firefox24/patches/patch-media_webrtc_trunk_build_build__config.h b/www/firefox24/patches/patch-media_webrtc_trunk_build_build__config.h
new file mode 100644
index 00000000000..1b9d1dc9fdf
--- /dev/null
+++ b/www/firefox24/patches/patch-media_webrtc_trunk_build_build__config.h
@@ -0,0 +1,41 @@
+$NetBSD: patch-media_webrtc_trunk_build_build__config.h,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- media/webrtc/trunk/build/build_config.h.orig 2013-09-10 03:43:46.000000000 +0000
++++ media/webrtc/trunk/build/build_config.h
+@@ -37,9 +37,15 @@
+ #elif defined(_WIN32)
+ #define OS_WIN 1
+ #define TOOLKIT_VIEWS 1
+-#elif defined(__FreeBSD__)
++#elif defined(__DragonFly__)
++#define OS_DRAGONFLY 1
++#define TOOLKIT_GTK
++#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ #define OS_FREEBSD 1
+ #define TOOLKIT_GTK
++#elif defined(__NetBSD__)
++#define OS_NETBSD 1
++#define TOOLKIT_GTK
+ #elif defined(__OpenBSD__)
+ #define OS_OPENBSD 1
+ #define TOOLKIT_GTK
+@@ -56,15 +62,15 @@
+
+ // For access to standard BSD features, use OS_BSD instead of a
+ // more specific macro.
+-#if defined(OS_FREEBSD) || defined(OS_OPENBSD)
++#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD) \
++ || defined(OS_NETBSD) || defined(OS_OPENBSD)
+ #define OS_BSD 1
+ #endif
+
+ // For access to standard POSIXish features, use OS_POSIX instead of a
+ // more specific macro.
+-#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_FREEBSD) || \
+- defined(OS_OPENBSD) || defined(OS_SOLARIS) || defined(OS_ANDROID) || \
+- defined(OS_NACL)
++#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) || \
++ defined(OS_SOLARIS) || defined(OS_ANDROID) || defined(OS_NACL)
+ #define OS_POSIX 1
+ #endif
+
diff --git a/www/firefox24/patches/patch-media_webrtc_trunk_tools_gyp_pylib_gyp_generator_mozmake.py b/www/firefox24/patches/patch-media_webrtc_trunk_tools_gyp_pylib_gyp_generator_mozmake.py
new file mode 100644
index 00000000000..093eebb155d
--- /dev/null
+++ b/www/firefox24/patches/patch-media_webrtc_trunk_tools_gyp_pylib_gyp_generator_mozmake.py
@@ -0,0 +1,55 @@
+$NetBSD: patch-media_webrtc_trunk_tools_gyp_pylib_gyp_generator_mozmake.py,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- media/webrtc/trunk/tools/gyp/pylib/gyp/generator/mozmake.py.orig 2013-05-11 19:19:44.000000000 +0000
++++ media/webrtc/trunk/tools/gyp/pylib/gyp/generator/mozmake.py
+@@ -9,6 +9,7 @@ import collections
+ import gyp
+ import gyp.common
+ import sys
++import platform
+ import os
+ import re
+ import shlex
+@@ -111,20 +112,34 @@ def ensure_directory_exists(path):
+
+ def GetFlavor(params):
+ """Returns |params.flavor| if it's set, the system's default flavor else."""
++ system = platform.system().lower()
+ flavors = {
+- 'win32': 'win',
+- 'darwin': 'mac',
+- 'sunos5': 'solaris',
+- 'freebsd7': 'freebsd',
+- 'freebsd8': 'freebsd',
++ 'microsoft': 'win',
++ 'windows' : 'win',
++ 'darwin' : 'mac',
++ 'sunos' : 'solaris',
++ 'dragonfly': 'bsd',
++ 'freebsd' : 'bsd',
++ 'netbsd' : 'bsd',
++ 'openbsd' : 'bsd',
+ }
+- flavor = flavors.get(sys.platform, 'linux')
+- return params.get('flavor', flavor)
++
++ if 'flavor' in params:
++ return params['flavor']
++ if system.startswith('cygwin'):
++ return 'win'
++ if system in flavors:
++ return flavors[system]
++
++ return 'linux'
+
+
+ def CalculateVariables(default_variables, params):
++ flavor = GetFlavor(params)
++ if flavor == 'bsd':
++ flavor = platform.system().lower()
+ generator_flags = params.get('generator_flags', {})
+- default_variables['OS'] = generator_flags.get('os', GetFlavor(params))
++ default_variables['OS'] = generator_flags.get('os', flavor)
+
+
+ def CalculateGeneratorInputInfo(params):
diff --git a/www/firefox24/patches/patch-media_webrtc_trunk_webrtc_build_common.gypi b/www/firefox24/patches/patch-media_webrtc_trunk_webrtc_build_common.gypi
new file mode 100644
index 00000000000..cd2b31fd620
--- /dev/null
+++ b/www/firefox24/patches/patch-media_webrtc_trunk_webrtc_build_common.gypi
@@ -0,0 +1,25 @@
+$NetBSD: patch-media_webrtc_trunk_webrtc_build_common.gypi,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- media/webrtc/trunk/webrtc/build/common.gypi.orig 2013-09-10 03:43:47.000000000 +0000
++++ media/webrtc/trunk/webrtc/build/common.gypi
+@@ -71,9 +71,9 @@
+ 'enable_data_logging%': 0,
+
+ # Disable these to not build components which can be externally provided.
+- 'build_libjpeg%': 1,
++ 'build_libjpeg%': 0,
+ 'build_libyuv%': 1,
+- 'build_libvpx%': 1,
++ 'build_libvpx%': 0,
+
+ # Enable to use the Mozilla internal settings.
+ 'build_with_mozilla%': 0,
+@@ -238,7 +238,7 @@
+ }],
+ ['OS=="dragonfly" or OS=="netbsd"', {
+ 'defines': [
+- # doesn't support pthread_condattr_setclock
++ # doesn't support pthread_condattr_setclock, NetBSD 6 supports it.
+ 'WEBRTC_CLOCK_TYPE_REALTIME',
+ ],
+ }],
diff --git a/www/firefox24/patches/patch-media_webrtc_trunk_webrtc_modules_audio__device_audio__device__impl.cc b/www/firefox24/patches/patch-media_webrtc_trunk_webrtc_modules_audio__device_audio__device__impl.cc
new file mode 100644
index 00000000000..c2cf69c9824
--- /dev/null
+++ b/www/firefox24/patches/patch-media_webrtc_trunk_webrtc_modules_audio__device_audio__device__impl.cc
@@ -0,0 +1,71 @@
+$NetBSD: patch-media_webrtc_trunk_webrtc_modules_audio__device_audio__device__impl.cc,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- media/webrtc/trunk/webrtc/modules/audio_device/audio_device_impl.cc.orig 2013-09-10 03:43:47.000000000 +0000
++++ media/webrtc/trunk/webrtc/modules/audio_device/audio_device_impl.cc
+@@ -16,7 +16,9 @@
+ #include <assert.h>
+ #include <string.h>
+
+-#if defined(_WIN32)
++#if defined(WEBRTC_DUMMY_AUDIO_BUILD)
++// do not include platform specific headers
++#elif defined(_WIN32)
+ #include "audio_device_utility_win.h"
+ #include "audio_device_wave_win.h"
+ #if defined(WEBRTC_WINDOWS_CORE_AUDIO_BUILD)
+@@ -32,14 +34,8 @@
+ #include <stdlib.h>
+ #include "audio_device_utility_android.h"
+ #include "audio_device_jni_android.h"
+-#elif defined(WEBRTC_LINUX)
++#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)
+ #include "audio_device_utility_linux.h"
+- #if defined(LINUX_ALSA)
+- #include "audio_device_alsa_linux.h"
+- #endif
+- #if defined(LINUX_PULSE)
+- #include "audio_device_pulse_linux.h"
+- #endif
+ #elif defined(WEBRTC_IOS)
+ #include "audio_device_utility_ios.h"
+ #include "audio_device_ios.h"
+@@ -47,6 +43,12 @@
+ #include "audio_device_utility_mac.h"
+ #include "audio_device_mac.h"
+ #endif
++#if defined(LINUX_ALSA)
++ #include "audio_device_alsa_linux.h"
++#endif
++#if defined(LINUX_PULSE)
++ #include "audio_device_pulse_linux.h"
++#endif
+ #include "audio_device_dummy.h"
+ #include "audio_device_utility_dummy.h"
+ #include "critical_section_wrapper.h"
+@@ -161,7 +163,7 @@ WebRtc_Word32 AudioDeviceModuleImpl::Che
+ #elif defined(WEBRTC_ANDROID)
+ platform = kPlatformAndroid;
+ WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "current platform is ANDROID");
+-#elif defined(WEBRTC_LINUX)
++#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)
+ platform = kPlatformLinux;
+ WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "current platform is LINUX");
+ #elif defined(WEBRTC_IOS)
+@@ -301,7 +303,7 @@ WebRtc_Word32 AudioDeviceModuleImpl::Cre
+
+ // Create the *Linux* implementation of the Audio Device
+ //
+-#elif defined(WEBRTC_LINUX)
++#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)
+ if ((audioLayer == kLinuxPulseAudio) || (audioLayer == kPlatformDefaultAudio))
+ {
+ #if defined(LINUX_PULSE)
+@@ -347,7 +349,7 @@ WebRtc_Word32 AudioDeviceModuleImpl::Cre
+ //
+ ptrAudioDeviceUtility = new AudioDeviceUtilityLinux(Id());
+ }
+-#endif // #if defined(WEBRTC_LINUX)
++#endif // #if defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)
+
+ // Create the *iPhone* implementation of the Audio Device
+ //
diff --git a/www/firefox24/patches/patch-media_webrtc_trunk_webrtc_modules_audio__device_test_audio__device__test__api.cc b/www/firefox24/patches/patch-media_webrtc_trunk_webrtc_modules_audio__device_test_audio__device__test__api.cc
new file mode 100644
index 00000000000..c7891097548
--- /dev/null
+++ b/www/firefox24/patches/patch-media_webrtc_trunk_webrtc_modules_audio__device_test_audio__device__test__api.cc
@@ -0,0 +1,31 @@
+$NetBSD: patch-media_webrtc_trunk_webrtc_modules_audio__device_test_audio__device__test__api.cc,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- media/webrtc/trunk/webrtc/modules/audio_device/test/audio_device_test_api.cc.orig 2013-09-10 03:43:47.000000000 +0000
++++ media/webrtc/trunk/webrtc/modules/audio_device/test/audio_device_test_api.cc
+@@ -196,7 +196,7 @@ class AudioDeviceAPITest: public testing
+ // Create default implementation instance
+ EXPECT_TRUE((audio_device_ = AudioDeviceModuleImpl::Create(
+ kId, AudioDeviceModule::kPlatformDefaultAudio)) != NULL);
+-#elif defined(WEBRTC_LINUX)
++#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)
+ EXPECT_TRUE((audio_device_ = AudioDeviceModuleImpl::Create(
+ kId, AudioDeviceModule::kWindowsWaveAudio)) == NULL);
+ EXPECT_TRUE((audio_device_ = AudioDeviceModuleImpl::Create(
+@@ -1689,7 +1689,7 @@ TEST_F(AudioDeviceAPITest, CPULoad) {
+
+ // TODO(kjellander): Fix flakiness causing failures on Windows.
+ // TODO(phoglund): Fix flakiness causing failures on Linux.
+-#if !defined(_WIN32) && !defined(WEBRTC_LINUX)
++#if !defined(_WIN32) && !defined(WEBRTC_LINUX) && !defined(WEBRTC_BSD)
+ TEST_F(AudioDeviceAPITest, StartAndStopRawOutputFileRecording) {
+ // NOTE: this API is better tested in a functional test
+ CheckInitialPlayoutStates();
+@@ -1758,7 +1758,7 @@ TEST_F(AudioDeviceAPITest, StartAndStopR
+ // - size of raw_input_not_recording.pcm shall be 0
+ // - size of raw_input_not_recording.pcm shall be > 0
+ }
+-#endif // !WIN32 && !WEBRTC_LINUX
++#endif // !WIN32 && !WEBRTC_LINUX && !defined(WEBRTC_BSD)
+
+ TEST_F(AudioDeviceAPITest, RecordingSampleRate) {
+ WebRtc_UWord32 sampleRate(0);
diff --git a/www/firefox24/patches/patch-media_webrtc_trunk_webrtc_modules_video__capture_linux_device__info__linux.cc b/www/firefox24/patches/patch-media_webrtc_trunk_webrtc_modules_video__capture_linux_device__info__linux.cc
new file mode 100644
index 00000000000..03091e3b8ff
--- /dev/null
+++ b/www/firefox24/patches/patch-media_webrtc_trunk_webrtc_modules_video__capture_linux_device__info__linux.cc
@@ -0,0 +1,47 @@
+$NetBSD: patch-media_webrtc_trunk_webrtc_modules_video__capture_linux_device__info__linux.cc,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc.orig 2013-09-10 03:43:47.000000000 +0000
++++ media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc
+@@ -26,10 +26,30 @@
+ #else
+ #include <linux/videodev2.h>
+ #endif
++#ifdef HAVE_LIBV4L2
++#include <libv4l2.h>
++#endif
+
+ #include "ref_count.h"
+ #include "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
++
++#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
+ {
+@@ -137,6 +157,11 @@ WebRtc_Word32 DeviceInfoLinux::GetDevice
+ 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/firefox24/patches/patch-media_webrtc_trunk_webrtc_modules_video__capture_linux_video__capture__linux.cc b/www/firefox24/patches/patch-media_webrtc_trunk_webrtc_modules_video__capture_linux_video__capture__linux.cc
new file mode 100644
index 00000000000..771d7a1144b
--- /dev/null
+++ b/www/firefox24/patches/patch-media_webrtc_trunk_webrtc_modules_video__capture_linux_video__capture__linux.cc
@@ -0,0 +1,30 @@
+$NetBSD: patch-media_webrtc_trunk_webrtc_modules_video__capture_linux_video__capture__linux.cc,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- media/webrtc/trunk/webrtc/modules/video_capture/linux/video_capture_linux.cc.orig 2013-09-10 03:43:47.000000000 +0000
++++ 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>
+
+@@ -34,6 +37,15 @@
+ #include "critical_section_wrapper.h"
+ #include "video_capture_linux.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/firefox24/patches/patch-media_webrtc_trunk_webrtc_modules_video__capture_video__capture.gypi b/www/firefox24/patches/patch-media_webrtc_trunk_webrtc_modules_video__capture_video__capture.gypi
new file mode 100644
index 00000000000..9c972793d53
--- /dev/null
+++ b/www/firefox24/patches/patch-media_webrtc_trunk_webrtc_modules_video__capture_video__capture.gypi
@@ -0,0 +1,31 @@
+$NetBSD: patch-media_webrtc_trunk_webrtc_modules_video__capture_video__capture.gypi,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- media/webrtc/trunk/webrtc/modules/video_capture/video_capture.gypi.orig 2013-09-10 03:43:47.000000000 +0000
++++ 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': [
+ {
+ 'target_name': 'video_capture_module',
+@@ -49,6 +52,16 @@
+ }, { # include_internal_video_capture == 1
+ 'conditions': [
+ ['include_v4l2_video_capture==1', {
++ 'conditions': [
++ ['use_libv4l2==1', {
++ 'defines': [
++ 'HAVE_LIBV4L2',
++ ],
++ 'libraries': [
++ '-lv4l2',
++ ],
++ }],
++ ],
+ 'include_dirs': [
+ 'linux',
+ ],
diff --git a/www/firefox24/patches/patch-media_webrtc_trunk_webrtc_modules_video__capture_video__capture__factory.cc b/www/firefox24/patches/patch-media_webrtc_trunk_webrtc_modules_video__capture_video__capture__factory.cc
new file mode 100644
index 00000000000..9b5e1e0f08b
--- /dev/null
+++ b/www/firefox24/patches/patch-media_webrtc_trunk_webrtc_modules_video__capture_video__capture__factory.cc
@@ -0,0 +1,15 @@
+$NetBSD: patch-media_webrtc_trunk_webrtc_modules_video__capture_video__capture__factory.cc,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- media/webrtc/trunk/webrtc/modules/video_capture/video_capture_factory.cc.orig 2013-06-17 22:13:20.000000000 +0000
++++ media/webrtc/trunk/webrtc/modules/video_capture/video_capture_factory.cc
+@@ -8,8 +8,10 @@
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
++_Pragma("GCC visibility push(default)")
+ #include "video_capture_factory.h"
+ #include "video_capture_impl.h"
++_Pragma("GCC visibility pop")
+
+ namespace webrtc
+ {
diff --git a/www/firefox24/patches/patch-media_webrtc_trunk_webrtc_system__wrappers_source_condition__variable.cc b/www/firefox24/patches/patch-media_webrtc_trunk_webrtc_system__wrappers_source_condition__variable.cc
new file mode 100644
index 00000000000..4c834a21381
--- /dev/null
+++ b/www/firefox24/patches/patch-media_webrtc_trunk_webrtc_system__wrappers_source_condition__variable.cc
@@ -0,0 +1,13 @@
+$NetBSD: patch-media_webrtc_trunk_webrtc_system__wrappers_source_condition__variable.cc,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- media/webrtc/trunk/webrtc/system_wrappers/source/condition_variable.cc.orig 2013-09-10 03:43:47.000000000 +0000
++++ media/webrtc/trunk/webrtc/system_wrappers/source/condition_variable.cc
+@@ -16,6 +16,8 @@
+ #elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) || defined(WEBRTC_MAC)
+ #include <pthread.h>
+ #include "condition_variable_posix.h"
++#else
++#include <stddef.h> // for NULL
+ #endif
+
+ namespace webrtc {
diff --git a/www/firefox24/patches/patch-media_webrtc_trunk_webrtc_system__wrappers_source_spreadsortlib_spreadsort.hpp b/www/firefox24/patches/patch-media_webrtc_trunk_webrtc_system__wrappers_source_spreadsortlib_spreadsort.hpp
new file mode 100644
index 00000000000..9790546bc06
--- /dev/null
+++ b/www/firefox24/patches/patch-media_webrtc_trunk_webrtc_system__wrappers_source_spreadsortlib_spreadsort.hpp
@@ -0,0 +1,18 @@
+$NetBSD: patch-media_webrtc_trunk_webrtc_system__wrappers_source_spreadsortlib_spreadsort.hpp,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- media/webrtc/trunk/webrtc/system_wrappers/source/spreadsortlib/spreadsort.hpp.orig 2013-05-11 19:19:46.000000000 +0000
++++ media/webrtc/trunk/webrtc/system_wrappers/source/spreadsortlib/spreadsort.hpp
+@@ -21,6 +21,13 @@ Scott McMurray
+ #include "constants.hpp"
+ #include <cstring>
+
++#ifdef __FreeBSD__
++# include <osreldate.h>
++# if __FreeBSD_version < 900506
++# define getchar boost_getchar
++# endif
++#endif
++
+ namespace boost {
+ namespace detail {
+ //This only works on unsigned data types
diff --git a/www/firefox24/patches/patch-media_webrtc_trunk_webrtc_system__wrappers_source_thread__posix.cc b/www/firefox24/patches/patch-media_webrtc_trunk_webrtc_system__wrappers_source_thread__posix.cc
new file mode 100644
index 00000000000..ca778edcd26
--- /dev/null
+++ b/www/firefox24/patches/patch-media_webrtc_trunk_webrtc_system__wrappers_source_thread__posix.cc
@@ -0,0 +1,48 @@
+$NetBSD: patch-media_webrtc_trunk_webrtc_system__wrappers_source_thread__posix.cc,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- media/webrtc/trunk/webrtc/system_wrappers/source/thread_posix.cc.orig 2013-09-10 03:43:47.000000000 +0000
++++ media/webrtc/trunk/webrtc/system_wrappers/source/thread_posix.cc
+@@ -272,7 +272,7 @@ bool ThreadPosix::Start(unsigned int& th
+
+ // CPU_ZERO and CPU_SET are not available in NDK r7, so disable
+ // SetAffinity on Android for now.
+-#if defined(__FreeBSD__) || (defined(WEBRTC_LINUX) && (!defined(WEBRTC_ANDROID)) && (!defined(WEBRTC_GONK)))
++#if defined(__FreeBSD__) || defined(__NetBSD__) || (defined(WEBRTC_LINUX) && (!defined(WEBRTC_ANDROID)) && (!defined(WEBRTC_GONK)))
+ bool ThreadPosix::SetAffinity(const int* processor_numbers,
+ const unsigned int amount_of_processors) {
+ if (!processor_numbers || (amount_of_processors == 0)) {
+@@ -280,20 +280,34 @@ bool ThreadPosix::SetAffinity(const int*
+ }
+ #if defined(__FreeBSD__)
+ cpuset_t mask;
++#elif defined(__NetBSD__)
++ cpuset_t *mask;
+ #else
+ cpu_set_t mask;
+ #endif
++#if defined(__NetBSD__)
++ cpuset_zero(mask);
++#else
+ CPU_ZERO(&mask);
++#endif
+
+ for (unsigned int processor = 0;
+ processor < amount_of_processors;
+ ++processor) {
++#if defined(__NetBSD__)
++ cpuset_set(processor_numbers[processor], mask);
++#else
+ CPU_SET(processor_numbers[processor], &mask);
++#endif
+ }
+ #if defined(__FreeBSD__)
+ const int result = pthread_setaffinity_np(thread_,
+ sizeof(mask),
+ &mask);
++#elif defined(__NetBSD__)
++ const int result = pthread_setaffinity_np(thread_,
++ sizeof(mask),
++ mask);
+ #elif defined(WEBRTC_ANDROID) || defined(WEBRTC_GONK)
+ // Android.
+ const int result = syscall(__NR_sched_setaffinity,
diff --git a/www/firefox24/patches/patch-memory_mozalloc_mozalloc__abort.cpp b/www/firefox24/patches/patch-memory_mozalloc_mozalloc__abort.cpp
new file mode 100644
index 00000000000..9330ec4a3a3
--- /dev/null
+++ b/www/firefox24/patches/patch-memory_mozalloc_mozalloc__abort.cpp
@@ -0,0 +1,16 @@
+$NetBSD: patch-memory_mozalloc_mozalloc__abort.cpp,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- memory/mozalloc/mozalloc_abort.cpp.orig 2013-05-11 19:19:46.000000000 +0000
++++ memory/mozalloc/mozalloc_abort.cpp
+@@ -34,7 +34,11 @@ mozalloc_abort(const char* const msg)
+ // Define abort() here, so that it is used instead of the system abort(). This
+ // lets us control the behavior when aborting, in order to get better results
+ // on *NIX platforms. See mozalloc_abort for details.
++#if defined(SOLARIS)
++void std::abort(void)
++#else
+ void abort(void)
++#endif
+ {
+ mozalloc_abort("Redirecting call to abort() to mozalloc_abort\n");
+ }
diff --git a/www/firefox24/patches/patch-mfbt_Atomics.h b/www/firefox24/patches/patch-mfbt_Atomics.h
new file mode 100644
index 00000000000..177d75e1b9f
--- /dev/null
+++ b/www/firefox24/patches/patch-mfbt_Atomics.h
@@ -0,0 +1,13 @@
+$NetBSD: patch-mfbt_Atomics.h,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- mfbt/Atomics.h.orig 2013-09-10 03:43:48.000000000 +0000
++++ mfbt/Atomics.h
+@@ -37,7 +37,7 @@
+ */
+ # if !defined(__linux__) && !defined(__OpenBSD__) && \
+ (__cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)) && \
+- __has_include(<atomic>)
++ __has_include_next(<atomic>)
+ # define MOZ_HAVE_CXX11_ATOMICS
+ # endif
+ /*
diff --git a/www/firefox24/patches/patch-mfbt_Poison.cpp b/www/firefox24/patches/patch-mfbt_Poison.cpp
new file mode 100644
index 00000000000..e02f7692f4d
--- /dev/null
+++ b/www/firefox24/patches/patch-mfbt_Poison.cpp
@@ -0,0 +1,20 @@
+$NetBSD: patch-mfbt_Poison.cpp,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+* Use posix_madvise(3) instead of madvise(3) for Solaris/SunOS.
+ Solaris/SunOS's madvise(3) is not enabled in this context,
+ and its first argument type is different from NetBSD/Linux's one.
+
+--- mfbt/Poison.cpp.orig 2013-09-11 03:22:45.000000000 +0000
++++ mfbt/Poison.cpp
+@@ -125,7 +125,11 @@ ReleaseRegion(void *region, uintptr_t si
+ static bool
+ ProbeRegion(uintptr_t region, uintptr_t size)
+ {
++#if !defined(__sun__)
+ if (madvise(reinterpret_cast<void*>(region), size, MADV_NORMAL)) {
++#else
++ if (posix_madvise(reinterpret_cast<void*>(region), size, MADV_NORMAL)) {
++#endif
+ return true;
+ } else {
+ return false;
diff --git a/www/firefox24/patches/patch-modules_libjar_nsZipArchive.cpp b/www/firefox24/patches/patch-modules_libjar_nsZipArchive.cpp
new file mode 100644
index 00000000000..cec9858fd08
--- /dev/null
+++ b/www/firefox24/patches/patch-modules_libjar_nsZipArchive.cpp
@@ -0,0 +1,15 @@
+$NetBSD: patch-modules_libjar_nsZipArchive.cpp,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- modules/libjar/nsZipArchive.cpp.orig 2013-06-18 11:01:37.000000000 +0000
++++ modules/libjar/nsZipArchive.cpp
+@@ -590,7 +590,9 @@ MOZ_WIN_MEM_TRY_BEGIN
+ // Success means optimized jar layout from bug 559961 is in effect
+ uint32_t readaheadLength = xtolong(startp);
+ if (readaheadLength) {
+-#if defined(XP_UNIX)
++#if defined(OS_SOLARIS)
++ posix_madvise(const_cast<uint8_t*>(startp), readaheadLength, POSIX_MADV_WILLNEED);
++#elif defined(XP_UNIX)
+ madvise(const_cast<uint8_t*>(startp), readaheadLength, MADV_WILLNEED);
+ #elif defined(XP_WIN)
+ if (aFd) {
diff --git a/www/firefox24/patches/patch-modules_libpref_src_init_all.js b/www/firefox24/patches/patch-modules_libpref_src_init_all.js
new file mode 100644
index 00000000000..bfc7e59fccc
--- /dev/null
+++ b/www/firefox24/patches/patch-modules_libpref_src_init_all.js
@@ -0,0 +1,13 @@
+$NetBSD: patch-modules_libpref_src_init_all.js,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- modules/libpref/src/init/all.js.orig 2013-09-10 03:43:49.000000000 +0000
++++ modules/libpref/src/init/all.js
+@@ -188,7 +188,7 @@ pref("media.webm.enabled", true);
+ pref("media.dash.enabled", false);
+ #endif
+ #ifdef MOZ_GSTREAMER
+-pref("media.gstreamer.enabled", false);
++pref("media.gstreamer.enabled", true);
+ #endif
+ #ifdef MOZ_WEBRTC
+ pref("media.navigator.enabled", true);
diff --git a/www/firefox24/patches/patch-netwerk_sctp_src_netinet6_sctp6__usrreq.c b/www/firefox24/patches/patch-netwerk_sctp_src_netinet6_sctp6__usrreq.c
new file mode 100644
index 00000000000..064c1159a78
--- /dev/null
+++ b/www/firefox24/patches/patch-netwerk_sctp_src_netinet6_sctp6__usrreq.c
@@ -0,0 +1,13 @@
+$NetBSD: patch-netwerk_sctp_src_netinet6_sctp6__usrreq.c,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- netwerk/sctp/src/netinet6/sctp6_usrreq.c.orig 2013-06-17 22:13:23.000000000 +0000
++++ netwerk/sctp/src/netinet6/sctp6_usrreq.c
+@@ -459,6 +459,8 @@ sctp6_notify(struct sctp_inpcb *inp,
+ (icmph->icmp6_code == ICMP_UNREACH_HOST_PROHIB) ||
+ #ifdef __Panda__
+ (icmph->icmp6_code == ICMP_UNREACH_ADMIN)) {
++#elif defined(__Userspace_os_NetBSD)
++ (icmph->icmp6_code == ICMP_UNREACH_ADMIN_PROHIBIT)) {
+ #else
+ (icmph->icmp6_code == ICMP_UNREACH_FILTER_PROHIB)) {
+ #endif
diff --git a/www/firefox24/patches/patch-netwerk_sctp_src_netinet_sctp__os__userspace.h b/www/firefox24/patches/patch-netwerk_sctp_src_netinet_sctp__os__userspace.h
new file mode 100644
index 00000000000..aea1f938b10
--- /dev/null
+++ b/www/firefox24/patches/patch-netwerk_sctp_src_netinet_sctp__os__userspace.h
@@ -0,0 +1,41 @@
+$NetBSD: patch-netwerk_sctp_src_netinet_sctp__os__userspace.h,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- netwerk/sctp/src/netinet/sctp_os_userspace.h.orig 2013-06-17 22:13:23.000000000 +0000
++++ netwerk/sctp/src/netinet/sctp_os_userspace.h
+@@ -383,7 +383,7 @@ struct udphdr {
+ #else /* !defined(Userspace_os_Windows) */
+ #include <sys/cdefs.h> /* needed? added from old __FreeBSD__ */
+ #include <sys/socket.h>
+-#if defined(__Userspace_os_FreeBSD) || defined(__Userspace_os_OpenBSD) || defined(ANDROID)
++#if defined(__Userspace_os_FreeBSD) || defined(__Userspace_os_OpenBSD) || defined(ANDROID) || defined(__Userspace_os_NetBSD)
+ #include <pthread.h>
+ #endif
+ typedef pthread_mutex_t userland_mutex_t;
+@@ -397,7 +397,9 @@ typedef pthread_t userland_thread_t;
+ #define MA_OWNED 7 /* sys/mutex.h typically on FreeBSD */
+ #if !defined(__Userspace_os_FreeBSD)
+ struct mtx {int dummy;};
++#if !defined(__Userspace_os_NetBSD)
+ struct selinfo {int dummy;};
++#endif
+ struct sx {int dummy;};
+ #endif
+
+@@ -500,7 +502,7 @@ struct sx {int dummy;};
+ #include <netinet/ip6.h>
+ #include <netinet/icmp6.h>
+ #endif
+-#if defined(__Userspace_os_Linux) || defined(__Userspace_os_Darwin) || defined(__Userspace_os_FreeBSD) || defined(__Userspace_os_OpenBSD) ||defined(__Userspace_os_Windows)
++#if defined(__Userspace_os_Linux) || defined(__Userspace_os_Darwin) || defined(__Userspace_os_FreeBSD) || defined(__Userspace_os_OpenBSD) ||defined(__Userspace_os_Windows) || defined(__Userspace_os_NetBSD)
+ #include "user_ip6_var.h"
+ #else
+ #include <netinet6/ip6_var.h>
+@@ -1120,6 +1122,8 @@ sctp_get_mbuf_for_msg(unsigned int space
+ #if defined(__Userspace_os_FreeBSD) || defined(__Userspace_os_OpenBSD)
+ /* stolen from /usr/include/sys/socket.h */
+ #define CMSG_ALIGN(n) _ALIGN(n)
++#elif defined(__Userspace_os_NetBSD)
++#define CMSG_ALIGN(n) (((n) + __ALIGNBYTES) & ~__ALIGNBYTES)
+ #elif defined(__Userspace_os_Darwin)
+ #if !defined(__DARWIN_ALIGNBYTES)
+ #define __DARWIN_ALIGNBYTES (sizeof(__darwin_size_t) - 1)
diff --git a/www/firefox24/patches/patch-netwerk_sctp_src_netinet_sctp__usrreq.c b/www/firefox24/patches/patch-netwerk_sctp_src_netinet_sctp__usrreq.c
new file mode 100644
index 00000000000..134ab5dbe8b
--- /dev/null
+++ b/www/firefox24/patches/patch-netwerk_sctp_src_netinet_sctp__usrreq.c
@@ -0,0 +1,13 @@
+$NetBSD: patch-netwerk_sctp_src_netinet_sctp__usrreq.c,v 1.1 2013/11/03 04:51:59 ryoon Exp $
+
+--- netwerk/sctp/src/netinet/sctp_usrreq.c.orig 2013-06-17 22:13:23.000000000 +0000
++++ netwerk/sctp/src/netinet/sctp_usrreq.c
+@@ -414,6 +414,8 @@ sctp_notify(struct sctp_inpcb *inp,
+ (icmph->icmp_code == ICMP_UNREACH_HOST_PROHIB) ||
+ #ifdef __Panda__
+ (icmph->icmp_code == ICMP_UNREACH_ADMIN)) {
++#elif defined(__Userspace_os_NetBSD)
++ (icmph->icmp_code == ICMP_UNREACH_ADMIN_PROHIBIT)) {
+ #else
+ (icmph->icmp_code == ICMP_UNREACH_FILTER_PROHIB)) {
+ #endif
diff --git a/www/firefox24/patches/patch-netwerk_sctp_src_user__recv__thread.c b/www/firefox24/patches/patch-netwerk_sctp_src_user__recv__thread.c
new file mode 100644
index 00000000000..bf64923e2dc
--- /dev/null
+++ b/www/firefox24/patches/patch-netwerk_sctp_src_user__recv__thread.c
@@ -0,0 +1,13 @@
+$NetBSD: patch-netwerk_sctp_src_user__recv__thread.c,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+--- netwerk/sctp/src/user_recv_thread.c.orig 2013-05-11 19:19:49.000000000 +0000
++++ netwerk/sctp/src/user_recv_thread.c
+@@ -35,7 +35,7 @@
+ #include <netinet/in.h>
+ #include <unistd.h>
+ #include <pthread.h>
+-#if !defined(__Userspace_os_FreeBSD)
++#if !defined(__Userspace_os_FreeBSD) && !defined(__Userspace_os_NetBSD)
+ #include <sys/uio.h>
+ #else
+ #include <user_ip6_var.h>
diff --git a/www/firefox24/patches/patch-netwerk_sctp_src_user__socket.c b/www/firefox24/patches/patch-netwerk_sctp_src_user__socket.c
new file mode 100644
index 00000000000..93b4f3c8fcc
--- /dev/null
+++ b/www/firefox24/patches/patch-netwerk_sctp_src_user__socket.c
@@ -0,0 +1,53 @@
+$NetBSD: patch-netwerk_sctp_src_user__socket.c,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+--- netwerk/sctp/src/user_socket.c.orig 2013-06-17 22:13:23.000000000 +0000
++++ netwerk/sctp/src/user_socket.c
+@@ -1104,8 +1104,13 @@ userspace_sctp_recvmsg(struct socket *so
+ (struct sctp_sndrcvinfo *)sinfo, 1);
+
+ if (error) {
++#if defined(__Userspace_os_NetBSD)
++ if (auio.uio_resid != (int)ulen && (
++ error == EINTR || error == EWOULDBLOCK))
++#else
+ if (auio.uio_resid != (int)ulen && (error == ERESTART ||
+ error == EINTR || error == EWOULDBLOCK))
++#endif
+ error = 0;
+ }
+ if ((fromlenp != NULL) && (fromlen > 0) && (from != NULL)) {
+@@ -1193,7 +1198,11 @@ usrsctp_recvv(struct socket *so,
+ (struct sctp_sndrcvinfo *)&seinfo, 1);
+ if (errno) {
+ if (auio.uio_resid != (int)ulen &&
++#if defined(__Userspace_os_NetBSD)
++ (errno == EINTR || errno == EWOULDBLOCK)) {
++#else
+ (errno == ERESTART || errno == EINTR || errno == EWOULDBLOCK)) {
++#endif
+ errno = 0;
+ }
+ }
+@@ -2143,7 +2152,11 @@ int user_connect(struct socket *so, stru
+ error = pthread_cond_wait(SOCK_COND(so), SOCK_MTX(so));
+ #endif
+ if (error) {
++#if defined(__Userspace_os_NetBSD)
++ if (error == EINTR)
++#else
+ if (error == EINTR || error == ERESTART)
++#endif
+ interrupted = 1;
+ break;
+ }
+@@ -2157,8 +2170,10 @@ int user_connect(struct socket *so, stru
+ bad:
+ if (!interrupted)
+ so->so_state &= ~SS_ISCONNECTING;
++#if !defined(__Userspace_os_NetBSD)
+ if (error == ERESTART)
+ error = EINTR;
++#endif
+ done1:
+ return (error);
+ }
diff --git a/www/firefox24/patches/patch-netwerk_sctp_src_user__socketvar.h b/www/firefox24/patches/patch-netwerk_sctp_src_user__socketvar.h
new file mode 100644
index 00000000000..668e976ff67
--- /dev/null
+++ b/www/firefox24/patches/patch-netwerk_sctp_src_user__socketvar.h
@@ -0,0 +1,27 @@
+$NetBSD: patch-netwerk_sctp_src_user__socketvar.h,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+--- netwerk/sctp/src/user_socketvar.h.orig 2013-06-17 22:13:23.000000000 +0000
++++ netwerk/sctp/src/user_socketvar.h
+@@ -47,7 +47,7 @@
+ /* #include <sys/_lock.h> was 0 byte file */
+ /* #include <sys/_mutex.h> was 0 byte file */
+ /* #include <sys/_sx.h> */ /*__Userspace__ alternative?*/
+-#if !defined(__Userspace_os_Windows) && !defined(__Userspace_os_FreeBSD)
++#if !defined(__Userspace_os_Windows) && !defined(__Userspace_os_FreeBSD) && !defined(__Userspace_os_NetBSD)
+ #include <sys/uio.h>
+ #endif
+ #define SOCK_MAXADDRLEN 255
+@@ -64,11 +64,11 @@
+ #define ERESTART (-1)
+ #endif
+
+-#if !defined(__Userspace_os_Darwin) && !defined(__Userspace_os_OpenBSD)
++#if !defined(__Userspace_os_Darwin) && !defined(__Userspace_os_OpenBSD) && !defined(__Userspace_os_NetBSD)
+ enum uio_rw { UIO_READ, UIO_WRITE };
+ #endif
+
+-#if !defined(__Userspace_os_OpenBSD)
++#if !defined(__Userspace_os_OpenBSD) && !defined(__Userspace_os_NetBSD)
+ /* Segment flag values. */
+ enum uio_seg {
+ UIO_USERSPACE, /* from user data space */
diff --git a/www/firefox24/patches/patch-netwerk_wifi_Makefile.in b/www/firefox24/patches/patch-netwerk_wifi_Makefile.in
new file mode 100644
index 00000000000..6cc491b1c25
--- /dev/null
+++ b/www/firefox24/patches/patch-netwerk_wifi_Makefile.in
@@ -0,0 +1,13 @@
+$NetBSD: patch-netwerk_wifi_Makefile.in,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+--- netwerk/wifi/Makefile.in.orig 2013-09-10 03:43:50.000000000 +0000
++++ netwerk/wifi/Makefile.in
+@@ -26,7 +26,7 @@ ifeq ($(OS_ARCH),SunOS)
+ OS_INCLUDES += $(GLIB_CFLAGS)
+ endif
+
+-ifdef MOZ_ENABLE_DBUS
++ifdef NECKO_WIFI_DBUS
+ OS_INCLUDES += $(MOZ_DBUS_GLIB_CFLAGS)
+ endif
+
diff --git a/www/firefox24/patches/patch-netwerk_wifi_moz.build b/www/firefox24/patches/patch-netwerk_wifi_moz.build
new file mode 100644
index 00000000000..fdd66e3b643
--- /dev/null
+++ b/www/firefox24/patches/patch-netwerk_wifi_moz.build
@@ -0,0 +1,24 @@
+$NetBSD: patch-netwerk_wifi_moz.build,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+--- netwerk/wifi/moz.build.orig 2013-09-10 03:43:50.000000000 +0000
++++ netwerk/wifi/moz.build
+@@ -31,6 +31,10 @@ if CONFIG['OS_ARCH'] == 'Darwin':
+ CPP_SOURCES += [
+ 'nsWifiScannerMac.cpp',
+ ]
++elif CONFIG['OS_ARCH'] == 'FreeBSD':
++ CPP_SOURCES += [
++ 'nsWifiScannerFreeBSD.cpp',
++ ]
+ elif CONFIG['OS_ARCH'] == 'WINNT':
+ CPP_SOURCES += [
+ 'nsWifiScannerWin.cpp',
+@@ -40,7 +44,7 @@ elif CONFIG['OS_ARCH'] == 'SunOS':
+ 'nsWifiScannerSolaris.cpp',
+ ]
+
+-if CONFIG['MOZ_ENABLE_DBUS']:
++if CONFIG['NECKO_WIFI_DBUS']:
+ CPP_SOURCES += [
+ 'nsWifiScannerDBus.cpp',
+ ]
diff --git a/www/firefox24/patches/patch-netwerk_wifi_nsWifiScannerFreeBSD.cpp b/www/firefox24/patches/patch-netwerk_wifi_nsWifiScannerFreeBSD.cpp
new file mode 100644
index 00000000000..259bc012bab
--- /dev/null
+++ b/www/firefox24/patches/patch-netwerk_wifi_nsWifiScannerFreeBSD.cpp
@@ -0,0 +1,177 @@
+$NetBSD: patch-netwerk_wifi_nsWifiScannerFreeBSD.cpp,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+--- netwerk/wifi/nsWifiScannerFreeBSD.cpp.orig 2013-09-14 15:17:47.000000000 +0000
++++ netwerk/wifi/nsWifiScannerFreeBSD.cpp
+@@ -0,0 +1,172 @@
++/* This Source Code Form is subject to the terms of the Mozilla Public
++ * License, v. 2.0. If a copy of the MPL was not distributed with this
++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
++
++// Developed by J.R. Oldroyd <fbsd@opal.com>, December 2012.
++
++// For FreeBSD we use the getifaddrs(3) to obtain the list of interfaces
++// and then check for those with an 802.11 media type and able to return
++// a list of stations. This is similar to ifconfig(8).
++
++#include <sys/types.h>
++#include <sys/ioctl.h>
++#include <sys/socket.h>
++#include <net/if.h>
++#include <net/if_media.h>
++#include <net80211/ieee80211_ioctl.h>
++
++#include <ifaddrs.h>
++#include <string.h>
++#include <unistd.h>
++
++#include "nsWifiAccessPoint.h"
++
++using namespace mozilla;
++
++static nsresult
++FreeBSDGetAccessPointData(nsCOMArray<nsWifiAccessPoint> &accessPoints)
++{
++ bool res = false;
++ char *dupn = NULL;
++ struct ifaddrs *ifal, *ifa;
++ unsigned len;
++
++ // get list of interfaces
++ if (getifaddrs(&ifal) < 0)
++ return NS_ERROR_FAILURE;
++
++ accessPoints.Clear();
++
++ // loop through the interfaces
++ for (ifa = ifal; ifa; ifa = ifa->ifa_next) {
++ int s;
++ struct ifreq ifr;
++ struct ifmediareq ifmr;
++ struct ieee80211req i802r;
++ char iscanbuf[32*1024], *vsr;
++
++ memset(&ifr, 0, sizeof(ifr));
++
++ // list can contain duplicates, so ignore those
++ if (dupn != NULL && strcmp(dupn, ifa->ifa_name) == 0)
++ continue;
++ dupn = ifa->ifa_name;
++
++ // store interface name in socket structure
++ strncpy(ifr.ifr_name, ifa->ifa_name, sizeof(ifr.ifr_name));
++ ifr.ifr_addr.sa_family = AF_LOCAL;
++
++ // open socket to interface
++ if ((s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0)) < 0)
++ continue;
++
++ // clear interface media structure
++ (void) memset(&ifmr, 0, sizeof(ifmr));
++ (void) strncpy(ifmr.ifm_name, ifa->ifa_name, sizeof(ifmr.ifm_name));
++
++ // get interface media information
++ if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) < 0) {
++ close(s);
++ continue;
++ }
++
++ // check interface is a WiFi interface
++ if (IFM_TYPE(ifmr.ifm_active) != IFM_IEEE80211) {
++ close(s);
++ continue;
++ }
++
++ // perform WiFi scan
++ (void) memset(&i802r, 0, sizeof(i802r));
++ (void) strncpy(i802r.i_name, ifa->ifa_name, sizeof(i802r.i_name));
++ i802r.i_type = IEEE80211_IOC_SCAN_RESULTS;
++ i802r.i_data = iscanbuf;
++ i802r.i_len = sizeof(iscanbuf);
++ if (ioctl(s, SIOCG80211, &i802r) < 0) {
++ close(s);
++ continue;
++ }
++
++ // close socket
++ close(s);
++
++ // loop through WiFi networks and build geoloc-lookup structure
++ vsr = (char *) i802r.i_data;
++ len = i802r.i_len;
++ while (len >= sizeof(struct ieee80211req_scan_result)) {
++ struct ieee80211req_scan_result *isr;
++ char *id;
++ int idlen;
++ char ssid[IEEE80211_NWID_LEN+1];
++ nsWifiAccessPoint *ap;
++
++ isr = (struct ieee80211req_scan_result *) vsr;
++
++ // determine size of this entry
++ if (isr->isr_meshid_len) {
++ id = vsr + isr->isr_ie_off + isr->isr_ssid_len;
++ idlen = isr->isr_meshid_len;
++ }
++ else {
++ id = vsr + isr->isr_ie_off;
++ idlen = isr->isr_ssid_len;
++ }
++
++ // copy network data
++ strncpy(ssid, id, idlen);
++ ssid[idlen] = '\0';
++ ap = new nsWifiAccessPoint();
++ ap->setSSID(ssid, strlen(ssid));
++ ap->setMac(isr->isr_bssid);
++ ap->setSignal(isr->isr_rssi);
++ accessPoints.AppendObject(ap);
++ res = true;
++
++ // log the data
++ LOG(( "FreeBSD access point: "
++ "SSID: %s, MAC: %02x-%02x-%02x-%02x-%02x-%02x, "
++ "Strength: %d, Channel: %dMHz\n",
++ ssid, isr->isr_bssid[0], isr->isr_bssid[1], isr->isr_bssid[2],
++ isr->isr_bssid[3], isr->isr_bssid[4], isr->isr_bssid[5],
++ isr->isr_rssi, isr->isr_freq));
++
++ // increment pointers
++ len -= isr->isr_len;
++ vsr += isr->isr_len;
++ }
++ }
++
++ freeifaddrs(ifal);
++
++ return res ? NS_OK : NS_ERROR_FAILURE;
++}
++
++nsresult
++nsWifiMonitor::DoScan()
++{
++ // Regularly get the access point data.
++
++ nsCOMArray<nsWifiAccessPoint> lastAccessPoints;
++ nsCOMArray<nsWifiAccessPoint> accessPoints;
++
++ do {
++ nsresult rv = FreeBSDGetAccessPointData(accessPoints);
++ if (NS_FAILED(rv))
++ return rv;
++
++ bool accessPointsChanged = !AccessPointsEqual(accessPoints, lastAccessPoints);
++ ReplaceArray(lastAccessPoints, accessPoints);
++
++ rv = CallWifiListeners(lastAccessPoints, accessPointsChanged);
++ NS_ENSURE_SUCCESS(rv, rv);
++
++ // wait for some reasonable amount of time. pref?
++ LOG(("waiting on monitor\n"));
++
++ ReentrantMonitorAutoEnter mon(mReentrantMonitor);
++ mon.Wait(PR_SecondsToInterval(60));
++ }
++ while (mKeepGoing);
++
++ return NS_OK;
++}
diff --git a/www/firefox24/patches/patch-pb b/www/firefox24/patches/patch-pb
new file mode 100644
index 00000000000..d3bf2bae92d
--- /dev/null
+++ b/www/firefox24/patches/patch-pb
@@ -0,0 +1,11 @@
+$NetBSD: patch-pb,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+--- xulrunner/installer/libxul.pc.in.orig 2013-07-30 00:59:18.000000000 +0000
++++ xulrunner/installer/libxul.pc.in
+@@ -7,5 +7,5 @@ Name: libxul
+ Description: The Mozilla Runtime and Embedding Engine
+ Version: %MOZILLA_VERSION%
+ Requires: %NSPR_NAME% >= %NSPR_VERSION%
+-Libs: -L${sdkdir}/lib %MOZ_XUL_LINK%
++Libs: -Wl,-R${prefix}/lib/xulrunner24 -Wl,-R${prefix}/lib/xulrunner24 -Wl,-R${prefix}/lib/xulrunner24 -Wl,-R${prefix}/lib/xulrunner24 -L${prefix}/lib/xulrunner24 %MOZ_XUL_LINK%
+ Cflags: -I${includedir} %WCHAR_CFLAGS%
diff --git a/www/firefox24/patches/patch-pc b/www/firefox24/patches/patch-pc
new file mode 100644
index 00000000000..063e947f4d0
--- /dev/null
+++ b/www/firefox24/patches/patch-pc
@@ -0,0 +1,12 @@
+$NetBSD: patch-pc,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+--- xulrunner/installer/libxul-embedding.pc.in.orig 2013-07-30 00:59:18.000000000 +0000
++++ xulrunner/installer/libxul-embedding.pc.in
+@@ -6,5 +6,6 @@ idldir=%idldir%
+ Name: libxul-embedding
+ Description: Static library for version-independent embedding of the Mozilla runtime
+ Version: %MOZILLA_VERSION%
+-Libs: -L${sdkdir}/lib -lxpcomglue -ldl
++# XXXtnn -ldl removed
++Libs: -Wl,-R${prefix}/lib/xulrunner24 -Wl,-R${prefix}/lib/xulrunner24 -Wl,-R${prefix}/lib/xulrunner24 -Wl,-R${prefix}/lib/xulrunner24 -L${prefix}/lib/xulrunner24 -lxpcomglue
+ Cflags: -DXPCOM_GLUE -I${includedir} %WCHAR_CFLAGS%
diff --git a/www/firefox24/patches/patch-rc b/www/firefox24/patches/patch-rc
new file mode 100644
index 00000000000..70721aa5544
--- /dev/null
+++ b/www/firefox24/patches/patch-rc
@@ -0,0 +1,14 @@
+$NetBSD: patch-rc,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+--- browser/branding/unofficial/locales/en-US/brand.dtd.orig 2013-01-04 23:44:28.000000000 +0000
++++ browser/branding/unofficial/locales/en-US/brand.dtd
+@@ -2,7 +2,7 @@
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
+-<!ENTITY brandShortName "Mozilla Developer Preview">
+-<!ENTITY brandFullName "Mozilla Developer Preview">
++<!ENTITY brandShortName "Browser">
++<!ENTITY brandFullName "Browser">
+ <!ENTITY vendorShortName "mozilla.org">
+ <!ENTITY trademarkInfo.part1 " ">
diff --git a/www/firefox24/patches/patch-security_manager_ssl_src_JARSignatureVerification.cpp b/www/firefox24/patches/patch-security_manager_ssl_src_JARSignatureVerification.cpp
new file mode 100644
index 00000000000..3da7b6bed36
--- /dev/null
+++ b/www/firefox24/patches/patch-security_manager_ssl_src_JARSignatureVerification.cpp
@@ -0,0 +1,17 @@
+$NetBSD: patch-security_manager_ssl_src_JARSignatureVerification.cpp,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+--- security/manager/ssl/src/JARSignatureVerification.cpp.orig 2013-09-10 03:43:51.000000000 +0000
++++ security/manager/ssl/src/JARSignatureVerification.cpp
+@@ -596,9 +596,9 @@ OpenSignedJARFile(nsIFile * aJarFile,
+ }
+
+ // Verify that the signature file is a valid signature of the SF file
+- if (!SEC_PKCS7VerifyDetachedSignatureAtTime(p7_info, certUsageObjectSigner,
+- &sfCalculatedDigest.get(),
+- HASH_AlgSHA1, false, PR_Now())) {
++ if (!SEC_PKCS7VerifyDetachedSignature(p7_info, certUsageObjectSigner,
++ &sfCalculatedDigest.get(), HASH_AlgSHA1,
++ false)) {
+ PRErrorCode error = PR_GetError();
+ const char * errorName = PR_ErrorToName(error);
+ PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("Failed to verify detached signature: %s",
diff --git a/www/firefox24/patches/patch-security_manager_ssl_src_nsNSSComponent.cpp b/www/firefox24/patches/patch-security_manager_ssl_src_nsNSSComponent.cpp
new file mode 100644
index 00000000000..45856fe90a9
--- /dev/null
+++ b/www/firefox24/patches/patch-security_manager_ssl_src_nsNSSComponent.cpp
@@ -0,0 +1,12 @@
+$NetBSD: patch-security_manager_ssl_src_nsNSSComponent.cpp,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+--- security/manager/ssl/src/nsNSSComponent.cpp.orig 2013-09-10 03:43:51.000000000 +0000
++++ security/manager/ssl/src/nsNSSComponent.cpp
+@@ -49,6 +49,7 @@
+
+ #include "nss.h"
+ #include "ssl.h"
++#define NSS_ENABLE_ECC 1
+ #include "sslproto.h"
+ #include "secmod.h"
+ #include "secmime.h"
diff --git a/www/firefox24/patches/patch-toolkit_components_osfile_osfile__unix__allthreads.jsm b/www/firefox24/patches/patch-toolkit_components_osfile_osfile__unix__allthreads.jsm
new file mode 100644
index 00000000000..e472606f64c
--- /dev/null
+++ b/www/firefox24/patches/patch-toolkit_components_osfile_osfile__unix__allthreads.jsm
@@ -0,0 +1,13 @@
+$NetBSD: patch-toolkit_components_osfile_osfile__unix__allthreads.jsm,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+--- toolkit/components/osfile/osfile_unix_allthreads.jsm.orig 2013-09-10 03:43:54.000000000 +0000
++++ toolkit/components/osfile/osfile_unix_allthreads.jsm
+@@ -40,7 +40,7 @@ if (typeof Components != "undefined") {
+ // Open libc
+ let libc;
+ let libc_candidates = [ "libSystem.B.dylib",
+- "libc.so.6",
++ "libc.so.7",
+ "libc.so" ];
+ for (let i = 0; i < libc_candidates.length; ++i) {
+ try {
diff --git a/www/firefox24/patches/patch-toolkit_library_Makefile.in b/www/firefox24/patches/patch-toolkit_library_Makefile.in
new file mode 100644
index 00000000000..4a65ce6ecc0
--- /dev/null
+++ b/www/firefox24/patches/patch-toolkit_library_Makefile.in
@@ -0,0 +1,12 @@
+$NetBSD: patch-toolkit_library_Makefile.in,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+--- toolkit/library/Makefile.in.orig 2013-05-11 19:19:54.000000000 +0000
++++ toolkit/library/Makefile.in
+@@ -405,6 +405,7 @@ endif
+ EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME_PATH,gkmedias,$(DIST)/lib)
+
+ ifdef MOZ_WEBRTC
++EXTRA_DSO_LDOPTS += $(MOZ_LIBV4L2_LIBS)
+ ifdef MOZ_PEERCONNECTION
+ COMPONENT_LIBS += peerconnection
+ endif
diff --git a/www/firefox24/patches/patch-toolkit_mozapps_update_updater_updater.cpp b/www/firefox24/patches/patch-toolkit_mozapps_update_updater_updater.cpp
new file mode 100644
index 00000000000..9b0449fd0c5
--- /dev/null
+++ b/www/firefox24/patches/patch-toolkit_mozapps_update_updater_updater.cpp
@@ -0,0 +1,16 @@
+$NetBSD: patch-toolkit_mozapps_update_updater_updater.cpp,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+--- toolkit/mozapps/update/updater/updater.cpp.orig 2013-08-20 13:38:52.000000000 +0000
++++ toolkit/mozapps/update/updater/updater.cpp
+@@ -123,7 +123,10 @@ static bool sUseHardLinks = true;
+ // declare it here to avoid including that entire header file.
+ #define BZ2_CRC32TABLE_UNDECLARED
+
+-#if MOZ_IS_GCC
++#if defined(__clang__)
++extern "C" __attribute__((visibility("default"))) unsigned int BZ2_crc32Table[256];
++#undef BZ2_CRC32TABLE_UNDECLARED
++#elif MOZ_IS_GCC
+ #if MOZ_GCC_VERSION_AT_LEAST(3, 3, 0)
+ extern "C" __attribute__((visibility("default"))) unsigned int BZ2_crc32Table[256];
+ #undef BZ2_CRC32TABLE_UNDECLARED
diff --git a/www/firefox24/patches/patch-toolkit_toolkit.mozbuild b/www/firefox24/patches/patch-toolkit_toolkit.mozbuild
new file mode 100644
index 00000000000..9ffccda57db
--- /dev/null
+++ b/www/firefox24/patches/patch-toolkit_toolkit.mozbuild
@@ -0,0 +1,13 @@
+$NetBSD: patch-toolkit_toolkit.mozbuild,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+--- toolkit/toolkit.mozbuild.orig 2013-06-17 22:13:28.000000000 +0000
++++ toolkit/toolkit.mozbuild
+@@ -46,7 +46,7 @@ if CONFIG['MOZ_UPDATER']:
+ if not CONFIG['MOZ_NATIVE_BZ2']:
+ add_tier_dir('platform', 'modules/libbz2')
+
+- add_tier_dir('platform', 'other-licenses/bsdiff')
++# add_tier_dir('platform', 'other-licenses/bsdiff')
+
+ # Gecko/Core components.
+
diff --git a/www/firefox24/patches/patch-toolkit_xre_Makefile.in b/www/firefox24/patches/patch-toolkit_xre_Makefile.in
new file mode 100644
index 00000000000..d08e485c58b
--- /dev/null
+++ b/www/firefox24/patches/patch-toolkit_xre_Makefile.in
@@ -0,0 +1,10 @@
+$NetBSD: patch-toolkit_xre_Makefile.in,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+--- toolkit/xre/Makefile.in.orig 2013-09-10 03:43:56.000000000 +0000
++++ toolkit/xre/Makefile.in
+@@ -216,5 +216,3 @@ GARBAGE += platform.ini
+ libs:: platform.ini
+ $(INSTALL) $^ $(DIST)/bin
+
+-install::
+- $(INSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir)
diff --git a/www/firefox24/patches/patch-toolkit_xre_nsEmbedFunctions.cpp b/www/firefox24/patches/patch-toolkit_xre_nsEmbedFunctions.cpp
new file mode 100644
index 00000000000..2efaf39ea21
--- /dev/null
+++ b/www/firefox24/patches/patch-toolkit_xre_nsEmbedFunctions.cpp
@@ -0,0 +1,22 @@
+$NetBSD: patch-toolkit_xre_nsEmbedFunctions.cpp,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+--- toolkit/xre/nsEmbedFunctions.cpp.orig 2013-05-11 19:19:55.000000000 +0000
++++ toolkit/xre/nsEmbedFunctions.cpp
+@@ -239,7 +239,7 @@ XRE_SetRemoteExceptionHandler(const char
+ {
+ #if defined(XP_WIN) || defined(XP_MACOSX)
+ return CrashReporter::SetRemoteExceptionHandler(nsDependentCString(aPipe));
+-#elif defined(OS_LINUX)
++#elif defined(OS_LINUX) || defined(OS_SOLARIS)
+ return CrashReporter::SetRemoteExceptionHandler();
+ #else
+ # error "OOP crash reporter unsupported on this platform"
+@@ -351,7 +351,7 @@ XRE_InitChildProcess(int aArgc,
+ // Bug 684322 will add better visibility into this condition
+ NS_WARNING("Could not setup crash reporting\n");
+ }
+-# elif defined(OS_LINUX)
++# elif defined(OS_LINUX) || defined(OS_SOLARIS)
+ // on POSIX, |crashReporterArg| is "true" if crash reporting is
+ // enabled, false otherwise
+ if (0 != strcmp("false", crashReporterArg) &&
diff --git a/www/firefox24/patches/patch-xb b/www/firefox24/patches/patch-xb
new file mode 100644
index 00000000000..889ed8960d3
--- /dev/null
+++ b/www/firefox24/patches/patch-xb
@@ -0,0 +1,91 @@
+$NetBSD: patch-xb,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+NetBSD/sparc64 xptcall support code. From pkgsrc/www/firefox3/files/
+
+--- xpcom/reflect/xptcall/src/md/unix/xptcinvoke_sparc64_netbsd.cpp.orig 2013-01-09 15:25:54.000000000 +0000
++++ xpcom/reflect/xptcall/src/md/unix/xptcinvoke_sparc64_netbsd.cpp
+@@ -0,0 +1,84 @@
++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
++ *
++ * The contents of this file are subject to the Netscape Public
++ * License Version 1.1 (the "License"); you may not use this file
++ * except in compliance with the License. You may obtain a copy of
++ * the License at http://www.mozilla.org/NPL/
++ *
++ * Software distributed under the License is distributed on an "AS
++ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
++ * implied. See the License for the specific language governing
++ * rights and limitations under the License.
++ *
++ * The Original Code is mozilla.org code.
++ *
++ * The Initial Developer of the Original Code is Netscape
++ * Communications Corporation. Portions created by Netscape are
++ * Copyright (C) 1998 Netscape Communications Corporation. All
++ * Rights Reserved.
++ *
++ * Contributor(s):
++ */
++
++/* Platform specific code to invoke XPCOM methods on native objects */
++
++#include "xptcprivate.h"
++
++#if !defined(__sparc64__) && !defined(_LP64)
++#error "This code is for Sparc64 only"
++#endif
++
++extern "C" PRUint32
++invoke_copy_to_stack(PRUint64* d, PRUint32 paramCount, nsXPTCVariant* s)
++{
++ /*
++ We need to copy the parameters for this function to locals and use them
++ from there since the parameters occupy the same stack space as the stack
++ we're trying to populate.
++ */
++ PRUint64 *l_d = d;
++ nsXPTCVariant *l_s = s;
++ PRUint64 l_paramCount = paramCount;
++ PRUint64 regCount = 0; // return the number of registers to load from the stack
++
++ for(PRUint64 i = 0; i < l_paramCount; i++, l_d++, l_s++)
++ {
++ if (regCount < 5) regCount++;
++
++ if (l_s->IsPtrData())
++ {
++ *l_d = (PRUint64)l_s->ptr;
++ continue;
++ }
++ switch (l_s->type)
++ {
++ case nsXPTType::T_I8 : *((PRInt64*)l_d) = l_s->val.i8; break;
++ case nsXPTType::T_I16 : *((PRInt64*)l_d) = l_s->val.i16; break;
++ case nsXPTType::T_I32 : *((PRInt64*)l_d) = l_s->val.i32; break;
++ case nsXPTType::T_I64 : *((PRInt64*)l_d) = l_s->val.i64; break;
++
++ case nsXPTType::T_U8 : *((PRUint64*)l_d) = l_s->val.u8; break;
++ case nsXPTType::T_U16 : *((PRUint64*)l_d) = l_s->val.u16; break;
++ case nsXPTType::T_U32 : *((PRUint64*)l_d) = l_s->val.u32; break;
++ case nsXPTType::T_U64 : *((PRUint64*)l_d) = l_s->val.u64; break;
++
++ /* in the case of floats, we want to put the bits in to the
++ 64bit space right justified... floats in the paramter array on
++ sparcv9 use odd numbered registers.. %f1, %f3, so we have to skip
++ the space that would be occupied by %f0, %f2, etc.
++ */
++ case nsXPTType::T_FLOAT : *(((float*)l_d) + 1) = l_s->val.f; break;
++ case nsXPTType::T_DOUBLE: *((double*)l_d) = l_s->val.d; break;
++ case nsXPTType::T_BOOL : *((PRInt64*)l_d) = l_s->val.b; break;
++ case nsXPTType::T_CHAR : *((PRUint64*)l_d) = l_s->val.c; break;
++ case nsXPTType::T_WCHAR : *((PRInt64*)l_d) = l_s->val.wc; break;
++
++ default:
++ // all the others are plain pointer types
++ *((void**)l_d) = l_s->val.p;
++ break;
++ }
++ }
++
++ return regCount;
++}
diff --git a/www/firefox24/patches/patch-xc b/www/firefox24/patches/patch-xc
new file mode 100644
index 00000000000..318c868069a
--- /dev/null
+++ b/www/firefox24/patches/patch-xc
@@ -0,0 +1,73 @@
+$NetBSD: patch-xc,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+NetBSD/sparc64 xptcall support code. From pkgsrc/www/firefox3/files/
+
+--- xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_sparc64_netbsd.s.orig 2013-01-09 15:25:54.000000000 +0000
++++ xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_sparc64_netbsd.s
+@@ -0,0 +1,66 @@
++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
++ *
++ * The contents of this file are subject to the Netscape Public
++ * License Version 1.1 (the "License"); you may not use this file
++ * except in compliance with the License. You may obtain a copy of
++ * the License at http://www.mozilla.org/NPL/
++ *
++ * Software distributed under the License is distributed on an "AS
++ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
++ * implied. See the License for the specific language governing
++ * rights and limitations under the License.
++ *
++ * The Original Code is mozilla.org code.
++ *
++ * The Initial Developer of the Original Code is Netscape
++ * Communications Corporation. Portions created by Netscape are
++ * Copyright (C) 1999 Netscape Communications Corporation. All
++ * Rights Reserved.
++ *
++ * Contributor(s):
++ */
++
++ .global SharedStub
++
++/*
++ in the frame for the function that called SharedStub are the
++ rest of the parameters we need
++
++*/
++
++SharedStub:
++! we don't create a new frame yet, but work within the frame of the calling
++! function to give ourselves the other parameters we want
++
++ mov %o0, %o1 ! shuffle the index up to 2nd place
++ mov %i0, %o0 ! the original 'this'
++ add %fp, 0x7ff + 136, %o2 ! previous stack top adjusted to the first argument slot (beyond 'this')
++
++! save off the original incoming parameters that arrived in
++! registers, the ABI guarantees the space for us to do this
++ stx %i1, [%fp + 0x7ff + 136]
++ stx %i2, [%fp + 0x7ff + 144]
++ stx %i3, [%fp + 0x7ff + 152]
++ stx %i4, [%fp + 0x7ff + 160]
++ stx %i5, [%fp + 0x7ff + 168]
++! now we can build our own stack frame
++ save %sp,-(128 + 64),%sp ! room for the register window and
++ ! struct pointer, rounded up to 0 % 64
++! our function now appears to have been called
++! as SharedStub(nsISupports* that, PRUint32 index, PRUint32* args)
++! so we can just copy these through
++
++ mov %i0, %o0
++ mov %i1, %o1
++ mov %i2, %o2
++ call PrepareAndDispatch
++ nop
++ mov %o0,%i0 ! propagate return value
++ b .LL1
++ nop
++.LL1:
++ ret
++ restore
++
++ .size SharedStub, .-SharedStub
++ .type SharedStub, #function
diff --git a/www/firefox24/patches/patch-xe b/www/firefox24/patches/patch-xe
new file mode 100644
index 00000000000..295dbb7d9de
--- /dev/null
+++ b/www/firefox24/patches/patch-xe
@@ -0,0 +1,75 @@
+$NetBSD: patch-xe,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+--- xpcom/reflect/xptcall/src/md/unix/xptcinvoke_netbsd_m68k.cpp.orig 2013-01-04 23:44:47.000000000 +0000
++++ xpcom/reflect/xptcall/src/md/unix/xptcinvoke_netbsd_m68k.cpp
+@@ -100,6 +100,15 @@ extern "C" {
+ }
+ }
+
++/*
++ * SYMBOL PREFIX must be "_" for aout symbols and "" for ELF
++ */
++#ifndef __ELF__
++#define SYMBOLPREFIX "_"
++#else
++#define SYMBOLPREFIX
++#endif
++
+ XPTC_PUBLIC_API(nsresult)
+ XPTC_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
+ uint32_t paramCount, nsXPTCVariant* params)
+@@ -107,30 +116,30 @@ XPTC_InvokeByIndex(nsISupports* that, ui
+ uint32_t result;
+
+ __asm__ __volatile__(
+- "movl %4, sp@-\n\t"
+- "movl %3, sp@-\n\t"
+- "jbsr _invoke_count_words\n\t" /* count words */
+- "addql #8, sp\n\t"
+- "lsll #2, d0\n\t" /* *= 4 */
+- "movl sp, a2\n\t" /* save original sp */
+- "subl d0, sp\n\t" /* make room for params */
+- "movl sp, a0\n\t"
+- "movl %4, sp@-\n\t"
+- "movl %3, sp@-\n\t"
+- "movl a0, sp@-\n\t"
+- "jbsr _invoke_copy_to_stack\n\t" /* copy params */
+- "addl #12, sp\n\t"
+- "movl %1, a0\n\t"
+- "movl a0@, a1\n\t"
+- "movl %2, d0\n\t" /* function index */
+- "movl a0, d1\n\t"
+- "movw a1@(8,d0:l:8), a0\n\t"
+- "addl a0, d1\n\t"
+- "movl a1@(12,d0:l:8), a1\n\t"
+- "movl d1, sp@-\n\t"
+- "jbsr a1@\n\t"
+- "movl a2, sp\n\t" /* restore original sp */
+- "movl d0, %0\n\t"
++ "movl %4, %%sp@-\n\t"
++ "movl %3, %%sp@-\n\t"
++ "jbsr "SYMBOLPREFIX"invoke_count_words\n\t" /* count words */
++ "addql #8, %%sp\n\t"
++ "lsll #2, %%d0\n\t" /* *= 4 */
++ "movl %%sp, %%a2\n\t" /* save original sp */
++ "subl %%d0, %%sp\n\t" /* make room for params */
++ "movl %%sp, %%a0\n\t"
++ "movl %4, %%sp@-\n\t"
++ "movl %3, %%sp@-\n\t"
++ "movl %%a0, %%sp@-\n\t"
++ "jbsr "SYMBOLPREFIX"invoke_copy_to_stack\n\t" /* copy params */
++ "addl #12, %%sp\n\t"
++ "movl %1, %%a0\n\t"
++ "movl %%a0@, %%a1\n\t"
++ "movl %2, %%d0\n\t" /* function index */
++ "movl %%a0, %%d1\n\t"
++ "movw %%a1@(8,%%d0:l:8), %%a0\n\t"
++ "addl %%a0, %%d1\n\t"
++ "movl %%a1@(12,%%d0:l:8), %%a1\n\t"
++ "movl %%d1, %%sp@-\n\t"
++ "jbsr %%a1@\n\t"
++ "movl %%a2, %%sp\n\t" /* restore original sp */
++ "movl %%d0, %0\n\t"
+ : "=g" (result) /* %0 */
+ : "g" (that), /* %1 */
+ "g" (methodIndex), /* %2 */
diff --git a/www/firefox24/patches/patch-xf b/www/firefox24/patches/patch-xf
new file mode 100644
index 00000000000..61473fb07ca
--- /dev/null
+++ b/www/firefox24/patches/patch-xf
@@ -0,0 +1,43 @@
+$NetBSD: patch-xf,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+NetBSD/m68k xptcall support code. From pkgsrc/www/firefox/patch-ae.
+
+--- xpcom/reflect/xptcall/src/md/unix/xptcstubs_netbsd_m68k.cpp.orig 2013-01-04 23:44:47.000000000 +0000
++++ xpcom/reflect/xptcall/src/md/unix/xptcstubs_netbsd_m68k.cpp
+@@ -91,17 +91,27 @@ extern "C" {
+ }
+ }
+
++/*
++ * Beware: use % instead of %% for register identifiers in a preprocessor macro
++ * SYMBOL PREFIX must be "_" for aout and "" for ELF
++ */
++#ifndef __ELF__
++#define SYMBOLPREFIX "_"
++#else
++#define SYMBOLPREFIX
++#endif
++
+ #define STUB_ENTRY(n) \
+ __asm__( \
+- ".global _Stub"#n"__14nsXPTCStubBase\n\t" \
+-"_Stub"#n"__14nsXPTCStubBase:\n\t" \
+- "link a6,#0 \n\t" \
+- "lea a6@(12), a0 \n\t" /* pointer to args */ \
+- "movl a0, sp@- \n\t" \
+- "movl #"#n", sp@- \n\t" /* method index */ \
+- "movl a6@(8), sp@- \n\t" /* this */ \
+- "jbsr _PrepareAndDispatch \n\t" \
+- "unlk a6 \n\t" \
++ ".global "SYMBOLPREFIX"Stub"#n"__14nsXPTCStubBase\n\t" \
++SYMBOLPREFIX"Stub"#n"__14nsXPTCStubBase:\n\t" \
++ "link %a6,#0 \n\t" \
++ "lea %a6@(12), %a0 \n\t" /* pointer to args */ \
++ "movl %a0, %sp@- \n\t" \
++ "movl #"#n", %sp@- \n\t" /* method index */ \
++ "movl %a6@(8), %sp@- \n\t" /* this */ \
++ "jbsr "SYMBOLPREFIX"PrepareAndDispatch\n\t" \
++ "unlk %a6 \n\t" \
+ "rts \n\t" \
+ );
+
diff --git a/www/firefox24/patches/patch-xg b/www/firefox24/patches/patch-xg
new file mode 100644
index 00000000000..e7e8ca903a7
--- /dev/null
+++ b/www/firefox24/patches/patch-xg
@@ -0,0 +1,33 @@
+$NetBSD: patch-xg,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+NetBSD/arm xptcall support code. From pkgsrc/www/firefox/patch-bm.
+
+--- xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm_netbsd.cpp.orig 2013-01-04 23:44:47.000000000 +0000
++++ xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm_netbsd.cpp
+@@ -86,18 +86,23 @@ PrepareAndDispatch(nsXPTCStubBase* self,
+ * so they are contiguous with values passed on the stack, and then calls
+ * PrepareAndDispatch() to do the dirty work.
+ */
++#ifndef __ELF__
++#define SYMBOLPREFIX "_"
++#else
++#define SYMBOLPREFIX
++#endif
+
+ #define STUB_ENTRY(n) \
+ __asm__( \
+- ".global _Stub"#n"__14nsXPTCStubBase\n\t" \
+-"_Stub"#n"__14nsXPTCStubBase:\n\t" \
++ ".global "SYMBOLPREFIX"Stub"#n"__14nsXPTCStubBase\n\t" \
++SYMBOLPREFIX"Stub"#n"__14nsXPTCStubBase:\n\t" \
+ "stmfd sp!, {r1, r2, r3} \n\t" \
+ "mov ip, sp \n\t" \
+ "stmfd sp!, {fp, ip, lr, pc} \n\t" \
+ "sub fp, ip, #4 \n\t" \
+ "mov r1, #"#n" \n\t" /* = methodIndex */ \
+ "add r2, sp, #16 \n\t" \
+- "bl _PrepareAndDispatch__FP14nsXPTCStubBaseUiPUi \n\t" \
++ "bl "SYMBOLPREFIX"PrepareAndDispatch__FP14nsXPTCStubBaseUiPUi \n\t" \
+ "ldmea fp, {fp, sp, lr} \n\t" \
+ "add sp, sp, #12 \n\t" \
+ "mov pc, lr \n\t" \
diff --git a/www/firefox24/patches/patch-xj b/www/firefox24/patches/patch-xj
new file mode 100644
index 00000000000..abb95fd10a4
--- /dev/null
+++ b/www/firefox24/patches/patch-xj
@@ -0,0 +1,128 @@
+$NetBSD: patch-xj,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+NetBSD ppc xptcall support code. Originally from pkgsrc/www/mozilla.
+
+--- xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_netbsd.cpp.orig 2013-01-04 23:44:47.000000000 +0000
++++ xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_netbsd.cpp
+@@ -6,6 +6,7 @@
+ // Implement shared vtbl methods.
+
+ #include "xptcprivate.h"
++#include "xptiprivate.h"
+
+ // The Linux/PPC ABI (aka PPC/SYSV ABI) passes the first 8 integral
+ // parameters and the first 8 floating point parameters in registers
+@@ -36,7 +37,6 @@ PrepareAndDispatch(nsXPTCStubBase* self,
+ {
+ nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
+ nsXPTCMiniVariant* dispatchParams = NULL;
+- nsIInterfaceInfo* iface_info = NULL;
+ const nsXPTMethodInfo* info;
+ uint32_t paramCount;
+ uint32_t i;
+@@ -44,11 +44,7 @@ PrepareAndDispatch(nsXPTCStubBase* self,
+
+ NS_ASSERTION(self,"no self");
+
+- self->GetInterfaceInfo(&iface_info);
+- NS_ASSERTION(iface_info,"no interface info");
+- if (! iface_info)
+- return NS_ERROR_UNEXPECTED;
+-
++ self->mEntry->GetMethodInfo(PRUint16(methodIndex), &info);
+ iface_info->GetMethodInfo(uint16_t(methodIndex), &info);
+ NS_ASSERTION(info,"no method info");
+ if (! info)
+@@ -84,8 +80,10 @@ PrepareAndDispatch(nsXPTCStubBase* self,
+ if ((uint32_t) ap & 4) ap++; // doubles are 8-byte aligned on stack
+ dp->val.d = *(double*) ap;
+ ap += 2;
++#if __GXX_ABI_VERSION < 100
+ if (gpr < GPR_COUNT)
+ gpr += 2;
++#endif
+ }
+ continue;
+ }
+@@ -95,8 +93,10 @@ PrepareAndDispatch(nsXPTCStubBase* self,
+ else {
+ dp->val.f = *(float*) ap;
+ ap += 1;
++#if __GXX_ABI_VERSION < 100
+ if (gpr < GPR_COUNT)
+ gpr += 1;
++#endif
+ }
+ continue;
+ }
+@@ -144,9 +144,9 @@ PrepareAndDispatch(nsXPTCStubBase* self,
+ }
+ }
+
+- result = self->CallMethod((uint16_t) methodIndex, info, dispatchParams);
+-
+- NS_RELEASE(iface_info);
++ result = self->mOuter->CallMethod((PRUint16) methodIndex,
++ info,
++ dispatchParams);
+
+ if (dispatchParams != paramBuffer)
+ delete [] dispatchParams;
+@@ -160,7 +160,9 @@ PrepareAndDispatch(nsXPTCStubBase* self,
+ // however, it's quick, dirty, and'll break when the ABI changes on
+ // us, which is what we want ;-).
+
+-#define STUB_ENTRY(n) \
++#if __GXX_ABI_VERSION < 100
++// gcc-2 version
++# define STUB_ENTRY(n) \
+ __asm__ ( \
+ ".section \".text\" \n\t" \
+ ".align 2 \n\t" \
+@@ -171,6 +173,46 @@ __asm__ (
+ "li 11,"#n" \n\t" \
+ "b SharedStub@local \n" \
+ );
++#else
++// gcc-3 version
++//
++// As G++3 ABI contains the length of the functionname in the mangled
++// name, it is difficult to get a generic assembler mechanism like
++// in the G++ 2.95 case.
++// Create names would be like:
++// _ZN14nsXPTCStubBase5Stub1Ev
++// _ZN14nsXPTCStubBase6Stub12Ev
++// _ZN14nsXPTCStubBase7Stub123Ev
++// _ZN14nsXPTCStubBase8Stub1234Ev
++// etc.
++// Use assembler directives to get the names right...
++
++# define STUB_ENTRY(n) \
++__asm__ ( \
++ ".align 2 \n\t" \
++ ".if "#n" < 10 \n\t" \
++ ".globl _ZN14nsXPTCStubBase5Stub"#n"Ev \n\t" \
++ ".type _ZN14nsXPTCStubBase5Stub"#n"Ev,@function \n\n" \
++"_ZN14nsXPTCStubBase5Stub"#n"Ev: \n\t" \
++ \
++ ".elseif "#n" < 100 \n\t" \
++ ".globl _ZN14nsXPTCStubBase6Stub"#n"Ev \n\t" \
++ ".type _ZN14nsXPTCStubBase6Stub"#n"Ev,@function \n\n" \
++"_ZN14nsXPTCStubBase6Stub"#n"Ev: \n\t" \
++ \
++ ".elseif "#n" < 1000 \n\t" \
++ ".globl _ZN14nsXPTCStubBase7Stub"#n"Ev \n\t" \
++ ".type _ZN14nsXPTCStubBase7Stub"#n"Ev,@function \n\n" \
++"_ZN14nsXPTCStubBase7Stub"#n"Ev: \n\t" \
++ \
++ ".else \n\t" \
++ ".err \"stub number "#n" >= 1000 not yet supported\"\n" \
++ ".endif \n\t" \
++ \
++ "li 11,"#n" \n\t" \
++ "b SharedStub@local \n" \
++);
++#endif
+
+ #define SENTINEL_ENTRY(n) \
+ nsresult nsXPTCStubBase::Sentinel##n() \
diff --git a/www/firefox24/patches/patch-xk b/www/firefox24/patches/patch-xk
new file mode 100644
index 00000000000..1d7571c7b2d
--- /dev/null
+++ b/www/firefox24/patches/patch-xk
@@ -0,0 +1,72 @@
+$NetBSD: patch-xk,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+NetBSD ppc xptcall support code. Originally from pkgsrc/www/mozilla.
+
+--- xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_ppc_netbsd.s.orig 2013-01-04 23:44:47.000000000 +0000
++++ xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_ppc_netbsd.s
+@@ -25,23 +25,23 @@
+ .type SharedStub,@function
+
+ SharedStub:
+- stwu sp,-112(sp) # room for
+- # linkage (8),
+- # gprData (32),
+- # fprData (64),
+- # stack alignment(8)
++ stwu sp,-112(sp) // room for
++ // linkage (8),
++ // gprData (32),
++ // fprData (64),
++ // stack alignment(8)
+ mflr r0
+- stw r0,116(sp) # save LR backchain
++ stw r0,116(sp) // save LR backchain
+
+- stw r4,12(sp) # save GP registers
+- stw r5,16(sp) # (n.b. that we don't save r3
+- stw r6,20(sp) # because PrepareAndDispatch() is savvy)
++ stw r4,12(sp) // save GP registers
++ stw r5,16(sp) // (n.b. that we don't save r3
++ stw r6,20(sp) // because PrepareAndDispatch() is savvy)
+ stw r7,24(sp)
+ stw r8,28(sp)
+ stw r9,32(sp)
+ stw r10,36(sp)
+
+- stfd f1,40(sp) # save FP registers
++ stfd f1,40(sp) // save FP registers
+ stfd f2,48(sp)
+ stfd f3,56(sp)
+ stfd f4,64(sp)
+@@ -50,21 +50,21 @@ SharedStub:
+ stfd f7,88(sp)
+ stfd f8,96(sp)
+
+- # r3 has the 'self' pointer already
++ // r3 has the 'self' pointer already
+
+- mr r4,r11 # r4 <= methodIndex selector, passed
+- # via r11 in the nsXPTCStubBase::StubXX() call
++ mr r4,r11 // r4 <= methodIndex selector, passed
++ // via r11 in the nsXPTCStubBase::StubXX() call
+
+- addi r5,sp,120 # r5 <= pointer to callers args area,
+- # beyond r3-r10/f1-f8 mapped range
++ addi r5,sp,120 // r5 <= pointer to callers args area,
++ // beyond r3-r10/f1-f8 mapped range
+
+- addi r6,sp,8 # r6 <= gprData
+- addi r7,sp,40 # r7 <= fprData
++ addi r6,sp,8 // r6 <= gprData
++ addi r7,sp,40 // r7 <= fprData
+
+- bl PrepareAndDispatch@local # Go!
++ bl PrepareAndDispatch@local // Go!
+
+- lwz r0,116(sp) # restore LR
++ lwz r0,116(sp) // restore LR
+ mtlr r0
+- la sp,112(sp) # clean up the stack
++ la sp,112(sp) // clean up the stack
+ blr
+
diff --git a/www/firefox24/patches/patch-xl b/www/firefox24/patches/patch-xl
new file mode 100644
index 00000000000..7118ae6959f
--- /dev/null
+++ b/www/firefox24/patches/patch-xl
@@ -0,0 +1,74 @@
+$NetBSD: patch-xl,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+NetBSD ppc xptcall support code. Originally from pkgsrc/www/mozilla.
+
+--- xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc_netbsd.s.orig 2013-01-04 23:44:47.000000000 +0000
++++ xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc_netbsd.s
+@@ -20,41 +20,42 @@
+
+ .section ".text"
+ .align 2
+- .globl XPTC_InvokeByIndex
+- .type XPTC_InvokeByIndex,@function
++ .globl NS_InvokeByIndex_P
++ .type NS_InvokeByIndex_P,@function
++
++//
++// NS_InvokeByIndex_P(nsISupports* that, PRUint32 methodIndex,
++// PRUint32 paramCount, nsXPTCVariant* params)
++//
++
++NS_InvokeByIndex_P:
++ stwu sp,-32(sp) // setup standard stack frame
++ mflr r0 // save LR
++ stw r3,8(sp) // r3 <= that
++ stw r4,12(sp) // r4 <= methodIndex
+
+-#
+-# XPTC_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
+-# uint32_t paramCount, nsXPTCVariant* params)
+-#
+-
+-XPTC_InvokeByIndex:
+- stwu sp,-32(sp) # setup standard stack frame
+- mflr r0 # save LR
+- stw r3,8(sp) # r3 <= that
+- stw r4,12(sp) # r4 <= methodIndex
+ stw r30,16(sp)
+ stw r31,20(sp)
+
+- stw r0,36(sp) # store LR backchain
++ stw r0,36(sp) // store LR backchain
+ mr r31,sp
+
+- rlwinm r10,r5,3,0,27 # r10 = (ParamCount * 2 * 4) & ~0x0f
+- addi r0,r10,96 # reserve stack for GPR and FPR register save area r0 = r10 + 96
+- lwz r9,0(sp) # r9 = backchain
++ rlwinm r10,r5,3,0,27 // r10 = (ParamCount * 2 * 4) & ~0x0f
++ addi r0,r10,96 // reserve stack for GPR and FPR register save area r0 = r10 + 96
++ lwz r9,0(sp) // r9 = backchain
+ neg r0,r0
+- stwux r9,sp,r0 # reserve stack sapce and save SP backchain
++ stwux r9,sp,r0 // reserve stack sapce and save SP backchain
+
+- addi r3,sp,8 # r3 <= args
+- mr r4,r5 # r4 <= paramCount
+- mr r5,r6 # r5 <= params
+- add r6,r3,r10 # r6 <= gpregs ( == args + r10 )
+- mr r30,r6 # store in r30 for use later...
+- addi r7,r6,32 # r7 <= fpregs ( == gpregs + 32 )
++ addi r3,sp,8 // r3 <= args
++ mr r4,r5 // r4 <= paramCount
++ mr r5,r6 // r5 <= params
++ add r6,r3,r10 // r6 <= gpregs ( == args + r10 )
++ mr r30,r6 // store in r30 for use later...
++ addi r7,r6,32 // r7 <= fpregs ( == gpregs + 32 )
+
+- bl invoke_copy_to_stack@local # (args, paramCount, params, gpregs, fpregs)
++ bl invoke_copy_to_stack@local // (args, paramCount, params, gpregs, fpregs)
+
+- lfd f1,32(r30) # load FP registers with method parameters
++ lfd f1,32(r30) // load FP registers with method parameters
+ lfd f2,40(r30)
+ lfd f3,48(r30)
+ lfd f4,56(r30)
diff --git a/www/firefox24/patches/patch-xm b/www/firefox24/patches/patch-xm
new file mode 100644
index 00000000000..7e7cb404577
--- /dev/null
+++ b/www/firefox24/patches/patch-xm
@@ -0,0 +1,49 @@
+$NetBSD: patch-xm,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+NetBSD/ppc xptcall support code. Originally from pkgsrc/www/mozilla.
+
+--- xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_netbsd.cpp.orig 2013-01-04 23:44:47.000000000 +0000
++++ xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_netbsd.cpp
+@@ -5,9 +5,9 @@
+
+ // Platform specific code to invoke XPCOM methods on native objects
+
+-// The purpose of XPTC_InvokeByIndex() is to map a platform
++// The purpose of NS_InvokeByIndex_P() is to map a platform
+ // indepenpent call to the platform ABI. To do that,
+-// XPTC_InvokeByIndex() has to determine the method to call via vtable
++// NS_InvokeByIndex_P() has to determine the method to call via vtable
+ // access. The parameters for the method are read from the
+ // nsXPTCVariant* and prepared for the native ABI. For the Linux/PPC
+ // ABI this means that the first 8 integral and floating point
+@@ -69,8 +69,10 @@ invoke_copy_to_stack(uint32_t* d,
+ if ((uint32_t) d & 4) d++; // doubles are 8-byte aligned on stack
+ *((double*) d) = s->val.d;
+ d += 2;
++#if __GXX_ABI_VERSION < 100
+ if (gpr < GPR_COUNT)
+ gpr += 2;
++#endif
+ }
+ }
+ else if (!s->IsPtrData() && s->type == nsXPTType::T_FLOAT) {
+@@ -79,8 +81,10 @@ invoke_copy_to_stack(uint32_t* d,
+ else {
+ *((float*) d) = s->val.f;
+ d += 1;
++#if __GXX_ABI_VERSION < 100
+ if (gpr < GPR_COUNT)
+ gpr += 1;
++#endif
+ }
+ }
+ else if (!s->IsPtrData() && (s->type == nsXPTType::T_I64
+@@ -107,6 +111,6 @@ invoke_copy_to_stack(uint32_t* d,
+ }
+
+ extern "C"
+-XPTC_PUBLIC_API(nsresult)
+-XPTC_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
++EXPORT_XPCOM_API(nsresult)
++NS_InvokeByIndex_P(nsISupports* that, PRUint32 methodIndex,
+ uint32_t paramCount, nsXPTCVariant* params);
diff --git a/www/firefox24/patches/patch-xn b/www/firefox24/patches/patch-xn
new file mode 100644
index 00000000000..7a7cd9814dd
--- /dev/null
+++ b/www/firefox24/patches/patch-xn
@@ -0,0 +1,52 @@
+$NetBSD: patch-xn,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+--- xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips.s.orig 2013-01-04 23:44:47.000000000 +0000
++++ xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips.s
+@@ -16,6 +16,47 @@
+ #include <sys/asm.h>
+ #endif
+
++#ifdef __NetBSD__
++# include <machine/regdef.h>
++# include <machine/asm.h>
++# ifndef fp
++# define fp s8
++# endif
++# ifndef PTRLOG
++# if SZREG == 4
++# define PTRLOG 2
++# else
++# define PTRLOG 3
++# endif
++# endif
++# ifndef SETUP_GP
++# if defined(__mips_o32)
++# define SETUP_GP \
++ .set push; \
++ .set noreorder; \
++ .cpload t9; \
++ .set pop
++# define SAVE_GP(x) \
++ .cprestore x
++# else
++# define SETUP_GP
++# define SAVE_GP(x)
++# endif
++# endif
++# ifndef ALSZ
++# if defined(__mips_n32) || defined(__mips_n64)
++# define ALSZ 15
++# define ALMASK ~15
++# else
++# define ALSZ 7
++# define ALMASK ~7
++# endif
++# endif
++#else
++# include <sys/regdef.h>
++# include <sys/asm.h>
++#endif
++
+ # NARGSAVE is the argument space in the callers frame, including extra
+ # 'shadowed' space for the argument registers. The minimum of 4
+ # argument slots is sometimes predefined in the header files.
diff --git a/www/firefox24/patches/patch-xo b/www/firefox24/patches/patch-xo
new file mode 100644
index 00000000000..1b46664bdf0
--- /dev/null
+++ b/www/firefox24/patches/patch-xo
@@ -0,0 +1,52 @@
+$NetBSD: patch-xo,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+--- xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips.s.orig 2013-01-04 23:44:47.000000000 +0000
++++ xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips.s
+@@ -14,6 +14,47 @@
+ #include <sys/asm.h>
+ #endif
+
++#ifdef __NetBSD__
++# include <machine/regdef.h>
++# include <machine/asm.h>
++# ifndef fp
++# define fp s8
++# endif
++# ifndef PTRLOG
++# if SZREG == 4
++# define PTRLOG 2
++# else
++# define PTRLOG 3
++# endif
++# endif
++# ifndef SETUP_GP
++# if defined(__mips_o32)
++# define SETUP_GP \
++ .set push; \
++ .set noreorder; \
++ .cpload t9; \
++ .set pop
++# define SAVE_GP(x) \
++ .cprestore x
++# else
++# define SETUP_GP
++# define SAVE_GP(x)
++# endif
++# endif
++# ifndef ALSZ
++# if defined(__mips_n32) || defined(__mips_n64)
++# define ALSZ 15
++# define ALMASK ~15
++# else
++# define ALSZ 7
++# define ALMASK ~7
++# endif
++# endif
++#else
++# include <sys/regdef.h>
++# include <sys/asm.h>
++#endif
++
+ # NARGSAVE is the argument space in the callers frame, including extra
+ # 'shadowed' space for the argument registers. The minimum of 4
+ # argument slots is sometimes predefined in the header files.
diff --git a/www/firefox24/patches/patch-xpcom_base_nsStackWalk.cpp b/www/firefox24/patches/patch-xpcom_base_nsStackWalk.cpp
new file mode 100644
index 00000000000..20bce2f06b4
--- /dev/null
+++ b/www/firefox24/patches/patch-xpcom_base_nsStackWalk.cpp
@@ -0,0 +1,13 @@
+$NetBSD: patch-xpcom_base_nsStackWalk.cpp,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+--- xpcom/base/nsStackWalk.cpp.orig 2013-05-11 19:19:56.000000000 +0000
++++ xpcom/base/nsStackWalk.cpp
+@@ -853,7 +853,7 @@ void DemangleSymbol(const char * aSymbol
+ }
+
+
+-#if NSSTACKWALK_SUPPORTS_SOLARIS
++#if notNSSTACKWALK_SUPPORTS_SOLARIS
+
+ /*
+ * Stack walking code for Solaris courtesy of Bart Smaalder's "memtrak".
diff --git a/www/firefox24/patches/patch-xpcom_ds_TimeStamp.h b/www/firefox24/patches/patch-xpcom_ds_TimeStamp.h
new file mode 100644
index 00000000000..3fd174f23ff
--- /dev/null
+++ b/www/firefox24/patches/patch-xpcom_ds_TimeStamp.h
@@ -0,0 +1,20 @@
+$NetBSD: patch-xpcom_ds_TimeStamp.h,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+http://gnats.netbsd.org/47233
+
+--- xpcom/ds/TimeStamp.h.orig 2013-01-04 23:44:47.000000000 +0000
++++ xpcom/ds/TimeStamp.h
+@@ -130,11 +130,11 @@ private:
+ // NOTE: this MUST be a >= test, because int64_t(double(INT64_MAX))
+ // overflows and gives INT64_MIN.
+ if (aTicks >= double(INT64_MAX))
+- return TimeDuration::FromTicks(INT64_MAX);
++ return TimeDuration::FromTicks(int64_t(INT64_MAX));
+
+ // This MUST be a <= test.
+ if (aTicks <= double(INT64_MIN))
+- return TimeDuration::FromTicks(INT64_MIN);
++ return TimeDuration::FromTicks(int64_t(INT64_MIN));
+
+ return TimeDuration::FromTicks(int64_t(aTicks));
+ }
diff --git a/www/firefox24/patches/patch-xpcom_ds_moz.build b/www/firefox24/patches/patch-xpcom_ds_moz.build
new file mode 100644
index 00000000000..a4b6aa93e59
--- /dev/null
+++ b/www/firefox24/patches/patch-xpcom_ds_moz.build
@@ -0,0 +1,24 @@
+$NetBSD: patch-xpcom_ds_moz.build,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+* Honor sFirstTimeStamp and sProcessCreation, fix segfault.
+
+--- xpcom/ds/moz.build.orig 2013-09-10 03:43:57.000000000 +0000
++++ xpcom/ds/moz.build
+@@ -95,7 +95,6 @@ CPP_SOURCES += [
+ 'nsSupportsPrimitives.cpp',
+ 'nsUnicharBuffer.cpp',
+ 'nsVariant.cpp',
+- 'TimeStamp.cpp',
+ ]
+
+ if CONFIG['HAVE_CLOCK_MONOTONIC']:
+@@ -113,5 +112,9 @@ elif CONFIG['OS_ARCH'] == 'WINNT':
+ else:
+ error('No TimeStamp implementation on this platform. Build will not succeed')
+
++CPP_SOURCES += [
++ 'TimeStamp.cpp',
++]
++
+ LIBRARY_NAME = 'xpcomds_s'
+
diff --git a/www/firefox24/patches/patch-xpcom_reflect_xptcall_src_md_unix_moz.build b/www/firefox24/patches/patch-xpcom_reflect_xptcall_src_md_unix_moz.build
new file mode 100644
index 00000000000..e3420f5b628
--- /dev/null
+++ b/www/firefox24/patches/patch-xpcom_reflect_xptcall_src_md_unix_moz.build
@@ -0,0 +1,23 @@
+$NetBSD: patch-xpcom_reflect_xptcall_src_md_unix_moz.build,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+* Support NetBSD/amd64 and DragonFly/amd64.
+
+--- xpcom/reflect/xptcall/src/md/unix/moz.build.orig 2013-09-11 03:22:57.000000000 +0000
++++ xpcom/reflect/xptcall/src/md/unix/moz.build
+@@ -19,14 +19,14 @@ if CONFIG['OS_ARCH'] == 'Darwin':
+ 'xptcstubs_gcc_x86_unix.cpp',
+ ]
+
+-if CONFIG['OS_ARCH'] in ('NetBSD', 'OpenBSD', 'GNU'):
++if CONFIG['OS_ARCH'] in ('OpenBSD', 'GNU'):
+ if CONFIG['CPU_ARCH'] == 'x86':
+ CPP_SOURCES += [
+ 'xptcinvoke_gcc_x86_unix.cpp',
+ 'xptcstubs_gcc_x86_unix.cpp'
+ ]
+
+-if CONFIG['OS_ARCH'] in ('Linux', 'FreeBSD') or \
++if CONFIG['OS_ARCH'] in ('Linux', 'FreeBSD', 'NetBSD', 'DragonFly') or \
+ CONFIG['OS_ARCH'].startswith('GNU_'):
+ if CONFIG['OS_TEST'] == 'x86_64':
+ CPP_SOURCES += [
diff --git a/www/firefox24/patches/patch-xpcom_reflect_xptcall_src_md_unix_xptcinvoke__gcc__x86__unix.cpp b/www/firefox24/patches/patch-xpcom_reflect_xptcall_src_md_unix_xptcinvoke__gcc__x86__unix.cpp
new file mode 100644
index 00000000000..247b831ed04
--- /dev/null
+++ b/www/firefox24/patches/patch-xpcom_reflect_xptcall_src_md_unix_xptcinvoke__gcc__x86__unix.cpp
@@ -0,0 +1,13 @@
+$NetBSD: patch-xpcom_reflect_xptcall_src_md_unix_xptcinvoke__gcc__x86__unix.cpp,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+--- xpcom/reflect/xptcall/src/md/unix/xptcinvoke_gcc_x86_unix.cpp.orig 2013-05-11 19:19:56.000000000 +0000
++++ xpcom/reflect/xptcall/src/md/unix/xptcinvoke_gcc_x86_unix.cpp
+@@ -9,7 +9,7 @@
+ #include "xptc_gcc_x86_unix.h"
+
+ extern "C" {
+-static void ATTRIBUTE_USED __attribute__ ((regparm(3)))
++void ATTRIBUTE_USED __attribute__ ((regparm(3)))
+ invoke_copy_to_stack(uint32_t paramCount, nsXPTCVariant* s, uint32_t* d)
+ {
+ for(uint32_t i = paramCount; i >0; i--, d++, s++)
diff --git a/www/firefox24/patches/patch-xpcom_reflect_xptcall_src_md_unix_xptcstubs__gcc__x86__unix.cpp b/www/firefox24/patches/patch-xpcom_reflect_xptcall_src_md_unix_xptcstubs__gcc__x86__unix.cpp
new file mode 100644
index 00000000000..2899eeada20
--- /dev/null
+++ b/www/firefox24/patches/patch-xpcom_reflect_xptcall_src_md_unix_xptcstubs__gcc__x86__unix.cpp
@@ -0,0 +1,13 @@
+$NetBSD: patch-xpcom_reflect_xptcall_src_md_unix_xptcstubs__gcc__x86__unix.cpp,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+--- xpcom/reflect/xptcall/src/md/unix/xptcstubs_gcc_x86_unix.cpp.orig 2013-05-11 19:19:56.000000000 +0000
++++ xpcom/reflect/xptcall/src/md/unix/xptcstubs_gcc_x86_unix.cpp
+@@ -10,7 +10,7 @@
+ #include "xptc_gcc_x86_unix.h"
+
+ extern "C" {
+-static nsresult ATTRIBUTE_USED
++nsresult ATTRIBUTE_USED
+ __attribute__ ((regparm (3)))
+ PrepareAndDispatch(uint32_t methodIndex, nsXPTCStubBase* self, uint32_t* args)
+ {
diff --git a/www/firefox24/patches/patch-xpcom_string_public_nsAlgorithm.h b/www/firefox24/patches/patch-xpcom_string_public_nsAlgorithm.h
new file mode 100644
index 00000000000..d80841de07a
--- /dev/null
+++ b/www/firefox24/patches/patch-xpcom_string_public_nsAlgorithm.h
@@ -0,0 +1,16 @@
+$NetBSD: patch-xpcom_string_public_nsAlgorithm.h,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+--- xpcom/string/public/nsAlgorithm.h.orig 2013-05-11 19:19:56.000000000 +0000
++++ xpcom/string/public/nsAlgorithm.h
+@@ -45,7 +45,10 @@ XPCOM_MAX( const T& a, const T& b )
+ return a > b ? a : b;
+ }
+
+-#if defined(_MSC_VER) && (_MSC_VER < 1600)
++#if (defined(_MSC_VER) && (_MSC_VER < 1600)) || \
++ ((defined(__GLIBCXX__) && __GLIBCXX__ < 20121005) && \
++ (defined(_GLIBCXX_USE_LONG_LONG) && \
++ (!_GLIBCXX_USE_C99 || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC)))
+ namespace std {
+ inline
+ long long
diff --git a/www/firefox24/patches/patch-xulrunner_installer_Makefile.in b/www/firefox24/patches/patch-xulrunner_installer_Makefile.in
new file mode 100644
index 00000000000..c79220bfb2f
--- /dev/null
+++ b/www/firefox24/patches/patch-xulrunner_installer_Makefile.in
@@ -0,0 +1,15 @@
+$NetBSD: patch-xulrunner_installer_Makefile.in,v 1.1 2013/11/03 04:52:00 ryoon Exp $
+
+* Install pkg-config pc files to package specific directory.
+
+--- xulrunner/installer/Makefile.in.orig 2013-07-30 00:59:18.000000000 +0000
++++ xulrunner/installer/Makefile.in
+@@ -96,7 +96,7 @@ endif
+
+ install:: $(pkg_config_files)
+ @echo pkg_config_file: $(pkg_config_files)
+- $(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(libdir)/pkgconfig
++ $(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)${PREFIX}/lib/${MOZILLA_PKG_NAME}/pkgconfig
+
+ GARBAGE += $(pkg_config_files)
+