summaryrefslogtreecommitdiff
path: root/mail
diff options
context:
space:
mode:
authorBeat Gaetzi <beat@FreeBSD.org>2014-10-15 15:48:16 +0000
committerBeat Gaetzi <beat@FreeBSD.org>2014-10-15 15:48:16 +0000
commit8f7f02ae397da7ce0cf9c3bc16b5d117807c1949 (patch)
treec910dffa13397137a5faa661668aff88ff8d1a77 /mail
parent- Allow svnup to work with TLS; SSLv3 is being disabled due to POODLE. (diff)
- Update Firefox to 33.0
- Update Firefox ESR to 31.2.0 - Update NSS to 3.17.2 - Update Thunderbird to 31.2.0 - Update libxul to 31.2.0 (and mark as BROKEN) - Disable SSL 3.0 with pref (Upstream bug 1076983) - (workaround) replace USE_GCC=yes with USES=compiler:gcc-c++11-lib in order to fix runtime for PGO and powerpc/powerpc64 on libc++ systems - Add OSS audio fallback for HTML5 audio from upstream bug; not exposed yet because WebRTC still needs ALSA or PulseAudio - Kill @dirrm from gecko@ ports per CHANGES from 20140922 - Drop workaround for LLVM PR 19007: base and lang/clang34 have the fix - Improve workaround comment for LLVM PR 15840, partially rejecting r348851 by marino@ until bug 193555 PR: 194356 Submitted by: Jan Beich Security: http://www.vuxml.org/freebsd/9c1495ac-8d8c-4789-a0f3-8ca6b476619c.html
Diffstat (limited to 'mail')
-rw-r--r--mail/linux-thunderbird/Makefile2
-rw-r--r--mail/linux-thunderbird/distinfo4
-rw-r--r--mail/linux-thunderbird/pkg-plist14
-rw-r--r--mail/thunderbird-i18n/Makefile13
-rw-r--r--mail/thunderbird-i18n/distinfo220
-rw-r--r--mail/thunderbird/Makefile10
-rw-r--r--mail/thunderbird/distinfo4
-rw-r--r--mail/thunderbird/files/patch-bug10217611092
-rw-r--r--mail/thunderbird/files/patch-bug107370918
-rw-r--r--mail/thunderbird/files/patch-bug107698345
-rw-r--r--mail/thunderbird/files/patch-clang34-disable-stdcall13
11 files changed, 1278 insertions, 157 deletions
diff --git a/mail/linux-thunderbird/Makefile b/mail/linux-thunderbird/Makefile
index 61ac401e2f9e..9e93133f6064 100644
--- a/mail/linux-thunderbird/Makefile
+++ b/mail/linux-thunderbird/Makefile
@@ -2,7 +2,7 @@
# $FreeBSD$
PORTNAME= thunderbird
-DISTVERSION= 31.1.2
+DISTVERSION= 31.2.0
CATEGORIES= mail news net-im ipv6
MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}/linux-i686/en-US
diff --git a/mail/linux-thunderbird/distinfo b/mail/linux-thunderbird/distinfo
index 5b21bfb83982..cd6b5336f427 100644
--- a/mail/linux-thunderbird/distinfo
+++ b/mail/linux-thunderbird/distinfo
@@ -1,5 +1,5 @@
-SHA256 (thunderbird-31.1.2.tar.bz2) = 9209fa7bdada6245717dbfaf517d68cef04719812504bc0c988def6adc7baab5
-SIZE (thunderbird-31.1.2.tar.bz2) = 33552961
+SHA256 (thunderbird-31.2.0.tar.bz2) = 4c4da90f383d7b43e97e471656a6cfbbd44d1b80d57b8b2405497678aced46b5
+SIZE (thunderbird-31.2.0.tar.bz2) = 33559450
SHA256 (glib2-2.22.2-2.fc12.i686.rpm) = e3b459c245ec14e7248e9de4b506963a4773407f3e58835db5070d0ed02ecc99
SIZE (glib2-2.22.2-2.fc12.i686.rpm) = 1162908
SHA256 (gtk2-2.18.3-19.fc12.i686.rpm) = aea9cf7ffe9c8dae0faa2bf3d2aa1b2117c55dce03da72dcce8c268279ec0a4b
diff --git a/mail/linux-thunderbird/pkg-plist b/mail/linux-thunderbird/pkg-plist
index edf841303cac..0a609912cd98 100644
--- a/mail/linux-thunderbird/pkg-plist
+++ b/mail/linux-thunderbird/pkg-plist
@@ -78,17 +78,3 @@ lib/%%APP_NAME%%/updater
lib/%%APP_NAME%%/updater.ini
@exec /bin/cp -R %%LOCALBASE%%/lib/xpi/symlinks/%%APP_NAME%%/ %D/lib/%%APP_NAME%%/extensions/ 2>/dev/null || true
@unexec /usr/bin/find %D/lib/%%APP_NAME%%/extensions/ -depth 1 -type l -delete 2>/dev/null || true
-@dirrm lib/%%APP_NAME%%/chrome/icons/default
-@dirrm lib/%%APP_NAME%%/chrome/icons
-@dirrm lib/%%APP_NAME%%/chrome
-@dirrm lib/%%APP_NAME%%/components
-@dirrm lib/%%APP_NAME%%/defaults/messenger
-@dirrm lib/%%APP_NAME%%/defaults/pref
-@dirrm lib/%%APP_NAME%%/defaults
-@dirrm lib/%%APP_NAME%%/dictionaries
-@dirrm lib/%%APP_NAME%%/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}
-@dirrm lib/%%APP_NAME%%/extensions
-@dirrm lib/%%APP_NAME%%/icons
-@dirrm lib/%%APP_NAME%%/isp
-@dirrm lib/%%APP_NAME%%/searchplugins
-@dirrm lib/%%APP_NAME%%
diff --git a/mail/thunderbird-i18n/Makefile b/mail/thunderbird-i18n/Makefile
index 33cae5f85072..11dd8bcc67ec 100644
--- a/mail/thunderbird-i18n/Makefile
+++ b/mail/thunderbird-i18n/Makefile
@@ -2,7 +2,7 @@
# $FreeBSD$
PORTNAME= thunderbird-i18n
-PORTVERSION= 31.1.2
+PORTVERSION= 31.2.0
CATEGORIES= mail news net-im
MASTER_SITES= MOZILLA/${PORTNAME:S|-i18n||}/releases/${PORTVERSION}/linux-i686/xpi
PKGNAMEPREFIX=
@@ -12,7 +12,7 @@ DIST_SUBDIR= xpi/${DISTNAME}
MAINTAINER= gecko@FreeBSD.org
COMMENT= Localized interface for Thunderbird
-USES= gecko:thunderbird zip
+USES= gecko:thunderbird,build zip
USE_XPI= thunderbird
NO_BUILD= yes
@@ -24,15 +24,11 @@ WDIR= langpack-*@thunderbird.mozilla.org
XPI_DISTNAMES= ${THUNDERBIRD_I18N_}
PLIST?= ${WRKDIR}/plist
-PLISTD?= ${WRKDIR}/plist_dirs
PLISTF?= ${WRKDIR}/plist_files
.include "${.CURDIR}/Makefile.option"
.include <bsd.port.pre.mk>
-# make sure that thunderbird always gets upgraded before this port
-BUILD_DEPENDS= thunderbird>=0:${PORTSDIR}/mail/thunderbird
-
.ifndef WITHOUT_SWITCHER
RUN_DEPENDS+= xpi-quick-locale-switcher>=0:${PORTSDIR}/www/xpi-quick-locale-switcher
.endif
@@ -55,12 +51,9 @@ do-extract:
fi; \
cd ${WRKSRC}/langpack-$$lang@thunderbird.mozilla.org/; \
${FIND} -H -s * ! -type d | \
- ${SED} -e "s|^|lib/xpi/langpack-$$lang@thunderbird.mozilla.org/|" >> ${PLISTF} && \
- ${FIND} -d * -type d | \
- ${SED} -e "s|^|@dirrm lib/xpi/langpack-$$lang@thunderbird.mozilla.org/|" >> ${PLISTD}; \
+ ${SED} -e "s|^|lib/xpi/langpack-$$lang@thunderbird.mozilla.org/|" >> ${PLISTF}; \
done
${CAT} ${PLISTF} | ${SORT} >> ${PLIST}
- ${CAT} ${PLISTD} | ${SORT} -r >> ${PLIST}
do-install:
diff --git a/mail/thunderbird-i18n/distinfo b/mail/thunderbird-i18n/distinfo
index 4933adb11fa7..094926733cba 100644
--- a/mail/thunderbird-i18n/distinfo
+++ b/mail/thunderbird-i18n/distinfo
@@ -1,110 +1,110 @@
-SHA256 (xpi/thunderbird-i18n-31.1.2/ar.xpi) = d7f7f5fa42bc7dbeeb67ea312cd1390f9daf38cf22db2d29acebcd1d3e74d1fa
-SIZE (xpi/thunderbird-i18n-31.1.2/ar.xpi) = 472810
-SHA256 (xpi/thunderbird-i18n-31.1.2/ast.xpi) = 635422fbc96177f43cb01c292a3b0a06ceb3040355d00880a6ddeffb4dcfeb4a
-SIZE (xpi/thunderbird-i18n-31.1.2/ast.xpi) = 393048
-SHA256 (xpi/thunderbird-i18n-31.1.2/be.xpi) = a8a48f464b3a44a5724096995431606b740af3247bb325f47a63c065f626c1d7
-SIZE (xpi/thunderbird-i18n-31.1.2/be.xpi) = 427488
-SHA256 (xpi/thunderbird-i18n-31.1.2/bg.xpi) = e5dd2c1c5a97cc90514a1d0e0852e8579e625d689964b198036a6ac6f33e446c
-SIZE (xpi/thunderbird-i18n-31.1.2/bg.xpi) = 493735
-SHA256 (xpi/thunderbird-i18n-31.1.2/bn-BD.xpi) = 461fac71d5d8a3910d68740def12b2235374b39f5cfa01ab912021e295cbd3c2
-SIZE (xpi/thunderbird-i18n-31.1.2/bn-BD.xpi) = 555612
-SHA256 (xpi/thunderbird-i18n-31.1.2/br.xpi) = 3c1d248c517de97d559a85f127e6871afd1a8c245cb4999be80626a258bdbb49
-SIZE (xpi/thunderbird-i18n-31.1.2/br.xpi) = 441444
-SHA256 (xpi/thunderbird-i18n-31.1.2/ca.xpi) = fff999721e7b388880a7a9c64d73add479e2a2f9e447b8d4e506a318efde9069
-SIZE (xpi/thunderbird-i18n-31.1.2/ca.xpi) = 441712
-SHA256 (xpi/thunderbird-i18n-31.1.2/cs.xpi) = 40c16d650c2f48ea945daca989f24cc293343794c45c5cde3f7ffe1305b8f159
-SIZE (xpi/thunderbird-i18n-31.1.2/cs.xpi) = 444701
-SHA256 (xpi/thunderbird-i18n-31.1.2/da.xpi) = fdfd890e09e23004cc1ba4c0df38648cd74f1c8d9d8d336c15a2aee8f75d98fc
-SIZE (xpi/thunderbird-i18n-31.1.2/da.xpi) = 422052
-SHA256 (xpi/thunderbird-i18n-31.1.2/de.xpi) = da60f2a84ca8cb6b4e15393046ae43adac368dac35327f04bf89d31e8e0f829e
-SIZE (xpi/thunderbird-i18n-31.1.2/de.xpi) = 424665
-SHA256 (xpi/thunderbird-i18n-31.1.2/el.xpi) = 975fdb6134fe5436d0459eb89dc6e8ae3d8829f2b8f7b5a3387011215184cef5
-SIZE (xpi/thunderbird-i18n-31.1.2/el.xpi) = 484855
-SHA256 (xpi/thunderbird-i18n-31.1.2/en-GB.xpi) = 87ac86fac2b341286e9789c1037404588813bb858e9cd718f7de5e401ddade6e
-SIZE (xpi/thunderbird-i18n-31.1.2/en-GB.xpi) = 412515
-SHA256 (xpi/thunderbird-i18n-31.1.2/en-US.xpi) = f96739de83f760ee65727e9a68ad59e13cc60d2272b6a03bc80b5153fa0a365a
-SIZE (xpi/thunderbird-i18n-31.1.2/en-US.xpi) = 413660
-SHA256 (xpi/thunderbird-i18n-31.1.2/es-AR.xpi) = d50ef569c6f74ceac8d9eb128cd98c3b2bb0af4853d1bf7a26265d5f31a8d452
-SIZE (xpi/thunderbird-i18n-31.1.2/es-AR.xpi) = 438530
-SHA256 (xpi/thunderbird-i18n-31.1.2/es-ES.xpi) = 6a9ec42a0f90b1d59fb61e47e533b5c79df41e13d8452d2fba5e5a649527cffe
-SIZE (xpi/thunderbird-i18n-31.1.2/es-ES.xpi) = 374979
-SHA256 (xpi/thunderbird-i18n-31.1.2/et.xpi) = 7763519e3c74f37afa026a8fe7214a2b99e9d0f86391031eaa66869e3ef74870
-SIZE (xpi/thunderbird-i18n-31.1.2/et.xpi) = 434364
-SHA256 (xpi/thunderbird-i18n-31.1.2/eu.xpi) = 233ce00a457754f2454f26e618cc01f1736671a717a96b63cc7bea3d72193172
-SIZE (xpi/thunderbird-i18n-31.1.2/eu.xpi) = 431448
-SHA256 (xpi/thunderbird-i18n-31.1.2/fi.xpi) = 833ce0403ed46f87cb2730d2a0a4f3cdaa383295f84e7beeb90d6e48b2a0ddf7
-SIZE (xpi/thunderbird-i18n-31.1.2/fi.xpi) = 435632
-SHA256 (xpi/thunderbird-i18n-31.1.2/fr.xpi) = daf99b99c3fa73679801750bfbd33ac007edc05621ad663e4e26ddfee17b5dd2
-SIZE (xpi/thunderbird-i18n-31.1.2/fr.xpi) = 444143
-SHA256 (xpi/thunderbird-i18n-31.1.2/fy-NL.xpi) = f775a2236591a18d84fcf36e5b5a5d1bb8a5864b91faa29c2b39e0bee599ff0e
-SIZE (xpi/thunderbird-i18n-31.1.2/fy-NL.xpi) = 438544
-SHA256 (xpi/thunderbird-i18n-31.1.2/ga-IE.xpi) = 6eed7b3ac1e4f9ac89b138041c2a10d7fae0ef5492035397bfafe771952526db
-SIZE (xpi/thunderbird-i18n-31.1.2/ga-IE.xpi) = 449361
-SHA256 (xpi/thunderbird-i18n-31.1.2/gd.xpi) = 0576fb35d74a20624581b4fe53ef916032e77e3c7bfd9a7b86fdf687a413c923
-SIZE (xpi/thunderbird-i18n-31.1.2/gd.xpi) = 453171
-SHA256 (xpi/thunderbird-i18n-31.1.2/gl.xpi) = 274c45fe7bffe038a9c846359e99847193672e7c4dcec4c47e65720a8d16e3c0
-SIZE (xpi/thunderbird-i18n-31.1.2/gl.xpi) = 446787
-SHA256 (xpi/thunderbird-i18n-31.1.2/he.xpi) = 784505dd220387ff2b569118380957882feabf61366a9cde1e794e4fc08414f7
-SIZE (xpi/thunderbird-i18n-31.1.2/he.xpi) = 476111
-SHA256 (xpi/thunderbird-i18n-31.1.2/hr.xpi) = 4908835dafeb9bef43f4fa294f254bcd64c611c40f1aa35716730f179a3af554
-SIZE (xpi/thunderbird-i18n-31.1.2/hr.xpi) = 436982
-SHA256 (xpi/thunderbird-i18n-31.1.2/hu.xpi) = 210f50f948c726744ffdfa33cdb1fd9f4434698bd6c131257984f2e2cdcc1ecc
-SIZE (xpi/thunderbird-i18n-31.1.2/hu.xpi) = 454541
-SHA256 (xpi/thunderbird-i18n-31.1.2/hy-AM.xpi) = 8acd553aacfdf9f4ed66fdd50454f473146fa1762309ff48104a941e62cff995
-SIZE (xpi/thunderbird-i18n-31.1.2/hy-AM.xpi) = 492767
-SHA256 (xpi/thunderbird-i18n-31.1.2/id.xpi) = 8388260bdb9d7d715e7cfdfe21826e5d390bcb1f48d1e649d82d0142f360d42d
-SIZE (xpi/thunderbird-i18n-31.1.2/id.xpi) = 475875
-SHA256 (xpi/thunderbird-i18n-31.1.2/is.xpi) = cebe06ca5e72448ffe8e5d97c61b2be3a898b1ceb9726f9a0bfa7cec714f8eb2
-SIZE (xpi/thunderbird-i18n-31.1.2/is.xpi) = 437959
-SHA256 (xpi/thunderbird-i18n-31.1.2/it.xpi) = d5bab57141fbae37f3a983ed85983d91fff71f005da1dcf89682563c92baf3f3
-SIZE (xpi/thunderbird-i18n-31.1.2/it.xpi) = 368000
-SHA256 (xpi/thunderbird-i18n-31.1.2/ja.xpi) = 06a62d4ef79c2a7006b15fae6882b7919b10843c2b93cd23decf9e4d07151555
-SIZE (xpi/thunderbird-i18n-31.1.2/ja.xpi) = 489267
-SHA256 (xpi/thunderbird-i18n-31.1.2/ko.xpi) = fb40e186e31bc836a8f18be6df4dc654b793a782f1b79f4b143ff3830781dca2
-SIZE (xpi/thunderbird-i18n-31.1.2/ko.xpi) = 448920
-SHA256 (xpi/thunderbird-i18n-31.1.2/lt.xpi) = 80dc6b4ba4fef803776e3634682cded4ae4df1a35771d30ed0c2a1f4af6a6e30
-SIZE (xpi/thunderbird-i18n-31.1.2/lt.xpi) = 457812
-SHA256 (xpi/thunderbird-i18n-31.1.2/nb-NO.xpi) = be32cfc7192a3836f48c11022ec58d28091f568f1bf2fc25e1d7667ac6222603
-SIZE (xpi/thunderbird-i18n-31.1.2/nb-NO.xpi) = 430941
-SHA256 (xpi/thunderbird-i18n-31.1.2/nl.xpi) = 0607fe516735fea3763154f63bc2212f1b76ea3cfae26f1748e7d3f05b5a1301
-SIZE (xpi/thunderbird-i18n-31.1.2/nl.xpi) = 431887
-SHA256 (xpi/thunderbird-i18n-31.1.2/nn-NO.xpi) = 31782ee5743442de756d7eb6dc601ec5843af0d6f45254f946fedca23dfbf9f5
-SIZE (xpi/thunderbird-i18n-31.1.2/nn-NO.xpi) = 433198
-SHA256 (xpi/thunderbird-i18n-31.1.2/pa-IN.xpi) = 4f3849fb31c8fe4f65869b35595621df22d2491d08df259d9fdb14ee89b9df04
-SIZE (xpi/thunderbird-i18n-31.1.2/pa-IN.xpi) = 525323
-SHA256 (xpi/thunderbird-i18n-31.1.2/pl.xpi) = ea31936122f377d83c6d059435c28c3e990cadd6d1332d97ac3a7bb196ad085b
-SIZE (xpi/thunderbird-i18n-31.1.2/pl.xpi) = 410872
-SHA256 (xpi/thunderbird-i18n-31.1.2/pt-BR.xpi) = 74501df72d4747944fafafde1fedf2214c86c4f4ba594d276f5efec437f14a28
-SIZE (xpi/thunderbird-i18n-31.1.2/pt-BR.xpi) = 450477
-SHA256 (xpi/thunderbird-i18n-31.1.2/pt-PT.xpi) = 43f0d1a2a6187e3f01e75c091c599341b0895e71e3c76b7e6cd040fd95d69482
-SIZE (xpi/thunderbird-i18n-31.1.2/pt-PT.xpi) = 439603
-SHA256 (xpi/thunderbird-i18n-31.1.2/rm.xpi) = 5c8c153c5f36e7237605fcbaa2d66df0e72b7c6a20f793b9113c3e16c87240b8
-SIZE (xpi/thunderbird-i18n-31.1.2/rm.xpi) = 439185
-SHA256 (xpi/thunderbird-i18n-31.1.2/ro.xpi) = 381a1f57aa7e3646dcd29aa28eec1bd951cff1e378d5fe795a5e87556fd286ae
-SIZE (xpi/thunderbird-i18n-31.1.2/ro.xpi) = 479746
-SHA256 (xpi/thunderbird-i18n-31.1.2/ru.xpi) = 667ffecf4065352a0e6b32ed5d4535dc9758167cb431b01b13bac9d4027719e5
-SIZE (xpi/thunderbird-i18n-31.1.2/ru.xpi) = 436156
-SHA256 (xpi/thunderbird-i18n-31.1.2/si.xpi) = 5bb7054dc79e73852f39464b3cabeb28ef45dd814a2fbef699fd8ac0d28cfa15
-SIZE (xpi/thunderbird-i18n-31.1.2/si.xpi) = 528812
-SHA256 (xpi/thunderbird-i18n-31.1.2/sk.xpi) = e8f13c479e58e7858ef82864927bb48d013d3f1b7c04b26b525504cb475ba02e
-SIZE (xpi/thunderbird-i18n-31.1.2/sk.xpi) = 452995
-SHA256 (xpi/thunderbird-i18n-31.1.2/sl.xpi) = 4e2c3392ae516d34f2568a6de607e86e641eda8e1dd211420ab9c569354757b2
-SIZE (xpi/thunderbird-i18n-31.1.2/sl.xpi) = 433874
-SHA256 (xpi/thunderbird-i18n-31.1.2/sq.xpi) = f38d505b006a209c28fbe2497e2840b1402f15659ab8850b96e401b37439aa43
-SIZE (xpi/thunderbird-i18n-31.1.2/sq.xpi) = 454695
-SHA256 (xpi/thunderbird-i18n-31.1.2/sr.xpi) = 0ea7ab963f7316a8c99c4ede0d2604532b8e9c640d1c1ad17b5aef52410efb6a
-SIZE (xpi/thunderbird-i18n-31.1.2/sr.xpi) = 537335
-SHA256 (xpi/thunderbird-i18n-31.1.2/sv-SE.xpi) = c2be7fa0cc149411afa6cd697fc5f9c5db8e8dc94eb361e9005a7c85207812ad
-SIZE (xpi/thunderbird-i18n-31.1.2/sv-SE.xpi) = 436105
-SHA256 (xpi/thunderbird-i18n-31.1.2/ta-LK.xpi) = 2990c01eccc33ba92e4bd4a5b6bc6a862a3d4ba038187193862aee20590f222f
-SIZE (xpi/thunderbird-i18n-31.1.2/ta-LK.xpi) = 553508
-SHA256 (xpi/thunderbird-i18n-31.1.2/tr.xpi) = 7c28f5337d0f5265ffc264e06b7f18b733358ba040d36cccc14586e4b2b212d5
-SIZE (xpi/thunderbird-i18n-31.1.2/tr.xpi) = 457359
-SHA256 (xpi/thunderbird-i18n-31.1.2/uk.xpi) = 711e037fe115f63b560e59ca33f26fe89b021587d3ade4706df0fe5c4822af16
-SIZE (xpi/thunderbird-i18n-31.1.2/uk.xpi) = 499656
-SHA256 (xpi/thunderbird-i18n-31.1.2/vi.xpi) = 9889f4d9ebf9d298b7a5076879bf34e71dd00665a6be69ff2331df49fdc0b620
-SIZE (xpi/thunderbird-i18n-31.1.2/vi.xpi) = 513834
-SHA256 (xpi/thunderbird-i18n-31.1.2/zh-CN.xpi) = b29c35c9b4de9678f8f15d5910b23b842553b80763f41f2340e823a03b44700e
-SIZE (xpi/thunderbird-i18n-31.1.2/zh-CN.xpi) = 462667
-SHA256 (xpi/thunderbird-i18n-31.1.2/zh-TW.xpi) = 9c76eae686d8a72ceb11a24ad155521aa02ee65ade6a068a4dfe6df5f7ba4698
-SIZE (xpi/thunderbird-i18n-31.1.2/zh-TW.xpi) = 463408
+SHA256 (xpi/thunderbird-i18n-31.2.0/ar.xpi) = de2222b5edbe334c323086d2f4742b3d89abf53ea9d04e7b145b56e06203490a
+SIZE (xpi/thunderbird-i18n-31.2.0/ar.xpi) = 472812
+SHA256 (xpi/thunderbird-i18n-31.2.0/ast.xpi) = 5d8a3d7cf8a8777595d9427f9ef9fa50af9e42d3c02fb0eaf23bc98ee5fc673d
+SIZE (xpi/thunderbird-i18n-31.2.0/ast.xpi) = 393049
+SHA256 (xpi/thunderbird-i18n-31.2.0/be.xpi) = f8228331079c95d98aff60c49039b41bc494c10074b19d92850d0abc88b94da2
+SIZE (xpi/thunderbird-i18n-31.2.0/be.xpi) = 427488
+SHA256 (xpi/thunderbird-i18n-31.2.0/bg.xpi) = 4c7ec26c111e810476f8308a2b65c1fd754c9a970eec04440a186cab9487dd5b
+SIZE (xpi/thunderbird-i18n-31.2.0/bg.xpi) = 493734
+SHA256 (xpi/thunderbird-i18n-31.2.0/bn-BD.xpi) = 41cd06883895d4813f140aeb2c9592ded5c1971e035373a79ff9484dc731e8de
+SIZE (xpi/thunderbird-i18n-31.2.0/bn-BD.xpi) = 555613
+SHA256 (xpi/thunderbird-i18n-31.2.0/br.xpi) = a4fbe64d4b4e2c4a0c92a1679459b774b6f19838203661c97bfdd4bd132e0918
+SIZE (xpi/thunderbird-i18n-31.2.0/br.xpi) = 441444
+SHA256 (xpi/thunderbird-i18n-31.2.0/ca.xpi) = ff37b69e48d8fe429a981bce805cf6470f21ccfb9718762aa49fbe16246e0e6a
+SIZE (xpi/thunderbird-i18n-31.2.0/ca.xpi) = 441713
+SHA256 (xpi/thunderbird-i18n-31.2.0/cs.xpi) = 11c4d4d9aa51b4db454ea0aa3164d62ed17c6b108be18b28bf2eacf626546737
+SIZE (xpi/thunderbird-i18n-31.2.0/cs.xpi) = 444701
+SHA256 (xpi/thunderbird-i18n-31.2.0/da.xpi) = c11a949b9e20375542b72dfd631091db3ae29040cf32f15cf661c141b72d9503
+SIZE (xpi/thunderbird-i18n-31.2.0/da.xpi) = 422051
+SHA256 (xpi/thunderbird-i18n-31.2.0/de.xpi) = c5a529579a4884a9efd7dade99fda51fb17f1918e68439719c4d4cb9f303d908
+SIZE (xpi/thunderbird-i18n-31.2.0/de.xpi) = 424665
+SHA256 (xpi/thunderbird-i18n-31.2.0/el.xpi) = 3a60bd9b6d3806794ae7a45f5ed51ddaed0cc7d3d4eefb32e1a048e92e3bd617
+SIZE (xpi/thunderbird-i18n-31.2.0/el.xpi) = 484855
+SHA256 (xpi/thunderbird-i18n-31.2.0/en-GB.xpi) = 2d96c8962746fe12c42d6d161d0993c317344b6ce236689a33554f432832922b
+SIZE (xpi/thunderbird-i18n-31.2.0/en-GB.xpi) = 412515
+SHA256 (xpi/thunderbird-i18n-31.2.0/en-US.xpi) = b3ce584db1780e96d42284945d5accde989ee747bbe5d56fa26df500a4f8655d
+SIZE (xpi/thunderbird-i18n-31.2.0/en-US.xpi) = 413660
+SHA256 (xpi/thunderbird-i18n-31.2.0/es-AR.xpi) = 24b5ce7d75676056103ae24c589b19e707c94ad1e79dc5cb8d9aa85abeef40a2
+SIZE (xpi/thunderbird-i18n-31.2.0/es-AR.xpi) = 438531
+SHA256 (xpi/thunderbird-i18n-31.2.0/es-ES.xpi) = 2d879a455caac1fb21cf7f4cbedd0a685e8a13c4048d9182c0027ee7b947f398
+SIZE (xpi/thunderbird-i18n-31.2.0/es-ES.xpi) = 374979
+SHA256 (xpi/thunderbird-i18n-31.2.0/et.xpi) = 1f7a2196700782542290c7c28d0da7c6f9e958f8ff9c2e00318c4bfe4fa26f97
+SIZE (xpi/thunderbird-i18n-31.2.0/et.xpi) = 434364
+SHA256 (xpi/thunderbird-i18n-31.2.0/eu.xpi) = 006bc0dad91e8ed9d5b1b0b812171a147bc34fb5b8159f5b990a14b34e426941
+SIZE (xpi/thunderbird-i18n-31.2.0/eu.xpi) = 431448
+SHA256 (xpi/thunderbird-i18n-31.2.0/fi.xpi) = 0ee12f069f1ca5e36873b5ed7ddf42539358dbee321dd2c60c9d86c0b099ad87
+SIZE (xpi/thunderbird-i18n-31.2.0/fi.xpi) = 435632
+SHA256 (xpi/thunderbird-i18n-31.2.0/fr.xpi) = db6cc05b0c2ba94130cf065e4ee9c0440c5583bed557e46453a1cbc0df3c2cb4
+SIZE (xpi/thunderbird-i18n-31.2.0/fr.xpi) = 444144
+SHA256 (xpi/thunderbird-i18n-31.2.0/fy-NL.xpi) = 041ade3e98acdcb4ef5589aea49c9c8cd49730fd117d7fc0f45c4a24db9235d9
+SIZE (xpi/thunderbird-i18n-31.2.0/fy-NL.xpi) = 438545
+SHA256 (xpi/thunderbird-i18n-31.2.0/ga-IE.xpi) = f25ca1b71b9ab326a08a74492de3bf7ab276751e79ac3bba97e017b6d63b35a0
+SIZE (xpi/thunderbird-i18n-31.2.0/ga-IE.xpi) = 449362
+SHA256 (xpi/thunderbird-i18n-31.2.0/gd.xpi) = f520c4ffff9903ae8277f59c90e3d0a8f7c3dbdfcf08f7a09eed5e52be28ab75
+SIZE (xpi/thunderbird-i18n-31.2.0/gd.xpi) = 453171
+SHA256 (xpi/thunderbird-i18n-31.2.0/gl.xpi) = 49e151a0e9fb797534095177a36c8323f4b21af7c3b0cd119cddb5c8c3991a38
+SIZE (xpi/thunderbird-i18n-31.2.0/gl.xpi) = 446788
+SHA256 (xpi/thunderbird-i18n-31.2.0/he.xpi) = db3ec6a406074229b5d470147ed18c195d1c83ff002c9c6692e5a974fce68109
+SIZE (xpi/thunderbird-i18n-31.2.0/he.xpi) = 476111
+SHA256 (xpi/thunderbird-i18n-31.2.0/hr.xpi) = a79194cb6a188515b02591bb4d10aab2f0a4f51ad7d9de880e5f97b0d824b6bb
+SIZE (xpi/thunderbird-i18n-31.2.0/hr.xpi) = 436980
+SHA256 (xpi/thunderbird-i18n-31.2.0/hu.xpi) = 57ee1d724aed1a7afc67fcc58905f74c2d5694602ccc54218266a608611e90b8
+SIZE (xpi/thunderbird-i18n-31.2.0/hu.xpi) = 454542
+SHA256 (xpi/thunderbird-i18n-31.2.0/hy-AM.xpi) = 2626af0ff4cd8023c599abb158a5f61e4e507112f1c7ccf470bef16896a3224c
+SIZE (xpi/thunderbird-i18n-31.2.0/hy-AM.xpi) = 492765
+SHA256 (xpi/thunderbird-i18n-31.2.0/id.xpi) = a053c4935b4088c8fbb0850a73b4177ae854462f8ad37d130581879969fad498
+SIZE (xpi/thunderbird-i18n-31.2.0/id.xpi) = 475876
+SHA256 (xpi/thunderbird-i18n-31.2.0/is.xpi) = 63a39a88a75fabc271e09f8a8bed08388a1c3aa1fbb6b8a3e2946f7ba3ba008d
+SIZE (xpi/thunderbird-i18n-31.2.0/is.xpi) = 437959
+SHA256 (xpi/thunderbird-i18n-31.2.0/it.xpi) = b7a9c9454d038bda5138bbf73c30af650d79aa5de017c3d4eefd039cbfa6ca27
+SIZE (xpi/thunderbird-i18n-31.2.0/it.xpi) = 368001
+SHA256 (xpi/thunderbird-i18n-31.2.0/ja.xpi) = 128c6413771d621a80840f26d9248f52ca6d16456e032f2f754058dca233eab3
+SIZE (xpi/thunderbird-i18n-31.2.0/ja.xpi) = 489267
+SHA256 (xpi/thunderbird-i18n-31.2.0/ko.xpi) = 949d6bbc2c35c4fa2751a4efdd21d253f60c30e7ff975fd4b5806d89d1737a3c
+SIZE (xpi/thunderbird-i18n-31.2.0/ko.xpi) = 448920
+SHA256 (xpi/thunderbird-i18n-31.2.0/lt.xpi) = c6eb3433657dab7ebb01cbb86d0024aa49598a4fca61f500ed9e44c4e74fdc95
+SIZE (xpi/thunderbird-i18n-31.2.0/lt.xpi) = 456351
+SHA256 (xpi/thunderbird-i18n-31.2.0/nb-NO.xpi) = 2779fff656aaebaa852aa79c0685a801159a5d5b296bc239a871e0ca3b77558f
+SIZE (xpi/thunderbird-i18n-31.2.0/nb-NO.xpi) = 430941
+SHA256 (xpi/thunderbird-i18n-31.2.0/nl.xpi) = 21da7b7403d3c3746ff560a541dc87fdce9537fd14bfaee3904e936c426d4400
+SIZE (xpi/thunderbird-i18n-31.2.0/nl.xpi) = 431888
+SHA256 (xpi/thunderbird-i18n-31.2.0/nn-NO.xpi) = c79700f36907cde8d2a5788b121a7d0118f8b2471c72eda8f6aaf41f6049293b
+SIZE (xpi/thunderbird-i18n-31.2.0/nn-NO.xpi) = 433198
+SHA256 (xpi/thunderbird-i18n-31.2.0/pa-IN.xpi) = 899c8f1dc900280a44869bd5c4be649f30186c361b717a9e996d269c744fce7e
+SIZE (xpi/thunderbird-i18n-31.2.0/pa-IN.xpi) = 525323
+SHA256 (xpi/thunderbird-i18n-31.2.0/pl.xpi) = 489f30d45340cc7fdfc3a84d7459f464404ad5abd4cc72d4091c1e1c167f2533
+SIZE (xpi/thunderbird-i18n-31.2.0/pl.xpi) = 410872
+SHA256 (xpi/thunderbird-i18n-31.2.0/pt-BR.xpi) = 2459b15a8277d9c636f7380201f9636a98f7be66e695567bb545af21bed3f581
+SIZE (xpi/thunderbird-i18n-31.2.0/pt-BR.xpi) = 450477
+SHA256 (xpi/thunderbird-i18n-31.2.0/pt-PT.xpi) = f44efe77338e3bac23eb4e266a22e7e21c977db0b1740e2e2bb8978cb2724d75
+SIZE (xpi/thunderbird-i18n-31.2.0/pt-PT.xpi) = 439604
+SHA256 (xpi/thunderbird-i18n-31.2.0/rm.xpi) = b0f7e929ebe3e1c88b304e7df9cc3f5fc185effe1666bf5bebaab5874d1706d7
+SIZE (xpi/thunderbird-i18n-31.2.0/rm.xpi) = 439185
+SHA256 (xpi/thunderbird-i18n-31.2.0/ro.xpi) = 4c60b7a9233ed19b79f38f2c1acdd3c3c421e83866986720d36bc2dd5852c5ab
+SIZE (xpi/thunderbird-i18n-31.2.0/ro.xpi) = 479747
+SHA256 (xpi/thunderbird-i18n-31.2.0/ru.xpi) = 8098a2085dc282b70d5f2ec44a51676086d7e930c45056b8be8225529c0a93bd
+SIZE (xpi/thunderbird-i18n-31.2.0/ru.xpi) = 436156
+SHA256 (xpi/thunderbird-i18n-31.2.0/si.xpi) = 07a599cddff30ebdb245b03cf7fb3f10fd7dab77c7d5f72043a348147d9561b1
+SIZE (xpi/thunderbird-i18n-31.2.0/si.xpi) = 528812
+SHA256 (xpi/thunderbird-i18n-31.2.0/sk.xpi) = c2a10018d3a697735368112b957f84bfb1033567a04897e744e1a4d25cb91e1b
+SIZE (xpi/thunderbird-i18n-31.2.0/sk.xpi) = 452995
+SHA256 (xpi/thunderbird-i18n-31.2.0/sl.xpi) = 03391be8d12577f9e733e137818fdda4f4f28724ddbd4d9548e4ad26da94296a
+SIZE (xpi/thunderbird-i18n-31.2.0/sl.xpi) = 433874
+SHA256 (xpi/thunderbird-i18n-31.2.0/sq.xpi) = be5ba55ce94531b3dc84056e0433f78d341fe3b4f8ba5c68f67795aca44c8490
+SIZE (xpi/thunderbird-i18n-31.2.0/sq.xpi) = 454694
+SHA256 (xpi/thunderbird-i18n-31.2.0/sr.xpi) = e8f23cffa3b76f867dd0209f1f65a2b55d3f80245dbba9946b0f1993c1759791
+SIZE (xpi/thunderbird-i18n-31.2.0/sr.xpi) = 537335
+SHA256 (xpi/thunderbird-i18n-31.2.0/sv-SE.xpi) = 1760e8023cb00f33111279f25b60604613b682385aa735c2286fdd3d909853e2
+SIZE (xpi/thunderbird-i18n-31.2.0/sv-SE.xpi) = 436105
+SHA256 (xpi/thunderbird-i18n-31.2.0/ta-LK.xpi) = 1fe61ab35f687cd2389296783b7896b191bcc3ce02f7229404e1adc46360fe0e
+SIZE (xpi/thunderbird-i18n-31.2.0/ta-LK.xpi) = 553508
+SHA256 (xpi/thunderbird-i18n-31.2.0/tr.xpi) = a44cfd98890ab255a21b54991de71eca5f06a17e5cf825c01f8b7874ff2b2edd
+SIZE (xpi/thunderbird-i18n-31.2.0/tr.xpi) = 457360
+SHA256 (xpi/thunderbird-i18n-31.2.0/uk.xpi) = 7942f621505ce2270dbac9aecded2be7457aedf8ae345ffa776dfa5f3e524cb6
+SIZE (xpi/thunderbird-i18n-31.2.0/uk.xpi) = 499656
+SHA256 (xpi/thunderbird-i18n-31.2.0/vi.xpi) = 132981f1bdcf48ffb630965052713425d93fed862d0a87e9878c2196f64fd684
+SIZE (xpi/thunderbird-i18n-31.2.0/vi.xpi) = 513835
+SHA256 (xpi/thunderbird-i18n-31.2.0/zh-CN.xpi) = d6382bf21c901de5301a2ce4f2aaba839ba4ea3171bb2b965fca6876703c79cf
+SIZE (xpi/thunderbird-i18n-31.2.0/zh-CN.xpi) = 462668
+SHA256 (xpi/thunderbird-i18n-31.2.0/zh-TW.xpi) = 7704b9a4ed6f20c94b1390349614e18af643bf6d58b9cef38664afcc7048346f
+SIZE (xpi/thunderbird-i18n-31.2.0/zh-TW.xpi) = 463408
diff --git a/mail/thunderbird/Makefile b/mail/thunderbird/Makefile
index 9b0b217abed6..92c5dc57d83d 100644
--- a/mail/thunderbird/Makefile
+++ b/mail/thunderbird/Makefile
@@ -2,10 +2,10 @@
# $FreeBSD$
PORTNAME= thunderbird
-DISTVERSION= 31.1.2
+DISTVERSION= 31.2.0
CATEGORIES= mail news net-im ipv6
MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \
- https://ftp.mozilla.org/pub/mozilla.org/${PORTNAME}/candidates/${DISTVERSION}-candidates/build1/source/
+ https://ftp.mozilla.org/pub/mozilla.org/${PORTNAME}/candidates/${DISTVERSION}-candidates/build2/source/
DISTFILES= ${PORTNAME}-${DISTVERSION}.source${EXTRACT_SUFX}
EXTRACT_ONLY= ${PORTNAME}-${DISTVERSION}.source${EXTRACT_SUFX}
@@ -32,7 +32,7 @@ BUILD_DEPENDS= nspr>=4.10.6:${PORTSDIR}/devel/nspr \
LIB_DEPENDS= libv4l2.so:${PORTSDIR}/multimedia/libv4l
EM_VERSION= 1.7.2
-L_VERSION= 3.3.1.2
+L_VERSION= 3.3.2
SSP_UNSAFE= yes
OBJDIR_BUILD= # in-tree build broken after bug 789837
@@ -80,8 +80,8 @@ MOZSRC:= ${WRKSRC}/mozilla
XPI_LIBDIR= ${PREFIX}/lib/xpi
# avoid clang 3.2/3.3 crash in js/src/jsgc.cpp on refillFreeList<(js::AllowGC)1>
-# http://svnweb.freebsd.org/changeset/base/255804
-.if ${CHOSEN_COMPILER_TYPE} == clang && ${ARCH} == i386 && ${OSVERSION} < 1000056
+# To be removed when 9.2R goes EOL. http://llvm.org/PR15840
+.if ${ARCH} == i386 && ${CHOSEN_COMPILER_TYPE} == clang && ${COMPILER_VERSION:M3[23]}
. if ${PORT_OPTIONS:MOPTIMIZED_CFLAGS}
BROKEN= Cannot build with OPTIMIZED_CFLAGS option due to \
a ${CHOSEN_COMPILER_TYPE} bug: unset the option or \
diff --git a/mail/thunderbird/distinfo b/mail/thunderbird/distinfo
index 1e7c4157fba6..18cb22c174eb 100644
--- a/mail/thunderbird/distinfo
+++ b/mail/thunderbird/distinfo
@@ -1,4 +1,4 @@
-SHA256 (thunderbird-31.1.2.source.tar.bz2) = 86b18e7642ad8e6004cb4826daec586a24fae8a27da59df49f0039495dd5d7b5
-SIZE (thunderbird-31.1.2.source.tar.bz2) = 171033949
+SHA256 (thunderbird-31.2.0.source.tar.bz2) = 48130bbd9102303167aa832ea80970201777ee65b91fbab515332527850749b4
+SIZE (thunderbird-31.2.0.source.tar.bz2) = 171047372
SHA256 (enigmail-1.7.2.tar.gz) = 7b3a62e83961bafec1cdac60075aa6c317c8f655a837e31a7d1f3ce6a49fc7d6
SIZE (enigmail-1.7.2.tar.gz) = 1420346
diff --git a/mail/thunderbird/files/patch-bug1021761 b/mail/thunderbird/files/patch-bug1021761
new file mode 100644
index 000000000000..441cf005574b
--- /dev/null
+++ b/mail/thunderbird/files/patch-bug1021761
@@ -0,0 +1,1092 @@
+diff --git configure.in configure.in
+index 48e60c0..ec08417 100644
+--- mozilla/configure.in
++++ mozilla/configure.in
+@@ -5438,6 +5438,60 @@ fi
+ AC_SUBST(MOZ_WEBM_ENCODER)
+
+ dnl ==================================
++dnl = Check OSS availability
++dnl ==================================
++
++dnl If using Linux, Solaris or BSDs, ensure that OSS is available
++case "$OS_TARGET" in
++Linux|SunOS|DragonFly|FreeBSD|NetBSD|GNU/kFreeBSD)
++ MOZ_OSS=1
++ ;;
++esac
++
++MOZ_ARG_DISABLE_BOOL(oss,
++[ --disable-oss Disable OpenSoundSystem support],
++ MOZ_OSS=,
++ MOZ_OSS=1)
++
++_SAVE_CFLAGS=$CFLAGS
++_SAVE_LIBS=$LIBS
++if test -n "$MOZ_OSS"; then
++ dnl Prefer 4Front implementation
++ AC_MSG_CHECKING([MOZ_OSS_CFLAGS])
++ if test -z "$MOZ_OSS_CFLAGS"; then
++ for oss_conf in /etc/oss.conf /usr/local/etc/oss.conf; do
++ if test -e "$oss_conf"; then
++ . "$oss_conf"
++ fi
++ done
++ if test -d "$OSSLIBDIR"; then
++ MOZ_OSS_CFLAGS="-I$OSSLIBDIR/include"
++ fi
++ fi
++ AC_MSG_RESULT([$MOZ_OSS_CFLAGS])
++
++ CFLAGS="$CFLAGS $MOZ_OSS_CFLAGS"
++ MOZ_CHECK_HEADERS(sys/soundcard.h linux/soundcard.h soundcard.h)
++
++ if test "$ac_cv_header_sys_soundcard_h" != "yes" -a \
++ "$ac_cv_header_linux_soundcard_h" != "yes" -a \
++ "$ac_cv_header_soundcard_h" != "yes"; then
++ AC_MSG_ERROR([Need OSS for Ogg, Wave or WebM decoding on $OS_TARGET. Disable with --disable-ogg --disable-wave --disable-webm.])
++ fi
++
++ dnl Assume NetBSD implementation over SunAudio
++ AC_CHECK_LIB(ossaudio, _oss_ioctl,
++ [AC_DEFINE_UNQUOTED(CUBEB_OSS_DEFAULT_OUTPUT, "/dev/sound")
++ MOZ_OSS_LIBS="-lossaudio"])
++fi
++CFLAGS=$_SAVE_CFLAGS
++LIBS=$_SAVE_LIBS
++
++AC_SUBST(MOZ_OSS)
++AC_SUBST_LIST(MOZ_OSS_CFLAGS)
++AC_SUBST_LIST(MOZ_OSS_LIBS)
++
++dnl ==================================
+ dnl = Check alsa availability on Linux
+ dnl ==================================
+
+@@ -5451,12 +5505,23 @@ MOZ_ARG_ENABLE_BOOL(alsa,
+ MOZ_ALSA=1,
+ MOZ_ALSA=)
+
++MOZ_ARG_DISABLE_BOOL(alsa-dlopen,
++[ --disable-alsa-dlopen Disable runtime linking of libasound.so],
++ DISABLE_LIBASOUND_DLOPEN=1,
++ DISABLE_LIBASOUND_DLOPEN=)
++
+ if test -n "$MOZ_ALSA"; then
+ PKG_CHECK_MODULES(MOZ_ALSA, alsa, ,
+ [echo "$MOZ_ALSA_PKG_ERRORS"
+ AC_MSG_ERROR([Need alsa for Ogg, Wave or WebM decoding on Linux. Disable with --disable-ogg --disable-wave --disable-webm. (On Ubuntu, you might try installing the package libasound2-dev.)])])
+ fi
+
++if test -n "$DISABLE_LIBASOUND_DLOPEN"; then
++ AC_DEFINE(DISABLE_LIBASOUND_DLOPEN)
++else
++ MOZ_ALSA_LIBS=
++fi
++
+ AC_SUBST(MOZ_ALSA)
+
+ dnl ========================================================
+diff --git media/libcubeb/AUTHORS media/libcubeb/AUTHORS
+index b441e8a..950d9e5 100644
+--- mozilla/media/libcubeb/AUTHORS
++++ mozilla/media/libcubeb/AUTHORS
+@@ -4,3 +4,4 @@ Michael Wu <mwu@mozilla.com>
+ Paul Adenot <paul@paul.cx>
+ David Richards <drichards@mozilla.com>
+ Sebastien Alaiwan <sebastien.alaiwan@gmail.com>
++Evgeniy Vodolazskiy <waterlaz@gmail.com>
+diff --git media/libcubeb/src/cubeb.c media/libcubeb/src/cubeb.c
+index 9c3adcc..45d765b 100644
+--- mozilla/media/libcubeb/src/cubeb.c
++++ mozilla/media/libcubeb/src/cubeb.c
+@@ -54,6 +54,9 @@ int opensl_init(cubeb ** context, char const * context_name);
+ #if defined(USE_AUDIOTRACK)
+ int audiotrack_init(cubeb ** context, char const * context_name);
+ #endif
++#if defined(USE_OSS)
++int oss_init(cubeb ** context, char const * context_name);
++#endif
+
+ int
+ validate_stream_params(cubeb_stream_params stream_params)
+@@ -120,6 +123,9 @@ cubeb_init(cubeb ** context, char const * context_name)
+ #if defined(USE_AUDIOTRACK)
+ audiotrack_init,
+ #endif
++#if defined(USE_OSS)
++ oss_init,
++#endif
+ };
+ int i;
+
+diff --git media/libcubeb/src/cubeb_alsa.c media/libcubeb/src/cubeb_alsa.c
+index a962553..1f780f4 100644
+--- mozilla/media/libcubeb/src/cubeb_alsa.c
++++ mozilla/media/libcubeb/src/cubeb_alsa.c
+@@ -11,6 +11,7 @@
+ #include <sys/time.h>
+ #include <assert.h>
+ #include <limits.h>
++#include <dlfcn.h>
+ #include <poll.h>
+ #include <unistd.h>
+ #include <alsa/asoundlib.h>
+@@ -24,6 +25,50 @@
+
+ #define ALSA_PA_PLUGIN "ALSA <-> PulseAudio PCM I/O Plugin"
+
++#ifdef DISABLE_LIBASOUND_DLOPEN
++#define WRAP(x) x
++#else
++#define WRAP(x) cubeb_##x
++#define MAKE_TYPEDEF(x) static typeof(x) * cubeb_##x
++MAKE_TYPEDEF(snd_config);
++MAKE_TYPEDEF(snd_config_add);
++MAKE_TYPEDEF(snd_config_copy);
++MAKE_TYPEDEF(snd_config_delete);
++MAKE_TYPEDEF(snd_config_get_id);
++MAKE_TYPEDEF(snd_config_get_string);
++MAKE_TYPEDEF(snd_config_imake_integer);
++MAKE_TYPEDEF(snd_config_search);
++MAKE_TYPEDEF(snd_config_search_definition);
++MAKE_TYPEDEF(snd_lib_error_set_handler);
++MAKE_TYPEDEF(snd_pcm_avail_update);
++MAKE_TYPEDEF(snd_pcm_close);
++MAKE_TYPEDEF(snd_pcm_delay);
++MAKE_TYPEDEF(snd_pcm_drain);
++MAKE_TYPEDEF(snd_pcm_frames_to_bytes);
++MAKE_TYPEDEF(snd_pcm_get_params);
++/* snd_pcm_hw_params_alloca is actually a macro */
++/* MAKE_TYPEDEF(snd_pcm_hw_params_alloca); */
++MAKE_TYPEDEF(snd_pcm_hw_params_sizeof);
++#define snd_pcm_hw_params_sizeof cubeb_snd_pcm_hw_params_sizeof
++MAKE_TYPEDEF(snd_pcm_hw_params_any);
++MAKE_TYPEDEF(snd_pcm_hw_params_get_channels_max);
++MAKE_TYPEDEF(snd_pcm_hw_params_get_rate);
++MAKE_TYPEDEF(snd_pcm_hw_params_set_rate_near);
++MAKE_TYPEDEF(snd_pcm_nonblock);
++MAKE_TYPEDEF(snd_pcm_open);
++MAKE_TYPEDEF(snd_pcm_open_lconf);
++MAKE_TYPEDEF(snd_pcm_pause);
++MAKE_TYPEDEF(snd_pcm_poll_descriptors);
++MAKE_TYPEDEF(snd_pcm_poll_descriptors_count);
++MAKE_TYPEDEF(snd_pcm_poll_descriptors_revents);
++MAKE_TYPEDEF(snd_pcm_recover);
++MAKE_TYPEDEF(snd_pcm_set_params);
++MAKE_TYPEDEF(snd_pcm_state);
++MAKE_TYPEDEF(snd_pcm_writei);
++
++#undef MAKE_TYPEDEF
++#endif
++
+ /* ALSA is not thread-safe. snd_pcm_t instances are individually protected
+ by the owning cubeb_stream's mutex. snd_pcm_t creation and destruction
+ is not thread-safe until ALSA 1.0.24 (see alsa-lib.git commit 91c9c8f1),
+@@ -64,6 +109,8 @@ struct cubeb {
+ workaround is not required. */
+ snd_config_t * local_config;
+ int is_pa;
++
++ void * libasound;
+ };
+
+ enum stream_state {
+@@ -262,7 +309,7 @@ alsa_refill_stream(cubeb_stream * stm)
+
+ pthread_mutex_lock(&stm->mutex);
+
+- r = snd_pcm_poll_descriptors_revents(stm->pcm, stm->fds, stm->nfds, &revents);
++ r = WRAP(snd_pcm_poll_descriptors_revents)(stm->pcm, stm->fds, stm->nfds, &revents);
+ if (r < 0 || revents != POLLOUT) {
+ /* This should be a stream error; it makes no sense for poll(2) to wake
+ for this stream and then have the stream report that it's not ready.
+@@ -271,10 +318,10 @@ alsa_refill_stream(cubeb_stream * stm)
+ return RUNNING;
+ }
+
+- avail = snd_pcm_avail_update(stm->pcm);
++ avail = WRAP(snd_pcm_avail_update)(stm->pcm);
+ if (avail == -EPIPE) {
+- snd_pcm_recover(stm->pcm, avail, 1);
+- avail = snd_pcm_avail_update(stm->pcm);
++ WRAP(snd_pcm_recover)(stm->pcm, avail, 1);
++ avail = WRAP(snd_pcm_avail_update)(stm->pcm);
+ }
+
+ /* Failed to recover from an xrun, this stream must be broken. */
+@@ -293,8 +340,8 @@ alsa_refill_stream(cubeb_stream * stm)
+ available to write. If avail is still zero here, the stream must be in
+ a funky state, so recover and try again. */
+ if (avail == 0) {
+- snd_pcm_recover(stm->pcm, -EPIPE, 1);
+- avail = snd_pcm_avail_update(stm->pcm);
++ WRAP(snd_pcm_recover)(stm->pcm, -EPIPE, 1);
++ avail = WRAP(snd_pcm_avail_update)(stm->pcm);
+ if (avail <= 0) {
+ pthread_mutex_unlock(&stm->mutex);
+ stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_ERROR);
+@@ -302,7 +349,7 @@ alsa_refill_stream(cubeb_stream * stm)
+ }
+ }
+
+- p = calloc(1, snd_pcm_frames_to_bytes(stm->pcm, avail));
++ p = calloc(1, WRAP(snd_pcm_frames_to_bytes)(stm->pcm, avail));
+ 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);
+ if (wrote == -EPIPE) {
+- snd_pcm_recover(stm->pcm, wrote, 1);
+- wrote = snd_pcm_writei(stm->pcm, p, got);
++ 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;
+@@ -342,7 +389,7 @@ alsa_refill_stream(cubeb_stream * stm)
+
+ /* Fill the remaining buffer with silence to guarantee one full period
+ has been written. */
+- snd_pcm_writei(stm->pcm, (char *) p + got, avail - got);
++ WRAP(snd_pcm_writei)(stm->pcm, (char *) p + got, avail - got);
+
+ set_timeout(&stm->drain_timeout, buffer_time * 1000);
+
+@@ -453,26 +500,26 @@ get_slave_pcm_node(snd_config_t * lconf, snd_config_t * root_pcm)
+
+ slave_def = NULL;
+
+- r = snd_config_search(root_pcm, "slave", &slave_pcm);
++ r = WRAP(snd_config_search)(root_pcm, "slave", &slave_pcm);
+ if (r < 0) {
+ return NULL;
+ }
+
+- r = snd_config_get_string(slave_pcm, &string);
++ r = WRAP(snd_config_get_string)(slave_pcm, &string);
+ if (r >= 0) {
+- r = snd_config_search_definition(lconf, "pcm_slave", string, &slave_def);
++ r = WRAP(snd_config_search_definition)(lconf, "pcm_slave", string, &slave_def);
+ if (r < 0) {
+ return NULL;
+ }
+ }
+
+ do {
+- r = snd_config_search(slave_def ? slave_def : slave_pcm, "pcm", &pcm);
++ r = WRAP(snd_config_search)(slave_def ? slave_def : slave_pcm, "pcm", &pcm);
+ if (r < 0) {
+ break;
+ }
+
+- r = snd_config_get_string(slave_def ? slave_def : slave_pcm, &string);
++ r = WRAP(snd_config_get_string)(slave_def ? slave_def : slave_pcm, &string);
+ if (r < 0) {
+ break;
+ }
+@@ -481,7 +528,7 @@ get_slave_pcm_node(snd_config_t * lconf, snd_config_t * root_pcm)
+ if (r < 0 || r > (int) sizeof(node_name)) {
+ break;
+ }
+- r = snd_config_search(lconf, node_name, &pcm);
++ r = WRAP(snd_config_search)(lconf, node_name, &pcm);
+ if (r < 0) {
+ break;
+ }
+@@ -490,7 +537,7 @@ get_slave_pcm_node(snd_config_t * lconf, snd_config_t * root_pcm)
+ } while (0);
+
+ if (slave_def) {
+- snd_config_delete(slave_def);
++ WRAP(snd_config_delete)(slave_def);
+ }
+
+ return NULL;
+@@ -513,22 +560,22 @@ init_local_config_with_workaround(char const * pcm_name)
+
+ lconf = NULL;
+
+- if (snd_config == NULL) {
++ if (*WRAP(snd_config) == NULL) {
+ return NULL;
+ }
+
+- r = snd_config_copy(&lconf, snd_config);
++ r = WRAP(snd_config_copy)(&lconf, *WRAP(snd_config));
+ if (r < 0) {
+ return NULL;
+ }
+
+ do {
+- r = snd_config_search_definition(lconf, "pcm", pcm_name, &pcm_node);
++ r = WRAP(snd_config_search_definition)(lconf, "pcm", pcm_name, &pcm_node);
+ if (r < 0) {
+ break;
+ }
+
+- r = snd_config_get_id(pcm_node, &string);
++ r = WRAP(snd_config_get_id)(pcm_node, &string);
+ if (r < 0) {
+ break;
+ }
+@@ -537,7 +584,7 @@ init_local_config_with_workaround(char const * pcm_name)
+ if (r < 0 || r > (int) sizeof(node_name)) {
+ break;
+ }
+- r = snd_config_search(lconf, node_name, &pcm_node);
++ r = WRAP(snd_config_search)(lconf, node_name, &pcm_node);
+ if (r < 0) {
+ break;
+ }
+@@ -548,12 +595,12 @@ init_local_config_with_workaround(char const * pcm_name)
+ }
+
+ /* Fetch the PCM node's type, and bail out if it's not the PulseAudio plugin. */
+- r = snd_config_search(pcm_node, "type", &node);
++ r = WRAP(snd_config_search)(pcm_node, "type", &node);
+ if (r < 0) {
+ break;
+ }
+
+- r = snd_config_get_string(node, &string);
++ r = WRAP(snd_config_get_string)(node, &string);
+ if (r < 0) {
+ break;
+ }
+@@ -564,18 +611,18 @@ init_local_config_with_workaround(char const * pcm_name)
+
+ /* Don't clobber an explicit existing handle_underrun value, set it only
+ if it doesn't already exist. */
+- r = snd_config_search(pcm_node, "handle_underrun", &node);
++ r = WRAP(snd_config_search)(pcm_node, "handle_underrun", &node);
+ if (r != -ENOENT) {
+ break;
+ }
+
+ /* Disable pcm_pulse's asynchronous underrun handling. */
+- r = snd_config_imake_integer(&node, "handle_underrun", 0);
++ r = WRAP(snd_config_imake_integer)(&node, "handle_underrun", 0);
+ if (r < 0) {
+ break;
+ }
+
+- r = snd_config_add(pcm_node, node);
++ r = WRAP(snd_config_add)(pcm_node, node);
+ if (r < 0) {
+ break;
+ }
+@@ -583,7 +630,7 @@ init_local_config_with_workaround(char const * pcm_name)
+ return lconf;
+ } while (0);
+
+- snd_config_delete(lconf);
++ WRAP(snd_config_delete)(lconf);
+
+ return NULL;
+ }
+@@ -595,9 +642,9 @@ alsa_locked_pcm_open(snd_pcm_t ** pcm, snd_pcm_stream_t stream, snd_config_t * l
+
+ pthread_mutex_lock(&cubeb_alsa_mutex);
+ if (local_config) {
+- r = snd_pcm_open_lconf(pcm, CUBEB_ALSA_PCM_NAME, stream, SND_PCM_NONBLOCK, local_config);
++ r = WRAP(snd_pcm_open_lconf)(pcm, CUBEB_ALSA_PCM_NAME, stream, SND_PCM_NONBLOCK, local_config);
+ } else {
+- r = snd_pcm_open(pcm, CUBEB_ALSA_PCM_NAME, stream, SND_PCM_NONBLOCK);
++ r = WRAP(snd_pcm_open)(pcm, CUBEB_ALSA_PCM_NAME, stream, SND_PCM_NONBLOCK);
+ }
+ pthread_mutex_unlock(&cubeb_alsa_mutex);
+
+@@ -610,7 +657,7 @@ alsa_locked_pcm_close(snd_pcm_t * pcm)
+ int r;
+
+ pthread_mutex_lock(&cubeb_alsa_mutex);
+- r = snd_pcm_close(pcm);
++ r = WRAP(snd_pcm_close)(pcm);
+ pthread_mutex_unlock(&cubeb_alsa_mutex);
+
+ return r;
+@@ -667,12 +714,65 @@ alsa_init(cubeb ** context, char const * context_name)
+ pthread_attr_t attr;
+ snd_pcm_t * dummy;
+
++ void * libasound = NULL;
++
++#ifndef DISABLE_LIBASOUND_DLOPEN
++ libasound = dlopen("libasound.so", RTLD_LAZY);
++ if (!libasound) {
++ return CUBEB_ERROR;
++ }
++
++#define LOAD(x) do { \
++ cubeb_##x = dlsym(libasound, #x); \
++ if (!cubeb_##x) { \
++ dlclose(libasound); \
++ return CUBEB_ERROR; \
++ } \
++ } while(0)
++
++ LOAD(snd_config);
++ LOAD(snd_config_add);
++ LOAD(snd_config_copy);
++ LOAD(snd_config_delete);
++ LOAD(snd_config_get_id);
++ LOAD(snd_config_get_string);
++ LOAD(snd_config_imake_integer);
++ LOAD(snd_config_search);
++ LOAD(snd_config_search_definition);
++ LOAD(snd_lib_error_set_handler);
++ LOAD(snd_pcm_avail_update);
++ LOAD(snd_pcm_close);
++ LOAD(snd_pcm_delay);
++ LOAD(snd_pcm_drain);
++ LOAD(snd_pcm_frames_to_bytes);
++ LOAD(snd_pcm_get_params);
++ /* snd_pcm_hw_params_alloca is actually a macro */
++ /* LOAD(snd_pcm_hw_params_alloca); */
++ LOAD(snd_pcm_hw_params_sizeof);
++ LOAD(snd_pcm_hw_params_any);
++ LOAD(snd_pcm_hw_params_get_channels_max);
++ LOAD(snd_pcm_hw_params_get_rate);
++ LOAD(snd_pcm_hw_params_set_rate_near);
++ LOAD(snd_pcm_nonblock);
++ LOAD(snd_pcm_open);
++ LOAD(snd_pcm_open_lconf);
++ LOAD(snd_pcm_pause);
++ LOAD(snd_pcm_poll_descriptors);
++ LOAD(snd_pcm_poll_descriptors_count);
++ LOAD(snd_pcm_poll_descriptors_revents);
++ LOAD(snd_pcm_recover);
++ LOAD(snd_pcm_set_params);
++ LOAD(snd_pcm_state);
++ LOAD(snd_pcm_writei);
++
++#undef LOAD
++#endif
+ assert(context);
+ *context = NULL;
+
+ pthread_mutex_lock(&cubeb_alsa_mutex);
+ if (!cubeb_alsa_error_handler_set) {
+- snd_lib_error_set_handler(silent_error_handler);
++ WRAP(snd_lib_error_set_handler)(silent_error_handler);
+ cubeb_alsa_error_handler_set = 1;
+ }
+ pthread_mutex_unlock(&cubeb_alsa_mutex);
+@@ -680,6 +780,8 @@ alsa_init(cubeb ** context, char const * context_name)
+ ctx = calloc(1, sizeof(*ctx));
+ assert(ctx);
+
++ ctx->libasound = libasound;
++
+ ctx->ops = &alsa_ops;
+
+ r = pthread_mutex_init(&ctx->mutex, NULL);
+@@ -729,7 +831,7 @@ alsa_init(cubeb ** context, char const * context_name)
+ config fails with EINVAL, the PA PCM is too old for this workaround. */
+ if (r == -EINVAL) {
+ pthread_mutex_lock(&cubeb_alsa_mutex);
+- snd_config_delete(ctx->local_config);
++ WRAP(snd_config_delete)(ctx->local_config);
+ pthread_mutex_unlock(&cubeb_alsa_mutex);
+ ctx->local_config = NULL;
+ } else if (r >= 0) {
+@@ -768,9 +870,13 @@ alsa_destroy(cubeb * ctx)
+ pthread_mutex_destroy(&ctx->mutex);
+ free(ctx->fds);
+
++ if (ctx->libasound) {
++ dlclose(ctx->libasound);
++ }
++
+ if (ctx->local_config) {
+ pthread_mutex_lock(&cubeb_alsa_mutex);
+- snd_config_delete(ctx->local_config);
++ WRAP(snd_config_delete)(ctx->local_config);
+ pthread_mutex_unlock(&cubeb_alsa_mutex);
+ }
+
+@@ -838,7 +944,7 @@ alsa_stream_init(cubeb * ctx, cubeb_stream ** stream, char const * stream_name,
+ return CUBEB_ERROR;
+ }
+
+- r = snd_pcm_nonblock(stm->pcm, 1);
++ r = WRAP(snd_pcm_nonblock)(stm->pcm, 1);
+ assert(r == 0);
+
+ /* Ugly hack: the PA ALSA plugin allows buffer configurations that can't
+@@ -848,23 +954,23 @@ alsa_stream_init(cubeb * ctx, cubeb_stream ** stream, char const * stream_name,
+ latency = latency < 500 ? 500 : latency;
+ }
+
+- r = snd_pcm_set_params(stm->pcm, format, SND_PCM_ACCESS_RW_INTERLEAVED,
+- stm->params.channels, stm->params.rate, 1,
+- latency * 1000);
++ r = WRAP(snd_pcm_set_params)(stm->pcm, format, SND_PCM_ACCESS_RW_INTERLEAVED,
++ stm->params.channels, stm->params.rate, 1,
++ latency * 1000);
+ if (r < 0) {
+ alsa_stream_destroy(stm);
+ return CUBEB_ERROR_INVALID_FORMAT;
+ }
+
+- r = snd_pcm_get_params(stm->pcm, &stm->buffer_size, &stm->period_size);
++ r = WRAP(snd_pcm_get_params)(stm->pcm, &stm->buffer_size, &stm->period_size);
+ assert(r == 0);
+
+- stm->nfds = snd_pcm_poll_descriptors_count(stm->pcm);
++ stm->nfds = WRAP(snd_pcm_poll_descriptors_count)(stm->pcm);
+ assert(stm->nfds > 0);
+
+ stm->saved_fds = calloc(stm->nfds, sizeof(struct pollfd));
+ assert(stm->saved_fds);
+- r = snd_pcm_poll_descriptors(stm->pcm, stm->saved_fds, stm->nfds);
++ r = WRAP(snd_pcm_poll_descriptors)(stm->pcm, stm->saved_fds, stm->nfds);
+ assert((nfds_t) r == stm->nfds);
+
+ r = pthread_cond_init(&stm->cond, NULL);
+@@ -937,12 +1043,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) {
+ 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) {
+ return CUBEB_ERROR;
+ }
+@@ -962,34 +1068,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) {
+ 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) {
+- 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) {
+ /* There is a default rate: use it. */
+- snd_pcm_close(pcm);
++ WRAP(snd_pcm_close)(pcm);
+ return CUBEB_OK;
+ }
+
+ /* 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) {
+- snd_pcm_close(pcm);
++ WRAP(snd_pcm_close)(pcm);
+ return CUBEB_ERROR;
+ }
+
+- snd_pcm_close(pcm);
++ WRAP(snd_pcm_close)(pcm);
+
+ return CUBEB_OK;
+ }
+@@ -1013,7 +1119,7 @@ alsa_stream_start(cubeb_stream * stm)
+ ctx = stm->context;
+
+ pthread_mutex_lock(&stm->mutex);
+- snd_pcm_pause(stm->pcm, 0);
++ WRAP(snd_pcm_pause)(stm->pcm, 0);
+ gettimeofday(&stm->last_activity, NULL);
+ pthread_mutex_unlock(&stm->mutex);
+
+@@ -1047,7 +1153,7 @@ alsa_stream_stop(cubeb_stream * stm)
+ pthread_mutex_unlock(&ctx->mutex);
+
+ pthread_mutex_lock(&stm->mutex);
+- snd_pcm_pause(stm->pcm, 1);
++ WRAP(snd_pcm_pause)(stm->pcm, 1);
+ pthread_mutex_unlock(&stm->mutex);
+
+ return CUBEB_OK;
+@@ -1063,8 +1169,8 @@ alsa_stream_get_position(cubeb_stream * stm, uint64_t * position)
+ pthread_mutex_lock(&stm->mutex);
+
+ delay = -1;
+- if (snd_pcm_state(stm->pcm) != SND_PCM_STATE_RUNNING ||
+- snd_pcm_delay(stm->pcm, &delay) != 0) {
++ if (WRAP(snd_pcm_state)(stm->pcm) != SND_PCM_STATE_RUNNING ||
++ WRAP(snd_pcm_delay)(stm->pcm, &delay) != 0) {
+ *position = stm->last_position;
+ pthread_mutex_unlock(&stm->mutex);
+ return CUBEB_OK;
+@@ -1089,7 +1195,7 @@ alsa_stream_get_latency(cubeb_stream * stm, uint32_t * latency)
+ snd_pcm_sframes_t delay;
+ /* This function returns the delay in frames until a frame written using
+ snd_pcm_writei is sent to the DAC. The DAC delay should be < 1ms anyways. */
+- if (snd_pcm_delay(stm->pcm, &delay)) {
++ if (WRAP(snd_pcm_delay)(stm->pcm, &delay)) {
+ return CUBEB_ERROR;
+ }
+
+diff --git media/libcubeb/src/cubeb_oss.c media/libcubeb/src/cubeb_oss.c
+new file mode 100644
+index 0000000..5e38e27
+--- /dev/null
++++ mozilla/media/libcubeb/src/cubeb_oss.c
+@@ -0,0 +1,399 @@
++/*
++ * Copyright © 2014 Mozilla Foundation
++ *
++ * This program is made available under an ISC-style license. See the
++ * accompanying file LICENSE for details.
++ */
++#if defined(HAVE_SYS_SOUNDCARD_H)
++#include <sys/soundcard.h>
++#elif defined(HAVE_LINUX_SOUNDCARD_H)
++#include <linux/soundcard.h>
++#else
++#include <soundcard.h>
++#endif
++#include <unistd.h>
++#include <stdlib.h>
++#include <sys/types.h>
++#include <sys/stat.h>
++#include <fcntl.h>
++#include <sys/ioctl.h>
++#include <errno.h>
++#include <pthread.h>
++#include <stdio.h>
++
++#include "cubeb/cubeb.h"
++#include "cubeb-internal.h"
++
++#ifndef CUBEB_OSS_DEFAULT_OUTPUT
++#define CUBEB_OSS_DEFAULT_OUTPUT "/dev/dsp"
++#endif
++
++#define OSS_BUFFER_SIZE 1024
++
++struct cubeb {
++ struct cubeb_ops const * ops;
++};
++
++struct cubeb_stream {
++ cubeb * context;
++
++ cubeb_data_callback data_callback;
++ cubeb_state_callback state_callback;
++ void * user_ptr;
++ float volume;
++ float panning;
++
++ pthread_mutex_t state_mutex;
++ pthread_cond_t state_cond;
++
++ int running;
++ int stopped;
++ int floating;
++
++ /* These two vars are needed to support old versions of OSS */
++ unsigned int position_bytes;
++ unsigned int last_position_bytes;
++
++ uint64_t written_frags; /* The number of fragments written to /dev/dsp */
++ uint64_t missed_frags; /* fragments output with stopped stream */
++
++ cubeb_stream_params params;
++ int fd;
++ pthread_t th;
++};
++
++static struct cubeb_ops const oss_ops;
++
++int oss_init(cubeb ** context, char const * context_name)
++{
++ cubeb* ctx = (cubeb*)malloc(sizeof(cubeb));
++ ctx->ops = &oss_ops;
++ *context = ctx;
++ return CUBEB_OK;
++}
++
++static void oss_destroy(cubeb *ctx)
++{
++ free(ctx);
++}
++
++static char const * oss_get_backend_id(cubeb * context)
++{
++ static char oss_name[] = "oss";
++ return oss_name;
++}
++
++static int oss_get_max_channel_count(cubeb * ctx, uint32_t * max_channels)
++{
++ *max_channels = 2; /* Let's support only stereo for now */
++ return CUBEB_OK;
++}
++
++static int oss_get_min_latency(cubeb * context, cubeb_stream_params params,
++ uint32_t * latency_ms)
++{
++ /* 40ms is a big enough number to work ok */
++ *latency_ms = 40;
++ return CUBEB_OK;
++}
++
++static int oss_get_preferred_sample_rate(cubeb *context, uint32_t * rate)
++{
++ /* 48000 seems a prefered choice for most audio devices
++ * and a good choice for OSS */
++ *rate = 48000;
++ return CUBEB_OK;
++}
++
++static void run_state_callback(cubeb_stream *stream, cubeb_state state)
++{
++ if (stream->state_callback) {
++ stream->state_callback(stream, stream->user_ptr, state);
++ }
++}
++
++static long run_data_callback(cubeb_stream *stream, void *buffer, long nframes)
++{
++ long got = 0;
++ pthread_mutex_lock(&stream->state_mutex);
++ if (stream->data_callback && stream->running && !stream->stopped) {
++ pthread_mutex_unlock(&stream->state_mutex);
++ got = stream->data_callback(stream, stream->user_ptr, buffer, nframes);
++ } else {
++ pthread_mutex_unlock(&stream->state_mutex);
++ }
++ return got;
++}
++
++static void apply_volume(int16_t* buffer, unsigned int n,
++ float volume, float panning)
++{
++ float left = volume;
++ float right = volume;
++ unsigned int i;
++ int pan[2];
++ if (panning<0) {
++ right *= (1+panning);
++ } else {
++ left *= (1-panning);
++ }
++ pan[0] = 128.0*left;
++ pan[1] = 128.0*right;
++ for(i=0; i<n; i++){
++ buffer[i] = ((int)buffer[i])*pan[i%2]/128;
++ }
++}
++
++static void *writer(void *stm)
++{
++ cubeb_stream* stream = (cubeb_stream*)stm;
++ int16_t buffer[OSS_BUFFER_SIZE];
++ float f_buffer[OSS_BUFFER_SIZE];
++ int got;
++ unsigned long i;
++ while (stream->running) {
++ pthread_mutex_lock(&stream->state_mutex);
++ if (stream->stopped) {
++ pthread_mutex_unlock(&stream->state_mutex);
++ run_state_callback(stream, CUBEB_STATE_STOPPED);
++ pthread_mutex_lock(&stream->state_mutex);
++ while (stream->stopped) {
++ pthread_cond_wait(&stream->state_cond, &stream->state_mutex);
++ }
++ pthread_mutex_unlock(&stream->state_mutex);
++ run_state_callback(stream, CUBEB_STATE_STARTED);
++ continue;
++ }
++ pthread_mutex_unlock(&stream->state_mutex);
++ if (stream->floating) {
++ got = run_data_callback(stream, f_buffer,
++ OSS_BUFFER_SIZE/stream->params.channels);
++ for (i=0; i<((unsigned long)got)*stream->params.channels; i++) {
++ buffer[i] = f_buffer[i]*32767.0;
++ }
++ } else {
++ got = run_data_callback(stream, buffer,
++ OSS_BUFFER_SIZE/stream->params.channels);
++ }
++ apply_volume(buffer, got*stream->params.channels,
++ stream->volume, stream->panning);
++ if (got<0) {
++ run_state_callback(stream, CUBEB_STATE_ERROR);
++ break;
++ }
++ if (!got) {
++ run_state_callback(stream, CUBEB_STATE_DRAINED);
++ }
++ if (got) {
++ size_t i = 0;
++ size_t s = got*stream->params.channels*sizeof(int16_t);
++ while (i < s) {
++ ssize_t n = write(stream->fd, ((char*)buffer) + i, s - i);
++ if (n<=0) {
++ run_state_callback(stream, CUBEB_STATE_ERROR);
++ break;
++ }
++ i+=n;
++ }
++ stream->written_frags+=got;
++ }
++ }
++ return NULL;
++}
++
++static void oss_try_set_latency(cubeb_stream* stream, unsigned int latency)
++{
++ unsigned int latency_bytes, n_frag;
++ int frag;
++ /* fragment size of 1024 is a good choice with good chances to be accepted */
++ unsigned int frag_size=1024;
++ unsigned int frag_log=10; /* 2^frag_log = frag_size */
++ latency_bytes =
++ latency*stream->params.rate*stream->params.channels*sizeof(uint16_t)/1000;
++ n_frag = latency_bytes>>frag_log;
++ frag = (n_frag<<16) | frag_log;
++ /* Even if this fails we wish to continue, not checking for errors */
++ ioctl(stream->fd, SNDCTL_DSP_SETFRAGMENT, &frag);
++}
++
++static int oss_stream_init(cubeb * context, cubeb_stream ** stm,
++ char const * stream_name,
++ cubeb_stream_params stream_params,
++ unsigned int latency,
++ cubeb_data_callback data_callback,
++ cubeb_state_callback state_callback, void * user_ptr)
++{
++ cubeb_stream* stream = (cubeb_stream*)malloc(sizeof(cubeb_stream));
++ stream->context = context;
++ stream->data_callback = data_callback;
++ stream->state_callback = state_callback;
++ stream->user_ptr = user_ptr;
++
++ if ((stream->fd = open(CUBEB_OSS_DEFAULT_OUTPUT, O_WRONLY)) == -1) {
++ free(stream);
++ return CUBEB_ERROR;
++ }
++#define SET(what, to) do { unsigned int i = to; \
++ int j = ioctl(stream->fd, what, &i); \
++ if (j == -1 || i != to) { \
++ close(stream->fd); \
++ free(stream); \
++ return CUBEB_ERROR_INVALID_FORMAT; } } while (0)
++
++ stream->params = stream_params;
++ stream->volume = 1.0;
++ stream->panning = 0.0;
++
++ oss_try_set_latency(stream, latency);
++
++ stream->floating = 0;
++ SET(SNDCTL_DSP_CHANNELS, stream_params.channels);
++ SET(SNDCTL_DSP_SPEED, stream_params.rate);
++ switch (stream_params.format) {
++ case CUBEB_SAMPLE_S16LE:
++ SET(SNDCTL_DSP_SETFMT, AFMT_S16_LE);
++ break;
++ case CUBEB_SAMPLE_S16BE:
++ SET(SNDCTL_DSP_SETFMT, AFMT_S16_BE);
++ break;
++ case CUBEB_SAMPLE_FLOAT32LE:
++ SET(SNDCTL_DSP_SETFMT, AFMT_S16_NE);
++ stream->floating = 1;
++ break;
++ default:
++ close(stream->fd);
++ free(stream);
++ return CUBEB_ERROR;
++ }
++
++
++ pthread_mutex_init(&stream->state_mutex, NULL);
++ pthread_cond_init(&stream->state_cond, NULL);
++
++ stream->running = 1;
++ stream->stopped = 1;
++ stream->position_bytes = 0;
++ stream->last_position_bytes = 0;
++ stream->written_frags = 0;
++ stream->missed_frags = 0;
++
++ pthread_create(&stream->th, NULL, writer, (void*)stream);
++
++ *stm = stream;
++
++ return CUBEB_OK;
++}
++
++static void oss_stream_destroy(cubeb_stream * stream)
++{
++ pthread_mutex_lock(&stream->state_mutex);
++
++ stream->running = 0;
++ stream->stopped = 0;
++ pthread_cond_signal(&stream->state_cond);
++
++ pthread_mutex_unlock(&stream->state_mutex);
++
++ pthread_join(stream->th, NULL);
++
++ pthread_mutex_destroy(&stream->state_mutex);
++ pthread_cond_destroy(&stream->state_cond);
++ close(stream->fd);
++ free(stream);
++}
++
++static int oss_stream_get_latency(cubeb_stream * stream, uint32_t * latency)
++{
++ if (ioctl(stream->fd, SNDCTL_DSP_GETODELAY, latency)==-1) {
++ return CUBEB_ERROR;
++ }
++ /* Convert latency from bytes to frames */
++ *latency /= stream->params.channels*sizeof(int16_t);
++ return CUBEB_OK;
++}
++
++
++static int oss_stream_current_optr(cubeb_stream * stream, uint64_t * position)
++{
++ count_info ci;
++ /* Unfortunately, this ioctl is only available in OSS 4.x */
++#ifdef SNDCTL_DSP_CURRENT_OPTR
++ oss_count_t count;
++ if (ioctl(stream->fd, SNDCTL_DSP_CURRENT_OPTR, &count) != -1) {
++ *position = count.samples;// + count.fifo_samples;
++ return CUBEB_OK;
++ }
++#endif
++ /* Fall back to this ioctl in case the previous one fails */
++ if (ioctl(stream->fd, SNDCTL_DSP_GETOPTR, &ci) == -1) {
++ return CUBEB_ERROR;
++ }
++ /* ci.bytes is only 32 bit and will start to wrap after arithmetic overflow */
++ stream->position_bytes += ci.bytes - stream->last_position_bytes;
++ stream->last_position_bytes = ci.bytes;
++ *position = stream->position_bytes/stream->params.channels/sizeof(int16_t);
++ return CUBEB_OK;
++}
++
++static int oss_stream_get_position(cubeb_stream * stream, uint64_t * position)
++{
++ if ( oss_stream_current_optr(stream, position) == CUBEB_OK ){
++ *position -= stream->missed_frags;
++ return CUBEB_OK;
++ }
++ /* If no correct method to get position works we resort to this */
++ *position = stream->written_frags;
++ return CUBEB_OK;
++}
++
++
++static int oss_stream_start(cubeb_stream * stream)
++{
++ pthread_mutex_lock(&stream->state_mutex);
++ if (stream->stopped) {
++ uint64_t ptr;
++ oss_stream_current_optr(stream, &ptr);
++ stream->missed_frags = ptr - stream->written_frags;
++ stream->stopped = 0;
++ pthread_cond_signal(&stream->state_cond);
++ }
++ pthread_mutex_unlock(&stream->state_mutex);
++ return CUBEB_OK;
++}
++
++static int oss_stream_stop(cubeb_stream * stream)
++{
++ pthread_mutex_lock(&stream->state_mutex);
++ stream->stopped = 1;
++ pthread_mutex_unlock(&stream->state_mutex);
++ return CUBEB_OK;
++}
++
++int oss_stream_set_panning(cubeb_stream * stream, float panning)
++{
++ if (stream->params.channels == 2) {
++ stream->panning=panning;
++ }
++ return CUBEB_OK;
++}
++
++int oss_stream_set_volume(cubeb_stream * stream, float volume)
++{
++ stream->volume=volume;
++ return CUBEB_OK;
++}
++
++static struct cubeb_ops const oss_ops = {
++ .init = oss_init,
++ .get_backend_id = oss_get_backend_id,
++ .get_max_channel_count = oss_get_max_channel_count,
++ .get_min_latency = oss_get_min_latency,
++ .get_preferred_sample_rate = oss_get_preferred_sample_rate,
++ .destroy = oss_destroy,
++ .stream_init = oss_stream_init,
++ .stream_destroy = oss_stream_destroy,
++ .stream_start = oss_stream_start,
++ .stream_stop = oss_stream_stop,
++ .stream_get_position = oss_stream_get_position,
++ .stream_get_latency = oss_stream_get_latency
++};
+diff --git media/libcubeb/src/moz.build media/libcubeb/src/moz.build
+index 8b7a0dd..31212ce 100644
+--- mozilla/media/libcubeb/src/moz.build
++++ mozilla/media/libcubeb/src/moz.build
+@@ -17,6 +17,12 @@ if CONFIG['MOZ_ALSA']:
+ ]
+ DEFINES['USE_ALSA'] = True
+
++if CONFIG['MOZ_OSS']:
++ SOURCES += [
++ 'cubeb_oss.c',
++ ]
++ DEFINES['USE_OSS'] = True
++
+ if CONFIG['MOZ_PULSEAUDIO']:
+ SOURCES += [
+ 'cubeb_pulse.c',
+@@ -75,5 +81,6 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
+
+ FAIL_ON_WARNINGS = True
+
++CFLAGS += CONFIG['MOZ_OSS_CFLAGS']
+ CFLAGS += CONFIG['MOZ_ALSA_CFLAGS']
+ CFLAGS += CONFIG['MOZ_PULSEAUDIO_CFLAGS']
+diff --git toolkit/library/libxul.mk toolkit/library/libxul.mk
+index e191f13..4fb268a 100644
+--- mozilla/toolkit/library/libxul.mk
++++ mozilla/toolkit/library/libxul.mk
+@@ -146,6 +146,10 @@ OS_LIBS += $(call EXPAND_LIBNAME,secur32
+ endif
+ endif
+
++ifdef MOZ_OSS
++EXTRA_DSO_LDOPTS += $(MOZ_OSS_LIBS)
++endif
++
+ ifdef MOZ_ALSA
+ EXTRA_DSO_LDOPTS += $(MOZ_ALSA_LIBS)
+ endif
diff --git a/mail/thunderbird/files/patch-bug1073709 b/mail/thunderbird/files/patch-bug1073709
new file mode 100644
index 000000000000..054ed2725747
--- /dev/null
+++ b/mail/thunderbird/files/patch-bug1073709
@@ -0,0 +1,18 @@
+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
+ /*
diff --git a/mail/thunderbird/files/patch-bug1076983 b/mail/thunderbird/files/patch-bug1076983
new file mode 100644
index 000000000000..ff764be7398f
--- /dev/null
+++ b/mail/thunderbird/files/patch-bug1076983
@@ -0,0 +1,45 @@
+commit e10ee74
+Author: Martin Thomson <martin.thomson@gmail.com>
+Date: Tue Oct 14 17:17:35 2014 -0700
+
+ Bug 1076983 - Disabling SSL 3.0 with pref
+---
+ netwerk/base/public/security-prefs.js | 2 +-
+ security/manager/ssl/src/nsNSSComponent.cpp | 7 +++----
+ 2 files changed, 4 insertions(+), 5 deletions(-)
+
+diff --git netwerk/base/public/security-prefs.js netwerk/base/public/security-prefs.js
+index 352552e..c12731b 100644
+--- mozilla/netwerk/base/public/security-prefs.js
++++ mozilla/netwerk/base/public/security-prefs.js
+@@ -2,7 +2,7 @@
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+-pref("security.tls.version.min", 0);
++pref("security.tls.version.min", 1);
+ pref("security.tls.version.max", 3);
+
+ pref("security.ssl.allow_unrestricted_renego_everywhere__temporarily_available_pref", false);
+diff --git security/manager/ssl/src/nsNSSComponent.cpp security/manager/ssl/src/nsNSSComponent.cpp
+index 8cab67b..772959d 100644
+--- mozilla/security/manager/ssl/src/nsNSSComponent.cpp
++++ mozilla/security/manager/ssl/src/nsNSSComponent.cpp
+@@ -829,14 +829,13 @@ void nsNSSComponent::setValidationOptions(bool isInitialSetting,
+ mDefaultCertVerifier = new SharedCertVerifier(odc, osc, ogc, pinningMode);
+ }
+
+-// Enable the TLS versions given in the prefs, defaulting to SSL 3.0 (min
+-// version) and TLS 1.2 (max version) when the prefs aren't set or set to
+-// invalid values.
++// Enable the TLS versions given in the prefs, defaulting to TLS 1.0 (min) and
++// TLS 1.2 (max) when the prefs aren't set or set to invalid values.
+ nsresult
+ nsNSSComponent::setEnabledTLSVersions()
+ {
+ // keep these values in sync with security-prefs.js
+- static const int32_t PSM_DEFAULT_MIN_TLS_VERSION = 0;
++ static const int32_t PSM_DEFAULT_MIN_TLS_VERSION = 1;
+ static const int32_t PSM_DEFAULT_MAX_TLS_VERSION = 3;
+
+ int32_t minVersion = Preferences::GetInt("security.tls.version.min",
diff --git a/mail/thunderbird/files/patch-clang34-disable-stdcall b/mail/thunderbird/files/patch-clang34-disable-stdcall
deleted file mode 100644
index 2b91fba7197f..000000000000
--- a/mail/thunderbird/files/patch-clang34-disable-stdcall
+++ /dev/null
@@ -1,13 +0,0 @@
-# http://llvm.org/bugs/show_bug.cgi?id=19007
-
---- mozilla/xpcom/base/nscore.h~
-+++ mozilla/xpcom/base/nscore.h
-@@ -110,7 +110,7 @@
- * NS_HIDDEN_(int) NS_FASTCALL func2(char *foo);
- */
-
--#if defined(__i386__) && defined(__GNUC__)
-+#if defined(__i386__) && defined(__GNUC__) && !(defined(__clang__) && __clang_major__ == 3 && __clang_minor__ == 4 && __clang_patchlevel__ == 0)
- #define NS_FASTCALL __attribute__ ((regparm (3), stdcall))
- #define NS_CONSTRUCTOR_FASTCALL __attribute__ ((regparm (3), stdcall))
- #elif defined(XP_WIN) && !defined(_WIN64)