[SVN-Commit] r1854 - in trunk: mail/thunderbird mail/thunderbird/files www/firefox/files

svn-freebsd-gecko at chruetertee.ch svn-freebsd-gecko at chruetertee.ch
Fri Jul 24 01:25:21 UTC 2015


Author: jbeich
Date: Fri Jul 24 01:20:55 2015
New Revision: 1854

Log:
sync with ports

Added:
   trunk/mail/thunderbird/files/patch-bug1041268
   trunk/mail/thunderbird/files/patch-bug1073117
   trunk/mail/thunderbird/files/patch-bug1138845
   trunk/mail/thunderbird/files/patch-bug1143686
   trunk/mail/thunderbird/files/patch-bug1144643
   trunk/mail/thunderbird/files/patch-media-libstagefright-foundation-AString.cpp
   trunk/mail/thunderbird/files/patch-media-mtransport-third_party-nICEr-src-util-mbslen.c
   trunk/mail/thunderbird/files/patch-media-webrtc-trunk-src-system_wrappers-source-spreadsortlib-spreadsort.hpp
   trunk/mail/thunderbird/files/patch-memory-jemalloc-Makefile.in
   trunk/mail/thunderbird/files/patch-system-openh264
   trunk/mail/thunderbird/files/patch-toolkit_mozapps_installer_packager_mk
Deleted:
   trunk/mail/thunderbird/files/patch-bug1013675
   trunk/mail/thunderbird/files/patch-bug1015547
   trunk/mail/thunderbird/files/patch-bug1021171
   trunk/mail/thunderbird/files/patch-bug1026828
   trunk/mail/thunderbird/files/patch-bug1041795
   trunk/mail/thunderbird/files/patch-bug1046224
   trunk/mail/thunderbird/files/patch-bug1073709
   trunk/mail/thunderbird/files/patch-bug1082199
   trunk/mail/thunderbird/files/patch-bug1103858
   trunk/mail/thunderbird/files/patch-bug1125579
   trunk/mail/thunderbird/files/patch-bug1125580
   trunk/mail/thunderbird/files/patch-bug858919
   trunk/mail/thunderbird/files/patch-bug961264
   trunk/mail/thunderbird/files/patch-mozilla-media-mtransport-third_party-nICEr-src-util-mbslen.c
   trunk/mail/thunderbird/files/patch-mozilla-media-webrtc-trunk-src-system_wrappers-source-spreadsortlib-spreadsort.hpp
   trunk/mail/thunderbird/files/patch-mozilla-memory-jemalloc-Makefile.in
   trunk/mail/thunderbird/files/patch-mozilla_toolkit_mozapps_installer_packager_mk
   trunk/www/firefox/files/patch-bug1143411
Modified:
   trunk/mail/thunderbird/Makefile
   trunk/mail/thunderbird/distinfo
   trunk/mail/thunderbird/files/patch-bug1021761
   trunk/mail/thunderbird/files/patch-bug1130155
   trunk/mail/thunderbird/files/patch-bug702179
   trunk/mail/thunderbird/files/patch-bug779713
   trunk/mail/thunderbird/files/patch-bug826985
   trunk/mail/thunderbird/files/patch-bug847568
   trunk/mail/thunderbird/files/patch-config-baseconfig.mk
   trunk/mail/thunderbird/files/patch-ijg-libjpeg
   trunk/mail/thunderbird/files/patch-mail-app-nsMailApp.cpp
   trunk/mail/thunderbird/files/patch-z-bug517422

Modified: trunk/mail/thunderbird/Makefile
==============================================================================
--- trunk/mail/thunderbird/Makefile	Wed Jul 15 17:06:44 2015	(r1853)
+++ trunk/mail/thunderbird/Makefile	Fri Jul 24 01:20:55 2015	(r1854)
@@ -1,9 +1,8 @@
 # Created by: Joe Marcus Clarke <marcus at FreeBSD.org>
-# $FreeBSD: head/mail/thunderbird/Makefile 388940 2015-06-09 14:25:41Z jbeich $
+# $FreeBSD: head/mail/thunderbird/Makefile 392761 2015-07-23 23:36:07Z jbeich $
 
 PORTNAME=	thunderbird
-DISTVERSION=	31.7.0
-PORTREVISION=	1
+DISTVERSION=	38.1.0
 CATEGORIES=	mail news net-im ipv6
 MASTER_SITES=	MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \
 		MOZILLA/${PORTNAME}/candidates/${DISTVERSION}-candidates/build1/source
@@ -13,31 +12,32 @@
 MAINTAINER=	gecko at FreeBSD.org
 COMMENT=	Mozilla Thunderbird is standalone mail and news that stands above
 
-BUILD_DEPENDS=	nspr>=4.10.6:${PORTSDIR}/devel/nspr \
-		nss>=3.16.2.3:${PORTSDIR}/security/nss \
+BUILD_DEPENDS=	nspr>=4.10.8:${PORTSDIR}/devel/nspr \
+		nss>=3.19.2:${PORTSDIR}/security/nss \
 		libevent2>=2.0.21_2:${PORTSDIR}/devel/libevent2 \
 		cairo>=1.12.16_1,2:${PORTSDIR}/graphics/cairo \
 		soundtouch>=1.8.0:${PORTSDIR}/audio/soundtouch \
-		harfbuzz>=0.9.25:${PORTSDIR}/print/harfbuzz \
+		harfbuzz>=0.9.34:${PORTSDIR}/print/harfbuzz \
 		graphite2>=1.2.4:${PORTSDIR}/graphics/graphite2 \
 		libvorbis>=1.3.5:${PORTSDIR}/audio/libvorbis \
 		opus>=1.1:${PORTSDIR}/audio/opus \
 		libvpx>=1.3.0:${PORTSDIR}/multimedia/libvpx \
-		sqlite3>=3.8.4.2:${PORTSDIR}/databases/sqlite3 \
+		sqlite3>=3.8.9:${PORTSDIR}/databases/sqlite3 \
 		${PYTHON_PKGNAMEPREFIX}sqlite3>0:${PORTSDIR}/databases/py-sqlite3 \
 		v4l_compat>0:${PORTSDIR}/multimedia/v4l_compat \
 		autoconf-2.13:${PORTSDIR}/devel/autoconf213 \
 		zip:${PORTSDIR}/archivers/zip \
 		unzip:${PORTSDIR}/archivers/unzip
+#		opus>=1.1:${PORTSDIR}/audio/opus \
 
 LIB_DEPENDS=	libv4l2.so:${PORTSDIR}/multimedia/libv4l
 
 EM_VERSION=	1.8.2
-L_VERSION=	3.3.7
+L_VERSION=	4.0.1
 
 SSP_UNSAFE=	yes
 USE_GECKO=	gecko
-USE_MOZILLA=	# empty
+USE_MOZILLA=	-opus
 
 USE_QT5=	# empty
 QT_NONSTANDARD=	yes
@@ -67,7 +67,7 @@
 
 .include <bsd.port.pre.mk>
 
-WRKSRC=		${WRKDIR}/comm-esr31
+WRKSRC=		${WRKDIR}/comm-esr38
 MOZSRC:=	${WRKSRC}/mozilla
 
 XPI_LIBDIR=	${PREFIX}/lib/xpi
@@ -103,7 +103,7 @@
 MOZ_OPTIONS+=	--enable-calendar
 MOZ_MK_OPTIONS+=	MOZ_CO_PROJECT=calendar
 LIGHTNING_DIR=	share/lightning
-XPI_FILE=	${MOZ_OBJDIR}/mozilla/dist/xpi-stage/lightning-${L_VERSION}.en-US.${OPSYS:tl}${OSREL}-${ARCH:S/amd64/x86_64/}.xpi
+XPI_FILE=	${MOZ_OBJDIR}/dist/xpi-stage/lightning-${L_VERSION}.en-US.${OPSYS:tl}${OSREL}-${ARCH:S/amd64/x86_64/}.xpi
 XPI_ORIG_ID=	{e2fda1a4-762b-4020-b5ad-a41df1933103}
 XPI_ID=		lightning at thunderbird.mozilla.org
 .else

Modified: trunk/mail/thunderbird/distinfo
==============================================================================
--- trunk/mail/thunderbird/distinfo	Wed Jul 15 17:06:44 2015	(r1853)
+++ trunk/mail/thunderbird/distinfo	Fri Jul 24 01:20:55 2015	(r1854)
@@ -1,4 +1,4 @@
-SHA256 (thunderbird-31.7.0.source.tar.bz2) = dc3a6afaab486ba09745898f55986f98cc9bf7647cd992849f9c7ead563479b7
-SIZE (thunderbird-31.7.0.source.tar.bz2) = 171059989
+SHA256 (thunderbird-38.1.0.source.tar.bz2) = ddf1fd6048f07370bb0375eac76e687c19d29100c19e9f86fc04bb88d4409787
+SIZE (thunderbird-38.1.0.source.tar.bz2) = 204161689
 SHA256 (enigmail-1.8.2.tar.gz) = 1d2700799bc52aaa8e8c9f7a0f5111281ff9fbdffc093cdff070657d574eb2a6
 SIZE (enigmail-1.8.2.tar.gz) = 1604159

Deleted: trunk/mail/thunderbird/files/patch-bug1013675
==============================================================================
--- trunk/mail/thunderbird/files/patch-bug1013675	Fri Jul 24 01:20:55 2015	(r1853)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,88 +0,0 @@
-diff --git xpcom/base/nsDebugImpl.cpp xpcom/base/nsDebugImpl.cpp
-index 13a286f..293bd73 100644
---- mozilla/xpcom/base/nsDebugImpl.cpp
-+++ mozilla/xpcom/base/nsDebugImpl.cpp
-@@ -45,12 +45,43 @@
- #endif
- #endif
- 
--#if defined(XP_MACOSX)
-+#if defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \
-+ || defined(__NetBSD__) || defined(__OpenBSD__)
- #include <stdbool.h>
- #include <unistd.h>
-+#include <sys/param.h>
- #include <sys/sysctl.h>
- #endif
- 
-+#if defined(__OpenBSD__)
-+#include <sys/proc.h>
-+#endif
-+
-+#if defined(__DragonFly__) || defined(__FreeBSD__)
-+#include <sys/user.h>
-+#endif
-+
-+#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_FLAGS kp_proc.p_flag
-+#elif defined(__DragonFly__)
-+#define KP_FLAGS kp_flags
-+#elif defined(__FreeBSD__)
-+#define KP_FLAGS ki_flag
-+#elif defined(__OpenBSD__) && !defined(_P_TRACED)
-+#define KP_FLAGS p_psflags
-+#define P_TRACED PS_TRACED
-+#else
-+#define KP_FLAGS p_flag
-+#endif
-+
- #include "mozilla/mozalloc_abort.h"
- 
- static void
-@@ -144,16 +175,22 @@ nsDebugImpl::GetIsDebuggerAttached(bool* aResult)
- 
- #if defined(XP_WIN)
-   *aResult = ::IsDebuggerPresent();
--#elif defined(XP_MACOSX)
-+#elif defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \
-+   || defined(__NetBSD__) || defined(__OpenBSD__)
-   // Specify the info we're looking for
--  int mib[4];
--  mib[0] = CTL_KERN;
--  mib[1] = KERN_PROC;
--  mib[2] = KERN_PROC_PID;
--  mib[3] = getpid();
-+  int mib[] = {
-+    CTL_KERN,
-+    KERN_PROC,
-+    KERN_PROC_PID,
-+    getpid(),
-+#if defined(__NetBSD__) || defined(__OpenBSD__)
-+    sizeof(KINFO_PROC),
-+    1,
-+#endif
-+  };
-   size_t mibSize = sizeof(mib) / sizeof(int);
- 
--  struct kinfo_proc info;
-+  KINFO_PROC info;
-   size_t infoSize = sizeof(info);
-   memset(&info, 0, infoSize);
- 
-@@ -163,7 +200,7 @@ nsDebugImpl::GetIsDebuggerAttached(bool* aResult)
-     return NS_OK;
-   }
- 
--  if (info.kp_proc.p_flag & P_TRACED) {
-+  if (info.KP_FLAGS & P_TRACED) {
-     *aResult = true;
-   }
- #endif

Deleted: trunk/mail/thunderbird/files/patch-bug1015547
==============================================================================
--- trunk/mail/thunderbird/files/patch-bug1015547	Fri Jul 24 01:20:55 2015	(r1853)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,95 +0,0 @@
-diff --git configure.in configure.in
-index 7bed45f..053de17 100644
---- mozilla/configure.in
-+++ mozilla/configure.in
-@@ -2950,7 +2950,7 @@ dnl Checks for library functions.
- dnl ========================================================
- AC_PROG_GCC_TRADITIONAL
- AC_FUNC_MEMCMP
--AC_CHECK_FUNCS(stat64 lstat64 truncate64 statvfs64 statvfs statfs64 statfs getpagesize localtime_r)
-+AC_CHECK_FUNCS(stat64 lstat64 truncate64 statvfs64 statvfs statfs64 statfs getpagesize localtime_r arc4random arc4random_buf)
- 
- dnl check for clock_gettime(), the CLOCK_MONOTONIC clock
- AC_CACHE_CHECK(for clock_gettime(CLOCK_MONOTONIC),
-diff --git xpcom/base/nsUUIDGenerator.cpp xpcom/base/nsUUIDGenerator.cpp
-index 0687344..ca3ff8b 100644
---- mozilla/xpcom/base/nsUUIDGenerator.cpp
-+++ mozilla/xpcom/base/nsUUIDGenerator.cpp
-@@ -15,6 +15,10 @@
- 
- #include "nsUUIDGenerator.h"
- 
-+#ifdef ANDROID
-+extern "C" NS_EXPORT void arc4random_buf(void *, size_t);
-+#endif
-+
- using namespace mozilla;
- 
- NS_IMPL_ISUPPORTS1(nsUUIDGenerator, nsIUUIDGenerator)
-@@ -34,7 +38,7 @@ nsUUIDGenerator::Init()
-     // We're a service, so we're guaranteed that Init() is not going
-     // to be reentered while we're inside Init().
-     
--#if !defined(XP_WIN) && !defined(XP_MACOSX) && !defined(ANDROID)
-+#if !defined(XP_WIN) && !defined(XP_MACOSX) && !defined(HAVE_ARC4RANDOM)
-     /* initialize random number generator using NSPR random noise */
-     unsigned int seed;
- 
-@@ -67,7 +71,7 @@ nsUUIDGenerator::Init()
-         return NS_ERROR_FAILURE;
- #endif
- 
--#endif /* non XP_WIN and non XP_MACOSX */
-+#endif /* non XP_WIN and non XP_MACOSX and non ARC4RANDOM */
- 
-     return NS_OK;
- }
-@@ -114,13 +118,16 @@ nsUUIDGenerator::GenerateUUIDInPlace(nsID* id)
-      * back to it; instead, we use the value returned when we called
-      * initstate, since older glibc's have broken setstate() return values
-      */
--#ifndef ANDROID
-+#ifndef HAVE_ARC4RANDOM
-     setstate(mState);
- #endif
- 
-+#ifdef HAVE_ARC4RANDOM_BUF
-+    arc4random_buf(id, sizeof(nsID));
-+#else /* HAVE_ARC4RANDOM_BUF */
-     size_t bytesLeft = sizeof(nsID);
-     while (bytesLeft > 0) {
--#ifdef ANDROID
-+#ifdef HAVE_ARC4RANDOM
-         long rval = arc4random();
-         const size_t mRBytes = 4;
- #else
-@@ -141,6 +148,7 @@ nsUUIDGenerator::GenerateUUIDInPlace(nsID* id)
- 
-         bytesLeft -= toWrite;
-     }
-+#endif /* HAVE_ARC4RANDOM_BUF */
- 
-     /* Put in the version */
-     id->m2 &= 0x0fff;
-@@ -150,7 +158,7 @@ nsUUIDGenerator::GenerateUUIDInPlace(nsID* id)
-     id->m3[0] &= 0x3f;
-     id->m3[0] |= 0x80;
- 
--#ifndef ANDROID
-+#ifndef HAVE_ARC4RANDOM
-     /* Restore the previous RNG state */
-     setstate(mSavedState);
- #endif
-diff --git xpcom/base/nsUUIDGenerator.h xpcom/base/nsUUIDGenerator.h
-index 6a24212..68ed6f2 100644
---- mozilla/xpcom/base/nsUUIDGenerator.h
-+++ mozilla/xpcom/base/nsUUIDGenerator.h
-@@ -27,7 +27,7 @@ private:
- protected:
- 
-     mozilla::Mutex mLock;
--#if !defined(XP_WIN) && !defined(XP_MACOSX) && !defined(ANDROID)
-+#if !defined(XP_WIN) && !defined(XP_MACOSX) && !defined(HAVE_ARC4RANDOM)
-     char mState[128];
-     char *mSavedState;
-     uint8_t mRBytes;

Deleted: trunk/mail/thunderbird/files/patch-bug1021171
==============================================================================
--- trunk/mail/thunderbird/files/patch-bug1021171	Fri Jul 24 01:20:55 2015	(r1853)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,193 +0,0 @@
-commit dd19f59
-Author: Trevor Saunders <trev.saunders at gmail.com>
-Date:   Fri Jun 6 15:31:30 2014 -0400
-
-    bug 1021171 - don't return nulllptr in functions returning bool r=bz,waldo
----
- js/src/builtin/TypedObject.cpp        | 32 ++++++++++++++++----------------
- js/src/frontend/BytecodeCompiler.cpp  |  2 +-
- js/xpconnect/wrappers/XrayWrapper.cpp |  2 +-
- netwerk/ipc/NeckoParent.cpp           |  2 +-
- 4 files changed, 19 insertions(+), 19 deletions(-)
-
-diff --git js/src/builtin/TypedObject.cpp js/src/builtin/TypedObject.cpp
-index 9e284b9..7a0a7fc 100644
---- mozilla/js/src/builtin/TypedObject.cpp
-+++ mozilla/js/src/builtin/TypedObject.cpp
-@@ -710,12 +710,12 @@ ArrayMetaTypeDescr::construct(JSContext *cx, unsigned argc, Value *vp)
-     contents.append(")");
-     RootedAtom stringRepr(cx, contents.finishAtom());
-     if (!stringRepr)
--        return nullptr;
-+        return false;
- 
-     // Extract ArrayType.prototype
-     RootedObject arrayTypePrototype(cx, GetPrototype(cx, arrayTypeGlobal));
-     if (!arrayTypePrototype)
--        return nullptr;
-+        return false;
- 
-     // Create the instance of ArrayType
-     Rooted<UnsizedArrayTypeDescr *> obj(cx);
-@@ -728,7 +728,7 @@ ArrayMetaTypeDescr::construct(JSContext *cx, unsigned argc, Value *vp)
-     if (!JSObject::defineProperty(cx, obj, cx->names().length,
-                                   UndefinedHandleValue, nullptr, nullptr,
-                                   JSPROP_READONLY | JSPROP_PERMANENT))
--        return nullptr;
-+        return false;
- 
-     args.rval().setObject(*obj);
-     return true;
-@@ -762,7 +762,7 @@ UnsizedArrayTypeDescr::dimension(JSContext *cx, unsigned int argc, jsval *vp)
-     if (!size.isValid()) {
-         JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr,
-                              JSMSG_TYPEDOBJECT_TOO_BIG);
--        return nullptr;
-+        return false;
-     }
- 
-     // Construct a canonical string `new ArrayType(<elementType>).dimension(N)`:
-@@ -775,7 +775,7 @@ UnsizedArrayTypeDescr::dimension(JSContext *cx, unsigned int argc, jsval *vp)
-     contents.append(")");
-     RootedAtom stringRepr(cx, contents.finishAtom());
-     if (!stringRepr)
--        return nullptr;
-+        return false;
- 
-     // Create the sized type object.
-     Rooted<SizedArrayTypeDescr*> obj(cx);
-@@ -793,7 +793,7 @@ UnsizedArrayTypeDescr::dimension(JSContext *cx, unsigned int argc, jsval *vp)
-     if (!JSObject::defineProperty(cx, obj, cx->names().length,
-                                   lengthVal, nullptr, nullptr,
-                                   JSPROP_READONLY | JSPROP_PERMANENT))
--        return nullptr;
-+        return false;
- 
-     // Add `unsized` property, which is a link from the sized
-     // array to the unsized array.
-@@ -801,7 +801,7 @@ UnsizedArrayTypeDescr::dimension(JSContext *cx, unsigned int argc, jsval *vp)
-     if (!JSObject::defineProperty(cx, obj, cx->names().unsized,
-                                   unsizedTypeDescrValue, nullptr, nullptr,
-                                   JSPROP_READONLY | JSPROP_PERMANENT))
--        return nullptr;
-+        return false;
- 
-     args.rval().setObject(*obj);
-     return true;
-@@ -1253,7 +1253,7 @@ DefineSimpleTypeDescr(JSContext *cx,
-     Rooted<TypedProto*> proto(cx);
-     proto = NewObjectWithProto<TypedProto>(cx, objProto, nullptr, TenuredObject);
-     if (!proto)
--        return nullptr;
-+        return false;
-     proto->initTypeDescrSlot(*descr);
-     descr->initReservedSlot(JS_DESCR_SLOT_TYPROTO, ObjectValue(*proto));
- 
-@@ -1358,14 +1358,14 @@ GlobalObject::initTypedObjectModule(JSContext *cx, Handle<GlobalObject*> global)
- #define BINARYDATA_SCALAR_DEFINE(constant_, type_, name_)                       \
-     if (!DefineSimpleTypeDescr<ScalarTypeDescr>(cx, global, module, constant_,      \
-                                             cx->names().name_))                 \
--        return nullptr;
-+        return false;
-     JS_FOR_EACH_SCALAR_TYPE_REPR(BINARYDATA_SCALAR_DEFINE)
- #undef BINARYDATA_SCALAR_DEFINE
- 
- #define BINARYDATA_REFERENCE_DEFINE(constant_, type_, name_)                    \
-     if (!DefineSimpleTypeDescr<ReferenceTypeDescr>(cx, global, module, constant_,   \
-                                                cx->names().name_))              \
--        return nullptr;
-+        return false;
-     JS_FOR_EACH_REFERENCE_TYPE_REPR(BINARYDATA_REFERENCE_DEFINE)
- #undef BINARYDATA_REFERENCE_DEFINE
- 
-@@ -1375,14 +1375,14 @@ GlobalObject::initTypedObjectModule(JSContext *cx, Handle<GlobalObject*> global)
-     arrayType = DefineMetaTypeDescr<ArrayMetaTypeDescr>(
-         cx, global, module, TypedObjectModuleObject::ArrayTypePrototype);
-     if (!arrayType)
--        return nullptr;
-+        return false;
- 
-     RootedValue arrayTypeValue(cx, ObjectValue(*arrayType));
-     if (!JSObject::defineProperty(cx, module, cx->names().ArrayType,
-                                   arrayTypeValue,
-                                   nullptr, nullptr,
-                                   JSPROP_READONLY | JSPROP_PERMANENT))
--        return nullptr;
-+        return false;
- 
-     // StructType.
- 
-@@ -1390,14 +1390,14 @@ GlobalObject::initTypedObjectModule(JSContext *cx, Handle<GlobalObject*> global)
-     structType = DefineMetaTypeDescr<StructMetaTypeDescr>(
-         cx, global, module, TypedObjectModuleObject::StructTypePrototype);
-     if (!structType)
--        return nullptr;
-+        return false;
- 
-     RootedValue structTypeValue(cx, ObjectValue(*structType));
-     if (!JSObject::defineProperty(cx, module, cx->names().StructType,
-                                   structTypeValue,
-                                   nullptr, nullptr,
-                                   JSPROP_READONLY | JSPROP_PERMANENT))
--        return nullptr;
-+        return false;
- 
-     // Everything is setup, install module on the global object:
-     RootedValue moduleValue(cx, ObjectValue(*module));
-@@ -1407,7 +1407,7 @@ GlobalObject::initTypedObjectModule(JSContext *cx, Handle<GlobalObject*> global)
-                                   nullptr, nullptr,
-                                   0))
-     {
--        return nullptr;
-+        return false;
-     }
- 
-     return module;
-@@ -2449,7 +2449,7 @@ TypedObject::constructUnsized(JSContext *cx, unsigned int argc, Value *vp)
-         if (length < 0) {
-             JS_ReportErrorNumber(cx, js_GetErrorMessage,
-                                  nullptr, JSMSG_TYPEDOBJECT_BAD_ARGS);
--            return nullptr;
-+            return false;
-         }
-         Rooted<TypedObject*> obj(cx, createZeroed(cx, callee, length));
-         if (!obj)
-diff --git js/src/frontend/BytecodeCompiler.cpp js/src/frontend/BytecodeCompiler.cpp
-index 5aacc23..aed45ca 100644
---- mozilla/js/src/frontend/BytecodeCompiler.cpp
-+++ mozilla/js/src/frontend/BytecodeCompiler.cpp
-@@ -544,7 +544,7 @@ CompileFunctionBody(JSContext *cx, MutableHandleFunction fun, const ReadOnlyComp
- 
-     RootedScriptSource sourceObject(cx, CreateScriptSourceObject(cx, options));
-     if (!sourceObject)
--        return nullptr;
-+        return false;
-     ScriptSource* ss = sourceObject->source();
- 
-     SourceCompressionTask sct(cx);
-diff --git js/xpconnect/wrappers/XrayWrapper.cpp js/xpconnect/wrappers/XrayWrapper.cpp
-index fd6458b..ab48770 100644
---- mozilla/js/xpconnect/wrappers/XrayWrapper.cpp
-+++ mozilla/js/xpconnect/wrappers/XrayWrapper.cpp
-@@ -363,7 +363,7 @@ public:
-         {
-             JSAutoCompartment ac(cx, target);
-             if (!JS_GetClassPrototype(cx, key, protop))
--                return nullptr;
-+                return false;
-         }
-         return JS_WrapObject(cx, protop);
-     }
-diff --git netwerk/ipc/NeckoParent.cpp netwerk/ipc/NeckoParent.cpp
-index 96dbb1d..ef3293b 100644
---- mozilla/netwerk/ipc/NeckoParent.cpp
-+++ mozilla/netwerk/ipc/NeckoParent.cpp
-@@ -365,7 +365,7 @@ NeckoParent::RecvPRtspChannelConstructor(
-   RtspChannelParent* p = static_cast<RtspChannelParent*>(aActor);
-   return p->Init(aConnectArgs);
- #else
--  return nullptr;
-+  return false;
- #endif
- }
- 

Modified: trunk/mail/thunderbird/files/patch-bug1021761
==============================================================================
--- trunk/mail/thunderbird/files/patch-bug1021761	Wed Jul 15 17:06:44 2015	(r1853)
+++ trunk/mail/thunderbird/files/patch-bug1021761	Fri Jul 24 01:20:55 2015	(r1854)
@@ -218,12 +218,12 @@
    assert(p);
  
    pthread_mutex_unlock(&stm->mutex);
-@@ -313,10 +360,10 @@ alsa_refill_stream(cubeb_stream * stm)
-     return ERROR;
-   }
-   if (got > 0) {
--    snd_pcm_sframes_t wrote = snd_pcm_writei(stm->pcm, p, got);
-+    snd_pcm_sframes_t wrote = WRAP(snd_pcm_writei)(stm->pcm, p, got);
+@@ -327,10 +374,10 @@ alsa_refill_stream(cubeb_stream * stm)
+         b[i] *= stm->volume;
+       }
+     }
+-    wrote = snd_pcm_writei(stm->pcm, p, got);
++    wrote = WRAP(snd_pcm_writei)(stm->pcm, p, got);
      if (wrote == -EPIPE) {
 -      snd_pcm_recover(stm->pcm, wrote, 1);
 -      wrote = snd_pcm_writei(stm->pcm, p, got);
@@ -533,42 +533,51 @@
    assert((nfds_t) r == stm->nfds);
  
    r = pthread_cond_init(&stm->cond, NULL);
-@@ -937,12 +1043,12 @@ alsa_get_max_channel_count(cubeb * ctx, uint32_t * max_channels)
+@@ -895,7 +1001,7 @@ alsa_stream_destroy(cubeb_stream * stm)
+   pthread_mutex_lock(&stm->mutex);
+   if (stm->pcm) {
+     if (stm->state == DRAINING) {
+-      snd_pcm_drain(stm->pcm);
++      WRAP(snd_pcm_drain)(stm->pcm);
+     }
+     alsa_locked_pcm_close(stm->pcm);
+     stm->pcm = NULL;
+@@ -938,12 +1044,12 @@ alsa_get_max_channel_count(cubeb * ctx, uint32_t * max_channels)
      return CUBEB_ERROR;
    }
  
--  rv = snd_pcm_hw_params_any(stm->pcm, hw_params);
-+  rv = WRAP(snd_pcm_hw_params_any)(stm->pcm, hw_params);
-   if (rv < 0) {
+-  r = snd_pcm_hw_params_any(stm->pcm, hw_params);
++  r = WRAP(snd_pcm_hw_params_any)(stm->pcm, hw_params);
+   if (r < 0) {
      return CUBEB_ERROR;
    }
  
--  rv = snd_pcm_hw_params_get_channels_max(hw_params, max_channels);
-+  rv = WRAP(snd_pcm_hw_params_get_channels_max)(hw_params, max_channels);
-   if (rv < 0) {
+-  r = snd_pcm_hw_params_get_channels_max(hw_params, max_channels);
++  r = WRAP(snd_pcm_hw_params_get_channels_max)(hw_params, max_channels);
+   if (r < 0) {
      return CUBEB_ERROR;
    }
-@@ -962,34 +1068,34 @@ alsa_get_preferred_sample_rate(cubeb * ctx, uint32_t * rate) {
+@@ -963,34 +1069,34 @@ alsa_get_preferred_sample_rate(cubeb * ctx, uint32_t * rate) {
  
    /* get a pcm, disabling resampling, so we get a rate the
     * hardware/dmix/pulse/etc. supports. */
--  rv = snd_pcm_open(&pcm, "", SND_PCM_STREAM_PLAYBACK | SND_PCM_NO_AUTO_RESAMPLE, 0);
-+  rv = WRAP(snd_pcm_open)(&pcm, "", SND_PCM_STREAM_PLAYBACK | SND_PCM_NO_AUTO_RESAMPLE, 0);
-   if (rv < 0) {
+-  r = snd_pcm_open(&pcm, "default", SND_PCM_STREAM_PLAYBACK | SND_PCM_NO_AUTO_RESAMPLE, 0);
++  r = WRAP(snd_pcm_open)(&pcm, "default", SND_PCM_STREAM_PLAYBACK | SND_PCM_NO_AUTO_RESAMPLE, 0);
+   if (r < 0) {
      return CUBEB_ERROR;
    }
  
--  rv = snd_pcm_hw_params_any(pcm, hw_params);
-+  rv = WRAP(snd_pcm_hw_params_any)(pcm, hw_params);
-   if (rv < 0) {
+-  r = snd_pcm_hw_params_any(pcm, hw_params);
++  r = WRAP(snd_pcm_hw_params_any)(pcm, hw_params);
+   if (r < 0) {
 -    snd_pcm_close(pcm);
 +    WRAP(snd_pcm_close)(pcm);
      return CUBEB_ERROR;
    }
  
--  rv = snd_pcm_hw_params_get_rate(hw_params, rate, &dir);
-+  rv = WRAP(snd_pcm_hw_params_get_rate)(hw_params, rate, &dir);
-   if (rv >= 0) {
+-  r = snd_pcm_hw_params_get_rate(hw_params, rate, &dir);
++  r = WRAP(snd_pcm_hw_params_get_rate)(hw_params, rate, &dir);
+   if (r >= 0) {
      /* There is a default rate: use it. */
 -    snd_pcm_close(pcm);
 +    WRAP(snd_pcm_close)(pcm);
@@ -578,9 +587,9 @@
    /* Use a common rate, alsa may adjust it based on hw/etc. capabilities. */
    *rate = 44100;
  
--  rv = snd_pcm_hw_params_set_rate_near(pcm, hw_params, rate, NULL);
-+  rv = WRAP(snd_pcm_hw_params_set_rate_near)(pcm, hw_params, rate, NULL);
-   if (rv < 0) {
+-  r = snd_pcm_hw_params_set_rate_near(pcm, hw_params, rate, NULL);
++  r = WRAP(snd_pcm_hw_params_set_rate_near)(pcm, hw_params, rate, NULL);
+   if (r < 0) {
 -    snd_pcm_close(pcm);
 +    WRAP(snd_pcm_close)(pcm);
      return CUBEB_ERROR;
@@ -634,7 +643,7 @@
 index 0000000..5e38e27
 --- /dev/null
 +++ mozilla/media/libcubeb/src/cubeb_oss.c
-@@ -0,0 +1,397 @@
+@@ -0,0 +1,402 @@
 +/*
 + * Copyright © 2014 Mozilla Foundation
 + *
@@ -1030,7 +1039,12 @@
 +  .stream_start = oss_stream_start,
 +  .stream_stop = oss_stream_stop,
 +  .stream_get_position = oss_stream_get_position,
-+  .stream_get_latency = oss_stream_get_latency
++  .stream_get_latency = oss_stream_get_latency,
++  .stream_set_volume = oss_stream_set_volume,
++  .stream_set_panning = oss_stream_set_panning,
++  .stream_get_current_device = NULL,
++  .stream_device_destroy = NULL,
++  .stream_register_device_changed_callback = NULL
 +};
 diff --git media/libcubeb/src/moz.build media/libcubeb/src/moz.build
 index 8b7a0dd..31212ce 100644
@@ -1056,36 +1070,33 @@
 +CFLAGS += CONFIG['MOZ_OSS_CFLAGS']
  CFLAGS += CONFIG['MOZ_ALSA_CFLAGS']
  CFLAGS += CONFIG['MOZ_PULSEAUDIO_CFLAGS']
-diff --git media/webrtc/signaling/test/Makefile.in media/webrtc/signaling/test/Makefile.in
+diff --git media/webrtc/signaling/test/moz.build media/webrtc/signaling/test/moz.build
 index 991f03f..3d99eb5 100644
---- mozilla/media/webrtc/signaling/test/Makefile.in
-+++ mozilla/media/webrtc/signaling/test/Makefile.in
-@@ -26,9 +26,9 @@ ifdef JS_SHARED_LIBRARY
- LIBS += $(MOZ_JS_LIBS)
- endif
- 
--ifdef MOZ_ALSA
-+ifdef MOZ_OSS
- LIBS += \
--  $(MOZ_ALSA_LIBS) \
-+  $(MOZ_OSS_LIBS) \
-   $(NULL)
- endif
+--- mozilla/media/webrtc/signaling/test/moz.build
++++ mozilla/media/webrtc/signaling/test/moz.build
+@@ -112,8 +112,8 @@ if CONFIG['JS_SHARED_LIBRARY']:
+ OS_LIBS += CONFIG['MOZ_WEBRTC_X11_LIBS']
+ OS_LIBS += CONFIG['REALTIME_LIBS']
+ 
+-if CONFIG['MOZ_ALSA']:
+-    OS_LIBS += CONFIG['MOZ_ALSA_LIBS']
++if CONFIG['MOZ_OSS']:
++    OS_LIBS += CONFIG['MOZ_OSS_LIBS']
  
-diff --git toolkit/library/libxul.mk toolkit/library/libxul.mk
+ if CONFIG['MOZ_NATIVE_JPEG']:
+     OS_LIBS += CONFIG['MOZ_JPEG_LIBS']
+diff --git toolkit/library/moz.build toolkit/library/moz.build
 index e191f13..4fb268a 100644
---- mozilla/toolkit/library/libxul.mk
-+++ mozilla/toolkit/library/libxul.mk
-@@ -146,9 +146,9 @@ OS_LIBS += $(call EXPAND_LIBNAME,secur32
- endif
- endif
- 
--ifdef MOZ_ALSA
--EXTRA_DSO_LDOPTS += $(MOZ_ALSA_LIBS)
--endif
-+ifdef MOZ_OSS
-+EXTRA_DSO_LDOPTS += $(MOZ_OSS_LIBS)
-+endif
+--- mozilla/toolkit/library/moz.build
++++ mozilla/toolkit/library/moz.build
+@@ -234,8 +234,8 @@ if CONFIG['MOZ_NATIVE_LIBVPX']:
+ if not CONFIG['MOZ_TREE_PIXMAN']:
+     OS_LIBS += CONFIG['MOZ_PIXMAN_LIBS']
+ 
+-if CONFIG['MOZ_ALSA']:
+-    OS_LIBS += CONFIG['MOZ_ALSA_LIBS']
++if CONFIG['MOZ_OSS']:
++    OS_LIBS += CONFIG['MOZ_OSS_LIBS']
  
- ifdef HAVE_CLOCK_MONOTONIC
- EXTRA_DSO_LDOPTS += $(REALTIME_LIBS)
+ if CONFIG['HAVE_CLOCK_MONOTONIC']:
+     OS_LIBS += CONFIG['REALTIME_LIBS']

Deleted: trunk/mail/thunderbird/files/patch-bug1026828
==============================================================================
--- trunk/mail/thunderbird/files/patch-bug1026828	Fri Jul 24 01:20:55 2015	(r1853)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,20 +0,0 @@
-diff --git storage/src/moz.build storage/src/moz.build
-index 4cd2551..5c40536 100644
---- mozilla/storage/src/moz.build
-+++ mozilla/storage/src/moz.build
-@@ -50,11 +50,14 @@ FINAL_LIBRARY = 'storagecomps'
- # (such as NSS) might trigger an initialization of sqlite and allocation
- # of memory using the default allocator, prior to the storage service
- # registering its allocator, causing memory management failures (bug 938730).
-+# However, this is not an issue if both the jemalloc allocator and the default
-+# allocator are the same thing.
- #
- # Note: On Windows our sqlite build assumes we use jemalloc.  If you disable
- # MOZ_STORAGE_MEMORY on Windows, you will also need to change the "ifdef
- # MOZ_MEMORY" options in db/sqlite3/src/Makefile.in.
--if CONFIG['MOZ_MEMORY'] and not CONFIG['MOZ_NATIVE_SQLITE']:
-+if CONFIG['MOZ_MEMORY'] and (not CONFIG['MOZ_NATIVE_SQLITE']
-+                             or CONFIG['MOZ_NATIVE_JEMALLOC']):
-     if CONFIG['OS_TARGET'] != 'Android':
-         DEFINES['MOZ_STORAGE_MEMORY'] = True
- 

Added: trunk/mail/thunderbird/files/patch-bug1041268
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/mail/thunderbird/files/patch-bug1041268	Fri Jul 24 01:20:55 2015	(r1854)
@@ -0,0 +1,26 @@
+diff --git media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer.cc media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer.cc
+index 97f69d3..77a50b3 100644
+--- mozilla/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer.cc
++++ mozilla/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer.cc
+@@ -18,7 +18,7 @@ ScreenCapturer* ScreenCapturer::Create() {
+   return Create(DesktopCaptureOptions::CreateDefault());
+ }
+ 
+-#if defined(WEBRTC_LINUX)
++#if defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)
+ ScreenCapturer* ScreenCapturer::CreateWithXDamage(
+     bool use_update_notifications) {
+   DesktopCaptureOptions options;
+diff --git media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer.h media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer.h
+index a8d40a7..177a6c1 100644
+--- mozilla/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer.h
++++ mozilla/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer.h
+@@ -74,7 +74,7 @@ class ScreenCapturer : public DesktopCapturer {
+   static ScreenCapturer* Create(const DesktopCaptureOptions& options);
+   static ScreenCapturer* Create();
+ 
+-#if defined(WEBRTC_LINUX)
++#if defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)
+   // Creates platform-specific capturer and instructs it whether it should use
+   // X DAMAGE support.
+   static ScreenCapturer* CreateWithXDamage(bool use_x_damage);

Deleted: trunk/mail/thunderbird/files/patch-bug1041795
==============================================================================
--- trunk/mail/thunderbird/files/patch-bug1041795	Fri Jul 24 01:20:55 2015	(r1853)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,48 +0,0 @@
-diff --git config/rules.mk config/rules.mk
-index 4d67eda..783942f 100644
---- mozilla/config/rules.mk
-+++ mozilla/config/rules.mk
-@@ -858,7 +858,7 @@ ifdef DTRACE_PROBE_OBJ
- ifndef DTRACE_LIB_DEPENDENT
- NON_DTRACE_OBJS := $(filter-out $(DTRACE_PROBE_OBJ),$(OBJS))
- $(DTRACE_PROBE_OBJ): $(NON_DTRACE_OBJS)
--	dtrace -G -C -s $(MOZILLA_DTRACE_SRC) -o $(DTRACE_PROBE_OBJ) $(NON_DTRACE_OBJS)
-+	dtrace -x nolibs -G -C -s $(MOZILLA_DTRACE_SRC) -o $(DTRACE_PROBE_OBJ) $(NON_DTRACE_OBJS)
- endif
- endif
- endif
-@@ -876,7 +876,7 @@ ifndef INCREMENTAL_LINKER
- endif
- ifdef DTRACE_LIB_DEPENDENT
- ifndef XP_MACOSX
--	dtrace -G -C -s $(MOZILLA_DTRACE_SRC) -o  $(DTRACE_PROBE_OBJ) $(shell $(EXPAND_LIBS) $(MOZILLA_PROBE_LIBS))
-+	dtrace -x nolibs -G -C -s $(MOZILLA_DTRACE_SRC) -o  $(DTRACE_PROBE_OBJ) $(shell $(EXPAND_LIBS) $(MOZILLA_PROBE_LIBS))
- endif
- 	$(EXPAND_MKSHLIB) $(SHLIB_LDSTARTFILE) $(OBJS) $(SUB_SHLOBJS) $(DTRACE_PROBE_OBJ) $(MOZILLA_PROBE_LIBS) $(RESFILE) $(LDFLAGS) $(WRAP_LDFLAGS) $(SHARED_LIBRARY_LIBS) $(EXTRA_DSO_LDOPTS) $(MOZ_GLUE_LDFLAGS) $(OS_LIBS) $(EXTRA_LIBS) $(DEF_FILE) $(SHLIB_LDENDFILE) $(if $(LIB_IS_C_ONLY),,$(STLPORT_LIBS))
- 	@$(RM) $(DTRACE_PROBE_OBJ)
-diff --git js/src/Makefile.in js/src/Makefile.in
-index 28ca5e8..96793d7 100644
---- mozilla/js/src/Makefile.in
-+++ mozilla/js/src/Makefile.in
-@@ -342,7 +342,7 @@ endif
- 
- ifdef HAVE_DTRACE
- $(CURDIR)/javascript-trace.h: $(srcdir)/devtools/javascript-trace.d
--	dtrace -h -s $(srcdir)/devtools/javascript-trace.d -o javascript-trace.h.in
-+	dtrace -x nolibs -h -s $(srcdir)/devtools/javascript-trace.d -o javascript-trace.h.in
- 	sed -e 's/if _DTRACE_VERSION/ifdef INCLUDE_MOZILLA_DTRACE/' \
- 	    -e '/const/!s/char \*/const char */g' \
- 	    javascript-trace.h.in > javascript-trace.h
-diff --git probes/Makefile.in probes/Makefile.in
-index 6d18f34..deec83f 100644
---- mozilla/probes/Makefile.in
-+++ mozilla/probes/Makefile.in
-@@ -7,7 +7,7 @@ export:: $(DIST)/include/mozilla-trace.h
- 
- # Replace _DTRACE_VERSION with INCLUDE_MOZILLA_DTRACE
- $(DIST)/include/mozilla-trace.h: mozilla-trace.d Makefile
--	dtrace -h -s $(srcdir)/mozilla-trace.d -o mozilla-trace.h.tmp
-+	dtrace -x nolibs -h -s $(srcdir)/mozilla-trace.d -o mozilla-trace.h.tmp
- 	sed -e 's/if _DTRACE_VERSION/ifdef INCLUDE_MOZILLA_DTRACE/' \
- 	    mozilla-trace.h.tmp > $(DIST)/include/mozilla-trace.h
- 	rm mozilla-trace.h.tmp

Deleted: trunk/mail/thunderbird/files/patch-bug1046224
==============================================================================
--- trunk/mail/thunderbird/files/patch-bug1046224	Fri Jul 24 01:20:55 2015	(r1853)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,26 +0,0 @@
-diff --git configure.in configure.in
-index 1853029..559bd45 100644
---- mozilla/configure.in
-+++ mozilla/configure.in
-@@ -2651,7 +2651,7 @@ if test "$ac_cv_sockaddr_sa_len" = true ; then
-   AC_DEFINE(HAVE_SA_LEN)
- fi
- 
--AC_ARG_ENABLE(dtrace,
-+MOZ_ARG_ENABLE_BOOL(dtrace,
-               [  --enable-dtrace         build with dtrace support if available (default=no)],
-               [enable_dtrace="yes"],)
- if test "x$enable_dtrace" = "xyes"; then
-diff --git js/src/configure.in js/src/configure.in
-index 134dfd3..682c1fb 100644
---- mozilla/js/src/configure.in
-+++ mozilla/js/src/configure.in
-@@ -2153,7 +2153,7 @@ dnl Quota support
- MOZ_CHECK_HEADERS(sys/quota.h)
- MOZ_CHECK_HEADERS(linux/quota.h)
- 
--AC_ARG_ENABLE(dtrace,
-+MOZ_ARG_ENABLE_BOOL(dtrace,
-               [  --enable-dtrace         build with dtrace support if available (default=no)],
-               [enable_dtrace="yes"],)
- if test "x$enable_dtrace" = "xyes"; then

Added: trunk/mail/thunderbird/files/patch-bug1073117
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/mail/thunderbird/files/patch-bug1073117	Fri Jul 24 01:20:55 2015	(r1854)
@@ -0,0 +1,877 @@
+diff --git widget/gtk/gtk2drawing.c widget/gtk/gtk2drawing.c
+index 34f22af..1b950ab 100644
+--- mozilla/widget/gtk/gtk2drawing.c
++++ mozilla/widget/gtk/gtk2drawing.c
+@@ -831,7 +831,7 @@ moz_gtk_get_focus_outline_size(gint* focus_h_width, gint* focus_v_width)
+     return MOZ_GTK_SUCCESS;
+ }
+ 
+-gint
++static gint
+ moz_gtk_widget_get_focus(GtkWidget* widget, gboolean* interior_focus,
+                          gint* focus_width, gint* focus_pad) 
+ {
+@@ -928,7 +928,7 @@ moz_gtk_splitter_get_metrics(gint orientation, gint* size)
+     return MOZ_GTK_SUCCESS;
+ }
+ 
+-gint
++static gint
+ moz_gtk_button_get_inner_border(GtkWidget* widget, GtkBorder* inner_border)
+ {
+     static const GtkBorder default_inner_border = { 1, 1, 1, 1 };
+diff --git widget/gtk/gtk3drawing.c widget/gtk/gtk3drawing.c
+index 08a58d6..7fef6fa 100644
+--- mozilla/widget/gtk/gtk3drawing.c
++++ mozilla/widget/gtk/gtk3drawing.c
+@@ -65,6 +65,7 @@ static GtkWidget* gScrolledWindowWidget;
+ static style_prop_t style_prop_func;
+ static gboolean have_arrow_scaling;
+ static gboolean checkbox_check_state;
++static gboolean notebook_has_tab_gap;
+ static gboolean is_initialized;
+ 
+ #define ARROW_UP      0
+@@ -725,6 +726,14 @@ moz_gtk_init()
+     else
+         checkbox_check_state = GTK_STATE_FLAG_ACTIVE;
+ 
++    if(!gtk_check_version(3, 12, 0)) {
++        ensure_tab_widget();
++        gtk_widget_style_get(gTabWidget, "has-tab-gap", &notebook_has_tab_gap, NULL);
++    }
++    else {
++        notebook_has_tab_gap = TRUE;
++    }
++
+     /* Add style property to GtkEntry.
+      * Adding the style property to the normal GtkEntry class means that it
+      * will work without issues inside GtkComboBox and for Spinbuttons. */
+@@ -762,37 +771,17 @@ moz_gtk_radio_get_metrics(gint* indicator_size, gint* indicator_spacing)
+ gint
+ moz_gtk_get_focus_outline_size(gint* focus_h_width, gint* focus_v_width)
+ {
+-    gboolean interior_focus;
+-    gint focus_width = 0;
++    GtkBorder border;
++    GtkBorder padding;
++    GtkStyleContext *style;
+ 
+     ensure_entry_widget();
+-    gtk_widget_style_get(gEntryWidget,
+-                         "interior-focus", &interior_focus,
+-                         "focus-line-width", &focus_width,
+-                         NULL);
+-    if (interior_focus) {
+-        GtkBorder border;
+-        GtkStyleContext *style = gtk_widget_get_style_context(gEntryWidget);
+-        gtk_style_context_get_border(style, 0, &border);
+-        *focus_h_width = border.left + focus_width;
+-        *focus_v_width = border.top + focus_width;
+-    } else {
+-        *focus_h_width = focus_width;
+-        *focus_v_width = focus_width;
+-    }
+-    return MOZ_GTK_SUCCESS;
+-}
+-
+-gint
+-moz_gtk_widget_get_focus(GtkWidget* widget, gboolean* interior_focus,
+-                         gint* focus_width, gint* focus_pad) 
+-{
+-    gtk_widget_style_get (widget,
+-                          "interior-focus", interior_focus,
+-                          "focus-line-width", focus_width,
+-                          "focus-padding", focus_pad,
+-                          NULL);
++    style = gtk_widget_get_style_context(gEntryWidget);
+ 
++    gtk_style_context_get_border(style, 0, &border);
++    gtk_style_context_get_padding(style, 0, &padding);
++    *focus_h_width = border.left + padding.left;
++    *focus_v_width = border.top + padding.top;
+     return MOZ_GTK_SUCCESS;
+ }
+ 
+@@ -880,24 +860,6 @@ moz_gtk_splitter_get_metrics(gint orientation, gint* size)
+     return MOZ_GTK_SUCCESS;
+ }
+ 
+-gint
+-moz_gtk_button_get_inner_border(GtkWidget* widget, GtkBorder* inner_border)
+-{
+-    static const GtkBorder default_inner_border = { 1, 1, 1, 1 };
+-    GtkBorder *tmp_border;
+-
+-    gtk_widget_style_get (widget, "inner-border", &tmp_border, NULL);
+-
+-    if (tmp_border) {
+-        *inner_border = *tmp_border;
+-        gtk_border_free(tmp_border);
+-    }
+-    else
+-        *inner_border = default_inner_border;
+-
+-    return MOZ_GTK_SUCCESS;
+-}
+-
+ static gint
+ moz_gtk_button_paint(cairo_t *cr, GdkRectangle* rect,
+                      GtkWidgetState* state,
+@@ -908,19 +870,8 @@ moz_gtk_button_paint(cairo_t *cr, GdkRectangle* rect,
+     GtkStyleContext* style = gtk_widget_get_style_context(widget);    
+     gint x = rect->x, y=rect->y, width=rect->width, height=rect->height;
+ 
+-    gboolean interior_focus;
+-    gint focus_width, focus_pad;
+-
+-    moz_gtk_widget_get_focus(widget, &interior_focus, &focus_width, &focus_pad);
+     gtk_widget_set_direction(widget, direction);
+-
+-    if (!interior_focus && state->focused) {
+-        x += focus_width + focus_pad;
+-        y += focus_width + focus_pad;
+-        width -= 2 * (focus_width + focus_pad);
+-        height -= 2 * (focus_width + focus_pad);
+-    }
+-  
++ 
+     gtk_style_context_save(style);
+     gtk_style_context_set_state(style, state_flags);
+ 
+@@ -953,20 +904,12 @@ moz_gtk_button_paint(cairo_t *cr, GdkRectangle* rect,
+     }
+ 
+     if (state->focused) {
+-        if (interior_focus) {
+-            GtkBorder border;
+-            gtk_style_context_get_border(style, state_flags, &border);
+-            x += border.left + focus_pad;
+-            y += border.top + focus_pad;
+-            width -= 2 * (border.left + focus_pad);
+-            height -= 2 * (border.top + focus_pad);
+-        } else {
+-            x -= focus_width + focus_pad;
+-            y -= focus_width + focus_pad;
+-            width += 2 * (focus_width + focus_pad);
+-            height += 2 * (focus_width + focus_pad);
+-        }
+-
++        GtkBorder border;
++        gtk_style_context_get_border(style, state_flags, &border);
++        x += border.left;
++        y += border.top;
++        width -= (border.left + border.right);
++        height -= (border.top + border.bottom);
+         gtk_render_focus(style, cr, x, y, width, height);
+     }
+     gtk_style_context_restore(style);
+@@ -1056,33 +999,23 @@ calculate_button_inner_rect(GtkWidget* button, GdkRectangle* rect,
+                             GtkTextDirection direction,
+                             gboolean ignore_focus)
+ {
+-    GtkBorder inner_border;
+-    gboolean interior_focus;
+-    gint focus_width, focus_pad;
+     GtkStyleContext* style;
+     GtkBorder border;
++    GtkBorder padding = {0, 0, 0, 0};
+ 
+     style = gtk_widget_get_style_context(button);
+ 
+     /* This mirrors gtkbutton's child positioning */
+-    moz_gtk_button_get_inner_border(button, &inner_border);
+-    moz_gtk_widget_get_focus(button, &interior_focus,
+-                             &focus_width, &focus_pad);
+-
+-    if (ignore_focus)
+-        focus_width = focus_pad = 0;
+-
+     gtk_style_context_get_border(style, 0, &border);
++    if (!ignore_focus)
++        gtk_style_context_get_padding(style, 0, &padding);
+ 
+-    inner_rect->x = rect->x + border.left + focus_width + focus_pad;
+-    inner_rect->x += direction == GTK_TEXT_DIR_LTR ?
+-                        inner_border.left : inner_border.right;
+-    inner_rect->y = rect->y + inner_border.top + border.top +
+-                    focus_width + focus_pad;
+-    inner_rect->width = MAX(1, rect->width - inner_border.left -
+-       inner_border.right - (border.left + focus_pad + focus_width) * 2);
+-    inner_rect->height = MAX(1, rect->height - inner_border.top -
+-       inner_border.bottom - (border.top + focus_pad + focus_width) * 2);
++    inner_rect->x = rect->x + border.left + padding.left;
++    inner_rect->y = rect->y + padding.top + border.top;
++    inner_rect->width = MAX(1, rect->width - padding.left -
++       padding.right - border.left * 2);
++    inner_rect->height = MAX(1, rect->height - padding.top -
++       padding.bottom - border.top * 2);
+ 
+     return MOZ_GTK_SUCCESS;
+ }
+@@ -1457,19 +1390,12 @@ moz_gtk_entry_paint(cairo_t *cr, GdkRectangle* rect,
+ {
+     gint x = rect->x, y = rect->y, width = rect->width, height = rect->height;
+     GtkStyleContext* style;
+-    gboolean interior_focus;
+-    gint focus_width;
+     int draw_focus_outline_only = state->depressed; // NS_THEME_FOCUS_OUTLINE
+ 
+     gtk_widget_set_direction(widget, direction);
+ 
+     style = gtk_widget_get_style_context(widget);
+ 
+-    gtk_widget_style_get(widget,
+-                         "interior-focus", &interior_focus,
+-                         "focus-line-width", &focus_width,
+-                         NULL);
+-
+     if (draw_focus_outline_only) {
+         // Inflate the given 'rect' with the focus outline size.
+         gint h, v;
+@@ -1501,14 +1427,6 @@ moz_gtk_entry_paint(cairo_t *cr, GdkRectangle* rect,
+         /* This will get us the lit borders that focused textboxes enjoy on
+          * some themes. */
+         gtk_style_context_set_state(style, GTK_STATE_FLAG_FOCUSED);
+-        if (!interior_focus) {
+-            /* Indent the border a little bit if we have exterior focus 
+-               (this is what GTK does to draw native entries) */
+-            x += focus_width;
+-            y += focus_width;
+-            width -= 2 * focus_width;
+-            height -= 2 * focus_width;
+-        }
+     }
+ 
+     if (state->disabled) {
+@@ -1520,11 +1438,6 @@ moz_gtk_entry_paint(cairo_t *cr, GdkRectangle* rect,
+     }
+     gtk_render_frame(style, cr, x, y, width, height);
+ 
+-    if (state->focused && !state->disabled) {
+-        if (!interior_focus) {
+-            gtk_render_focus(style, cr, rect->x, rect->y, rect->width, rect->height);
+-        }
+-    }
+     gtk_style_context_restore(style);
+ 
+     return MOZ_GTK_SUCCESS;
+@@ -1829,8 +1742,6 @@ moz_gtk_container_paint(cairo_t *cr, GdkRectangle* rect,
+     GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state);
+     GtkStyleContext* style;
+     GtkWidget *widget;
+-    gboolean interior_focus;
+-    gint focus_width, focus_pad;
+ 
+     if (isradio) {
+         ensure_radiobutton_widget();
+@@ -1843,7 +1754,6 @@ moz_gtk_container_paint(cairo_t *cr, GdkRectangle* rect,
+ 
+     style = gtk_widget_get_style_context(widget);
+     gtk_style_context_save(style);
+-    moz_gtk_widget_get_focus(widget, &interior_focus, &focus_width, &focus_pad);
+     gtk_style_context_set_state(style, state_flags);
+   
+     /* this is for drawing a prelight box */
+@@ -1852,10 +1762,6 @@ moz_gtk_container_paint(cairo_t *cr, GdkRectangle* rect,
+                               rect->x, rect->y, rect->width, rect->height);
+     }
+   
+-    if (state->focused && !interior_focus) {
+-        gtk_render_focus(style, cr,
+-                        rect->x, rect->y, rect->width, rect->height);
+-    }
+     gtk_style_context_restore(style);
+   
+     return MOZ_GTK_SUCCESS;
+@@ -1868,7 +1774,6 @@ moz_gtk_toggle_label_paint(cairo_t *cr, GdkRectangle* rect,
+ {
+     GtkStyleContext *style;
+     GtkWidget *widget;
+-    gboolean interior_focus;
+ 
+     if (!state->focused)
+         return MOZ_GTK_SUCCESS;
+@@ -1889,10 +1794,6 @@ moz_gtk_toggle_label_paint(cairo_t *cr, GdkRectangle* rect,
+     }
+     gtk_widget_set_direction(widget, direction);
+ 
+-    gtk_widget_style_get(widget, "interior-focus", &interior_focus, NULL);
+-    if (!interior_focus)
+-        return MOZ_GTK_SUCCESS;
+-
+     gtk_style_context_set_state(style, GetStateFlagsFromGtkWidgetState(state));
+     gtk_render_focus(style, cr,
+                     rect->x, rect->y, rect->width, rect->height);
+@@ -2105,6 +2015,9 @@ moz_gtk_get_tab_thickness(void)
+     GtkStyleContext * style;
+ 
+     ensure_tab_widget();
++    if (!notebook_has_tab_gap)
++      return 0; /* tabs do not overdraw the tabpanel border with "no gap" style */
++
+     style = gtk_widget_get_style_context(gTabWidget);
+     gtk_style_context_add_class(style, GTK_STYLE_CLASS_NOTEBOOK);
+     gtk_style_context_get_border(style, 0, &border);
+@@ -2150,7 +2063,7 @@ moz_gtk_tab_paint(cairo_t *cr, GdkRectangle* rect,
+     ensure_tab_widget();
+     gtk_widget_set_direction(gTabWidget, direction);
+ 
+-    style = gtk_widget_get_style_context(gTabWidget);    
++    style = gtk_widget_get_style_context(gTabWidget);
+     gtk_style_context_save(style);
+     moz_gtk_tab_prepare_style_context(style, flags);
+ 
+@@ -2167,143 +2080,155 @@ moz_gtk_tab_paint(cairo_t *cr, GdkRectangle* rect,
+ 
+     focusRect = backRect = tabRect;
+ 
+-    if ((flags & MOZ_GTK_TAB_SELECTED) == 0) {
+-        /* Only draw the tab */
+-        gtk_render_extension(style, cr,
+-                             tabRect.x, tabRect.y, tabRect.width, tabRect.height,
+-                            (flags & MOZ_GTK_TAB_BOTTOM) ?
+-                                GTK_POS_TOP : GTK_POS_BOTTOM );
+-    } else {
+-        /* Draw the tab and the gap
+-         * We want the gap to be positioned exactly on the tabpanel top
+-         * border; since tabbox.css may set a negative margin so that the tab
+-         * frame rect already overlaps the tabpanel frame rect, we need to take
+-         * that into account when drawing. To that effect, nsNativeThemeGTK
+-         * passes us this negative margin (bmargin in the graphic below) in the
+-         * lowest bits of |flags|.  We use it to set gap_voffset, the distance
+-         * between the top of the gap and the bottom of the tab (resp. the
+-         * bottom of the gap and the top of the tab when we draw a bottom tab),
+-         * while ensuring that the gap always touches the border of the tab,
+-         * i.e. 0 <= gap_voffset <= gap_height, to avoid surprinsing results
+-         * with big negative or positive margins.
+-         * Here is a graphical explanation in the case of top tabs:
+-         *             ___________________________
+-         *            /                           \
+-         *           |            T A B            |
+-         * ----------|. . . . . . . . . . . . . . .|----- top of tabpanel
+-         *           :    ^       bmargin          :  ^
+-         *           :    | (-negative margin,     :  |
+-         *  bottom   :    v  passed in flags)      :  |       gap_height
+-         *    of  -> :.............................:  |    (the size of the
+-         * the tab   .       part of the gap       .  |  tabpanel top border)
+-         *           .      outside of the tab     .  v
+-         * ----------------------------------------------
+-         *
+-         * To draw the gap, we use gtk_paint_box_gap(), see comment in
+-         * moz_gtk_tabpanels_paint(). This box_gap is made 3 * gap_height tall,
+-         * which should suffice to ensure that the only visible border is the
+-         * pierced one.  If the tab is in the middle, we make the box_gap begin
+-         * a bit to the left of the tab and end a bit to the right, adjusting
+-         * the gap position so it still is under the tab, because we want the
+-         * rendering of a gap in the middle of a tabpanel.  This is the role of
+-         * the gints gap_{l,r}_offset. On the contrary, if the tab is the
+-         * first, we align the start border of the box_gap with the start
+-         * border of the tab (left if LTR, right if RTL), by setting the
+-         * appropriate offset to 0.*/
+-        gint gap_loffset, gap_roffset, gap_voffset, gap_height;
+-
+-        /* Get height needed by the gap */
+-        gap_height = moz_gtk_get_tab_thickness();
+-
+-        /* Extract gap_voffset from the first bits of flags */
+-        gap_voffset = flags & MOZ_GTK_TAB_MARGIN_MASK;
+-        if (gap_voffset > gap_height)
+-            gap_voffset = gap_height;
+-
+-        /* Set gap_{l,r}_offset to appropriate values */
+-        gap_loffset = gap_roffset = 20; /* should be enough */
+-        if (flags & MOZ_GTK_TAB_FIRST) {
+-            if (direction == GTK_TEXT_DIR_RTL)
+-                gap_roffset = initial_gap;
+-            else
+-                gap_loffset = initial_gap;
+-        }
+-
+-        if (flags & MOZ_GTK_TAB_BOTTOM) {
+-            /* Draw the tab on bottom */
+-            focusRect.y += gap_voffset;
+-            focusRect.height -= gap_voffset;
+-
++    if (notebook_has_tab_gap) {
++        if ((flags & MOZ_GTK_TAB_SELECTED) == 0) {
++            /* Only draw the tab */
+             gtk_render_extension(style, cr,
+-                                 tabRect.x, tabRect.y + gap_voffset, tabRect.width,
+-                                 tabRect.height - gap_voffset, GTK_POS_TOP);
+-
+-            gtk_style_context_remove_region(style, GTK_STYLE_REGION_TAB);
+-
+-            backRect.y += (gap_voffset - gap_height);
+-            backRect.height = gap_height;
+-
+-            /* Draw the gap; erase with background color before painting in
+-             * case theme does not */
+-            gtk_render_background(style, cr, backRect.x, backRect.y,
+-                                 backRect.width, backRect.height);
+-            cairo_save(cr);
+-            cairo_rectangle(cr, backRect.x, backRect.y, backRect.width, backRect.height);
+-            cairo_clip(cr);
+-
+-            gtk_render_frame_gap(style, cr,
+-                                 tabRect.x - gap_loffset,
+-                                 tabRect.y + gap_voffset - 3 * gap_height,
+-                                 tabRect.width + gap_loffset + gap_roffset,
+-                                 3 * gap_height, GTK_POS_BOTTOM,
+-                                 gap_loffset, gap_loffset + tabRect.width);
+-            cairo_restore(cr);
++                                 tabRect.x, tabRect.y, tabRect.width, tabRect.height,
++                                (flags & MOZ_GTK_TAB_BOTTOM) ?
++                                    GTK_POS_TOP : GTK_POS_BOTTOM );
+         } else {
+-            /* Draw the tab on top */
+-            focusRect.height -= gap_voffset;
+-            gtk_render_extension(style, cr,
+-                                 tabRect.x, tabRect.y, tabRect.width,
+-                                 tabRect.height - gap_voffset, GTK_POS_BOTTOM);
+-
+-            gtk_style_context_remove_region(style, GTK_STYLE_REGION_TAB);
+-
+-            backRect.y += (tabRect.height - gap_voffset);
+-            backRect.height = gap_height;
+-
+-            /* Draw the gap; erase with background color before painting in
+-             * case theme does not */
+-            gtk_render_background(style, cr, backRect.x, backRect.y,
+-                                  backRect.width, backRect.height);
+-
+-            cairo_save(cr);
+-            cairo_rectangle(cr, backRect.x, backRect.y, backRect.width, backRect.height);
+-            cairo_clip(cr);
+-
+-            gtk_render_frame_gap(style, cr,
+-                                 tabRect.x - gap_loffset,
+-                                 tabRect.y + tabRect.height - gap_voffset,
+-                                 tabRect.width + gap_loffset + gap_roffset,
+-                                 3 * gap_height, GTK_POS_TOP,
+-                                 gap_loffset, gap_loffset + tabRect.width);
+-            cairo_restore(cr);
++            /* Draw the tab and the gap
++             * We want the gap to be positioned exactly on the tabpanel top
++             * border; since tabbox.css may set a negative margin so that the tab
++             * frame rect already overlaps the tabpanel frame rect, we need to take
++             * that into account when drawing. To that effect, nsNativeThemeGTK
++             * passes us this negative margin (bmargin in the graphic below) in the
++             * lowest bits of |flags|.  We use it to set gap_voffset, the distance
++             * between the top of the gap and the bottom of the tab (resp. the
++             * bottom of the gap and the top of the tab when we draw a bottom tab),
++             * while ensuring that the gap always touches the border of the tab,
++             * i.e. 0 <= gap_voffset <= gap_height, to avoid surprinsing results
++             * with big negative or positive margins.
++             * Here is a graphical explanation in the case of top tabs:
++             *             ___________________________
++             *            /                           \
++             *           |            T A B            |
++             * ----------|. . . . . . . . . . . . . . .|----- top of tabpanel
++             *           :    ^       bmargin          :  ^
++             *           :    | (-negative margin,     :  |
++             *  bottom   :    v  passed in flags)      :  |       gap_height
++             *    of  -> :.............................:  |    (the size of the
++             * the tab   .       part of the gap       .  |  tabpanel top border)
++             *           .      outside of the tab     .  v
++             * ----------------------------------------------
++             *
++             * To draw the gap, we use gtk_paint_box_gap(), see comment in
++             * moz_gtk_tabpanels_paint(). This box_gap is made 3 * gap_height tall,
++             * which should suffice to ensure that the only visible border is the
++             * pierced one.  If the tab is in the middle, we make the box_gap begin
++             * a bit to the left of the tab and end a bit to the right, adjusting
++             * the gap position so it still is under the tab, because we want the
++             * rendering of a gap in the middle of a tabpanel.  This is the role of
++             * the gints gap_{l,r}_offset. On the contrary, if the tab is the
++             * first, we align the start border of the box_gap with the start
++             * border of the tab (left if LTR, right if RTL), by setting the
++             * appropriate offset to 0.*/
++            gint gap_loffset, gap_roffset, gap_voffset, gap_height;
++
++            /* Get height needed by the gap */
++            gap_height = moz_gtk_get_tab_thickness();
++
++            /* Extract gap_voffset from the first bits of flags */
++            gap_voffset = flags & MOZ_GTK_TAB_MARGIN_MASK;
++            if (gap_voffset > gap_height)
++                gap_voffset = gap_height;
++
++            /* Set gap_{l,r}_offset to appropriate values */
++            gap_loffset = gap_roffset = 20; /* should be enough */
++            if (flags & MOZ_GTK_TAB_FIRST) {
++                if (direction == GTK_TEXT_DIR_RTL)
++                    gap_roffset = initial_gap;
++                else
++                    gap_loffset = initial_gap;
++            }
++
++            if (flags & MOZ_GTK_TAB_BOTTOM) {
++                /* Draw the tab on bottom */
++                focusRect.y += gap_voffset;
++                focusRect.height -= gap_voffset;
++
++                gtk_render_extension(style, cr,
++                                     tabRect.x, tabRect.y + gap_voffset, tabRect.width,
++                                     tabRect.height - gap_voffset, GTK_POS_TOP);
++
++                gtk_style_context_remove_region(style, GTK_STYLE_REGION_TAB);
++
++                backRect.y += (gap_voffset - gap_height);
++                backRect.height = gap_height;
++
++                /* Draw the gap; erase with background color before painting in
++                 * case theme does not */
++                gtk_render_background(style, cr, backRect.x, backRect.y,
++                                     backRect.width, backRect.height);
++                cairo_save(cr);
++                cairo_rectangle(cr, backRect.x, backRect.y, backRect.width, backRect.height);
++                cairo_clip(cr);
++
++                gtk_render_frame_gap(style, cr,
++                                     tabRect.x - gap_loffset,
++                                     tabRect.y + gap_voffset - 3 * gap_height,
++                                     tabRect.width + gap_loffset + gap_roffset,
++                                     3 * gap_height, GTK_POS_BOTTOM,
++                                     gap_loffset, gap_loffset + tabRect.width);
++                cairo_restore(cr);
++            } else {
++                /* Draw the tab on top */
++                focusRect.height -= gap_voffset;
++                gtk_render_extension(style, cr,
++                                     tabRect.x, tabRect.y, tabRect.width,
++                                     tabRect.height - gap_voffset, GTK_POS_BOTTOM);
++
++                gtk_style_context_remove_region(style, GTK_STYLE_REGION_TAB);
++
++                backRect.y += (tabRect.height - gap_voffset);
++                backRect.height = gap_height;
++
++                /* Draw the gap; erase with background color before painting in
++                 * case theme does not */
++                gtk_render_background(style, cr, backRect.x, backRect.y,
++                                      backRect.width, backRect.height);
++
++                cairo_save(cr);
++                cairo_rectangle(cr, backRect.x, backRect.y, backRect.width, backRect.height);
++                cairo_clip(cr);
++
++                gtk_render_frame_gap(style, cr,
++                                     tabRect.x - gap_loffset,
++                                     tabRect.y + tabRect.height - gap_voffset,
++                                     tabRect.width + gap_loffset + gap_roffset,
++                                     3 * gap_height, GTK_POS_TOP,
++                                     gap_loffset, gap_loffset + tabRect.width);
++                cairo_restore(cr);
++            }
+         }
++    } else {
++        gtk_render_background(style, cr, tabRect.x, tabRect.y, tabRect.width, tabRect.height);
++        gtk_render_frame(style, cr, tabRect.x, tabRect.y, tabRect.width, tabRect.height);
+     }
+ 
++    gtk_style_context_restore(style);
++
+     if (state->focused) {
+       /* Paint the focus ring */
+-      GtkBorder border;
+-      gtk_style_context_get_border(style, GetStateFlagsFromGtkWidgetState(state), &border);
++      GtkBorder padding;
++
++      gtk_style_context_save(style);
++      moz_gtk_tab_prepare_style_context(style, flags);
+ 
+-      focusRect.x += border.left;
+-      focusRect.width -= (border.left + border.right);
+-      focusRect.y += border.top;
+-      focusRect.height -= (border.top + border.bottom);
++      gtk_style_context_get_padding(style, GetStateFlagsFromGtkWidgetState(state), &padding);
++
++      focusRect.x += padding.left;
++      focusRect.width -= (padding.left + padding.right);
++      focusRect.y += padding.top;
++      focusRect.height -= (padding.top + padding.bottom);
+ 
+       gtk_render_focus(style, cr,
+                       focusRect.x, focusRect.y, focusRect.width, focusRect.height);
++
++      gtk_style_context_restore(style);
+     }
+ 
+-    gtk_style_context_restore(style);
+ 
+     return MOZ_GTK_SUCCESS;
+ }
+@@ -2684,26 +2609,18 @@ moz_gtk_get_widget_border(GtkThemeWidgetType widget, gint* left, gint* top,
+     switch (widget) {
+     case MOZ_GTK_BUTTON:
+         {
+-            GtkBorder inner_border;
+-            gboolean interior_focus;
+-            gint focus_width, focus_pad;
+-
+             ensure_button_widget();
++            style = gtk_widget_get_style_context(gButtonWidget);
++
+             *left = *top = *right = *bottom = gtk_container_get_border_width(GTK_CONTAINER(gButtonWidget));
+ 
+             /* Don't add this padding in HTML, otherwise the buttons will
+                become too big and stuff the layout. */
+             if (!inhtml) {
+-                moz_gtk_widget_get_focus(gButtonWidget, &interior_focus, &focus_width, &focus_pad);
+-                moz_gtk_button_get_inner_border(gButtonWidget, &inner_border);
+-                *left += focus_width + focus_pad + inner_border.left;
+-                *right += focus_width + focus_pad + inner_border.right;
+-                *top += focus_width + focus_pad + inner_border.top;
+-                *bottom += focus_width + focus_pad + inner_border.bottom;
++                moz_gtk_add_style_padding(style, left, top, right, bottom);
+             }
+ 
+-            moz_gtk_add_style_border(gtk_widget_get_style_context(gButtonWidget), 
+-                                     left, top, right, bottom);
++            moz_gtk_add_style_border(style, left, top, right, bottom);
+             return MOZ_GTK_SUCCESS;
+         }
+     case MOZ_GTK_ENTRY:
+@@ -2717,7 +2610,13 @@ moz_gtk_get_widget_border(GtkThemeWidgetType widget, gint* left, gint* top,
+             ensure_entry_widget();
+             style = gtk_widget_get_style_context(gEntryWidget);
+             moz_gtk_add_style_border(style, left, top, right, bottom);
+-            moz_gtk_add_style_padding(style, left, top, right, bottom);
++
++            /* Use the document padding in HTML
++               and GTK style padding in XUL. */
++            if (!inhtml) {
++                moz_gtk_add_style_padding(style, left, top, right, bottom);
++            }
++
+             return MOZ_GTK_SUCCESS;
+         }
+     case MOZ_GTK_TREEVIEW:
+@@ -2737,23 +2636,15 @@ moz_gtk_get_widget_border(GtkThemeWidgetType widget, gint* left, gint* top,
+              * assigned.
+              * That is why the following code is the same as for MOZ_GTK_BUTTON.  
+              * */
+-
+-            GtkBorder inner_border;
+-            gboolean interior_focus;
+-            gint focus_width, focus_pad;
++            GtkStyleContext *style;
+ 
+             ensure_tree_header_cell_widget();
+             *left = *top = *right = *bottom = gtk_container_get_border_width(GTK_CONTAINER(gTreeHeaderCellWidget));
+ 
+-            moz_gtk_widget_get_focus(gTreeHeaderCellWidget, &interior_focus, &focus_width, &focus_pad);
+-            moz_gtk_button_get_inner_border(gTreeHeaderCellWidget, &inner_border);
+-            *left += focus_width + focus_pad + inner_border.left;
+-            *right += focus_width + focus_pad + inner_border.right;
+-            *top += focus_width + focus_pad + inner_border.top;
+-            *bottom += focus_width + focus_pad + inner_border.bottom;
+-        
+-            moz_gtk_add_style_border(gtk_widget_get_style_context(gTreeHeaderCellWidget), 
+-                                     left, top, right, bottom);
++            style = gtk_widget_get_style_context(gTreeHeaderCellWidget);
++
++            moz_gtk_add_style_border(style, left, top, right, bottom);
++            moz_gtk_add_style_padding(style, left, top, right, bottom);
+             return MOZ_GTK_SUCCESS;
+         }
+     case MOZ_GTK_TREE_HEADER_SORTARROW:
+@@ -2773,29 +2664,23 @@ moz_gtk_get_widget_border(GtkThemeWidgetType widget, gint* left, gint* top,
+             /* We need to account for the arrow on the dropdown, so text
+              * doesn't come too close to the arrow, or in some cases spill
+              * into the arrow. */
+-            gboolean ignored_interior_focus, wide_separators;
+-            gint focus_width, focus_pad, separator_width;
++            gboolean wide_separators;
++            gint separator_width;
+             GtkRequisition arrow_req;
+             GtkBorder border;
+ 
+             ensure_combo_box_widgets();
+ 
+-            *left = gtk_container_get_border_width(GTK_CONTAINER(gComboBoxButtonWidget));
++            *left = *top = *right = *bottom = 
++                gtk_container_get_border_width(GTK_CONTAINER(gComboBoxButtonWidget));
++
++            style = gtk_widget_get_style_context(gComboBoxButtonWidget);
+ 
+             if (!inhtml) {
+-                moz_gtk_widget_get_focus(gComboBoxButtonWidget,
+-                                         &ignored_interior_focus,
+-                                         &focus_width, &focus_pad);
+-                *left += focus_width + focus_pad;
++                moz_gtk_add_style_padding(style, left, top, right, bottom);
+             }
+           
+-            style = gtk_widget_get_style_context(gComboBoxButtonWidget);
+-            gtk_style_context_get_border(style, 0, &border);
+-
+-            *top = *left + border.top;
+-            *left += border.left;
+-
+-            *right = *left; *bottom = *top;
++            moz_gtk_add_style_border(style, left, top, right, bottom);
+ 
+             /* If there is no separator, don't try to count its width. */
+             separator_width = 0;
+@@ -2847,60 +2732,23 @@ moz_gtk_get_widget_border(GtkThemeWidgetType widget, gint* left, gint* top,
+         ensure_frame_widget();
+         w = gFrameWidget;
+         break;
+-    case MOZ_GTK_CHECKBUTTON_LABEL:
+-    case MOZ_GTK_RADIOBUTTON_LABEL:
+-        {
+-            gboolean interior_focus;
+-            gint focus_width, focus_pad;
+-
+-            /* If the focus is interior, then the label has a border of
+-               (focus_width + focus_pad). */
+-            if (widget == MOZ_GTK_CHECKBUTTON_LABEL) {
+-                ensure_checkbox_widget();
+-                moz_gtk_widget_get_focus(gCheckboxWidget, &interior_focus,
+-                                           &focus_width, &focus_pad);
+-            }
+-            else {
+-                ensure_radiobutton_widget();
+-                moz_gtk_widget_get_focus(gRadiobuttonWidget, &interior_focus,
+-                                        &focus_width, &focus_pad);
+-            }
+-
+-            if (interior_focus)
+-                *left = *top = *right = *bottom = (focus_width + focus_pad);
+-
+-            return MOZ_GTK_SUCCESS;
+-        }
+-
+     case MOZ_GTK_CHECKBUTTON_CONTAINER:
+     case MOZ_GTK_RADIOBUTTON_CONTAINER:
+         {
+-            gboolean interior_focus;
+-            gint focus_width, focus_pad;
+-
+-            /* If the focus is _not_ interior, then the container has a border
+-               of (focus_width + focus_pad). */
+             if (widget == MOZ_GTK_CHECKBUTTON_CONTAINER) {
+                 ensure_checkbox_widget();
+-                moz_gtk_widget_get_focus(gCheckboxWidget, &interior_focus,
+-                                           &focus_width, &focus_pad);
+                 w = gCheckboxWidget;
+             } else {
+                 ensure_radiobutton_widget();
+-                moz_gtk_widget_get_focus(gRadiobuttonWidget, &interior_focus,
+-                                        &focus_width, &focus_pad);
+                 w = gRadiobuttonWidget;
+             }
++            style = gtk_widget_get_style_context(w);
+ 
+             *left = *top = *right = *bottom = gtk_container_get_border_width(GTK_CONTAINER(w));
+-
+-            if (!interior_focus) {
+-                *left += (focus_width + focus_pad);
+-                *right += (focus_width + focus_pad);
+-                *top += (focus_width + focus_pad);
+-                *bottom += (focus_width + focus_pad);
+-            }
+-
++            moz_gtk_add_style_border(style,
++                                     left, top, right, bottom);
++            moz_gtk_add_style_padding(style,
++                                      left, top, right, bottom);
+             return MOZ_GTK_SUCCESS;
+         }
+     case MOZ_GTK_MENUPOPUP:
+@@ -2927,6 +2775,8 @@ moz_gtk_get_widget_border(GtkThemeWidgetType widget, gint* left, gint* top,
+             return MOZ_GTK_SUCCESS;
+         }
+     /* These widgets have no borders, since they are not containers. */
++    case MOZ_GTK_CHECKBUTTON_LABEL:
++    case MOZ_GTK_RADIOBUTTON_LABEL:
+     case MOZ_GTK_SPLITTER_HORIZONTAL:
+     case MOZ_GTK_SPLITTER_VERTICAL:
+     case MOZ_GTK_CHECKBUTTON:
+@@ -2975,11 +2849,7 @@ moz_gtk_get_tab_border(gint* left, gint* top, gint* right, gint* bottom,
+     gtk_style_context_save(style);
+     moz_gtk_tab_prepare_style_context(style, flags);
+ 
+-    // TODO add_style_border() should be replaced
+-    // with focus-line-width and focus-padding
+-    // see Bug 877605
+     *left = *top = *right = *bottom = 0;
+-    moz_gtk_add_style_border(style, left, top, right, bottom);
+     moz_gtk_add_style_padding(style, left, top, right, bottom);
+ 
+     gtk_widget_style_get (gTabWidget, "tab-curvature", &tab_curvature, NULL);
+@@ -2990,16 +2860,9 @@ moz_gtk_get_tab_border(gint* left, gint* top, gint* right, gint* bottom,
+       int initial_gap;
+       gtk_widget_style_get (gTabWidget, "initial-gap", &initial_gap, NULL);
+       if (direction == GTK_TEXT_DIR_RTL)
+-      	*right += initial_gap;
++        *right += initial_gap;
+       else
+-      	*left += initial_gap;
+-    }
+-
+-    // Top tabs have no bottom border, bottom tabs have no top border
+-    if (flags & MOZ_GTK_TAB_BOTTOM) {
+-      *top = 0;
+-    } else {
+-      *bottom = 0;
++        *left += initial_gap;
+     }
+ 
+     gtk_style_context_restore(style);
+diff --git widget/gtk/gtkdrawing.h widget/gtk/gtkdrawing.h
+index 1938e8f..5f71cfd 100644
+--- mozilla/widget/gtk/gtkdrawing.h
++++ mozilla/widget/gtk/gtkdrawing.h
+@@ -293,16 +293,6 @@ moz_gtk_checkbox_get_metrics(gint* indicator_size, gint* indicator_spacing);
+ gint
+ moz_gtk_radio_get_metrics(gint* indicator_size, gint* indicator_spacing);
+ 
+-/**
+- * Get the inner-border value for a GtkButton widget (button or tree header)
+- * widget:             [IN]  the widget to get the border value for 
+- * inner_border:       [OUT] the inner border
+- *
+- * returns:   MOZ_GTK_SUCCESS if there was no error, an error code otherwise
+- */
+-gint
+-moz_gtk_button_get_inner_border(GtkWidget* widget, GtkBorder* inner_border);
+-
+ /** Get the extra size for the focus ring for outline:auto.
+  * widget:             [IN]  the widget to get the focus metrics for    
+  * focus_h_width:      [OUT] the horizontal width
+@@ -313,19 +303,6 @@ moz_gtk_button_get_inner_border(GtkWidget* widget, GtkBorder* inner_border);
+ gint
+ moz_gtk_get_focus_outline_size(gint* focus_h_width, gint* focus_v_width);
+ 
+-/** Get the focus metrics for a treeheadercell, button, checkbox, or radio button.
+- * widget:             [IN]  the widget to get the focus metrics for    
+- * interior_focus:     [OUT] whether the focus is drawn around the
+- *                           label (TRUE) or around the whole container (FALSE)
+- * focus_width:        [OUT] the width of the focus line
+- * focus_pad:          [OUT] the padding between the focus line and children
+- *
+- * returns:    MOZ_GTK_SUCCESS if there was no error, an error code otherwise
+- */
+-gint
+-moz_gtk_widget_get_focus(GtkWidget* widget, gboolean* interior_focus,
+-                         gint* focus_width, gint* focus_pad);
+-
+ /** Get the horizontal padding for the menuitem widget or checkmenuitem widget.
+  * horizontal_padding: [OUT] The left and right padding of the menuitem or checkmenuitem
+  *
+diff --git widget/gtk/nsNativeThemeGTK.cpp widget/gtk/nsNativeThemeGTK.cpp
+index e5e1867..76d28e3 100644
+--- mozilla/widget/gtk/nsNativeThemeGTK.cpp
++++ mozilla/widget/gtk/nsNativeThemeGTK.cpp
+@@ -761,6 +761,8 @@ nsNativeThemeGTK::GetExtraSizeForWidget(nsIFrame* aFrame, uint8_t aWidgetType,
+         return false;
+ 
+       gint gap_height = moz_gtk_get_tab_thickness();
++      if (!gap_height)
++        return false;
+ 
+       int32_t extra = gap_height - GetTabMarginPixels(aFrame);
+       if (extra <= 0)

Deleted: trunk/mail/thunderbird/files/patch-bug1073709
==============================================================================
--- trunk/mail/thunderbird/files/patch-bug1073709	Fri Jul 24 01:20:55 2015	(r1853)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,18 +0,0 @@
-diff --git mfbt/Atomics.h mfbt/Atomics.h
-index 495a9d3..c7f7601 100644
---- mozilla/mfbt/Atomics.h
-+++ mozilla/mfbt/Atomics.h
-@@ -34,10 +34,12 @@
-     * loose typing of the atomic builtins. GCC 4.5 and 4.6 lacks inline
-     * definitions for unspecialized std::atomic and causes linking errors.
-     * Therefore, we require at least 4.7.0 for using libstdc++.
-+    *
-+    * libc++ <atomic> is only functional with clang.
-     */
- #  if MOZ_USING_LIBSTDCXX && MOZ_LIBSTDCXX_VERSION_AT_LEAST(4, 7, 0)
- #    define MOZ_HAVE_CXX11_ATOMICS
--#  elif MOZ_USING_LIBCXX
-+#  elif MOZ_USING_LIBCXX && defined(__clang__)
- #    define MOZ_HAVE_CXX11_ATOMICS
- #  endif
- /*

Deleted: trunk/mail/thunderbird/files/patch-bug1082199
==============================================================================
--- trunk/mail/thunderbird/files/patch-bug1082199	Fri Jul 24 01:20:55 2015	(r1853)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,26 +0,0 @@
-commit 258ec90
-Author: Guilherme Goncalves <guilherme.p.gonc at gmail.com>
-Date:   Fri Oct 17 15:55:00 2014 +0200
-
-    Bug 1082199 - Recompute stats in jemalloc_stats when using jemalloc3. r=glandium
----
- memory/build/mozjemalloc_compat.c | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git memory/build/mozjemalloc_compat.c memory/build/mozjemalloc_compat.c
-index 78bb13a..70265a7 100644
---- mozilla/memory/build/mozjemalloc_compat.c
-+++ mozilla/memory/build/mozjemalloc_compat.c
-@@ -68,6 +68,12 @@ jemalloc_stats_impl(jemalloc_stats_t *stats)
-   size_t active, allocated, mapped, page, pdirty;
-   size_t lg_chunk;
- 
-+  // Refresh jemalloc's stats by updating its epoch, see ctl_refresh in
-+  // src/ctl.c
-+  uint64_t epoch = 0;
-+  size_t esz = sizeof(epoch);
-+  int ret = je_(mallctl)("epoch", &epoch, &esz, &epoch, esz);
-+
-   CTL_GET("arenas.narenas", narenas);
-   CTL_GET("arenas.page", page);
-   CTL_GET("stats.active", active);

Deleted: trunk/mail/thunderbird/files/patch-bug1103858
==============================================================================
--- trunk/mail/thunderbird/files/patch-bug1103858	Fri Jul 24 01:20:55 2015	(r1853)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,42 +0,0 @@
-diff --git configure.in configure.in
-index b2b45e7..dcfdfb7 100644
---- mozilla/configure.in
-+++ mozilla/configure.in
-@@ -8346,7 +8346,7 @@ case "$OS_TARGET" in
-       NECKO_WIFI=1
-     fi
-     ;;
--  Darwin|FreeBSD|SunOS|WINNT)
-+  Darwin|DragonFly|FreeBSD|SunOS|WINNT)
-     NECKO_WIFI=1
-     ;;
-   Linux)
-diff --git netwerk/wifi/moz.build netwerk/wifi/moz.build
-index d4de063..3949380 100644
---- mozilla/netwerk/wifi/moz.build
-+++ mozilla/netwerk/wifi/moz.build
-@@ -35,7 +35,7 @@ if CONFIG['OS_ARCH'] == 'Darwin':
-     UNIFIED_SOURCES += [
-         'osx_corewlan.mm',
-     ]
--elif CONFIG['OS_ARCH'] == 'FreeBSD':
-+elif CONFIG['OS_ARCH'] in ('DragonFly', 'FreeBSD'):
-     UNIFIED_SOURCES += [
-         'nsWifiScannerFreeBSD.cpp',
-     ]
-diff --git netwerk/wifi/nsWifiScannerFreeBSD.cpp netwerk/wifi/nsWifiScannerFreeBSD.cpp
-index bdf171e..4185d69 100644
---- mozilla/netwerk/wifi/nsWifiScannerFreeBSD.cpp
-+++ mozilla/netwerk/wifi/nsWifiScannerFreeBSD.cpp
-@@ -13,7 +13,11 @@
- #include <sys/socket.h>
- #include <net/if.h>
- #include <net/if_media.h>
-+#ifdef __DragonFly__
-+#include <netproto/802_11/ieee80211_ioctl.h>
-+#else
- #include <net80211/ieee80211_ioctl.h>
-+#endif
- 
- #include <ifaddrs.h>
- #include <string.h>

Deleted: trunk/mail/thunderbird/files/patch-bug1125579
==============================================================================
--- trunk/mail/thunderbird/files/patch-bug1125579	Fri Jul 24 01:20:55 2015	(r1853)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,14 +0,0 @@
---- mozilla/js/src/assembler/jit/ExecutableAllocator.h~
-+++ mozilla/js/src/assembler/jit/ExecutableAllocator.h
-@@ -454,6 +454,11 @@ public:
-     {
-         User::IMB_Range(code, static_cast<char*>(code) + size);
-     }
-+#elif WTF_CPU_ARM_TRADITIONAL && (WTF_OS_FREEBSD || WTF_OS_NETBSD)
-+    static void cacheFlush(void* code, size_t size)
-+    {
-+	__clear_cache(code, reinterpret_cast<char*>(code) + size);
-+    }
- #elif WTF_CPU_ARM_TRADITIONAL && WTF_OS_LINUX && WTF_COMPILER_RVCT
-     static __asm void cacheFlush(void* code, size_t size);
- #elif WTF_CPU_ARM_TRADITIONAL && (WTF_OS_LINUX || WTF_OS_ANDROID) && WTF_COMPILER_GCC

Deleted: trunk/mail/thunderbird/files/patch-bug1125580
==============================================================================
--- trunk/mail/thunderbird/files/patch-bug1125580	Fri Jul 24 01:20:55 2015	(r1853)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,11 +0,0 @@
---- mozilla/js/src/jit/arm/Architecture-arm.cpp~
-+++ mozilla/js/src/jit/arm/Architecture-arm.cpp
-@@ -17,7 +17,7 @@
- 
- #define HWCAP_USE_HARDFP_ABI (1 << 28)
- 
--#if !(defined(ANDROID) || defined(MOZ_B2G)) && !defined(JS_ARM_SIMULATOR)
-+#if defined(__linux__) && !defined(ANDROID) && !defined(MOZ_B2G) && !defined(JS_ARM_SIMULATOR)
- #define HWCAP_ARMv7 (1 << 29)
- #include <asm/hwcap.h>
- #else

Modified: trunk/mail/thunderbird/files/patch-bug1130155
==============================================================================
--- trunk/mail/thunderbird/files/patch-bug1130155	Wed Jul 15 17:06:44 2015	(r1853)
+++ trunk/mail/thunderbird/files/patch-bug1130155	Fri Jul 24 01:20:55 2015	(r1854)
@@ -82,7 +82,7 @@
  
    /* This should never happen. */
    if ((unsigned int) avail > stm->buffer_size) {
-@@ -355,17 +361,67 @@ alsa_refill_stream(cubeb_stream * stm)
+@@ -359,10 +365,11 @@ alsa_refill_stream(cubeb_stream * stm)
    if (got < 0) {
      pthread_mutex_unlock(&stm->mutex);
      stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_ERROR);
@@ -90,15 +90,19 @@
      return ERROR;
    }
    if (got > 0) {
--    snd_pcm_sframes_t wrote = WRAP(snd_pcm_writei)(stm->pcm, p, got);
+-    snd_pcm_sframes_t wrote;
++    snd_pcm_sframes_t wrote, towrite = got;
+ 
+     if (stm->params.format == CUBEB_SAMPLE_FLOAT32NE) {
+       float * b = (float *) p;
+@@ -375,14 +382,62 @@ alsa_refill_stream(cubeb_stream * stm)
+         b[i] *= stm->volume;
+       }
+     }
+-    wrote = WRAP(snd_pcm_writei)(stm->pcm, p, got);
 -    if (wrote == -EPIPE) {
 -      WRAP(snd_pcm_recover)(stm->pcm, wrote, 1);
 -      wrote = WRAP(snd_pcm_writei)(stm->pcm, p, got);
--    }
--    assert(wrote >= 0 && wrote == got);
--    stm->write_position += wrote;
--    gettimeofday(&stm->last_activity, NULL);
-+    snd_pcm_sframes_t wrote, towrite = got;
 +    for (;;) {
 +      wrote = WRAP(snd_pcm_writei)(stm->pcm, p,
 +        towrite > avail ? avail : towrite);
@@ -154,7 +158,10 @@
 +      if (towrite == wrote)
 +        break;
 +      towrite -= wrote;
-+    }
+     }
+-    assert(wrote >= 0 && wrote == got);
+-    stm->write_position += wrote;
+-    gettimeofday(&stm->last_activity, NULL);
    }
    if (got != avail) {
      long buffer_fill = stm->buffer_size - (avail - got);

Added: trunk/mail/thunderbird/files/patch-bug1138845
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/mail/thunderbird/files/patch-bug1138845	Fri Jul 24 01:20:55 2015	(r1854)
@@ -0,0 +1,134 @@
+commit 4b5b332
+Author: Mike Hommey <mh+mozilla at glandium.org>
+Date:   Tue Mar 3 18:41:13 2015 +0900
+
+    Bug 1138845 - Don't require atk-bridge for gtk+3 builds. r=tbsaunde
+---
+ accessible/atk/Platform.cpp | 29 +++++++++++++++++++----------
+ config/system-headers       |  1 -
+ configure.in                |  2 +-
+ 3 files changed, 20 insertions(+), 12 deletions(-)
+
+diff --git accessible/atk/Platform.cpp accessible/atk/Platform.cpp
+index a2afd96..2ed5e0b 100644
+--- mozilla/accessible/atk/Platform.cpp
++++ mozilla/accessible/atk/Platform.cpp
+@@ -18,8 +18,9 @@
+ #include <dbus/dbus.h>
+ #endif
+ #include <gtk/gtk.h>
++
+ #if (MOZ_WIDGET_GTK == 3)
+-#include <atk-bridge.h>
++extern "C" __attribute__((weak,visibility("default"))) int atk_bridge_adaptor_init(int*, char **[]);
+ #endif
+ 
+ using namespace mozilla;
+@@ -46,7 +47,6 @@ static gulong sToplevel_hide_hook = 0;
+ 
+ GType g_atk_hyperlink_impl_type = G_TYPE_INVALID;
+ 
+-#if (MOZ_WIDGET_GTK == 2)
+ struct GnomeAccessibilityModule
+ {
+     const char *libName;
+@@ -67,11 +67,13 @@ static GnomeAccessibilityModule sAtkBridge = {
+     "gnome_accessibility_module_shutdown", nullptr
+ };
+ 
++#if (MOZ_WIDGET_GTK == 2)
+ static GnomeAccessibilityModule sGail = {
+     "libgail.so", nullptr,
+     "gnome_accessibility_module_init", nullptr,
+     "gnome_accessibility_module_shutdown", nullptr
+ };
++#endif
+ 
+ static nsresult
+ LoadGtkModule(GnomeAccessibilityModule& aModule)
+@@ -98,7 +100,11 @@ LoadGtkModule(GnomeAccessibilityModule& aModule)
+             else
+                 subLen = loc2 - loc1;
+             nsAutoCString sub(Substring(libPath, loc1, subLen));
++#if (MOZ_WIDGET_GTK == 2)
+             sub.AppendLiteral("/gtk-2.0/modules/");
++#else
++            sub.AppendLiteral("/gtk-3.0/modules/");
++#endif
+             sub.Append(aModule.libName);
+             aModule.lib = PR_LoadLibrary(sub.get());
+             if (aModule.lib)
+@@ -123,7 +129,6 @@ LoadGtkModule(GnomeAccessibilityModule& aModule)
+     }
+     return NS_OK;
+ }
+-#endif // (MOZ_WIDGET_GTK == 2)
+ 
+ void
+ a11y::PlatformInit()
+@@ -175,14 +180,17 @@ a11y::PlatformInit()
+ 
+   // Init atk-bridge now
+   PR_SetEnv("NO_AT_BRIDGE=0");
+-#if (MOZ_WIDGET_GTK == 2)
+-  rv = LoadGtkModule(sAtkBridge);
+-  if (NS_SUCCEEDED(rv)) {
+-    (*sAtkBridge.init)();
+-  }
+-#else
+-  atk_bridge_adaptor_init(nullptr, nullptr);
++#if (MOZ_WIDGET_GTK == 3)
++  if (atk_bridge_adaptor_init) {
++    atk_bridge_adaptor_init(nullptr, nullptr);
++  } else
+ #endif
++  {
++    nsresult rv = LoadGtkModule(sAtkBridge);
++    if (NS_SUCCEEDED(rv)) {
++      (*sAtkBridge.init)();
++    }
++  }
+ 
+   if (!sToplevel_event_hook_added) {
+     sToplevel_event_hook_added = true;
+@@ -210,7 +218,6 @@ a11y::PlatformShutdown()
+                                     sToplevel_hide_hook);
+     }
+ 
+-#if (MOZ_WIDGET_GTK == 2)
+     if (sAtkBridge.lib) {
+         // Do not shutdown/unload atk-bridge,
+         // an exit function registered will take care of it
+@@ -221,6 +228,7 @@ a11y::PlatformShutdown()
+         sAtkBridge.init = nullptr;
+         sAtkBridge.shutdown = nullptr;
+     }
++#if (MOZ_WIDGET_GTK == 2)
+     if (sGail.lib) {
+         // Do not shutdown gail because
+         // 1) Maybe it's not init-ed by us. e.g. GtkEmbed
+diff --git config/system-headers config/system-headers
+index 2c94a7d..cf01775 100644
+--- mozilla/config/system-headers
++++ mozilla/config/system-headers
+@@ -189,7 +189,6 @@ asm/signal.h
+ ASRegistry.h
+ assert.h
+ atk/atk.h
+-atk-bridge.h
+ atlcom.h
+ atlconv.h
+ atlctl.cpp
+diff --git configure.in configure.in
+index 0bd1eb7..f3b3365 100644
+--- mozilla/configure.in
++++ mozilla/configure.in
+@@ -4408,7 +4408,7 @@ fi
+ 
+ if test "$COMPILE_ENVIRONMENT"; then
+   if test "$MOZ_ENABLE_GTK3"; then
+-    PKG_CHECK_MODULES(MOZ_GTK3, gtk+-3.0 >= $GTK3_VERSION gtk+-unix-print-3.0 glib-2.0 gobject-2.0 atk-bridge-2.0 $GDK_PACKAGES)
++    PKG_CHECK_MODULES(MOZ_GTK3, gtk+-3.0 >= $GTK3_VERSION gtk+-unix-print-3.0 glib-2.0 gobject-2.0 $GDK_PACKAGES)
+     MOZ_GTK3_CFLAGS="-I${_topsrcdir}/widget/gtk/compat-gtk3 $MOZ_GTK3_CFLAGS"
+     dnl Contrary to MOZ_GTK2_LIBS, MOZ_GTK3_LIBS needs to be literally added to TK_LIBS instead
+     dnl of a make reference because of how TK_LIBS is mangled in toolkit/library/moz.build

Added: trunk/mail/thunderbird/files/patch-bug1143686
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/mail/thunderbird/files/patch-bug1143686	Fri Jul 24 01:20:55 2015	(r1854)
@@ -0,0 +1,46 @@
+commit e50e738
+Author: Martin Stransky <stransky at redhat.com>
+Date:   Mon Mar 16 08:00:00 2015 -0400
+
+    Bug 1143686 - Gtk3 - Render scrollbar thumb with margin. r=karlt
+---
+ widget/gtk/gtk3drawing.c | 14 ++++++++++----
+ 1 file changed, 10 insertions(+), 4 deletions(-)
+
+diff --git widget/gtk/gtk3drawing.c widget/gtk/gtk3drawing.c
+index 17f46ab..08a58d6 100644
+--- mozilla/widget/gtk/gtk3drawing.c
++++ mozilla/widget/gtk/gtk3drawing.c
+@@ -1230,6 +1230,7 @@ moz_gtk_scrollbar_thumb_paint(GtkThemeWidgetType widget,
+     GtkStyleContext* style;
+     GtkScrollbar *scrollbar;
+     GtkAdjustment *adj;
++    GtkBorder margin;
+ 
+     ensure_scrollbar_widget();
+ 
+@@ -1239,15 +1240,20 @@ moz_gtk_scrollbar_thumb_paint(GtkThemeWidgetType widget,
+         scrollbar = GTK_SCROLLBAR(gVertScrollbarWidget);
+ 
+     gtk_widget_set_direction(GTK_WIDGET(scrollbar), direction);
+-  
++
+     style = gtk_widget_get_style_context(GTK_WIDGET(scrollbar));
+     gtk_style_context_save(style);
+-       
++
+     gtk_style_context_add_class(style, GTK_STYLE_CLASS_SLIDER);
+     gtk_style_context_set_state(style, state_flags);
+ 
+-    gtk_render_slider(style, cr, rect->x, rect->y,
+-                      rect->width,  rect->height,
++    gtk_style_context_get_margin (style, state_flags, &margin);
++
++    gtk_render_slider(style, cr,
++                      rect->x + margin.left,
++                      rect->y + margin.top,
++                      rect->width - margin.left - margin.right,
++                      rect->height - margin.top - margin.bottom,
+                      (widget == MOZ_GTK_SCROLLBAR_THUMB_HORIZONTAL) ?
+                      GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL);
+ 

Added: trunk/mail/thunderbird/files/patch-bug1144643
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/mail/thunderbird/files/patch-bug1144643	Fri Jul 24 01:20:55 2015	(r1854)
@@ -0,0 +1,33 @@
+commit a0ccc19
+Author: Martin Stransky <stransky at redhat.com>
+Date:   Wed Mar 18 07:14:00 2015 -0400
+
+    Bug 1144643 - Render tooltips as transparent on Gtk3. r=karlt
+    
+    --HG--
+    extra : rebase_source : 23085532b27350ca71cbe18db071628388003f33
+---
+ widget/gtk/nsNativeThemeGTK.cpp | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git widget/gtk/nsNativeThemeGTK.cpp widget/gtk/nsNativeThemeGTK.cpp
+index e5e1867..26d13a5 100644
+--- mozilla/widget/gtk/nsNativeThemeGTK.cpp
++++ mozilla/widget/gtk/nsNativeThemeGTK.cpp
+@@ -1528,9 +1528,15 @@ nsNativeThemeGTK::GetWidgetTransparency(nsIFrame* aFrame, uint8_t aWidgetType)
+   case NS_THEME_MENUPOPUP:
+   case NS_THEME_WINDOW:
+   case NS_THEME_DIALOG:
+-  // Tooltips use gtk_paint_flat_box().
++    return eOpaque;
++  // Tooltips use gtk_paint_flat_box() on Gtk2
++  // but are shaped on Gtk3
+   case NS_THEME_TOOLTIP:
++#if (MOZ_WIDGET_GTK == 2)
+     return eOpaque;
++#else
++    return eTransparent;
++#endif
+   }
+ 
+   return eUnknownTransparency;

Modified: trunk/mail/thunderbird/files/patch-bug702179
==============================================================================
--- trunk/mail/thunderbird/files/patch-bug702179	Wed Jul 15 17:06:44 2015	(r1853)
+++ trunk/mail/thunderbird/files/patch-bug702179	Fri Jul 24 01:20:55 2015	(r1854)
@@ -4,33 +4,21 @@
 
     Bug 702179 dtrace probes are not installed on Solaris with static js lib r=glandium
 ---
- configure.in       | 2 +-
- js/src/Makefile.in | 2 --
- 2 files changed, 1 insertion(+), 3 deletions(-)
+ js/src/Makefile.in        | 3 ---
+ toolkit/library/moz.build | 5 -----
+ 2 files changed, 8 deletions(-)
 
-diff --git configure.in configure.in
-index 66549c1..75b848d 100644
---- mozilla/configure.in
-+++ mozilla/configure.in
-@@ -966,7 +966,7 @@ MOZ_BZ2_LIBS='$(call EXPAND_LIBNAME_PATH,bz2,$(DEPTH)/modules/libbz2/src)'
- MOZ_PNG_CFLAGS="-I$_objdir/dist/include" # needed for freetype compilation
- MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,mozpng,$(DEPTH)/media/libpng)'
- 
--MOZ_JS_STATIC_LIBS='$(call EXPAND_LIBNAME_PATH,js_static,$(LIBXUL_DIST)/lib)'
-+MOZ_JS_STATIC_LIBS='$(call EXPAND_LIBNAME_PATH,js_static,$(DEPTH)/js/src)'
- MOZ_JS_SHARED_LIBS='$(call EXPAND_LIBNAME_PATH,mozjs,$(LIBXUL_DIST)/lib)'
- MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib'
- XPCOM_FROZEN_LDOPTS='$(call EXPAND_LIBNAME_PATH,xul mozalloc,$(LIBXUL_DIST)/bin)'
 diff --git js/src/Makefile.in js/src/Makefile.in
-index e28160a..28ca5e8 100644
+index 62bbfa0..90400cb 100644
 --- mozilla/js/src/Makefile.in
 +++ mozilla/js/src/Makefile.in
-@@ -18,8 +18,6 @@ run_for_side_effects := $(shell echo 'MAKE: $(MAKE)')
- STATIC_LIBRARY_NAME = js_static
- LIBS		= $(NSPR_LIBS)
+@@ -17,9 +17,6 @@ TOPLEVEL_BUILD := 1
+ run_for_side_effects := $(shell echo 'MAKE: $(MAKE)')
+ EXTRA_LIBS		+= $(NSPR_LIBS)
  
 -DIST_INSTALL = 1
+-NO_EXPAND_LIBS = 1
 -
- ifdef JS_STANDALONE
- SHARED_LIBRARY_LIBS += $(call EXPAND_LIBNAME_PATH,mfbt,$(DEPTH)/mfbt)
- ifndef MOZ_NATIVE_ZLIB
+ ifdef JS_HAS_CTYPES
+ ifdef MOZ_NATIVE_FFI
+ LOCAL_INCLUDES = $(MOZ_FFI_CFLAGS)

Modified: trunk/mail/thunderbird/files/patch-bug779713
==============================================================================
--- trunk/mail/thunderbird/files/patch-bug779713	Wed Jul 15 17:06:44 2015	(r1853)
+++ trunk/mail/thunderbird/files/patch-bug779713	Fri Jul 24 01:20:55 2015	(r1854)
@@ -1,3 +1,5 @@
+diff --git mfbt/Alignment.h mfbt/Alignment.h
+index e0843ca..353ec36 100644
 --- mozilla/mfbt/Alignment.h
 +++ mozilla/mfbt/Alignment.h
 @@ -9,11 +9,20 @@
@@ -45,7 +47,15 @@
 index d317766..ddb13da 100644
 --- mozilla/mfbt/Attributes.h
 +++ mozilla/mfbt/Attributes.h
-@@ -54,6 +54,9 @@
+@@ -50,6 +50,7 @@
+  * don't indicate support for them here, due to
+  * http://stackoverflow.com/questions/20498142/visual-studio-2013-explicit-keyword-bug
+  */
++#  define MOZ_HAVE_CXX11_ALIGNAS
+ #  define MOZ_HAVE_NEVER_INLINE          __declspec(noinline)
+ #  define MOZ_HAVE_NORETURN              __declspec(noreturn)
+ #  ifdef __clang__
+@@ -70,6 +71,9 @@
  #  ifndef __has_extension
  #    define __has_extension __has_feature /* compatibility, for older versions of clang */
  #  endif
@@ -55,21 +65,13 @@
  #  if __has_extension(cxx_constexpr)
  #    define MOZ_HAVE_CXX11_CONSTEXPR
  #  endif
-@@ -75,6 +78,9 @@
+@@ -84,6 +88,9 @@
  #  endif
  #elif defined(__GNUC__)
  #  if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
 +#    if MOZ_GCC_VERSION_AT_LEAST(4, 8, 0)
 +#      define MOZ_HAVE_CXX11_ALIGNAS
 +#    endif
- #    if MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)
- #      define MOZ_HAVE_CXX11_OVERRIDE
- #      define MOZ_HAVE_CXX11_FINAL       final
-@@ -96,6 +102,7 @@
- #  define MOZ_HAVE_NORETURN              __attribute__((noreturn))
- #elif defined(_MSC_VER)
- #  if _MSC_VER >= 1800
-+#    define MOZ_HAVE_CXX11_ALIGNAS
- #    define MOZ_HAVE_CXX11_DELETE
+ #      define MOZ_HAVE_CXX11_CONSTEXPR
+ #      define MOZ_HAVE_EXPLICIT_CONVERSION
  #  endif
- #  if _MSC_VER >= 1700

Modified: trunk/mail/thunderbird/files/patch-bug826985
==============================================================================
--- trunk/mail/thunderbird/files/patch-bug826985	Wed Jul 15 17:06:44 2015	(r1853)
+++ trunk/mail/thunderbird/files/patch-bug826985	Fri Jul 24 01:20:55 2015	(r1854)
@@ -51,18 +51,18 @@
      # basic stuff for everything
      'include_internal_video_render': 0,
      'clang_use_chrome_plugins': 0,
-diff --git media/webrtc/signaling/test/Makefile.in media/webrtc/signaling/test/Makefile.in
+diff --git media/webrtc/signaling/test/moz.build media/webrtc/signaling/test/moz.build
 index b483cd1..f1dd1f0 100644
---- mozilla/media/webrtc/signaling/test/Makefile.in
-+++ mozilla/media/webrtc/signaling/test/Makefile.in
-@@ -7,6 +7,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) \
+--- mozilla/media/webrtc/signaling/test/moz.build
++++ mozilla/media/webrtc/signaling/test/moz.build
+@@ -122,6 +122,7 @@ if CONFIG['JS_SHARED_LIBRARY']:
+         'js',
+     ]
+ 
++OS_LIBS += CONFIG['MOZ_LIBV4L2_LIBS']
+ OS_LIBS += CONFIG['MOZ_WEBRTC_X11_LIBS']
+ OS_LIBS += CONFIG['REALTIME_LIBS']
+ 
 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
 --- mozilla/media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc
@@ -145,35 +145,35 @@
    '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',
-+                  ],
-+                }],
+@@ -69,6 +72,19 @@
+             'linux/video_capture_linux.cc',
+             'linux/video_capture_linux.h',
+           ],
++          'conditions': [
++            ['use_libv4l2==1', {
++              'defines': [
++                'HAVE_LIBV4L2',
++              ],
++              'cflags_mozilla': [
++                '$(MOZ_LIBV4L2_CFLAGS)',
++              ],
++              'libraries': [
++                '-lv4l2',
 +              ],
-               'include_dirs': [
-                 'linux',
-               ],
-diff --git toolkit/library/Makefile.in toolkit/library/Makefile.in
++            }],
++          ],
+         }],  # linux
+         ['OS=="mac"', {
+           'sources': [
+diff --git toolkit/library/moz.build toolkit/library/moz.build
 index 9c16ffa..1db3794 100644
---- mozilla/toolkit/library/libxul.mk
-+++ mozilla/toolkit/library/libxul.mk
-@@ -182,6 +182,10 @@ endif
- 
- EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME_PATH,gkmedias,$(DIST)/lib)
- 
-+ifdef MOZ_LIBV4L2_LIBS
-+EXTRA_DSO_LDOPTS += $(MOZ_LIBV4L2_LIBS)
-+endif
-+
- ifdef MOZ_WEBRTC
- ifeq (WINNT,$(OS_TARGET))
- EXTRA_DSO_LDOPTS += \
+--- mozilla/toolkit/library/moz.build
++++ mozilla/toolkit/library/moz.build
+@@ -163,6 +163,7 @@ if CONFIG['OS_ARCH'] == 'Linux' and CONF
+     ]
+ 
+ OS_LIBS += CONFIG['MOZ_CAIRO_OSLIBS']
++OS_LIBS += CONFIG['MOZ_LIBV4L2_LIBS']
+ OS_LIBS += CONFIG['MOZ_WEBRTC_X11_LIBS']
+ OS_LIBS += CONFIG['MOZ_APP_EXTRA_LIBS']
+ 

Modified: trunk/mail/thunderbird/files/patch-bug847568
==============================================================================
--- trunk/mail/thunderbird/files/patch-bug847568	Wed Jul 15 17:06:44 2015	(r1853)
+++ trunk/mail/thunderbird/files/patch-bug847568	Fri Jul 24 01:20:55 2015	(r1854)
@@ -4,7 +4,7 @@
 index 14bfc0d..5383399 100644
 --- mozilla/config/Makefile.in
 +++ mozilla/config/Makefile.in
-@@ -77,6 +77,8 @@ export:: $(export-preqs)
+@@ -75,6 +75,8 @@ export:: $(export-preqs)
  		-DMOZ_NATIVE_LIBEVENT=$(MOZ_NATIVE_LIBEVENT) \
  		-DMOZ_NATIVE_LIBVPX=$(MOZ_NATIVE_LIBVPX) \
  		-DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \
@@ -17,7 +17,7 @@
 index 18e8703..bdc5f82 100644
 --- mozilla/config/system-headers
 +++ mozilla/config/system-headers
-@@ -1145,3 +1145,11 @@ unicode/utypes.h
+@@ -1357,3 +1357,11 @@ unicode/utypes.h
  #endif
  libutil.h
  unwind.h
@@ -33,7 +33,7 @@
 index ac38f40..87536b7 100644
 --- mozilla/configure.in
 +++ mozilla/configure.in
-@@ -8032,6 +8032,52 @@ if test "$USE_FC_FREETYPE"; then
+@@ -7986,6 +7986,49 @@ if test "$USE_FC_FREETYPE"; then
  fi
  
  dnl ========================================================
@@ -46,16 +46,15 @@
 +MOZ_NATIVE_HARFBUZZ=)
 +
 +if test -n "$MOZ_NATIVE_HARFBUZZ"; then
-+    PKG_CHECK_MODULES(MOZ_HARFBUZZ, harfbuzz >= 0.9.25)
++    PKG_CHECK_MODULES(MOZ_HARFBUZZ, harfbuzz >= 0.9.34)
 +fi
 +
 +AC_SUBST(MOZ_NATIVE_HARFBUZZ)
-+AC_SUBST(MOZ_HARFBUZZ_CFLAGS)
-+AC_SUBST(MOZ_HARFBUZZ_LIBS)
 +
 +dnl ========================================================
 +dnl Check for graphite2
 +dnl ========================================================
++
 +MOZ_ARG_WITH_BOOL(system-graphite2,
 +[  --with-system-graphite2 Use system graphite2 (located with pkgconfig)],
 +MOZ_NATIVE_GRAPHITE2=1,
@@ -79,27 +78,58 @@
 +fi
 +
 +AC_SUBST(MOZ_NATIVE_GRAPHITE2)
-+AC_SUBST(MOZ_GRAPHITE2_CFLAGS)
-+AC_SUBST(MOZ_GRAPHITE2_LIBS)
 +
 +dnl ========================================================
  dnl Check for pixman and cairo
  dnl ========================================================
  
-diff --git content/base/src/moz.build content/base/src/moz.build
-index d4f6380..0ee55df 100644
---- mozilla/content/base/src/moz.build
-+++ mozilla/content/base/src/moz.build
-@@ -179,6 +179,9 @@ SOURCES += [
+diff --git dom/base/moz.build dom/base/moz.build
+index a660ba4..6b2f602 100644
+--- mozilla/dom/base/moz.build
++++ mozilla/dom/base/moz.build
+@@ -196,6 +196,9 @@ SOURCES += [
      'nsObjectLoadingContent.cpp',
  ]
  
 +if CONFIG['MOZ_NATIVE_HARFBUZZ']:
-+    SOURCES['nsContentUtils.cpp'].flags += [CONFIG['MOZ_HARFBUZZ_CFLAGS']]
++    SOURCES['nsContentUtils.cpp'].flags += CONFIG['MOZ_HARFBUZZ_CFLAGS']
 +
  EXTRA_COMPONENTS += [
      'contentAreaDropListener.js',
      'contentAreaDropListener.manifest',
+diff --git gfx/graphite2/moz-gr-update.sh gfx/graphite2/moz-gr-update.sh
+index f3d76ea..a9e7fb6 100644
+--- mozilla/gfx/graphite2/moz-gr-update.sh
++++ mozilla/gfx/graphite2/moz-gr-update.sh
+@@ -23,8 +23,14 @@ echo "\nSee" $0 "for update procedure.\n" >> gfx/graphite2/README.mozilla
+ find gfx/graphite2/ -name "*.cpp" -exec perl -p -i -e "s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \;
+ find gfx/graphite2/ -name "*.h" -exec perl -p -i -e "s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \;
+ 
++# closest tag/release to require for system version
++TAG=$(cd ../graphitedev/ && hg parents --template {latesttag})
++
++perl -p -i -e "s/[0-9]+\,[0-9]+\,[0-9]+/$TAG/ and tr/./,/ \
++  if /GR2_VERSION_REQUIRE/" configure.in
++
+ # summarize what's been touched
+-echo Updated to $CHANGESET.
++echo Updated to $CHANGESET \($TAG for --with-system-graphite2\)
+ echo Here is what changed in the gfx/graphite2 directory:
+ echo
+ 
+diff --git gfx/harfbuzz/README-mozilla gfx/harfbuzz/README-mozilla
+index ca57d16..1ce21fe 100644
+--- mozilla/gfx/harfbuzz/README-mozilla
++++ mozilla/gfx/harfbuzz/README-mozilla
+@@ -21,3 +21,8 @@ In addition, the src/Makefile.in file here is NOT from upstream, nor is it
+ generated from src/Makefile.am (the original harfbuzz version); it is a mozilla-
+ specific makefile that is maintained by hand. It should only need updating when
+ new source files or exported headers are added in harfbuzz.
++
++The in-tree copy may be omitted during build by --with-system-harfbuzz.
++Make sure to keep pkg-config version check within configure.in in sync
++with checkout version or increment latest tag by one if it's not based
++on upstream release.
 diff --git gfx/moz.build gfx/moz.build
 index 519aa46..6929751 100644
 --- mozilla/gfx/moz.build
@@ -126,83 +156,87 @@
      'ots/src',
      'thebes',
      'ipc',
-diff --git gfx/skia/Makefile.in gfx/skia/Makefile.in
-index ee0efb2..98e169d6f 100644
---- mozilla/gfx/skia/Makefile.in
-+++ mozilla/gfx/skia/Makefile.in
-@@ -15,6 +15,10 @@ ifeq (qt,$(MOZ_WIDGET_TOOLKIT))
- OS_CXXFLAGS += $(MOZ_CAIRO_CFLAGS) $(MOZ_PANGO_CFLAGS) $(CAIRO_FT_CFLAGS)
- endif
- 
-+ifdef MOZ_NATIVE_HARFBUZZ
-+OS_CXXFLAGS += $(MOZ_HARFBUZZ_CFLAGS)
-+endif
-+
- include $(topsrcdir)/config/rules.mk
- 
- ifeq ($(CPU_ARCH)_$(GNU_CC),arm_1)
-diff --git gfx/thebes/Makefile.in gfx/thebes/Makefile.in
-index 45c36ae..79d32cf 100644
---- mozilla/gfx/thebes/Makefile.in
-+++ mozilla/gfx/thebes/Makefile.in
-@@ -13,6 +13,14 @@ DEFINES := $(filter-out -DUNICODE,$(DEFINES))
- CXXFLAGS += $(MOZ_CAIRO_CFLAGS) $(TK_CFLAGS)
- CFLAGS += $(MOZ_CAIRO_CFLAGS) $(TK_CFLAGS)
- 
-+ifdef MOZ_NATIVE_GRAPHITE2
-+CXXFLAGS += $(MOZ_GRAPHITE2_CFLAGS)
-+endif
-+
-+ifdef MOZ_NATIVE_HARFBUZZ
-+CXXFLAGS += $(MOZ_HARFBUZZ_CFLAGS)
-+endif
-+
- ifeq ($(MOZ_WIDGET_TOOLKIT),android)
- CXXFLAGS += $(CAIRO_FT_CFLAGS)
- endif
-diff --git intl/unicharutil/util/Makefile.in intl/unicharutil/util/Makefile.in
-index f6b9f7c..60863f4 100644
---- mozilla/intl/unicharutil/util/Makefile.in
-+++ mozilla/intl/unicharutil/util/Makefile.in
-@@ -21,3 +21,7 @@ ifdef _MSC_VER
- OS_COMPILE_CXXFLAGS += -Zl
- OS_COMPILE_CFLAGS += -Zl
- endif
-+
-+ifdef MOZ_NATIVE_HARFBUZZ
-+CXXFLAGS += $(MOZ_HARFBUZZ_CFLAGS)
-+endif
-diff --git netwerk/dns/Makefile.in netwerk/dns/Makefile.in
-index 1cacbd7..f5d72bb 100644
---- mozilla/netwerk/dns/Makefile.in
-+++ mozilla/netwerk/dns/Makefile.in
-@@ -5,6 +5,10 @@
- 
- include $(topsrcdir)/config/rules.mk
- 
-+ifdef MOZ_NATIVE_HARFBUZZ
-+CXXFLAGS += $(MOZ_HARFBUZZ_CFLAGS)
-+endif
-+
- # Generate the include file containing compact, static definitions
- # for effective TLD data.
- etld_data.inc: $(srcdir)/prepare_tlds.py $(srcdir)/effective_tld_names.dat
-diff --git toolkit/library/libxul.mk toolkit/library/libxul.mk
+diff --git gfx/skia/generate_mozbuild.py gfx/skia/generate_mozbuild.py
+index 28fa6b5..240dced 100755
+--- mozilla/gfx/skia/generate_mozbuild.py
++++ mozilla/gfx/skia/generate_mozbuild.py
+@@ -140,6 +140,9 @@ if CONFIG['GNU_CXX']:
+     if not CONFIG['CLANG_CXX']:
+         CXXFLAGS += ['-Wno-logical-op']
+ 
++if CONFIG['MOZ_NATIVE_HARFBUZZ']:
++    CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
++
+ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3', 'android', 'gonk', 'qt'):
+     CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
+     CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
+diff --git gfx/skia/moz.build gfx/skia/moz.build
+index 1d0c2f9..adb8941 100644
+--- mozilla/gfx/skia/moz.build
++++ mozilla/gfx/skia/moz.build
+@@ -968,6 +968,9 @@ if CONFIG['GNU_CXX']:
+     if not CONFIG['CLANG_CXX']:
+         CXXFLAGS += ['-Wno-logical-op']
+ 
++if CONFIG['MOZ_NATIVE_HARFBUZZ']:
++    CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
++
+ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3', 'android', 'gonk', 'qt'):
+     CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
+     CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
+diff --git gfx/thebes/moz.build gfx/thebes/moz.build
+index d5852fa..aeeab25 100644
+--- mozilla/gfx/thebes/moz.build
++++ mozilla/gfx/thebes/moz.build
+@@ -278,6 +278,12 @@ CXXFLAGS += CONFIG['TK_CFLAGS']
+ CFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
+ CFLAGS += CONFIG['TK_CFLAGS']
+ 
++if CONFIG['MOZ_NATIVE_HARFBUZZ']:
++    CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
++
++if CONFIG['MOZ_NATIVE_GRAPHITE2']:
++    CXXFLAGS += CONFIG['MOZ_GRAPHITE2_CFLAGS']
++
+ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gonk', 'qt'):
+     CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
+ 
+diff --git intl/unicharutil/util/moz.build intl/unicharutil/util/moz.build
+index d736943..41a931f 100644
+--- mozilla/intl/unicharutil/util/moz.build
++++ mozilla/intl/unicharutil/util/moz.build
+@@ -37,3 +37,6 @@ if CONFIG['_MSC_VER']:
+ 
+ if CONFIG['ENABLE_INTL_API']:
+     CXXFLAGS += CONFIG['MOZ_ICU_CFLAGS']
++
++if CONFIG['MOZ_NATIVE_HARFBUZZ']:
++    CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
+diff --git netwerk/dns/moz.build netwerk/dns/moz.build
+index 0b0717a..2e665c9 100644
+--- mozilla/netwerk/dns/moz.build
++++ mozilla/netwerk/dns/moz.build
+@@ -64,3 +64,6 @@ GENERATED_FILES = [
+ LOCAL_INCLUDES += [
+     '/netwerk/base',
+ ]
++
++if CONFIG['MOZ_NATIVE_HARFBUZZ']:
++    CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
+diff --git toolkit/library/moz.build toolkit/library/moz.build
 index 67f0db9..d42137a 100644
---- mozilla/toolkit/library/libxul.mk
-+++ mozilla/toolkit/library/libxul.mk
-@@ -89,6 +89,14 @@ ifndef MOZ_TREE_PIXMAN
- EXTRA_DSO_LDOPTS += $(MOZ_PIXMAN_LIBS)
- endif
- 
-+ifdef MOZ_NATIVE_GRAPHITE2
-+EXTRA_DSO_LDOPTS += $(MOZ_GRAPHITE2_LIBS)
-+endif
-+
-+ifdef MOZ_NATIVE_HARFBUZZ
-+EXTRA_DSO_LDOPTS += $(MOZ_HARFBUZZ_LIBS)
-+endif
-+
- ifdef MOZ_DMD
- EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME_PATH,dmd,$(DIST)/lib)
- endif
+--- mozilla/toolkit/library/moz.build
++++ mozilla/toolkit/library/moz.build
+@@ -187,6 +187,12 @@ if CONFIG['MOZ_NATIVE_LIBVPX']:
+ if not CONFIG['MOZ_TREE_PIXMAN']:
+     OS_LIBS += CONFIG['MOZ_PIXMAN_LIBS']
+ 
++if CONFIG['MOZ_NATIVE_GRAPHITE2']:
++    OS_LIBS += CONFIG['MOZ_GRAPHITE2_LIBS']
++
++if CONFIG['MOZ_NATIVE_HARFBUZZ']:
++    OS_LIBS += CONFIG['MOZ_HARFBUZZ_LIBS']
++
+ if CONFIG['MOZ_OSS']:
+     OS_LIBS += CONFIG['MOZ_OSS_LIBS']
+ 

Deleted: trunk/mail/thunderbird/files/patch-bug858919
==============================================================================
--- trunk/mail/thunderbird/files/patch-bug858919	Fri Jul 24 01:20:55 2015	(r1853)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,391 +0,0 @@
-commit a33d4f7
-Author: Martin Stransky <stransky at redhat.com>
-Date:   Fri Nov 14 04:04:00 2014 +0100
-
-    Bug 858919 - Add support for libnotify calls which was removed for new notification API. r=karlt
----
- toolkit/components/alerts/nsAlertsService.cpp  | 10 +--
- toolkit/system/gnome/moz.build                 |  2 +
- toolkit/system/gnome/nsAlertsIconListener.cpp  | 64 ++++++++++++------
- toolkit/system/gnome/nsAlertsIconListener.h    | 89 ++++++++++++++++++++++++++
- toolkit/system/gnome/nsGnomeModule.cpp         |  5 ++
- toolkit/system/gnome/nsSystemAlertsService.cpp | 54 ++++++++++++++++
- toolkit/system/gnome/nsSystemAlertsService.h   | 27 ++++++++
- 7 files changed, 226 insertions(+), 25 deletions(-)
-
-diff --git toolkit/components/alerts/nsAlertsService.cpp toolkit/components/alerts/nsAlertsService.cpp
-index 93f4536..f8b5e07 100644
---- mozilla/toolkit/components/alerts/nsAlertsService.cpp
-+++ mozilla/toolkit/components/alerts/nsAlertsService.cpp
-@@ -100,9 +100,11 @@ NS_IMETHODIMP nsAlertsService::ShowAlertNotification(const nsAString & aImageUrl
-   nsCOMPtr<nsIAlertsService> sysAlerts(do_GetService(NS_SYSTEMALERTSERVICE_CONTRACTID));
-   nsresult rv;
-   if (sysAlerts) {
--    return sysAlerts->ShowAlertNotification(aImageUrl, aAlertTitle, aAlertText, aAlertTextClickable,
--                                            aAlertCookie, aAlertListener, aAlertName,
--                                            aBidi, aLang, IPC::Principal(aPrincipal));
-+    rv = sysAlerts->ShowAlertNotification(aImageUrl, aAlertTitle, aAlertText, aAlertTextClickable,
-+                                          aAlertCookie, aAlertListener, aAlertName,
-+                                          aBidi, aLang, IPC::Principal(aPrincipal));
-+    if (NS_SUCCEEDED(rv))
-+      return NS_OK;
-   }
- 
-   if (!ShouldShowAlert()) {
-diff --git toolkit/system/gnome/moz.build toolkit/system/gnome/moz.build
-index c033f8b..9242209 100644
---- mozilla/toolkit/system/gnome/moz.build
-+++ mozilla/toolkit/system/gnome/moz.build
-@@ -5,7 +5,9 @@
- # file, You can obtain one at http://mozilla.org/MPL/2.0/.
- 
- SOURCES += [
-+    'nsAlertsIconListener.cpp',
-     'nsGnomeModule.cpp',
-+    'nsSystemAlertsService.cpp',
- ]
- 
- if CONFIG['MOZ_ENABLE_GCONF']:
-diff --git toolkit/system/gnome/nsAlertsIconListener.cpp toolkit/system/gnome/nsAlertsIconListener.cpp
-index f39335e..55f4356 100644
---- mozilla/toolkit/system/gnome/nsAlertsIconListener.cpp
-+++ mozilla/toolkit/system/gnome/nsAlertsIconListener.cpp
-@@ -51,6 +51,21 @@ static void notify_closed_marshal(GClosure* closure,
-   NS_RELEASE(alert);
- }
- 
-+static GdkPixbuf*
-+GetPixbufFromImgRequest(imgIRequest* aRequest)
-+{
-+  nsCOMPtr<imgIContainer> image;
-+  nsresult rv = aRequest->GetImage(getter_AddRefs(image));
-+  if (NS_FAILED(rv)) {
-+    return nullptr;
-+  }
-+
-+  nsCOMPtr<nsIImageToPixbuf> imgToPixbuf =
-+    do_GetService("@mozilla.org/widget/image-to-gdk-pixbuf;1");
-+
-+  return imgToPixbuf->ConvertImageToPixbuf(image);
-+}
-+
- NS_IMPL_ISUPPORTS(nsAlertsIconListener, imgINotificationObserver,
-                   nsIObserver, nsISupportsWeakReference)
- 
-@@ -106,47 +121,45 @@ nsAlertsIconListener::Notify(imgIRequest *aRequest, int32_t aType, const nsIntRe
- nsresult
- nsAlertsIconListener::OnStopRequest(imgIRequest* aRequest)
- {
-+  NS_ASSERTION(mIconRequest == aRequest, "aRequest does not match!");
-+
-   uint32_t imgStatus = imgIRequest::STATUS_ERROR;
-   nsresult rv = aRequest->GetImageStatus(&imgStatus);
-   NS_ENSURE_SUCCESS(rv, rv);
-   if (imgStatus == imgIRequest::STATUS_ERROR && !mLoadedFrame) {
-     // We have an error getting the image. Display the notification with no icon.
-     ShowAlert(nullptr);
--  }
- 
--  if (mIconRequest) {
-+    // Cancel any pending request
-     mIconRequest->Cancel(NS_BINDING_ABORTED);
-     mIconRequest = nullptr;
-   }
-+
-   return NS_OK;
- }
- 
- nsresult
- nsAlertsIconListener::OnStopFrame(imgIRequest* aRequest)
- {
--  if (aRequest != mIconRequest)
--    return NS_ERROR_FAILURE;
-+  NS_ASSERTION(mIconRequest == aRequest, "aRequest does not match!");
- 
-   if (mLoadedFrame)
-     return NS_OK; // only use one frame
- 
--  nsCOMPtr<imgIContainer> image;
--  nsresult rv = aRequest->GetImage(getter_AddRefs(image));
--  if (NS_FAILED(rv))
--    return rv;
--
--  nsCOMPtr<nsIImageToPixbuf> imgToPixbuf =
--    do_GetService("@mozilla.org/widget/image-to-gdk-pixbuf;1");
--
--  GdkPixbuf* imagePixbuf = imgToPixbuf->ConvertImageToPixbuf(image);
--  if (!imagePixbuf)
--    return NS_ERROR_FAILURE;
-+  GdkPixbuf* imagePixbuf = GetPixbufFromImgRequest(aRequest);
-+  if (!imagePixbuf) {
-+    ShowAlert(nullptr);
-+  } else {
-+    ShowAlert(imagePixbuf);
-+    g_object_unref(imagePixbuf);
-+  }
- 
--  ShowAlert(imagePixbuf);
-+  mLoadedFrame = true;
- 
--  g_object_unref(imagePixbuf);
-+  // Cancel any pending request (multipart image loading/decoding for instance)
-+  mIconRequest->Cancel(NS_BINDING_ABORTED);
-+  mIconRequest = nullptr;
- 
--  mLoadedFrame = true;
-   return NS_OK;
- }
- 
-@@ -180,6 +193,9 @@ nsAlertsIconListener::ShowAlert(GdkPixbuf* aPixbuf)
-   mClosureHandler = g_signal_connect_closure(mNotification, "closed", closure, FALSE);
-   gboolean result = notify_notification_show(mNotification, nullptr);
- 
-+  if (result && mAlertListener)
-+    mAlertListener->Observe(nullptr, "alertshow", mAlertCookie.get());
-+
-   return result ? NS_OK : NS_ERROR_FAILURE;
- }
- 
-@@ -201,9 +217,15 @@ nsAlertsIconListener::StartRequest(const nsAString & aImageUrl)
-   if (!il)
-     return ShowAlert(nullptr);
- 
--  return il->LoadImageXPCOM(imageUri, nullptr, nullptr, nullptr, nullptr,
--                            this, nullptr, nsIRequest::LOAD_NORMAL, nullptr,
--                            nullptr, getter_AddRefs(mIconRequest));
-+  nsresult rv = il->LoadImageXPCOM(imageUri, nullptr, nullptr, nullptr, nullptr,
-+                                   this, nullptr, nsIRequest::LOAD_NORMAL, nullptr,
-+                                   0 /* use default */, getter_AddRefs(mIconRequest));
-+  if (NS_FAILED(rv))
-+    return rv;
-+
-+  mIconRequest->StartDecoding();
-+
-+  return NS_OK;
- }
- 
- void
-diff --git toolkit/system/gnome/nsAlertsIconListener.h toolkit/system/gnome/nsAlertsIconListener.h
-new file mode 100644
-index 0000000..ac96db9
---- /dev/null
-+++ mozilla/toolkit/system/gnome/nsAlertsIconListener.h
-@@ -0,0 +1,89 @@
-+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-+/* 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/. */
-+
-+#ifndef nsAlertsIconListener_h__
-+#define nsAlertsIconListener_h__
-+
-+#include "nsCOMPtr.h"
-+#include "imgINotificationObserver.h"
-+#include "nsStringAPI.h"
-+#include "nsIObserver.h"
-+#include "nsWeakReference.h"
-+
-+#include <gdk-pixbuf/gdk-pixbuf.h>
-+
-+class imgIRequest;
-+
-+struct NotifyNotification;
-+
-+class nsAlertsIconListener : public imgINotificationObserver,
-+                             public nsIObserver,
-+                             public nsSupportsWeakReference
-+{
-+public:
-+  NS_DECL_ISUPPORTS
-+  NS_DECL_IMGINOTIFICATIONOBSERVER
-+  NS_DECL_NSIOBSERVER
-+
-+  nsAlertsIconListener();
-+
-+  nsresult InitAlertAsync(const nsAString & aImageUrl,
-+                          const nsAString & aAlertTitle, 
-+                          const nsAString & aAlertText,
-+                          bool aAlertTextClickable,
-+                          const nsAString & aAlertCookie,
-+                          nsIObserver * aAlertListener);
-+
-+  void SendCallback();
-+  void SendClosed();
-+
-+protected:
-+  virtual ~nsAlertsIconListener();
-+
-+  nsresult OnStopRequest(imgIRequest* aRequest);
-+  nsresult OnStopFrame(imgIRequest* aRequest);
-+
-+  /**
-+   * The only difference between libnotify.so.4 and libnotify.so.1 for these symbols
-+   * is that notify_notification_new takes three arguments in libnotify.so.4 and
-+   * four in libnotify.so.1.
-+   * Passing the fourth argument as NULL is binary compatible.
-+   */
-+  typedef void (*NotifyActionCallback)(NotifyNotification*, char*, gpointer);
-+  typedef bool (*notify_is_initted_t)(void);
-+  typedef bool (*notify_init_t)(const char*);
-+  typedef GList* (*notify_get_server_caps_t)(void);
-+  typedef NotifyNotification* (*notify_notification_new_t)(const char*, const char*, const char*, const char*);
-+  typedef bool (*notify_notification_show_t)(void*, char*);
-+  typedef void (*notify_notification_set_icon_from_pixbuf_t)(void*, GdkPixbuf*);
-+  typedef void (*notify_notification_add_action_t)(void*, const char*, const char*, NotifyActionCallback, gpointer, GFreeFunc);
-+
-+  nsCOMPtr<imgIRequest> mIconRequest;
-+  nsCString mAlertTitle;
-+  nsCString mAlertText;
-+
-+  nsCOMPtr<nsIObserver> mAlertListener;
-+  nsString mAlertCookie;
-+
-+  bool mLoadedFrame;
-+  bool mAlertHasAction;
-+
-+  static void* libNotifyHandle;
-+  static bool libNotifyNotAvail;
-+  static notify_is_initted_t notify_is_initted;
-+  static notify_init_t notify_init;
-+  static notify_get_server_caps_t notify_get_server_caps;
-+  static notify_notification_new_t notify_notification_new;
-+  static notify_notification_show_t notify_notification_show;
-+  static notify_notification_set_icon_from_pixbuf_t notify_notification_set_icon_from_pixbuf;
-+  static notify_notification_add_action_t notify_notification_add_action;
-+  NotifyNotification* mNotification;
-+  gulong mClosureHandler;
-+
-+  nsresult StartRequest(const nsAString & aImageUrl);
-+  nsresult ShowAlert(GdkPixbuf* aPixbuf);
-+};
-+
-+#endif
-diff --git toolkit/system/gnome/nsGnomeModule.cpp toolkit/system/gnome/nsGnomeModule.cpp
-index 5ccc8e5..f893893 100644
---- mozilla/toolkit/system/gnome/nsGnomeModule.cpp
-+++ mozilla/toolkit/system/gnome/nsGnomeModule.cpp
-@@ -22,6 +22,8 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGnomeVFSService, Init)
- NS_GENERIC_FACTORY_CONSTRUCTOR(nsGIOService)
- NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGSettingsService, Init)
- #endif
-+#include "nsSystemAlertsService.h"
-+NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsSystemAlertsService, Init)
- 
- #ifdef MOZ_ENABLE_GCONF
- NS_DEFINE_NAMED_CID(NS_GCONFSERVICE_CID);
-@@ -33,6 +35,7 @@ NS_DEFINE_NAMED_CID(NS_GNOMEVFSSERVICE_CID);
- NS_DEFINE_NAMED_CID(NS_GIOSERVICE_CID);
- NS_DEFINE_NAMED_CID(NS_GSETTINGSSERVICE_CID);
- #endif
-+NS_DEFINE_NAMED_CID(NS_SYSTEMALERTSSERVICE_CID);
- 
- static const mozilla::Module::CIDEntry kGnomeCIDs[] = {
- #ifdef MOZ_ENABLE_GCONF
-@@ -45,6 +48,7 @@ static const mozilla::Module::CIDEntry kGnomeCIDs[] = {
-   { &kNS_GIOSERVICE_CID, false, nullptr, nsGIOServiceConstructor },
-   { &kNS_GSETTINGSSERVICE_CID, false, nullptr, nsGSettingsServiceConstructor },
- #endif
-+  { &kNS_SYSTEMALERTSSERVICE_CID, false, nullptr, nsSystemAlertsServiceConstructor },
-   { nullptr }
- };
- 
-@@ -59,6 +63,7 @@ static const mozilla::Module::ContractIDEntry kGnomeContracts[] = {
-   { NS_GIOSERVICE_CONTRACTID, &kNS_GIOSERVICE_CID },
-   { NS_GSETTINGSSERVICE_CONTRACTID, &kNS_GSETTINGSSERVICE_CID },
- #endif
-+  { NS_SYSTEMALERTSERVICE_CONTRACTID, &kNS_SYSTEMALERTSSERVICE_CID },
-   { nullptr }
- };
- 
-diff --git toolkit/system/gnome/nsSystemAlertsService.cpp toolkit/system/gnome/nsSystemAlertsService.cpp
-new file mode 100644
-index 0000000..b91b402
---- /dev/null
-+++ mozilla/toolkit/system/gnome/nsSystemAlertsService.cpp
-@@ -0,0 +1,53 @@
-+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode:nil; c-basic-offset: 2 -*- */
-+/* This Source Code Form is subject to the terms of the Mozilla Public
-+ * License, v. 2.0. If a copy of the MPL was not distributed with this
-+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-+
-+#include "nsXULAppAPI.h"
-+#include "nsSystemAlertsService.h"
-+#include "nsAlertsIconListener.h"
-+#include "nsAutoPtr.h"
-+
-+NS_IMPL_ADDREF(nsSystemAlertsService)
-+NS_IMPL_RELEASE(nsSystemAlertsService)
-+
-+NS_INTERFACE_MAP_BEGIN(nsSystemAlertsService)
-+   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIAlertsService)
-+   NS_INTERFACE_MAP_ENTRY(nsIAlertsService)
-+NS_INTERFACE_MAP_END_THREADSAFE
-+
-+nsSystemAlertsService::nsSystemAlertsService()
-+{
-+}
-+
-+nsSystemAlertsService::~nsSystemAlertsService()
-+{}
-+
-+nsresult
-+nsSystemAlertsService::Init()
-+{
-+  return NS_OK;
-+}
-+
-+NS_IMETHODIMP nsSystemAlertsService::ShowAlertNotification(const nsAString & aImageUrl, const nsAString & aAlertTitle, 
-+                                                           const nsAString & aAlertText, bool aAlertTextClickable,
-+                                                           const nsAString & aAlertCookie,
-+                                                           nsIObserver * aAlertListener,
-+                                                           const nsAString & aAlertName,
-+                                                           const nsAString & aBidi,
-+                                                           const nsAString & aLang,
-+                                                           nsIPrincipal * aPrincipal)
-+{
-+  nsRefPtr<nsAlertsIconListener> alertListener = new nsAlertsIconListener();
-+  if (!alertListener)
-+    return NS_ERROR_OUT_OF_MEMORY;
-+
-+  return alertListener->InitAlertAsync(aImageUrl, aAlertTitle, aAlertText, aAlertTextClickable,
-+                                       aAlertCookie, aAlertListener);
-+}
-+
-+NS_IMETHODIMP nsSystemAlertsService::CloseAlert(const nsAString& aAlertName,
-+                                                nsIPrincipal* aPrincipal)
-+{
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-diff --git toolkit/system/gnome/nsSystemAlertsService.h toolkit/system/gnome/nsSystemAlertsService.h
-new file mode 100644
-index 0000000..b0bd625
---- /dev/null
-+++ mozilla/toolkit/system/gnome/nsSystemAlertsService.h
-@@ -0,0 +1,27 @@
-+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-+/* 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/. */
-+
-+#ifndef nsSystemAlertsService_h__
-+#define nsSystemAlertsService_h__
-+
-+#include "nsIAlertsService.h"
-+#include "nsCOMPtr.h"
-+
-+class nsSystemAlertsService : public nsIAlertsService
-+{
-+public:
-+  NS_DECL_NSIALERTSSERVICE
-+  NS_DECL_ISUPPORTS
-+
-+  nsSystemAlertsService();
-+
-+  nsresult Init();
-+
-+protected:
-+  virtual ~nsSystemAlertsService();
-+
-+};
-+
-+#endif /* nsSystemAlertsService_h__ */

Deleted: trunk/mail/thunderbird/files/patch-bug961264
==============================================================================
--- trunk/mail/thunderbird/files/patch-bug961264	Fri Jul 24 01:20:55 2015	(r1853)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,266 +0,0 @@
-commit d099acd
-Author: Trevor Saunders <trev.saunders at gmail.com>
-Date:   Fri Jan 17 15:08:00 2014 -0800
-
-    Bug 961264 - Remove obsolete checks for gcc visibility stuff.
----
- configure.in        | 115 +++-------------------------------------------------
- js/src/configure.in | 111 ++------------------------------------------------
- 2 files changed, 8 insertions(+), 218 deletions(-)
-
-diff --git configure.in configure.in
-index dfb8193..33d71b3 100644
---- mozilla/configure.in
-+++ mozilla/configure.in
-@@ -2507,118 +2507,15 @@ MOZ_CXX11
- 
- AC_LANG_C
- 
--dnl Check for .hidden assembler directive and visibility attribute.
--dnl Borrowed from glibc configure.in
-+dnl Setup default hidden visibility and wrapped system headers.
- dnl ===============================================================
- if test "$GNU_CC"; then
--  AC_CACHE_CHECK(for visibility(hidden) attribute,
--                 ac_cv_visibility_hidden,
--                 [cat > conftest.c <<EOF
--                  int foo __attribute__ ((visibility ("hidden"))) = 1;
--EOF
--                  ac_cv_visibility_hidden=no
--                  if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
--                    if egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
--                      ac_cv_visibility_hidden=yes
--                    fi
--                  fi
--                  rm -f conftest.[cs]
--                 ])
--  if test "$ac_cv_visibility_hidden" = "yes"; then
--    AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
--
--    AC_CACHE_CHECK(for visibility(default) attribute,
--                   ac_cv_visibility_default,
--                   [cat > conftest.c <<EOF
--                    int foo __attribute__ ((visibility ("default"))) = 1;
--EOF
--                    ac_cv_visibility_default=no
--                    if ${CC-cc} -fvisibility=hidden -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
--                      if ! egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
--                        ac_cv_visibility_default=yes
--                      fi
--                    fi
--                    rm -f conftest.[cs]
--                   ])
--    if test "$ac_cv_visibility_default" = "yes"; then
--      AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE)
--
--      AC_CACHE_CHECK(for visibility pragma support,
--                     ac_cv_visibility_pragma,
--                     [cat > conftest.c <<EOF
--#pragma GCC visibility push(hidden)
--                      int foo_hidden = 1;
--#pragma GCC visibility push(default)
--                      int foo_default = 1;
--EOF
--                      ac_cv_visibility_pragma=no
--                      if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
--                        if egrep '\.(hidden|private_extern).*foo_hidden' conftest.s >/dev/null; then
--                          if ! egrep '\.(hidden|private_extern).*foo_default' conftest.s > /dev/null; then
--                            ac_cv_visibility_pragma=yes
--                          fi
--                        fi
--                      fi
--                      rm -f conftest.[cs]
--                    ])
--      if test "$ac_cv_visibility_pragma" = "yes"; then
--        AC_CACHE_CHECK(For gcc visibility bug with class-level attributes (GCC bug 26905),
--                       ac_cv_have_visibility_class_bug,
--                       [cat > conftest.c <<EOF
--#pragma GCC visibility push(hidden)
--struct __attribute__ ((visibility ("default"))) TestStruct {
--  static void Init();
--};
--__attribute__ ((visibility ("default"))) void TestFunc() {
--  TestStruct::Init();
--}
--EOF
--                       ac_cv_have_visibility_class_bug=no
--                       if ! ${CXX-g++} ${CXXFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
--                         ac_cv_have_visibility_class_bug=yes
--                       else
--                         if test `egrep -c '@PLT|\\$stub' conftest.S` = 0; then
--                           ac_cv_have_visibility_class_bug=yes
--                         fi
--                       fi
--                       rm -rf conftest.{c,S}
--                       ])
--
--        AC_CACHE_CHECK(For x86_64 gcc visibility bug with builtins (GCC bug 20297),
--                       ac_cv_have_visibility_builtin_bug,
--                       [cat > conftest.c <<EOF
--#pragma GCC visibility push(hidden)
--#pragma GCC visibility push(default)
--#include <string.h>
--#pragma GCC visibility pop
--
--__attribute__ ((visibility ("default"))) void Func() {
--  char c[[100]];
--  memset(c, 0, sizeof(c));
--}
--EOF
--                       ac_cv_have_visibility_builtin_bug=no
--                       if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
--                         ac_cv_have_visibility_builtin_bug=yes
--                       else
--                         if test `grep -c "@PLT" conftest.S` = 0; then
--                           ac_cv_visibility_builtin_bug=yes
--                         fi
--                       fi
--                       rm -f conftest.{c,S}
--                       ])
--        if test "$ac_cv_have_visibility_builtin_bug" = "no" -a \
--                "$ac_cv_have_visibility_class_bug" = "no"; then
--          VISIBILITY_FLAGS='-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
--          WRAP_SYSTEM_INCLUDES=1
--          STL_FLAGS='-I$(DIST)/stl_wrappers'
--          WRAP_STL_INCLUDES=1
--        else
--          VISIBILITY_FLAGS='-fvisibility=hidden'
--        fi # have visibility pragma bug
--      fi   # have visibility pragma
--    fi     # have visibility(default) attribute
--  fi       # have visibility(hidden) attribute
-+  AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
-+  AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE)
-+  VISIBILITY_FLAGS='-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
-+  WRAP_SYSTEM_INCLUDES=1
-+  STL_FLAGS='-I$(DIST)/stl_wrappers'
-+  WRAP_STL_INCLUDES=1
- fi         # GNU_CC
- 
- # visibility hidden flag for Sun Studio on Solaris
-diff --git js/src/configure.in js/src/configure.in
-index bddd46d..d4b522e 100644
---- mozilla/js/src/configure.in
-+++ mozilla/js/src/configure.in
-@@ -2077,116 +2077,13 @@ AC_LANG_CPLUSPLUS
- 
- MOZ_CXX11
- 
--dnl Check for .hidden assembler directive and visibility attribute.
--dnl Borrowed from glibc configure.in
-+dnl Setup default hidden visibility and wrapped system headers.
- dnl ===============================================================
- if test "$GNU_CC"; then
--  AC_CACHE_CHECK(for visibility(hidden) attribute,
--                 ac_cv_visibility_hidden,
--                 [cat > conftest.c <<EOF
--                  int foo __attribute__ ((visibility ("hidden"))) = 1;
--EOF
--                  ac_cv_visibility_hidden=no
--                  if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
--                    if egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
--                      ac_cv_visibility_hidden=yes
--                    fi
--                  fi
--                  rm -f conftest.[cs]
--                 ])
--  if test "$ac_cv_visibility_hidden" = "yes"; then
--    AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
--
--    AC_CACHE_CHECK(for visibility(default) attribute,
--                   ac_cv_visibility_default,
--                   [cat > conftest.c <<EOF
--                    int foo __attribute__ ((visibility ("default"))) = 1;
--EOF
--                    ac_cv_visibility_default=no
--                    if ${CC-cc} -fvisibility=hidden -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
--                      if ! egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
--                        ac_cv_visibility_default=yes
--                      fi
--                    fi
--                    rm -f conftest.[cs]
--                   ])
--    if test "$ac_cv_visibility_default" = "yes"; then
--      AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE)
--
--      AC_CACHE_CHECK(for visibility pragma support,
--                     ac_cv_visibility_pragma,
--                     [cat > conftest.c <<EOF
--#pragma GCC visibility push(hidden)
--                      int foo_hidden = 1;
--#pragma GCC visibility push(default)
--                      int foo_default = 1;
--EOF
--                      ac_cv_visibility_pragma=no
--                      if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
--                        if egrep '\.(hidden|private_extern).*foo_hidden' conftest.s >/dev/null; then
--                          if ! egrep '\.(hidden|private_extern).*foo_default' conftest.s > /dev/null; then
--                            ac_cv_visibility_pragma=yes
--                          fi
--                        fi
--                      fi
--                      rm -f conftest.[cs]
--                    ])
--      if test "$ac_cv_visibility_pragma" = "yes"; then
--        AC_CACHE_CHECK(For gcc visibility bug with class-level attributes (GCC bug 26905),
--                       ac_cv_have_visibility_class_bug,
--                       [cat > conftest.c <<EOF
--#pragma GCC visibility push(hidden)
--struct __attribute__ ((visibility ("default"))) TestStruct {
--  static void Init();
--};
--__attribute__ ((visibility ("default"))) void TestFunc() {
--  TestStruct::Init();
--}
--EOF
--                       ac_cv_have_visibility_class_bug=no
--                       if ! ${CXX-g++} ${CXXFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
--                         ac_cv_have_visibility_class_bug=yes
--                       else
--                         if test `egrep -c '@PLT|\\$stub' conftest.S` = 0; then
--                           ac_cv_have_visibility_class_bug=yes
--                         fi
--                       fi
--                       rm -rf conftest.{c,S}
--                       ])
--
--        AC_CACHE_CHECK(For x86_64 gcc visibility bug with builtins (GCC bug 20297),
--                       ac_cv_have_visibility_builtin_bug,
--                       [cat > conftest.c <<EOF
--#pragma GCC visibility push(hidden)
--#pragma GCC visibility push(default)
--#include <string.h>
--#pragma GCC visibility pop
--
--__attribute__ ((visibility ("default"))) void Func() {
--  char c[[100]];
--  memset(c, 0, sizeof(c));
--}
--EOF
--                       ac_cv_have_visibility_builtin_bug=no
--                       if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
--                         ac_cv_have_visibility_builtin_bug=yes
--                       else
--                         if test `grep -c "@PLT" conftest.S` = 0; then
--                           ac_cv_visibility_builtin_bug=yes
--                         fi
--                       fi
--                       rm -f conftest.{c,S}
--                       ])
--        if test "$ac_cv_have_visibility_builtin_bug" = "no" -a \
--                "$ac_cv_have_visibility_class_bug" = "no"; then
--          VISIBILITY_FLAGS='-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
--          WRAP_SYSTEM_INCLUDES=1
--        else
--          VISIBILITY_FLAGS='-fvisibility=hidden'
--        fi # have visibility pragma bug
--      fi   # have visibility pragma
--    fi     # have visibility(default) attribute
--  fi       # have visibility(hidden) attribute
-+  AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
-+  AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE)
-+  VISIBILITY_FLAGS='-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
-+  WRAP_SYSTEM_INCLUDES=1
- fi         # GNU_CC
- 
- # visibility hidden flag for Sun Studio on Solaris

Modified: trunk/mail/thunderbird/files/patch-config-baseconfig.mk
==============================================================================
--- trunk/mail/thunderbird/files/patch-config-baseconfig.mk	Wed Jul 15 17:06:44 2015	(r1853)
+++ trunk/mail/thunderbird/files/patch-config-baseconfig.mk	Fri Jul 24 01:20:55 2015	(r1854)
@@ -1,5 +1,5 @@
---- config/baseconfig.mk~
-+++ config/baseconfig.mk
+--- mozilla/config/baseconfig.mk~
++++ mozilla/config/baseconfig.mk
 @@ -1,7 +1,7 @@
 -includedir := $(includedir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
 -idldir = $(datadir)/idl/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
@@ -9,6 +9,6 @@
 +idldir = $(datadir)/idl/%%MOZILLA%%
 +installdir = $(libdir)/%%MOZILLA%%
 +sdkdir = $(libdir)/%%MOZILLA%%
- MOZILLA_SRCDIR = $(topsrcdir)/mozilla
- MOZDEPTH = $(DEPTH)/mozilla
- DIST = $(MOZDEPTH)/dist
+ ifndef TOP_DIST
+ TOP_DIST = dist
+ endif

Modified: trunk/mail/thunderbird/files/patch-ijg-libjpeg
==============================================================================
--- trunk/mail/thunderbird/files/patch-ijg-libjpeg	Wed Jul 15 17:06:44 2015	(r1853)
+++ trunk/mail/thunderbird/files/patch-ijg-libjpeg	Fri Jul 24 01:20:55 2015	(r1854)
@@ -17,7 +17,7 @@
                     MOZ_NATIVE_JPEG=1,
                     AC_MSG_ERROR([Insufficient JPEG library version for --with-system-jpeg]))
  fi
-diff --git mozilla/image/decoders/nsJPEGDecoder.cpp mozilla/image/decoders/nsJPEGDecoder.cpp
+diff --git image/decoders/nsJPEGDecoder.cpp image/decoders/nsJPEGDecoder.cpp
 index 8fa8200..1d2a259 100644
 --- mozilla/image/decoders/nsJPEGDecoder.cpp
 +++ mozilla/image/decoders/nsJPEGDecoder.cpp
@@ -28,7 +28,7 @@
 -}
  
 +#ifdef JCS_EXTENSIONS
- #if defined(IS_BIG_ENDIAN)
+ #if MOZ_BIG_ENDIAN
  #define MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB JCS_EXT_XRGB
  #else
  #define MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB JCS_EXT_BGRX
@@ -51,26 +51,26 @@
  
  static void cmyk_convert_rgb(JSAMPROW row, JDIMENSION width);
  
-@@ -324,6 +340,7 @@ nsJPEGDecoder::WriteInternal(const char *aBuffer, uint32_t aCount)
-       case JCS_GRAYSCALE:
-       case JCS_RGB:
-       case JCS_YCbCr:
+@@ -367,6 +382,7 @@ nsJPEGDecoder::WriteInternal(const char*
+         case JCS_GRAYSCALE:
+         case JCS_RGB:
+         case JCS_YCbCr:
 +#ifdef JCS_EXTENSIONS
-         // if we're not color managing we can decode directly to
-         // MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB
-         if (mCMSMode != eCMSMode_All) {
-@@ -332,6 +349,9 @@ nsJPEGDecoder::WriteInternal(const char *aBuffer, uint32_t aCount)
-         } 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) {
+@@ -375,6 +391,9 @@ nsJPEGDecoder::WriteInternal(const char*
+           } else {
+               mInfo.out_color_space = JCS_RGB;
+           }
 +#else
-+        mInfo.out_color_space = JCS_RGB;
++          mInfo.out_color_space = JCS_RGB;
 +#endif
-         break;
-       case JCS_CMYK:
-       case JCS_YCCK:
-@@ -399,6 +419,15 @@ nsJPEGDecoder::WriteInternal(const char *aBuffer, uint32_t aCount)
-       return; /* I/O suspension */
+           break;
+         case JCS_CMYK:
+         case JCS_YCCK:
+@@ -433,6 +452,15 @@ nsJPEGDecoder::WriteInternal(const char*
+       return; // I/O suspension
      }
  
 +#ifndef JCS_EXTENSIONS
@@ -83,10 +83,10 @@
 +    }
 +#endif
  
-     /* If this is a progressive JPEG ... */
-     mState = mInfo.buffered_image ? JPEG_DECOMPRESS_PROGRESSIVE : JPEG_DECOMPRESS_SEQUENTIAL;
-@@ -544,7 +573,11 @@ nsJPEGDecoder::OutputScanlines(bool* suspend)
-       uint32_t *imageRow = ((uint32_t*)mImageData) +
+     // If this is a progressive JPEG ...
+     mState = mInfo.buffered_image ?
+@@ -605,7 +633,11 @@ nsJPEGDecoder::OutputScanlines(bool* sus
+       uint32_t* imageRow = ((uint32_t*)mImageData) +
                             (mInfo.output_scanline * mInfo.output_width);
  
 +#ifdef JCS_EXTENSIONS
@@ -94,10 +94,10 @@
 +#else
 +      if (mInfo.cconvert->color_convert == ycc_rgb_convert_argb) {
 +#endif
-         /* Special case: scanline will be directly converted into packed ARGB */
+         // Special case: scanline will be directly converted into packed ARGB
          if (jpeg_read_scanlines(&mInfo, (JSAMPARRAY)&imageRow, 1) != 1) {
-           *suspend = true; /* suspend */
-@@ -854,6 +887,282 @@ term_source (j_decompress_ptr jd)
+           *suspend = true; // suspend
+@@ -920,6 +952,282 @@ term_source (j_decompress_ptr jd)
  } // namespace mozilla
  
  
@@ -377,6 +377,6 @@
 +#endif
 +
 +
- /**************** Inverted CMYK -> RGB conversion **************/
- /*
-  * Input is (Inverted) CMYK stored as 4 bytes per pixel.
+ ///*************** Inverted CMYK -> RGB conversion *************************
+ /// Input is (Inverted) CMYK stored as 4 bytes per pixel.
+ /// Output is RGB stored as 3 bytes per pixel.

Modified: trunk/mail/thunderbird/files/patch-mail-app-nsMailApp.cpp
==============================================================================
--- trunk/mail/thunderbird/files/patch-mail-app-nsMailApp.cpp	Wed Jul 15 17:06:44 2015	(r1853)
+++ trunk/mail/thunderbird/files/patch-mail-app-nsMailApp.cpp	Fri Jul 24 01:20:55 2015	(r1854)
@@ -1,10 +1,10 @@
 --- mail/app/nsMailApp.cpp~
 +++ mail/app/nsMailApp.cpp
-@@ -154,6 +154,7 @@ int main(int argc, char* argv[])
+@@ -320,6 +320,7 @@ int main(int argc, char* argv[])
    TriggerQuirks();
  #endif
  
 +  setenv("MOZ_PLUGIN_PATH", "%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko", 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;

Added: trunk/mail/thunderbird/files/patch-media-libstagefright-foundation-AString.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/mail/thunderbird/files/patch-media-libstagefright-foundation-AString.cpp	Fri Jul 24 01:20:55 2015	(r1854)
@@ -0,0 +1,16 @@
+--- mozilla/media/libstagefright/frameworks/av/media/libstagefright/foundation/AString.cpp~
++++ mozilla/media/libstagefright/frameworks/av/media/libstagefright/foundation/AString.cpp
+@@ -23,6 +23,13 @@
+ #include "ADebug.h"
+ #include "AString.h"
+ 
++#ifdef __FreeBSD__
++# include <osreldate.h>
++# if __FreeBSD_version < 900506
++#  undef tolower
++# endif
++#endif
++
+ namespace stagefright {
+ 
+ // static

Added: trunk/mail/thunderbird/files/patch-media-mtransport-third_party-nICEr-src-util-mbslen.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/mail/thunderbird/files/patch-media-mtransport-third_party-nICEr-src-util-mbslen.c	Fri Jul 24 01:20:55 2015	(r1854)
@@ -0,0 +1,16 @@
+--- mozilla/media/mtransport/third_party/nICEr/src/util/mbslen.c~
++++ mozilla/media/mtransport/third_party/nICEr/src/util/mbslen.c
+@@ -54,6 +54,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ # endif
+ #endif
+ 
++#ifdef __DragonFly__
++#include <osreldate.h>
++# if __DragonFly_version > 300502
++#  define HAVE_XLOCALE
++# endif
++#endif
++
+ #ifdef HAVE_XLOCALE
+ #include <xlocale.h>
+ #endif /* HAVE_XLOCALE */

Added: trunk/mail/thunderbird/files/patch-media-webrtc-trunk-src-system_wrappers-source-spreadsortlib-spreadsort.hpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/mail/thunderbird/files/patch-media-webrtc-trunk-src-system_wrappers-source-spreadsortlib-spreadsort.hpp	Fri Jul 24 01:20:55 2015	(r1854)
@@ -0,0 +1,16 @@
+--- mozilla/media/webrtc/trunk/webrtc/system_wrappers/source/spreadsortlib/spreadsort.hpp~
++++ mozilla/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

Added: trunk/mail/thunderbird/files/patch-memory-jemalloc-Makefile.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/mail/thunderbird/files/patch-memory-jemalloc-Makefile.in	Fri Jul 24 01:20:55 2015	(r1854)
@@ -0,0 +1,10 @@
+--- mozilla/memory/jemalloc/Makefile.in~
++++ mozilla/memory/jemalloc/Makefile.in
+@@ -12,3 +12,7 @@ include $(topsrcdir)/config/rules.mk
+ ifdef GNU_CC
+ CFLAGS += -std=gnu99
+ endif
++
++# XXX startup crash workaround for gcc47 on amd64
++jemalloc.$(OBJ_SUFFIX): OS_CFLAGS := $(filter-out -O3 -Ofast,$(OS_CFLAGS))
++jemalloc.$(OBJ_SUFFIX): MOZ_OPTIMIZE_FLAGS=

Deleted: trunk/mail/thunderbird/files/patch-mozilla-media-mtransport-third_party-nICEr-src-util-mbslen.c
==============================================================================
--- trunk/mail/thunderbird/files/patch-mozilla-media-mtransport-third_party-nICEr-src-util-mbslen.c	Fri Jul 24 01:20:55 2015	(r1853)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,16 +0,0 @@
---- mozilla/media/mtransport/third_party/nICEr/src/util/mbslen.c~
-+++ mozilla/media/mtransport/third_party/nICEr/src/util/mbslen.c
-@@ -54,6 +54,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- # endif
- #endif
- 
-+#ifdef __DragonFly__
-+#include <osreldate.h>
-+# if __DragonFly_version > 300502
-+#  define HAVE_XLOCALE
-+# endif
-+#endif
-+
- #ifdef HAVE_XLOCALE
- #include <xlocale.h>
- #endif /* HAVE_XLOCALE */

Deleted: trunk/mail/thunderbird/files/patch-mozilla-media-webrtc-trunk-src-system_wrappers-source-spreadsortlib-spreadsort.hpp
==============================================================================
--- trunk/mail/thunderbird/files/patch-mozilla-media-webrtc-trunk-src-system_wrappers-source-spreadsortlib-spreadsort.hpp	Fri Jul 24 01:20:55 2015	(r1853)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,16 +0,0 @@
---- mozilla/media/webrtc/trunk/webrtc/system_wrappers/source/spreadsortlib/spreadsort.hpp~
-+++ mozilla/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

Deleted: trunk/mail/thunderbird/files/patch-mozilla-memory-jemalloc-Makefile.in
==============================================================================
--- trunk/mail/thunderbird/files/patch-mozilla-memory-jemalloc-Makefile.in	Fri Jul 24 01:20:55 2015	(r1853)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,10 +0,0 @@
---- mozilla/memory/jemalloc/Makefile.in~
-+++ mozilla/memory/jemalloc/Makefile.in
-@@ -12,3 +12,7 @@ include $(topsrcdir)/config/rules.mk
- ifdef GNU_CC
- CFLAGS += -std=gnu99
- endif
-+
-+# XXX startup crash workaround for gcc47 on amd64
-+jemalloc.$(OBJ_SUFFIX): OS_CFLAGS := $(filter-out -O3 -Ofast,$(OS_CFLAGS))
-+jemalloc.$(OBJ_SUFFIX): MOZ_OPTIMIZE_FLAGS=

Deleted: trunk/mail/thunderbird/files/patch-mozilla_toolkit_mozapps_installer_packager_mk
==============================================================================
--- trunk/mail/thunderbird/files/patch-mozilla_toolkit_mozapps_installer_packager_mk	Fri Jul 24 01:20:55 2015	(r1853)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,13 +0,0 @@
-$OpenBSD: patch-toolkit_mozapps_installer_packager_mk,v 1.11 2012/06/11 15:29:56 landry Exp $
-install headers/idl/sdk libs only if xulrunner
---- mozilla/toolkit/mozapps/installer/packager.mk.orig	Fri Jun  1 14:04:20 2012
-+++ mozilla/toolkit/mozapps/installer/packager.mk	Tue Jun  5 07:55:51 2012
-@@ -886,7 +886,7 @@ endif
- 	$(NSINSTALL) -D $(DESTDIR)$(bindir)
- 	$(RM) -f $(DESTDIR)$(bindir)/$(MOZ_APP_NAME)
- 	ln -s $(installdir)/$(MOZ_APP_NAME) $(DESTDIR)$(bindir)
--ifdef INSTALL_SDK # Here comes the hard part
-+ifeq ($(MOZ_APP_NAME),xulrunner)
- 	$(NSINSTALL) -D $(DESTDIR)$(includedir)
- 	(cd $(DIST)/include && tar $(TAR_CREATE_FLAGS) - .) | \
- 	  (cd $(DESTDIR)$(includedir) && tar -xf -)

Added: trunk/mail/thunderbird/files/patch-system-openh264
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/mail/thunderbird/files/patch-system-openh264	Fri Jul 24 01:20:55 2015	(r1854)
@@ -0,0 +1,239 @@
+# Revert bug 1045209 to allow using absolute path
+
+diff --git dom/media/gmp/GMPChild.cpp dom/media/gmp/GMPChild.cpp
+index 1dde3ac..12c88cf 100644
+--- mozilla/dom/media/gmp/GMPChild.cpp
++++ mozilla/dom/media/gmp/GMPChild.cpp
+@@ -76,21 +76,14 @@ GetFileBase(const std::string& aPluginPa
+   }
+ #endif
+ 
+-  nsCOMPtr<nsIFile> parent;
+-  rv = aFileBase->GetParent(getter_AddRefs(parent));
+-  if (NS_FAILED(rv)) {
+-    return false;
+-  }
+-
+-  nsAutoString parentLeafName;
+-  rv = parent->GetLeafName(parentLeafName);
+-  if (NS_FAILED(rv)) {
++  nsAutoString leafName;
++  if (NS_FAILED(aFileBase->GetLeafName(leafName))) {
+     return false;
+   }
+ 
+-  aBaseName = Substring(parentLeafName,
++  aBaseName = Substring(leafName,
+                         4,
+-                        parentLeafName.Length() - 1);
++                        leafName.Length() - 1);
+   return true;
+ }
+ 
+diff --git dom/media/gmp/GMPParent.cpp dom/media/gmp/GMPParent.cpp
+index aa60acf..90878ca 100644
+--- mozilla/dom/media/gmp/GMPParent.cpp
++++ mozilla/dom/media/gmp/GMPParent.cpp
+@@ -90,23 +90,16 @@
+   mService = aService;
+   mDirectory = aPluginDir;
+ 
+-  // aPluginDir is <profile-dir>/<gmp-plugin-id>/<version>
+-  // where <gmp-plugin-id> should be gmp-gmpopenh264
+-  nsCOMPtr<nsIFile> parent;
+-  nsresult rv = aPluginDir->GetParent(getter_AddRefs(parent));
+-  if (NS_FAILED(rv)) {
+-    return rv;
+-  }
+-  nsAutoString parentLeafName;
+-  rv = parent->GetLeafName(parentLeafName);
++  nsAutoString leafname;
++  nsresult rv = aPluginDir->GetLeafName(leafname);
+   if (NS_FAILED(rv)) {
+     return rv;
+   }
+   LOGD(("%s::%s: %p for %s", __CLASS__, __FUNCTION__, this,
+-       NS_LossyConvertUTF16toASCII(parentLeafName).get()));
++       NS_LossyConvertUTF16toASCII(leafname).get()));
+ 
+-  MOZ_ASSERT(parentLeafName.Length() > 4);
+-  mName = Substring(parentLeafName, 4);
++  MOZ_ASSERT(leafname.Length() > 4);
++  mName = Substring(leafname, 4);
+ 
+   return ReadGMPMetaData();
+ }
+diff --git toolkit/modules/GMPInstallManager.jsm toolkit/modules/GMPInstallManager.jsm
+index 9593492..470384b 100644
+--- mozilla/toolkit/modules/GMPInstallManager.jsm
++++ mozilla/toolkit/modules/GMPInstallManager.jsm
+@@ -888,9 +889,7 @@
+       let gmpAddon = this._gmpAddon;
+       let installToDirPath = Cc["@mozilla.org/file/local;1"].
+                           createInstance(Ci.nsIFile);
+-      let path = OS.Path.join(OS.Constants.Path.profileDir,
+-                              gmpAddon.id,
+-                              gmpAddon.version);
++      let path = OS.Path.join(OS.Constants.Path.profileDir, gmpAddon.id);
+       installToDirPath.initWithPath(path);
+       log.info("install to directory path: " + installToDirPath.path);
+       let gmpInstaller = new GMPExtractor(zipPath, installToDirPath.path);
+@@ -885,10 +883,12 @@
+         // Success, set the prefs
+         let now = Math.round(Date.now() / 1000);
+         GMPPrefs.set(GMPPrefs.KEY_PLUGIN_LAST_UPDATE, now, gmpAddon.id);
+-        // Setting the version pref signals installation completion to consumers,
+-        // if you need to set other prefs etc. do it before this.
++        // Setting the path pref signals installation completion to consumers,
++        // so set the version and potential other information they use first.
+         GMPPrefs.set(GMPPrefs.KEY_PLUGIN_VERSION, gmpAddon.version,
+                      gmpAddon.id);
++        GMPPrefs.set(GMPPrefs.KEY_PLUGIN_PATH,
++                     installToDirPath.path, gmpAddon.id);
+         this._deferred.resolve(extractedPaths);
+       }, err => {
+         this._deferred.reject(err);
+diff --git toolkit/modules/GMPUtils.jsm toolkit/modules/GMPUtils.jsm
+index 1f3a0b1..93517be 100644
+--- mozilla/toolkit/modules/GMPUtils.jsm
++++ mozilla/toolkit/modules/GMPUtils.jsm
+@@ -70,6 +70,7 @@ this.GMPPrefs = {
+   KEY_EME_ENABLED:              "media.eme.enabled",
+   KEY_PLUGIN_ENABLED:           "media.{0}.enabled",
+   KEY_PLUGIN_LAST_UPDATE:       "media.{0}.lastUpdate",
++  KEY_PLUGIN_PATH:              "media.{0}.path",
+   KEY_PLUGIN_VERSION:           "media.{0}.version",
+   KEY_PLUGIN_AUTOUPDATE:        "media.{0}.autoupdate",
+   KEY_PLUGIN_FORCEVISIBLE:      "media.{0}.forcevisible",
+diff --git toolkit/mozapps/extensions/internal/GMPProvider.jsm toolkit/mozapps/extensions/internal/GMPProvider.jsm
+index 1f3a0b1..93517be 100644
+--- mozilla/toolkit/mozapps/extensions/internal/GMPProvider.jsm
++++ mozilla/toolkit/mozapps/extensions/internal/GMPProvider.jsm
+@@ -100,12 +100,11 @@
+     Log.repository.getLoggerWithMessagePrefix("Toolkit.GMP",
+                                               "GMPWrapper(" +
+                                               this._plugin.id + ") ");
+-  Preferences.observe(GMPPrefs.getPrefKey(GMPPrefs.KEY_PLUGIN_ENABLED,
+-                                          this._plugin.id),
++  Preferences.observe(GMPPrefs.getPrefKey(GMPPrefs.KEY_PLUGIN_ENABLED, this._plugin.id),
+                       this.onPrefEnabledChanged, this);
+-  Preferences.observe(GMPPrefs.getPrefKey(GMPPrefs.KEY_PLUGIN_VERSION,
++  Preferences.observe(GMPPrefs.getPrefKey(GMPPrefs.KEY_PLUGIN_PATH,
+                                           this._plugin.id),
+-                      this.onPrefVersionChanged, this);
++                      this.onPrefPathChanged, this);
+   if (this._plugin.isEME) {
+     Preferences.observe(GMPPrefs.KEY_EME_ENABLED,
+                         this.onPrefEMEGlobalEnabledChanged, this);
+@@ -120,17 +119,14 @@
+   optionsType: AddonManager.OPTIONS_TYPE_INLINE,
+   get optionsURL() { return this._plugin.optionsURL; },
+ 
++
+   set gmpPath(aPath) { this._gmpPath = aPath; },
+   get gmpPath() {
+-    if (!this._gmpPath && this.isInstalled) {
+-      this._gmpPath = OS.Path.join(OS.Constants.Path.profileDir,
+-                                   this._plugin.id,
+-                                   GMPPrefs.get(GMPPrefs.KEY_PLUGIN_VERSION,
+-                                                null, this._plugin.id));
++    if (!this._gmpPath) {
++      this._gmpPath = GMPPrefs.get(GMPPrefs.KEY_PLUGIN_PATH, null, this._plugin.id);
+     }
+     return this._gmpPath;
+   },
+-
+   get id() { return this._plugin.id; },
+   get type() { return "plugin"; },
+   get isGMPlugin() { return true; },
+@@ -141,8 +137,13 @@
+   get description() { return this._plugin.description; },
+   get fullDescription() { return this._plugin.fullDescription; },
+ 
+-  get version() { return GMPPrefs.get(GMPPrefs.KEY_PLUGIN_VERSION, null,
+-                                      this._plugin.id); },
++  get version() { 
++    if (this.isInstalled) {
++        return GMPPrefs.get(GMPPrefs.KEY_PLUGIN_VERSION, null,
++                                    this._plugin.id);
++    }
++    return null;
++  },
+ 
+   get isActive() { return !this.appDisabled && !this.userDisabled; },
+   get appDisabled() {
+@@ -289,24 +290,17 @@
+ 
+   get pluginMimeTypes() { return []; },
+   get pluginLibraries() {
+-    if (this.isInstalled) {
+-      let path = this.version;
+-      return [path];
+-    }
+-    return [];
++    let path = GMPPrefs.get(GMPPrefs.KEY_PLUGIN_PATH, null, this._plugin.id);
++    return path && path.length ? [OS.Path.basename(path)] : [];
+   },
+   get pluginFullpath() {
+-    if (this.isInstalled) {
+-      let path = OS.Path.join(OS.Constants.Path.profileDir,
+-                              this._plugin.id,
+-                              this.version);
+-      return [path];
+-    }
+-    return [];
++    let path = GMPPrefs.get(GMPPrefs.KEY_PLUGIN_PATH, null, this._plugin.id);
++    return path && path.length ? [path] : [];
+   },
+ 
+   get isInstalled() {
+-    return this.version && this.version.length > 0;
++    let path = GMPPrefs.get(GMPPrefs.KEY_PLUGIN_PATH, null, this._plugin.id);
++    return path && path.length > 0;
+   },
+ 
+   _handleEnabledChanged: function() {
+@@ -362,10 +356,10 @@
+     }
+   },
+ 
+-  onPrefVersionChanged: function() {
++  onPrefPathChanged: function() {
+     AddonManagerPrivate.callAddonListeners("onUninstalling", this, false);
+     if (this._gmpPath) {
+-      this._log.info("onPrefVersionChanged() - unregistering gmp directory " +
++      this._log.info("onPrefPathChanged() - unregistering gmp directory " +
+                      this._gmpPath);
+       gmpService.removePluginDirectory(this._gmpPath);
+     }
+@@ -374,15 +368,10 @@
+     AddonManagerPrivate.callInstallListeners("onExternalInstall", null, this,
+                                              null, false);
+     AddonManagerPrivate.callAddonListeners("onInstalling", this, false);
+-    this._gmpPath = null;
+-    if (this.isInstalled) {
+-      this._gmpPath = OS.Path.join(OS.Constants.Path.profileDir,
+-                                   this._plugin.id,
+-                                   GMPPrefs.get(GMPPrefs.KEY_PLUGIN_VERSION,
+-                                                null, this._plugin.id));
+-    }
++    this._gmpPath = GMPPrefs.get(GMPPrefs.KEY_PLUGIN_PATH,
++                                 null, this._plugin.id);
+     if (this._gmpPath && this.isActive) {
+-      this._log.info("onPrefVersionChanged() - registering gmp directory " +
++      this._log.info("onPrefPathChanged() - registering gmp directory " +
+                      this._gmpPath);
+       gmpService.addPluginDirectory(this._gmpPath);
+     }
+@@ -393,9 +382,9 @@
+     Preferences.ignore(GMPPrefs.getPrefKey(GMPPrefs.KEY_PLUGIN_ENABLED,
+                                            this._plugin.id),
+                        this.onPrefEnabledChanged, this);
+-    Preferences.ignore(GMPPrefs.getPrefKey(GMPPrefs.KEY_PLUGIN_VERSION,
++    Preferences.ignore(GMPPrefs.getPrefKey(GMPPrefs.KEY_PLUGIN_PATH,
+                                            this._plugin.id),
+-                       this.onPrefVersionChanged, this);
++                       this.onPrefPathChanged, this);
+     if (this._plugin.isEME) {
+       Preferences.ignore(GMPPrefs.KEY_EME_ENABLED,
+                          this.onPrefEMEGlobalEnabledChanged, this);

Added: trunk/mail/thunderbird/files/patch-toolkit_mozapps_installer_packager_mk
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/mail/thunderbird/files/patch-toolkit_mozapps_installer_packager_mk	Fri Jul 24 01:20:55 2015	(r1854)
@@ -0,0 +1,13 @@
+$OpenBSD: patch-toolkit_mozapps_installer_packager_mk,v 1.11 2012/06/11 15:29:56 landry Exp $
+install headers/idl/sdk libs only if xulrunner
+--- mozilla/toolkit/mozapps/installer/packager.mk.orig	Fri Jun  1 14:04:20 2012
++++ mozilla/toolkit/mozapps/installer/packager.mk	Tue Jun  5 07:55:51 2012
+@@ -886,7 +886,7 @@ endif
+ 	$(NSINSTALL) -D $(DESTDIR)$(bindir)
+ 	$(RM) -f $(DESTDIR)$(bindir)/$(MOZ_APP_NAME)
+ 	ln -s $(installdir)/$(MOZ_APP_NAME) $(DESTDIR)$(bindir)
+-ifdef INSTALL_SDK # Here comes the hard part
++ifeq ($(MOZ_APP_NAME),xulrunner)
+ 	$(NSINSTALL) -D $(DESTDIR)$(includedir)
+ 	(cd $(DIST)/include && tar $(TAR_CREATE_FLAGS) - .) | \
+ 	  (cd $(DESTDIR)$(includedir) && tar -xf -)

Modified: trunk/mail/thunderbird/files/patch-z-bug517422
==============================================================================
--- trunk/mail/thunderbird/files/patch-z-bug517422	Wed Jul 15 17:06:44 2015	(r1853)
+++ trunk/mail/thunderbird/files/patch-z-bug517422	Fri Jul 24 01:20:55 2015	(r1854)
@@ -4,7 +4,7 @@
 index 5383399..0410004 100644
 --- mozilla/config/Makefile.in
 +++ mozilla/config/Makefile.in
-@@ -79,6 +79,13 @@ export:: $(export-preqs)
+@@ -77,6 +77,14 @@ export:: $(export-preqs)
  		-DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \
  		-DMOZ_NATIVE_GRAPHITE2=$(MOZ_NATIVE_GRAPHITE2) \
  		-DMOZ_NATIVE_HARFBUZZ=$(MOZ_NATIVE_HARFBUZZ) \
@@ -12,6 +12,7 @@
 +		-DMOZ_NATIVE_THEORA=$(MOZ_NATIVE_THEORA) \
 +		-DMOZ_NATIVE_VORBIS=$(MOZ_NATIVE_VORBIS) \
 +		-DMOZ_NATIVE_TREMOR=$(MOZ_NATIVE_TREMOR) \
++		-DMOZ_NATIVE_CELT=$(MOZ_NATIVE_CELT) \
 +		-DMOZ_NATIVE_OPUS=$(MOZ_NATIVE_OPUS) \
 +		-DMOZ_NATIVE_SPEEX=$(MOZ_NATIVE_SPEEX) \
 +		-DMOZ_NATIVE_SOUNDTOUCH=$(MOZ_NATIVE_SOUNDTOUCH) \
@@ -22,14 +23,17 @@
 index f67c5c7..eb909ce 100644
 --- mozilla/config/external/moz.build
 +++ mozilla/config/external/moz.build
-@@ -15,13 +15,19 @@ if CONFIG['MOZ_UPDATER']:
-     if not CONFIG['MOZ_NATIVE_BZ2']:
-         external_dirs += ['modules/libbz2']
+@@ -19,10 +19,19 @@ if CONFIG['MOZ_UPDATER']:
+ # There's no "native brotli" yet, but probably in the future...
+ external_dirs += ['modules/brotli']
  
 -if CONFIG['MOZ_VORBIS']:
 +if not CONFIG['MOZ_NATIVE_OGG']:
 +    external_dirs += ['media/libogg']
 +
++if not CONFIG['MOZ_NATIVE_CELT'] or not CONFIG['MOZ_NATIVE_OPUS']:
++    external_dirs += ['media/libopus']
++
 +if not CONFIG['MOZ_NATIVE_THEORA']:
 +    external_dirs += ['media/libtheora']
 +
@@ -40,12 +44,8 @@
 +if CONFIG['MOZ_TREMOR'] and not CONFIG['MOZ_NATIVE_TREMOR']:
      external_dirs += ['media/libtremor']
  
--if CONFIG['MOZ_OPUS']:
-+if CONFIG['MOZ_OPUS'] and not CONFIG['MOZ_NATIVE_OPUS']:
-     external_dirs += ['media/libopus']
- 
  if CONFIG['MOZ_WEBM']:
-@@ -36,13 +42,15 @@ if CONFIG['MOZ_VPX'] and not CONFIG['MOZ_NATIVE_LIBVPX']:
+@@ -37,15 +46,16 @@ if CONFIG['MOZ_VPX'] and not CONFIG['MOZ
  if not CONFIG['MOZ_NATIVE_PNG']:
      external_dirs += ['media/libpng']
  
@@ -59,35 +59,35 @@
      'media/kiss_fft',
      'media/libcubeb',
 -    'media/libogg',
+-    'media/libopus',
 -    'media/libtheora',
 -    'media/libspeex_resampler',
+     'media/libstagefright',
 -    'media/libsoundtouch',
  ]
  
- PARALLEL_DIRS += ['../../' + i for i in external_dirs]
+ DIRS += ['../../' + i for i in external_dirs]
 diff --git config/system-headers config/system-headers
 index bef567c..9807c29 100644
 --- mozilla/config/system-headers
 +++ mozilla/config/system-headers
-@@ -1050,8 +1050,6 @@ X11/Xutil.h
- xpt_struct.h
- xpt_xdr.h
+@@ -1263,7 +1263,6 @@ X11/Xlocale.h
+ X11/Xos.h
+ X11/Xutil.h
  zmouse.h
--speex/speex_resampler.h
 -soundtouch/SoundTouch.h
  #if MOZ_NATIVE_PNG==1
  png.h
  #endif
-@@ -1119,6 +1117,8 @@ ogg/ogg.h
+@@ -1325,6 +1324,7 @@ vorbis/codec.h
+ theora/theoradec.h
+ tremor/ivorbiscodec.h
+ speex/speex_resampler.h
++soundtouch/SoundTouch.h
+ ogg/ogg.h
  ogg/os_types.h
  nestegg/nestegg.h
- cubeb/cubeb.h
-+speex/speex_resampler.h
-+soundtouch/SoundTouch.h
- #endif
- gst/gst.h
- gst/app/gstappsink.h
-@@ -1155,3 +1155,29 @@ graphite2/Segment.h
+@@ -1365,3 +1365,35 @@ graphite2/Segment.h
  harfbuzz/hb-ot.h
  harfbuzz/hb.h
  #endif
@@ -105,6 +105,12 @@
 +#if MOZ_NATIVE_TREMOR==1
 +tremor/ivorbiscodec.h
 +#endif
++#if MOZ_NATIVE_CELT==1
++celt.h
++celt_header.h
++celt/celt.h
++celt/celt_header.h
++#endif
 +#if MOZ_NATIVE_OPUS==1
 +opus.h
 +opus_multistream.h
@@ -121,7 +127,7 @@
 index 87db361..7947626 100644
 --- mozilla/configure.in
 +++ mozilla/configure.in
-@@ -5211,6 +5211,63 @@ if test "${ac_cv_c_attribute_aligned}" != "0"; then
+@@ -5223,6 +5223,157 @@ if test "${ac_cv_c_attribute_aligned}" !
  fi
  
  dnl ========================================================
@@ -144,8 +150,6 @@
 +fi
 +
 +AC_SUBST(MOZ_NATIVE_OGG)
-+AC_SUBST(MOZ_OGG_CFLAGS)
-+AC_SUBST(MOZ_OGG_LIBS)
 +
 +dnl ========================================================
 +dnl Check for libvorbis
@@ -161,8 +165,6 @@
 +fi
 +
 +AC_SUBST(MOZ_NATIVE_VORBIS)
-+AC_SUBST(MOZ_VORBIS_CFLAGS)
-+AC_SUBST(MOZ_VORBIS_LIBS)
 +
 +dnl ========================================================
 +dnl Check for integer-only libvorbis aka tremor
@@ -178,17 +180,25 @@
 +fi
 +
 +AC_SUBST(MOZ_NATIVE_TREMOR)
-+AC_SUBST(MOZ_TREMOR_CFLAGS)
-+AC_SUBST(MOZ_TREMOR_LIBS)
 +
 +dnl ========================================================
- dnl = Disable Opus audio codec support
- dnl ========================================================
- MOZ_ARG_DISABLE_BOOL(opus,
-@@ -5219,6 +5274,97 @@ MOZ_ARG_DISABLE_BOOL(opus,
-     MOZ_OPUS=1)
- 
- dnl ========================================================
++dnl Check for libcelt
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-celt,
++[  --with-system-celt      Use system libcelt (located with pkgconfig)],
++MOZ_NATIVE_CELT=1,
++MOZ_NATIVE_CELT=)
++
++if test -n "$MOZ_NATIVE_CELT"; then
++    PKG_CHECK_MODULES(MOZ_CELT, celt)
++else
++    MOZ_CELT_CFLAGS='-I$(topsrcdir)/media/libopus'
++fi
++
++AC_SUBST(MOZ_NATIVE_CELT)
++
++dnl ========================================================
 +dnl Check for libopus
 +dnl ========================================================
 +
@@ -204,8 +214,6 @@
 +fi
 +
 +AC_SUBST(MOZ_NATIVE_OPUS)
-+AC_SUBST(MOZ_OPUS_CFLAGS)
-+AC_SUBST(MOZ_OPUS_LIBS)
 +
 +dnl ========================================================
 +dnl Check for libtheora
@@ -221,8 +229,6 @@
 +fi
 +
 +AC_SUBST(MOZ_NATIVE_THEORA)
-+AC_SUBST(MOZ_THEORA_CFLAGS)
-+AC_SUBST(MOZ_THEORA_LIBS)
 +
 +dnl ========================================================
 +dnl Check for libspeex resampler
@@ -238,8 +244,6 @@
 +fi
 +
 +AC_SUBST(MOZ_NATIVE_SPEEX)
-+AC_SUBST(MOZ_SPEEX_CFLAGS)
-+AC_SUBST(MOZ_SPEEX_LIBS)
 +
 +dnl ========================================================
 +dnl Check for libsoundtouch
@@ -276,19 +280,17 @@
 +fi
 +
 +AC_SUBST(MOZ_NATIVE_SOUNDTOUCH)
-+AC_SUBST(MOZ_SOUNDTOUCH_CFLAGS)
-+AC_SUBST(MOZ_SOUNDTOUCH_LIBS)
 +
 +dnl ========================================================
  dnl = Disable VP8 decoder support
  dnl ========================================================
  MOZ_ARG_DISABLE_BOOL(webm,
-diff --git content/media/AudioStream.h content/media/AudioStream.h
+diff --git dom/media/AudioStream.h dom/media/AudioStream.h
 index 085676d..00c54fb 100644
---- mozilla/content/media/AudioStream.h
-+++ mozilla/content/media/AudioStream.h
-@@ -26,7 +26,7 @@ public:
- };
+--- mozilla/dom/media/AudioStream.h
++++ mozilla/dom/media/AudioStream.h
+@@ -17,7 +17,7 @@
+ #include "CubebUtils.h"
  
  namespace soundtouch {
 -class SoundTouch;
@@ -296,177 +298,265 @@
  }
  
  namespace mozilla {
-diff --git content/media/Makefile.in content/media/Makefile.in
-index fd34449..c6c42c8 100644
---- mozilla/content/media/Makefile.in
-+++ mozilla/content/media/Makefile.in
-@@ -6,3 +6,31 @@ include $(topsrcdir)/config/rules.mk
- 
- CFLAGS   += $(GSTREAMER_CFLAGS)
- CXXFLAGS += $(GSTREAMER_CFLAGS)
-+
-+ifdef MOZ_NATIVE_OGG
-+CXXFLAGS += $(MOZ_OGG_CFLAGS)
-+endif
-+
-+ifdef MOZ_NATIVE_THEORA
-+CXXFLAGS += $(MOZ_THEORA_CFLAGS)
-+endif
-+
-+ifdef MOZ_NATIVE_VORBIS
-+CXXFLAGS += $(MOZ_VORBIS_CFLAGS)
-+endif
-+
-+ifdef MOZ_NATIVE_TREMOR
-+CXXFLAGS += $(MOZ_TREMOR_CFLAGS)
-+endif
-+
-+ifdef MOZ_NATIVE_OPUS
-+CXXFLAGS += $(MOZ_OPUS_CFLAGS)
-+endif
-+
-+ifdef MOZ_NATIVE_SPEEX
-+CXXFLAGS += $(MOZ_SPEEX_CFLAGS)
-+endif
-+
-+ifdef MOZ_NATIVE_SOUNDTOUCH
-+CXXFLAGS += $(MOZ_SOUNDTOUCH_CFLAGS)
-+endif
-diff --git media/libcubeb/src/Makefile.in media/libcubeb/src/Makefile.in
-index 4c14494..1cb98e2 100644
---- mozilla/media/libcubeb/src/Makefile.in
-+++ mozilla/media/libcubeb/src/Makefile.in
-@@ -9,3 +9,7 @@ CFLAGS += \
-         $(MOZ_ALSA_CFLAGS) \
-         $(MOZ_PULSEAUDIO_CFLAGS) \
-         $(NULL)
-+
-+ifdef MOZ_NATIVE_SPEEX
-+CFLAGS += $(MOZ_SPEEX_CFLAGS)
-+endif
-diff --git media/libtheora/Makefile.in media/libtheora/Makefile.in
-new file mode 100644
-index 0000000..1f02dc0
---- /dev/null
-+++ mozilla/media/libtheora/Makefile.in
-@@ -0,0 +1,9 @@
-+# This Source Code Form is subject to the terms of the Mozilla Public
-+# License, v. 2.0. If a copy of the MPL was not distributed with this
-+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-+
-+include $(topsrcdir)/config/rules.mk
-+
-+ifdef MOZ_NATIVE_OGG
-+CFLAGS += $(MOZ_OGG_CFLAGS)
-+endif
-diff --git media/libtremor/Makefile.in media/libtremor/Makefile.in
-new file mode 100644
-index 0000000..1f02dc0
---- /dev/null
-+++ mozilla/media/libtremor/Makefile.in
-@@ -0,0 +1,9 @@
-+# This Source Code Form is subject to the terms of the Mozilla Public
-+# License, v. 2.0. If a copy of the MPL was not distributed with this
-+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-+
-+include $(topsrcdir)/config/rules.mk
-+
-+ifdef MOZ_NATIVE_OGG
-+CFLAGS += $(MOZ_OGG_CFLAGS)
-+endif
-diff --git media/libvorbis/Makefile.in media/libvorbis/Makefile.in
-new file mode 100644
-index 0000000..1f02dc0
---- /dev/null
-+++ mozilla/media/libvorbis/Makefile.in
-@@ -0,0 +1,9 @@
-+# This Source Code Form is subject to the terms of the Mozilla Public
-+# License, v. 2.0. If a copy of the MPL was not distributed with this
-+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-+
-+include $(topsrcdir)/config/rules.mk
-+
-+ifdef MOZ_NATIVE_OGG
-+CFLAGS += $(MOZ_OGG_CFLAGS)
-+endif
-diff --git media/webrtc/signaling/test/Makefile.in media/webrtc/signaling/test/Makefile.in
+diff --git dom/media/moz.build dom/media/moz.build
+index 7526cff..e0a0ca0 100644
+--- mozilla/dom/media/moz.build
++++ mozilla/dom/media/moz.build
+@@ -212,3 +212,24 @@ if CONFIG['ANDROID_VERSION'] > '15':
+ 
+ CFLAGS += CONFIG['GSTREAMER_CFLAGS']
+ CXXFLAGS += CONFIG['GSTREAMER_CFLAGS']
++
++if CONFIG['MOZ_NATIVE_OGG']:
++    CXXFLAGS += CONFIG['MOZ_OGG_CFLAGS']
++
++if CONFIG['MOZ_NATIVE_THEORA']:
++    CXXFLAGS += CONFIG['MOZ_THEORA_CFLAGS']
++
++if CONFIG['MOZ_NATIVE_VORBIS']:
++    CXXFLAGS += CONFIG['MOZ_VORBIS_CFLAGS']
++
++if CONFIG['MOZ_NATIVE_TREMOR']:
++    CXXFLAGS += CONFIG['MOZ_TREMOR_CFLAGS']
++
++if CONFIG['MOZ_NATIVE_OPUS']:
++    CXXFLAGS += CONFIG['MOZ_OPUS_CFLAGS']
++
++if CONFIG['MOZ_NATIVE_SPEEX']:
++    CXXFLAGS += CONFIG['MOZ_SPEEX_CFLAGS']
++
++if CONFIG['MOZ_NATIVE_SOUNDTOUCH']:
++    CXXFLAGS += CONFIG['MOZ_SOUNDTOUCH_CFLAGS']
+diff --git media/libcubeb/src/moz.build media/libcubeb/src/moz.build
+index 944744d..9a7c8c0 100644
+--- mozilla/media/libcubeb/src/moz.build
++++ mozilla/media/libcubeb/src/moz.build
+@@ -65,6 +65,9 @@ if CONFIG['GKMEDIAS_SHARED_LIBRARY']:
+ 
+ FINAL_LIBRARY = 'gkmedias'
+ 
++if CONFIG['MOZ_NATIVE_SPEEX']:
++    SOURCES['cubeb_resampler.cpp'].flags += CONFIG['MOZ_SPEEX_CFLAGS']
++
+ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
+     CFLAGS += [
+         '-I%s/%s' % (CONFIG['ANDROID_SOURCE'], d) for d in [
+diff --git media/libogg/README_MOZILLA media/libogg/README_MOZILLA
+index 0833e4d..7ece97b 100644
+--- mozilla/media/libogg/README_MOZILLA
++++ mozilla/media/libogg/README_MOZILLA
+@@ -6,3 +6,6 @@ The svn revision number used was r17287.
+ The int-types.patch address a bug that config_types.h generated from
+ Linux platform can't be used on OpenSolaris directly see Mozilla bug
+ 449754
++
++The in-tree copy may be omitted during build by --with-system-ogg.
++Keep version in configure.in in sync on updates.
+diff --git media/libopus/README_MOZILLA media/libopus/README_MOZILLA
+index 2d85c9f..d3fb9f8 100644
+--- mozilla/media/libopus/README_MOZILLA
++++ mozilla/media/libopus/README_MOZILLA
+@@ -9,3 +9,6 @@ files after the copy step.
+ The upstream repository is https://git.xiph.org/opus.git
+ 
+ The git tag/revision used was v1.1.
++
++The in-tree copy may be omitted during build by --with-system-opus.
++So, keep its pkg-config version check within configure.in in sync on updates.
+diff --git media/libsoundtouch/README_MOZILLA media/libsoundtouch/README_MOZILLA
+index bfd4b1a..15b158d 100644
+--- mozilla/media/libsoundtouch/README_MOZILLA
++++ mozilla/media/libsoundtouch/README_MOZILLA
+@@ -6,3 +6,5 @@ The whole library is not used, only the relevant files are imported in the tree,
+ using the script `update.sh`. Some changes have been made to the files, using
+ the patch `moz-libsoundtouch.patch`. We also use a custom soundtouch_config.h.
+ 
++The in-tree copy may be omitted during build by --with-system-soundtouch.
++Keep version in configure.in in sync on updates.
+diff --git media/libspeex_resampler/README_MOZILLA media/libspeex_resampler/README_MOZILLA
+index 7f6b1bb..e830300 100644
+--- mozilla/media/libspeex_resampler/README_MOZILLA
++++ mozilla/media/libspeex_resampler/README_MOZILLA
+@@ -3,3 +3,6 @@ This source is from the Speex DSP library
+ 
+ It consists in the audio resampling code (resampler.c) and its header files
+ dependancies, imported into the tree using the update.sh script.
++
++The in-tree copy may be omitted during build by --with-system-speex.
++Keep version in configure.in in sync on updates.
+diff --git media/libtheora/README_MOZILLA media/libtheora/README_MOZILLA
+index d48dbfa..f08a2ed 100644
+--- mozilla/media/libtheora/README_MOZILLA
++++ mozilla/media/libtheora/README_MOZILLA
+@@ -3,3 +3,6 @@ using the update.sh script. The changes made were those applied by update.sh,
+ the addition/update of Makefile.in files for the Mozilla build system.
+ 
+ The subversion revision used was r17578.
++
++The in-tree copy may be omitted during build by --with-system-theora.
++Keep version in configure.in in sync on updates.
+diff --git media/libtheora/moz.build media/libtheora/moz.build
+index 14265b1..3069e99 100644
+--- mozilla/media/libtheora/moz.build
++++ mozilla/media/libtheora/moz.build
+@@ -93,3 +93,5 @@ if CONFIG['GNU_AS']:
+         if CONFIG['OS_TARGET'] == 'Android':
+             DEFINES['__linux__'] = True
+ 
++if CONFIG['MOZ_NATIVE_OGG']:
++    CFLAGS += CONFIG['MOZ_OGG_CFLAGS']
+diff --git media/libtremor/README_MOZILLA media/libtremor/README_MOZILLA
+index ee67b53..3f34a09 100644
+--- mozilla/media/libtremor/README_MOZILLA
++++ mozilla/media/libtremor/README_MOZILLA
+@@ -5,3 +5,6 @@ Makefile.in files for the Mozilla build system.
+ 
+ The upstream release used was http://svn.xiph.org/trunk/Tremor/
+ The subversion revision used was r17547.
++
++The in-tree copy may be omitted during build by --with-system-tremor.
++Keep version in configure.in in sync on updates.
+diff --git media/libtremor/moz.build media/libtremor/moz.build
+index 31831ba..a03d576 100644
+--- mozilla/media/libtremor/moz.build
++++ mozilla/media/libtremor/moz.build
+@@ -6,3 +6,5 @@
+ 
+ DIRS += ['include/tremor', 'lib']
+ 
++if CONFIG['MOZ_NATIVE_OGG']:
++    CFLAGS += CONFIG['MOZ_OGG_CFLAGS']
+diff --git media/libvorbis/README_MOZILLA media/libvorbis/README_MOZILLA
+index 7c7454c..55baedd 100644
+--- mozilla/media/libvorbis/README_MOZILLA
++++ mozilla/media/libvorbis/README_MOZILLA
+@@ -8,3 +8,6 @@ https://svn.xiph.org/tags/vorbis/libvorbis-1.3.4@19059
+ 
+ Some files are renamed during the copy to prevent clashes with object
+ file names with other Mozilla libraries.
++
++The in-tree copy may be omitted during build by --with-system-vorbis.
++Keep version in configure.in in sync on updates.
+diff --git media/libvorbis/moz.build media/libvorbis/moz.build
+index 919b99e..cc776f7 100644
+--- mozilla/media/libvorbis/moz.build
++++ mozilla/media/libvorbis/moz.build
+@@ -55,3 +55,6 @@ FINAL_LIBRARY = 'gkmedias'
+ # Suppress warnings in third-party code.
+ if CONFIG['GNU_CC']:
+     CFLAGS += ['-Wno-uninitialized']
++
++if CONFIG['MOZ_NATIVE_OGG']:
++    CFLAGS += CONFIG['MOZ_OGG_CFLAGS']
+diff --git media/webrtc/signaling/test/moz.build media/webrtc/signaling/test/moz.build
 index bbc971c..6ed7e41 100644
---- mozilla/media/webrtc/signaling/test/Makefile.in
-+++ mozilla/media/webrtc/signaling/test/Makefile.in
-@@ -48,6 +48,12 @@ LIBS += \
-   $(NULL)
- endif
- 
-+ifdef MOZ_NATIVE_OPUS
-+LIBS += \
-+  $(MOZ_OPUS_LIBS) \
-+  $(NULL)
-+endif
-+
- ifdef MOZ_NATIVE_LIBVPX
- LIBS += \
-   $(MOZ_LIBVPX_LIBS) \
+--- mozilla/media/webrtc/signaling/test/moz.build
++++ mozilla/media/webrtc/signaling/test/moz.build
+@@ -127,6 +127,9 @@ if CONFIG['MOZ_ALSA']:
+ if CONFIG['MOZ_NATIVE_JPEG']:
+     OS_LIBS += CONFIG['MOZ_JPEG_LIBS']
+ 
++if CONFIG['MOZ_NATIVE_OPUS']:
++    OS_LIBS += CONFIG['MOZ_OPUS_LIBS']
++
+ if CONFIG['MOZ_NATIVE_LIBVPX']:
+     OS_LIBS += CONFIG['MOZ_LIBVPX_LIBS']
+ 
 diff --git media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi
 index 00e77e7..55f48ab 100644
 --- mozilla/media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi
 +++ mozilla/media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi
-@@ -14,9 +14,9 @@
+@@ -17,18 +17,11 @@
        'conditions': [
          ['build_with_mozilla==1', {
            # Mozilla provides its own build of the opus library.
 -          'include_dirs': [
 -            '/media/libopus/include',
--           ]
+-            '/media/libopus/src',
+-            '/media/libopus/celt',
 +          'cflags_mozilla': [
++            '$(filter -I%, $(MOZ_CELT_CFLAGS))/celt',
 +            '$(MOZ_OPUS_CFLAGS)',
-+          ],
++            '$(filter -I%, $(MOZ_OPUS_CFLAGS))/../src',
+           ],
+-          'direct_dependent_settings': {
+-            'include_dirs': [
+-              '/media/libopus/include',
+-              '/media/libopus/src',
+-              '/media/libopus/celt',
+-            ],
+-          },
          }, {
            'dependencies': [
              '<(DEPTH)/third_party/opus/opus.gyp:opus'
-diff --git toolkit/library/libxul.mk toolkit/library/libxul.mk
+diff --git media/webrtc/trunk/webrtc/modules/audio_coding/neteq/neteq.gypi media/webrtc/trunk/webrtc/modules/audio_coding/neteq/neteq.gypi
+index 00e77e7..55f48ab 100644
+--- mozilla/media/webrtc/trunk/webrtc/modules/audio_coding/neteq/neteq.gypi
++++ mozilla/media/webrtc/trunk/webrtc/modules/audio_coding/neteq/neteq.gypi
+@@ -84,19 +84,11 @@
+           ],
+ 	}],
+         ['build_with_mozilla==1', {
+-          'include_dirs': [
+-            # Need Opus header files for the audio classifier.
+-            '<(DEPTH)/../../../media/opus/celt',
+-#            '<(DEPTH)/third_party/opus/src/src',
++          'cflags_mozilla': [
++            '$(filter -I%, $(MOZ_CELT_CFLAGS))/celt',
++            '$(MOZ_OPUS_CFLAGS)',
++            '$(filter -I%, $(MOZ_OPUS_CFLAGS))/../src',
+           ],
+-          'direct_dependent_settings': {
+-            'include_dirs': [
+-              '../../../../../../media/opus/celt',
+-              # Need Opus header files for the audio classifier.
+-              '<(DEPTH)/../../../media/opus/celt',
+-#              '<(DEPTH)/third_party/opus/src/src',
+-            ],
+-          },
+         }],
+       ],
+       'sources': [
+diff --git toolkit/library/moz.build toolkit/library/moz.build
 index d42137a..695e75a8 100644
---- mozilla/toolkit/library/libxul.mk
-+++ mozilla/toolkit/library/libxul.mk
-@@ -77,6 +77,34 @@ ifdef MOZ_NATIVE_HUNSPELL
- EXTRA_DSO_LDOPTS += $(MOZ_HUNSPELL_LIBS)
- endif
- 
-+ifdef MOZ_NATIVE_OGG
-+EXTRA_DSO_LDOPTS += $(MOZ_OGG_LIBS)
-+endif
-+
-+ifdef MOZ_NATIVE_THEORA
-+EXTRA_DSO_LDOPTS += $(MOZ_THEORA_LIBS)
-+endif
-+
-+ifdef MOZ_NATIVE_VORBIS
-+EXTRA_DSO_LDOPTS += $(MOZ_VORBIS_LIBS)
-+endif
-+
-+ifdef MOZ_NATIVE_TREMOR
-+EXTRA_DSO_LDOPTS += $(MOZ_TREMOR_LIBS)
-+endif
-+
-+ifdef MOZ_NATIVE_OPUS
-+EXTRA_DSO_LDOPTS += $(MOZ_OPUS_LIBS)
-+endif
-+
-+ifdef MOZ_NATIVE_SPEEX
-+EXTRA_DSO_LDOPTS += $(MOZ_SPEEX_LIBS)
-+endif
-+
-+ifdef MOZ_NATIVE_SOUNDTOUCH
-+EXTRA_DSO_LDOPTS += $(MOZ_SOUNDTOUCH_LIBS)
-+endif
-+
- ifdef MOZ_NATIVE_LIBEVENT
- EXTRA_DSO_LDOPTS += $(MOZ_LIBEVENT_LIBS)
- endif
-diff --git xpcom/build/nsXPComInit.cpp xpcom/build/nsXPComInit.cpp
+--- mozilla/toolkit/library/moz.build
++++ mozilla/toolkit/library/moz.build
+@@ -178,6 +178,30 @@ if CONFIG['MOZ_NATIVE_PNG']:
+ if CONFIG['MOZ_NATIVE_HUNSPELL']:
+     OS_LIBS += CONFIG['MOZ_HUNSPELL_LIBS']
+ 
++if CONFIG['MOZ_NATIVE_OGG']:
++    OS_LIBS += CONFIG['MOZ_OGG_LIBS']
++
++if CONFIG['MOZ_NATIVE_THEORA']:
++    OS_LIBS += CONFIG['MOZ_THEORA_LIBS']
++
++if CONFIG['MOZ_NATIVE_VORBIS']:
++    OS_LIBS += CONFIG['MOZ_VORBIS_LIBS']
++
++if CONFIG['MOZ_NATIVE_TREMOR']:
++    OS_LIBS += CONFIG['MOZ_TREMOR_LIBS']
++
++if CONFIG['MOZ_NATIVE_CELT']:
++    OS_LIBS += CONFIG['MOZ_CELT_LIBS']
++
++if CONFIG['MOZ_NATIVE_OPUS']:
++    OS_LIBS += CONFIG['MOZ_OPUS_LIBS']
++
++if CONFIG['MOZ_NATIVE_SPEEX']:
++    OS_LIBS += CONFIG['MOZ_SPEEX_LIBS']
++
++if CONFIG['MOZ_NATIVE_SOUNDTOUCH']:
++    OS_LIBS += CONFIG['MOZ_SOUNDTOUCH_LIBS']
++
+ if CONFIG['MOZ_NATIVE_LIBEVENT']:
+     OS_LIBS += CONFIG['MOZ_LIBEVENT_LIBS']
+ 
+diff --git xpcom/build/XPCOMInit.cpp xpcom/build/XPCOMInit.cpp
 index 2cf281e..6d7af0e 100644
---- mozilla/xpcom/build/nsXPComInit.cpp
-+++ mozilla/xpcom/build/nsXPComInit.cpp
-@@ -130,7 +130,9 @@ extern nsresult nsStringInputStreamConstructor(nsISupports *, REFNSIID, void **)
+--- mozilla/xpcom/build/XPCOMInit.cpp
++++ mozilla/xpcom/build/XPCOMInit.cpp
+@@ -138,7 +138,9 @@ extern nsresult nsStringInputStreamConstructor(nsISupports*, REFNSIID, void**);
  #include "mozilla/VisualEventTracer.h"
  #endif
  
@@ -476,17 +566,17 @@
  #if defined(MOZ_VPX) && !defined(MOZ_VPX_NO_MEM_REPORTING)
  #include "vpx_mem/vpx_mem.h"
  #endif
-@@ -571,11 +573,13 @@ NS_InitXPCOM2(nsIServiceManager* *result,
-     // this oddness.
-     mozilla::SetICUMemoryFunctions();
+@@ -651,11 +653,13 @@ NS_InitXPCOM2(nsIServiceManager** aResult,
+   // this oddness.
+   mozilla::SetICUMemoryFunctions();
  
 +#ifndef MOZ_OGG_NO_MEM_REPORTING
-     // Do the same for libogg.
-     ogg_set_mem_functions(OggReporter::CountingMalloc,
-                           OggReporter::CountingCalloc,
-                           OggReporter::CountingRealloc,
-                           OggReporter::CountingFree);
+   // Do the same for libogg.
+   ogg_set_mem_functions(OggReporter::CountingMalloc,
+                         OggReporter::CountingCalloc,
+                         OggReporter::CountingRealloc,
+                         OggReporter::CountingFree);
 +#endif
  
  #if defined(MOZ_VPX) && !defined(MOZ_VPX_NO_MEM_REPORTING)
-     // And for VPX.
+   // And for VPX.

Deleted: trunk/www/firefox/files/patch-bug1143411
==============================================================================
--- trunk/www/firefox/files/patch-bug1143411	Fri Jul 24 01:20:55 2015	(r1853)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,27 +0,0 @@
-https://bugzilla.mozilla.org/show_bug.cgi?id=1143411
-
-diff --git a/config/system-headers b/config/system-headers
---- config/system-headers
-+++ config/system-headers
-@@ -465,16 +465,17 @@ freetype/tttables.h
- freetype/t1tables.h
- freetype/ftlcdfil.h
- freetype/ftsizes.h
- freetype/ftadvanc.h
- freetype/ftbitmap.h
- freetype/ftxf86.h
- freetype.h
- ftcache.h
-+ftfntfmt.h
- ftglyph.h
- ftsynth.h
- ftoutln.h
- ttnameid.h
- tttables.h
- t1tables.h
- ftlcdfil.h
- ftsizes.h
-
-
-
-


More information about the freebsd-gecko mailing list