aboutsummaryrefslogtreecommitdiff
path: root/www/firefox-esr
diff options
context:
space:
mode:
authorFlorian Smeets <flo@FreeBSD.org>2013-10-30 20:37:55 +0000
committerFlorian Smeets <flo@FreeBSD.org>2013-10-30 20:37:55 +0000
commit2cd503bcdb5f9bb9fadb663412a68fb84e801524 (patch)
treea87ddf1d023ec31d88d818886f89a42f8183ebd2 /www/firefox-esr
parent8603282df1f4ec28fd2ffa11843c31f4a4dcea3a (diff)
downloadports-2cd503bcdb5f9bb9fadb663412a68fb84e801524.tar.gz
ports-2cd503bcdb5f9bb9fadb663412a68fb84e801524.zip
- update firefox to 25.0
- update firefox-esr to 24.1.0 - update thunderbird to 24.1.0 - update seamonkey to 22.0 - update libxul to 24.1.0 - don't remove/add share/applications directory - remove checks for older gecko releases from bsd.gecko.mk - drop support for FreeBSD 9.0 Not staged yet. I started working on it, but didn't finish it in time for this release. I'll try to make the next one in 6 weeks. In collaboration with: Jan Beich
Notes
Notes: svn path=/head/; revision=332168
Diffstat (limited to 'www/firefox-esr')
-rw-r--r--www/firefox-esr/Makefile21
-rw-r--r--www/firefox-esr/distinfo4
-rw-r--r--www/firefox-esr/files/extra-bug78053129
-rw-r--r--www/firefox-esr/files/patch-alsapulse114
-rw-r--r--www/firefox-esr/files/patch-browser-app-nsBrowserApp.cpp8
-rw-r--r--www/firefox-esr/files/patch-bug68525817
-rw-r--r--www/firefox-esr/files/patch-bug713802163
-rw-r--r--www/firefox-esr/files/patch-bug72297561
-rw-r--r--www/firefox-esr/files/patch-bug73234013
-rw-r--r--www/firefox-esr/files/patch-bug7530461207
-rw-r--r--www/firefox-esr/files/patch-bug77807811
-rw-r--r--www/firefox-esr/files/patch-bug78346328
-rw-r--r--www/firefox-esr/files/patch-bug78463152
-rw-r--r--www/firefox-esr/files/patch-bug78699536
-rw-r--r--www/firefox-esr/files/patch-bug78790412
-rw-r--r--www/firefox-esr/files/patch-bug78803948
-rw-r--r--www/firefox-esr/files/patch-bug78810820
-rw-r--r--www/firefox-esr/files/patch-bug788955299
-rw-r--r--www/firefox-esr/files/patch-bug78943627
-rw-r--r--www/firefox-esr/files/patch-bug78965611
-rw-r--r--www/firefox-esr/files/patch-bug789693109
-rw-r--r--www/firefox-esr/files/patch-bug791305384
-rw-r--r--www/firefox-esr/files/patch-bug79136695
-rw-r--r--www/firefox-esr/files/patch-bug799441116
-rw-r--r--www/firefox-esr/files/patch-bug803480102
-rw-r--r--www/firefox-esr/files/patch-bug80613929
-rw-r--r--www/firefox-esr/files/patch-bug807492628
-rw-r--r--www/firefox-esr/files/patch-bug826985164
-rw-r--r--www/firefox-esr/files/patch-bug82800336
-rw-r--r--www/firefox-esr/files/patch-bug851992339
-rw-r--r--www/firefox-esr/files/patch-bug87615613
-rw-r--r--www/firefox-esr/files/patch-bug87879111
-rw-r--r--www/firefox-esr/files/patch-bug88618111
-rw-r--r--www/firefox-esr/files/patch-bug889699175
-rw-r--r--www/firefox-esr/files/patch-bug893397206
-rw-r--r--www/firefox-esr/files/patch-bug910875102
-rw-r--r--www/firefox-esr/files/patch-bug91621639
-rw-r--r--www/firefox-esr/files/patch-bug91658940
-rw-r--r--www/firefox-esr/files/patch-bug91817736
-rw-r--r--www/firefox-esr/files/patch-build-pgo-profileserver.py23
-rw-r--r--www/firefox-esr/files/patch-clang3325
-rw-r--r--www/firefox-esr/files/patch-duckduckgo47
-rw-r--r--www/firefox-esr/files/patch-ipc-chromium-Makefile.in15
-rw-r--r--www/firefox-esr/files/patch-ipc-chromium-src-base-message_pump_libevent.cc4
-rw-r--r--www/firefox-esr/files/patch-js-src-methodjit-MethodJIT.cpp20
-rw-r--r--www/firefox-esr/files/patch-media-libsydneyaudio-src-sydney_audio_oss.c13
-rw-r--r--www/firefox-esr/files/patch-media-webrtc-trunk-src-system_wrappers-source-spreadsortlib-spreadsort.hpp16
-rw-r--r--www/firefox-esr/files/patch-no-videoio.h22
-rw-r--r--www/firefox-esr/files/patch-z-bug76244570
49 files changed, 2351 insertions, 2720 deletions
diff --git a/www/firefox-esr/Makefile b/www/firefox-esr/Makefile
index 81ed1e1de26a..1ba88156148c 100644
--- a/www/firefox-esr/Makefile
+++ b/www/firefox-esr/Makefile
@@ -2,7 +2,7 @@
# $FreeBSD$
PORTNAME= firefox
-DISTVERSION= 17.0.9
+DISTVERSION= 24.1.0
PORTEPOCH= 1
CATEGORIES= www ipv6
MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}esr/source
@@ -12,15 +12,18 @@ DISTNAME= ${PORTNAME}-${DISTVERSION}esr.source
MAINTAINER= gecko@FreeBSD.org
COMMENT= Web browser based on the browser portion of Mozilla
-BUILD_DEPENDS= nspr>=4.9.2:${PORTSDIR}/devel/nspr \
- nss>=3.13.6_1:${PORTSDIR}/security/nss \
- sqlite3>=3.7.13:${PORTSDIR}/databases/sqlite3 \
+BUILD_DEPENDS= nspr>=4.10:${PORTSDIR}/devel/nspr \
+ nss>=3.15:${PORTSDIR}/security/nss \
+ sqlite3>=3.7.17:${PORTSDIR}/databases/sqlite3 \
${PYTHON_PKGNAMEPREFIX}sqlite3>0:${PORTSDIR}/databases/py-sqlite3 \
cairo>=1.10.2_1,1:${PORTSDIR}/graphics/cairo \
+ v4l_compat>0:${PORTSDIR}/multimedia/v4l_compat \
unzip:${PORTSDIR}/archivers/unzip
+LIB_DEPENDS= libv4l2.so:${PORTSDIR}/multimedia/libv4l
USE_AUTOTOOLS= autoconf213:env
USE_PYTHON_BUILD=-2.7
+OBJDIR_BUILD= # in-tree build broken after bug 789837
USE_GECKO= gecko
CONFLICTS= firefox-2[0-35-9].* firefox-1[1-689].*
MOZ_PKGCONFIG_FILES= # empty
@@ -34,19 +37,19 @@ ALL_TARGET= default
GNU_CONFIGURE= yes
USE_BZIP2= yes
USE_GL= gl
+USE_DOS2UNIX= media/webrtc/trunk/webrtc/system_wrappers/source/spreadsortlib/spreadsort.hpp
NO_MOZPKGINSTALL=yes
FIREFOX_ICON= ${MOZILLA}.png
-FIREFOX_ICON_SRC= ${PREFIX}/lib/${MOZILLA}/chrome/icons/default/default48.png
+FIREFOX_ICON_SRC= ${PREFIX}/lib/${MOZILLA}/browser/chrome/icons/default/default48.png
MOZ_OPTIONS= --program-transform-name='s/firefox/${MOZILLA}/' \
--enable-application=browser \
--enable-official-branding
-NO_STAGE= yes
.include "${.CURDIR}/../../www/firefox/Makefile.options"
.include <bsd.port.pre.mk>
-WRKSRC:= ${WRKDIR}/mozilla-esr17
+WRKSRC:= ${WRKDIR}/mozilla-esr24
post-extract:
@${SED} -e 's|@FIREFOX_ICON@|${FIREFOX_ICON}|' -e 's|@MOZILLA@|${MOZILLA}|' \
@@ -54,6 +57,8 @@ post-extract:
<${FILESDIR}/firefox.desktop.in >${WRKDIR}/${MOZILLA}.desktop
post-patch:
+ @${REINPLACE_CMD} -e '/MOZPNG/s/=[0-9]*/=10511/' \
+ ${WRKSRC}/configure.in
@${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
${WRKSRC}/browser/app/nsBrowserApp.cpp
@@ -66,8 +71,8 @@ port-pre-install:
${ECHO_CMD} 'share/pixmaps/${FIREFOX_ICON}' >> ${PLISTF}
post-install:
+ ${MKDIR} ${PREFIX}/share/pixmaps
${INSTALL_DATA} ${WRKDIR}/${MOZILLA}.desktop ${PREFIX}/share/applications/
- ${MKDIR} ${PREFIX}/lib/${MOZILLA}/chrome/icons/default
${LN} -sf ${FIREFOX_ICON_SRC} ${PREFIX}/share/pixmaps/${FIREFOX_ICON}
@${CAT} ${PKGMESSAGE}
diff --git a/www/firefox-esr/distinfo b/www/firefox-esr/distinfo
index 1c2251d9acb3..fb50062e02de 100644
--- a/www/firefox-esr/distinfo
+++ b/www/firefox-esr/distinfo
@@ -1,2 +1,2 @@
-SHA256 (firefox-17.0.9esr.source.tar.bz2) = 5b2d5498de40a0acd2a1aed8b671ad4b53a991e679ca98027c2a4c89c72f8cae
-SIZE (firefox-17.0.9esr.source.tar.bz2) = 90859763
+SHA256 (firefox-24.1.0esr.source.tar.bz2) = 92dcc2bacaf00cb36004236440635613a27d1528e927d205b424a92c8f58b35e
+SIZE (firefox-24.1.0esr.source.tar.bz2) = 119816789
diff --git a/www/firefox-esr/files/extra-bug780531 b/www/firefox-esr/files/extra-bug780531
index aa3547c397a4..26859a9bde10 100644
--- a/www/firefox-esr/files/extra-bug780531
+++ b/www/firefox-esr/files/extra-bug780531
@@ -1,13 +1,24 @@
--- configure.in~
+++ configure.in
-@@ -5151,8 +5148,8 @@ fi
+@@ -5364,15 +5364,18 @@ AC_SUBST(MOZ_SRTP)
- AC_SUBST(MOZ_WEBRTC)
-
--case "$target_cpu" in
--arm*)
+ 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
-+arm-*-linux*|*-dragonfly*|*-freebsd*|*-netbsd*|*-openbsd*)
- MOZ_SAMPLE_TYPE_S16LE=1
- AC_DEFINE(MOZ_SAMPLE_TYPE_S16LE)
- AC_SUBST(MOZ_SAMPLE_TYPE_S16LE)
++*-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
diff --git a/www/firefox-esr/files/patch-alsapulse b/www/firefox-esr/files/patch-alsapulse
deleted file mode 100644
index f0c38d347bea..000000000000
--- a/www/firefox-esr/files/patch-alsapulse
+++ /dev/null
@@ -1,114 +0,0 @@
-diff --git configure.in configure.in
-index 5980b76..11f5f77 100644
---- configure.in
-+++ configure.in
-@@ -5600,13 +5600,25 @@ dnl ========================================================
- dnl = Check alsa availability on Linux if using sydneyaudio
- dnl ========================================================
-
-+MOZ_ARG_ENABLE_BOOL(alsa,
-+[ --enable-alsa Enable Alsa support (default on Linux)],
-+MOZ_ALSA=1,
-+MOZ_ALSA= MOZ_ALSA_FORCE=$enableval)
-+
- dnl If using sydneyaudio with Linux, ensure that the alsa library is available
--if test -n "$MOZ_SYDNEYAUDIO" -a "$OS_TARGET" = "Linux"; then
-+if test -n "$MOZ_SYDNEYAUDIO" -a "$OS_TARGET" = "Linux" -a "$MOZ_ALSA_FORCE" != "no"; then
-+ MOZ_ALSA=1
-+fi
-+
-+if test -n "$MOZ_ALSA"; then
-+ AC_DEFINE(MOZ_CUBEB)
- PKG_CHECK_MODULES(MOZ_ALSA, alsa, ,
- [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
-
-+AC_SUBST(MOZ_ALSA)
-+
- dnl ========================================================
- dnl = Enable PulseAudio
- dnl ========================================================
-diff --git media/libcubeb/src/Makefile.in media/libcubeb/src/Makefile.in
-index 5ab4dd8..c8df26f 100644
---- media/libcubeb/src/Makefile.in
-+++ media/libcubeb/src/Makefile.in
-@@ -24,10 +24,6 @@ endif
-
- ifeq ($(OS_TARGET),Android)
- # No Android implementation of libcubeb yet.
--else ifeq ($(OS_TARGET),Linux)
--CSRCS = \
-- cubeb_alsa.c \
-- $(NULL)
- endif
-
- ifeq ($(OS_TARGET),Darwin)
-@@ -42,6 +38,12 @@ CSRCS = \
- $(NULL)
- endif
-
-+ifdef MOZ_ALSA
-+CSRCS = \
-+ cubeb_alsa.c \
-+ $(NULL)
-+endif
-+
- ifdef MOZ_PULSEAUDIO
- CSRCS = \
- cubeb_pulse.c \
-diff --git media/libsydneyaudio/src/Makefile.in media/libsydneyaudio/src/Makefile.in
-index 8dda8ce..b19641d 100644
---- media/libsydneyaudio/src/Makefile.in
-+++ media/libsydneyaudio/src/Makefile.in
-@@ -30,10 +30,6 @@ else ifeq ($(MOZ_WIDGET_TOOLKIT),android)
- CSRCS = \
- sydney_audio_android.c \
- $(NULL)
--else ifeq ($(OS_ARCH),Linux)
--CSRCS = \
-- sydney_audio_alsa.c \
-- $(NULL)
- endif
-
- ifeq ($(OS_ARCH),WINNT)
-@@ -68,6 +64,18 @@ CSRCS = \
- $(NULL)
- endif
-
-+ifdef MOZ_ALSA
-+CSRCS = \
-+ sydney_audio_alsa.c \
-+ $(NULL)
-+endif
-+
-+ifdef MOZ_PULSEAUDIO
-+CSRCS = \
-+ sydney_audio_pulseaudio.c \
-+ $(NULL)
-+endif
-+
- ifeq ($(OS_ARCH),WINNT)
- OS_LIBS += winmm.lib
- endif
-diff --git toolkit/library/Makefile.in toolkit/library/Makefile.in
-index 43384e9..e46a6e3 100644
---- toolkit/library/Makefile.in
-+++ toolkit/library/Makefile.in
-@@ -370,14 +370,11 @@ endif
-
- EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME_PATH,gkmedias,$(DIST)/lib)
-
--ifdef MOZ_SYDNEYAUDIO
--ifeq ($(OS_ARCH),Linux)
-+ifneq (,$(MOZ_CUBEB)$(MOZ_SYDNEYAUDIO))
-+ifdef MOZ_ALSA
- EXTRA_DSO_LDOPTS += $(MOZ_ALSA_LIBS)
- endif
--endif
--
- ifdef MOZ_PULSEAUDIO
--ifdef MOZ_CUBEB
- EXTRA_DSO_LDOPTS += $(MOZ_PULSEAUDIO_LIBS)
- endif
- endif
diff --git a/www/firefox-esr/files/patch-browser-app-nsBrowserApp.cpp b/www/firefox-esr/files/patch-browser-app-nsBrowserApp.cpp
index 2d5190639b79..b8ff70542e0d 100644
--- a/www/firefox-esr/files/patch-browser-app-nsBrowserApp.cpp
+++ b/www/firefox-esr/files/patch-browser-app-nsBrowserApp.cpp
@@ -1,10 +1,10 @@
--- browser/app/nsBrowserApp.cpp~
+++ browser/app/nsBrowserApp.cpp
-@@ -197,6 +197,7 @@ int main(int argc, char* argv[])
+@@ -334,6 +334,7 @@ int main(int argc, char* argv[])
TriggerQuirks();
#endif
+ setenv("MOZ_PLUGIN_PATH", "%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko19:%%LOCALBASE%%/lib/npapi/symlinks/firefox", 0);
- nsresult rv = mozilla::BinaryPath::Get(argv[0], exePath);
- if (NS_FAILED(rv)) {
- Output("Couldn't calculate the application directory.\n");
+ int gotCounters;
+ #if defined(XP_UNIX)
+ struct rusage initialRUsage;
diff --git a/www/firefox-esr/files/patch-bug685258 b/www/firefox-esr/files/patch-bug685258
deleted file mode 100644
index ead2d3858209..000000000000
--- a/www/firefox-esr/files/patch-bug685258
+++ /dev/null
@@ -1,17 +0,0 @@
-# HG changeset patch
-# User Oleg Romashin <romaxa@gmail.com>
-# Parent a2291c212856ad27622416e83c8311b6a33b52f1
-Bug 685258 - Pulse audio backend does not check provided playback and crashes r=derf
-
-diff --git a/content/media/nsAudioStream.cpp b/content/media/nsAudioStream.cpp
---- content/media/nsAudioStream.cpp
-+++ content/media/nsAudioStream.cpp
-@@ -429,7 +429,7 @@ nsresult nsNativeAudioStream::Init(PRInt32 aNumChannels, PRInt32 aRate, SampleFo
- mFormat = aFormat;
-
- if (sa_stream_create_pcm(reinterpret_cast<sa_stream_t**>(&mAudioHandle),
-- NULL,
-+ "Mozilla",
- SA_MODE_WRONLY,
- SA_PCM_FORMAT_S16_NE,
- aRate,
diff --git a/www/firefox-esr/files/patch-bug713802 b/www/firefox-esr/files/patch-bug713802
deleted file mode 100644
index 7d3cc4dad110..000000000000
--- a/www/firefox-esr/files/patch-bug713802
+++ /dev/null
@@ -1,163 +0,0 @@
-commit 20586fa
-Author: Karl Tomlinson <karlt+@karlt.net>
-Date: Thu Sep 27 18:35:06 2012 +1200
-
- b=713802 default enable GIO support and disable GnomeVFS r=glandium
-
- --HG--
- extra : transplant_source : wk%ADr%CA%8EN%AE%C93p/p%0A%26%0E%1D0%F20
----
- browser/confvars.sh | 2 +-
- configure.in | 20 ++++++++++----------
- xulrunner/confvars.sh | 2 +-
- 3 files changed, 12 insertions(+), 12 deletions(-)
-
-diff --git browser/confvars.sh browser/confvars.sh
-index 40ab494..eae5645 100755
---- browser/confvars.sh
-+++ browser/confvars.sh
-@@ -21,7 +21,7 @@ MOZ_SERVICES_AITC=1
- MOZ_SERVICES_NOTIFICATIONS=1
- MOZ_SERVICES_SYNC=1
- MOZ_APP_VERSION=$FIREFOX_VERSION
--MOZ_EXTENSIONS_DEFAULT=" gnomevfs"
-+MOZ_EXTENSIONS_DEFAULT=" gio"
- # MOZ_APP_DISPLAYNAME will be set by branding/configure.sh
- # Changing MOZ_*BRANDING_DIRECTORY requires a clobber to ensure correct results,
- # because branding dependencies are broken.
-diff --git configure.in configure.in
-index 87a9391..2118651 100644
---- configure.in
-+++ configure.in
-@@ -4846,21 +4846,21 @@ dnl ========================================================
-
- if test "$MOZ_X11"
- then
-- dnl build the gnomevfs extension by default only when the
-+ dnl build the GIO extension by default only when the
- dnl GTK2 toolkit is in use.
- if test "$MOZ_ENABLE_GTK2"
- then
-- MOZ_ENABLE_GNOMEVFS=1
-+ MOZ_ENABLE_GIO=1
- MOZ_ENABLE_GCONF=1
- fi
-
- dnl ========================================================
- dnl = GnomeVFS support module
- dnl ========================================================
-- MOZ_ARG_DISABLE_BOOL(gnomevfs,
-- [ --disable-gnomevfs Disable GnomeVFS support ],
-- MOZ_ENABLE_GNOMEVFS=,
-- MOZ_ENABLE_GNOMEVFS=force)
-+ MOZ_ARG_ENABLE_BOOL(gnomevfs,
-+ [ --enable-gnomevfs Enable GnomeVFS support (default: disabled)],
-+ MOZ_ENABLE_GNOMEVFS=force,
-+ MOZ_ENABLE_GNOMEVFS=)
-
- if test "$MOZ_ENABLE_GNOMEVFS"
- then
-@@ -4884,10 +4884,10 @@ then
- dnl ========================================================
- dnl = GIO support module
- dnl ========================================================
-- MOZ_ARG_ENABLE_BOOL(gio,
-- [ --enable-gio Enable GIO support (default: disabled)],
-- MOZ_ENABLE_GIO=force,
-- MOZ_ENABLE_GIO=)
-+ MOZ_ARG_DISABLE_BOOL(gio,
-+ [ --disable-gio Disable GIO support],
-+ MOZ_ENABLE_GIO=,
-+ MOZ_ENABLE_GIO=force)
-
- if test "$MOZ_ENABLE_GIO" -a "$MOZ_ENABLE_GTK2"
- then
-diff --git xulrunner/confvars.sh xulrunner/confvars.sh
-index 2fa6ead..5fe2c3d 100755
---- xulrunner/confvars.sh
-+++ xulrunner/confvars.sh
-@@ -10,5 +10,5 @@ MOZ_XULRUNNER=1
- MOZ_CHROME_FILE_FORMAT=omni
- MOZ_APP_VERSION=$MOZILLA_VERSION
- MOZ_PLACES=1
--MOZ_EXTENSIONS_DEFAULT=" gnomevfs"
-+MOZ_EXTENSIONS_DEFAULT=" gio"
- MOZ_URL_CLASSIFIER=1
-
-commit d884d75
-Author: Karl Tomlinson <karlt+@karlt.net>
-Date: Thu Sep 27 18:34:44 2012 +1200
-
- b=713802 disable gnomevfs extension without --enable-gnomevfs r=glandium
-
- --HG--
- extra : transplant_source : i%07%81%E9%90_%C1%05b%194%9B%1E%93%FC%03%279%F9%8A
----
- configure.in | 12 +++---------
- 1 file changed, 3 insertions(+), 9 deletions(-)
-
-diff --git configure.in configure.in
-index f2b4041..87a9391 100644
---- configure.in
-+++ configure.in
-@@ -4875,12 +4875,6 @@ then
- fi
- MOZ_ENABLE_GNOMEVFS=
- ])
-- else
-- if test `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then
-- PKG_CHECK_MODULES(MOZ_GNOMEVFS, gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION,[
-- MOZ_GNOMEVFS_LIBS=`echo $MOZ_GNOMEVFS_LIBS | sed 's/-llinc\>//'`
-- ])
-- fi
- fi
-
- AC_SUBST(MOZ_ENABLE_GNOMEVFS)
-@@ -5967,10 +5961,10 @@ MOZ_ARG_ENABLE_STRING(extensions,
- done],
- MOZ_EXTENSIONS="$MOZ_EXTENSIONS_DEFAULT")
-
--if test -z "$MOZ_ENABLE_GNOMEVFS" -a -z "$MOZ_GNOMEVFS_LIBS" -a `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then
-+if test -z "$MOZ_ENABLE_GNOMEVFS" -a `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then
- # Suppress warning on non-X11 platforms
- if test -n "$MOZ_X11"; then
-- AC_MSG_WARN([Cannot build gnomevfs without required libraries. Removing gnomevfs from MOZ_EXTENSIONS.])
-+ AC_MSG_WARN([Removing gnomevfs from MOZ_EXTENSIONS due to no --enable-gnomevfs.])
- fi
- MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gnomevfs||'`
- fi
-@@ -5983,7 +5977,7 @@ fi
- if test -z "$MOZ_ENABLE_GIO" -a `echo "$MOZ_EXTENSIONS" | grep -c gio` -ne 0; then
- # Suppress warning on non-X11 platforms
- if test -n "$MOZ_X11"; then
-- AC_MSG_WARN([Cannot build gio without required libraries. Removing gio from MOZ_EXTENSIONS.])
-+ AC_MSG_WARN([Removing gio from MOZ_EXTENSIONS due to --disable-gio.])
- fi
- MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gio||'`
- fi
-
-commit ddedeea
-Author: Karl Tomlinson <karlt+@karlt.net>
-Date: Thu Sep 27 13:47:19 2012 +1200
-
- b=713802 link gio extension against libxul for tracemalloc stack functions r=bsmedberg
-
- --HG--
- extra : transplant_source : %C8%A3o%BE%A0z%F7%C8%8A%E6%0E%D4s%7D%90%9C%D9%0F%06%7E
----
- extensions/gio/Makefile.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git extensions/gio/Makefile.in extensions/gio/Makefile.in
-index 46412c4..ccf2846 100644
---- extensions/gio/Makefile.in
-+++ extensions/gio/Makefile.in
-@@ -23,7 +23,7 @@ LOCAL_INCLUDES = $(MOZ_GIO_CFLAGS)
-
- EXTRA_DSO_LDOPTS = \
- $(XPCOM_GLUE_LDOPTS) \
-- $(NSPR_LIBS) \
-+ $(MOZ_COMPONENT_LIBS) \
- $(MOZ_GIO_LIBS) \
- $(NULL)
-
diff --git a/www/firefox-esr/files/patch-bug722975 b/www/firefox-esr/files/patch-bug722975
deleted file mode 100644
index 46a3381b9375..000000000000
--- a/www/firefox-esr/files/patch-bug722975
+++ /dev/null
@@ -1,61 +0,0 @@
-# HG changeset patch
-# Parent 9d3c9b863c697634e434b687d456bb82fa794ecf
-# User Uli Schlachter <psychon@znc.in>
-Bug 722975 - --enable-system-cairo build is broken after Bug 715658 fixed
-
-
-diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp
---- gfx/thebes/gfxPlatform.cpp
-+++ gfx/thebes/gfxPlatform.cpp
-@@ -484,21 +484,19 @@ gfxPlatform::CreateDrawTargetForSurface(
-
- cairo_user_data_key_t kSourceSurface;
-
- void SourceBufferDestroy(void *srcBuffer)
- {
- static_cast<SourceSurface*>(srcBuffer)->Release();
- }
-
--void SourceSnapshotDetached(cairo_surface_t *nullSurf)
-+void SourceSnapshotDetached(void *nullSurf)
- {
-- gfxImageSurface* origSurf =
-- static_cast<gfxImageSurface*>(cairo_surface_get_user_data(nullSurf, &kSourceSurface));
--
-+ gfxImageSurface *origSurf = static_cast<gfxImageSurface*>(nullSurf);
- origSurf->SetData(&kSourceSurface, NULL, NULL);
- }
-
- RefPtr<SourceSurface>
- gfxPlatform::GetSourceSurfaceForSurface(DrawTarget *aTarget, gfxASurface *aSurface)
- {
- void *userData = aSurface->GetData(&kSourceSurface);
-
-@@ -588,24 +586,19 @@ gfxPlatform::GetSourceSurfaceForSurface(
- }
-
- srcBuffer = Factory::CreateWrappingDataSourceSurface(imgSurface->Data(),
- imgSurface->Stride(),
- size, format);
-
- }
-
-- cairo_surface_t *nullSurf =
-- cairo_null_surface_create(CAIRO_CONTENT_COLOR_ALPHA);
-- cairo_surface_set_user_data(nullSurf,
-- &kSourceSurface,
-- imgSurface,
-- NULL);
-- cairo_surface_attach_snapshot(imgSurface->CairoSurface(), nullSurf, SourceSnapshotDetached);
-- cairo_surface_destroy(nullSurf);
-+ cairo_surface_set_mime_data(imgSurface->CairoSurface(), "mozilla/magic",
-+ (const unsigned char *) "data", 4,
-+ SourceSnapshotDetached, imgSurface.get());
- }
-
- srcBuffer->AddRef();
- aSurface->SetData(&kSourceSurface, srcBuffer, SourceBufferDestroy);
-
- return srcBuffer;
- }
-
diff --git a/www/firefox-esr/files/patch-bug732340 b/www/firefox-esr/files/patch-bug732340
deleted file mode 100644
index 95756678bd0f..000000000000
--- a/www/firefox-esr/files/patch-bug732340
+++ /dev/null
@@ -1,13 +0,0 @@
---- gfx/harfbuzz/src/hb-ot-layout.cc.orig 2012-06-24 22:14:46.463741874 -0400
-+++ gfx/harfbuzz/src/hb-ot-layout.cc 2012-06-24 22:15:06.784770042 -0400
-@@ -537,4 +537,10 @@ hb_ot_layout_position_finish (hb_face_t
- GPOS::position_finish (buffer);
- }
-
-+#if !defined(__clang__) && defined(__GNUC__) && __GNUC_MINOR__ <= 3
-+template int SortedArrayOf<Record<LangSys> >::search<unsigned int>(unsigned int const &) const;
-+template int SortedArrayOf<Record<Script> >::search<unsigned int>(unsigned int const &) const;
-+template int SortedArrayOf<IntType<unsigned short> >::search<unsigned int>(unsigned int const &) const;
-+template int SortedArrayOf<RangeRecord>::search<unsigned int>(unsigned int const &) const;
-+#endif
-
diff --git a/www/firefox-esr/files/patch-bug753046 b/www/firefox-esr/files/patch-bug753046
deleted file mode 100644
index 3d99258b8323..000000000000
--- a/www/firefox-esr/files/patch-bug753046
+++ /dev/null
@@ -1,1207 +0,0 @@
-# Bug 753046 - Add support for DragonFly/NetBSD
-
-$NetBSD: patch-dom_plugins_ipc_PluginModuleChild.cpp,v 1.1 2012/03/06 12:34:09 ryoon Exp $
-
---- dom/plugins/ipc/PluginModuleChild.cpp.orig 2011-12-20 23:28:14.000000000 +0000
-+++ dom/plugins/ipc/PluginModuleChild.cpp
-@@ -5,6 +5,7 @@
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
- #ifdef MOZ_WIDGET_QT
-+#include <unistd.h> // for _exit()
- #include <QtCore/QTimer>
- #include "nsQAppInstance.h"
- #include "NestedLoopTimer.h"
-@@ -228,7 +228,7 @@ PluginModuleChild::Init(const std::strin
-
- // TODO: use PluginPRLibrary here
-
--#if defined(OS_LINUX)
-+#if defined(OS_LINUX) || defined(OS_BSD)
- mShutdownFunc =
- (NP_PLUGINSHUTDOWN) PR_FindFunctionSymbol(mLibrary, "NP_Shutdown");
-
-@@ -1790,7 +1790,7 @@ PluginModuleChild::AnswerNP_GetEntryPoin
- PLUGIN_LOG_DEBUG_METHOD;
- AssertPluginThread();
-
--#if defined(OS_LINUX)
-+#if defined(OS_LINUX) || defined(OS_BSD)
- return true;
- #elif defined(OS_WIN) || defined(OS_MACOSX)
- *_retval = mGetEntryPointsFunc(&mFunctions);
-@@ -1823,7 +1823,7 @@ PluginModuleChild::AnswerNP_Initialize(N
- SendBackUpXResources(FileDescriptor(xSocketFd, false/*don't close*/));
- #endif
-
--#if defined(OS_LINUX)
-+#if defined(OS_LINUX) || defined(OS_BSD)
- *_retval = mInitializeFunc(&sBrowserFuncs, &mFunctions);
- return true;
- #elif defined(OS_WIN) || defined(OS_MACOSX)
-$NetBSD: patch-dom_plugins_ipc_PluginModuleChild.h,v 1.1 2012/03/06 12:34:09 ryoon Exp $
-
---- dom/plugins/ipc/PluginModuleChild.h.orig 2011-12-20 23:28:14.000000000 +0000
-+++ dom/plugins/ipc/PluginModuleChild.h
-@@ -340,7 +340,7 @@ private:
-
- // we get this from the plugin
- NP_PLUGINSHUTDOWN mShutdownFunc;
--#ifdef OS_LINUX
-+#if defined(OS_LINUX) || defined(OS_BSD)
- NP_PLUGINUNIXINIT mInitializeFunc;
- #elif defined(OS_WIN) || defined(OS_MACOSX)
- NP_PLUGININIT mInitializeFunc;
-$NetBSD: patch-ipc_chromium_Makefile.in,v 1.1 2012/03/06 12:34:09 ryoon Exp $
-
---- ipc/chromium/Makefile.in.orig 2012-02-16 06:40:33.000000000 +0000
-+++ ipc/chromium/Makefile.in
-@@ -278,6 +278,33 @@ endif
-
- endif # } OS_LINUX
-
-+ifdef OS_BSD # {
-+
-+CPPSRCS += \
-+ atomicops_internals_x86_gcc.cc \
-+ process_util_bsd.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_BSD
-+
- # libevent
-
- ifndef MOZ_NATIVE_LIBEVENT # {
-$NetBSD: patch-ipc_chromium_chromium-config.mk,v 1.2 2012/03/15 08:30:06 ryoon Exp $
-
---- ipc/chromium/chromium-config.mk.orig 2012-02-16 07:40:33.000000000 +0100
-+++ ipc/chromium/chromium-config.mk 2012-03-11 11:05:40.397182000 +0100
-@@ -56,17 +56,6 @@
- -I$(DEPTH)/ipc/ipdl/_ipdlheaders \
- $(NULL)
-
--ifeq ($(OS_ARCH),Darwin) # {
--
--OS_MACOSX = 1
--OS_POSIX = 1
--
--DEFINES += \
-- -DOS_MACOSX=1 \
-- -DOS_POSIX=1 \
-- $(NULL)
--
--else # } {
- ifeq ($(OS_ARCH),WINNT) # {
- OS_LIBS += $(call EXPAND_LIBNAME,psapi shell32 dbghelp)
-
-@@ -93,13 +82,65 @@
- endif
-
- else # } {
--
--OS_LINUX = 1
- OS_POSIX = 1
-+DEFINES += -DOS_POSIX=1
-+
-+ifeq ($(OS_ARCH),Darwin) # {
-+
-+OS_MACOSX = 1
-+DEFINES += \
-+ -DOS_MACOSX=1 \
-+ $(NULL)
-+
-+else # } {
-+ifeq ($(OS_ARCH),DragonFly) # {
-+
-+OS_DRAGONFLY = 1
-+OS_BSD = 1
-+OS_LIBS += $(call EXPAND_LIBNAME,kvm)
-+DEFINES += \
-+ -DOS_DRAGONFLY=1 \
-+ -DOS_BSD=1 \
-+ $(NULL)
-+
-+else # } {
-+ifeq ($(OS_ARCH),FreeBSD) # {
-+
-+OS_FREEBSD = 1
-+OS_BSD = 1
-+OS_LIBS += $(call EXPAND_LIBNAME,kvm)
-+DEFINES += \
-+ -DOS_FREEBSD=1 \
-+ -DOS_BSD=1 \
-+ $(NULL)
-
-+else # } {
-+ifeq ($(OS_ARCH),NetBSD) # {
-+
-+OS_NETBSD = 1
-+OS_BSD = 1
-+OS_LIBS += $(call EXPAND_LIBNAME,kvm)
-+DEFINES += \
-+ -DOS_NETBSD=1 \
-+ -DOS_BSD=1 \
-+ $(NULL)
-+
-+else # } {
-+ifeq ($(OS_ARCH),OpenBSD) # {
-+
-+OS_OPENBSD = 1
-+OS_BSD = 1
-+OS_LIBS += $(call EXPAND_LIBNAME,kvm)
-+DEFINES += \
-+ -DOS_OPENBSD=1 \
-+ -DOS_BSD=1 \
-+ $(NULL)
-+
-+else # } {
-+
-+OS_LINUX = 1
- DEFINES += \
- -DOS_LINUX=1 \
-- -DOS_POSIX=1 \
- $(NULL)
-
- # NB: to stop gcc warnings about exporting template instantiation
-@@ -107,4 +147,8 @@
-
- endif # }
- endif # }
-+endif # }
-+endif # }
-+endif # }
-+endif # }
-
-$NetBSD: patch-ipc_chromium_src_base_base__paths.h,v 1.1 2012/03/06 12:34:09 ryoon Exp $
-
---- ipc/chromium/src/base/base_paths.h.orig 2011-12-20 23:28:19.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)
-+#elif defined(OS_LINUX) || defined(OS_BSD)
- #include "base/base_paths_linux.h"
- #endif
- #include "base/path_service.h"
-$NetBSD: patch-ipc_chromium_src_base_debug__util__posic.cc,v 1.3 2012/04/01 15:18:45 ryoon Exp $
-
---- ipc/chromium/src/base/debug_util_posix.cc.orig 2012-03-13 01:36:53.000000000 +0000
-+++ ipc/chromium/src/base/debug_util_posix.cc
-@@ -5,7 +5,7 @@
- #include "build/build_config.h"
- #include "base/debug_util.h"
-
--#define MOZ_HAVE_EXECINFO_H (!defined(ANDROID) && !defined(__OpenBSD__))
-+#define MOZ_HAVE_EXECINFO_H (defined(OS_LINUX) && !defined(ANDROID))
-
- #include <errno.h>
- #include <fcntl.h>
-@@ -17,9 +17,16 @@
- #include <unistd.h>
- #if MOZ_HAVE_EXECINFO_H
- #include <execinfo.h>
-+#endif
-+
-+#if defined(OS_MACOSX) || defined(OS_BSD)
- #include <sys/sysctl.h>
- #endif
-
-+#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD)
-+#include <sys/user.h>
-+#endif
-+
- #include "base/basictypes.h"
- #include "base/eintr_wrapper.h"
- #include "base/logging.h"
-@@ -32,7 +37,7 @@ bool DebugUtil::SpawnDebuggerOnProcess(u
- return false;
- }
-
--#if defined(OS_MACOSX)
-+#if defined(OS_MACOSX) || defined(OS_BSD)
-
- // Based on Apple's recommended method as described in
- // http://developer.apple.com/qa/qa2004/qa1361.html
-@@ -71,7 +76,15 @@ bool DebugUtil::BeingDebugged() {
-
- // This process is being debugged if the P_TRACED flag is set.
- is_set = true;
-+#if defined(OS_DRAGONFLY)
-+ being_debugged = (info.kp_flags & P_TRACED) != 0;
-+#elif defined(OS_FREEBSD)
-+ being_debugged = (info.ki_flag & P_TRACED) != 0;
-+#elif defined(OS_OPENBSD)
-+ being_debugged = (info.p_flag & P_TRACED) != 0;
-+#else
- being_debugged = (info.kp_proc.p_flag & P_TRACED) != 0;
-+#endif
- return being_debugged;
- }
-
-diff --git ipc/chromium/src/base/dir_reader_bsd.h ipc/chromium/src/base/dir_reader_bsd.h
-new file mode 100644
-index 0000000..3fc1a87
---- /dev/null
-+++ ipc/chromium/src/base/dir_reader_bsd.h
-@@ -0,0 +1,112 @@
-+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-+// Use of this source code is governed by a BSD-style license that can be
-+// found in the LICENSE file.
-+
-+// derived from dir_reader_linux.h
-+
-+#ifndef BASE_DIR_READER_BSD_H_
-+#define BASE_DIR_READER_BSD_H_
-+#pragma once
-+
-+#include <dirent.h>
-+#include <errno.h>
-+#include <fcntl.h>
-+#include <stdint.h>
-+#include <unistd.h>
-+
-+#include "base/logging.h"
-+#include "base/eintr_wrapper.h"
-+
-+// See the comments in dir_reader_posix.h about this.
-+
-+namespace base {
-+
-+class DirReaderBSD {
-+ public:
-+ explicit DirReaderBSD(const char* directory_path)
-+#ifdef O_DIRECTORY
-+ : fd_(open(directory_path, O_RDONLY | O_DIRECTORY)),
-+#else
-+ : fd_(open(directory_path, O_RDONLY)),
-+#endif
-+ offset_(0),
-+ size_(0) {
-+ memset(buf_, 0, sizeof(buf_));
-+ }
-+
-+ ~DirReaderBSD() {
-+ if (fd_ >= 0) {
-+ if (HANDLE_EINTR(close(fd_)))
-+ DLOG(ERROR) << "Failed to close directory handle";
-+ }
-+ }
-+
-+ bool IsValid() const {
-+ return fd_ >= 0;
-+ }
-+
-+ // Move to the next entry returning false if the iteration is complete.
-+ bool Next() {
-+ if (size_) {
-+ struct dirent* dirent = reinterpret_cast<struct dirent*>(&buf_[offset_]);
-+#ifdef OS_DRAGONFLY
-+ offset_ += _DIRENT_DIRSIZ(dirent);
-+#else
-+ offset_ += dirent->d_reclen;
-+#endif
-+ }
-+
-+ if (offset_ != size_)
-+ return true;
-+
-+#ifdef OS_OPENBSD
-+ const int r = getdirentries(fd_, buf_, sizeof(buf_), basep_);
-+#else
-+ const int r = getdents(fd_, buf_, sizeof(buf_));
-+#endif
-+ if (r == 0)
-+ return false;
-+ if (r == -1) {
-+#ifdef OS_OPENBSD
-+ DLOG(ERROR) << "getdirentries returned an error: " << errno;
-+#else
-+ DLOG(ERROR) << "getdents returned an error: " << errno;
-+#endif
-+ return false;
-+ }
-+ size_ = r;
-+ offset_ = 0;
-+ return true;
-+ }
-+
-+ const char* name() const {
-+ if (!size_)
-+ return NULL;
-+
-+ const struct dirent* dirent =
-+ reinterpret_cast<const struct dirent*>(&buf_[offset_]);
-+ return dirent->d_name;
-+ }
-+
-+ int fd() const {
-+ return fd_;
-+ }
-+
-+ static bool IsFallback() {
-+ return false;
-+ }
-+
-+ private:
-+ const int fd_;
-+ char buf_[512];
-+#ifdef OS_OPENBSD
-+ off_t *basep_;
-+#endif
-+ size_t offset_, size_;
-+
-+ DISALLOW_COPY_AND_ASSIGN(DirReaderBSD);
-+};
-+
-+} // namespace base
-+
-+#endif // BASE_DIR_READER_BSD_H_
-diff --git ipc/chromium/src/base/dir_reader_posix.h ipc/chromium/src/base/dir_reader_posix.h
-index 9a34492..62b280c 100644
---- ipc/chromium/src/base/dir_reader_posix.h
-+++ ipc/chromium/src/base/dir_reader_posix.h
-@@ -18,16 +18,20 @@
- // seems worse than falling back to enumerating all file descriptors so we will
- // probably never implement this on the Mac.
-
--#if defined(OS_LINUX) && !defined(OS_OPENBSD)
-+#if defined(OS_LINUX)
- #include "base/dir_reader_linux.h"
-+#elif defined(OS_BSD)
-+#include "base/dir_reader_bsd.h"
- #else
- #include "base/dir_reader_fallback.h"
- #endif
-
- namespace base {
-
--#if defined(OS_LINUX) && !defined(OS_OPENBSD)
-+#if defined(OS_LINUX)
- typedef DirReaderLinux DirReaderPosix;
-+#elif defined(OS_BSD)
-+typedef DirReaderBSD DirReaderPosix;
- #else
- typedef DirReaderFallback DirReaderPosix;
- #endif
-$NetBSD: patch-ipc_chromium_src_base_file__util__posix.cc,v 1.2 2012/03/06 12:34:09 ryoon Exp $
-
---- ipc/chromium/src/base/file_util_posix.cc.orig 2011-12-20 23:28:19.000000000 +0000
-+++ ipc/chromium/src/base/file_util_posix.cc
-@@ -31,7 +31,7 @@
- #include "base/time.h"
-
- // FreeBSD/OpenBSD lacks stat64, but its stat handles files >2GB just fine
--#if defined(OS_FREEBSD) || defined(OS_OPENBSD)
-+#ifndef HAVE_STAT64
- #define stat64 stat
- #endif
-
-$NetBSD: patch-ipc_chromium_src_base_message__loop.cc,v 1.1 2012/03/06 12:34:09 ryoon Exp $
-
---- ipc/chromium/src/base/message_loop.cc.orig 2012-02-16 07:40:33.000000000 +0100
-+++ ipc/chromium/src/base/message_loop.cc 2012-02-21 21:24:41.000000000 +0100
-@@ -19,7 +19,7 @@
- #if defined(OS_POSIX)
- #include "base/message_pump_libevent.h"
- #endif
--#if defined(OS_LINUX)
-+#if defined(OS_LINUX) || defined(OS_BSD)
- #ifdef MOZ_WIDGET_GTK2
- #include "base/message_pump_glib.h"
- #endif
-@@ -119,7 +119,7 @@
- if (type_ == TYPE_UI) {
- #if defined(OS_MACOSX)
- pump_ = base::MessagePumpMac::Create();
--#elif defined(OS_LINUX)
-+#elif defined(OS_LINUX) || defined(OS_BSD)
- pump_ = new base::MessagePumpForUI();
- #endif // OS_LINUX
- } else if (type_ == TYPE_IO) {
-$NetBSD: patch-ipc_chromium_src_base_platform__thread.h,v 1.1 2012/03/06 12:34:09 ryoon Exp $
-
---- ipc/chromium/src/base/platform_thread.h.orig 2011-12-20 23:28:19.000000000 +0000
-+++ ipc/chromium/src/base/platform_thread.h
-@@ -22,9 +22,12 @@ typedef void* PlatformThreadHandle; // HANDLE
- #elif defined(OS_POSIX)
- #include <pthread.h>
- typedef pthread_t PlatformThreadHandle;
--#if defined(OS_LINUX)
-+#if defined(OS_LINUX) || defined(OS_OPENBSD)
- #include <unistd.h>
- typedef pid_t PlatformThreadId;
-+#elif defined(OS_BSD)
-+#include <sys/types.h>
-+typedef lwpid_t PlatformThreadId;
- #elif defined(OS_MACOSX)
- #include <mach/mach.h>
- typedef mach_port_t PlatformThreadId;
-$NetBSD: patch-ipc_chromium_src_base_platform__thread__posix.cc,v 1.4 2012/04/01 15:18:45 ryoon Exp $
-
---- ipc/chromium/src/base/platform_thread_posix.cc.orig 2012-03-13 01:36:53.000000000 +0000
-+++ ipc/chromium/src/base/platform_thread_posix.cc
-@@ -9,16 +9,24 @@
-
- #if defined(OS_MACOSX)
- #include <mach/mach.h>
-+#elif defined(OS_NETBSD)
-+#include <lwp.h>
- #elif defined(OS_LINUX)
- #include <sys/syscall.h>
--#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__DragonFly__)
- #include <sys/prctl.h>
--#elif !defined(__NetBSD__)
--#include <pthread_np.h>
-+#elif defined(OS_FREEBSD)
-+#include <sys/param.h>
-+#include <sys/thr.h>
- #endif
-+
-+#if !defined(OS_MACOSX)
- #include <unistd.h>
- #endif
-
-+#if defined(OS_BSD) && !defined(OS_NETBSD)
-+#include <pthread_np.h>
-+#endif
-+
- #if defined(OS_MACOSX)
- namespace base {
- void InitThreading();
-@@ -38,9 +45,20 @@ PlatformThreadId PlatformThread::CurrentId() {
- // into the kernel.
- #if defined(OS_MACOSX)
- return mach_thread_self();
--#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
-+#elif defined(OS_NETBSD)
-+ return _lwp_self();
-+#elif defined(OS_DRAGONFLY)
-+ return lwp_gettid();
-+#elif defined(OS_FREEBSD)
-+# if __FreeBSD_version > 900030
-+ return pthread_getthreadid_np();
-+# else
-+ long lwpid;
-+ thr_self(&lwpid);
-+ return lwpid;
-+# endif
-+#elif defined(OS_OPENBSD)
-- // TODO(BSD): find a better thread ID
-- return (intptr_t)(pthread_self());
-+ return (intptr_t) (pthread_self());
- #elif defined(OS_LINUX)
- return syscall(__NR_gettid);
- #endif
-@@ -102,9 +102,9 @@ void PlatformThread::SetName(const char* name) {
- // Note that glibc also has a 'pthread_setname_np' api, but it may not be
- // available everywhere and it's only benefit over using prctl directly is
- // that it can set the name of threads other than the current thread.
--#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
-+#if defined(OS_BSD) && !defined(OS_NETBSD)
- pthread_set_name_np(pthread_self(), name);
--#elif defined(__NetBSD__)
-+#elif defined(OS_NETBSD)
- pthread_setname_np(pthread_self(), "%s", (void *)name);
- #else
- prctl(PR_SET_NAME, reinterpret_cast<uintptr_t>(name), 0, 0, 0);
-$NetBSD: patch-ipc_chromium_src_base_process__util.h,v 1.1 2012/03/06 12:34:09 ryoon Exp $
-
---- ipc/chromium/src/base/process_util.h.orig 2011-12-21 00:28:19.000000000 +0100
-+++ ipc/chromium/src/base/process_util.h 2012-01-31 13:14:54.000000000 +0100
-@@ -280,6 +280,7 @@ class NamedProcessIterator {
- const ProcessEntry* NextProcessEntry();
-
- private:
-+#if !defined(OS_BSD)
- // Determines whether there's another process (regardless of executable)
- // left in the list of all processes. Returns true and sets entry_ to
- // that process's info if there is one, false otherwise.
-@@ -292,18 +292,24 @@
- void InitProcessEntry(ProcessEntry* entry);
-
- std::wstring executable_name_;
-+#endif
-
- #if defined(OS_WIN)
- HANDLE snapshot_;
- bool started_iteration_;
- #elif defined(OS_LINUX)
- DIR *procfs_dir_;
-+#elif defined(OS_BSD)
-+ std::vector<ProcessEntry> content;
-+ size_t nextEntry;
- #elif defined(OS_MACOSX)
- std::vector<kinfo_proc> kinfo_procs_;
- size_t index_of_kinfo_proc_;
- #endif
-+#if !defined(OS_BSD)
- ProcessEntry entry_;
- const ProcessFilter* filter_;
-+#endif
-
- DISALLOW_EVIL_CONSTRUCTORS(NamedProcessIterator);
- };
-$NetBSD: patch-ipc_chromium_src_base_process__util__bsd.cc,v 1.4 2012/04/01 15:18:45 ryoon Exp $
-
---- ipc/chromium/src/base/process_util_bsd.cc.orig 2012-04-01 00:04:28.000000000 +0000
-+++ ipc/chromium/src/base/process_util_bsd.cc
-@@ -0,0 +1,367 @@
-+// Copyright (c) 2008 The Chromium Authors. All rights reserved.
-+// Use of this source code is governed by a BSD-style license that can be
-+// found in the LICENSE file.
-+
-+// derived from process_util_linux.cc and process_util_mac.cc
-+
-+#include "base/process_util.h"
-+
-+#include <sys/param.h>
-+#include <sys/sysctl.h>
-+#include <sys/wait.h>
-+#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD)
-+#include <sys/user.h>
-+#endif
-+
-+#include <ctype.h>
-+#include <fcntl.h>
-+#include <kvm.h>
-+#include <unistd.h>
-+
-+#include <string>
-+
-+#include "base/debug_util.h"
-+#include "base/eintr_wrapper.h"
-+#include "base/file_util.h"
-+#include "base/logging.h"
-+#include "base/string_tokenizer.h"
-+#include "base/string_util.h"
-+
-+#if (defined(_POSIX_SPAWN) && _POSIX_SPAWN > 0) \
-+ || (defined(OS_NETBSD) && __NetBSD_Version__ >= 599006500)
-+#define HAVE_POSIX_SPAWN 1
-+#endif
-+
-+/*
-+ * On platforms that are not gonk based, we fall back to an arbitrary
-+ * UID. This is generally the UID for user `nobody', albeit it is not
-+ * always the case.
-+ */
-+
-+#if defined(OS_NETBSD) || defined(OS_OPENBSD)
-+# define CHILD_UNPRIVILEGED_UID 32767
-+# define CHILD_UNPRIVILEGED_GID 32767
-+#else
-+# define CHILD_UNPRIVILEGED_UID 65534
-+# define CHILD_UNPRIVILEGED_GID 65534
-+#endif
-+
-+#ifndef __dso_public
-+# ifdef __exported
-+# define __dso_public __exported
-+# else
-+# define __dso_public __attribute__((__visibility__("default")))
-+# endif
-+#endif
-+
-+#ifdef HAVE_POSIX_SPAWN
-+#include <spawn.h>
-+extern "C" char **environ __dso_public;
-+#endif
-+
-+namespace {
-+
-+enum ParsingState {
-+ KEY_NAME,
-+ KEY_VALUE
-+};
-+
-+static mozilla::EnvironmentLog gProcessLog("MOZ_PROCESS_LOG");
-+
-+} // namespace
-+
-+namespace base {
-+
-+#ifdef HAVE_POSIX_SPAWN
-+
-+void FreeEnvVarsArray(char* array[], int length)
-+{
-+ for (int i = 0; i < length; i++) {
-+ free(array[i]);
-+ }
-+ delete[] array;
-+}
-+
-+bool LaunchApp(const std::vector<std::string>& argv,
-+ const file_handle_mapping_vector& fds_to_remap,
-+ bool wait, ProcessHandle* process_handle) {
-+ return LaunchApp(argv, fds_to_remap, environment_map(),
-+ wait, process_handle);
-+}
-+
-+bool LaunchApp(const std::vector<std::string>& argv,
-+ const file_handle_mapping_vector& fds_to_remap,
-+ const environment_map& env_vars_to_set,
-+ bool wait, ProcessHandle* process_handle,
-+ ProcessArchitecture arch) {
-+ return LaunchApp(argv, fds_to_remap, env_vars_to_set,
-+ SAME_PRIVILEGES_AS_PARENT,
-+ wait, process_handle);
-+}
-+
-+bool LaunchApp(const std::vector<std::string>& argv,
-+ const file_handle_mapping_vector& fds_to_remap,
-+ const environment_map& env_vars_to_set,
-+ ChildPrivileges privs,
-+ bool wait, ProcessHandle* process_handle,
-+ ProcessArchitecture arch) {
-+ bool retval = true;
-+
-+ char* argv_copy[argv.size() + 1];
-+ for (size_t i = 0; i < argv.size(); i++) {
-+ argv_copy[i] = const_cast<char*>(argv[i].c_str());
-+ }
-+ argv_copy[argv.size()] = NULL;
-+
-+ // Make sure we don't leak any FDs to the child process by marking all FDs
-+ // as close-on-exec.
-+ SetAllFDsToCloseOnExec();
-+
-+ // Copy environment to a new char array and add the variables
-+ // in env_vars_to_set.
-+ // Existing variables are overwritten by env_vars_to_set.
-+ int pos = 0;
-+ environment_map combined_env_vars = env_vars_to_set;
-+ while(environ[pos] != NULL) {
-+ std::string varString = environ[pos];
-+ std::string varName = varString.substr(0, varString.find_first_of('='));
-+ std::string varValue = varString.substr(varString.find_first_of('=') + 1);
-+ if (combined_env_vars.find(varName) == combined_env_vars.end()) {
-+ combined_env_vars[varName] = varValue;
-+ }
-+ pos++;
-+ }
-+ int varsLen = combined_env_vars.size() + 1;
-+
-+ char** vars = new char*[varsLen];
-+ int i = 0;
-+ for (environment_map::const_iterator it = combined_env_vars.begin();
-+ it != combined_env_vars.end(); ++it) {
-+ std::string entry(it->first);
-+ entry += "=";
-+ entry += it->second;
-+ vars[i] = strdup(entry.c_str());
-+ i++;
-+ }
-+ vars[i] = NULL;
-+
-+ posix_spawn_file_actions_t file_actions;
-+ if (posix_spawn_file_actions_init(&file_actions) != 0) {
-+ FreeEnvVarsArray(vars, varsLen);
-+ return false;
-+ }
-+
-+ // Turn fds_to_remap array into a set of dup2 calls.
-+ for (file_handle_mapping_vector::const_iterator it = fds_to_remap.begin();
-+ it != fds_to_remap.end();
-+ ++it) {
-+ int src_fd = it->first;
-+ int dest_fd = it->second;
-+
-+ if (src_fd == dest_fd) {
-+ int flags = fcntl(src_fd, F_GETFD);
-+ if (flags != -1) {
-+ fcntl(src_fd, F_SETFD, flags & ~FD_CLOEXEC);
-+ }
-+ } else {
-+ if (posix_spawn_file_actions_adddup2(&file_actions, src_fd, dest_fd) != 0) {
-+ posix_spawn_file_actions_destroy(&file_actions);
-+ FreeEnvVarsArray(vars, varsLen);
-+ return false;
-+ }
-+ }
-+ }
-+
-+ pid_t pid = 0;
-+ int spawn_succeeded = (posix_spawnp(&pid,
-+ argv_copy[0],
-+ &file_actions,
-+ NULL,
-+ argv_copy,
-+ vars) == 0);
-+
-+ FreeEnvVarsArray(vars, varsLen);
-+
-+ posix_spawn_file_actions_destroy(&file_actions);
-+
-+ bool process_handle_valid = pid > 0;
-+ if (!spawn_succeeded || !process_handle_valid) {
-+ retval = false;
-+ } else {
-+ if (wait)
-+ HANDLE_EINTR(waitpid(pid, 0, 0));
-+
-+ if (process_handle)
-+ *process_handle = pid;
-+ }
-+
-+ return retval;
-+}
-+
-+bool LaunchApp(const CommandLine& cl,
-+ bool wait, bool start_hidden, ProcessHandle* process_handle) {
-+ // TODO(playmobil): Do we need to respect the start_hidden flag?
-+ file_handle_mapping_vector no_files;
-+ return LaunchApp(cl.argv(), no_files, wait, process_handle);
-+}
-+
-+#else // no posix_spawn, use fork/exec
-+
-+bool LaunchApp(const std::vector<std::string>& argv,
-+ const file_handle_mapping_vector& fds_to_remap,
-+ bool wait, ProcessHandle* process_handle) {
-+ return LaunchApp(argv, fds_to_remap, environment_map(),
-+ wait, process_handle);
-+}
-+
-+bool LaunchApp(const std::vector<std::string>& argv,
-+ const file_handle_mapping_vector& fds_to_remap,
-+ const environment_map& env_vars_to_set,
-+ bool wait, ProcessHandle* process_handle,
-+ ProcessArchitecture arch) {
-+ return LaunchApp(argv, fds_to_remap, env_vars_to_set,
-+ SAME_PRIVILEGES_AS_PARENT,
-+ wait, process_handle);
-+}
-+
-+bool LaunchApp(const std::vector<std::string>& argv,
-+ const file_handle_mapping_vector& fds_to_remap,
-+ const environment_map& env_vars_to_set,
-+ ChildPrivileges privs,
-+ bool wait, ProcessHandle* process_handle,
-+ ProcessArchitecture arch) {
-+ scoped_array<char*> argv_cstr(new char*[argv.size() + 1]);
-+ // Illegal to allocate memory after fork and before execvp
-+ InjectiveMultimap fd_shuffle1, fd_shuffle2;
-+ fd_shuffle1.reserve(fds_to_remap.size());
-+ fd_shuffle2.reserve(fds_to_remap.size());
-+
-+ pid_t pid = fork();
-+ if (pid < 0)
-+ return false;
-+
-+ if (pid == 0) {
-+ for (file_handle_mapping_vector::const_iterator
-+ it = fds_to_remap.begin(); it != fds_to_remap.end(); ++it) {
-+ fd_shuffle1.push_back(InjectionArc(it->first, it->second, false));
-+ fd_shuffle2.push_back(InjectionArc(it->first, it->second, false));
-+ }
-+
-+ if (!ShuffleFileDescriptors(&fd_shuffle1))
-+ _exit(127);
-+
-+ CloseSuperfluousFds(fd_shuffle2);
-+
-+ for (size_t i = 0; i < argv.size(); i++)
-+ argv_cstr[i] = const_cast<char*>(argv[i].c_str());
-+ argv_cstr[argv.size()] = NULL;
-+
-+ if (privs == UNPRIVILEGED) {
-+ if (setgid(CHILD_UNPRIVILEGED_GID) != 0) {
-+ DLOG(ERROR) << "FAILED TO setgid() CHILD PROCESS, path: " << argv_cstr[0];
-+ _exit(127);
-+ }
-+ if (setuid(CHILD_UNPRIVILEGED_UID) != 0) {
-+ DLOG(ERROR) << "FAILED TO setuid() CHILD PROCESS, path: " << argv_cstr[0];
-+ _exit(127);
-+ }
-+ if (chdir("/") != 0)
-+ gProcessLog.print("==> could not chdir()\n");
-+ }
-+
-+ for (environment_map::const_iterator it = env_vars_to_set.begin();
-+ it != env_vars_to_set.end(); ++it) {
-+ if (setenv(it->first.c_str(), it->second.c_str(), 1/*overwrite*/))
-+ _exit(127);
-+ }
-+ execv(argv_cstr[0], argv_cstr.get());
-+ // if we get here, we're in serious trouble and should complain loudly
-+ DLOG(ERROR) << "FAILED TO exec() CHILD PROCESS, path: " << argv_cstr[0];
-+ _exit(127);
-+ } else {
-+ gProcessLog.print("==> process %d launched child process %d\n",
-+ GetCurrentProcId(), pid);
-+ if (wait)
-+ HANDLE_EINTR(waitpid(pid, 0, 0));
-+
-+ if (process_handle)
-+ *process_handle = pid;
-+ }
-+
-+ return true;
-+}
-+
-+bool LaunchApp(const CommandLine& cl,
-+ bool wait, bool start_hidden,
-+ ProcessHandle* process_handle) {
-+ file_handle_mapping_vector no_files;
-+ return LaunchApp(cl.argv(), no_files, wait, process_handle);
-+}
-+
-+#endif
-+
-+NamedProcessIterator::NamedProcessIterator(const std::wstring& executable_name,
-+ const ProcessFilter* filter)
-+{
-+ int numEntries;
-+ kvm_t *kvm;
-+ std::string exe(WideToASCII(executable_name));
-+
-+#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD)
-+ kvm = kvm_open(NULL, NULL, NULL, O_RDONLY, NULL);
-+ struct kinfo_proc* procs = kvm_getprocs(kvm, KERN_PROC_UID, getuid(), &numEntries);
-+ if (procs != NULL && numEntries > 0) {
-+ for (int i = 0; i < numEntries; i++) {
-+# if defined(OS_DRAGONFLY)
-+ if (exe != procs[i].kp_comm) continue;
-+ if (filter && !filter->Includes(procs[i].kp_pid, procs[i].kp_ppid)) continue;
-+ ProcessEntry e;
-+ e.pid = procs[i].kp_pid;
-+ e.ppid = procs[i].kp_ppid;
-+ strlcpy(e.szExeFile, procs[i].kp_comm, sizeof e.szExeFile);
-+ content.push_back(e);
-+# elif defined(OS_FREEBSD)
-+ if (exe != procs[i].ki_comm) continue;
-+ if (filter && !filter->Includes(procs[i].ki_pid, procs[i].ki_ppid)) continue;
-+ ProcessEntry e;
-+ e.pid = procs[i].ki_pid;
-+ e.ppid = procs[i].ki_ppid;
-+ strlcpy(e.szExeFile, procs[i].ki_comm, sizeof e.szExeFile);
-+ content.push_back(e);
-+# endif
-+#else
-+ kvm = kvm_open(NULL, NULL, NULL, KVM_NO_FILES, NULL);
-+#if defined(OS_OPENBSD)
-+ struct kinfo_proc* procs = kvm_getprocs(kvm, KERN_PROC_UID, getuid(), sizeof(struct kinfo_proc), &numEntries);
-+#else
-+ struct kinfo_proc2* procs = kvm_getproc2(kvm, KERN_PROC_UID, getuid(), sizeof(struct kinfo_proc2), &numEntries);
-+#endif
-+ if (procs != NULL && numEntries > 0) {
-+ for (int i = 0; i < numEntries; i++) {
-+ if (exe != procs[i].p_comm) continue;
-+ if (filter && !filter->Includes(procs[i].p_pid, procs[i].p_ppid)) continue;
-+ ProcessEntry e;
-+ e.pid = procs[i].p_pid;
-+ e.ppid = procs[i].p_ppid;
-+ strlcpy(e.szExeFile, procs[i].p_comm, sizeof e.szExeFile);
-+ content.push_back(e);
-+#endif
-+ }
-+ }
-+ nextEntry = 0;
-+ kvm_close(kvm);
-+}
-+
-+NamedProcessIterator::~NamedProcessIterator() {
-+}
-+
-+const ProcessEntry* NamedProcessIterator::NextProcessEntry() {
-+ if (nextEntry >= content.size()) return NULL;
-+ return &content[nextEntry++];
-+}
-+
-+bool ProcessMetrics::GetIOCounters(IoCounters* io_counters) const {
-+ return false;
-+}
-+
-+} // namespace base
-$NetBSD: patch-ipc_chromium_src_base_process__util__posix.cc,v 1.1 2012/03/06 12:34:09 ryoon Exp $
-
---- ipc/chromium/src/base/process_util_posix.cc.orig 2011-12-20 23:28:19.000000000 +0000
-+++ ipc/chromium/src/base/process_util_posix.cc
-@@ -116,6 +116,11 @@ void CloseSuperfluousFds(const base::Inj
- #elif defined(OS_MACOSX)
- static const rlim_t kSystemDefaultMaxFds = 256;
- static const char kFDDir[] = "/dev/fd";
-+#elif defined(OS_BSD)
-+ // the getrlimit below should never fail, so whatever ..
-+ static const rlim_t kSystemDefaultMaxFds = 1024;
-+ // at least /dev/fd will exist
-+ static const char kFDDir[] = "/dev/fd";
- #endif
-
- // Get the maximum number of FDs possible.
-@@ -199,7 +204,7 @@ void CloseSuperfluousFds(const base::Inj
- void SetAllFDsToCloseOnExec() {
- #if defined(OS_LINUX)
- const char fd_dir[] = "/proc/self/fd";
--#elif defined(OS_MACOSX)
-+#elif defined(OS_MACOSX) || defined(OS_BSD)
- const char fd_dir[] = "/dev/fd";
- #endif
- ScopedDIR dir_closer(opendir(fd_dir));
-$NetBSD: patch-ipc_chromium_src_base_sys__info__posix.cc,v 1.2 2011/11/27 13:09:00 tnn Exp $
-
---- ipc/chromium/src/base/sys_info_posix.cc.orig 2011-11-04 21:34:00.000000000 +0000
-+++ ipc/chromium/src/base/sys_info_posix.cc
-@@ -18,6 +18,11 @@
- #include <mach/mach_init.h>
- #endif
-
-+#if defined(OS_NETBSD)
-+#include <sys/param.h>
-+#include <sys/sysctl.h>
-+#endif
-+
- #include "base/logging.h"
- #include "base/string_util.h"
-
-@@ -26,7 +31,11 @@ namespace base {
- int SysInfo::NumberOfProcessors() {
- // It seems that sysconf returns the number of "logical" processors on both
- // mac and linux. So we get the number of "online logical" processors.
-+#ifdef _SC_NPROCESSORS_ONLN
- static long res = sysconf(_SC_NPROCESSORS_ONLN);
-+#else
-+ static long res = 1;
-+#endif
- if (res == -1) {
- NOTREACHED();
- return 1;
-@@ -52,6 +61,20 @@ int64 SysInfo::AmountOfPhysicalMemory()
- }
-
- return static_cast<int64>(hostinfo.max_mem);
-+#elif defined(OS_NETBSD)
-+ int mib[2];
-+ int rc;
-+ int64_t memSize;
-+ size_t len = sizeof(memSize);
-+
-+ mib[0] = CTL_HW;
-+ mib[1] = HW_PHYSMEM64;
-+ rc = sysctl( mib, 2, &memSize, &len, NULL, 0 );
-+ if (-1 != rc) {
-+ return memSize;
-+ }
-+ return 0;
-+
- #else
- long pages = sysconf(_SC_PHYS_PAGES);
- long page_size = sysconf(_SC_PAGE_SIZE);
-diff --git ipc/chromium/src/base/time_posix.cc ipc/chromium/src/base/time_posix.cc
-index abf2a56..48791f6 100644
---- ipc/chromium/src/base/time_posix.cc
-+++ ipc/chromium/src/base/time_posix.cc
-@@ -167,7 +167,7 @@ TimeTicks TimeTicks::Now() {
- // With numer and denom = 1 (the expected case), the 64-bit absolute time
- // reported in nanoseconds is enough to last nearly 585 years.
-
--#elif defined(__OpenBSD__) || defined(OS_POSIX) && \
-+#elif defined(OS_OPENBSD) || defined(OS_POSIX) && \
- defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0
-
- struct timespec ts;
-$NetBSD: patch-ipc_chromium_src_build_build__config.h,v 1.4 2012/04/01 15:18:45 ryoon Exp $
-
---- ipc/chromium/src/build/build_config.h.orig 2012-03-13 01:36:53.000000000 +0000
-+++ ipc/chromium/src/build/build_config.h
-@@ -19,6 +19,12 @@
- #define OS_MACOSX 1
- #elif defined(__linux__) || defined(ANDROID)
- #define OS_LINUX 1
-+#elif defined(__DragonFly__)
-+#define OS_DRAGONFLY 1
-+#elif defined(__FreeBSD__)
-+#define OS_FREEBSD 1
-+#elif defined(__NetBSD__)
-+#define OS_NETBSD 1
- #elif defined(__OpenBSD__)
- #define OS_OPENBSD 1
- #elif defined(_WIN32)
-@@ -27,9 +33,16 @@
- #error Please add support for your platform in build/build_config.h
- #endif
-
-+// For access to standard BSD features, use OS_BSD instead of a
-+// more specific macro.
-+#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD) \
-+ || defined(OS_NETBSD) || defined(OS_OPENBSD)
-+#define OS_BSD 1
-+#endif
-+
- // For access to standard POSIX features, use OS_POSIX instead of a more
- // specific macro.
--#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_OPENBSD)
-+#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD)
- #define OS_POSIX 1
- #endif
-
-diff --git ipc/chromium/src/chrome/common/ipc_channel_posix.cc ipc/chromium/src/chrome/common/ipc_channel_posix.cc
-index bd866ee..2ea5b19 100644
---- ipc/chromium/src/chrome/common/ipc_channel_posix.cc
-+++ ipc/chromium/src/chrome/common/ipc_channel_posix.cc
-@@ -7,6 +7,7 @@
- #include <errno.h>
- #include <fcntl.h>
- #include <stddef.h>
-+#include <unistd.h>
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <sys/stat.h>
-$NetBSD: patch-ipc_chromium_src_chrome_common_ipc__channel__posix.h,v 1.1 2011/07/11 12:46:14 tnn Exp $
-
---- ipc/chromium/src/chrome/common/ipc_channel_posix.h.orig 2011-06-15 21:57:27.000000000 +0000
-+++ ipc/chromium/src/chrome/common/ipc_channel_posix.h
-@@ -92,7 +92,7 @@ class Channel::ChannelImpl : public Mess
- };
-
- // This is a control message buffer large enough to hold kMaxReadFDs
--#if defined(OS_MACOSX)
-+#if defined(OS_MACOSX) || defined(OS_NETBSD)
- // TODO(agl): OSX appears to have non-constant CMSG macros!
- char input_cmsg_buf_[1024];
- #else
-$NetBSD: patch-ipc_chromium_src_chrome_common_ipc__message__utils.h,v 1.1 2012/03/06 12:34:09 ryoon Exp $
-
---- ipc/chromium/src/chrome/common/ipc_message_utils.h.orig 2011-12-20 23:28:19.000000000 +0000
-+++ ipc/chromium/src/chrome/common/ipc_message_utils.h
-@@ -195,7 +195,7 @@
- };
- #endif
-
--#if !(defined(OS_MACOSX) || defined(OS_OPENBSD) || defined(OS_WIN) || (defined(OS_LINUX) && defined(ARCH_CPU_64_BITS)) || defined(ARCH_CPU_S390))
-+#if !(defined(OS_MACOSX) || defined(OS_OPENBSD) || defined(OS_WIN) || ((defined(OS_BSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS)) || defined(ARCH_CPU_S390))
- // There size_t is a synonym for |unsigned long| ...
- template <>
- struct ParamTraits<size_t> {
-@@ -248,7 +248,7 @@
- };
- #endif // defined(OS_MACOSX)
-
--#if !(defined(OS_LINUX) && defined(ARCH_CPU_64_BITS))
-+#if !((defined(OS_BSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS))
- // int64 is |long int| on 64-bit systems, uint64 is |unsigned long|
- template <>
- struct ParamTraits<int64> {
-$NetBSD: patch-ipc_chromium_src_chrome_common_transport__dib.h,v 1.1 2012/03/06 12:34:09 ryoon Exp $
-
---- ipc/chromium/src/chrome/common/transport_dib.h.orig 2011-12-20 23:28:19.000000000 +0000
-+++ ipc/chromium/src/chrome/common/transport_dib.h
-@@ -7,7 +7,7 @@
-
- #include "base/basictypes.h"
-
--#if defined(OS_WIN) || defined(OS_MACOSX)
-+#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_BSD)
- #include "base/shared_memory.h"
- #endif
-
-@@ -66,7 +66,7 @@ class TransportDIB {
- uint32 sequence_num;
- };
- typedef HandleAndSequenceNum Id;
--#elif defined(OS_MACOSX)
-+#elif defined(OS_MACOSX) || defined(OS_BSD)
- typedef base::SharedMemoryHandle Handle;
- // On Mac, the inode number of the backing file is used as an id.
- typedef base::SharedMemoryId Id;
-@@ -108,7 +108,7 @@ class TransportDIB {
-
- private:
- TransportDIB();
--#if defined(OS_WIN) || defined(OS_MACOSX)
-+#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_BSD)
- explicit TransportDIB(base::SharedMemoryHandle dib);
- base::SharedMemory shared_memory_;
- uint32 sequence_num_;
-$NetBSD: patch-ipc_glue_GeckoChildProcessHost.cpp,v 1.2 2012/03/15 08:30:06 ryoon Exp $
-
---- ipc/glue/GeckoChildProcessHost.cpp.orig 2011-12-20 23:28:19.000000000 +0000
-+++ ipc/glue/GeckoChildProcessHost.cpp
-@@ -430,7 +430,7 @@
- // and passing wstrings from one config to the other is unsafe. So
- // we split the logic here.
-
--#if defined(OS_LINUX) || defined(OS_MACOSX)
-+#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_BSD)
- base::environment_map newEnvVars;
- // XPCOM may not be initialized in some subprocesses. We don't want
- // to initialize XPCOM just for the directory service, especially
-@@ -445,8 +445,8 @@
- if (NS_SUCCEEDED(rv)) {
- nsCString path;
- greDir->GetNativePath(path);
--# ifdef OS_LINUX
--# ifdef MOZ_WIDGET_ANDROID
-+# if defined(OS_LINUX) || defined(OS_BSD)
-+# if defined(MOZ_WIDGET_ANDROID) || defined(OS_BSD)
- path += "/lib";
- # endif // MOZ_WIDGET_ANDROID
- const char *ld_library_path = PR_GetEnv("LD_LIBRARY_PATH");
-@@ -557,7 +557,7 @@
- childArgv.push_back(pidstring);
-
- #if defined(MOZ_CRASHREPORTER)
--# if defined(OS_LINUX)
-+# if defined(OS_LINUX) || defined(OS_BSD)
- int childCrashFd, childCrashRemapFd;
- if (!CrashReporter::CreateNotificationPipeForChild(
- &childCrashFd, &childCrashRemapFd))
-@@ -594,7 +594,7 @@
- #endif
-
- base::LaunchApp(childArgv, mFileMap,
--#if defined(OS_LINUX) || defined(OS_MACOSX)
-+#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_BSD)
- newEnvVars, privs,
- #endif
- false, &process, arch);
-diff --git ipc/glue/SharedMemorySysV.h ipc/glue/SharedMemorySysV.h
-index f37998d..b05dc7b 100644
---- ipc/glue/SharedMemorySysV.h
-+++ ipc/glue/SharedMemorySysV.h
-@@ -8,7 +8,7 @@
- #ifndef mozilla_ipc_SharedMemorySysV_h
- #define mozilla_ipc_SharedMemorySysV_h
-
--#if defined(OS_LINUX) && !defined(ANDROID)
-+#if (defined(OS_LINUX) && !defined(ANDROID)) || defined(OS_BSD)
-
- // SysV shared memory isn't available on Windows, but we define the
- // following macro so that #ifdefs are clearer (compared to #ifdef
-$NetBSD: patch-mm,v 1.13 2012/06/05 18:09:21 ryoon Exp $
-
---- toolkit/library/Makefile.in.orig 2012-05-23 18:57:09.000000000 +0000
-+++ toolkit/library/Makefile.in
-@@ -534,6 +538,12 @@ EXTRA_DSO_LDOPTS += -lelf -ldemangle
- endif
- endif
-
-+ifneq (,$(filter DragonFly FreeBSD NetBSD OpenBSD,$(OS_ARCH)))
-+OS_LIBS += $(call EXPAND_LIBNAME,kvm)
-+# keep `environ' unresolved, see bug 14426 for binutils
-+EXTRA_DSO_LDOPTS += -Wl,--warn-unresolved-symbols
-+endif
-+
- ifeq ($(OS_ARCH),WINNT)
- OS_LIBS += $(call EXPAND_LIBNAME,shell32 ole32 version winspool comdlg32 imm32 msimg32 shlwapi psapi ws2_32 dbghelp rasapi32 rasdlg iphlpapi uxtheme setupapi secur32 sensorsapi portabledeviceguids windowscodecs wininet)
- ifdef ACCESSIBILITY
diff --git a/www/firefox-esr/files/patch-bug778078 b/www/firefox-esr/files/patch-bug778078
deleted file mode 100644
index f7bedeb8053c..000000000000
--- a/www/firefox-esr/files/patch-bug778078
+++ /dev/null
@@ -1,11 +0,0 @@
---- toolkit/xre/nsAppRunner.cpp~
-+++ toolkit/xre/nsAppRunner.cpp
-@@ -3833,7 +3833,7 @@ XREMain::XRE_main(int argc, char* argv[]
- ScopedLogging log;
-
- #if defined(MOZ_WIDGET_GTK)
--#ifdef MOZ_MEMORY
-+#if defined(MOZ_MEMORY) || defined(__FreeBSD__) || defined(__NetBSD__)
- // Disable the slice allocator, since jemalloc already uses similar layout
- // algorithms, and using a sub-allocator tends to increase fragmentation.
- // This must be done before g_thread_init() is called.
diff --git a/www/firefox-esr/files/patch-bug783463 b/www/firefox-esr/files/patch-bug783463
index b27a1997c534..dedbb7003927 100644
--- a/www/firefox-esr/files/patch-bug783463
+++ b/www/firefox-esr/files/patch-bug783463
@@ -1,14 +1,14 @@
---- gfx/skia/Makefile.in~
-+++ gfx/skia/Makefile.in
-@@ -339,10 +339,9 @@ CPPSRCS += \
- SkMMapStream.cpp \
- SkOSFile.cpp \
- $(NULL)
--ifeq (Linux,$(OS_TARGET))
-+ifneq (,$(or $(MOZ_X11),$(filter Linux,$(OS_TARGET))))
- CPPSRCS += \
- SkFontHost_linux.cpp \
-- SkFontHost_tables.cpp \
- SkTime_Unix.cpp \
- $(NULL)
- endif
+--- gfx/skia/moz.build~
++++ 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/firefox-esr/files/patch-bug784631 b/www/firefox-esr/files/patch-bug784631
deleted file mode 100644
index 2c8a1560b877..000000000000
--- a/www/firefox-esr/files/patch-bug784631
+++ /dev/null
@@ -1,52 +0,0 @@
-commit 66b3921
-Author: Terrence Cole <terrence@mozilla.com>
-Date: Tue Sep 11 12:31:04 2012 -0700
-
- Bug 784631 - Fix some clang build errors in SpiderMonkey; r=Waldo f=espindola
-
- Computed gotos are not in the C++ standard: clang and gcc differ on semantics.
----
- js/src/jsinterp.cpp | 3 ++-
- js/src/jsutil.h | 8 ++++----
- 2 files changed, 6 insertions(+), 5 deletions(-)
-
-diff --git js/src/jsinterp.cpp js/src/jsinterp.cpp
-index 0094c72..27a64a7 100644
---- js/src/jsinterp.cpp
-+++ js/src/jsinterp.cpp
-@@ -1231,6 +1231,7 @@ js::Interpret(JSContext *cx, StackFrame *entryFrame, InterpMode interpMode)
- RootedPropertyName rootName0(cx);
- RootedId rootId0(cx);
- RootedShape rootShape0(cx);
-+ DebugOnly<uint32_t> blockDepth;
-
- if (!entryFrame)
- entryFrame = regs.fp();
-@@ -3650,7 +3651,7 @@ BEGIN_CASE(JSOP_LEAVEBLOCK)
- BEGIN_CASE(JSOP_LEAVEFORLETIN)
- BEGIN_CASE(JSOP_LEAVEBLOCKEXPR)
- {
-- DebugOnly<uint32_t> blockDepth = regs.fp()->blockChain().stackDepth();
-+ blockDepth = regs.fp()->blockChain().stackDepth();
-
- regs.fp()->popBlock(cx);
-
-diff --git js/src/jsutil.h js/src/jsutil.h
-index 8838b6f..016a877 100644
---- js/src/jsutil.h
-+++ js/src/jsutil.h
-@@ -432,10 +432,10 @@ typedef size_t jsbitmap;
- #if defined(__clang__)
- # define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr) \
- JS_BEGIN_MACRO \
-- _Pragma("clang diagnostic push") \
-- _Pragma("clang diagnostic ignored \"-Wunused-value\"") \
-- expr; \
-- _Pragma("clang diagnostic pop") \
-+ _Pragma("(clang diagnostic push)") \
-+ _Pragma("(clang diagnostic ignored \"-Wunused-value\")") \
-+ {expr;} \
-+ _Pragma("(clang diagnostic pop)") \
- JS_END_MACRO
- #elif (__GNUC__ >= 5) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
- # define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr) \
diff --git a/www/firefox-esr/files/patch-bug786995 b/www/firefox-esr/files/patch-bug786995
deleted file mode 100644
index 85b3abcc3d13..000000000000
--- a/www/firefox-esr/files/patch-bug786995
+++ /dev/null
@@ -1,36 +0,0 @@
-# Bug 786995 - configure should check for SSSE3 support in the whole toolchain
-
---- configure.in.orig 2012-09-02 00:37:29.000000000 +0200
-+++ configure.in 2012-09-02 00:38:50.000000000 +0200
-@@ -1710,15 +1710,15 @@
- _MOZ_RTTI_FLAGS_OFF=-fno-rtti
-
- # Check for -mssse3 on $CC
-- AC_MSG_CHECKING([for -mssse3 option to $CC])
-- HAVE_COMPILER_FLAG_MSSSE3=
-+ AC_MSG_CHECKING([if toolchain supports -mssse3 option])
-+ HAVE_TOOLCHAIN_SUPPORT_MSSSE3=
- _SAVE_CFLAGS=$CFLAGS
- CFLAGS="$CFLAGS -mssse3"
-- AC_TRY_COMPILE(,,AC_MSG_RESULT([yes])
-- [HAVE_COMPILER_FLAG_MSSSE3=1],
-+ AC_TRY_COMPILE([asm ("pmaddubsw %xmm2,%xmm3");],,AC_MSG_RESULT([yes])
-+ [HAVE_TOOLCHAIN_SUPPORT_MSSSE3=1],
- AC_MSG_RESULT([no]))
- CFLAGS=$_SAVE_CFLAGS
-- AC_SUBST(HAVE_COMPILER_FLAG_MSSSE3)
-+ AC_SUBST(HAVE_TOOLCHAIN_SUPPORT_MSSSE3)
-
- # Turn on GNU-specific warnings:
- # -Wall - turn on a lot of warnings
---- gfx/skia/Makefile.in.orig 2012-09-02 00:39:00.000000000 +0200
-+++ gfx/skia/Makefile.in 2012-09-02 00:39:21.000000000 +0200
-@@ -365,7 +365,7 @@
- SkUtils_opts_SSE2.cpp \
- opts_check_SSE2.cpp \
- $(NULL)
--ifdef HAVE_COMPILER_FLAG_MSSSE3
-+ifdef HAVE_TOOLCHAIN_SUPPORT_MSSSE3
- DEFINES += -DSK_BUILD_SSSE3
- CPPSRCS += SkBitmapProcState_opts_SSSE3.cpp
- endif
diff --git a/www/firefox-esr/files/patch-bug787904 b/www/firefox-esr/files/patch-bug787904
deleted file mode 100644
index 55f7a6046813..000000000000
--- a/www/firefox-esr/files/patch-bug787904
+++ /dev/null
@@ -1,12 +0,0 @@
---- js/src/gc/Heap.h
-+++ js/src/gc/Heap.h
-@@ -108,7 +108,8 @@ struct Cell
- * Bug 692267: Move page size definition to gc/Memory.h and include it
- * directly once jsgc.h is no longer an installed header.
- */
--#if defined(SOLARIS) && (defined(__sparc) || defined(__sparcv9))
-+#if (defined(SOLARIS) || defined(__FreeBSD__)) && \
-+ (defined(__sparc) || defined(__sparcv9) || defined(__ia64))
- const size_t PageShift = 13;
- #else
- const size_t PageShift = 12;
diff --git a/www/firefox-esr/files/patch-bug788039 b/www/firefox-esr/files/patch-bug788039
deleted file mode 100644
index a678de2eab4f..000000000000
--- a/www/firefox-esr/files/patch-bug788039
+++ /dev/null
@@ -1,48 +0,0 @@
-# Bug 788039 - With no prefix search libevent via pkg-config.
-
---- configure.in~
-+++ configure.in
-@@ -3854,7 +3854,7 @@ fi
- dnl system libevent Support
- dnl ========================================================
- MOZ_ARG_WITH_STRING(system-libevent,
--[ --with-system-libevent=[PFX]
-+[ --with-system-libevent[=PFX]
- Use system libevent [installed at prefix PFX]],
- LIBEVENT_DIR=$withval)
-
-@@ -3863,10 +3863,11 @@ _SAVE_LDFLAGS=$LDFLAGS
- _SAVE_LIBS=$LIBS
- if test -z "$LIBEVENT_DIR" -o "$LIBEVENT_DIR" = no; then
- MOZ_NATIVE_LIBEVENT=
-+elif test "$LIBEVENT_DIR" = yes; then
-+ PKG_CHECK_MODULES(MOZ_LIBEVENT, libevent,
-+ MOZ_NATIVE_LIBEVENT=1,
-+ AC_MSG_ERROR([--with-system-libevent requested but libevent package not found]))
- else
-- if test "${LIBEVENT_DIR}" = "yes"; then
-- LIBEVENT_DIR=/usr
-- fi
- CFLAGS="-I${LIBEVENT_DIR}/include $CFLAGS"
- LDFLAGS="-L${LIBEVENT_DIR}/lib $LDFLAGS"
- MOZ_CHECK_HEADER(event.h,
-@@ -3876,16 +3877,16 @@ else
- AC_MSG_ERROR([--with-system-libevent requested but event.h not found]))
- AC_CHECK_LIB(event, event_init,
- [MOZ_NATIVE_LIBEVENT=1
-- MOZ_LIBEVENT_INCLUDES="${LIBEVENT_DIR}/include"
-+ MOZ_LIBEVENT_CFLAGS="-I${LIBEVENT_DIR}/include"
- MOZ_LIBEVENT_LIBS="-L${LIBEVENT_DIR}/lib -levent"],
-- [MOZ_NATIVE_LIBEVENT= MOZ_LIBEVENT_INCLUDES= MOZ_LIBEVENT_LIBS=])
-+ [MOZ_NATIVE_LIBEVENT= MOZ_LIBEVENT_CFLAGS= MOZ_LIBEVENT_LIBS=])
- fi
- CFLAGS=$_SAVE_CFLAGS
- LDFLAGS=$_SAVE_LDFLAGS
- LIBS=$_SAVE_LIBS
-
- AC_SUBST(MOZ_NATIVE_LIBEVENT)
--AC_SUBST(MOZ_LIBEVENT_INCLUDES)
-+AC_SUBST(MOZ_LIBEVENT_CFLAGS)
- AC_SUBST(MOZ_LIBEVENT_LIBS)
-
- dnl ========================================================
diff --git a/www/firefox-esr/files/patch-bug788108 b/www/firefox-esr/files/patch-bug788108
deleted file mode 100644
index 80ff18649882..000000000000
--- a/www/firefox-esr/files/patch-bug788108
+++ /dev/null
@@ -1,20 +0,0 @@
---- content/base/public/nsContentUtils.h~
-+++ content/base/public/nsContentUtils.h
-@@ -18,17 +18,6 @@
- #include <ieeefp.h>
- #endif
-
--//A trick to handle IEEE floating point exceptions on FreeBSD - E.D.
--#ifdef __FreeBSD__
--#include <ieeefp.h>
--#if !defined(__i386__) && !defined(__x86_64__)
--static fp_except_t allmask = FP_X_INV|FP_X_OFL|FP_X_UFL|FP_X_DZ|FP_X_IMP;
--#else
--static fp_except_t allmask = FP_X_INV|FP_X_OFL|FP_X_UFL|FP_X_DZ|FP_X_IMP|FP_X_DNML;
--#endif
--static fp_except_t oldmask = fpsetmask(~allmask);
--#endif
--
- #include "nsAString.h"
- #include "nsIStatefulFrame.h"
- #include "nsNodeInfoManager.h"
diff --git a/www/firefox-esr/files/patch-bug788955 b/www/firefox-esr/files/patch-bug788955
deleted file mode 100644
index 57c5f12d7ed4..000000000000
--- a/www/firefox-esr/files/patch-bug788955
+++ /dev/null
@@ -1,299 +0,0 @@
-diff --git Makefile.in Makefile.in
-index e341462..f75bd55 100644
---- Makefile.in
-+++ Makefile.in
-@@ -48,8 +48,10 @@ endif
- ifdef MOZ_MEMORY
- tier_base_dirs += memory/mozjemalloc
- ifdef MOZ_JEMALLOC
-+ifndef MOZ_NATIVE_JEMALLOC
- tier_base_dirs += memory/jemalloc
- endif
-+endif
- tier_base_dirs += memory/build
- endif
- ifndef MOZ_NATIVE_ZLIB
-diff --git allmakefiles.sh allmakefiles.sh
-index 6a9be4b..d2e49e3 100755
---- allmakefiles.sh
-+++ allmakefiles.sh
-@@ -59,7 +59,7 @@ if [ ! "$LIBXUL_SDK" ]; then
- mozglue/Makefile
- mozglue/build/Makefile
- "
-- if [ "$MOZ_JEMALLOC" ]; then
-+ if [ "$MOZ_JEMALLOC" -a -z "$MOZ_NATIVE_JEMALLOC" ]; then
- add_makefiles "
- memory/jemalloc/Makefile
- "
-diff --git configure.in configure.in
-index bb05782..2f32516 100644
---- configure.in
-+++ configure.in
-@@ -3711,21 +3711,22 @@ fi
-
- dnl Check for the existence of various allocation headers/functions
-
-+MALLOC_HEADERS="malloc.h malloc_np.h malloc/malloc.h sys/malloc.h"
- MALLOC_H=
--MOZ_CHECK_HEADER(malloc.h, [MALLOC_H=malloc.h])
--if test "$MALLOC_H" = ""; then
-- MOZ_CHECK_HEADER(malloc/malloc.h, [MALLOC_H=malloc/malloc.h])
-- if test "$MALLOC_H" = ""; then
-- MOZ_CHECK_HEADER(sys/malloc.h, [MALLOC_H=sys/malloc.h])
-+
-+for file in $MALLOC_HEADERS; do
-+ MOZ_CHECK_HEADER($file, [MALLOC_H=$file])
-+ if test "$MALLOC_H" != ""; then
-+ AC_DEFINE_UNQUOTED(MALLOC_H, <$MALLOC_H>)
-+ break
- fi
--fi
--if test "$MALLOC_H" != ""; then
-- AC_DEFINE_UNQUOTED(MALLOC_H, <$MALLOC_H>)
--fi
-+done
-
- MOZ_ALLOCATING_FUNCS="strndup posix_memalign memalign valloc"
- AC_CHECK_FUNCS(strndup posix_memalign memalign valloc)
-
-+AC_CHECK_FUNCS(malloc_usable_size)
-+
- dnl See if compiler supports some gcc-style attributes
-
- AC_CACHE_CHECK(for __attribute__((always_inline)),
-@@ -6939,6 +6940,18 @@ else
- fi
-
- if test -z "$MOZ_MEMORY"; then
-+ if test -n "$MOZ_JEMALLOC"; then
-+ MOZ_NATIVE_JEMALLOC=1
-+ AC_CHECK_FUNCS(mallctl nallocm,,
-+ [MOZ_NATIVE_JEMALLOC=
-+ break])
-+ if test -n "$MOZ_NATIVE_JEMALLOC"; then
-+ MOZ_MEMORY=1
-+ AC_DEFINE(MOZ_MEMORY)
-+ AC_DEFINE(MOZ_JEMALLOC)
-+ AC_DEFINE(MOZ_NATIVE_JEMALLOC)
-+ fi
-+ fi
- case "${target}" in
- *-mingw*)
- if test -z "$WIN32_REDIST_DIR" -a -z "$MOZ_DEBUG"; then
-@@ -7033,6 +7046,7 @@ else
- fi # MOZ_MEMORY
- AC_SUBST(MOZ_MEMORY)
- AC_SUBST(MOZ_JEMALLOC)
-+AC_SUBST(MOZ_NATIVE_JEMALLOC)
- AC_SUBST(MOZ_GLUE_LDFLAGS)
- AC_SUBST(MOZ_GLUE_PROGRAM_LDFLAGS)
- AC_SUBST(WIN32_CRT_LIBS)
-@@ -8820,10 +8834,22 @@ fi
-
- # Run jemalloc configure script
-
--if test "$MOZ_JEMALLOC" -a "$MOZ_MEMORY"; then
-+if test -z "$MOZ_NATIVE_JEMALLOC" -a "$MOZ_JEMALLOC" -a "$MOZ_MEMORY" ; then
- ac_configure_args="$_SUBDIR_CONFIG_ARGS --build=$build --host=$target --enable-stats --with-jemalloc-prefix=je_"
-- if test "$OS_ARCH" = "Linux"; then
-- MANGLE="malloc calloc valloc free realloc memalign posix_memalign malloc_usable_size"
-+ case "$OS_ARCH" in
-+ Linux|DragonFly|FreeBSD|NetBSD|OpenBSD)
-+ MANGLE="malloc calloc valloc free realloc posix_memalign"
-+ case "$OS_ARCH" in
-+ Linux)
-+ MANGLE="$MANGLE memalign malloc_usable_size"
-+ ;;
-+ FreeBSD)
-+ MANGLE="$MANGLE malloc_usable_size"
-+ ;;
-+ esac
-+ ;;
-+ esac
-+ if test -n "$MANGLE"; then
- MANGLED=
- JEMALLOC_WRAPPER=
- if test -n "$_WRAP_MALLOC"; then
-diff --git memory/build/Makefile.in memory/build/Makefile.in
-index dca0f48..af93ee0 100644
---- memory/build/Makefile.in
-+++ memory/build/Makefile.in
-@@ -22,7 +22,9 @@ CSRCS = extraMallocFuncs.c
-
- ifdef MOZ_JEMALLOC
- CSRCS += mozjemalloc_compat.c
-+ifndef MOZ_NATIVE_JEMALLOC
- SHARED_LIBRARY_LIBS += $(call EXPAND_LIBNAME_PATH,jemalloc,$(DEPTH)/memory/jemalloc)
-+endif
- else
- SHARED_LIBRARY_LIBS += $(call EXPAND_LIBNAME_PATH,jemalloc,$(DEPTH)/memory/mozjemalloc)
- endif
-diff --git memory/build/extraMallocFuncs.c memory/build/extraMallocFuncs.c
-index 9d87629..03c8320 100644
---- memory/build/extraMallocFuncs.c
-+++ memory/build/extraMallocFuncs.c
-@@ -94,8 +94,16 @@ wrap(wcsdup)(const wchar_t *src)
- #endif
-
- #ifdef MOZ_JEMALLOC
-+
-+#undef wrap
-+#if defined(MOZ_NATIVE_JEMALLOC)
-+#define wrap(a) a
-+#else
-+#define wrap(a) je_ ## a
-+#endif
-+
- /* Override some jemalloc defaults */
--const char *je_malloc_conf = "narenas:1,lg_chunk:20";
-+MOZ_EXPORT_DATA(const char *) wrap(malloc_conf) = "narenas:1,lg_chunk:20";
-
- #ifdef ANDROID
- #include <android/log.h>
-diff --git memory/build/mozjemalloc_compat.c memory/build/mozjemalloc_compat.c
-index 10a845a..94ad96e 100644
---- memory/build/mozjemalloc_compat.c
-+++ memory/build/mozjemalloc_compat.c
-@@ -5,14 +5,21 @@
- #include "mozilla/Types.h"
- #include "jemalloc_types.h"
-
--extern int je_mallctl(const char*, void*, size_t*, void*, size_t);
-+#if defined(MOZ_NATIVE_JEMALLOC)
-+#define wrap(a) a
-+#else
-+#define wrap(a) je_ ## a
-+#endif
-
--MOZ_EXPORT_API (void)
-+extern MOZ_IMPORT_API(int)
-+wrap(mallctl)(const char*, void*, size_t*, void*, size_t);
-+
-+MOZ_EXPORT_API(void)
- jemalloc_stats(jemalloc_stats_t *stats)
- {
- size_t size = sizeof(stats->mapped);
-- je_mallctl("stats.mapped", &stats->mapped, &size, NULL, 0);
-- je_mallctl("stats.allocated", &stats->allocated, &size, NULL, 0);
-+ wrap(mallctl)("stats.mapped", &stats->mapped, &size, NULL, 0);
-+ wrap(mallctl)("stats.allocated", &stats->allocated, &size, NULL, 0);
- stats->committed = -1;
- stats->dirty = -1;
- }
-diff --git memory/jemalloc/src/src/mutex.c memory/jemalloc/src/src/mutex.c
-index 37a843e..55e18c2 100644
---- memory/jemalloc/src/src/mutex.c
-+++ memory/jemalloc/src/src/mutex.c
-@@ -64,7 +64,7 @@ pthread_create(pthread_t *__restrict thread,
- /******************************************************************************/
-
- #ifdef JEMALLOC_MUTEX_INIT_CB
--int _pthread_mutex_init_calloc_cb(pthread_mutex_t *mutex,
-+JEMALLOC_EXPORT int _pthread_mutex_init_calloc_cb(pthread_mutex_t *mutex,
- void *(calloc_cb)(size_t, size_t));
- #endif
-
-diff --git memory/mozalloc/mozalloc.cpp memory/mozalloc/mozalloc.cpp
-index 5b61050b..5b3399a 100644
---- memory/mozalloc/mozalloc.cpp
-+++ memory/mozalloc/mozalloc.cpp
-@@ -12,16 +12,13 @@
- #include <sys/types.h>
-
- #if defined(MALLOC_H)
--# include MALLOC_H // for memalign, valloc where available
-+# include MALLOC_H // for memalign, valloc, malloc_size, malloc_usable_size
- #endif // if defined(MALLOC_H)
- #include <stddef.h> // for size_t
- #include <stdlib.h> // for malloc, free
- #if defined(XP_UNIX)
- # include <unistd.h> // for valloc on *BSD
- #endif //if defined(XP_UNIX)
--#if defined(__FreeBSD__)
--# include <malloc_np.h> // for malloc_usable_size
--#endif // if defined(__FreeBSD__)
-
- #if defined(XP_WIN) || (defined(XP_OS2) && defined(__declspec))
- # define MOZALLOC_EXPORT __declspec(dllexport)
-@@ -213,8 +210,7 @@ moz_malloc_usable_size(void *ptr)
-
- #if defined(XP_MACOSX)
- return malloc_size(ptr);
--#elif defined(MOZ_MEMORY) || (defined(XP_LINUX) && !defined(ANDROID)) || defined(__FreeBSD__)
-- // Android bionic libc doesn't have malloc_usable_size.
-+#elif defined(HAVE_MALLOC_USABLE_SIZE) || defined(MOZ_MEMORY)
- return malloc_usable_size(ptr);
- #elif defined(XP_WIN)
- return _msize(ptr);
-diff --git memory/mozjemalloc/jemalloc.h memory/mozjemalloc/jemalloc.h
-index f0e0878..2486e83 100644
---- memory/mozjemalloc/jemalloc.h
-+++ memory/mozjemalloc/jemalloc.h
-@@ -37,22 +37,29 @@
- #endif
- #include "jemalloc_types.h"
-
-+#if defined(MOZ_NATIVE_JEMALLOC)
-+#define wrap(a) a
-+#else
-+#define wrap(a) je_ ## a
-+#endif
-+
- #ifdef __cplusplus
- extern "C" {
- #endif
-
--#if defined(MOZ_MEMORY_LINUX)
-+#if defined(MOZ_NATIVE_JEMALLOC) \
-+ || defined(MOZ_MEMORY_LINUX) || defined(MOZ_MEMORY_BSD)
- __attribute__((weak))
- #endif
- void jemalloc_stats(jemalloc_stats_t *stats);
-
- /* Computes the usable size in advance. */
- #if !defined(MOZ_MEMORY_DARWIN)
--#if defined(MOZ_MEMORY_LINUX)
-+#if defined(MOZ_MEMORY_LINUX) || defined(MOZ_MEMORY_BSD)
- __attribute__((weak))
- #endif
- #if defined(MOZ_JEMALLOC)
--int je_nallocm(size_t *rsize, size_t size, int flags);
-+MOZ_IMPORT_API(int) wrap(nallocm)(size_t *rsize, size_t size, int flags);
- #else
- size_t je_malloc_good_size(size_t size);
- #endif
-@@ -62,11 +69,11 @@ static inline size_t je_malloc_usable_size_in_advance(size_t size) {
- #if defined(MOZ_MEMORY_DARWIN)
- return malloc_good_size(size);
- #elif defined(MOZ_JEMALLOC)
-- if (je_nallocm) {
-+ if (wrap(nallocm)) {
- size_t ret;
- if (size == 0)
- size = 1;
-- if (!je_nallocm(&ret, size, 0))
-+ if (!wrap(nallocm)(&ret, size, 0))
- return ret;
- }
- return size;
-@@ -113,4 +120,6 @@ void jemalloc_purge_freed_pages();
- } /* extern "C" */
- #endif
-
-+#undef wrap
-+
- #endif /* _JEMALLOC_H_ */
-diff --git mozglue/build/Makefile.in mozglue/build/Makefile.in
-index c333647..15ba505 100644
---- mozglue/build/Makefile.in
-+++ mozglue/build/Makefile.in
-@@ -23,7 +23,7 @@ FORCE_STATIC_LIB = 1
- endif
-
- # Keep jemalloc separated when mozglue is statically linked
--ifeq (1_1,$(MOZ_MEMORY)_$(FORCE_SHARED_LIB))
-+ifeq (1_1,$(MOZ_MEMORY)_$(or $(MOZ_NATIVE_JEMALLOC),$(FORCE_SHARED_LIB)))
- SHARED_LIBRARY_LIBS = $(call EXPAND_LIBNAME_PATH,memory,$(DEPTH)/memory/build)
- else
- # Temporary, until bug 662814 lands
diff --git a/www/firefox-esr/files/patch-bug789436 b/www/firefox-esr/files/patch-bug789436
deleted file mode 100644
index 6d1e7069b858..000000000000
--- a/www/firefox-esr/files/patch-bug789436
+++ /dev/null
@@ -1,27 +0,0 @@
---- toolkit/xre/nsAppRunner.cpp~
-+++ toolkit/xre/nsAppRunner.cpp
-@@ -1388,11 +1388,6 @@ static int MSCRTReportHook( int aReportType, char *aMessage, int *oReturnValue)
-
- #endif
-
--#if defined(FREEBSD)
--// pick up fpsetmask prototype.
--#include <ieeefp.h>
--#endif
--
- static inline void
- DumpVersion()
- {
-@@ -4136,12 +4131,5 @@ SetupErrorHandling(const char* progname)
-
- // Unbuffer stdout, needed for tinderbox tests.
- setbuf(stdout, 0);
--
--#if defined(FREEBSD)
-- // Disable all SIGFPE's on FreeBSD, as it has non-IEEE-conformant fp
-- // trap behavior that trips up on floating-point tests performed by
-- // the JS engine. See bugzilla bug 9967 details.
-- fpsetmask(0);
--#endif
- }
-
diff --git a/www/firefox-esr/files/patch-bug789656 b/www/firefox-esr/files/patch-bug789656
deleted file mode 100644
index ebc567ef27ac..000000000000
--- a/www/firefox-esr/files/patch-bug789656
+++ /dev/null
@@ -1,11 +0,0 @@
---- media/libopus/Makefile.in~
-+++ media/libopus/Makefile.in
-@@ -20,7 +20,7 @@ DEFINES += \
- -Drestrict= \
- $(NULL)
-
--ifneq ($(filter $(OS_ARCH),Linux Darwin),)
-+ifneq ($(filter $(OS_ARCH),Linux Darwin DragonFly FreeBSD NetBSD OpenBSD),)
- DEFINES += -DHAVE_LRINTF
- endif
- ifeq ($(OS_ARCH), WINNT)
diff --git a/www/firefox-esr/files/patch-bug789693 b/www/firefox-esr/files/patch-bug789693
deleted file mode 100644
index 1d2b790a35d5..000000000000
--- a/www/firefox-esr/files/patch-bug789693
+++ /dev/null
@@ -1,109 +0,0 @@
---- toolkit/components/startup/nsAppStartup.cpp
-+++ toolkit/components/startup/nsAppStartup.cpp
-@@ -50,18 +50,41 @@
- #include <sys/syscall.h>
- #endif
-
--#ifdef XP_MACOSX
-+#if defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \
-+ || defined(__NetBSD__) || defined(__OpenBSD__)
-+#include <sys/param.h>
- #include <sys/sysctl.h>
- #endif
-
--#ifdef __OpenBSD__
--#include <sys/param.h>
--#include <sys/sysctl.h>
-+#if defined(__DragonFly__) || defined(__FreeBSD__)
-+#include <sys/user.h>
- #endif
-
- #include "mozilla/Telemetry.h"
- #include "mozilla/StartupTimeline.h"
-
-+#if defined(__NetBSD__)
-+#undef KERN_PROC
-+#define KERN_PROC KERN_PROC2
-+#define KINFO_PROC struct kinfo_proc2
-+#else
-+#define KINFO_PROC struct kinfo_proc
-+#endif
-+
-+#if defined(XP_MACOSX)
-+#define KP_START_SEC kp_proc.p_un.__p_starttime.tv_sec
-+#define KP_START_USEC kp_proc.p_un.__p_starttime.tv_usec
-+#elif defined(__DragonFly__)
-+#define KP_START_SEC kp_start.tv_sec
-+#define KP_START_USEC kp_start.tv_usec
-+#elif defined(__FreeBSD__)
-+#define KP_START_SEC ki_start.tv_sec
-+#define KP_START_USEC ki_start.tv_usec
-+#else
-+#define KP_START_SEC p_ustart_sec
-+#define KP_START_USEC p_ustart_usec
-+#endif
-+
- static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);
-
- #define kPrefLastSuccess "toolkit.startup.last_success"
-@@ -836,42 +859,30 @@ CalculateProcessCreationTimestamp()
- #endif
- return timestamp;
- }
--#elif defined(XP_MACOSX)
-+#elif defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \
-+ || defined(__NetBSD__) || defined(__OpenBSD__)
- static PRTime
- CalculateProcessCreationTimestamp()
- {
-- int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid() };
-- size_t buffer_size;
-- if (sysctl(mib, 4, NULL, &buffer_size, NULL, 0))
-- return 0;
-+ int mib[] = {
-+ CTL_KERN,
-+ KERN_PROC,
-+ KERN_PROC_PID,
-+ getpid(),
-+#if defined(__NetBSD__) || defined(__OpenBSD__)
-+ sizeof(KINFO_PROC),
-+ 1,
-+#endif
-+ };
-+ u_int miblen = sizeof(mib) / sizeof(mib[0]);
-
-- struct kinfo_proc *proc = (kinfo_proc*) malloc(buffer_size);
-- if (sysctl(mib, 4, proc, &buffer_size, NULL, 0)) {
-- free(proc);
-- return 0;
-- }
-- PRTime starttime = static_cast<PRTime>(proc->kp_proc.p_un.__p_starttime.tv_sec) * PR_USEC_PER_SEC;
-- starttime += proc->kp_proc.p_un.__p_starttime.tv_usec;
-- free(proc);
-- return starttime;
--}
--#elif defined(__OpenBSD__)
--static PRTime
--CalculateProcessCreationTimestamp()
--{
-- int mib[6] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid(), sizeof(struct kinfo_proc), 1 };
-- size_t buffer_size;
-- if (sysctl(mib, 6, NULL, &buffer_size, NULL, 0))
-+ KINFO_PROC proc;
-+ size_t buffer_size = sizeof(proc);
-+ if (sysctl(mib, miblen, &proc, &buffer_size, NULL, 0))
- return 0;
-
-- struct kinfo_proc *proc = (struct kinfo_proc*) malloc(buffer_size);
-- if (sysctl(mib, 6, proc, &buffer_size, NULL, 0)) {
-- free(proc);
-- return 0;
-- }
-- PRTime starttime = static_cast<PRTime>(proc->p_ustart_sec) * PR_USEC_PER_SEC;
-- starttime += proc->p_ustart_usec;
-- free(proc);
-+ PRTime starttime = static_cast<PRTime>(proc.KP_START_SEC) * PR_USEC_PER_SEC;
-+ starttime += proc.KP_START_USEC;
- return starttime;
- }
- #else
diff --git a/www/firefox-esr/files/patch-bug791305 b/www/firefox-esr/files/patch-bug791305
index 534e7f2d9cac..ef75e4a17bb5 100644
--- a/www/firefox-esr/files/patch-bug791305
+++ b/www/firefox-esr/files/patch-bug791305
@@ -15,93 +15,383 @@ Date: Fri Sep 14 15:54:55 2012 -0400
image/decoders/nsJPEGDecoder.cpp | 311 ++-------------------------------------
2 files changed, 20 insertions(+), 297 deletions(-)
+diff --git configure.in configure.in
+index f0aeb5d..1c01010 100644
+--- configure.in
++++ configure.in
+@@ -4027,11 +4027,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
diff --git image/decoders/nsJPEGDecoder.cpp image/decoders/nsJPEGDecoder.cpp
-index c1fb515..1d2a259 100644
+index 8fa8200..1d2a259 100644
--- image/decoders/nsJPEGDecoder.cpp
+++ image/decoders/nsJPEGDecoder.cpp
-@@ -22,6 +22,13 @@
+@@ -21,13 +21,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
+ #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));
-@@ -34,6 +41,7 @@ METHODDEF(void)
- ycc_rgb_convert_argb (j_decompress_ptr cinfo,
- JSAMPIMAGE input_buf, JDIMENSION input_row,
- JSAMPARRAY output_buf, int num_rows);
++/* 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);
-@@ -329,7 +340,18 @@ nsJPEGDecoder::WriteInternal(const char *aBuffer, PRUint32 aCount)
+
+@@ -324,6 +340,7 @@ nsJPEGDecoder::WriteInternal(const char *aBuffer, uint32_t aCount)
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) {
-+ mInfo.out_color_space = MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB;
-+ mInfo.out_color_components = 4;
-+ } else {
-+ mInfo.out_color_space = JCS_RGB;
-+ }
+ // if we're not color managing we can decode directly to
+ // MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB
+ if (mCMSMode != eCMSMode_All) {
+@@ -332,6 +349,9 @@ nsJPEGDecoder::WriteInternal(const char *aBuffer, uint32_t aCount)
+ } else {
+ mInfo.out_color_space = JCS_RGB;
+ }
+#else
- mInfo.out_color_space = JCS_RGB;
++ mInfo.out_color_space = JCS_RGB;
+#endif
break;
case JCS_CMYK:
case JCS_YCCK:
-@@ -397,6 +419,7 @@ nsJPEGDecoder::WriteInternal(const char *aBuffer, PRUint32 aCount)
+@@ -399,6 +419,15 @@ nsJPEGDecoder::WriteInternal(const char *aBuffer, uint32_t aCount)
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) {
-@@ -404,6 +427,7 @@ nsJPEGDecoder::WriteInternal(const char *aBuffer, PRUint32 aCount)
- mInfo.out_color_components = 4; /* Packed ARGB pixels are always 4 bytes...*/
- mInfo.cconvert->color_convert = ycc_rgb_convert_argb;
- }
++ /* 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;
-@@ -542,7 +566,11 @@ nsJPEGDecoder::OutputScanlines(bool* suspend)
- PRUint32 *imageRow = ((PRUint32*)mImageData) +
+@@ -544,7 +573,11 @@ nsJPEGDecoder::OutputScanlines(bool* suspend)
+ 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) {
+ if (mInfo.out_color_space == MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB) {
+#else
- if (mInfo.cconvert->color_convert == ycc_rgb_convert_argb) {
++ 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 */
-@@ -858,6 +887,7 @@ term_source (j_decompress_ptr jd)
+@@ -854,6 +887,282 @@ term_source (j_decompress_ptr jd)
} // namespace mozilla
+#ifndef JCS_EXTENSIONS
- /**************** YCbCr -> Cairo's RGB24/ARGB32 conversion: most common case **************/
-
- /*
-@@ -1130,7 +1160,8 @@ ycc_rgb_convert_argb (j_decompress_ptr cinfo,
- }
- }
- }
++/**************** 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/firefox-esr/files/patch-bug791366 b/www/firefox-esr/files/patch-bug791366
deleted file mode 100644
index 2be866d928cd..000000000000
--- a/www/firefox-esr/files/patch-bug791366
+++ /dev/null
@@ -1,95 +0,0 @@
-diff --git xpcom/base/nsMemoryReporterManager.cpp xpcom/base/nsMemoryReporterManager.cpp
-index a9aff58..674e757 100644
---- xpcom/base/nsMemoryReporterManager.cpp
-+++ xpcom/base/nsMemoryReporterManager.cpp
-@@ -32,7 +32,7 @@ using namespace mozilla;
- # include "jemalloc.h"
- #endif // MOZ_MEMORY
-
--#if defined(XP_LINUX) || defined(XP_MACOSX) || defined(SOLARIS)
-+#ifdef XP_UNIX
-
- #include <sys/time.h>
- #include <sys/resource.h>
-@@ -95,6 +95,81 @@ static nsresult GetResident(PRInt64 *n)
- return GetProcSelfStatmField(1, n);
- }
-
-+#elif defined(__DragonFly__) || defined(__FreeBSD__) \
-+ || defined(__NetBSD__) || defined(__OpenBSD__)
-+
-+#include <sys/param.h>
-+#include <sys/sysctl.h>
-+#if defined(__DragonFly__) || defined(__FreeBSD__)
-+#include <sys/user.h>
-+#endif
-+
-+#include <unistd.h>
-+
-+#if defined(__NetBSD__)
-+#undef KERN_PROC
-+#define KERN_PROC KERN_PROC2
-+#define KINFO_PROC struct kinfo_proc2
-+#else
-+#define KINFO_PROC struct kinfo_proc
-+#endif
-+
-+#if defined(__DragonFly__)
-+#define KP_SIZE(kp) (kp.kp_vm_map_size)
-+#define KP_RSS(kp) (kp.kp_vm_rssize * getpagesize())
-+#elif defined(__FreeBSD__)
-+#define KP_SIZE(kp) (kp.ki_size)
-+#define KP_RSS(kp) (kp.ki_rssize * getpagesize())
-+#elif defined(__NetBSD__)
-+#define KP_SIZE(kp) (kp.p_vm_msize * getpagesize())
-+#define KP_RSS(kp) (kp.p_vm_rssize * getpagesize())
-+#elif defined(__OpenBSD__)
-+#define KP_SIZE(kp) ((kp.p_vm_dsize + kp.p_vm_ssize \
-+ + kp.p_vm_tsize) * getpagesize())
-+#define KP_RSS(kp) (kp.p_vm_rssize * getpagesize())
-+#endif
-+
-+static nsresult GetKinfoProcSelf(KINFO_PROC *proc)
-+{
-+ int mib[] = {
-+ CTL_KERN,
-+ KERN_PROC,
-+ KERN_PROC_PID,
-+ getpid(),
-+#if defined(__NetBSD__) || defined(__OpenBSD__)
-+ sizeof(KINFO_PROC),
-+ 1,
-+#endif
-+ };
-+ u_int miblen = sizeof(mib) / sizeof(mib[0]);
-+ size_t size = sizeof(KINFO_PROC);
-+ if (sysctl(mib, miblen, proc, &size, NULL, 0))
-+ return NS_ERROR_FAILURE;
-+
-+ return NS_OK;
-+}
-+
-+#define HAVE_VSIZE_AND_RESIDENT_REPORTERS 1
-+static nsresult GetVsize(PRInt64 *n)
-+{
-+ KINFO_PROC proc;
-+ nsresult rv = GetKinfoProcSelf(&proc);
-+ if (NS_SUCCEEDED(rv))
-+ *n = KP_SIZE(proc);
-+
-+ return rv;
-+}
-+
-+static nsresult GetResident(PRInt64 *n)
-+{
-+ KINFO_PROC proc;
-+ nsresult rv = GetKinfoProcSelf(&proc);
-+ if (NS_SUCCEEDED(rv))
-+ *n = KP_RSS(proc);
-+
-+ return rv;
-+}
-+
- #elif defined(SOLARIS)
-
- #include <procfs.h>
diff --git a/www/firefox-esr/files/patch-bug799441 b/www/firefox-esr/files/patch-bug799441
deleted file mode 100644
index 98bc613ba60d..000000000000
--- a/www/firefox-esr/files/patch-bug799441
+++ /dev/null
@@ -1,116 +0,0 @@
-commit b9accdd
-Author: Mike Hommey <mh+mozilla@glandium.org>
-Date: Thu Oct 18 14:47:10 2012 +0200
-
- Bug 799441 - Build GIO module in libxul. r=ted
----
- configure.in | 6 ++++++
- extensions/gio/Makefile.in | 14 +++-----------
- toolkit/library/Makefile.in | 5 +++++
- toolkit/library/nsStaticXULComponents.cpp | 7 +++++++
- toolkit/toolkit-tiers.mk | 4 ++++
- 5 files changed, 25 insertions(+), 11 deletions(-)
-
-diff --git configure.in configure.in
-index a9fb5f1..37e6db8 100644
---- configure.in
-+++ configure.in
-@@ -6086,6 +6086,12 @@ if test -n "$LIBXUL_SDK_DIR" -a `echo "$MOZ_EXTENSIONS" | grep -c gio` -ne 0; th
- MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gio||'`
- fi
-
-+if test `echo "$MOZ_EXTENSIONS" | grep -c gio` -ne 0; then
-+ MOZ_GIO_COMPONENT=1
-+ MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gio||'`
-+fi
-+AC_SUBST(MOZ_GIO_COMPONENT)
-+
- if test -z "$MOZ_JSDEBUGGER" -a `echo "$MOZ_EXTENSIONS" | grep -c venkman` -ne 0; then
- AC_MSG_WARN([Cannot build venkman without JavaScript debug library. Removing venkman from MOZ_EXTENSIONS.])
- MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|venkman||'`
-diff --git extensions/gio/Makefile.in extensions/gio/Makefile.in
-index ccf2846..79112a8 100644
---- extensions/gio/Makefile.in
-+++ extensions/gio/Makefile.in
-@@ -14,6 +14,9 @@ MODULE = nkgio
- LIBRARY_NAME = nkgio
- SHORT_LIBNAME = nkgio
- IS_COMPONENT = 1
-+EXPORT_LIBRARY = 1
-+MODULE_NAME = nsGIOModule
-+LIBXUL_LIBRARY = 1
-
- CPPSRCS = \
- nsGIOProtocolHandler.cpp \
-@@ -21,15 +24,4 @@ CPPSRCS = \
-
- LOCAL_INCLUDES = $(MOZ_GIO_CFLAGS)
-
--EXTRA_DSO_LDOPTS = \
-- $(XPCOM_GLUE_LDOPTS) \
-- $(MOZ_COMPONENT_LIBS) \
-- $(MOZ_GIO_LIBS) \
-- $(NULL)
--
--# make sure this component is never statically linked into the main
--# application. this is necessary since we don't want to force users
--# to install gio in order to use the rest of mozilla ;-)
--FORCE_SHARED_LIB= 1
--
- include $(topsrcdir)/config/rules.mk
-diff --git toolkit/library/Makefile.in toolkit/library/Makefile.in
-index 7f9046e..6499758 100644
---- toolkit/library/Makefile.in
-+++ toolkit/library/Makefile.in
-@@ -333,6 +333,11 @@ COMPONENT_LIBS += gkdebug
- endif
- endif
-
-+ifdef MOZ_GIO_COMPONENT
-+DEFINES += -DMOZ_GIO_COMPONENT
-+COMPONENT_LIBS += nkgio
-+endif
-+
- ifdef MOZ_APP_COMPONENT_LIBS
- COMPONENT_LIBS += $(MOZ_APP_COMPONENT_LIBS)
- endif
-diff --git toolkit/library/nsStaticXULComponents.cpp toolkit/library/nsStaticXULComponents.cpp
-index e1d90f2..85b21a2 100644
---- toolkit/library/nsStaticXULComponents.cpp
-+++ toolkit/library/nsStaticXULComponents.cpp
-@@ -164,6 +164,12 @@
- #define PROFILER_MODULE
- #endif
-
-+#if defined(MOZ_GIO_COMPONENT)
-+#define GIO_MODULE MODULE(nsGIOModule)
-+#else
-+#define GIO_MODULE
-+#endif
-+
- #define XUL_MODULES \
- MODULE(nsUConvModule) \
- MODULE(nsI18nModule) \
-@@ -220,6 +226,7 @@
- MODULE(nsTelemetryModule) \
- MODULE(jsinspector) \
- MODULE(jsdebugger) \
-+ GIO_MODULE \
- /* end of list */
-
- #define MODULE(_name) \
-diff --git toolkit/toolkit-tiers.mk toolkit/toolkit-tiers.mk
-index e87d7af..4b16d23 100644
---- toolkit/toolkit-tiers.mk
-+++ toolkit/toolkit-tiers.mk
-@@ -252,6 +252,10 @@ tier_platform_dirs += js/ductwork/debugger
-
- tier_platform_dirs += other-licenses/snappy
-
-+ifdef MOZ_GIO_COMPONENT
-+tier_platform_dirs += extensions/gio
-+endif
-+
- ifdef APP_LIBXUL_STATICDIRS
- # Applications can cheat and ask for code to be
- # built before libxul so libxul can be linked against it.
diff --git a/www/firefox-esr/files/patch-bug803480 b/www/firefox-esr/files/patch-bug803480
new file mode 100644
index 000000000000..5f5b4fe7f392
--- /dev/null
+++ b/www/firefox-esr/files/patch-bug803480
@@ -0,0 +1,102 @@
+diff --git configure.in configure.in
+index a0575dc..be327fd 100644
+--- configure.in
++++ configure.in
+@@ -4306,7 +4306,6 @@ NS_PRINTING=1
+ MOZ_PDF_PRINTING=
+ MOZ_DISABLE_CRYPTOLEGACY=
+ NSS_DISABLE_DBM=
+-NECKO_WIFI=1
+ NECKO_COOKIES=1
+ NECKO_PROTOCOLS_DEFAULT="about data file ftp http res viewsource websocket wyciwyg device"
+ USE_ARM_KUSER=
+@@ -4336,11 +4335,6 @@ case "${target}" in
+ fi
+
+ NSS_DISABLE_DBM=1
+- if test -z "$gonkdir"; then
+- NECKO_WIFI=
+- else
+- NECKO_WIFI=1
+- fi
+ MOZ_THEME_FASTSTRIPE=1
+ MOZ_TREE_FREETYPE=1
+ MOZ_MEMORY=1
+@@ -8485,28 +8479,39 @@ done
+ dnl
+ dnl option to disable necko's wifi scanner
+ dnl
++
++case "$OS_TARGET" in
++ OS2)
++ dnl OS/2 implementation of Necko-WiFi support will be added in bug 506566
++ ;;
++ Android)
++ if test -n "$gonkdir"; then
++ NECKO_WIFI=1
++ fi
++ ;;
++ Darwin|SunOS|WINNT)
++ NECKO_WIFI=1
++ ;;
++ Linux)
++ 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
++ NECKO_WIFI=1
++ NECKO_WIFI_DBUS=1
++ ;;
++esac
++
+ MOZ_ARG_DISABLE_BOOL(necko-wifi,
+ [ --disable-necko-wifi Disable necko wifi scanner],
+ 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])
+-fi
+-
+ if test "$NECKO_WIFI"; then
+ AC_DEFINE(NECKO_WIFI)
+ _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_WIFI"
+ fi
+ AC_SUBST(NECKO_WIFI)
++AC_SUBST(NECKO_WIFI_DBUS)
+
+ dnl
+ dnl option to disable cookies
+diff --git netwerk/wifi/Makefile.in netwerk/wifi/Makefile.in
+index 26dbd79..4cbf912 100644
+--- netwerk/wifi/Makefile.in
++++ netwerk/wifi/Makefile.in
+@@ -20,7 +20,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 netwerk/wifi/moz.build netwerk/wifi/moz.build
+index 5e70211..07b01de 100644
+--- netwerk/wifi/moz.build
++++ netwerk/wifi/moz.build
+@@ -43,7 +43,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/firefox-esr/files/patch-bug806139 b/www/firefox-esr/files/patch-bug806139
deleted file mode 100644
index 56791e71fb61..000000000000
--- a/www/firefox-esr/files/patch-bug806139
+++ /dev/null
@@ -1,29 +0,0 @@
---- content/html/content/public/nsHTMLMediaElement.h~
-+++ content/html/content/public/nsHTMLMediaElement.h
-@@ -311,7 +311,7 @@ public:
- static bool IsH264Enabled();
- static bool IsH264Type(const nsACString& aType);
- static const char gH264Types[3][16];
-- static char const *const gH264Codecs[7];
-+ static char const *const gH264Codecs[9];
- #endif
-
- #ifdef MOZ_MEDIA_PLUGINS
---- content/html/content/src/nsHTMLMediaElement.cpp~
-+++ content/html/content/src/nsHTMLMediaElement.cpp
-@@ -2114,12 +2114,14 @@ const char nsHTMLMediaElement::gH264Type
- "video/quicktime",
- };
-
--char const *const nsHTMLMediaElement::gH264Codecs[7] = {
-+char const *const nsHTMLMediaElement::gH264Codecs[9] = {
- "avc1.42E01E",
- "avc1.42001E",
- "avc1.58A01E",
- "avc1.4D401E",
- "avc1.64001E",
-+ "avc1.64001F",
-+ "mp4v.20.3",
- "mp4a.40.2",
- nullptr
- };
diff --git a/www/firefox-esr/files/patch-bug807492 b/www/firefox-esr/files/patch-bug807492
new file mode 100644
index 000000000000..3b39766e0492
--- /dev/null
+++ b/www/firefox-esr/files/patch-bug807492
@@ -0,0 +1,628 @@
+JJdiff --git configure.in configure.in
+index c167461..8346c11 100644
+--- configure.in
++++ configure.in
+@@ -5246,17 +5246,17 @@ if test "$NS_PRINTING"; then
+ AC_DEFINE(NS_PRINT_PREVIEW)
+ fi
+
+ dnl Turn off webrtc for OS's we don't handle yet, but allow
+ dnl --enable-webrtc to override. Can disable for everything in
+ 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
+ ;;
+ *)
+ dnl default to disabled for all others
+ MOZ_WEBRTC=
+ ;;
+ esac
+ fi
+diff --git media/mtransport/objs.mk media/mtransport/objs.mk
+index f1fc85f..141e8ca 100644
+--- media/mtransport/objs.mk
++++ media/mtransport/objs.mk
+@@ -18,22 +18,26 @@ LOCAL_INCLUDES += \
+ -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/util/libekr \
+ -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/log \
+ -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/registry \
+ -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/stats \
+ -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/plugin \
+ -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)
+ LOCAL_INCLUDES += \
+ -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/linux/include \
+ -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/generic/include \
+ $(NULL)
+ DEFINES += -DLINUX
+diff --git media/mtransport/test/Makefile.in media/mtransport/test/Makefile.in
+index c1d5bf4..2ecf2c7 100644
+--- media/mtransport/test/Makefile.in
++++ media/mtransport/test/Makefile.in
+@@ -73,22 +73,24 @@ DEFINES += -D__Userspace_os_FreeBSD=1
+ else
+ #default_fallback; probably doesn't work
+ DEFINES += -D__Userspace_os_$(OS_TARGET)=1
+ endif
+ 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
+ endif
+
+ ifeq ($(OS_TARGET), Android)
+ LOCAL_INCLUDES += -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/android/include
+
+diff --git media/mtransport/third_party/nICEr/nicer.gyp media/mtransport/third_party/nICEr/nicer.gyp
+index 0e1f8b4..9a4b995 100644
+--- media/mtransport/third_party/nICEr/nicer.gyp
++++ media/mtransport/third_party/nICEr/nicer.gyp
+@@ -126,26 +126,36 @@
+ 'R_DEFINED_UINT2=uint16_t',
+ 'R_DEFINED_INT4=int32_t',
+ 'R_DEFINED_UINT4=uint32_t',
+ 'R_DEFINED_INT8=int64_t',
+ 'R_DEFINED_UINT8=uint64_t',
+ ],
+
+ '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',
+ '-Wno-strict-prototypes',
+ '-Wmissing-prototypes',
+ ],
+ 'defines' : [
+- 'DARWIN',
+ 'HAVE_LIBM=1',
+ 'HAVE_STRDUP=1',
+ 'HAVE_STRLCPY=1',
+ 'HAVE_SYS_TIME_H=1',
+ 'HAVE_VFPRINTF=1',
+ 'NEW_STDIO'
+ 'RETSIGTYPE=void',
+ 'TIME_WITH_SYS_TIME_H=1',
+diff --git media/mtransport/third_party/nICEr/src/stun/addrs.c media/mtransport/third_party/nICEr/src/stun/addrs.c
+index b0b66b2..04fea94 100644
+--- media/mtransport/third_party/nICEr/src/stun/addrs.c
++++ media/mtransport/third_party/nICEr/src/stun/addrs.c
+@@ -50,17 +50,19 @@ static char *RCSSTRING __UNUSED__="$Id: addrs.c,v 1.2 2008/04/28 18:21:30 ekr Ex
+ #else
+ #include <syslog.h>
+ /* Work around an Android NDK < r8c bug */
+ #undef __unused
+ #include <linux/sysctl.h>
+ #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>
+ #else
+ #include <linux/if.h>
+ #endif
+ #include <net/route.h>
+
+@@ -75,17 +77,17 @@ static char *RCSSTRING __UNUSED__="$Id: addrs.c,v 1.2 2008/04/28 18:21:30 ekr Ex
+ #include <netdb.h>
+ #endif /* UNIX */
+
+ #include "stun.h"
+ #include "addrs.h"
+
+
+
+-#ifdef DARWIN
++#if defined(BSD) || defined(DARWIN)
+ /*
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+@@ -685,17 +687,17 @@ nr_stun_remove_duplicate_addrs(nr_transport_addr addrs[], int remove_loopback, i
+ }
+
+ int
+ nr_stun_get_addrs(nr_transport_addr addrs[], int maxaddrs, int drop_loopback, int *count)
+ {
+ 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);
+ #elif defined(__sparc__)
+ _status = stun_get_sparc_addrs(addrs, maxaddrs, count);
+ #else
+ _status = stun_get_siocgifconf_addrs(addrs, maxaddrs, count);
+ #endif
+diff --git media/mtransport/third_party/nICEr/src/stun/stun.h media/mtransport/third_party/nICEr/src/stun/stun.h
+index a3c51f9..eb65ac8 100644
+--- media/mtransport/third_party/nICEr/src/stun/stun.h
++++ media/mtransport/third_party/nICEr/src/stun/stun.h
+@@ -36,21 +36,25 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ #ifdef WIN32
+ #include <winsock2.h>
+ #else
+ #include <sys/param.h>
+ #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>
+ #endif
+ #include <arpa/inet.h>
+ #include <netdb.h>
+ #endif
+ #include <time.h>
+diff --git media/mtransport/third_party/nICEr/src/util/mbslen.c media/mtransport/third_party/nICEr/src/util/mbslen.c
+index cc260b7..66af2d7 100644
+--- media/mtransport/third_party/nICEr/src/util/mbslen.c
++++ media/mtransport/third_party/nICEr/src/util/mbslen.c
+@@ -38,50 +38,58 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ #include <errno.h>
+ #include <csi_platform.h>
+
+ #include <assert.h>
+ #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"
+
+ /* get number of characters in a mult-byte character string */
+ 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;
+ #endif /* WIN32 */
+ int _status;
+ size_t nbytes;
+ int nchars;
+ mbstate_t mbs;
+
+-#ifdef DARWIN
++#ifdef HAVE_XLOCALE
+ if (! initialized) {
+ initialized = 1;
+ loc = newlocale(LC_CTYPE_MASK, "UTF-8", LC_GLOBAL_LOCALE);
+ }
+
+ 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))
+ ABORT(R_INTERNAL);
+
+ if (!(my_locale = r_strdup(setlocale(LC_CTYPE, 0))))
+ ABORT(R_NO_MEMORY);
+
+@@ -94,28 +102,28 @@ mbslen(const char *s, size_t *ncharsp)
+ /* can't count UTF-8 characters with mbrlen if the locale isn't UTF-8 */
+ /* null-checking setlocale is required because Android */
+ char *locale = setlocale(LC_CTYPE, 0);
+ /* some systems use "utf8" instead of "UTF-8" like Fedora 17 */
+ if (!locale || (!strcasestr(locale, "UTF-8") && !strcasestr(locale, "UTF8")))
+ 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);
+ }
+ if (nbytes == (size_t)-2) /* encoding error */ {
+ ABORT(R_BAD_DATA);
+ }
+
+diff --git media/mtransport/third_party/nrappkit/nrappkit.gyp media/mtransport/third_party/nrappkit/nrappkit.gyp
+index 3cc8e1c..74016c6 100644
+--- media/mtransport/third_party/nrappkit/nrappkit.gyp
++++ media/mtransport/third_party/nrappkit/nrappkit.gyp
+@@ -142,26 +142,35 @@
+ 'R_DEFINED_UINT2=uint16_t',
+ 'R_DEFINED_INT4=int32_t',
+ 'R_DEFINED_UINT4=uint32_t',
+ 'R_DEFINED_INT8=int64_t',
+ 'R_DEFINED_UINT8=uint64_t',
+ ],
+
+ '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',
+ '-Wno-strict-prototypes',
+ '-Wmissing-prototypes',
+ ],
+ 'defines' : [
+- 'DARWIN',
+ 'HAVE_LIBM=1',
+ 'HAVE_STRDUP=1',
+ 'HAVE_STRLCPY=1',
+ 'HAVE_SYS_TIME_H=1',
+ 'HAVE_VFPRINTF=1',
+ 'NEW_STDIO'
+ 'RETSIGTYPE=void',
+ 'TIME_WITH_SYS_TIME_H=1',
+diff --git media/mtransport/third_party/nrappkit/src/log/r_log.c media/mtransport/third_party/nrappkit/src/log/r_log.c
+index efb7ef2..aebf578 100644
+--- media/mtransport/third_party/nrappkit/src/log/r_log.c
++++ media/mtransport/third_party/nrappkit/src/log/r_log.c
+@@ -43,16 +43,17 @@ static char *RCSSTRING __UNUSED__ ="$Id: r_log.c,v 1.10 2008/11/25 22:25:18 adam
+ #ifdef LINUX
+ #define _BSD_SOURCE
+ #endif
+
+ #include "r_log.h"
+ #include "hex.h"
+
+ #include <string.h>
++#include <errno.h>
+ #ifndef _MSC_VER
+ #include <strings.h>
+ #include <syslog.h>
+ #endif
+ #include <registry.h>
+ #include <time.h>
+
+
+diff --git media/mtransport/third_party/nrappkit/src/port/generic/include/sys/queue.h media/mtransport/third_party/nrappkit/src/port/generic/include/sys/queue.h
+index bcb1ec0..bb73591 100644
+--- media/mtransport/third_party/nrappkit/src/port/generic/include/sys/queue.h
++++ 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 media/mtransport/third_party/nrappkit/src/util/util.c media/mtransport/third_party/nrappkit/src/util/util.c
+index a7d4ff1..ff11a60 100644
+--- media/mtransport/third_party/nrappkit/src/util/util.c
++++ media/mtransport/third_party/nrappkit/src/util/util.c
+@@ -40,16 +40,17 @@
+ static char *RCSSTRING __UNUSED__ ="$Id: util.c,v 1.5 2007/11/21 00:09:13 adamcain Exp $";
+
+ #ifndef WIN32
+ #include <sys/uio.h>
+ #include <pwd.h>
+ #include <dirent.h>
+ #endif
+ #include <string.h>
++#include <errno.h>
+ #include <ctype.h>
+ #include <sys/stat.h>
+ #ifdef OPENSSL
+ #include <openssl/evp.h>
+ #endif
+ #include "nr_common.h"
+ #include "r_common.h"
+ #include "registry.h"
+diff --git media/webrtc/signaling/signaling.gyp media/webrtc/signaling/signaling.gyp
+index 2a91e3d..31de641 100644
+--- media/webrtc/signaling/signaling.gyp
++++ media/webrtc/signaling/signaling.gyp
+@@ -212,16 +212,29 @@
+ 'SIPCC_BUILD',
+ 'HAVE_WINSOCK2_H',
+ 'CPR_STDINT_INCLUDE=\\"mozilla/StandardInteger.h\\"'
+ ],
+
+ 'cflags_mozilla': [
+ ],
+ }],
++ ['os_bsd==1', {
++ 'include_dirs': [
++ ],
++ 'defines': [
++ # avoiding pointless ifdef churn
++ 'SIP_OS_OSX',
++ 'OSX',
++ 'SECLIB_OPENSSL',
++ ],
++
++ 'cflags_mozilla': [
++ ],
++ }],
+ ['OS=="mac"', {
+ 'include_dirs': [
+ ],
+ 'defines': [
+ 'SIP_OS_OSX',
+ 'OSX',
+ '_FORTIFY_SOURCE=2',
+ ],
+@@ -747,17 +760,17 @@
+ 'EXTERNAL_TICK_REQUIRED',
+ 'GIPS_VER=3480',
+ ],
+
+ 'cflags_mozilla': [
+ ],
+
+ }],
+- ['OS=="mac"', {
++ ['OS=="mac" or os_bsd==1', {
+
+ 'include_dirs': [
+ ],
+
+ 'sources': [
+ # SIPSTACK
+ './src/sipcc/core/sipstack/sip_platform_task.c',
+
+@@ -792,24 +805,23 @@
+ './src/sipcc/cpr/darwin/cpr_darwin_timers_using_select.c',
+ './src/sipcc/cpr/darwin/cpr_darwin_tst.h',
+ './src/sipcc/cpr/darwin/cpr_darwin_types.h',
+ ],
+
+
+ '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',
+ ],
+
+ 'cflags_mozilla': [
+ ],
+ }],
+ ],
+
+diff --git media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_ipc.c media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_ipc.c
+index a7c47e1..4f191de 100644
+--- media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_ipc.c
++++ media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_ipc.c
+@@ -317,21 +317,25 @@ cprGetMessage (cprMsgQueue_t msgQueue, boolean waitForever, void **ppUserData)
+ {
+ static const char fname[] = "cprGetMessage";
+
+ void *buffer = 0;
+ cpr_msg_queue_t *msgq;
+ 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) {
+ *ppUserData = NULL;
+ }
+
+ msgq = (cpr_msg_queue_t *) msgQueue;
+ if (msgq == NULL) {
+diff --git media/webrtc/signaling/test/Makefile.in media/webrtc/signaling/test/Makefile.in
+index a30e330..cfbd8a3 100644
+--- media/webrtc/signaling/test/Makefile.in
++++ media/webrtc/signaling/test/Makefile.in
+@@ -81,17 +81,17 @@ endif
+ ifeq (qt,$(MOZ_WIDGET_TOOLKIT))
+ LIBS += \
+ $(XLIBS) \
+ $(TK_LIBS) \
+ $(MOZ_PANGO_LIBS) \
+ $(NULL)
+ endif
+
+-ifeq ($(OS_TARGET),Linux)
++ifneq (,$(filter Linux DragonFly FreeBSD NetBSD OpenBSD,$(OS_TARGET)))
+ LIBS += \
+ $(MOZ_CAIRO_OSLIBS) \
+ $(NULL)
+ endif
+
+ ifeq ($(OS_TARGET),Darwin)
+ LIBS += \
+ -framework AudioToolbox \
+diff --git media/webrtc/trunk/tools/gyp/pylib/gyp/generator/mozmake.py media/webrtc/trunk/tools/gyp/pylib/gyp/generator/mozmake.py
+index 338d0b7..2241d41 100644
+--- media/webrtc/trunk/tools/gyp/pylib/gyp/generator/mozmake.py
++++ media/webrtc/trunk/tools/gyp/pylib/gyp/generator/mozmake.py
+@@ -1,16 +1,17 @@
+ # Copyright (c) 2012 Mozilla Foundation. All rights reserved.
+ # Use of this source code is governed by a BSD-style license that can be
+ # found in the LICENSE file.
+
+ import collections
+ import gyp
+ import gyp.common
+ import sys
++import platform
+ import os
+ import re
+ import shlex
+
+ generator_wants_sorted_dependencies = True
+
+ generator_default_variables = {
+ }
+@@ -107,30 +108,44 @@ endif
+
+ def ensure_directory_exists(path):
+ dir = os.path.dirname(path)
+ if dir and not os.path.exists(dir):
+ os.makedirs(dir)
+
+ 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):
+ """Calculate the generator specific info that gets fed to input (called by
+ gyp)."""
+ generator_flags = params.get('generator_flags', {})
+ if generator_flags.get('adjust_static_libraries', False):
+ global generator_wants_static_library_dependencies_adjusted
diff --git a/www/firefox-esr/files/patch-bug826985 b/www/firefox-esr/files/patch-bug826985
new file mode 100644
index 000000000000..fe55ff667281
--- /dev/null
+++ b/www/firefox-esr/files/patch-bug826985
@@ -0,0 +1,164 @@
+commit 8024d93
+Author: Henrik Gulbrandsen <henrik@gulbra.net>
+Date: Fri Jan 4 13:49:22 2013 +0100
+
+ Bug 826985 - Support more video formats for WebRTC via libv4l2 on Linux.
+---
+ configure.in | 7 +++++++
+ media/webrtc/signaling/test/Makefile.in | 1 +
+ .../modules/video_capture/linux/device_info_linux.cc | 17 +++++++++++++++++
+ .../modules/video_capture/linux/video_capture_linux.cc | 16 +++++++++++++++-
+ .../webrtc/modules/video_capture/video_capture.gypi | 11 +++++++++++
+ toolkit/library/Makefile.in | 1 +
+ 6 files changed, 52 insertions(+), 1 deletion(-)
+
+diff --git configure.in configure.in
+index 55e4cd1..76567b3 100644
+--- configure.in
++++ configure.in
+@@ -5309,6 +5309,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)
+@@ -8981,6 +8984,10 @@ elif test "${OS_TARGET}" = "Android"; then
+ fi
+ 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 media/webrtc/signaling/test/Makefile.in media/webrtc/signaling/test/Makefile.in
+index b483cd1..f1dd1f0 100644
+--- media/webrtc/signaling/test/Makefile.in
++++ 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) \
+diff --git media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc
+index 239a292..bab496c 100644
+--- media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc
++++ media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc
+@@ -26,11 +26,23 @@
+ #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
++
+ namespace webrtc
+ {
+ namespace videocapturemodule
+@@ -130,6 +142,11 @@ WebRtc_Word32 DeviceInfoLinux::GetDeviceName(
+ memset(deviceNameUTF8, 0, deviceNameLength);
+ memcpy(cameraName, cap.card, sizeof(cap.card));
+
++ if (cameraName[0] == '\0')
++ {
++ sprintf(cameraName, "Camera at /dev/video%d", deviceNumber);
++ }
++
+ if (deviceNameLength >= strlen(cameraName))
+ {
+ memcpy(deviceNameUTF8, cameraName, strlen(cameraName));
+diff --git media/webrtc/trunk/webrtc/modules/video_capture/linux/video_capture_linux.cc media/webrtc/trunk/webrtc/modules/video_capture/linux/video_capture_linux.cc
+index 12df1b3..e9863ba 100644
+--- media/webrtc/trunk/webrtc/modules/video_capture/linux/video_capture_linux.cc
++++ 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>
+
+@@ -26,6 +31,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 media/webrtc/trunk/webrtc/modules/video_capture/video_capture.gypi media/webrtc/trunk/webrtc/modules/video_capture/video_capture.gypi
+index d46b5aa..e452223 100644
+--- media/webrtc/trunk/webrtc/modules/video_capture/video_capture.gypi
++++ 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 toolkit/library/Makefile.in toolkit/library/Makefile.in
+index 9c16ffa..1db3794 100644
+--- toolkit/library/Makefile.in
++++ 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/firefox-esr/files/patch-bug828003 b/www/firefox-esr/files/patch-bug828003
deleted file mode 100644
index 16a7b9d46b78..000000000000
--- a/www/firefox-esr/files/patch-bug828003
+++ /dev/null
@@ -1,36 +0,0 @@
---- gfx/qcms/qcmstypes.h
-+++ gfx/qcms/qcmstypes.h
-@@ -7,30 +7,12 @@
- #include "mozilla/StandardInteger.h"
-
- /* prtypes.h defines IS_LITTLE_ENDIAN and IS_BIG ENDIAN */
-+/* StandardInteger.h defines int*_t and uintptr_t */
-
--#if defined (__SVR4) && defined (__sun)
--/* int_types.h gets included somehow, so avoid redefining the types differently */
--#include <sys/int_types.h>
--#elif defined (_AIX)
-+#if defined(_AIX)
- #include <sys/types.h>
--#elif defined(__OpenBSD__)
--#include <inttypes.h>
--#elif !defined(ANDROID)
--typedef int8_t int8_t;
--typedef uint8_t uint8_t;
--typedef int16_t int16_t;
--typedef uint16_t uint16_t;
--typedef int32_t int32_t;
--typedef uint32_t uint32_t;
--typedef int64_t int64_t;
--typedef uint64_t uint64_t;
--
--#ifdef __OS2__
--/* OS/2's stdlib typdefs uintptr_t. So we'll just include that so we don't collide */
-+#elif defined(__OS2__)
- #include <stdlib.h>
--#elif !defined(__intptr_t_defined) && !defined(_UINTPTR_T_DEFINED)
--typedef PRUptrdiff uintptr_t;
--#endif
- #endif
-
- #else // MOZ_QCMS
diff --git a/www/firefox-esr/files/patch-bug851992 b/www/firefox-esr/files/patch-bug851992
new file mode 100644
index 000000000000..4c322188c47c
--- /dev/null
+++ b/www/firefox-esr/files/patch-bug851992
@@ -0,0 +1,339 @@
+diff --git a/config/Makefile.in b/config/Makefile.in
+--- config/Makefile.in
++++ config/Makefile.in
+@@ -97,16 +97,17 @@ export:: $(export-preqs)
+ -DMOZ_TREE_PIXMAN=$(MOZ_TREE_PIXMAN) \
+ -DMOZ_NATIVE_HUNSPELL=$(MOZ_NATIVE_HUNSPELL) \
+ -DMOZ_NATIVE_BZ2=$(MOZ_NATIVE_BZ2) \
+ -DMOZ_NATIVE_ZLIB=$(MOZ_NATIVE_ZLIB) \
+ -DMOZ_NATIVE_PNG=$(MOZ_NATIVE_PNG) \
+ -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)
+
+ GARBAGE_DIRS += system_wrappers
+ endif
+
+ ifdef WRAP_STL_INCLUDES
+ ifdef GNU_CXX
+diff --git a/config/system-headers b/config/system-headers
+--- config/system-headers
++++ config/system-headers
+@@ -1125,8 +1125,19 @@ gst/video/video.h
+ sys/msg.h
+ sys/ipc.h
+ sys/thr.h
+ sys/user.h
+ 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/configure.in b/configure.in
+--- configure.in
++++ configure.in
+@@ -4134,16 +4134,32 @@ if test -n "$MOZ_NATIVE_FFI"; then
+ PKG_CHECK_MODULES(MOZ_FFI, libffi > 3.0.9)
+ else
+ PKG_CHECK_MODULES(MOZ_FFI, libffi >= 3.0.9)
+ fi
+ MOZ_JS_STATIC_LIBS="$MOZ_JS_STATIC_LIBS $MOZ_FFI_LIBS"
+ 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 ========================================================
+
+ JAVA_BIN_PATH=
+ MOZ_ARG_WITH_STRING(java-bin-path,
+ [ --with-java-bin-path=dir
+ Location of Java binaries (java, javac, jar)],
+ JAVA_BIN_PATH=$withval)
+diff --git a/js/src/Makefile.in b/js/src/Makefile.in
+--- js/src/Makefile.in.orig 2013-10-22 08:19:02.000000000 +0200
++++ js/src/Makefile.in 2013-10-29 10:11:58.272605098 +0100
+@@ -237,10 +237,14 @@
+ # 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 @@
+ 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
+@@ -276,6 +281,7 @@
+ $(call SUBMAKE,$@,intl/icu)
+
+ endif
++endif
+
+ #
+ # END ECMAScript Internationalization API
+@@ -413,7 +419,11 @@
+ 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
+diff --git a/js/src/config/Makefile.in b/js/src/config/Makefile.in
+--- js/src/config/Makefile.in
++++ js/src/config/Makefile.in
+@@ -54,16 +54,17 @@ include $(topsrcdir)/config/rules.mk
+
+ HOST_CFLAGS += -DUNICODE -D_UNICODE
+
+ ifdef WRAP_SYSTEM_INCLUDES
+ 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)
+
+ GARBAGE_DIRS += system_wrappers_js
+ endif
+
+ GARBAGE += $(srcdir)/*.pyc *.pyc
+
+diff --git a/js/src/config/system-headers b/js/src/config/system-headers
+--- js/src/config/system-headers
++++ js/src/config/system-headers
+@@ -1125,8 +1125,19 @@ gst/video/video.h
+ sys/msg.h
+ sys/ipc.h
+ sys/thr.h
+ sys/user.h
+ 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/js/src/configure.in b/js/src/configure.in
+--- js/src/configure.in
++++ js/src/configure.in
+@@ -4406,59 +4406,68 @@ if test "$ACCESSIBILITY" -a "$MOZ_ENABLE
+ AC_DEFINE_UNQUOTED(ATK_MINOR_VERSION, $ATK_MINOR_VERSION)
+ AC_DEFINE_UNQUOTED(ATK_REV_VERSION, $ATK_REV_VERSION)
+ 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
+ fi
+ MOZ_ARG_ENABLE_BOOL(intl-api,
+ [ --enable-intl-api Enable ECMAScript Internationalization API (default=yes for standalone JS)],
+ ENABLE_INTL_API=1,
+ ENABLE_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)
+-
+-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)
+-
++AC_SUBST(MOZ_ICU_LIBS)
++AC_SUBST(MOZ_NATIVE_ICU)
+
+ dnl Settings for ICU
+-if test -n "$ENABLE_INTL_API" ; then
++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)
++
+ # Set ICU compile options
+ ICU_CPPFLAGS=""
+ # don't use icu namespace automatically in client code
+ ICU_CPPFLAGS="$ICU_CPPFLAGS -DU_USING_ICU_NAMESPACE=0"
+ # don't include obsolete header files
+ ICU_CPPFLAGS="$ICU_CPPFLAGS -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1"
+ # remove chunks of the library that we don't need (yet)
+ ICU_CPPFLAGS="$ICU_CPPFLAGS -DUCONFIG_NO_LEGACY_CONVERSION"
+diff --git a/js/src/gdb/Makefile.in b/js/src/gdb/Makefile.in
+--- js/src/gdb/Makefile.in
++++ js/src/gdb/Makefile.in
+@@ -14,16 +14,20 @@ include $(DEPTH)/config/autoconf.mk
+ # Building against js_static requires that we declare mfbt sybols "exported"
+ # on its behalf.
+ DEFINES += -DEXPORT_JS_API -DIMPL_MFBT
+
+ LIBS = $(DEPTH)/$(LIB_PREFIX)js_static.$(LIB_SUFFIX) $(NSPR_LIBS) $(MOZ_ZLIB_LIBS)
+
+ 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
+ # in the build directory and in the dist/bin directory.
+ PP_TARGETS += GDB_AUTOLOAD
+ GDB_AUTOLOAD := gdb-tests-gdb.py.in
+ GDB_AUTOLOAD_FLAGS := -Dtopsrcdir=$(abspath $(topsrcdir))
+
+diff --git a/js/src/jsapi-tests/Makefile.in b/js/src/jsapi-tests/Makefile.in
+--- js/src/jsapi-tests/Makefile.in
++++ js/src/jsapi-tests/Makefile.in
+@@ -15,16 +15,20 @@ DEFINES += -DEXPORT_JS_API
+ # Building against js_static requires that we declare mfbt sybols "exported"
+ # on its behalf.
+ DEFINES += -DIMPL_MFBT
+
+ LIBS = $(DEPTH)/$(LIB_PREFIX)js_static.$(LIB_SUFFIX) $(NSPR_LIBS) $(MOZ_ZLIB_LIBS)
+
+ LOCAL_INCLUDES += -I$(topsrcdir) -I..
+
++ifdef MOZ_NATIVE_ICU
++EXTRA_LIBS += $(MOZ_ICU_LIBS)
++endif
++
+ EXTRA_LIBS += $(MOZ_FFI_LIBS)
+
+ ifdef QEMU_EXE
+ MOZ_POST_PROGRAM_COMMAND = $(topsrcdir)/build/qemu-wrap --qemu $(QEMU_EXE) --libdir $(CROSS_LIB)
+ endif
+
+ # Place a GDB Python auto-load file next to the jsapi-tests executable in
+ # the build directory.
+diff --git a/js/src/shell/Makefile.in b/js/src/shell/Makefile.in
+--- js/src/shell/Makefile.in
++++ js/src/shell/Makefile.in
+@@ -22,16 +22,19 @@ DEFINES += -DEXPORT_JS_API
+ # Building against js_static requires that we declare mfbt sybols "exported"
+ # on its behalf.
+ DEFINES += -DIMPL_MFBT
+
+ LIBS = $(NSPR_LIBS) $(EDITLINE_LIBS) $(DEPTH)/$(LIB_PREFIX)js_static.$(LIB_SUFFIX) $(MOZ_ZLIB_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..
+
+ ifeq ($(OS_ARCH),Darwin)
+ ifeq ($(TARGET_CPU),x86_64)
+ DARWIN_EXE_LDFLAGS += -pagezero_size 10000 -image_base 100000000
+ endif
+ endif
diff --git a/www/firefox-esr/files/patch-bug876156 b/www/firefox-esr/files/patch-bug876156
new file mode 100644
index 000000000000..84ecf6170671
--- /dev/null
+++ b/www/firefox-esr/files/patch-bug876156
@@ -0,0 +1,13 @@
+diff --git mfbt/Atomics.h mfbt/Atomics.h
+index d79af6c..40b9336 100644
+--- mfbt/Atomics.h
++++ mfbt/Atomics.h
+@@ -35,7 +35,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/firefox-esr/files/patch-bug878791 b/www/firefox-esr/files/patch-bug878791
new file mode 100644
index 000000000000..d8a3612e1702
--- /dev/null
+++ b/www/firefox-esr/files/patch-bug878791
@@ -0,0 +1,11 @@
+--- toolkit/components/osfile/osfile_unix_allthreads.jsm.orig 2013-05-11 21:19:53.000000000 +0200
++++ toolkit/components/osfile/osfile_unix_allthreads.jsm 2013-06-02 17:15:05.000000000 +0200
+@@ -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/firefox-esr/files/patch-bug886181 b/www/firefox-esr/files/patch-bug886181
new file mode 100644
index 000000000000..ed1c4df8348b
--- /dev/null
+++ b/www/firefox-esr/files/patch-bug886181
@@ -0,0 +1,11 @@
+--- modules/libpref/src/init/all.js~
++++ modules/libpref/src/init/all.js
+@@ -193,7 +193,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/firefox-esr/files/patch-bug889699 b/www/firefox-esr/files/patch-bug889699
new file mode 100644
index 000000000000..fef97da4ac50
--- /dev/null
+++ b/www/firefox-esr/files/patch-bug889699
@@ -0,0 +1,175 @@
+commit 7eb5827
+Author: Edwin Flores <eflores@mozilla.com>
+Date: Sat Jul 20 12:03:08 2013 +1200
+
+ Bug 889699 - Make gstreamer backend return more accurate results for canPlayType() r=alessandro.d
+---
+ content/media/gstreamer/GStreamerFormatHelper.cpp | 90 +++++++++++++++++------
+ 1 file changed, 66 insertions(+), 24 deletions(-)
+
+diff --git content/media/gstreamer/GStreamerFormatHelper.cpp content/media/gstreamer/GStreamerFormatHelper.cpp
+index f05ff8f..39f1fdf 100644
+--- content/media/gstreamer/GStreamerFormatHelper.cpp
++++ 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::mContainers[6][2] = {
+ {"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::mCodecs[9][2] = {
+ {"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::GStreamerFormatHelper()
+ }
+
+ 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::~GStreamerFormatHelper() {
+ 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::CanHandleMediaType(const nsACString& aMIMEType,
+ 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::ConvertFormatsToCaps(const char* aMIMEType,
+
+ 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::ConvertFormatsToCaps(const char* aMIMEType,
+ 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/firefox-esr/files/patch-bug893397 b/www/firefox-esr/files/patch-bug893397
new file mode 100644
index 000000000000..4d755c2ebb17
--- /dev/null
+++ b/www/firefox-esr/files/patch-bug893397
@@ -0,0 +1,206 @@
+diff --git configure.in configure.in
+index 549ad06..2878d9f 100644
+--- configure.in
++++ configure.in
+@@ -8491,7 +8491,7 @@ case "$OS_TARGET" in
+ NECKO_WIFI=1
+ fi
+ ;;
+- Darwin|SunOS|WINNT)
++ Darwin|FreeBSD|SunOS|WINNT)
+ NECKO_WIFI=1
+ ;;
+ Linux)
+diff --git netwerk/wifi/moz.build netwerk/wifi/moz.build
+index 07b01de..11706af 100644
+--- netwerk/wifi/moz.build
++++ netwerk/wifi/moz.build
+@@ -34,6 +34,10 @@ if CONFIG['OS_ARCH'] == 'Darwin':
+ CMMSRCS += [
+ 'osx_corewlan.mm',
+ ]
++elif CONFIG['OS_ARCH'] == 'FreeBSD':
++ CPP_SOURCES += [
++ 'nsWifiScannerFreeBSD.cpp',
++ ]
+ elif CONFIG['OS_ARCH'] == 'WINNT':
+ CPP_SOURCES += [
+ 'nsWifiScannerWin.cpp',
+diff --git netwerk/wifi/nsWifiScannerFreeBSD.cpp netwerk/wifi/nsWifiScannerFreeBSD.cpp
+new file mode 100644
+index 0000000..80d4cb6
+--- /dev/null
++++ 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/firefox-esr/files/patch-bug910875 b/www/firefox-esr/files/patch-bug910875
new file mode 100644
index 000000000000..4f1d5a521e84
--- /dev/null
+++ b/www/firefox-esr/files/patch-bug910875
@@ -0,0 +1,102 @@
+diff --git media/webrtc/trunk/webrtc/modules/audio_device/audio_device_impl.cc media/webrtc/trunk/webrtc/modules/audio_device/audio_device_impl.cc
+index f231b1e..6087696 100644
+--- media/webrtc/trunk/webrtc/modules/audio_device/audio_device_impl.cc
++++ 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)
+@@ -309,7 +311,7 @@ int32_t AudioDeviceModuleImpl::CreatePlatformSpecificObjects()
+
+ // 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)
+@@ -355,7 +357,7 @@ int32_t AudioDeviceModuleImpl::CreatePlatformSpecificObjects()
+ //
+ 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 media/webrtc/trunk/webrtc/modules/audio_device/test/audio_device_test_api.cc media/webrtc/trunk/webrtc/modules/audio_device/test/audio_device_test_api.cc
+index defd7f8..906c4a2 100644
+--- media/webrtc/trunk/webrtc/modules/audio_device/test/audio_device_test_api.cc
++++ media/webrtc/trunk/webrtc/modules/audio_device/test/audio_device_test_api.cc
+@@ -197,7 +197,7 @@ class AudioDeviceAPITest: public testing::Test {
+ // 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(
+@@ -1690,7 +1690,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();
+@@ -1759,7 +1759,7 @@ TEST_F(AudioDeviceAPITest, StartAndStopRawInputFileRecording) {
+ // - 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) {
+ uint32_t sampleRate(0);
diff --git a/www/firefox-esr/files/patch-bug916216 b/www/firefox-esr/files/patch-bug916216
new file mode 100644
index 000000000000..ca82967fa78c
--- /dev/null
+++ b/www/firefox-esr/files/patch-bug916216
@@ -0,0 +1,39 @@
+--- media/webrtc/trunk/build/build_config.h~
++++ 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/firefox-esr/files/patch-bug916589 b/www/firefox-esr/files/patch-bug916589
new file mode 100644
index 000000000000..664a7b167314
--- /dev/null
+++ b/www/firefox-esr/files/patch-bug916589
@@ -0,0 +1,40 @@
+diff --git media/mtransport/third_party/nrappkit/src/port/generic/include/sys/queue.h media/mtransport/third_party/nrappkit/src/port/generic/include/sys/queue.h
+index 5b50785..7cf47d5 100644
+--- media/mtransport/third_party/nrappkit/src/port/generic/include/sys/queue.h
++++ media/mtransport/third_party/nrappkit/src/port/generic/include/sys/queue.h
+@@ -31,11 +31,14 @@
+ */
+
+-#ifndef _SYS_QUEUE_H_
++#if (defined(BSD) && !defined(__OpenBSD__)) || defined(DARWIN)
++#include_next <sys/queue.h>
++#elif !defined(_SYS_QUEUE_H_)
+ #define _SYS_QUEUE_H_
+
+-#if !defined(__FreeBSD__) && !defined(DARWIN)
+ #include <stddef.h>
+-#define __offsetof offsetof
++
++#ifndef offsetof
++#define offsetof(type, field) ((size_t)(&((type *)0)->field))
+ #endif
+
+ #define STAILQ_FOREACH_SAFE(var, head, field, tvar) \
+@@ -43,8 +46,6 @@
+ (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \
+ (var) = (tvar))
+
+-// #define __offsetof(type, field) ((size_t)(&((type *)0)->field))
+-
+ /*
+ * This file defines four types of data structures: singly-linked lists,
+ * singly-linked tail queues, lists and tail queues.
+@@ -285,7 +286,7 @@ struct { \
+ (STAILQ_EMPTY((head)) ? \
+ NULL : \
+ ((struct type *) \
+- ((char *)((head)->stqh_last) - __offsetof(struct type, field))))
++ ((char *)((head)->stqh_last) - offsetof(struct type, field))))
+
+ #define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next)
+
diff --git a/www/firefox-esr/files/patch-bug918177 b/www/firefox-esr/files/patch-bug918177
new file mode 100644
index 000000000000..76dd34ca040a
--- /dev/null
+++ b/www/firefox-esr/files/patch-bug918177
@@ -0,0 +1,36 @@
+diff --git config/stl-headers config/stl-headers
+index c057d8e..dc7f6f0 100644
+--- config/stl-headers
++++ config/stl-headers
+@@ -21,6 +21,7 @@ algorithm
+ atomic
+ deque
+ ios
++iosfwd
+ iostream
+ iterator
+ limits
+diff --git config/system-headers config/system-headers
+index d31c94e..570c82a 100644
+--- config/system-headers
++++ config/system-headers
+@@ -469,6 +469,7 @@ IOKit/IOMessage.h
+ IOKit/pwr_mgt/IOPMLib.h
+ iomanip
+ ios
++iosfwd
+ iostream
+ iostream.h
+ iterator
+diff --git js/src/config/system-headers js/src/config/system-headers
+index d31c94e..570c82a 100644
+--- js/src/config/system-headers
++++ js/src/config/system-headers
+@@ -469,6 +469,7 @@ IOKit/IOMessage.h
+ IOKit/pwr_mgt/IOPMLib.h
+ iomanip
+ ios
++iosfwd
+ iostream
+ iostream.h
+ iterator
diff --git a/www/firefox-esr/files/patch-build-pgo-profileserver.py b/www/firefox-esr/files/patch-build-pgo-profileserver.py
index 0571eb19903d..31a3a0889c0a 100644
--- a/www/firefox-esr/files/patch-build-pgo-profileserver.py
+++ b/www/firefox-esr/files/patch-build-pgo-profileserver.py
@@ -1,18 +1,11 @@
--- build/pgo/profileserver.py.orig 2011-02-24 21:49:47.000000000 +0100
+++ build/pgo/profileserver.py 2011-02-24 21:50:30.000000000 +0100
-@@ -77,13 +77,13 @@
- t.setDaemon(True) # don't hang on exit
- t.start()
-
-- automation.setServerInfo("localhost", PORT)
-+ automation.setServerInfo("127.0.0.1", PORT)
- automation.initializeProfile(PROFILE_DIRECTORY)
- browserEnv = automation.environment()
- browserEnv["XPCOM_DEBUG_BREAK"] = "warn"
- browserEnv["MOZ_JAR_LOG_DIR"] = MOZ_JAR_LOG_DIR
+@@ -59,7 +59,7 @@ if __name__ == '__main__':
+ env["MOZ_JAR_LOG_FILE"] = os.path.abspath(jarlog)
+ print "jarlog: %s" % env["MOZ_JAR_LOG_FILE"]
-- url = "http://localhost:%d/index.html" % PORT
-+ url = "http://127.0.0.1:%d/index.html" % PORT
- appPath = os.path.join(SCRIPT_DIR, automation.DEFAULT_APP)
- status = automation.runApp(url, browserEnv, appPath, PROFILE_DIRECTORY, {},
- debuggerInfo=debuggerInfo,
+- 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/firefox-esr/files/patch-clang33 b/www/firefox-esr/files/patch-clang33
deleted file mode 100644
index dbf18eb4b70d..000000000000
--- a/www/firefox-esr/files/patch-clang33
+++ /dev/null
@@ -1,25 +0,0 @@
---- js/src/jspropertycacheinlines.h~
-+++ js/src/jspropertycacheinlines.h
-@@ -31,7 +31,7 @@ JS_ALWAYS_INLINE void
- js::PropertyCache::test(JSContext *cx, jsbytecode *pc, JSObject *&obj,
- JSObject *&pobj, PropertyCacheEntry *&entry, PropertyName *&name)
- {
-- AssertRootingUnnecessary assert(cx);
-+ js::AssertRootingUnnecessary assert(cx);
-
- JS_ASSERT(this == &JS_PROPERTY_CACHE(cx));
-
---- js/src/vm/ObjectImpl-inl.h~
-+++ js/src/vm/ObjectImpl-inl.h
-@@ -176,9 +176,9 @@ js::ObjectImpl::initializeSlotRange(uint
- JSCompartment *comp = compartment();
- uint32_t offset = start;
- for (HeapSlot *sp = fixedStart; sp < fixedEnd; sp++)
-- sp->init(comp, this->asObjectPtr(), offset++, UndefinedValue());
-+ sp->init(comp, this->asObjectPtr(), offset++, js::UndefinedValue());
- for (HeapSlot *sp = slotsStart; sp < slotsEnd; sp++)
-- sp->init(comp, this->asObjectPtr(), offset++, UndefinedValue());
-+ sp->init(comp, this->asObjectPtr(), offset++, js::UndefinedValue());
- }
-
- inline bool
diff --git a/www/firefox-esr/files/patch-duckduckgo b/www/firefox-esr/files/patch-duckduckgo
new file mode 100644
index 000000000000..bc3a7e321f41
--- /dev/null
+++ b/www/firefox-esr/files/patch-duckduckgo
@@ -0,0 +1,47 @@
+diff -r f2fa4ae74ee1 browser/locales/en-US/chrome/browser-region/region.properties
+--- browser/locales/en-US/chrome/browser-region/region.properties Mon Oct 24 22:54:18 2011 +0300
++++ browser/locales/en-US/chrome/browser-region/region.properties Tue Oct 25 21:13:40 2011 -0400
+@@ -9,6 +9,7 @@
+ 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
+--- /dev/null 2013-02-09 00:33:00.000000000 +0100
++++ browser/locales/en-US/searchplugins/duckduckgo.xml 2013-02-09 00:40:19.000000000 +0100
+@@ -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 -r f2fa4ae74ee1 browser/locales/en-US/searchplugins/list.txt
+--- browser/locales/en-US/searchplugins/list.txt Mon Oct 24 22:54:18 2011 +0300
++++ browser/locales/en-US/searchplugins/list.txt Tue Oct 25 21:13:40 2011 -0400
+@@ -1,7 +1,8 @@
+ amazondotcom
+ bing
++duckduckgo
+ eBay
+ google
+ twitter
+ wikipedia
+ yahoo
+--- browser/app/profile/firefox.js.orig 2013-02-09 12:26:02.000000000 +0100
++++ browser/app/profile/firefox.js 2013-02-09 12:26:19.000000000 +0100
+@@ -341,6 +341,7 @@
+ 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/firefox-esr/files/patch-ipc-chromium-Makefile.in b/www/firefox-esr/files/patch-ipc-chromium-Makefile.in
index b660c3662bb0..0e20edf2ee37 100644
--- a/www/firefox-esr/files/patch-ipc-chromium-Makefile.in
+++ b/www/firefox-esr/files/patch-ipc-chromium-Makefile.in
@@ -1,20 +1,5 @@
--- ipc/chromium/Makefile.in~
+++ ipc/chromium/Makefile.in
-@@ -43,6 +43,14 @@ include $(DEPTH)/config/autoconf.mk
-
- OS_CXXFLAGS := $(filter-out -fshort-wchar,$(OS_CXXFLAGS))
-
-+# workaround IPC hang with libevent2
-+ifndef MOZ_DEBUG
-+ifneq (,$(filter 4.2.%, $(CXX_VERSION)))
-+MOZ_OPTIMIZE_FLAGS = -O1
-+OS_CXXFLAGS += $(MOZ_OPTIMIZE_FLAGS)
-+endif
-+endif
-+
- LIBRARY_NAME = chromium_s
- FORCE_STATIC_LIB = 1
- LIBXUL_LIBRARY = 1
@@ -55,9 +60,7 @@ vpath %.c \
$(srcdir)/src/third_party/libevent \
$(NULL)
diff --git a/www/firefox-esr/files/patch-ipc-chromium-src-base-message_pump_libevent.cc b/www/firefox-esr/files/patch-ipc-chromium-src-base-message_pump_libevent.cc
index 7d4dc959eedf..02b6a5e90eca 100644
--- a/www/firefox-esr/files/patch-ipc-chromium-src-base-message_pump_libevent.cc
+++ b/www/firefox-esr/files/patch-ipc-chromium-src-base-message_pump_libevent.cc
@@ -1,9 +1,9 @@
--- ipc/chromium/src/base/message_pump_libevent.cc~
+++ ipc/chromium/src/base/message_pump_libevent.cc
-@@ -15,7 +15,7 @@
- #include "base/scoped_nsautorelease_pool.h"
+@@ -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"
diff --git a/www/firefox-esr/files/patch-js-src-methodjit-MethodJIT.cpp b/www/firefox-esr/files/patch-js-src-methodjit-MethodJIT.cpp
deleted file mode 100644
index d29c15ccc05a..000000000000
--- a/www/firefox-esr/files/patch-js-src-methodjit-MethodJIT.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
---- js/src/methodjit/MethodJIT.cpp~
-+++ js/src/methodjit/MethodJIT.cpp
-@@ -171,7 +171,7 @@
-
- JS_STATIC_ASSERT(offsetof(FrameRegs, sp) == 0);
-
--#if defined(__linux__) && defined(JS_CPU_X64)
-+#if defined(__ELF__) && defined(JS_CPU_X64)
- # define SYMBOL_STRING_RELOC(name) #name "@plt"
- #else
- # define SYMBOL_STRING_RELOC(name) SYMBOL_STRING(name)
-@@ -149,7 +149,7 @@
-
- #if defined(XP_MACOSX)
- # define HIDE_SYMBOL(name) ".private_extern _" #name
--#elif defined(__linux__)
-+#elif defined(__ELF__)
- # define HIDE_SYMBOL(name) ".hidden" #name
- #else
- # define HIDE_SYMBOL(name)
diff --git a/www/firefox-esr/files/patch-media-libsydneyaudio-src-sydney_audio_oss.c b/www/firefox-esr/files/patch-media-libsydneyaudio-src-sydney_audio_oss.c
deleted file mode 100644
index a7fd5f1ffd09..000000000000
--- a/www/firefox-esr/files/patch-media-libsydneyaudio-src-sydney_audio_oss.c
+++ /dev/null
@@ -1,13 +0,0 @@
---- media/libsydneyaudio/src/sydney_audio_oss.c~
-+++ media/libsydneyaudio/src/sydney_audio_oss.c
-@@ -446,6 +446,10 @@ static void audio_callback(void* data)
- printf("!"); /* not enough audio data */
- #endif
- bytes = bytes-bytes_to_copy;
-+ struct timespec ts = {0, 1000000};
-+ pthread_mutex_unlock(&s->mutex);
-+ nanosleep(&ts, NULL);
-+ pthread_mutex_lock(&s->mutex);
- break;
- }
- free(s->bl_head);
diff --git a/www/firefox-esr/files/patch-media-webrtc-trunk-src-system_wrappers-source-spreadsortlib-spreadsort.hpp b/www/firefox-esr/files/patch-media-webrtc-trunk-src-system_wrappers-source-spreadsortlib-spreadsort.hpp
new file mode 100644
index 000000000000..eeb58e7baa20
--- /dev/null
+++ b/www/firefox-esr/files/patch-media-webrtc-trunk-src-system_wrappers-source-spreadsortlib-spreadsort.hpp
@@ -0,0 +1,16 @@
+--- media/webrtc/trunk/webrtc/system_wrappers/source/spreadsortlib/spreadsort.hpp~
++++ 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/firefox-esr/files/patch-no-videoio.h b/www/firefox-esr/files/patch-no-videoio.h
new file mode 100644
index 000000000000..c20c0e039827
--- /dev/null
+++ b/www/firefox-esr/files/patch-no-videoio.h
@@ -0,0 +1,22 @@
+--- media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc
++++ media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc
+@@ -19,7 +19,7 @@
+ #include <stdlib.h>
+
+ //v4l includes
+-#if defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__)
++#if defined(__NetBSD__) || defined(__OpenBSD__)
+ #include <sys/videoio.h>
+ #elif defined(__sun)
+ #include <sys/videodev2.h>
+--- media/webrtc/trunk/webrtc/modules/video_capture/linux/video_capture_linux.cc
++++ media/webrtc/trunk/webrtc/modules/video_capture/linux/video_capture_linux.cc
+@@ -18,7 +18,7 @@
+ #include <string.h>
+
+ //v4l includes
+-#if defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__)
++#if defined(__NetBSD__) || defined(__OpenBSD__)
+ #include <sys/videoio.h>
+ #elif defined(__sun)
+ #include <sys/videodev2.h>
diff --git a/www/firefox-esr/files/patch-z-bug762445 b/www/firefox-esr/files/patch-z-bug762445
deleted file mode 100644
index fd42fea9cab2..000000000000
--- a/www/firefox-esr/files/patch-z-bug762445
+++ /dev/null
@@ -1,70 +0,0 @@
-commit b44dc8e
-Author: Jan Beich <jbeich@tormail.org>
-Date: Fri Oct 12 18:49:59 2012 +0000
-
- Bug 762445 - Add jemalloc3 glue for heap-committed, heap-dirty in about:memory.
----
- memory/build/mozjemalloc_compat.c | 34 ++++++++++++++++++++++++++++------
- 1 file changed, 28 insertions(+), 6 deletions(-)
-
-diff --git memory/build/mozjemalloc_compat.c memory/build/mozjemalloc_compat.c
-index 94ad96e..7adfef5 100644
---- memory/build/mozjemalloc_compat.c
-+++ memory/build/mozjemalloc_compat.c
-@@ -11,15 +11,50 @@
- #define wrap(a) je_ ## a
- #endif
-
--extern MOZ_IMPORT_API(int)
-+/*
-+ * CTL_* macros are from memory/jemalloc/src/src/stats.c with changes:
-+ * - drop `t' argument to avoid redundancy in calculating type size
-+ * - require `i' argument for arena number explicitly
-+ */
-+
-+#define CTL_GET(n, v) do { \
-+ size_t sz = sizeof(v); \
-+ wrap(mallctl)(n, &v, &sz, NULL, 0); \
-+} while (0)
-+
-+#define CTL_I_GET(n, v, i) do { \
-+ size_t mib[6]; \
-+ size_t miblen = sizeof(mib) / sizeof(mib[0]); \
-+ size_t sz = sizeof(v); \
-+ wrap(mallctlnametomib)(n, mib, &miblen); \
-+ mib[2] = i; \
-+ wrap(mallctlbymib)(mib, miblen, &v, &sz, NULL, 0); \
-+} while (0)
-+
-+MOZ_IMPORT_API(int)
- wrap(mallctl)(const char*, void*, size_t*, void*, size_t);
-+MOZ_IMPORT_API(int)
-+wrap(mallctlnametomib)(const char *name, size_t *mibp, size_t *miblenp);
-+MOZ_IMPORT_API(int)
-+wrap(mallctlbymib)(const size_t *mib, size_t miblen, void *oldp, size_t *oldlenp, void *newp, size_t newlen);
-
- MOZ_EXPORT_API(void)
- jemalloc_stats(jemalloc_stats_t *stats)
- {
-- size_t size = sizeof(stats->mapped);
-- wrap(mallctl)("stats.mapped", &stats->mapped, &size, NULL, 0);
-- wrap(mallctl)("stats.allocated", &stats->allocated, &size, NULL, 0);
-- stats->committed = -1;
-- stats->dirty = -1;
-+ unsigned narenas;
-+ size_t active, allocated, mapped, page, pdirty;
-+
-+ CTL_GET("arenas.narenas", narenas);
-+ CTL_GET("arenas.page", page);
-+ CTL_GET("stats.active", active);
-+ CTL_GET("stats.allocated", allocated);
-+ CTL_GET("stats.mapped", mapped);
-+
-+ /* get the summation for all arenas, i == narenas */
-+ CTL_I_GET("stats.arenas.0.pdirty", pdirty, narenas);
-+
-+ stats->allocated = allocated;
-+ stats->mapped = mapped;
-+ stats->dirty = pdirty * page;
-+ stats->committed = active + stats->dirty;
- }