aboutsummaryrefslogtreecommitdiff
path: root/mail
diff options
context:
space:
mode:
Diffstat (limited to 'mail')
-rw-r--r--mail/linux-thunderbird/Makefile7
-rw-r--r--mail/linux-thunderbird/distinfo4
-rw-r--r--mail/linux-thunderbird/pkg-plist8
-rw-r--r--mail/thunderbird-i18n/Makefile4
-rw-r--r--mail/thunderbird-i18n/distinfo168
-rw-r--r--mail/thunderbird/Makefile45
-rw-r--r--mail/thunderbird/distinfo8
-rw-r--r--mail/thunderbird/files/extra-bug78053129
-rw-r--r--mail/thunderbird/files/extra-bug88609532
-rw-r--r--mail/thunderbird/files/extra-patch-security_manager_Makefile.in11
-rw-r--r--mail/thunderbird/files/extrapatch-enigmail-ipc-src-Makefile59
-rw-r--r--mail/thunderbird/files/moz_pis_S50cleanhome17
-rw-r--r--mail/thunderbird/files/patch-alsapulse114
-rw-r--r--mail/thunderbird/files/patch-bug68525817
-rw-r--r--mail/thunderbird/files/patch-bug72297561
-rw-r--r--mail/thunderbird/files/patch-bug73234014
-rw-r--r--mail/thunderbird/files/patch-bug7530461207
-rw-r--r--mail/thunderbird/files/patch-bug77807811
-rw-r--r--mail/thunderbird/files/patch-bug78346328
-rw-r--r--mail/thunderbird/files/patch-bug78463152
-rw-r--r--mail/thunderbird/files/patch-bug78699536
-rw-r--r--mail/thunderbird/files/patch-bug78790412
-rw-r--r--mail/thunderbird/files/patch-bug78803948
-rw-r--r--mail/thunderbird/files/patch-bug78810820
-rw-r--r--mail/thunderbird/files/patch-bug788955299
-rw-r--r--mail/thunderbird/files/patch-bug78943627
-rw-r--r--mail/thunderbird/files/patch-bug78965611
-rw-r--r--mail/thunderbird/files/patch-bug789693109
-rw-r--r--mail/thunderbird/files/patch-bug791305384
-rw-r--r--mail/thunderbird/files/patch-bug79136695
-rw-r--r--mail/thunderbird/files/patch-bug799441116
-rw-r--r--mail/thunderbird/files/patch-bug803480102
-rw-r--r--mail/thunderbird/files/patch-bug80613929
-rw-r--r--mail/thunderbird/files/patch-bug807492628
-rw-r--r--mail/thunderbird/files/patch-bug81071627
-rw-r--r--mail/thunderbird/files/patch-bug826985164
-rw-r--r--mail/thunderbird/files/patch-bug82800336
-rw-r--r--mail/thunderbird/files/patch-bug851992373
-rw-r--r--mail/thunderbird/files/patch-bug87615613
-rw-r--r--mail/thunderbird/files/patch-bug87879111
-rw-r--r--mail/thunderbird/files/patch-bug88618111
-rw-r--r--mail/thunderbird/files/patch-bug889699175
-rw-r--r--mail/thunderbird/files/patch-bug893397206
-rw-r--r--mail/thunderbird/files/patch-bug910875102
-rw-r--r--mail/thunderbird/files/patch-bug91621639
-rw-r--r--mail/thunderbird/files/patch-bug91658940
-rw-r--r--mail/thunderbird/files/patch-clang32-libc++-visibility-hack19
-rw-r--r--mail/thunderbird/files/patch-clang3325
-rw-r--r--mail/thunderbird/files/patch-configure.in49
-rw-r--r--mail/thunderbird/files/patch-ldap-sdks-c-sdk-ldap-libraries-libprldap-Makefile.in2
-rw-r--r--mail/thunderbird/files/patch-ldap-sdks-c-sdk-ldap-libraries-libssldap-Makefile.in21
-rw-r--r--mail/thunderbird/files/patch-ldap-xpcom-src-Makefile.in13
-rw-r--r--mail/thunderbird/files/patch-mozilla-config-baseconfig.mk16
-rw-r--r--mail/thunderbird/files/patch-mozilla-ipc-chromium-Makefile.in15
-rw-r--r--mail/thunderbird/files/patch-mozilla-ipc-chromium-src-base-message_pump_libevent.cc4
-rw-r--r--mail/thunderbird/files/patch-mozilla-js-src-methodjit-MethodJIT.cpp20
-rw-r--r--mail/thunderbird/files/patch-mozilla-media-libsydneyaudio-src-sydney_audio_oss.c13
-rw-r--r--mail/thunderbird/files/patch-mozilla-media-webrtc-trunk-src-system_wrappers-source-spreadsortlib-spreadsort.hpp16
-rw-r--r--mail/thunderbird/files/patch-mozilla-toolkit-xre-Makefile.in8
-rw-r--r--mail/thunderbird/files/patch-no-videoio.h22
-rw-r--r--mail/thunderbird/files/patch-z-bug76244570
61 files changed, 2481 insertions, 2841 deletions
diff --git a/mail/linux-thunderbird/Makefile b/mail/linux-thunderbird/Makefile
index 0f43787bd66b..317a8137e03e 100644
--- a/mail/linux-thunderbird/Makefile
+++ b/mail/linux-thunderbird/Makefile
@@ -2,15 +2,16 @@
# $FreeBSD$
PORTNAME= thunderbird
-PORTVERSION= 17.0.8
+DISTVERSION= 24.0
CATEGORIES= mail
-DISTNAME= ${PORTNAME}-${DISTVERSION}esr
-MASTER_SITES= MOZILLA/${PORTNAME}/releases/${PORTVERSION}esr/linux-i686/en-US
+DISTNAME= ${PORTNAME}-${DISTVERSION}
+MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}/linux-i686/en-US
MAINTAINER= gecko@FreeBSD.org
COMMENT= Mozilla Thunderbird is standalone mail and news that stands above
USE_BZIP2= yes
+REPLACE_GRE= yes
USE_LINUX_APPS= dbusglib dbuslibs alsalib alsa-plugins-oss
diff --git a/mail/linux-thunderbird/distinfo b/mail/linux-thunderbird/distinfo
index 969827097198..f36cf9a35bf0 100644
--- a/mail/linux-thunderbird/distinfo
+++ b/mail/linux-thunderbird/distinfo
@@ -1,2 +1,2 @@
-SHA256 (thunderbird-17.0.8esr.tar.bz2) = 50a79b52784c8f7611c5ca491a5668f712485483494a7b3e18030a0cc89eb9bb
-SIZE (thunderbird-17.0.8esr.tar.bz2) = 21488005
+SHA256 (thunderbird-24.0.tar.bz2) = f642a6978cf0c5d1c54b97f86c11e79c8ae2d0a3ee38cff296320a9a5c8911a0
+SIZE (thunderbird-24.0.tar.bz2) = 28964786
diff --git a/mail/linux-thunderbird/pkg-plist b/mail/linux-thunderbird/pkg-plist
index 21ffa4fc1cc6..8fd6c1bbe710 100644
--- a/mail/linux-thunderbird/pkg-plist
+++ b/mail/linux-thunderbird/pkg-plist
@@ -10,18 +10,17 @@ lib/%%APP_NAME%%/chrome/icons/default/default24.png
lib/%%APP_NAME%%/chrome/icons/default/default256.png
lib/%%APP_NAME%%/chrome/icons/default/default32.png
lib/%%APP_NAME%%/chrome/icons/default/default48.png
-lib/%%APP_NAME%%/components/binary.manifest
+lib/%%APP_NAME%%/components/components.manifest
lib/%%APP_NAME%%/components/libdbusservice.so
lib/%%APP_NAME%%/components/libmozgnome.so
lib/%%APP_NAME%%/crashreporter
lib/%%APP_NAME%%/crashreporter.ini
lib/%%APP_NAME%%/defaults/messenger/mailViews.dat
+lib/%%APP_NAME%%/defaults/pref/browser-prefs.js
lib/%%APP_NAME%%/defaults/pref/channel-prefs.js
lib/%%APP_NAME%%/dependentlibs.list
lib/%%APP_NAME%%/dictionaries/en-US.aff
lib/%%APP_NAME%%/dictionaries/en-US.dic
-lib/%%APP_NAME%%/distribution/extensions/tbtestpilot@labs.mozilla.com.xpi
-lib/%%APP_NAME%%/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/chrome.manifest
lib/%%APP_NAME%%/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/icon.png
lib/%%APP_NAME%%/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/install.rdf
lib/%%APP_NAME%%/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/preview.png
@@ -52,7 +51,6 @@ lib/%%APP_NAME%%/libsmime3.so
lib/%%APP_NAME%%/libsoftokn3.chk
lib/%%APP_NAME%%/libsoftokn3.so
lib/%%APP_NAME%%/libssl3.so
-lib/%%APP_NAME%%/libxpcom.so
lib/%%APP_NAME%%/libxul.so
lib/%%APP_NAME%%/mozilla-xremote-client
lib/%%APP_NAME%%/omni.ja
@@ -85,8 +83,6 @@ lib/%%APP_NAME%%/updater.ini
@dirrm lib/%%APP_NAME%%/defaults/pref
@dirrm lib/%%APP_NAME%%/defaults
@dirrm lib/%%APP_NAME%%/dictionaries
-@dirrm lib/%%APP_NAME%%/distribution/extensions
-@dirrm lib/%%APP_NAME%%/distribution
@dirrm lib/%%APP_NAME%%/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}
@dirrm lib/%%APP_NAME%%/extensions
@dirrm lib/%%APP_NAME%%/icons
diff --git a/mail/thunderbird-i18n/Makefile b/mail/thunderbird-i18n/Makefile
index f28e48d9d32a..a39c460debcd 100644
--- a/mail/thunderbird-i18n/Makefile
+++ b/mail/thunderbird-i18n/Makefile
@@ -2,9 +2,9 @@
# $FreeBSD$
PORTNAME= thunderbird-i18n
-PORTVERSION= 17.0.8
+PORTVERSION= 24.0
CATEGORIES= mail
-MASTER_SITES= MOZILLA/${PORTNAME:S|-i18n||}/releases/${PORTVERSION}esr/linux-i686/xpi
+MASTER_SITES= MOZILLA/${PORTNAME:S|-i18n||}/releases/${PORTVERSION}/linux-i686/xpi
PKGNAMEPREFIX=
DISTFILES= ${THUNDERBIRD_I18N_:S/$/.xpi/}
DIST_SUBDIR= xpi/${DISTNAME}
diff --git a/mail/thunderbird-i18n/distinfo b/mail/thunderbird-i18n/distinfo
index 73c7cde80bc2..811a8d3e3c5c 100644
--- a/mail/thunderbird-i18n/distinfo
+++ b/mail/thunderbird-i18n/distinfo
@@ -1,84 +1,84 @@
-SHA256 (xpi/thunderbird-i18n-17.0.8/ar.xpi) = 06aa4989dafac30777a9f1733372038bf27ea6ebe2689bbfb1f32ee84bbce570
-SIZE (xpi/thunderbird-i18n-17.0.8/ar.xpi) = 445976
-SHA256 (xpi/thunderbird-i18n-17.0.8/br.xpi) = 7cec403004e5dfa547452aa3885d6a30711eebfdbeb708897e3be58eb95f038a
-SIZE (xpi/thunderbird-i18n-17.0.8/br.xpi) = 417071
-SHA256 (xpi/thunderbird-i18n-17.0.8/ca.xpi) = 9608970325c28c29e63c6db0c841c84588ec6af39ddbbbc305e18188b2591628
-SIZE (xpi/thunderbird-i18n-17.0.8/ca.xpi) = 418406
-SHA256 (xpi/thunderbird-i18n-17.0.8/cs.xpi) = 4e530ad1281db4f52484ff15d117c49b4204ad6e9c743452d72acb6ee716ae03
-SIZE (xpi/thunderbird-i18n-17.0.8/cs.xpi) = 420626
-SHA256 (xpi/thunderbird-i18n-17.0.8/da.xpi) = cbf06bd93d1244f07974176e13802bd1bf6a81783de6ef598be3011104e60d6a
-SIZE (xpi/thunderbird-i18n-17.0.8/da.xpi) = 398980
-SHA256 (xpi/thunderbird-i18n-17.0.8/de.xpi) = 49e0a19e794d4c3a12d8cee63fd6818583ea3b1c61cd604c62445d6217a8e3a2
-SIZE (xpi/thunderbird-i18n-17.0.8/de.xpi) = 393631
-SHA256 (xpi/thunderbird-i18n-17.0.8/en-GB.xpi) = ff7de06053de1ba904d3020d0706a0f8951127c307ab3c620b580ae72273243f
-SIZE (xpi/thunderbird-i18n-17.0.8/en-GB.xpi) = 390693
-SHA256 (xpi/thunderbird-i18n-17.0.8/en-US.xpi) = f28070ed90bb00befe74dda876194773ff334b16a1eb738847e3a41f5ba58617
-SIZE (xpi/thunderbird-i18n-17.0.8/en-US.xpi) = 390779
-SHA256 (xpi/thunderbird-i18n-17.0.8/es-AR.xpi) = 4976d3892ba2051a5182ab605c6ef9b2d2394cb6474af689fb7c96083070b643
-SIZE (xpi/thunderbird-i18n-17.0.8/es-AR.xpi) = 415498
-SHA256 (xpi/thunderbird-i18n-17.0.8/es-ES.xpi) = 7d0c65387f0d429eaf0f1a9e9cf96a1614378cf4f2c34c4db2fda3981fe777ac
-SIZE (xpi/thunderbird-i18n-17.0.8/es-ES.xpi) = 356860
-SHA256 (xpi/thunderbird-i18n-17.0.8/et.xpi) = fe6475d3fd4e025e4fd907389d522fce86fd9674f32b5f63d9b636503499ce18
-SIZE (xpi/thunderbird-i18n-17.0.8/et.xpi) = 411891
-SHA256 (xpi/thunderbird-i18n-17.0.8/eu.xpi) = f3f2be6e12a2fcad30233c45a700c72ae202802b430b7ba8b2b51c8b7f644f19
-SIZE (xpi/thunderbird-i18n-17.0.8/eu.xpi) = 407189
-SHA256 (xpi/thunderbird-i18n-17.0.8/fi.xpi) = 7a83de772a2b98927835d38a01bb7304149cf5958aff858d1120380f0c1f04b1
-SIZE (xpi/thunderbird-i18n-17.0.8/fi.xpi) = 413619
-SHA256 (xpi/thunderbird-i18n-17.0.8/fr.xpi) = f5b43059ea2e3b3f08087b040abfa0f04f3c51b865fc99b6095f953a14690cb6
-SIZE (xpi/thunderbird-i18n-17.0.8/fr.xpi) = 420825
-SHA256 (xpi/thunderbird-i18n-17.0.8/fy-NL.xpi) = ebc9b148fb7cd63b0225ce3bd6c1da1ff1ba88627fd9c0cb96d86c2618596217
-SIZE (xpi/thunderbird-i18n-17.0.8/fy-NL.xpi) = 415712
-SHA256 (xpi/thunderbird-i18n-17.0.8/ga-IE.xpi) = 095fe84c70d846aeb77ad9dcaf9a2c25096166e2594f85d52af3050ddcbef2ed
-SIZE (xpi/thunderbird-i18n-17.0.8/ga-IE.xpi) = 425394
-SHA256 (xpi/thunderbird-i18n-17.0.8/gd.xpi) = c88bb185f2e863a1114d23d31172ea1aab3a9b4856a6f2c0b4d7fe834af07f50
-SIZE (xpi/thunderbird-i18n-17.0.8/gd.xpi) = 428939
-SHA256 (xpi/thunderbird-i18n-17.0.8/gl.xpi) = e1f1e1745f635eb3a58a32fa466ca96ac913ff8ffc81c31b904ebfd843be21cb
-SIZE (xpi/thunderbird-i18n-17.0.8/gl.xpi) = 410369
-SHA256 (xpi/thunderbird-i18n-17.0.8/he.xpi) = 2e095d156027034db8c7d9ed44a23dade5f872651aed611df3428c05c7a9261d
-SIZE (xpi/thunderbird-i18n-17.0.8/he.xpi) = 439503
-SHA256 (xpi/thunderbird-i18n-17.0.8/hu.xpi) = 959666ffb50493b56db8832a4a4910e8f2839a248b0fe9da30b802fd197f0884
-SIZE (xpi/thunderbird-i18n-17.0.8/hu.xpi) = 433186
-SHA256 (xpi/thunderbird-i18n-17.0.8/is.xpi) = 09bd200fc261a525c42d66451fcd14fd1db4d1e4549d300683e88fb3d9dc6f97
-SIZE (xpi/thunderbird-i18n-17.0.8/is.xpi) = 414067
-SHA256 (xpi/thunderbird-i18n-17.0.8/it.xpi) = 591612ff988180ed4c654b800106d66c318543322d6f64170189abf9244ed6d6
-SIZE (xpi/thunderbird-i18n-17.0.8/it.xpi) = 348620
-SHA256 (xpi/thunderbird-i18n-17.0.8/ja.xpi) = 70bfb44ed2eedf8adb52eec63597fd4c75e0c71ac5616b2a1596132016ca9484
-SIZE (xpi/thunderbird-i18n-17.0.8/ja.xpi) = 463487
-SHA256 (xpi/thunderbird-i18n-17.0.8/ko.xpi) = 39972768c671f80dcb679947b4e4e205effad1006a887a871571efac8d74bff5
-SIZE (xpi/thunderbird-i18n-17.0.8/ko.xpi) = 412963
-SHA256 (xpi/thunderbird-i18n-17.0.8/lt.xpi) = 72aa8c347afc860e47242382e790f991e522d3185d1dcc7b0996118db9885dfd
-SIZE (xpi/thunderbird-i18n-17.0.8/lt.xpi) = 519802
-SHA256 (xpi/thunderbird-i18n-17.0.8/nb-NO.xpi) = 56a06fca489f0d3f001884d2c5d700869f78ab90ca99f4953249db68e7337bae
-SIZE (xpi/thunderbird-i18n-17.0.8/nb-NO.xpi) = 408518
-SHA256 (xpi/thunderbird-i18n-17.0.8/nl.xpi) = 0fb6c31b37d4a80044dede14d66c2e6c1d324cfd636da8cb48e6404d57bf8c09
-SIZE (xpi/thunderbird-i18n-17.0.8/nl.xpi) = 408526
-SHA256 (xpi/thunderbird-i18n-17.0.8/nn-NO.xpi) = fd94eea4d179135ba0603f1b1e73234b1de0ffec9d1c20e4226536fbb8a3efaa
-SIZE (xpi/thunderbird-i18n-17.0.8/nn-NO.xpi) = 431471
-SHA256 (xpi/thunderbird-i18n-17.0.8/pl.xpi) = e556ddf3ff2c4bc426f527bbc8f4ad0a9a2aedc4a9ed97e6de63aa0b0f9e8c8d
-SIZE (xpi/thunderbird-i18n-17.0.8/pl.xpi) = 402114
-SHA256 (xpi/thunderbird-i18n-17.0.8/pt-BR.xpi) = 204e3aacb4afae9dddd554fc7f3d422ca5ee14ba3611d49ca0143114da91f640
-SIZE (xpi/thunderbird-i18n-17.0.8/pt-BR.xpi) = 415777
-SHA256 (xpi/thunderbird-i18n-17.0.8/pt-PT.xpi) = e7f49b3552060eaa264ae80bd8f80342b875810e3c968e1b5e78713035696c27
-SIZE (xpi/thunderbird-i18n-17.0.8/pt-PT.xpi) = 445753
-SHA256 (xpi/thunderbird-i18n-17.0.8/rm.xpi) = 2effe0850bdf4fe6c3155a812e47ef2016b0eaf50f437e899861878cd1187b4f
-SIZE (xpi/thunderbird-i18n-17.0.8/rm.xpi) = 415530
-SHA256 (xpi/thunderbird-i18n-17.0.8/ru.xpi) = 9a9d855d12c59c975a293ca0c3fb9345c51b2108ab24c3b4863fe8d310d14405
-SIZE (xpi/thunderbird-i18n-17.0.8/ru.xpi) = 415707
-SHA256 (xpi/thunderbird-i18n-17.0.8/si.xpi) = 7c4554283aafae7ecbdd7736f46e4ae6d8f3fdd53590b5c94a9dcfa749e00460
-SIZE (xpi/thunderbird-i18n-17.0.8/si.xpi) = 494162
-SHA256 (xpi/thunderbird-i18n-17.0.8/sk.xpi) = 541f4b02312b5e8eec972067e0eca91b76f8d1be75767220813efb2a8e351cd9
-SIZE (xpi/thunderbird-i18n-17.0.8/sk.xpi) = 429755
-SHA256 (xpi/thunderbird-i18n-17.0.8/sl.xpi) = c86f305935aaa443cb3eca302595d401655a3e90dcb3b6b1270de5d9be7ba74a
-SIZE (xpi/thunderbird-i18n-17.0.8/sl.xpi) = 442095
-SHA256 (xpi/thunderbird-i18n-17.0.8/sq.xpi) = a3b6a6dcc81f4a780faa55f9cc7f43030bef80cb2f754d24077cb45ef80f9d51
-SIZE (xpi/thunderbird-i18n-17.0.8/sq.xpi) = 418779
-SHA256 (xpi/thunderbird-i18n-17.0.8/sv-SE.xpi) = 3758e651c99db3325703508d73010d7ca97e1904117ddc29a1132fa168a44e50
-SIZE (xpi/thunderbird-i18n-17.0.8/sv-SE.xpi) = 413217
-SHA256 (xpi/thunderbird-i18n-17.0.8/ta-LK.xpi) = e7e06c7ab1538571b0f71083230cd3d72d6cc2cd16e88268667e5239481a7941
-SIZE (xpi/thunderbird-i18n-17.0.8/ta-LK.xpi) = 517912
-SHA256 (xpi/thunderbird-i18n-17.0.8/tr.xpi) = 5f17ce575f00a08c5abd6536856469d388e9797195e7dadf20e1b3d980e10b91
-SIZE (xpi/thunderbird-i18n-17.0.8/tr.xpi) = 444944
-SHA256 (xpi/thunderbird-i18n-17.0.8/uk.xpi) = 77ea7dcee6ea87dafcf0ea49800c6a4318188ddc9906fca7f57b2e942e238389
-SIZE (xpi/thunderbird-i18n-17.0.8/uk.xpi) = 471142
-SHA256 (xpi/thunderbird-i18n-17.0.8/zh-TW.xpi) = bdda98eaebcd1c8104100002ef1c25db939039e533646f74ffd72b8faf381b10
-SIZE (xpi/thunderbird-i18n-17.0.8/zh-TW.xpi) = 437590
+SHA256 (xpi/thunderbird-i18n-24.0/ar.xpi) = 6e74a6ccb7554a3044df3ea099761f892028748e8441bbdd6f001a4bca5b54d2
+SIZE (xpi/thunderbird-i18n-24.0/ar.xpi) = 457861
+SHA256 (xpi/thunderbird-i18n-24.0/br.xpi) = d93eb0d12d1096ab6cf5876cd49bb2c1803fe868ace230e6cb1f780138202321
+SIZE (xpi/thunderbird-i18n-24.0/br.xpi) = 427679
+SHA256 (xpi/thunderbird-i18n-24.0/ca.xpi) = 51204a0b11204898d9fd5988b93b03834ac641e866d6a61562808ebb5129b5b1
+SIZE (xpi/thunderbird-i18n-24.0/ca.xpi) = 429745
+SHA256 (xpi/thunderbird-i18n-24.0/cs.xpi) = bcb13058eb336687fc88acc448403148575acb42e5b3fa95f8560b030e7f50b9
+SIZE (xpi/thunderbird-i18n-24.0/cs.xpi) = 431475
+SHA256 (xpi/thunderbird-i18n-24.0/da.xpi) = 9e00b6b4a355fac44fccbef39383fa7b87e21403a442e5f7f7f26b22bb4ea531
+SIZE (xpi/thunderbird-i18n-24.0/da.xpi) = 409625
+SHA256 (xpi/thunderbird-i18n-24.0/de.xpi) = ced0f7f53902ed68308f07fbdc006435f07390ca106e9380df90ec692d4931f3
+SIZE (xpi/thunderbird-i18n-24.0/de.xpi) = 408673
+SHA256 (xpi/thunderbird-i18n-24.0/en-GB.xpi) = d7a4e0064220a2c2b20b923038c04e5d0bb9601cea20f95062800cac4007e450
+SIZE (xpi/thunderbird-i18n-24.0/en-GB.xpi) = 400962
+SHA256 (xpi/thunderbird-i18n-24.0/en-US.xpi) = 30e6b0050d0e6a10ebc9cb094143df30325e10b8fea01a90b3a2d4adc697be09
+SIZE (xpi/thunderbird-i18n-24.0/en-US.xpi) = 402143
+SHA256 (xpi/thunderbird-i18n-24.0/es-AR.xpi) = 26ef7475af9e1e5f24486a863d1e5ce2b33be101554681405caeee7b5502918b
+SIZE (xpi/thunderbird-i18n-24.0/es-AR.xpi) = 425656
+SHA256 (xpi/thunderbird-i18n-24.0/es-ES.xpi) = 54162b01cf30faf33fa5e7201e8450e86c516bc73225bfc715db074a05cb977e
+SIZE (xpi/thunderbird-i18n-24.0/es-ES.xpi) = 366307
+SHA256 (xpi/thunderbird-i18n-24.0/et.xpi) = 8f25031f7f968b07029c81149272cf0f5ce1e72bb7945a078911d76d5b4595ff
+SIZE (xpi/thunderbird-i18n-24.0/et.xpi) = 422892
+SHA256 (xpi/thunderbird-i18n-24.0/eu.xpi) = fde5a4fd691b0d2b5d88158c867f5afc559190cb9b4398e80c2160ba882eaa72
+SIZE (xpi/thunderbird-i18n-24.0/eu.xpi) = 418495
+SHA256 (xpi/thunderbird-i18n-24.0/fi.xpi) = ac943ecb5dbdee837c4d488771b265ad5b95caca5fb78b52d2e4b2927da6f7db
+SIZE (xpi/thunderbird-i18n-24.0/fi.xpi) = 424264
+SHA256 (xpi/thunderbird-i18n-24.0/fr.xpi) = 29ab3aa7245390df7daa06adefbd21901d0cd0feedbada0ef6bfddbe7c2a1b3d
+SIZE (xpi/thunderbird-i18n-24.0/fr.xpi) = 431288
+SHA256 (xpi/thunderbird-i18n-24.0/fy-NL.xpi) = b06e11f3258446b2bb0ebd2107cc4e9d898331abd83b2ef98c9515703280ad19
+SIZE (xpi/thunderbird-i18n-24.0/fy-NL.xpi) = 426097
+SHA256 (xpi/thunderbird-i18n-24.0/ga-IE.xpi) = ee5814995fd15ce793c40cd9b5a1373e53c062ab1d48bd5462dd00a40502de9c
+SIZE (xpi/thunderbird-i18n-24.0/ga-IE.xpi) = 437113
+SHA256 (xpi/thunderbird-i18n-24.0/gd.xpi) = 0216577662f777e651fc4d811c02f1a230ab580d6a205e4035b227f772d39e41
+SIZE (xpi/thunderbird-i18n-24.0/gd.xpi) = 440091
+SHA256 (xpi/thunderbird-i18n-24.0/gl.xpi) = f2534c5c4dab6e95789b4eec759429dd450fbeaa7ac68126319e4eb65f1e13d8
+SIZE (xpi/thunderbird-i18n-24.0/gl.xpi) = 427541
+SHA256 (xpi/thunderbird-i18n-24.0/he.xpi) = 080ffd99b20800b2c798cfb8891d56e64908745af439b0fe4653cc28120c90d9
+SIZE (xpi/thunderbird-i18n-24.0/he.xpi) = 457064
+SHA256 (xpi/thunderbird-i18n-24.0/hu.xpi) = 9d14de0cefcf099f12a767a5703e2687c805713e1e5489931c2c29295bf2f514
+SIZE (xpi/thunderbird-i18n-24.0/hu.xpi) = 441511
+SHA256 (xpi/thunderbird-i18n-24.0/is.xpi) = ed00dade105c0656f5dd51d027f18ac902d24a5073988c339401a6f443e5d062
+SIZE (xpi/thunderbird-i18n-24.0/is.xpi) = 425710
+SHA256 (xpi/thunderbird-i18n-24.0/it.xpi) = 51767e8fb90a46432862e24de5bfd34ec8cda786859f6b3d9e1a08d2fa0256e2
+SIZE (xpi/thunderbird-i18n-24.0/it.xpi) = 357932
+SHA256 (xpi/thunderbird-i18n-24.0/ja.xpi) = cf3332bd773a119fabc993cef4a56f1e0235d4f881deb7437025404e2a7fba3b
+SIZE (xpi/thunderbird-i18n-24.0/ja.xpi) = 475558
+SHA256 (xpi/thunderbird-i18n-24.0/ko.xpi) = 420b7ae6ce2b01b8e5458f3c4c89c9b425aabb8307487f7a37111ddb2c10b547
+SIZE (xpi/thunderbird-i18n-24.0/ko.xpi) = 428069
+SHA256 (xpi/thunderbird-i18n-24.0/lt.xpi) = 39102843525cae3a387fadb7f705d6c67b3a64bd0ca0aed9ade34ae261c536bc
+SIZE (xpi/thunderbird-i18n-24.0/lt.xpi) = 443259
+SHA256 (xpi/thunderbird-i18n-24.0/nb-NO.xpi) = 05f337bfecef422add4442566c549af97c803b779ce09eeebe60868e58a5e7da
+SIZE (xpi/thunderbird-i18n-24.0/nb-NO.xpi) = 418921
+SHA256 (xpi/thunderbird-i18n-24.0/nl.xpi) = e9025ece687f11db08b7d8b1ebc45a1a4ee4d4b99277a3fd047af7f54e21a20d
+SIZE (xpi/thunderbird-i18n-24.0/nl.xpi) = 418763
+SHA256 (xpi/thunderbird-i18n-24.0/nn-NO.xpi) = 0e8e2d44b6c0fa3023ac6ab1eeddc77dbd2d0577e915eaa7520ed154f89b1ce2
+SIZE (xpi/thunderbird-i18n-24.0/nn-NO.xpi) = 421133
+SHA256 (xpi/thunderbird-i18n-24.0/pl.xpi) = f23f0dd3a8c5a066ac413a64700a15155e674b64e8d10be031a0a632410f1b25
+SIZE (xpi/thunderbird-i18n-24.0/pl.xpi) = 401751
+SHA256 (xpi/thunderbird-i18n-24.0/pt-BR.xpi) = 8230c94b5d999b9dfc2492b5e322615893763d31881e67f87c931f5d2bf1251c
+SIZE (xpi/thunderbird-i18n-24.0/pt-BR.xpi) = 430907
+SHA256 (xpi/thunderbird-i18n-24.0/pt-PT.xpi) = f95d600c78e5b80f9bceaf70b47af007be292c6c699c2d6b7391c01a8d4ea56c
+SIZE (xpi/thunderbird-i18n-24.0/pt-PT.xpi) = 425024
+SHA256 (xpi/thunderbird-i18n-24.0/rm.xpi) = 07de2de69ffe373dc4328968cc5732526952b4611816372093b4ef384c6d689f
+SIZE (xpi/thunderbird-i18n-24.0/rm.xpi) = 432383
+SHA256 (xpi/thunderbird-i18n-24.0/ru.xpi) = 4e552902034381abb9823648a4f43f6923b4c2d1f0c17a306094238ce1a74e2b
+SIZE (xpi/thunderbird-i18n-24.0/ru.xpi) = 425097
+SHA256 (xpi/thunderbird-i18n-24.0/si.xpi) = 92a93c4ac2e6c1407a86f478d0092e7c5ede6d6b51ae1a9d5fad116f57ec57b4
+SIZE (xpi/thunderbird-i18n-24.0/si.xpi) = 511166
+SHA256 (xpi/thunderbird-i18n-24.0/sk.xpi) = 73619d1dc30e824ef3416975871e3ad0624f7523da5be4eb40beb3d1121bc018
+SIZE (xpi/thunderbird-i18n-24.0/sk.xpi) = 440105
+SHA256 (xpi/thunderbird-i18n-24.0/sl.xpi) = 4c662abae741f474f08cda52ba82a465d24f730845a67d7cbac0ab278801b92f
+SIZE (xpi/thunderbird-i18n-24.0/sl.xpi) = 421705
+SHA256 (xpi/thunderbird-i18n-24.0/sq.xpi) = d3356e40709d5ac8299f163737d537f7fbb7ea1942a64faa2b34d4dcaae7a2b2
+SIZE (xpi/thunderbird-i18n-24.0/sq.xpi) = 435214
+SHA256 (xpi/thunderbird-i18n-24.0/sv-SE.xpi) = e91988e86316d0b6a4fc660f17ab9efb3141d293453adbf63dd81978bf488eaa
+SIZE (xpi/thunderbird-i18n-24.0/sv-SE.xpi) = 423814
+SHA256 (xpi/thunderbird-i18n-24.0/ta-LK.xpi) = d1d7ba9affb29e8afd8fca1261313c3f14c414086e30754e4c3da2bef4962ab6
+SIZE (xpi/thunderbird-i18n-24.0/ta-LK.xpi) = 534922
+SHA256 (xpi/thunderbird-i18n-24.0/tr.xpi) = d1ff4e9bbd39d37d9b2c80f05a8df011ac64a3c24c090526822ca2965e3aceab
+SIZE (xpi/thunderbird-i18n-24.0/tr.xpi) = 438066
+SHA256 (xpi/thunderbird-i18n-24.0/uk.xpi) = 8d4c56288be58f392436b8f123aa8696bf81d8f6712fbebe95659659cf1a307f
+SIZE (xpi/thunderbird-i18n-24.0/uk.xpi) = 480948
+SHA256 (xpi/thunderbird-i18n-24.0/zh-TW.xpi) = a0c8877af5dfd9b7b3add1626e3fa01ddaac7b7648fbc1dbd23eb1f0660da537
+SIZE (xpi/thunderbird-i18n-24.0/zh-TW.xpi) = 450000
diff --git a/mail/thunderbird/Makefile b/mail/thunderbird/Makefile
index 800b0113dccc..798821f4b873 100644
--- a/mail/thunderbird/Makefile
+++ b/mail/thunderbird/Makefile
@@ -2,26 +2,30 @@
# $FreeBSD$
PORTNAME= thunderbird
-DISTVERSION= 17.0.8
+DISTVERSION= 24.0
CATEGORIES= mail ipv6
-MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}esr/source
-DISTFILES= ${PORTNAME}-${DISTVERSION}esr.source${EXTRACT_SUFX}
-EXTRACT_ONLY= ${PORTNAME}-${DISTVERSION}esr.source${EXTRACT_SUFX}
+MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source
+DISTFILES= ${PORTNAME}-${DISTVERSION}.source${EXTRACT_SUFX}
+EXTRACT_ONLY= ${PORTNAME}-${DISTVERSION}.source${EXTRACT_SUFX}
MAINTAINER= gecko@FreeBSD.org
COMMENT= Mozilla Thunderbird is standalone mail and news that stands above
-BUILD_DEPENDS= nspr>=4.9.2:${PORTSDIR}/devel/nspr \
- nss>=3.13.6_1:${PORTSDIR}/security/nss \
- sqlite3>=3.7.13:${PORTSDIR}/databases/sqlite3 \
+BUILD_DEPENDS= nspr>=4.10:${PORTSDIR}/devel/nspr \
+ nss>=3.15:${PORTSDIR}/security/nss \
+ sqlite3>=3.7.16.1:${PORTSDIR}/databases/sqlite3 \
${PYTHON_PKGNAMEPREFIX}sqlite3>0:${PORTSDIR}/databases/py-sqlite3 \
cairo>=1.10.2_1,1:${PORTSDIR}/graphics/cairo \
+ v4l_compat>0:${PORTSDIR}/multimedia/v4l_compat \
unzip:${PORTSDIR}/archivers/unzip
+LIB_DEPENDS= libv4l2.so:${PORTSDIR}/multimedia/libv4l
-EM_VERSION= 1.5.1
+EM_VERSION= 1.5.2
+L_VERSION= 2.6b3
USE_AUTOTOOLS= autoconf213:env
USE_PYTHON_BUILD=-2.7
+OBJDIR_BUILD= # in-tree build broken after bug 789837
USE_GECKO= gecko
USE_MOZILLA= # empty
@@ -29,10 +33,9 @@ WANT_GNOME= yes
USE_QT4= # empty
QT_NONSTANDARD= yes
ALL_TARGET= default
-GNU_CONFIGURE= yes
USE_BZIP2= yes
-USES= gmake pkgconfig
USE_GL= gl
+USE_DOS2UNIX= mozilla/media/webrtc/trunk/webrtc/system_wrappers/source/spreadsortlib/spreadsort.hpp
MOZ_PROTOCOLS= http,ftp,file,viewsource,res,data,wyciwyg,websocket
MOZ_OPTIONS= --program-transform-name='s/thunderbird/${MOZILLA}/' \
@@ -51,19 +54,30 @@ MOZ_PIS_SCRIPTS=moz_pis_S50cleanhome
OPTIONS_DEFINE= ENIGMAIL LIGHTNING
OPTIONS_DEFAULT=ENIGMAIL LIGHTNING
+# non-client.mk objdir build broken after bug 846540
+.undef GNU_CONFIGURE
+ALL_TARGET= build
+MAKEFILE= ${WRKSRC}/client.mk
+
.include "${.CURDIR}/../../www/firefox/Makefile.options"
-OPTIONS_DEFAULT:=${OPTIONS_DEFAULT:S/ALSA/OSS/}
+# OSS is gone after bug 852401
+OPTIONS_SINGLE_AUDIO:=${OPTIONS_SINGLE_AUDIO:S/OSS//}
.include <bsd.port.pre.mk>
-WRKSRC= ${WRKDIR}/comm-esr17
+WRKSRC= ${WRKDIR}/comm-esr24
MOZSRC:= ${WRKSRC}/mozilla
XPI_LIBDIR= ${PREFIX}/lib/xpi
+# libprldap60.so: Undefined symbol "PR_GetCurrentThread"
+.if ${ARCH} == i386
+USE_GCC?= yes
+.endif
+
.if ${PORT_OPTIONS:MENIGMAIL}
-MASTER_SITES+= http://www.enigmail.net/download/source/:enigmail
+MASTER_SITES+= https://www.enigmail.net/download/source/:enigmail
DISTFILES+= ${EM_DISTFILE}:enigmail
RUN_DEPENDS+= gpg:${PORTSDIR}/security/gnupg
EM_DISTNAME= enigmail-${EM_VERSION}
@@ -75,13 +89,14 @@ EM_ID_RFILES= ${XPI_LIBDIR}/${EM_ID}/install.rdf \
${XPI_LIBDIR}/${EM_ID}/components/enigmail.js \
${XPI_LIBDIR}/${EM_ID}/modules/enigmailCommon.jsm
EXTRA_PATCHES+= ${FILESDIR}/extrapatch-enigmail-ipc-src-Makefile
+EXTRA_PATCHES+= ${FILESDIR}/extra-bug886095
.endif
.if ${PORT_OPTIONS:MLIGHTNING}
MOZ_OPTIONS+= --enable-calendar
MOZ_MK_OPTIONS+= MOZ_CO_PROJECT=calendar
LIGHTNING_DIR= share/lightning
-XPI_FILE= ${MOZ_OBJDIR}/mozilla/dist/xpi-stage/lightning.xpi
+XPI_FILE= ${MOZ_OBJDIR}/mozilla/dist/xpi-stage/lightning-${L_VERSION}.en-US.${OPSYS:L}${OSREL}-${ARCH:S/amd64/x86_64/}.xpi
XPI_ORIG_ID= {e2fda1a4-762b-4020-b5ad-a41df1933103}
XPI_ID= lightning@thunderbird.mozilla.org
.else
@@ -97,6 +112,8 @@ post-extract:
.endif
post-patch:
+ @${REINPLACE_CMD} -e '/MOZPNG/s/=[0-9]*/=10511/' \
+ ${MOZSRC}/configure.in ${WRKSRC}/configure.in
@${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
${WRKSRC}/mail/app/nsMailApp.cpp
.if ${PORT_OPTIONS:MENIGMAIL}
diff --git a/mail/thunderbird/distinfo b/mail/thunderbird/distinfo
index a48ae8137937..d8baa121cfe5 100644
--- a/mail/thunderbird/distinfo
+++ b/mail/thunderbird/distinfo
@@ -1,4 +1,4 @@
-SHA256 (thunderbird-17.0.8esr.source.tar.bz2) = 6e9f5899f97a6efd11b231909d534b2dec40502a20e1ab06eb12a4953e3deb54
-SIZE (thunderbird-17.0.8esr.source.tar.bz2) = 113699743
-SHA256 (enigmail-1.5.1.tar.gz) = 234ca3c8f7c74afb64ebdaa4762e358f35a72c1f8de007b992497fc2db803af0
-SIZE (enigmail-1.5.1.tar.gz) = 1213954
+SHA256 (thunderbird-24.0.source.tar.bz2) = 60a1abde987a61c8096e431f13df2ba2cf188a22fdbf1712aaec795b302a5ff5
+SIZE (thunderbird-24.0.source.tar.bz2) = 140334722
+SHA256 (enigmail-1.5.2.tar.gz) = f20d6d1be1ab12dc2f1208d8f01227fd7e5c4dcf5d6f4bd0833a932b58973a26
+SIZE (enigmail-1.5.2.tar.gz) = 1211395
diff --git a/mail/thunderbird/files/extra-bug780531 b/mail/thunderbird/files/extra-bug780531
index cbb71630e9a8..5468f16c3be7 100644
--- a/mail/thunderbird/files/extra-bug780531
+++ b/mail/thunderbird/files/extra-bug780531
@@ -1,13 +1,24 @@
--- mozilla/configure.in~
+++ mozilla/configure.in
-@@ -5151,8 +5148,8 @@ fi
+@@ -5364,15 +5364,18 @@ AC_SUBST(MOZ_SRTP)
- AC_SUBST(MOZ_WEBRTC)
-
--case "$target_cpu" in
--arm*)
+ dnl Use integers over floats for audio on B2G and Android, because audio
+ dnl backends for those platforms don't support floats.
+-if test "$OS_TARGET" = "Android"; then
+case "$target" in
-+arm-*-linux*|*-dragonfly*|*-freebsd*|*-netbsd*|*-openbsd*)
- MOZ_SAMPLE_TYPE_S16LE=1
- AC_DEFINE(MOZ_SAMPLE_TYPE_S16LE)
- AC_SUBST(MOZ_SAMPLE_TYPE_S16LE)
++*-android*|*-linuxandroid*|*-dragonfly*|*-freebsd*|*-netbsd*|*-openbsd*)
+ MOZ_SAMPLE_TYPE_S16=1
+ AC_DEFINE(MOZ_SAMPLE_TYPE_S16)
+ AC_SUBST(MOZ_SAMPLE_TYPE_S16)
+-else
++;;
++*)
+ MOZ_SAMPLE_TYPE_FLOAT32=1
+ AC_DEFINE(MOZ_SAMPLE_TYPE_FLOAT32)
+ AC_SUBST(MOZ_SAMPLE_TYPE_FLOAT32)
+-fi
++;;
++esac
+
+ dnl ========================================================
+ dnl = Disable Speech API code
diff --git a/mail/thunderbird/files/extra-bug886095 b/mail/thunderbird/files/extra-bug886095
new file mode 100644
index 000000000000..d72ace7c04e6
--- /dev/null
+++ b/mail/thunderbird/files/extra-bug886095
@@ -0,0 +1,32 @@
+diff --git genxpi genxpi
+index a50e7ab..6083c55 100755
+--- mailnews/extensions/enigmail/genxpi~
++++ mailnews/extensions/enigmail/genxpi
+@@ -74,16 +74,17 @@ if [ ${platform} = OS2_x86-gcc3 ]; then
+ else
+ enigDllFile=platform/${platform}/components/${libPrefix}enigmime-${xpcomAbi}${dllSuffix}
+ fi
+
+ subprocessDll=${libPrefix}subprocess${dllSuffix}
+ spDllFile=platform/${platform}/lib/${libPrefix}subprocess-${xpcomAbi}${dllSuffix}
+
+ # Prepare chrome.manifest
++cp ${targetDir}/chrome.manifest ${targetDir}/chrome.manifest.save
+ cat ${srcDir}/package/chrome.manifest | \
+ sed 's/##ENIGMIMEDLL-PLACEHOLDER##/binary-component platform\/'${platform}'\/components\/'`basename ${enigDllFile}`' ABI='${platform}'/' \
+ > ${targetDir}/chrome.manifest
+
+ # Prepare languages other than en-US
+
+ if [ -s ${srcDir}/lang/current-languages.txt ]; then
+ localeJar=chrome/${xpiModule}.jar
+@@ -147,8 +148,9 @@ zip ${xpiFile} \
+ ${localeJar} \
+ components/enigmime.xpt \
+ ${enigDllFile} \
+ ${spDllFile} \
+ chrome.manifest \
+ install.rdf
+
+ rm install.rdf chrome.manifest
++mv chrome.manifest.save chrome.manifest
diff --git a/mail/thunderbird/files/extra-patch-security_manager_Makefile.in b/mail/thunderbird/files/extra-patch-security_manager_Makefile.in
new file mode 100644
index 000000000000..c936ae46850d
--- /dev/null
+++ b/mail/thunderbird/files/extra-patch-security_manager_Makefile.in
@@ -0,0 +1,11 @@
+--- security/manager/Makefile.in.orig.patched Thu May 25 10:19:22 2006
++++ security/manager/Makefile.in Thu May 25 10:19:22 2006
+@@ -159,8 +159,6 @@
+ $(MAKE) -C $(topsrcdir)/security/coreconf $(DEFAULT_GMAKE_FLAGS)
+ ifeq ($(OS_ARCH),WINNT)
+ cd $(DIST)/lib; cp -f $(LIB_PREFIX)dbm$(MOZ_BITS).$(LIB_SUFFIX) $(LIB_PREFIX)dbm.$(LIB_SUFFIX)
+-else
+- cd $(DIST)/lib; cp -f $(LIB_PREFIX)mozdbm_s.$(LIB_SUFFIX) $(LIB_PREFIX)dbm.$(LIB_SUFFIX); $(RANLIB) $(LIB_PREFIX)dbm.$(LIB_SUFFIX)
+ endif
+ # $(MAKE) -C $(topsrcdir)/security/nss/lib $(DEFAULT_GMAKE_FLAGS)
+ ifndef SKIP_CHK
diff --git a/mail/thunderbird/files/extrapatch-enigmail-ipc-src-Makefile b/mail/thunderbird/files/extrapatch-enigmail-ipc-src-Makefile
index d8b5128d02b4..55071518aaf1 100644
--- a/mail/thunderbird/files/extrapatch-enigmail-ipc-src-Makefile
+++ b/mail/thunderbird/files/extrapatch-enigmail-ipc-src-Makefile
@@ -1,6 +1,6 @@
--- mailnews/extensions/enigmail/ipc/src/Makefile.enig~
+++ mailnews/extensions/enigmail/ipc/src/Makefile.enig
-@@ -19,26 +19,26 @@ endif
+@@ -19,13 +19,13 @@ endif
ifeq ($(OS_ARCH),NetBSD)
ifeq ($(DLL_SUFFIX),.so.1.0)
@@ -16,50 +16,7 @@
CFLAGS += -fPIC
endif
- ifeq ($(OS_ARCH),HP-UX)
- ifeq ($(GNU_CC)$(GNU_CXX),)
--LDFLAGS += -Wl,-Bsymbolic
-+LDFLAGS += -shared -Wl,-Bsymbolic
- CFLAGS += -fPIC
- endif
- endif
-
- ifeq ($(OS_ARCH),OSF1)
- ifeq ($(GNU_CC)$(GNU_CXX),)
--LDFLAGS += -B symbolic
-+LDFLAGS += -shared -B symbolic
- CFLAGS += -fPIC
- endif
- endif
-@@ -62,7 +62,11 @@ libs: source
- $(CC) $(LDFLAGS) -o $(libname) $(objfiles)
-
- source: $(source)
-+ifneq (,$(filter 4.2.%, $(CC_VERSION)))
-+ $(CC) $(CFLAGS) -c -o $(objfiles) $^
-+else
- $(CC) $(CFLAGS) -Wno-return-type-c-linkage -c -o $(objfiles) $^
-+endif
-
-
- clean:
---- mailnews/extensions/enigmail/ipc/src/Makefile.in~
-+++ mailnews/extensions/enigmail/ipc/src/Makefile.in
-@@ -19,26 +19,26 @@ endif
-
- ifeq ($(OS_ARCH),NetBSD)
- ifeq ($(DLL_SUFFIX),.so.1.0)
--LDFLAGS += -Wl,-Bsymbolic
-+LDFLAGS += -shared -Wl,-Bsymbolic
- CFLAGS += -fPIC
- endif
- endif
-
- ifeq ($(OS_ARCH),FreeBSD)
--LDFLAGS += -Wl,-Bsymbolic
-+LDFLAGS += -shared -Wl,-Bsymbolic
- CFLAGS += -fPIC
- endif
+@@ -36,14 +36,14 @@ endif
ifeq ($(OS_ARCH),HP-UX)
ifeq ($(GNU_CC)$(GNU_CXX),)
@@ -76,15 +33,3 @@
CFLAGS += -fPIC
endif
endif
-@@ -62,7 +62,11 @@ libs: source
- $(CC) $(LDFLAGS) -o $(libname) $(objfiles)
-
- source: $(source)
-+ifneq (,$(filter 4.2.%, $(CC_VERSION)))
-+ $(CC) $(CFLAGS) -c -o $(objfiles) $^
-+else
- $(CC) $(CFLAGS) -Wno-return-type-c-linkage -c -o $(objfiles) $^
-+endif
-
-
- clean:
diff --git a/mail/thunderbird/files/moz_pis_S50cleanhome b/mail/thunderbird/files/moz_pis_S50cleanhome
index 348592392043..3de5565e39f2 100644
--- a/mail/thunderbird/files/moz_pis_S50cleanhome
+++ b/mail/thunderbird/files/moz_pis_S50cleanhome
@@ -2,7 +2,8 @@
#
# S50cleanhome
-# a script to polite ${HOME}/${MOZ_PIS_USER_DIR}
+# a script to clean up users' Mozilla home directories to make upgrading
+# less painful.
# We run in our own subshell
@@ -13,22 +14,18 @@
[ -z "${HOME}" -o ! -d "${HOME}" ] && exit 1
[ -z "${MOZ_PIS_USER_DIR}" -o ! -d "${HOME}/${MOZ_PIS_USER_DIR}" ] && exit 1
-# Try to polite ${HOME}/${MOZ_PIS_USER_DIR}
+# Try to cleanup ${HOME}/${MOZ_PIS_USER_DIR}
-# This must be really needed?
-# rm -f "${$HOME}/${MOZ_PIS_USER_DIR}/pluginreg.dat"
-
-# Try to polite profile dirs
if [ -f "${HOME}/${MOZ_PIS_USER_DIR}/profiles.ini" ]; then
sed -e '/Path=/! d' -e "s,Path=,${HOME}/${MOZ_PIS_USER_DIR}/," \
- "${HOME}/${MOZ_PIS_USER_DIR}/profiles.ini" \
+ "${HOME}/${MOZ_PIS_USER_DIR}/profiles.ini" \
| while read dir
do
[ ! -d "${dir}" ] && continue
- # at last, debian do this, we do for new builds
+ # Debian does this for new builds
# rm -f "${dir}/XUL.mfasl"
- # make reclaculate compreg.dat, xpti.dat for new builds
+ # force a rebuild of compreg.dat and xpti.dat for new installations
[ "${dir}/compreg.dat" -ot "${MOZ_PIS_MOZBINDIR}/components.ini" ] &&
- rm -f "${dir}/compatibility.ini" "${dir}/XUL.mfasl"
+ rm -f "${dir}/compatibility.ini" "${dir}/XUL.mfasl"
done
fi
diff --git a/mail/thunderbird/files/patch-alsapulse b/mail/thunderbird/files/patch-alsapulse
deleted file mode 100644
index 6dbc3227711c..000000000000
--- a/mail/thunderbird/files/patch-alsapulse
+++ /dev/null
@@ -1,114 +0,0 @@
-diff --git mozilla/configure.in mozilla/configure.in
-index 5980b76..11f5f77 100644
---- mozilla/configure.in
-+++ mozilla/configure.in
-@@ -5600,13 +5600,25 @@ dnl ========================================================
- dnl = Check alsa availability on Linux if using sydneyaudio
- dnl ========================================================
-
-+MOZ_ARG_ENABLE_BOOL(alsa,
-+[ --enable-alsa Enable Alsa support (default on Linux)],
-+MOZ_ALSA=1,
-+MOZ_ALSA= MOZ_ALSA_FORCE=$enableval)
-+
- dnl If using sydneyaudio with Linux, ensure that the alsa library is available
--if test -n "$MOZ_SYDNEYAUDIO" -a "$OS_TARGET" = "Linux"; then
-+if test -n "$MOZ_SYDNEYAUDIO" -a "$OS_TARGET" = "Linux" -a "$MOZ_ALSA_FORCE" != "no"; then
-+ MOZ_ALSA=1
-+fi
-+
-+if test -n "$MOZ_ALSA"; then
-+ AC_DEFINE(MOZ_CUBEB)
- PKG_CHECK_MODULES(MOZ_ALSA, alsa, ,
- [echo "$MOZ_ALSA_PKG_ERRORS"
- AC_MSG_ERROR([Need alsa for Ogg, Wave or WebM decoding on Linux. Disable with --disable-ogg --disable-wave --disable-webm. (On Ubuntu, you might try installing the package libasound2-dev.)])])
- fi
-
-+AC_SUBST(MOZ_ALSA)
-+
- dnl ========================================================
- dnl = Enable PulseAudio
- dnl ========================================================
-diff --git mozilla/media/libcubeb/src/Makefile.in mozilla/media/libcubeb/src/Makefile.in
-index 5ab4dd8..c8df26f 100644
---- mozilla/media/libcubeb/src/Makefile.in
-+++ mozilla/media/libcubeb/src/Makefile.in
-@@ -24,10 +24,6 @@ endif
-
- ifeq ($(OS_TARGET),Android)
- # No Android implementation of libcubeb yet.
--else ifeq ($(OS_TARGET),Linux)
--CSRCS = \
-- cubeb_alsa.c \
-- $(NULL)
- endif
-
- ifeq ($(OS_TARGET),Darwin)
-@@ -42,6 +38,12 @@ CSRCS = \
- $(NULL)
- endif
-
-+ifdef MOZ_ALSA
-+CSRCS = \
-+ cubeb_alsa.c \
-+ $(NULL)
-+endif
-+
- ifdef MOZ_PULSEAUDIO
- CSRCS = \
- cubeb_pulse.c \
-diff --git mozilla/media/libsydneyaudio/src/Makefile.in mozilla/media/libsydneyaudio/src/Makefile.in
-index 8dda8ce..b19641d 100644
---- mozilla/media/libsydneyaudio/src/Makefile.in
-+++ mozilla/media/libsydneyaudio/src/Makefile.in
-@@ -30,10 +30,6 @@ else ifeq ($(MOZ_WIDGET_TOOLKIT),android)
- CSRCS = \
- sydney_audio_android.c \
- $(NULL)
--else ifeq ($(OS_ARCH),Linux)
--CSRCS = \
-- sydney_audio_alsa.c \
-- $(NULL)
- endif
-
- ifeq ($(OS_ARCH),WINNT)
-@@ -68,6 +64,18 @@ CSRCS = \
- $(NULL)
- endif
-
-+ifdef MOZ_ALSA
-+CSRCS = \
-+ sydney_audio_alsa.c \
-+ $(NULL)
-+endif
-+
-+ifdef MOZ_PULSEAUDIO
-+CSRCS = \
-+ sydney_audio_pulseaudio.c \
-+ $(NULL)
-+endif
-+
- ifeq ($(OS_ARCH),WINNT)
- OS_LIBS += winmm.lib
- endif
-diff --git mozilla/toolkit/library/Makefile.in mozilla/toolkit/library/Makefile.in
-index 43384e9..e46a6e3 100644
---- mozilla/toolkit/library/Makefile.in
-+++ mozilla/toolkit/library/Makefile.in
-@@ -370,14 +370,11 @@ endif
-
- EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME_PATH,gkmedias,$(DIST)/lib)
-
--ifdef MOZ_SYDNEYAUDIO
--ifeq ($(OS_ARCH),Linux)
-+ifneq (,$(MOZ_CUBEB)$(MOZ_SYDNEYAUDIO))
-+ifdef MOZ_ALSA
- EXTRA_DSO_LDOPTS += $(MOZ_ALSA_LIBS)
- endif
--endif
--
- ifdef MOZ_PULSEAUDIO
--ifdef MOZ_CUBEB
- EXTRA_DSO_LDOPTS += $(MOZ_PULSEAUDIO_LIBS)
- endif
- endif
diff --git a/mail/thunderbird/files/patch-bug685258 b/mail/thunderbird/files/patch-bug685258
deleted file mode 100644
index cac425d6adba..000000000000
--- a/mail/thunderbird/files/patch-bug685258
+++ /dev/null
@@ -1,17 +0,0 @@
-# HG changeset patch
-# User Oleg Romashin <romaxa@gmail.com>
-# Parent a2291c212856ad27622416e83c8311b6a33b52f1
-Bug 685258 - Pulse audio backend does not check provided playback and crashes r=derf
-
-diff --git a/content/media/nsAudioStream.cpp b/content/media/nsAudioStream.cpp
---- mozilla/content/media/nsAudioStream.cpp
-+++ mozilla/content/media/nsAudioStream.cpp
-@@ -429,7 +429,7 @@ nsresult nsNativeAudioStream::Init(PRInt32 aNumChannels, PRInt32 aRate, SampleFo
- mFormat = aFormat;
-
- if (sa_stream_create_pcm(reinterpret_cast<sa_stream_t**>(&mAudioHandle),
-- NULL,
-+ "Mozilla",
- SA_MODE_WRONLY,
- SA_PCM_FORMAT_S16_NE,
- aRate,
diff --git a/mail/thunderbird/files/patch-bug722975 b/mail/thunderbird/files/patch-bug722975
deleted file mode 100644
index 51bc5a4380ef..000000000000
--- a/mail/thunderbird/files/patch-bug722975
+++ /dev/null
@@ -1,61 +0,0 @@
-# HG changeset patch
-# Parent 9d3c9b863c697634e434b687d456bb82fa794ecf
-# User Uli Schlachter <psychon@znc.in>
-Bug 722975 - --enable-system-cairo build is broken after Bug 715658 fixed
-
-
-diff --git a/mozilla/gfx/thebes/gfxPlatform.cpp b/mozilla/gfx/thebes/gfxPlatform.cpp
---- mozilla/gfx/thebes/gfxPlatform.cpp
-+++ mozilla/gfx/thebes/gfxPlatform.cpp
-@@ -484,21 +484,19 @@ gfxPlatform::CreateDrawTargetForSurface(
-
- cairo_user_data_key_t kSourceSurface;
-
- void SourceBufferDestroy(void *srcBuffer)
- {
- static_cast<SourceSurface*>(srcBuffer)->Release();
- }
-
--void SourceSnapshotDetached(cairo_surface_t *nullSurf)
-+void SourceSnapshotDetached(void *nullSurf)
- {
-- gfxImageSurface* origSurf =
-- static_cast<gfxImageSurface*>(cairo_surface_get_user_data(nullSurf, &kSourceSurface));
--
-+ gfxImageSurface *origSurf = static_cast<gfxImageSurface*>(nullSurf);
- origSurf->SetData(&kSourceSurface, NULL, NULL);
- }
-
- RefPtr<SourceSurface>
- gfxPlatform::GetSourceSurfaceForSurface(DrawTarget *aTarget, gfxASurface *aSurface)
- {
- void *userData = aSurface->GetData(&kSourceSurface);
-
-@@ -588,24 +586,19 @@ gfxPlatform::GetSourceSurfaceForSurface(
- }
-
- srcBuffer = Factory::CreateWrappingDataSourceSurface(imgSurface->Data(),
- imgSurface->Stride(),
- size, format);
-
- }
-
-- cairo_surface_t *nullSurf =
-- cairo_null_surface_create(CAIRO_CONTENT_COLOR_ALPHA);
-- cairo_surface_set_user_data(nullSurf,
-- &kSourceSurface,
-- imgSurface,
-- NULL);
-- cairo_surface_attach_snapshot(imgSurface->CairoSurface(), nullSurf, SourceSnapshotDetached);
-- cairo_surface_destroy(nullSurf);
-+ cairo_surface_set_mime_data(imgSurface->CairoSurface(), "mozilla/magic",
-+ (const unsigned char *) "data", 4,
-+ SourceSnapshotDetached, imgSurface.get());
- }
-
- srcBuffer->AddRef();
- aSurface->SetData(&kSourceSurface, srcBuffer, SourceBufferDestroy);
-
- return srcBuffer;
- }
-
diff --git a/mail/thunderbird/files/patch-bug732340 b/mail/thunderbird/files/patch-bug732340
deleted file mode 100644
index f09561f4e8e1..000000000000
--- a/mail/thunderbird/files/patch-bug732340
+++ /dev/null
@@ -1,14 +0,0 @@
---- mozilla/gfx/harfbuzz/src/hb-ot-layout.cc.orig 2012-06-24 22:14:46.463741874 -0400
-+++ mozilla/gfx/harfbuzz/src/hb-ot-layout.cc 2012-06-24 22:15:06.784770042 -0400
-@@ -537,4 +537,10 @@ hb_ot_layout_position_finish (hb_face_t
- GPOS::position_finish (buffer);
- }
-
-+#if !defined(__clang__) && defined(__GNUC__) && __GNUC_MINOR__ <= 3
-+template int SortedArrayOf<Record<LangSys> >::search<unsigned int>(unsigned int const &) const;
-+template int SortedArrayOf<Record<Script> >::search<unsigned int>(unsigned int const &) const;
-+template int SortedArrayOf<IntType<unsigned short> >::search<unsigned int>(unsigned int const &) const;
-+template int SortedArrayOf<RangeRecord>::search<unsigned int>(unsigned int const &) const;
-+#endif
-
-
diff --git a/mail/thunderbird/files/patch-bug753046 b/mail/thunderbird/files/patch-bug753046
deleted file mode 100644
index 0a11537b30d7..000000000000
--- a/mail/thunderbird/files/patch-bug753046
+++ /dev/null
@@ -1,1207 +0,0 @@
-# Bug 753046 - Add support for DragonFly/NetBSD
-
-$NetBSD: patch-dom_plugins_ipc_PluginModuleChild.cpp,v 1.1 2012/03/06 12:34:09 ryoon Exp $
-
---- mozilla/dom/plugins/ipc/PluginModuleChild.cpp.orig 2011-12-20 23:28:14.000000000 +0000
-+++ mozilla/dom/plugins/ipc/PluginModuleChild.cpp
-@@ -5,6 +5,7 @@
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
- #ifdef MOZ_WIDGET_QT
-+#include <unistd.h> // for _exit()
- #include <QtCore/QTimer>
- #include "nsQAppInstance.h"
- #include "NestedLoopTimer.h"
-@@ -228,7 +228,7 @@ PluginModuleChild::Init(const std::strin
-
- // TODO: use PluginPRLibrary here
-
--#if defined(OS_LINUX)
-+#if defined(OS_LINUX) || defined(OS_BSD)
- mShutdownFunc =
- (NP_PLUGINSHUTDOWN) PR_FindFunctionSymbol(mLibrary, "NP_Shutdown");
-
-@@ -1790,7 +1790,7 @@ PluginModuleChild::AnswerNP_GetEntryPoin
- PLUGIN_LOG_DEBUG_METHOD;
- AssertPluginThread();
-
--#if defined(OS_LINUX)
-+#if defined(OS_LINUX) || defined(OS_BSD)
- return true;
- #elif defined(OS_WIN) || defined(OS_MACOSX)
- *_retval = mGetEntryPointsFunc(&mFunctions);
-@@ -1823,7 +1823,7 @@ PluginModuleChild::AnswerNP_Initialize(N
- SendBackUpXResources(FileDescriptor(xSocketFd, false/*don't close*/));
- #endif
-
--#if defined(OS_LINUX)
-+#if defined(OS_LINUX) || defined(OS_BSD)
- *_retval = mInitializeFunc(&sBrowserFuncs, &mFunctions);
- return true;
- #elif defined(OS_WIN) || defined(OS_MACOSX)
-$NetBSD: patch-dom_plugins_ipc_PluginModuleChild.h,v 1.1 2012/03/06 12:34:09 ryoon Exp $
-
---- mozilla/dom/plugins/ipc/PluginModuleChild.h.orig 2011-12-20 23:28:14.000000000 +0000
-+++ mozilla/dom/plugins/ipc/PluginModuleChild.h
-@@ -340,7 +340,7 @@ private:
-
- // we get this from the plugin
- NP_PLUGINSHUTDOWN mShutdownFunc;
--#ifdef OS_LINUX
-+#if defined(OS_LINUX) || defined(OS_BSD)
- NP_PLUGINUNIXINIT mInitializeFunc;
- #elif defined(OS_WIN) || defined(OS_MACOSX)
- NP_PLUGININIT mInitializeFunc;
-$NetBSD: patch-ipc_chromium_Makefile.in,v 1.1 2012/03/06 12:34:09 ryoon Exp $
-
---- mozilla/ipc/chromium/Makefile.in.orig 2012-02-16 06:40:33.000000000 +0000
-+++ mozilla/ipc/chromium/Makefile.in
-@@ -278,6 +278,33 @@ endif
-
- endif # } OS_LINUX
-
-+ifdef OS_BSD # {
-+
-+CPPSRCS += \
-+ atomicops_internals_x86_gcc.cc \
-+ process_util_bsd.cc \
-+ time_posix.cc \
-+ $(NULL)
-+
-+ifdef MOZ_ENABLE_GTK2
-+CPPSRCS += \
-+ message_pump_glib.cc \
-+ $(NULL)
-+endif
-+
-+ifdef MOZ_ENABLE_QT
-+MOCSRCS = \
-+ moc_message_pump_qt.cc \
-+ $(NULL)
-+
-+CPPSRCS += \
-+ $(MOCSRCS) \
-+ message_pump_qt.cc \
-+ $(NULL)
-+endif
-+
-+endif # } OS_BSD
-+
- # libevent
-
- ifndef MOZ_NATIVE_LIBEVENT # {
-$NetBSD: patch-ipc_chromium_chromium-config.mk,v 1.2 2012/03/15 08:30:06 ryoon Exp $
-
---- mozilla/ipc/chromium/chromium-config.mk.orig 2012-02-16 07:40:33.000000000 +0100
-+++ mozilla/ipc/chromium/chromium-config.mk 2012-03-11 11:05:40.397182000 +0100
-@@ -56,17 +56,6 @@
- -I$(DEPTH)/ipc/ipdl/_ipdlheaders \
- $(NULL)
-
--ifeq ($(OS_ARCH),Darwin) # {
--
--OS_MACOSX = 1
--OS_POSIX = 1
--
--DEFINES += \
-- -DOS_MACOSX=1 \
-- -DOS_POSIX=1 \
-- $(NULL)
--
--else # } {
- ifeq ($(OS_ARCH),WINNT) # {
- OS_LIBS += $(call EXPAND_LIBNAME,psapi shell32 dbghelp)
-
-@@ -93,13 +82,65 @@
- endif
-
- else # } {
--
--OS_LINUX = 1
- OS_POSIX = 1
-+DEFINES += -DOS_POSIX=1
-+
-+ifeq ($(OS_ARCH),Darwin) # {
-+
-+OS_MACOSX = 1
-+DEFINES += \
-+ -DOS_MACOSX=1 \
-+ $(NULL)
-+
-+else # } {
-+ifeq ($(OS_ARCH),DragonFly) # {
-+
-+OS_DRAGONFLY = 1
-+OS_BSD = 1
-+OS_LIBS += $(call EXPAND_LIBNAME,kvm)
-+DEFINES += \
-+ -DOS_DRAGONFLY=1 \
-+ -DOS_BSD=1 \
-+ $(NULL)
-+
-+else # } {
-+ifeq ($(OS_ARCH),FreeBSD) # {
-+
-+OS_FREEBSD = 1
-+OS_BSD = 1
-+OS_LIBS += $(call EXPAND_LIBNAME,kvm)
-+DEFINES += \
-+ -DOS_FREEBSD=1 \
-+ -DOS_BSD=1 \
-+ $(NULL)
-
-+else # } {
-+ifeq ($(OS_ARCH),NetBSD) # {
-+
-+OS_NETBSD = 1
-+OS_BSD = 1
-+OS_LIBS += $(call EXPAND_LIBNAME,kvm)
-+DEFINES += \
-+ -DOS_NETBSD=1 \
-+ -DOS_BSD=1 \
-+ $(NULL)
-+
-+else # } {
-+ifeq ($(OS_ARCH),OpenBSD) # {
-+
-+OS_OPENBSD = 1
-+OS_BSD = 1
-+OS_LIBS += $(call EXPAND_LIBNAME,kvm)
-+DEFINES += \
-+ -DOS_OPENBSD=1 \
-+ -DOS_BSD=1 \
-+ $(NULL)
-+
-+else # } {
-+
-+OS_LINUX = 1
- DEFINES += \
- -DOS_LINUX=1 \
-- -DOS_POSIX=1 \
- $(NULL)
-
- # NB: to stop gcc warnings about exporting template instantiation
-@@ -107,4 +147,8 @@
-
- endif # }
- endif # }
-+endif # }
-+endif # }
-+endif # }
-+endif # }
-
-$NetBSD: patch-ipc_chromium_src_base_base__paths.h,v 1.1 2012/03/06 12:34:09 ryoon Exp $
-
---- mozilla/ipc/chromium/src/base/base_paths.h.orig 2011-12-20 23:28:19.000000000 +0000
-+++ mozilla/ipc/chromium/src/base/base_paths.h
-@@ -13,7 +13,7 @@
- #include "base/base_paths_win.h"
- #elif defined(OS_MACOSX)
- #include "base/base_paths_mac.h"
--#elif defined(OS_LINUX)
-+#elif defined(OS_LINUX) || defined(OS_BSD)
- #include "base/base_paths_linux.h"
- #endif
- #include "base/path_service.h"
-$NetBSD: patch-ipc_chromium_src_base_debug__util__posic.cc,v 1.3 2012/04/01 15:18:45 ryoon Exp $
-
---- mozilla/ipc/chromium/src/base/debug_util_posix.cc.orig 2012-03-13 01:36:53.000000000 +0000
-+++ mozilla/ipc/chromium/src/base/debug_util_posix.cc
-@@ -5,7 +5,7 @@
- #include "build/build_config.h"
- #include "base/debug_util.h"
-
--#define MOZ_HAVE_EXECINFO_H (!defined(ANDROID) && !defined(__OpenBSD__))
-+#define MOZ_HAVE_EXECINFO_H (defined(OS_LINUX) && !defined(ANDROID))
-
- #include <errno.h>
- #include <fcntl.h>
-@@ -17,9 +17,16 @@
- #include <unistd.h>
- #if MOZ_HAVE_EXECINFO_H
- #include <execinfo.h>
-+#endif
-+
-+#if defined(OS_MACOSX) || defined(OS_BSD)
- #include <sys/sysctl.h>
- #endif
-
-+#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD)
-+#include <sys/user.h>
-+#endif
-+
- #include "base/basictypes.h"
- #include "base/eintr_wrapper.h"
- #include "base/logging.h"
-@@ -32,7 +37,7 @@ bool DebugUtil::SpawnDebuggerOnProcess(u
- return false;
- }
-
--#if defined(OS_MACOSX)
-+#if defined(OS_MACOSX) || defined(OS_BSD)
-
- // Based on Apple's recommended method as described in
- // http://developer.apple.com/qa/qa2004/qa1361.html
-@@ -71,7 +76,15 @@ bool DebugUtil::BeingDebugged() {
-
- // This process is being debugged if the P_TRACED flag is set.
- is_set = true;
-+#if defined(OS_DRAGONFLY)
-+ being_debugged = (info.kp_flags & P_TRACED) != 0;
-+#elif defined(OS_FREEBSD)
-+ being_debugged = (info.ki_flag & P_TRACED) != 0;
-+#elif defined(OS_OPENBSD)
-+ being_debugged = (info.p_flag & P_TRACED) != 0;
-+#else
- being_debugged = (info.kp_proc.p_flag & P_TRACED) != 0;
-+#endif
- return being_debugged;
- }
-
-diff --git ipc/chromium/src/base/dir_reader_bsd.h ipc/chromium/src/base/dir_reader_bsd.h
-new file mode 100644
-index 0000000..3fc1a87
---- /dev/null
-+++ mozilla/ipc/chromium/src/base/dir_reader_bsd.h
-@@ -0,0 +1,112 @@
-+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-+// Use of this source code is governed by a BSD-style license that can be
-+// found in the LICENSE file.
-+
-+// derived from dir_reader_linux.h
-+
-+#ifndef BASE_DIR_READER_BSD_H_
-+#define BASE_DIR_READER_BSD_H_
-+#pragma once
-+
-+#include <dirent.h>
-+#include <errno.h>
-+#include <fcntl.h>
-+#include <stdint.h>
-+#include <unistd.h>
-+
-+#include "base/logging.h"
-+#include "base/eintr_wrapper.h"
-+
-+// See the comments in dir_reader_posix.h about this.
-+
-+namespace base {
-+
-+class DirReaderBSD {
-+ public:
-+ explicit DirReaderBSD(const char* directory_path)
-+#ifdef O_DIRECTORY
-+ : fd_(open(directory_path, O_RDONLY | O_DIRECTORY)),
-+#else
-+ : fd_(open(directory_path, O_RDONLY)),
-+#endif
-+ offset_(0),
-+ size_(0) {
-+ memset(buf_, 0, sizeof(buf_));
-+ }
-+
-+ ~DirReaderBSD() {
-+ if (fd_ >= 0) {
-+ if (HANDLE_EINTR(close(fd_)))
-+ DLOG(ERROR) << "Failed to close directory handle";
-+ }
-+ }
-+
-+ bool IsValid() const {
-+ return fd_ >= 0;
-+ }
-+
-+ // Move to the next entry returning false if the iteration is complete.
-+ bool Next() {
-+ if (size_) {
-+ struct dirent* dirent = reinterpret_cast<struct dirent*>(&buf_[offset_]);
-+#ifdef OS_DRAGONFLY
-+ offset_ += _DIRENT_DIRSIZ(dirent);
-+#else
-+ offset_ += dirent->d_reclen;
-+#endif
-+ }
-+
-+ if (offset_ != size_)
-+ return true;
-+
-+#ifdef OS_OPENBSD
-+ const int r = getdirentries(fd_, buf_, sizeof(buf_), basep_);
-+#else
-+ const int r = getdents(fd_, buf_, sizeof(buf_));
-+#endif
-+ if (r == 0)
-+ return false;
-+ if (r == -1) {
-+#ifdef OS_OPENBSD
-+ DLOG(ERROR) << "getdirentries returned an error: " << errno;
-+#else
-+ DLOG(ERROR) << "getdents returned an error: " << errno;
-+#endif
-+ return false;
-+ }
-+ size_ = r;
-+ offset_ = 0;
-+ return true;
-+ }
-+
-+ const char* name() const {
-+ if (!size_)
-+ return NULL;
-+
-+ const struct dirent* dirent =
-+ reinterpret_cast<const struct dirent*>(&buf_[offset_]);
-+ return dirent->d_name;
-+ }
-+
-+ int fd() const {
-+ return fd_;
-+ }
-+
-+ static bool IsFallback() {
-+ return false;
-+ }
-+
-+ private:
-+ const int fd_;
-+ char buf_[512];
-+#ifdef OS_OPENBSD
-+ off_t *basep_;
-+#endif
-+ size_t offset_, size_;
-+
-+ DISALLOW_COPY_AND_ASSIGN(DirReaderBSD);
-+};
-+
-+} // namespace base
-+
-+#endif // BASE_DIR_READER_BSD_H_
-diff --git ipc/chromium/src/base/dir_reader_posix.h ipc/chromium/src/base/dir_reader_posix.h
-index 9a34492..62b280c 100644
---- mozilla/ipc/chromium/src/base/dir_reader_posix.h
-+++ mozilla/ipc/chromium/src/base/dir_reader_posix.h
-@@ -18,16 +18,20 @@
- // seems worse than falling back to enumerating all file descriptors so we will
- // probably never implement this on the Mac.
-
--#if defined(OS_LINUX) && !defined(OS_OPENBSD)
-+#if defined(OS_LINUX)
- #include "base/dir_reader_linux.h"
-+#elif defined(OS_BSD)
-+#include "base/dir_reader_bsd.h"
- #else
- #include "base/dir_reader_fallback.h"
- #endif
-
- namespace base {
-
--#if defined(OS_LINUX) && !defined(OS_OPENBSD)
-+#if defined(OS_LINUX)
- typedef DirReaderLinux DirReaderPosix;
-+#elif defined(OS_BSD)
-+typedef DirReaderBSD DirReaderPosix;
- #else
- typedef DirReaderFallback DirReaderPosix;
- #endif
-$NetBSD: patch-ipc_chromium_src_base_file__util__posix.cc,v 1.2 2012/03/06 12:34:09 ryoon Exp $
-
---- mozilla/ipc/chromium/src/base/file_util_posix.cc.orig 2011-12-20 23:28:19.000000000 +0000
-+++ mozilla/ipc/chromium/src/base/file_util_posix.cc
-@@ -31,7 +31,7 @@
- #include "base/time.h"
-
- // FreeBSD/OpenBSD lacks stat64, but its stat handles files >2GB just fine
--#if defined(OS_FREEBSD) || defined(OS_OPENBSD)
-+#ifndef HAVE_STAT64
- #define stat64 stat
- #endif
-
-$NetBSD: patch-ipc_chromium_src_base_message__loop.cc,v 1.1 2012/03/06 12:34:09 ryoon Exp $
-
---- mozilla/ipc/chromium/src/base/message_loop.cc.orig 2012-02-16 07:40:33.000000000 +0100
-+++ mozilla/ipc/chromium/src/base/message_loop.cc 2012-02-21 21:24:41.000000000 +0100
-@@ -19,7 +19,7 @@
- #if defined(OS_POSIX)
- #include "base/message_pump_libevent.h"
- #endif
--#if defined(OS_LINUX)
-+#if defined(OS_LINUX) || defined(OS_BSD)
- #ifdef MOZ_WIDGET_GTK2
- #include "base/message_pump_glib.h"
- #endif
-@@ -119,7 +119,7 @@
- if (type_ == TYPE_UI) {
- #if defined(OS_MACOSX)
- pump_ = base::MessagePumpMac::Create();
--#elif defined(OS_LINUX)
-+#elif defined(OS_LINUX) || defined(OS_BSD)
- pump_ = new base::MessagePumpForUI();
- #endif // OS_LINUX
- } else if (type_ == TYPE_IO) {
-$NetBSD: patch-ipc_chromium_src_base_platform__thread.h,v 1.1 2012/03/06 12:34:09 ryoon Exp $
-
---- mozilla/ipc/chromium/src/base/platform_thread.h.orig 2011-12-20 23:28:19.000000000 +0000
-+++ mozilla/ipc/chromium/src/base/platform_thread.h
-@@ -22,9 +22,12 @@ typedef void* PlatformThreadHandle; // HANDLE
- #elif defined(OS_POSIX)
- #include <pthread.h>
- typedef pthread_t PlatformThreadHandle;
--#if defined(OS_LINUX)
-+#if defined(OS_LINUX) || defined(OS_OPENBSD)
- #include <unistd.h>
- typedef pid_t PlatformThreadId;
-+#elif defined(OS_BSD)
-+#include <sys/types.h>
-+typedef lwpid_t PlatformThreadId;
- #elif defined(OS_MACOSX)
- #include <mach/mach.h>
- typedef mach_port_t PlatformThreadId;
-$NetBSD: patch-ipc_chromium_src_base_platform__thread__posix.cc,v 1.4 2012/04/01 15:18:45 ryoon Exp $
-
---- mozilla/ipc/chromium/src/base/platform_thread_posix.cc.orig 2012-03-13 01:36:53.000000000 +0000
-+++ mozilla/ipc/chromium/src/base/platform_thread_posix.cc
-@@ -9,16 +9,24 @@
-
- #if defined(OS_MACOSX)
- #include <mach/mach.h>
-+#elif defined(OS_NETBSD)
-+#include <lwp.h>
- #elif defined(OS_LINUX)
- #include <sys/syscall.h>
--#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__DragonFly__)
- #include <sys/prctl.h>
--#elif !defined(__NetBSD__)
--#include <pthread_np.h>
-+#elif defined(OS_FREEBSD)
-+#include <sys/param.h>
-+#include <sys/thr.h>
- #endif
-+
-+#if !defined(OS_MACOSX)
- #include <unistd.h>
- #endif
-
-+#if defined(OS_BSD) && !defined(OS_NETBSD)
-+#include <pthread_np.h>
-+#endif
-+
- #if defined(OS_MACOSX)
- namespace base {
- void InitThreading();
-@@ -38,9 +45,20 @@ PlatformThreadId PlatformThread::CurrentId() {
- // into the kernel.
- #if defined(OS_MACOSX)
- return mach_thread_self();
--#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
-+#elif defined(OS_NETBSD)
-+ return _lwp_self();
-+#elif defined(OS_DRAGONFLY)
-+ return lwp_gettid();
-+#elif defined(OS_FREEBSD)
-+# if __FreeBSD_version > 900030
-+ return pthread_getthreadid_np();
-+# else
-+ long lwpid;
-+ thr_self(&lwpid);
-+ return lwpid;
-+# endif
-+#elif defined(OS_OPENBSD)
-- // TODO(BSD): find a better thread ID
-- return (intptr_t)(pthread_self());
-+ return (intptr_t) (pthread_self());
- #elif defined(OS_LINUX)
- return syscall(__NR_gettid);
- #endif
-@@ -102,9 +102,9 @@ void PlatformThread::SetName(const char* name) {
- // Note that glibc also has a 'pthread_setname_np' api, but it may not be
- // available everywhere and it's only benefit over using prctl directly is
- // that it can set the name of threads other than the current thread.
--#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
-+#if defined(OS_BSD) && !defined(OS_NETBSD)
- pthread_set_name_np(pthread_self(), name);
--#elif defined(__NetBSD__)
-+#elif defined(OS_NETBSD)
- pthread_setname_np(pthread_self(), "%s", (void *)name);
- #else
- prctl(PR_SET_NAME, reinterpret_cast<uintptr_t>(name), 0, 0, 0);
-$NetBSD: patch-ipc_chromium_src_base_process__util.h,v 1.1 2012/03/06 12:34:09 ryoon Exp $
-
---- mozilla/ipc/chromium/src/base/process_util.h.orig 2011-12-21 00:28:19.000000000 +0100
-+++ mozilla/ipc/chromium/src/base/process_util.h 2012-01-31 13:14:54.000000000 +0100
-@@ -280,6 +280,7 @@ class NamedProcessIterator {
- const ProcessEntry* NextProcessEntry();
-
- private:
-+#if !defined(OS_BSD)
- // Determines whether there's another process (regardless of executable)
- // left in the list of all processes. Returns true and sets entry_ to
- // that process's info if there is one, false otherwise.
-@@ -292,18 +292,24 @@
- void InitProcessEntry(ProcessEntry* entry);
-
- std::wstring executable_name_;
-+#endif
-
- #if defined(OS_WIN)
- HANDLE snapshot_;
- bool started_iteration_;
- #elif defined(OS_LINUX)
- DIR *procfs_dir_;
-+#elif defined(OS_BSD)
-+ std::vector<ProcessEntry> content;
-+ size_t nextEntry;
- #elif defined(OS_MACOSX)
- std::vector<kinfo_proc> kinfo_procs_;
- size_t index_of_kinfo_proc_;
- #endif
-+#if !defined(OS_BSD)
- ProcessEntry entry_;
- const ProcessFilter* filter_;
-+#endif
-
- DISALLOW_EVIL_CONSTRUCTORS(NamedProcessIterator);
- };
-$NetBSD: patch-ipc_chromium_src_base_process__util__bsd.cc,v 1.4 2012/04/01 15:18:45 ryoon Exp $
-
---- mozilla/ipc/chromium/src/base/process_util_bsd.cc.orig 2012-04-01 00:04:28.000000000 +0000
-+++ mozilla/ipc/chromium/src/base/process_util_bsd.cc
-@@ -0,0 +1,367 @@
-+// Copyright (c) 2008 The Chromium Authors. All rights reserved.
-+// Use of this source code is governed by a BSD-style license that can be
-+// found in the LICENSE file.
-+
-+// derived from process_util_linux.cc and process_util_mac.cc
-+
-+#include "base/process_util.h"
-+
-+#include <sys/param.h>
-+#include <sys/sysctl.h>
-+#include <sys/wait.h>
-+#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD)
-+#include <sys/user.h>
-+#endif
-+
-+#include <ctype.h>
-+#include <fcntl.h>
-+#include <kvm.h>
-+#include <unistd.h>
-+
-+#include <string>
-+
-+#include "base/debug_util.h"
-+#include "base/eintr_wrapper.h"
-+#include "base/file_util.h"
-+#include "base/logging.h"
-+#include "base/string_tokenizer.h"
-+#include "base/string_util.h"
-+
-+#if (defined(_POSIX_SPAWN) && _POSIX_SPAWN > 0) \
-+ || (defined(OS_NETBSD) && __NetBSD_Version__ >= 599006500)
-+#define HAVE_POSIX_SPAWN 1
-+#endif
-+
-+/*
-+ * On platforms that are not gonk based, we fall back to an arbitrary
-+ * UID. This is generally the UID for user `nobody', albeit it is not
-+ * always the case.
-+ */
-+
-+#if defined(OS_NETBSD) || defined(OS_OPENBSD)
-+# define CHILD_UNPRIVILEGED_UID 32767
-+# define CHILD_UNPRIVILEGED_GID 32767
-+#else
-+# define CHILD_UNPRIVILEGED_UID 65534
-+# define CHILD_UNPRIVILEGED_GID 65534
-+#endif
-+
-+#ifndef __dso_public
-+# ifdef __exported
-+# define __dso_public __exported
-+# else
-+# define __dso_public __attribute__((__visibility__("default")))
-+# endif
-+#endif
-+
-+#ifdef HAVE_POSIX_SPAWN
-+#include <spawn.h>
-+extern "C" char **environ __dso_public;
-+#endif
-+
-+namespace {
-+
-+enum ParsingState {
-+ KEY_NAME,
-+ KEY_VALUE
-+};
-+
-+static mozilla::EnvironmentLog gProcessLog("MOZ_PROCESS_LOG");
-+
-+} // namespace
-+
-+namespace base {
-+
-+#ifdef HAVE_POSIX_SPAWN
-+
-+void FreeEnvVarsArray(char* array[], int length)
-+{
-+ for (int i = 0; i < length; i++) {
-+ free(array[i]);
-+ }
-+ delete[] array;
-+}
-+
-+bool LaunchApp(const std::vector<std::string>& argv,
-+ const file_handle_mapping_vector& fds_to_remap,
-+ bool wait, ProcessHandle* process_handle) {
-+ return LaunchApp(argv, fds_to_remap, environment_map(),
-+ wait, process_handle);
-+}
-+
-+bool LaunchApp(const std::vector<std::string>& argv,
-+ const file_handle_mapping_vector& fds_to_remap,
-+ const environment_map& env_vars_to_set,
-+ bool wait, ProcessHandle* process_handle,
-+ ProcessArchitecture arch) {
-+ return LaunchApp(argv, fds_to_remap, env_vars_to_set,
-+ SAME_PRIVILEGES_AS_PARENT,
-+ wait, process_handle);
-+}
-+
-+bool LaunchApp(const std::vector<std::string>& argv,
-+ const file_handle_mapping_vector& fds_to_remap,
-+ const environment_map& env_vars_to_set,
-+ ChildPrivileges privs,
-+ bool wait, ProcessHandle* process_handle,
-+ ProcessArchitecture arch) {
-+ bool retval = true;
-+
-+ char* argv_copy[argv.size() + 1];
-+ for (size_t i = 0; i < argv.size(); i++) {
-+ argv_copy[i] = const_cast<char*>(argv[i].c_str());
-+ }
-+ argv_copy[argv.size()] = NULL;
-+
-+ // Make sure we don't leak any FDs to the child process by marking all FDs
-+ // as close-on-exec.
-+ SetAllFDsToCloseOnExec();
-+
-+ // Copy environment to a new char array and add the variables
-+ // in env_vars_to_set.
-+ // Existing variables are overwritten by env_vars_to_set.
-+ int pos = 0;
-+ environment_map combined_env_vars = env_vars_to_set;
-+ while(environ[pos] != NULL) {
-+ std::string varString = environ[pos];
-+ std::string varName = varString.substr(0, varString.find_first_of('='));
-+ std::string varValue = varString.substr(varString.find_first_of('=') + 1);
-+ if (combined_env_vars.find(varName) == combined_env_vars.end()) {
-+ combined_env_vars[varName] = varValue;
-+ }
-+ pos++;
-+ }
-+ int varsLen = combined_env_vars.size() + 1;
-+
-+ char** vars = new char*[varsLen];
-+ int i = 0;
-+ for (environment_map::const_iterator it = combined_env_vars.begin();
-+ it != combined_env_vars.end(); ++it) {
-+ std::string entry(it->first);
-+ entry += "=";
-+ entry += it->second;
-+ vars[i] = strdup(entry.c_str());
-+ i++;
-+ }
-+ vars[i] = NULL;
-+
-+ posix_spawn_file_actions_t file_actions;
-+ if (posix_spawn_file_actions_init(&file_actions) != 0) {
-+ FreeEnvVarsArray(vars, varsLen);
-+ return false;
-+ }
-+
-+ // Turn fds_to_remap array into a set of dup2 calls.
-+ for (file_handle_mapping_vector::const_iterator it = fds_to_remap.begin();
-+ it != fds_to_remap.end();
-+ ++it) {
-+ int src_fd = it->first;
-+ int dest_fd = it->second;
-+
-+ if (src_fd == dest_fd) {
-+ int flags = fcntl(src_fd, F_GETFD);
-+ if (flags != -1) {
-+ fcntl(src_fd, F_SETFD, flags & ~FD_CLOEXEC);
-+ }
-+ } else {
-+ if (posix_spawn_file_actions_adddup2(&file_actions, src_fd, dest_fd) != 0) {
-+ posix_spawn_file_actions_destroy(&file_actions);
-+ FreeEnvVarsArray(vars, varsLen);
-+ return false;
-+ }
-+ }
-+ }
-+
-+ pid_t pid = 0;
-+ int spawn_succeeded = (posix_spawnp(&pid,
-+ argv_copy[0],
-+ &file_actions,
-+ NULL,
-+ argv_copy,
-+ vars) == 0);
-+
-+ FreeEnvVarsArray(vars, varsLen);
-+
-+ posix_spawn_file_actions_destroy(&file_actions);
-+
-+ bool process_handle_valid = pid > 0;
-+ if (!spawn_succeeded || !process_handle_valid) {
-+ retval = false;
-+ } else {
-+ if (wait)
-+ HANDLE_EINTR(waitpid(pid, 0, 0));
-+
-+ if (process_handle)
-+ *process_handle = pid;
-+ }
-+
-+ return retval;
-+}
-+
-+bool LaunchApp(const CommandLine& cl,
-+ bool wait, bool start_hidden, ProcessHandle* process_handle) {
-+ // TODO(playmobil): Do we need to respect the start_hidden flag?
-+ file_handle_mapping_vector no_files;
-+ return LaunchApp(cl.argv(), no_files, wait, process_handle);
-+}
-+
-+#else // no posix_spawn, use fork/exec
-+
-+bool LaunchApp(const std::vector<std::string>& argv,
-+ const file_handle_mapping_vector& fds_to_remap,
-+ bool wait, ProcessHandle* process_handle) {
-+ return LaunchApp(argv, fds_to_remap, environment_map(),
-+ wait, process_handle);
-+}
-+
-+bool LaunchApp(const std::vector<std::string>& argv,
-+ const file_handle_mapping_vector& fds_to_remap,
-+ const environment_map& env_vars_to_set,
-+ bool wait, ProcessHandle* process_handle,
-+ ProcessArchitecture arch) {
-+ return LaunchApp(argv, fds_to_remap, env_vars_to_set,
-+ SAME_PRIVILEGES_AS_PARENT,
-+ wait, process_handle);
-+}
-+
-+bool LaunchApp(const std::vector<std::string>& argv,
-+ const file_handle_mapping_vector& fds_to_remap,
-+ const environment_map& env_vars_to_set,
-+ ChildPrivileges privs,
-+ bool wait, ProcessHandle* process_handle,
-+ ProcessArchitecture arch) {
-+ scoped_array<char*> argv_cstr(new char*[argv.size() + 1]);
-+ // Illegal to allocate memory after fork and before execvp
-+ InjectiveMultimap fd_shuffle1, fd_shuffle2;
-+ fd_shuffle1.reserve(fds_to_remap.size());
-+ fd_shuffle2.reserve(fds_to_remap.size());
-+
-+ pid_t pid = fork();
-+ if (pid < 0)
-+ return false;
-+
-+ if (pid == 0) {
-+ for (file_handle_mapping_vector::const_iterator
-+ it = fds_to_remap.begin(); it != fds_to_remap.end(); ++it) {
-+ fd_shuffle1.push_back(InjectionArc(it->first, it->second, false));
-+ fd_shuffle2.push_back(InjectionArc(it->first, it->second, false));
-+ }
-+
-+ if (!ShuffleFileDescriptors(&fd_shuffle1))
-+ _exit(127);
-+
-+ CloseSuperfluousFds(fd_shuffle2);
-+
-+ for (size_t i = 0; i < argv.size(); i++)
-+ argv_cstr[i] = const_cast<char*>(argv[i].c_str());
-+ argv_cstr[argv.size()] = NULL;
-+
-+ if (privs == UNPRIVILEGED) {
-+ if (setgid(CHILD_UNPRIVILEGED_GID) != 0) {
-+ DLOG(ERROR) << "FAILED TO setgid() CHILD PROCESS, path: " << argv_cstr[0];
-+ _exit(127);
-+ }
-+ if (setuid(CHILD_UNPRIVILEGED_UID) != 0) {
-+ DLOG(ERROR) << "FAILED TO setuid() CHILD PROCESS, path: " << argv_cstr[0];
-+ _exit(127);
-+ }
-+ if (chdir("/") != 0)
-+ gProcessLog.print("==> could not chdir()\n");
-+ }
-+
-+ for (environment_map::const_iterator it = env_vars_to_set.begin();
-+ it != env_vars_to_set.end(); ++it) {
-+ if (setenv(it->first.c_str(), it->second.c_str(), 1/*overwrite*/))
-+ _exit(127);
-+ }
-+ execv(argv_cstr[0], argv_cstr.get());
-+ // if we get here, we're in serious trouble and should complain loudly
-+ DLOG(ERROR) << "FAILED TO exec() CHILD PROCESS, path: " << argv_cstr[0];
-+ _exit(127);
-+ } else {
-+ gProcessLog.print("==> process %d launched child process %d\n",
-+ GetCurrentProcId(), pid);
-+ if (wait)
-+ HANDLE_EINTR(waitpid(pid, 0, 0));
-+
-+ if (process_handle)
-+ *process_handle = pid;
-+ }
-+
-+ return true;
-+}
-+
-+bool LaunchApp(const CommandLine& cl,
-+ bool wait, bool start_hidden,
-+ ProcessHandle* process_handle) {
-+ file_handle_mapping_vector no_files;
-+ return LaunchApp(cl.argv(), no_files, wait, process_handle);
-+}
-+
-+#endif
-+
-+NamedProcessIterator::NamedProcessIterator(const std::wstring& executable_name,
-+ const ProcessFilter* filter)
-+{
-+ int numEntries;
-+ kvm_t *kvm;
-+ std::string exe(WideToASCII(executable_name));
-+
-+#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD)
-+ kvm = kvm_open(NULL, NULL, NULL, O_RDONLY, NULL);
-+ struct kinfo_proc* procs = kvm_getprocs(kvm, KERN_PROC_UID, getuid(), &numEntries);
-+ if (procs != NULL && numEntries > 0) {
-+ for (int i = 0; i < numEntries; i++) {
-+# if defined(OS_DRAGONFLY)
-+ if (exe != procs[i].kp_comm) continue;
-+ if (filter && !filter->Includes(procs[i].kp_pid, procs[i].kp_ppid)) continue;
-+ ProcessEntry e;
-+ e.pid = procs[i].kp_pid;
-+ e.ppid = procs[i].kp_ppid;
-+ strlcpy(e.szExeFile, procs[i].kp_comm, sizeof e.szExeFile);
-+ content.push_back(e);
-+# elif defined(OS_FREEBSD)
-+ if (exe != procs[i].ki_comm) continue;
-+ if (filter && !filter->Includes(procs[i].ki_pid, procs[i].ki_ppid)) continue;
-+ ProcessEntry e;
-+ e.pid = procs[i].ki_pid;
-+ e.ppid = procs[i].ki_ppid;
-+ strlcpy(e.szExeFile, procs[i].ki_comm, sizeof e.szExeFile);
-+ content.push_back(e);
-+# endif
-+#else
-+ kvm = kvm_open(NULL, NULL, NULL, KVM_NO_FILES, NULL);
-+#if defined(OS_OPENBSD)
-+ struct kinfo_proc* procs = kvm_getprocs(kvm, KERN_PROC_UID, getuid(), sizeof(struct kinfo_proc), &numEntries);
-+#else
-+ struct kinfo_proc2* procs = kvm_getproc2(kvm, KERN_PROC_UID, getuid(), sizeof(struct kinfo_proc2), &numEntries);
-+#endif
-+ if (procs != NULL && numEntries > 0) {
-+ for (int i = 0; i < numEntries; i++) {
-+ if (exe != procs[i].p_comm) continue;
-+ if (filter && !filter->Includes(procs[i].p_pid, procs[i].p_ppid)) continue;
-+ ProcessEntry e;
-+ e.pid = procs[i].p_pid;
-+ e.ppid = procs[i].p_ppid;
-+ strlcpy(e.szExeFile, procs[i].p_comm, sizeof e.szExeFile);
-+ content.push_back(e);
-+#endif
-+ }
-+ }
-+ nextEntry = 0;
-+ kvm_close(kvm);
-+}
-+
-+NamedProcessIterator::~NamedProcessIterator() {
-+}
-+
-+const ProcessEntry* NamedProcessIterator::NextProcessEntry() {
-+ if (nextEntry >= content.size()) return NULL;
-+ return &content[nextEntry++];
-+}
-+
-+bool ProcessMetrics::GetIOCounters(IoCounters* io_counters) const {
-+ return false;
-+}
-+
-+} // namespace base
-$NetBSD: patch-ipc_chromium_src_base_process__util__posix.cc,v 1.1 2012/03/06 12:34:09 ryoon Exp $
-
---- mozilla/ipc/chromium/src/base/process_util_posix.cc.orig 2011-12-20 23:28:19.000000000 +0000
-+++ mozilla/ipc/chromium/src/base/process_util_posix.cc
-@@ -116,6 +116,11 @@ void CloseSuperfluousFds(const base::Inj
- #elif defined(OS_MACOSX)
- static const rlim_t kSystemDefaultMaxFds = 256;
- static const char kFDDir[] = "/dev/fd";
-+#elif defined(OS_BSD)
-+ // the getrlimit below should never fail, so whatever ..
-+ static const rlim_t kSystemDefaultMaxFds = 1024;
-+ // at least /dev/fd will exist
-+ static const char kFDDir[] = "/dev/fd";
- #endif
-
- // Get the maximum number of FDs possible.
-@@ -199,7 +204,7 @@ void CloseSuperfluousFds(const base::Inj
- void SetAllFDsToCloseOnExec() {
- #if defined(OS_LINUX)
- const char fd_dir[] = "/proc/self/fd";
--#elif defined(OS_MACOSX)
-+#elif defined(OS_MACOSX) || defined(OS_BSD)
- const char fd_dir[] = "/dev/fd";
- #endif
- ScopedDIR dir_closer(opendir(fd_dir));
-$NetBSD: patch-ipc_chromium_src_base_sys__info__posix.cc,v 1.2 2011/11/27 13:09:00 tnn Exp $
-
---- mozilla/ipc/chromium/src/base/sys_info_posix.cc.orig 2011-11-04 21:34:00.000000000 +0000
-+++ mozilla/ipc/chromium/src/base/sys_info_posix.cc
-@@ -18,6 +18,11 @@
- #include <mach/mach_init.h>
- #endif
-
-+#if defined(OS_NETBSD)
-+#include <sys/param.h>
-+#include <sys/sysctl.h>
-+#endif
-+
- #include "base/logging.h"
- #include "base/string_util.h"
-
-@@ -26,7 +31,11 @@ namespace base {
- int SysInfo::NumberOfProcessors() {
- // It seems that sysconf returns the number of "logical" processors on both
- // mac and linux. So we get the number of "online logical" processors.
-+#ifdef _SC_NPROCESSORS_ONLN
- static long res = sysconf(_SC_NPROCESSORS_ONLN);
-+#else
-+ static long res = 1;
-+#endif
- if (res == -1) {
- NOTREACHED();
- return 1;
-@@ -52,6 +61,20 @@ int64 SysInfo::AmountOfPhysicalMemory()
- }
-
- return static_cast<int64>(hostinfo.max_mem);
-+#elif defined(OS_NETBSD)
-+ int mib[2];
-+ int rc;
-+ int64_t memSize;
-+ size_t len = sizeof(memSize);
-+
-+ mib[0] = CTL_HW;
-+ mib[1] = HW_PHYSMEM64;
-+ rc = sysctl( mib, 2, &memSize, &len, NULL, 0 );
-+ if (-1 != rc) {
-+ return memSize;
-+ }
-+ return 0;
-+
- #else
- long pages = sysconf(_SC_PHYS_PAGES);
- long page_size = sysconf(_SC_PAGE_SIZE);
-diff --git ipc/chromium/src/base/time_posix.cc ipc/chromium/src/base/time_posix.cc
-index abf2a56..48791f6 100644
---- mozilla/ipc/chromium/src/base/time_posix.cc
-+++ mozilla/ipc/chromium/src/base/time_posix.cc
-@@ -167,7 +167,7 @@ TimeTicks TimeTicks::Now() {
- // With numer and denom = 1 (the expected case), the 64-bit absolute time
- // reported in nanoseconds is enough to last nearly 585 years.
-
--#elif defined(__OpenBSD__) || defined(OS_POSIX) && \
-+#elif defined(OS_OPENBSD) || defined(OS_POSIX) && \
- defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0
-
- struct timespec ts;
-$NetBSD: patch-ipc_chromium_src_build_build__config.h,v 1.4 2012/04/01 15:18:45 ryoon Exp $
-
---- mozilla/ipc/chromium/src/build/build_config.h.orig 2012-03-13 01:36:53.000000000 +0000
-+++ mozilla/ipc/chromium/src/build/build_config.h
-@@ -19,6 +19,12 @@
- #define OS_MACOSX 1
- #elif defined(__linux__) || defined(ANDROID)
- #define OS_LINUX 1
-+#elif defined(__DragonFly__)
-+#define OS_DRAGONFLY 1
-+#elif defined(__FreeBSD__)
-+#define OS_FREEBSD 1
-+#elif defined(__NetBSD__)
-+#define OS_NETBSD 1
- #elif defined(__OpenBSD__)
- #define OS_OPENBSD 1
- #elif defined(_WIN32)
-@@ -27,9 +33,16 @@
- #error Please add support for your platform in build/build_config.h
- #endif
-
-+// For access to standard BSD features, use OS_BSD instead of a
-+// more specific macro.
-+#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD) \
-+ || defined(OS_NETBSD) || defined(OS_OPENBSD)
-+#define OS_BSD 1
-+#endif
-+
- // For access to standard POSIX features, use OS_POSIX instead of a more
- // specific macro.
--#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_OPENBSD)
-+#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD)
- #define OS_POSIX 1
- #endif
-
-diff --git ipc/chromium/src/chrome/common/ipc_channel_posix.cc ipc/chromium/src/chrome/common/ipc_channel_posix.cc
-index bd866ee..2ea5b19 100644
---- mozilla/ipc/chromium/src/chrome/common/ipc_channel_posix.cc
-+++ mozilla/ipc/chromium/src/chrome/common/ipc_channel_posix.cc
-@@ -7,6 +7,7 @@
- #include <errno.h>
- #include <fcntl.h>
- #include <stddef.h>
-+#include <unistd.h>
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <sys/stat.h>
-$NetBSD: patch-ipc_chromium_src_chrome_common_ipc__channel__posix.h,v 1.1 2011/07/11 12:46:14 tnn Exp $
-
---- mozilla/ipc/chromium/src/chrome/common/ipc_channel_posix.h.orig 2011-06-15 21:57:27.000000000 +0000
-+++ mozilla/ipc/chromium/src/chrome/common/ipc_channel_posix.h
-@@ -92,7 +92,7 @@ class Channel::ChannelImpl : public Mess
- };
-
- // This is a control message buffer large enough to hold kMaxReadFDs
--#if defined(OS_MACOSX)
-+#if defined(OS_MACOSX) || defined(OS_NETBSD)
- // TODO(agl): OSX appears to have non-constant CMSG macros!
- char input_cmsg_buf_[1024];
- #else
-$NetBSD: patch-ipc_chromium_src_chrome_common_ipc__message__utils.h,v 1.1 2012/03/06 12:34:09 ryoon Exp $
-
---- mozilla/ipc/chromium/src/chrome/common/ipc_message_utils.h.orig 2011-12-20 23:28:19.000000000 +0000
-+++ mozilla/ipc/chromium/src/chrome/common/ipc_message_utils.h
-@@ -195,7 +195,7 @@
- };
- #endif
-
--#if !(defined(OS_MACOSX) || defined(OS_OPENBSD) || defined(OS_WIN) || (defined(OS_LINUX) && defined(ARCH_CPU_64_BITS)) || defined(ARCH_CPU_S390))
-+#if !(defined(OS_MACOSX) || defined(OS_OPENBSD) || defined(OS_WIN) || ((defined(OS_BSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS)) || defined(ARCH_CPU_S390))
- // There size_t is a synonym for |unsigned long| ...
- template <>
- struct ParamTraits<size_t> {
-@@ -248,7 +248,7 @@
- };
- #endif // defined(OS_MACOSX)
-
--#if !(defined(OS_LINUX) && defined(ARCH_CPU_64_BITS))
-+#if !((defined(OS_BSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS))
- // int64 is |long int| on 64-bit systems, uint64 is |unsigned long|
- template <>
- struct ParamTraits<int64> {
-$NetBSD: patch-ipc_chromium_src_chrome_common_transport__dib.h,v 1.1 2012/03/06 12:34:09 ryoon Exp $
-
---- mozilla/ipc/chromium/src/chrome/common/transport_dib.h.orig 2011-12-20 23:28:19.000000000 +0000
-+++ mozilla/ipc/chromium/src/chrome/common/transport_dib.h
-@@ -7,7 +7,7 @@
-
- #include "base/basictypes.h"
-
--#if defined(OS_WIN) || defined(OS_MACOSX)
-+#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_BSD)
- #include "base/shared_memory.h"
- #endif
-
-@@ -66,7 +66,7 @@ class TransportDIB {
- uint32 sequence_num;
- };
- typedef HandleAndSequenceNum Id;
--#elif defined(OS_MACOSX)
-+#elif defined(OS_MACOSX) || defined(OS_BSD)
- typedef base::SharedMemoryHandle Handle;
- // On Mac, the inode number of the backing file is used as an id.
- typedef base::SharedMemoryId Id;
-@@ -108,7 +108,7 @@ class TransportDIB {
-
- private:
- TransportDIB();
--#if defined(OS_WIN) || defined(OS_MACOSX)
-+#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_BSD)
- explicit TransportDIB(base::SharedMemoryHandle dib);
- base::SharedMemory shared_memory_;
- uint32 sequence_num_;
-$NetBSD: patch-ipc_glue_GeckoChildProcessHost.cpp,v 1.2 2012/03/15 08:30:06 ryoon Exp $
-
---- mozilla/ipc/glue/GeckoChildProcessHost.cpp.orig 2011-12-20 23:28:19.000000000 +0000
-+++ mozilla/ipc/glue/GeckoChildProcessHost.cpp
-@@ -430,7 +430,7 @@
- // and passing wstrings from one config to the other is unsafe. So
- // we split the logic here.
-
--#if defined(OS_LINUX) || defined(OS_MACOSX)
-+#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_BSD)
- base::environment_map newEnvVars;
- // XPCOM may not be initialized in some subprocesses. We don't want
- // to initialize XPCOM just for the directory service, especially
-@@ -445,8 +445,8 @@
- if (NS_SUCCEEDED(rv)) {
- nsCString path;
- greDir->GetNativePath(path);
--# ifdef OS_LINUX
--# ifdef MOZ_WIDGET_ANDROID
-+# if defined(OS_LINUX) || defined(OS_BSD)
-+# if defined(MOZ_WIDGET_ANDROID) || defined(OS_BSD)
- path += "/lib";
- # endif // MOZ_WIDGET_ANDROID
- const char *ld_library_path = PR_GetEnv("LD_LIBRARY_PATH");
-@@ -557,7 +557,7 @@
- childArgv.push_back(pidstring);
-
- #if defined(MOZ_CRASHREPORTER)
--# if defined(OS_LINUX)
-+# if defined(OS_LINUX) || defined(OS_BSD)
- int childCrashFd, childCrashRemapFd;
- if (!CrashReporter::CreateNotificationPipeForChild(
- &childCrashFd, &childCrashRemapFd))
-@@ -594,7 +594,7 @@
- #endif
-
- base::LaunchApp(childArgv, mFileMap,
--#if defined(OS_LINUX) || defined(OS_MACOSX)
-+#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_BSD)
- newEnvVars, privs,
- #endif
- false, &process, arch);
-diff --git ipc/glue/SharedMemorySysV.h ipc/glue/SharedMemorySysV.h
-index f37998d..b05dc7b 100644
---- mozilla/ipc/glue/SharedMemorySysV.h
-+++ mozilla/ipc/glue/SharedMemorySysV.h
-@@ -8,7 +8,7 @@
- #ifndef mozilla_ipc_SharedMemorySysV_h
- #define mozilla_ipc_SharedMemorySysV_h
-
--#if defined(OS_LINUX) && !defined(ANDROID)
-+#if (defined(OS_LINUX) && !defined(ANDROID)) || defined(OS_BSD)
-
- // SysV shared memory isn't available on Windows, but we define the
- // following macro so that #ifdefs are clearer (compared to #ifdef
-$NetBSD: patch-mm,v 1.13 2012/06/05 18:09:21 ryoon Exp $
-
---- mozilla/toolkit/library/Makefile.in.orig 2012-05-23 18:57:09.000000000 +0000
-+++ mozilla/toolkit/library/Makefile.in
-@@ -534,6 +538,12 @@ EXTRA_DSO_LDOPTS += -lelf -ldemangle
- endif
- endif
-
-+ifneq (,$(filter DragonFly FreeBSD NetBSD OpenBSD,$(OS_ARCH)))
-+OS_LIBS += $(call EXPAND_LIBNAME,kvm)
-+# keep `environ' unresolved, see bug 14426 for binutils
-+EXTRA_DSO_LDOPTS += -Wl,--warn-unresolved-symbols
-+endif
-+
- ifeq ($(OS_ARCH),WINNT)
- OS_LIBS += $(call EXPAND_LIBNAME,shell32 ole32 version winspool comdlg32 imm32 msimg32 shlwapi psapi ws2_32 dbghelp rasapi32 rasdlg iphlpapi uxtheme setupapi secur32 sensorsapi portabledeviceguids windowscodecs wininet)
- ifdef ACCESSIBILITY
diff --git a/mail/thunderbird/files/patch-bug778078 b/mail/thunderbird/files/patch-bug778078
deleted file mode 100644
index 27be88312b95..000000000000
--- a/mail/thunderbird/files/patch-bug778078
+++ /dev/null
@@ -1,11 +0,0 @@
---- mozilla/toolkit/xre/nsAppRunner.cpp~
-+++ mozilla/toolkit/xre/nsAppRunner.cpp
-@@ -3833,7 +3833,7 @@ XREMain::XRE_main(int argc, char* argv[]
- ScopedLogging log;
-
- #if defined(MOZ_WIDGET_GTK)
--#ifdef MOZ_MEMORY
-+#if defined(MOZ_MEMORY) || defined(__FreeBSD__) || defined(__NetBSD__)
- // Disable the slice allocator, since jemalloc already uses similar layout
- // algorithms, and using a sub-allocator tends to increase fragmentation.
- // This must be done before g_thread_init() is called.
diff --git a/mail/thunderbird/files/patch-bug783463 b/mail/thunderbird/files/patch-bug783463
index a774272227ea..7fc8ba00f21a 100644
--- a/mail/thunderbird/files/patch-bug783463
+++ b/mail/thunderbird/files/patch-bug783463
@@ -1,14 +1,14 @@
---- mozilla/gfx/skia/Makefile.in~
-+++ mozilla/gfx/skia/Makefile.in
-@@ -339,10 +339,9 @@ CPPSRCS += \
- SkMMapStream.cpp \
- SkOSFile.cpp \
- $(NULL)
--ifeq (Linux,$(OS_TARGET))
-+ifneq (,$(or $(MOZ_X11),$(filter Linux,$(OS_TARGET))))
- CPPSRCS += \
- SkFontHost_linux.cpp \
-- SkFontHost_tables.cpp \
- SkTime_Unix.cpp \
- $(NULL)
- endif
+--- mozilla/gfx/skia/moz.build~
++++ mozilla/gfx/skia/moz.build
+@@ -188,10 +188,9 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt
+ 'SkMMapStream.cpp',
+ 'SkOSFile.cpp',
+ ]
+- if CONFIG['OS_TARGET'] == 'Linux':
++ if CONFIG['MOZ_X11'] == 1 or CONFIG['OS_TARGET'] == 'Linux':
+ CPP_SOURCES += [
+ 'SkFontHost_linux.cpp',
+- 'SkFontHost_tables.cpp',
+ 'SkThread_pthread.cpp',
+ 'SkTime_Unix.cpp',
+ ]
diff --git a/mail/thunderbird/files/patch-bug784631 b/mail/thunderbird/files/patch-bug784631
deleted file mode 100644
index 6378663b9b70..000000000000
--- a/mail/thunderbird/files/patch-bug784631
+++ /dev/null
@@ -1,52 +0,0 @@
-commit 66b3921
-Author: Terrence Cole <terrence@mozilla.com>
-Date: Tue Sep 11 12:31:04 2012 -0700
-
- Bug 784631 - Fix some clang build errors in SpiderMonkey; r=Waldo f=espindola
-
- Computed gotos are not in the C++ standard: clang and gcc differ on semantics.
----
- js/src/jsinterp.cpp | 3 ++-
- js/src/jsutil.h | 8 ++++----
- 2 files changed, 6 insertions(+), 5 deletions(-)
-
-diff --git js/src/jsinterp.cpp js/src/jsinterp.cpp
-index 0094c72..27a64a7 100644
---- mozilla/js/src/jsinterp.cpp
-+++ mozilla/js/src/jsinterp.cpp
-@@ -1231,6 +1231,7 @@ js::Interpret(JSContext *cx, StackFrame *entryFrame, InterpMode interpMode)
- RootedPropertyName rootName0(cx);
- RootedId rootId0(cx);
- RootedShape rootShape0(cx);
-+ DebugOnly<uint32_t> blockDepth;
-
- if (!entryFrame)
- entryFrame = regs.fp();
-@@ -3650,7 +3651,7 @@ BEGIN_CASE(JSOP_LEAVEBLOCK)
- BEGIN_CASE(JSOP_LEAVEFORLETIN)
- BEGIN_CASE(JSOP_LEAVEBLOCKEXPR)
- {
-- DebugOnly<uint32_t> blockDepth = regs.fp()->blockChain().stackDepth();
-+ blockDepth = regs.fp()->blockChain().stackDepth();
-
- regs.fp()->popBlock(cx);
-
-diff --git js/src/jsutil.h js/src/jsutil.h
-index 8838b6f..016a877 100644
---- mozilla/js/src/jsutil.h
-+++ mozilla/js/src/jsutil.h
-@@ -432,10 +432,10 @@ typedef size_t jsbitmap;
- #if defined(__clang__)
- # define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr) \
- JS_BEGIN_MACRO \
-- _Pragma("clang diagnostic push") \
-- _Pragma("clang diagnostic ignored \"-Wunused-value\"") \
-- expr; \
-- _Pragma("clang diagnostic pop") \
-+ _Pragma("(clang diagnostic push)") \
-+ _Pragma("(clang diagnostic ignored \"-Wunused-value\")") \
-+ {expr;} \
-+ _Pragma("(clang diagnostic pop)") \
- JS_END_MACRO
- #elif (__GNUC__ >= 5) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
- # define JS_SILENCE_UNUSED_VALUE_IN_EXPR(expr) \
diff --git a/mail/thunderbird/files/patch-bug786995 b/mail/thunderbird/files/patch-bug786995
deleted file mode 100644
index 0dc1385f5876..000000000000
--- a/mail/thunderbird/files/patch-bug786995
+++ /dev/null
@@ -1,36 +0,0 @@
-# Bug 786995 - configure should check for SSSE3 support in the whole toolchain
-
---- mozilla/configure.in.orig 2012-09-02 00:37:29.000000000 +0200
-+++ mozilla/configure.in 2012-09-02 00:38:50.000000000 +0200
-@@ -1710,15 +1710,15 @@
- _MOZ_RTTI_FLAGS_OFF=-fno-rtti
-
- # Check for -mssse3 on $CC
-- AC_MSG_CHECKING([for -mssse3 option to $CC])
-- HAVE_COMPILER_FLAG_MSSSE3=
-+ AC_MSG_CHECKING([if toolchain supports -mssse3 option])
-+ HAVE_TOOLCHAIN_SUPPORT_MSSSE3=
- _SAVE_CFLAGS=$CFLAGS
- CFLAGS="$CFLAGS -mssse3"
-- AC_TRY_COMPILE(,,AC_MSG_RESULT([yes])
-- [HAVE_COMPILER_FLAG_MSSSE3=1],
-+ AC_TRY_COMPILE([asm ("pmaddubsw %xmm2,%xmm3");],,AC_MSG_RESULT([yes])
-+ [HAVE_TOOLCHAIN_SUPPORT_MSSSE3=1],
- AC_MSG_RESULT([no]))
- CFLAGS=$_SAVE_CFLAGS
-- AC_SUBST(HAVE_COMPILER_FLAG_MSSSE3)
-+ AC_SUBST(HAVE_TOOLCHAIN_SUPPORT_MSSSE3)
-
- # Turn on GNU-specific warnings:
- # -Wall - turn on a lot of warnings
---- mozilla/gfx/skia/Makefile.in.orig 2012-09-02 00:39:00.000000000 +0200
-+++ mozilla/gfx/skia/Makefile.in 2012-09-02 00:39:21.000000000 +0200
-@@ -365,7 +365,7 @@
- SkUtils_opts_SSE2.cpp \
- opts_check_SSE2.cpp \
- $(NULL)
--ifdef HAVE_COMPILER_FLAG_MSSSE3
-+ifdef HAVE_TOOLCHAIN_SUPPORT_MSSSE3
- DEFINES += -DSK_BUILD_SSSE3
- CPPSRCS += SkBitmapProcState_opts_SSSE3.cpp
- endif
diff --git a/mail/thunderbird/files/patch-bug787904 b/mail/thunderbird/files/patch-bug787904
deleted file mode 100644
index efd1a9154581..000000000000
--- a/mail/thunderbird/files/patch-bug787904
+++ /dev/null
@@ -1,12 +0,0 @@
---- mozilla/js/src/gc/Heap.h
-+++ mozilla/js/src/gc/Heap.h
-@@ -108,7 +108,8 @@ struct Cell
- * Bug 692267: Move page size definition to gc/Memory.h and include it
- * directly once jsgc.h is no longer an installed header.
- */
--#if defined(SOLARIS) && (defined(__sparc) || defined(__sparcv9))
-+#if (defined(SOLARIS) || defined(__FreeBSD__)) && \
-+ (defined(__sparc) || defined(__sparcv9) || defined(__ia64))
- const size_t PageShift = 13;
- #else
- const size_t PageShift = 12;
diff --git a/mail/thunderbird/files/patch-bug788039 b/mail/thunderbird/files/patch-bug788039
deleted file mode 100644
index e449b5e5b1a2..000000000000
--- a/mail/thunderbird/files/patch-bug788039
+++ /dev/null
@@ -1,48 +0,0 @@
-# Bug 788039 - With no prefix search libevent via pkg-config.
-
---- mozilla/configure.in~
-+++ mozilla/configure.in
-@@ -3854,7 +3854,7 @@ fi
- dnl system libevent Support
- dnl ========================================================
- MOZ_ARG_WITH_STRING(system-libevent,
--[ --with-system-libevent=[PFX]
-+[ --with-system-libevent[=PFX]
- Use system libevent [installed at prefix PFX]],
- LIBEVENT_DIR=$withval)
-
-@@ -3863,10 +3863,11 @@ _SAVE_LDFLAGS=$LDFLAGS
- _SAVE_LIBS=$LIBS
- if test -z "$LIBEVENT_DIR" -o "$LIBEVENT_DIR" = no; then
- MOZ_NATIVE_LIBEVENT=
-+elif test "$LIBEVENT_DIR" = yes; then
-+ PKG_CHECK_MODULES(MOZ_LIBEVENT, libevent,
-+ MOZ_NATIVE_LIBEVENT=1,
-+ AC_MSG_ERROR([--with-system-libevent requested but libevent package not found]))
- else
-- if test "${LIBEVENT_DIR}" = "yes"; then
-- LIBEVENT_DIR=/usr
-- fi
- CFLAGS="-I${LIBEVENT_DIR}/include $CFLAGS"
- LDFLAGS="-L${LIBEVENT_DIR}/lib $LDFLAGS"
- MOZ_CHECK_HEADER(event.h,
-@@ -3876,16 +3877,16 @@ else
- AC_MSG_ERROR([--with-system-libevent requested but event.h not found]))
- AC_CHECK_LIB(event, event_init,
- [MOZ_NATIVE_LIBEVENT=1
-- MOZ_LIBEVENT_INCLUDES="${LIBEVENT_DIR}/include"
-+ MOZ_LIBEVENT_CFLAGS="-I${LIBEVENT_DIR}/include"
- MOZ_LIBEVENT_LIBS="-L${LIBEVENT_DIR}/lib -levent"],
-- [MOZ_NATIVE_LIBEVENT= MOZ_LIBEVENT_INCLUDES= MOZ_LIBEVENT_LIBS=])
-+ [MOZ_NATIVE_LIBEVENT= MOZ_LIBEVENT_CFLAGS= MOZ_LIBEVENT_LIBS=])
- fi
- CFLAGS=$_SAVE_CFLAGS
- LDFLAGS=$_SAVE_LDFLAGS
- LIBS=$_SAVE_LIBS
-
- AC_SUBST(MOZ_NATIVE_LIBEVENT)
--AC_SUBST(MOZ_LIBEVENT_INCLUDES)
-+AC_SUBST(MOZ_LIBEVENT_CFLAGS)
- AC_SUBST(MOZ_LIBEVENT_LIBS)
-
- dnl ========================================================
diff --git a/mail/thunderbird/files/patch-bug788108 b/mail/thunderbird/files/patch-bug788108
deleted file mode 100644
index 3e5eb72dad08..000000000000
--- a/mail/thunderbird/files/patch-bug788108
+++ /dev/null
@@ -1,20 +0,0 @@
---- mozilla/content/base/public/nsContentUtils.h~
-+++ mozilla/content/base/public/nsContentUtils.h
-@@ -18,17 +18,6 @@
- #include <ieeefp.h>
- #endif
-
--//A trick to handle IEEE floating point exceptions on FreeBSD - E.D.
--#ifdef __FreeBSD__
--#include <ieeefp.h>
--#if !defined(__i386__) && !defined(__x86_64__)
--static fp_except_t allmask = FP_X_INV|FP_X_OFL|FP_X_UFL|FP_X_DZ|FP_X_IMP;
--#else
--static fp_except_t allmask = FP_X_INV|FP_X_OFL|FP_X_UFL|FP_X_DZ|FP_X_IMP|FP_X_DNML;
--#endif
--static fp_except_t oldmask = fpsetmask(~allmask);
--#endif
--
- #include "nsAString.h"
- #include "nsIStatefulFrame.h"
- #include "nsNodeInfoManager.h"
diff --git a/mail/thunderbird/files/patch-bug788955 b/mail/thunderbird/files/patch-bug788955
deleted file mode 100644
index 3974181f4aad..000000000000
--- a/mail/thunderbird/files/patch-bug788955
+++ /dev/null
@@ -1,299 +0,0 @@
-diff --git Makefile.in Makefile.in
-index e341462..f75bd55 100644
---- mozilla/Makefile.in
-+++ mozilla/Makefile.in
-@@ -48,8 +48,10 @@ endif
- ifdef MOZ_MEMORY
- tier_base_dirs += memory/mozjemalloc
- ifdef MOZ_JEMALLOC
-+ifndef MOZ_NATIVE_JEMALLOC
- tier_base_dirs += memory/jemalloc
- endif
-+endif
- tier_base_dirs += memory/build
- endif
- ifndef MOZ_NATIVE_ZLIB
-diff --git allmakefiles.sh allmakefiles.sh
-index 6a9be4b..d2e49e3 100755
---- mozilla/allmakefiles.sh
-+++ mozilla/allmakefiles.sh
-@@ -59,7 +59,7 @@ if [ ! "$LIBXUL_SDK" ]; then
- mozglue/Makefile
- mozglue/build/Makefile
- "
-- if [ "$MOZ_JEMALLOC" ]; then
-+ if [ "$MOZ_JEMALLOC" -a -z "$MOZ_NATIVE_JEMALLOC" ]; then
- add_makefiles "
- memory/jemalloc/Makefile
- "
-diff --git configure.in configure.in
-index bb05782..2f32516 100644
---- mozilla/configure.in
-+++ mozilla/configure.in
-@@ -3711,21 +3711,22 @@ fi
-
- dnl Check for the existence of various allocation headers/functions
-
-+MALLOC_HEADERS="malloc.h malloc_np.h malloc/malloc.h sys/malloc.h"
- MALLOC_H=
--MOZ_CHECK_HEADER(malloc.h, [MALLOC_H=malloc.h])
--if test "$MALLOC_H" = ""; then
-- MOZ_CHECK_HEADER(malloc/malloc.h, [MALLOC_H=malloc/malloc.h])
-- if test "$MALLOC_H" = ""; then
-- MOZ_CHECK_HEADER(sys/malloc.h, [MALLOC_H=sys/malloc.h])
-+
-+for file in $MALLOC_HEADERS; do
-+ MOZ_CHECK_HEADER($file, [MALLOC_H=$file])
-+ if test "$MALLOC_H" != ""; then
-+ AC_DEFINE_UNQUOTED(MALLOC_H, <$MALLOC_H>)
-+ break
- fi
--fi
--if test "$MALLOC_H" != ""; then
-- AC_DEFINE_UNQUOTED(MALLOC_H, <$MALLOC_H>)
--fi
-+done
-
- MOZ_ALLOCATING_FUNCS="strndup posix_memalign memalign valloc"
- AC_CHECK_FUNCS(strndup posix_memalign memalign valloc)
-
-+AC_CHECK_FUNCS(malloc_usable_size)
-+
- dnl See if compiler supports some gcc-style attributes
-
- AC_CACHE_CHECK(for __attribute__((always_inline)),
-@@ -6939,6 +6940,18 @@ else
- fi
-
- if test -z "$MOZ_MEMORY"; then
-+ if test -n "$MOZ_JEMALLOC"; then
-+ MOZ_NATIVE_JEMALLOC=1
-+ AC_CHECK_FUNCS(mallctl nallocm,,
-+ [MOZ_NATIVE_JEMALLOC=
-+ break])
-+ if test -n "$MOZ_NATIVE_JEMALLOC"; then
-+ MOZ_MEMORY=1
-+ AC_DEFINE(MOZ_MEMORY)
-+ AC_DEFINE(MOZ_JEMALLOC)
-+ AC_DEFINE(MOZ_NATIVE_JEMALLOC)
-+ fi
-+ fi
- case "${target}" in
- *-mingw*)
- if test -z "$WIN32_REDIST_DIR" -a -z "$MOZ_DEBUG"; then
-@@ -7033,6 +7046,7 @@ else
- fi # MOZ_MEMORY
- AC_SUBST(MOZ_MEMORY)
- AC_SUBST(MOZ_JEMALLOC)
-+AC_SUBST(MOZ_NATIVE_JEMALLOC)
- AC_SUBST(MOZ_GLUE_LDFLAGS)
- AC_SUBST(MOZ_GLUE_PROGRAM_LDFLAGS)
- AC_SUBST(WIN32_CRT_LIBS)
-@@ -8820,10 +8834,22 @@ fi
-
- # Run jemalloc configure script
-
--if test "$MOZ_JEMALLOC" -a "$MOZ_MEMORY"; then
-+if test -z "$MOZ_NATIVE_JEMALLOC" -a "$MOZ_JEMALLOC" -a "$MOZ_MEMORY" ; then
- ac_configure_args="$_SUBDIR_CONFIG_ARGS --build=$build --host=$target --enable-stats --with-jemalloc-prefix=je_"
-- if test "$OS_ARCH" = "Linux"; then
-- MANGLE="malloc calloc valloc free realloc memalign posix_memalign malloc_usable_size"
-+ case "$OS_ARCH" in
-+ Linux|DragonFly|FreeBSD|NetBSD|OpenBSD)
-+ MANGLE="malloc calloc valloc free realloc posix_memalign"
-+ case "$OS_ARCH" in
-+ Linux)
-+ MANGLE="$MANGLE memalign malloc_usable_size"
-+ ;;
-+ FreeBSD)
-+ MANGLE="$MANGLE malloc_usable_size"
-+ ;;
-+ esac
-+ ;;
-+ esac
-+ if test -n "$MANGLE"; then
- MANGLED=
- JEMALLOC_WRAPPER=
- if test -n "$_WRAP_MALLOC"; then
-diff --git memory/build/Makefile.in memory/build/Makefile.in
-index dca0f48..af93ee0 100644
---- mozilla/memory/build/Makefile.in
-+++ mozilla/memory/build/Makefile.in
-@@ -22,7 +22,9 @@ CSRCS = extraMallocFuncs.c
-
- ifdef MOZ_JEMALLOC
- CSRCS += mozjemalloc_compat.c
-+ifndef MOZ_NATIVE_JEMALLOC
- SHARED_LIBRARY_LIBS += $(call EXPAND_LIBNAME_PATH,jemalloc,$(DEPTH)/memory/jemalloc)
-+endif
- else
- SHARED_LIBRARY_LIBS += $(call EXPAND_LIBNAME_PATH,jemalloc,$(DEPTH)/memory/mozjemalloc)
- endif
-diff --git memory/build/extraMallocFuncs.c memory/build/extraMallocFuncs.c
-index 9d87629..03c8320 100644
---- mozilla/memory/build/extraMallocFuncs.c
-+++ mozilla/memory/build/extraMallocFuncs.c
-@@ -94,8 +94,16 @@ wrap(wcsdup)(const wchar_t *src)
- #endif
-
- #ifdef MOZ_JEMALLOC
-+
-+#undef wrap
-+#if defined(MOZ_NATIVE_JEMALLOC)
-+#define wrap(a) a
-+#else
-+#define wrap(a) je_ ## a
-+#endif
-+
- /* Override some jemalloc defaults */
--const char *je_malloc_conf = "narenas:1,lg_chunk:20";
-+MOZ_EXPORT_DATA(const char *) wrap(malloc_conf) = "narenas:1,lg_chunk:20";
-
- #ifdef ANDROID
- #include <android/log.h>
-diff --git memory/build/mozjemalloc_compat.c memory/build/mozjemalloc_compat.c
-index 10a845a..94ad96e 100644
---- mozilla/memory/build/mozjemalloc_compat.c
-+++ mozilla/memory/build/mozjemalloc_compat.c
-@@ -5,14 +5,21 @@
- #include "mozilla/Types.h"
- #include "jemalloc_types.h"
-
--extern int je_mallctl(const char*, void*, size_t*, void*, size_t);
-+#if defined(MOZ_NATIVE_JEMALLOC)
-+#define wrap(a) a
-+#else
-+#define wrap(a) je_ ## a
-+#endif
-
--MOZ_EXPORT_API (void)
-+extern MOZ_IMPORT_API(int)
-+wrap(mallctl)(const char*, void*, size_t*, void*, size_t);
-+
-+MOZ_EXPORT_API(void)
- jemalloc_stats(jemalloc_stats_t *stats)
- {
- size_t size = sizeof(stats->mapped);
-- je_mallctl("stats.mapped", &stats->mapped, &size, NULL, 0);
-- je_mallctl("stats.allocated", &stats->allocated, &size, NULL, 0);
-+ wrap(mallctl)("stats.mapped", &stats->mapped, &size, NULL, 0);
-+ wrap(mallctl)("stats.allocated", &stats->allocated, &size, NULL, 0);
- stats->committed = -1;
- stats->dirty = -1;
- }
-diff --git memory/jemalloc/src/src/mutex.c memory/jemalloc/src/src/mutex.c
-index 37a843e..55e18c2 100644
---- mozilla/memory/jemalloc/src/src/mutex.c
-+++ mozilla/memory/jemalloc/src/src/mutex.c
-@@ -64,7 +64,7 @@ pthread_create(pthread_t *__restrict thread,
- /******************************************************************************/
-
- #ifdef JEMALLOC_MUTEX_INIT_CB
--int _pthread_mutex_init_calloc_cb(pthread_mutex_t *mutex,
-+JEMALLOC_EXPORT int _pthread_mutex_init_calloc_cb(pthread_mutex_t *mutex,
- void *(calloc_cb)(size_t, size_t));
- #endif
-
-diff --git memory/mozalloc/mozalloc.cpp memory/mozalloc/mozalloc.cpp
-index 5b61050b..5b3399a 100644
---- mozilla/memory/mozalloc/mozalloc.cpp
-+++ mozilla/memory/mozalloc/mozalloc.cpp
-@@ -12,16 +12,13 @@
- #include <sys/types.h>
-
- #if defined(MALLOC_H)
--# include MALLOC_H // for memalign, valloc where available
-+# include MALLOC_H // for memalign, valloc, malloc_size, malloc_usable_size
- #endif // if defined(MALLOC_H)
- #include <stddef.h> // for size_t
- #include <stdlib.h> // for malloc, free
- #if defined(XP_UNIX)
- # include <unistd.h> // for valloc on *BSD
- #endif //if defined(XP_UNIX)
--#if defined(__FreeBSD__)
--# include <malloc_np.h> // for malloc_usable_size
--#endif // if defined(__FreeBSD__)
-
- #if defined(XP_WIN) || (defined(XP_OS2) && defined(__declspec))
- # define MOZALLOC_EXPORT __declspec(dllexport)
-@@ -213,8 +210,7 @@ moz_malloc_usable_size(void *ptr)
-
- #if defined(XP_MACOSX)
- return malloc_size(ptr);
--#elif defined(MOZ_MEMORY) || (defined(XP_LINUX) && !defined(ANDROID)) || defined(__FreeBSD__)
-- // Android bionic libc doesn't have malloc_usable_size.
-+#elif defined(HAVE_MALLOC_USABLE_SIZE) || defined(MOZ_MEMORY)
- return malloc_usable_size(ptr);
- #elif defined(XP_WIN)
- return _msize(ptr);
-diff --git memory/mozjemalloc/jemalloc.h memory/mozjemalloc/jemalloc.h
-index f0e0878..2486e83 100644
---- mozilla/memory/mozjemalloc/jemalloc.h
-+++ mozilla/memory/mozjemalloc/jemalloc.h
-@@ -37,22 +37,29 @@
- #endif
- #include "jemalloc_types.h"
-
-+#if defined(MOZ_NATIVE_JEMALLOC)
-+#define wrap(a) a
-+#else
-+#define wrap(a) je_ ## a
-+#endif
-+
- #ifdef __cplusplus
- extern "C" {
- #endif
-
--#if defined(MOZ_MEMORY_LINUX)
-+#if defined(MOZ_NATIVE_JEMALLOC) \
-+ || defined(MOZ_MEMORY_LINUX) || defined(MOZ_MEMORY_BSD)
- __attribute__((weak))
- #endif
- void jemalloc_stats(jemalloc_stats_t *stats);
-
- /* Computes the usable size in advance. */
- #if !defined(MOZ_MEMORY_DARWIN)
--#if defined(MOZ_MEMORY_LINUX)
-+#if defined(MOZ_MEMORY_LINUX) || defined(MOZ_MEMORY_BSD)
- __attribute__((weak))
- #endif
- #if defined(MOZ_JEMALLOC)
--int je_nallocm(size_t *rsize, size_t size, int flags);
-+MOZ_IMPORT_API(int) wrap(nallocm)(size_t *rsize, size_t size, int flags);
- #else
- size_t je_malloc_good_size(size_t size);
- #endif
-@@ -62,11 +69,11 @@ static inline size_t je_malloc_usable_size_in_advance(size_t size) {
- #if defined(MOZ_MEMORY_DARWIN)
- return malloc_good_size(size);
- #elif defined(MOZ_JEMALLOC)
-- if (je_nallocm) {
-+ if (wrap(nallocm)) {
- size_t ret;
- if (size == 0)
- size = 1;
-- if (!je_nallocm(&ret, size, 0))
-+ if (!wrap(nallocm)(&ret, size, 0))
- return ret;
- }
- return size;
-@@ -113,4 +120,6 @@ void jemalloc_purge_freed_pages();
- } /* extern "C" */
- #endif
-
-+#undef wrap
-+
- #endif /* _JEMALLOC_H_ */
-diff --git mozglue/build/Makefile.in mozglue/build/Makefile.in
-index c333647..15ba505 100644
---- mozilla/mozglue/build/Makefile.in
-+++ mozilla/mozglue/build/Makefile.in
-@@ -23,7 +23,7 @@ FORCE_STATIC_LIB = 1
- endif
-
- # Keep jemalloc separated when mozglue is statically linked
--ifeq (1_1,$(MOZ_MEMORY)_$(FORCE_SHARED_LIB))
-+ifeq (1_1,$(MOZ_MEMORY)_$(or $(MOZ_NATIVE_JEMALLOC),$(FORCE_SHARED_LIB)))
- SHARED_LIBRARY_LIBS = $(call EXPAND_LIBNAME_PATH,memory,$(DEPTH)/memory/build)
- else
- # Temporary, until bug 662814 lands
diff --git a/mail/thunderbird/files/patch-bug789436 b/mail/thunderbird/files/patch-bug789436
deleted file mode 100644
index 2479d8e69c78..000000000000
--- a/mail/thunderbird/files/patch-bug789436
+++ /dev/null
@@ -1,27 +0,0 @@
---- mozilla/toolkit/xre/nsAppRunner.cpp~
-+++ mozilla/toolkit/xre/nsAppRunner.cpp
-@@ -1388,11 +1388,6 @@ static int MSCRTReportHook( int aReportType, char *aMessage, int *oReturnValue)
-
- #endif
-
--#if defined(FREEBSD)
--// pick up fpsetmask prototype.
--#include <ieeefp.h>
--#endif
--
- static inline void
- DumpVersion()
- {
-@@ -4136,12 +4131,5 @@ SetupErrorHandling(const char* progname)
-
- // Unbuffer stdout, needed for tinderbox tests.
- setbuf(stdout, 0);
--
--#if defined(FREEBSD)
-- // Disable all SIGFPE's on FreeBSD, as it has non-IEEE-conformant fp
-- // trap behavior that trips up on floating-point tests performed by
-- // the JS engine. See bugzilla bug 9967 details.
-- fpsetmask(0);
--#endif
- }
-
diff --git a/mail/thunderbird/files/patch-bug789656 b/mail/thunderbird/files/patch-bug789656
deleted file mode 100644
index 17f1419897cc..000000000000
--- a/mail/thunderbird/files/patch-bug789656
+++ /dev/null
@@ -1,11 +0,0 @@
---- mozilla/media/libopus/Makefile.in~
-+++ mozilla/media/libopus/Makefile.in
-@@ -20,7 +20,7 @@ DEFINES += \
- -Drestrict= \
- $(NULL)
-
--ifneq ($(filter $(OS_ARCH),Linux Darwin),)
-+ifneq ($(filter $(OS_ARCH),Linux Darwin DragonFly FreeBSD NetBSD OpenBSD),)
- DEFINES += -DHAVE_LRINTF
- endif
- ifeq ($(OS_ARCH), WINNT)
diff --git a/mail/thunderbird/files/patch-bug789693 b/mail/thunderbird/files/patch-bug789693
deleted file mode 100644
index f88228f5498b..000000000000
--- a/mail/thunderbird/files/patch-bug789693
+++ /dev/null
@@ -1,109 +0,0 @@
---- mozilla/toolkit/components/startup/nsAppStartup.cpp
-+++ mozilla/toolkit/components/startup/nsAppStartup.cpp
-@@ -50,18 +50,41 @@
- #include <sys/syscall.h>
- #endif
-
--#ifdef XP_MACOSX
-+#if defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \
-+ || defined(__NetBSD__) || defined(__OpenBSD__)
-+#include <sys/param.h>
- #include <sys/sysctl.h>
- #endif
-
--#ifdef __OpenBSD__
--#include <sys/param.h>
--#include <sys/sysctl.h>
-+#if defined(__DragonFly__) || defined(__FreeBSD__)
-+#include <sys/user.h>
- #endif
-
- #include "mozilla/Telemetry.h"
- #include "mozilla/StartupTimeline.h"
-
-+#if defined(__NetBSD__)
-+#undef KERN_PROC
-+#define KERN_PROC KERN_PROC2
-+#define KINFO_PROC struct kinfo_proc2
-+#else
-+#define KINFO_PROC struct kinfo_proc
-+#endif
-+
-+#if defined(XP_MACOSX)
-+#define KP_START_SEC kp_proc.p_un.__p_starttime.tv_sec
-+#define KP_START_USEC kp_proc.p_un.__p_starttime.tv_usec
-+#elif defined(__DragonFly__)
-+#define KP_START_SEC kp_start.tv_sec
-+#define KP_START_USEC kp_start.tv_usec
-+#elif defined(__FreeBSD__)
-+#define KP_START_SEC ki_start.tv_sec
-+#define KP_START_USEC ki_start.tv_usec
-+#else
-+#define KP_START_SEC p_ustart_sec
-+#define KP_START_USEC p_ustart_usec
-+#endif
-+
- static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);
-
- #define kPrefLastSuccess "toolkit.startup.last_success"
-@@ -836,42 +859,30 @@ CalculateProcessCreationTimestamp()
- #endif
- return timestamp;
- }
--#elif defined(XP_MACOSX)
-+#elif defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \
-+ || defined(__NetBSD__) || defined(__OpenBSD__)
- static PRTime
- CalculateProcessCreationTimestamp()
- {
-- int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid() };
-- size_t buffer_size;
-- if (sysctl(mib, 4, NULL, &buffer_size, NULL, 0))
-- return 0;
-+ int mib[] = {
-+ CTL_KERN,
-+ KERN_PROC,
-+ KERN_PROC_PID,
-+ getpid(),
-+#if defined(__NetBSD__) || defined(__OpenBSD__)
-+ sizeof(KINFO_PROC),
-+ 1,
-+#endif
-+ };
-+ u_int miblen = sizeof(mib) / sizeof(mib[0]);
-
-- struct kinfo_proc *proc = (kinfo_proc*) malloc(buffer_size);
-- if (sysctl(mib, 4, proc, &buffer_size, NULL, 0)) {
-- free(proc);
-- return 0;
-- }
-- PRTime starttime = static_cast<PRTime>(proc->kp_proc.p_un.__p_starttime.tv_sec) * PR_USEC_PER_SEC;
-- starttime += proc->kp_proc.p_un.__p_starttime.tv_usec;
-- free(proc);
-- return starttime;
--}
--#elif defined(__OpenBSD__)
--static PRTime
--CalculateProcessCreationTimestamp()
--{
-- int mib[6] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid(), sizeof(struct kinfo_proc), 1 };
-- size_t buffer_size;
-- if (sysctl(mib, 6, NULL, &buffer_size, NULL, 0))
-+ KINFO_PROC proc;
-+ size_t buffer_size = sizeof(proc);
-+ if (sysctl(mib, miblen, &proc, &buffer_size, NULL, 0))
- return 0;
-
-- struct kinfo_proc *proc = (struct kinfo_proc*) malloc(buffer_size);
-- if (sysctl(mib, 6, proc, &buffer_size, NULL, 0)) {
-- free(proc);
-- return 0;
-- }
-- PRTime starttime = static_cast<PRTime>(proc->p_ustart_sec) * PR_USEC_PER_SEC;
-- starttime += proc->p_ustart_usec;
-- free(proc);
-+ PRTime starttime = static_cast<PRTime>(proc.KP_START_SEC) * PR_USEC_PER_SEC;
-+ starttime += proc.KP_START_USEC;
- return starttime;
- }
- #else
diff --git a/mail/thunderbird/files/patch-bug791305 b/mail/thunderbird/files/patch-bug791305
index e4c44a405f57..633415128199 100644
--- a/mail/thunderbird/files/patch-bug791305
+++ b/mail/thunderbird/files/patch-bug791305
@@ -15,93 +15,383 @@ Date: Fri Sep 14 15:54:55 2012 -0400
image/decoders/nsJPEGDecoder.cpp | 311 ++-------------------------------------
2 files changed, 20 insertions(+), 297 deletions(-)
+diff --git configure.in configure.in
+index f0aeb5d..1c01010 100644
+--- mozilla/configure.in
++++ mozilla/configure.in
+@@ -4027,11 +4027,7 @@ if test "$MOZ_NATIVE_JPEG" = 1; then
+ #include <jpeglib.h> ],
+ [ #if JPEG_LIB_VERSION < $MOZJPEG
+ #error "Insufficient JPEG library version ($MOZJPEG required)."
+- #endif
+- #ifndef JCS_EXTENSIONS
+- #error "libjpeg-turbo JCS_EXTENSIONS required"
+- #endif
+- ],
++ #endif ],
+ MOZ_NATIVE_JPEG=1,
+ AC_MSG_ERROR([Insufficient JPEG library version for --with-system-jpeg]))
+ fi
diff --git mozilla/image/decoders/nsJPEGDecoder.cpp mozilla/image/decoders/nsJPEGDecoder.cpp
-index c1fb515..1d2a259 100644
+index 8fa8200..1d2a259 100644
--- mozilla/image/decoders/nsJPEGDecoder.cpp
+++ mozilla/image/decoders/nsJPEGDecoder.cpp
-@@ -22,6 +22,13 @@
+@@ -21,13 +21,28 @@
+
extern "C" {
#include "iccjpeg.h"
+-}
+#ifdef JCS_EXTENSIONS
-+#if defined(IS_BIG_ENDIAN)
-+#define MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB JCS_EXT_XRGB
-+#else
-+#define MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB JCS_EXT_BGRX
-+#endif
+ #if defined(IS_BIG_ENDIAN)
+ #define MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB JCS_EXT_XRGB
+ #else
+ #define MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB JCS_EXT_BGRX
+ #endif
+#else
- /* Colorspace conversion (copied from jpegint.h) */
- struct jpeg_color_deconverter {
- JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
-@@ -34,6 +41,7 @@ METHODDEF(void)
- ycc_rgb_convert_argb (j_decompress_ptr cinfo,
- JSAMPIMAGE input_buf, JDIMENSION input_row,
- JSAMPARRAY output_buf, int num_rows);
++/* Colorspace conversion (copied from jpegint.h) */
++struct jpeg_color_deconverter {
++ JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
++ JMETHOD(void, color_convert, (j_decompress_ptr cinfo,
++ JSAMPIMAGE input_buf, JDIMENSION input_row,
++ JSAMPARRAY output_buf, int num_rows));
++};
++
++METHODDEF(void)
++ycc_rgb_convert_argb (j_decompress_ptr cinfo,
++ JSAMPIMAGE input_buf, JDIMENSION input_row,
++ JSAMPARRAY output_buf, int num_rows);
+#endif
- }
++}
static void cmyk_convert_rgb(JSAMPROW row, JDIMENSION width);
-@@ -329,7 +340,18 @@ nsJPEGDecoder::WriteInternal(const char *aBuffer, PRUint32 aCount)
+
+@@ -324,6 +340,7 @@ nsJPEGDecoder::WriteInternal(const char *aBuffer, uint32_t aCount)
case JCS_GRAYSCALE:
case JCS_RGB:
case JCS_YCbCr:
+#ifdef JCS_EXTENSIONS
-+ // if we're not color managing we can decode directly to
-+ // MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB
-+ if (mCMSMode != eCMSMode_All) {
-+ mInfo.out_color_space = MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB;
-+ mInfo.out_color_components = 4;
-+ } else {
-+ mInfo.out_color_space = JCS_RGB;
-+ }
+ // if we're not color managing we can decode directly to
+ // MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB
+ if (mCMSMode != eCMSMode_All) {
+@@ -332,6 +349,9 @@ nsJPEGDecoder::WriteInternal(const char *aBuffer, uint32_t aCount)
+ } else {
+ mInfo.out_color_space = JCS_RGB;
+ }
+#else
- mInfo.out_color_space = JCS_RGB;
++ mInfo.out_color_space = JCS_RGB;
+#endif
break;
case JCS_CMYK:
case JCS_YCCK:
-@@ -397,6 +419,7 @@ nsJPEGDecoder::WriteInternal(const char *aBuffer, PRUint32 aCount)
+@@ -399,6 +419,15 @@ nsJPEGDecoder::WriteInternal(const char *aBuffer, uint32_t aCount)
return; /* I/O suspension */
}
+#ifndef JCS_EXTENSIONS
- /* Force to use our YCbCr to Packed RGB converter when possible */
- if (!mTransform && (mCMSMode != eCMSMode_All) &&
- mInfo.jpeg_color_space == JCS_YCbCr && mInfo.out_color_space == JCS_RGB) {
-@@ -404,6 +427,7 @@ nsJPEGDecoder::WriteInternal(const char *aBuffer, PRUint32 aCount)
- mInfo.out_color_components = 4; /* Packed ARGB pixels are always 4 bytes...*/
- mInfo.cconvert->color_convert = ycc_rgb_convert_argb;
- }
++ /* Force to use our YCbCr to Packed RGB converter when possible */
++ if (!mTransform && (mCMSMode != eCMSMode_All) &&
++ mInfo.jpeg_color_space == JCS_YCbCr && mInfo.out_color_space == JCS_RGB) {
++ /* Special case for the most common case: transform from YCbCr direct into packed ARGB */
++ mInfo.out_color_components = 4; /* Packed ARGB pixels are always 4 bytes...*/
++ mInfo.cconvert->color_convert = ycc_rgb_convert_argb;
++ }
+#endif
/* If this is a progressive JPEG ... */
mState = mInfo.buffered_image ? JPEG_DECOMPRESS_PROGRESSIVE : JPEG_DECOMPRESS_SEQUENTIAL;
-@@ -542,7 +566,11 @@ nsJPEGDecoder::OutputScanlines(bool* suspend)
- PRUint32 *imageRow = ((PRUint32*)mImageData) +
+@@ -544,7 +573,11 @@ nsJPEGDecoder::OutputScanlines(bool* suspend)
+ uint32_t *imageRow = ((uint32_t*)mImageData) +
(mInfo.output_scanline * mInfo.output_width);
+#ifdef JCS_EXTENSIONS
-+ if (mInfo.out_color_space == MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB) {
+ if (mInfo.out_color_space == MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB) {
+#else
- if (mInfo.cconvert->color_convert == ycc_rgb_convert_argb) {
++ if (mInfo.cconvert->color_convert == ycc_rgb_convert_argb) {
+#endif
/* Special case: scanline will be directly converted into packed ARGB */
if (jpeg_read_scanlines(&mInfo, (JSAMPARRAY)&imageRow, 1) != 1) {
*suspend = true; /* suspend */
-@@ -858,6 +887,7 @@ term_source (j_decompress_ptr jd)
+@@ -854,6 +887,282 @@ term_source (j_decompress_ptr jd)
} // namespace mozilla
+#ifndef JCS_EXTENSIONS
- /**************** YCbCr -> Cairo's RGB24/ARGB32 conversion: most common case **************/
-
- /*
-@@ -1130,7 +1160,8 @@ ycc_rgb_convert_argb (j_decompress_ptr cinfo,
- }
- }
- }
++/**************** YCbCr -> Cairo's RGB24/ARGB32 conversion: most common case **************/
++
++/*
++ * YCbCr is defined per CCIR 601-1, except that Cb and Cr are
++ * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.
++ * The conversion equations to be implemented are therefore
++ * R = Y + 1.40200 * Cr
++ * G = Y - 0.34414 * Cb - 0.71414 * Cr
++ * B = Y + 1.77200 * Cb
++ * where Cb and Cr represent the incoming values less CENTERJSAMPLE.
++ * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.)
++ *
++ * To avoid floating-point arithmetic, we represent the fractional constants
++ * as integers scaled up by 2^16 (about 4 digits precision); we have to divide
++ * the products by 2^16, with appropriate rounding, to get the correct answer.
++ * Notice that Y, being an integral input, does not contribute any fraction
++ * so it need not participate in the rounding.
++ *
++ * For even more speed, we avoid doing any multiplications in the inner loop
++ * by precalculating the constants times Cb and Cr for all possible values.
++ * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table);
++ * for 12-bit samples it is still acceptable. It's not very reasonable for
++ * 16-bit samples, but if you want lossless storage you shouldn't be changing
++ * colorspace anyway.
++ * The Cr=>R and Cb=>B values can be rounded to integers in advance; the
++ * values for the G calculation are left scaled up, since we must add them
++ * together before rounding.
++ */
++
++#define SCALEBITS 16 /* speediest right-shift on some machines */
++
++/* Use static tables for color processing. */
++/* Four tables, each 256 entries of 4 bytes totals 4K which is not bad... */
++
++const int Cr_r_tab[(MAXJSAMPLE+1) * sizeof(int)] ={
++ -0xb3, -0xb2, -0xb1, -0xaf, -0xae, -0xac,
++ -0xab, -0xaa, -0xa8, -0xa7, -0xa5, -0xa4,
++ -0xa3, -0xa1, -0xa0, -0x9e, -0x9d, -0x9c,
++ -0x9a, -0x99, -0x97, -0x96, -0x95, -0x93,
++ -0x92, -0x90, -0x8f, -0x8e, -0x8c, -0x8b,
++ -0x89, -0x88, -0x87, -0x85, -0x84, -0x82,
++ -0x81, -0x80, -0x7e, -0x7d, -0x7b, -0x7a,
++ -0x79, -0x77, -0x76, -0x74, -0x73, -0x72,
++ -0x70, -0x6f, -0x6d, -0x6c, -0x6b, -0x69,
++ -0x68, -0x66, -0x65, -0x64, -0x62, -0x61,
++ -0x5f, -0x5e, -0x5d, -0x5b, -0x5a, -0x58,
++ -0x57, -0x56, -0x54, -0x53, -0x51, -0x50,
++ -0x4f, -0x4d, -0x4c, -0x4a, -0x49, -0x48,
++ -0x46, -0x45, -0x43, -0x42, -0x40, -0x3f,
++ -0x3e, -0x3c, -0x3b, -0x39, -0x38, -0x37,
++ -0x35, -0x34, -0x32, -0x31, -0x30, -0x2e,
++ -0x2d, -0x2b, -0x2a, -0x29, -0x27, -0x26,
++ -0x24, -0x23, -0x22, -0x20, -0x1f, -0x1d,
++ -0x1c, -0x1b, -0x19, -0x18, -0x16, -0x15,
++ -0x14, -0x12, -0x11, -0x0f, -0x0e, -0x0d,
++ -0x0b, -0x0a, -0x08, -0x07, -0x06, -0x04,
++ -0x03, -0x01, 0x00, 0x01, 0x03, 0x04,
++ 0x06, 0x07, 0x08, 0x0a, 0x0b, 0x0d,
++ 0x0e, 0x0f, 0x11, 0x12, 0x14, 0x15,
++ 0x16, 0x18, 0x19, 0x1b, 0x1c, 0x1d,
++ 0x1f, 0x20, 0x22, 0x23, 0x24, 0x26,
++ 0x27, 0x29, 0x2a, 0x2b, 0x2d, 0x2e,
++ 0x30, 0x31, 0x32, 0x34, 0x35, 0x37,
++ 0x38, 0x39, 0x3b, 0x3c, 0x3e, 0x3f,
++ 0x40, 0x42, 0x43, 0x45, 0x46, 0x48,
++ 0x49, 0x4a, 0x4c, 0x4d, 0x4f, 0x50,
++ 0x51, 0x53, 0x54, 0x56, 0x57, 0x58,
++ 0x5a, 0x5b, 0x5d, 0x5e, 0x5f, 0x61,
++ 0x62, 0x64, 0x65, 0x66, 0x68, 0x69,
++ 0x6b, 0x6c, 0x6d, 0x6f, 0x70, 0x72,
++ 0x73, 0x74, 0x76, 0x77, 0x79, 0x7a,
++ 0x7b, 0x7d, 0x7e, 0x80, 0x81, 0x82,
++ 0x84, 0x85, 0x87, 0x88, 0x89, 0x8b,
++ 0x8c, 0x8e, 0x8f, 0x90, 0x92, 0x93,
++ 0x95, 0x96, 0x97, 0x99, 0x9a, 0x9c,
++ 0x9d, 0x9e, 0xa0, 0xa1, 0xa3, 0xa4,
++ 0xa5, 0xa7, 0xa8, 0xaa, 0xab, 0xac,
++ 0xae, 0xaf, 0xb1, 0xb2,
++ };
++
++const int Cb_b_tab[(MAXJSAMPLE+1) * sizeof(int)] ={
++ -0xe3, -0xe1, -0xdf, -0xde, -0xdc, -0xda,
++ -0xd8, -0xd6, -0xd5, -0xd3, -0xd1, -0xcf,
++ -0xce, -0xcc, -0xca, -0xc8, -0xc6, -0xc5,
++ -0xc3, -0xc1, -0xbf, -0xbe, -0xbc, -0xba,
++ -0xb8, -0xb7, -0xb5, -0xb3, -0xb1, -0xaf,
++ -0xae, -0xac, -0xaa, -0xa8, -0xa7, -0xa5,
++ -0xa3, -0xa1, -0x9f, -0x9e, -0x9c, -0x9a,
++ -0x98, -0x97, -0x95, -0x93, -0x91, -0x90,
++ -0x8e, -0x8c, -0x8a, -0x88, -0x87, -0x85,
++ -0x83, -0x81, -0x80, -0x7e, -0x7c, -0x7a,
++ -0x78, -0x77, -0x75, -0x73, -0x71, -0x70,
++ -0x6e, -0x6c, -0x6a, -0x69, -0x67, -0x65,
++ -0x63, -0x61, -0x60, -0x5e, -0x5c, -0x5a,
++ -0x59, -0x57, -0x55, -0x53, -0x52, -0x50,
++ -0x4e, -0x4c, -0x4a, -0x49, -0x47, -0x45,
++ -0x43, -0x42, -0x40, -0x3e, -0x3c, -0x3a,
++ -0x39, -0x37, -0x35, -0x33, -0x32, -0x30,
++ -0x2e, -0x2c, -0x2b, -0x29, -0x27, -0x25,
++ -0x23, -0x22, -0x20, -0x1e, -0x1c, -0x1b,
++ -0x19, -0x17, -0x15, -0x13, -0x12, -0x10,
++ -0x0e, -0x0c, -0x0b, -0x09, -0x07, -0x05,
++ -0x04, -0x02, 0x00, 0x02, 0x04, 0x05,
++ 0x07, 0x09, 0x0b, 0x0c, 0x0e, 0x10,
++ 0x12, 0x13, 0x15, 0x17, 0x19, 0x1b,
++ 0x1c, 0x1e, 0x20, 0x22, 0x23, 0x25,
++ 0x27, 0x29, 0x2b, 0x2c, 0x2e, 0x30,
++ 0x32, 0x33, 0x35, 0x37, 0x39, 0x3a,
++ 0x3c, 0x3e, 0x40, 0x42, 0x43, 0x45,
++ 0x47, 0x49, 0x4a, 0x4c, 0x4e, 0x50,
++ 0x52, 0x53, 0x55, 0x57, 0x59, 0x5a,
++ 0x5c, 0x5e, 0x60, 0x61, 0x63, 0x65,
++ 0x67, 0x69, 0x6a, 0x6c, 0x6e, 0x70,
++ 0x71, 0x73, 0x75, 0x77, 0x78, 0x7a,
++ 0x7c, 0x7e, 0x80, 0x81, 0x83, 0x85,
++ 0x87, 0x88, 0x8a, 0x8c, 0x8e, 0x90,
++ 0x91, 0x93, 0x95, 0x97, 0x98, 0x9a,
++ 0x9c, 0x9e, 0x9f, 0xa1, 0xa3, 0xa5,
++ 0xa7, 0xa8, 0xaa, 0xac, 0xae, 0xaf,
++ 0xb1, 0xb3, 0xb5, 0xb7, 0xb8, 0xba,
++ 0xbc, 0xbe, 0xbf, 0xc1, 0xc3, 0xc5,
++ 0xc6, 0xc8, 0xca, 0xcc, 0xce, 0xcf,
++ 0xd1, 0xd3, 0xd5, 0xd6, 0xd8, 0xda,
++ 0xdc, 0xde, 0xdf, 0xe1,
++ };
++
++const int Cr_g_tab[(MAXJSAMPLE+1) * sizeof(int)] ={
++ 0x5b6900, 0x5ab22e, 0x59fb5c, 0x59448a, 0x588db8, 0x57d6e6,
++ 0x572014, 0x566942, 0x55b270, 0x54fb9e, 0x5444cc, 0x538dfa,
++ 0x52d728, 0x522056, 0x516984, 0x50b2b2, 0x4ffbe0, 0x4f450e,
++ 0x4e8e3c, 0x4dd76a, 0x4d2098, 0x4c69c6, 0x4bb2f4, 0x4afc22,
++ 0x4a4550, 0x498e7e, 0x48d7ac, 0x4820da, 0x476a08, 0x46b336,
++ 0x45fc64, 0x454592, 0x448ec0, 0x43d7ee, 0x43211c, 0x426a4a,
++ 0x41b378, 0x40fca6, 0x4045d4, 0x3f8f02, 0x3ed830, 0x3e215e,
++ 0x3d6a8c, 0x3cb3ba, 0x3bfce8, 0x3b4616, 0x3a8f44, 0x39d872,
++ 0x3921a0, 0x386ace, 0x37b3fc, 0x36fd2a, 0x364658, 0x358f86,
++ 0x34d8b4, 0x3421e2, 0x336b10, 0x32b43e, 0x31fd6c, 0x31469a,
++ 0x308fc8, 0x2fd8f6, 0x2f2224, 0x2e6b52, 0x2db480, 0x2cfdae,
++ 0x2c46dc, 0x2b900a, 0x2ad938, 0x2a2266, 0x296b94, 0x28b4c2,
++ 0x27fdf0, 0x27471e, 0x26904c, 0x25d97a, 0x2522a8, 0x246bd6,
++ 0x23b504, 0x22fe32, 0x224760, 0x21908e, 0x20d9bc, 0x2022ea,
++ 0x1f6c18, 0x1eb546, 0x1dfe74, 0x1d47a2, 0x1c90d0, 0x1bd9fe,
++ 0x1b232c, 0x1a6c5a, 0x19b588, 0x18feb6, 0x1847e4, 0x179112,
++ 0x16da40, 0x16236e, 0x156c9c, 0x14b5ca, 0x13fef8, 0x134826,
++ 0x129154, 0x11da82, 0x1123b0, 0x106cde, 0x0fb60c, 0x0eff3a,
++ 0x0e4868, 0x0d9196, 0x0cdac4, 0x0c23f2, 0x0b6d20, 0x0ab64e,
++ 0x09ff7c, 0x0948aa, 0x0891d8, 0x07db06, 0x072434, 0x066d62,
++ 0x05b690, 0x04ffbe, 0x0448ec, 0x03921a, 0x02db48, 0x022476,
++ 0x016da4, 0x00b6d2, 0x000000, -0x00b6d2, -0x016da4, -0x022476,
++ -0x02db48, -0x03921a, -0x0448ec, -0x04ffbe, -0x05b690, -0x066d62,
++ -0x072434, -0x07db06, -0x0891d8, -0x0948aa, -0x09ff7c, -0x0ab64e,
++ -0x0b6d20, -0x0c23f2, -0x0cdac4, -0x0d9196, -0x0e4868, -0x0eff3a,
++ -0x0fb60c, -0x106cde, -0x1123b0, -0x11da82, -0x129154, -0x134826,
++ -0x13fef8, -0x14b5ca, -0x156c9c, -0x16236e, -0x16da40, -0x179112,
++ -0x1847e4, -0x18feb6, -0x19b588, -0x1a6c5a, -0x1b232c, -0x1bd9fe,
++ -0x1c90d0, -0x1d47a2, -0x1dfe74, -0x1eb546, -0x1f6c18, -0x2022ea,
++ -0x20d9bc, -0x21908e, -0x224760, -0x22fe32, -0x23b504, -0x246bd6,
++ -0x2522a8, -0x25d97a, -0x26904c, -0x27471e, -0x27fdf0, -0x28b4c2,
++ -0x296b94, -0x2a2266, -0x2ad938, -0x2b900a, -0x2c46dc, -0x2cfdae,
++ -0x2db480, -0x2e6b52, -0x2f2224, -0x2fd8f6, -0x308fc8, -0x31469a,
++ -0x31fd6c, -0x32b43e, -0x336b10, -0x3421e2, -0x34d8b4, -0x358f86,
++ -0x364658, -0x36fd2a, -0x37b3fc, -0x386ace, -0x3921a0, -0x39d872,
++ -0x3a8f44, -0x3b4616, -0x3bfce8, -0x3cb3ba, -0x3d6a8c, -0x3e215e,
++ -0x3ed830, -0x3f8f02, -0x4045d4, -0x40fca6, -0x41b378, -0x426a4a,
++ -0x43211c, -0x43d7ee, -0x448ec0, -0x454592, -0x45fc64, -0x46b336,
++ -0x476a08, -0x4820da, -0x48d7ac, -0x498e7e, -0x4a4550, -0x4afc22,
++ -0x4bb2f4, -0x4c69c6, -0x4d2098, -0x4dd76a, -0x4e8e3c, -0x4f450e,
++ -0x4ffbe0, -0x50b2b2, -0x516984, -0x522056, -0x52d728, -0x538dfa,
++ -0x5444cc, -0x54fb9e, -0x55b270, -0x566942, -0x572014, -0x57d6e6,
++ -0x588db8, -0x59448a, -0x59fb5c, -0x5ab22e,
++ };
++
++const int Cb_g_tab[(MAXJSAMPLE+1) * sizeof(int)] ={
++ 0x2c8d00, 0x2c34e6, 0x2bdccc, 0x2b84b2, 0x2b2c98, 0x2ad47e,
++ 0x2a7c64, 0x2a244a, 0x29cc30, 0x297416, 0x291bfc, 0x28c3e2,
++ 0x286bc8, 0x2813ae, 0x27bb94, 0x27637a, 0x270b60, 0x26b346,
++ 0x265b2c, 0x260312, 0x25aaf8, 0x2552de, 0x24fac4, 0x24a2aa,
++ 0x244a90, 0x23f276, 0x239a5c, 0x234242, 0x22ea28, 0x22920e,
++ 0x2239f4, 0x21e1da, 0x2189c0, 0x2131a6, 0x20d98c, 0x208172,
++ 0x202958, 0x1fd13e, 0x1f7924, 0x1f210a, 0x1ec8f0, 0x1e70d6,
++ 0x1e18bc, 0x1dc0a2, 0x1d6888, 0x1d106e, 0x1cb854, 0x1c603a,
++ 0x1c0820, 0x1bb006, 0x1b57ec, 0x1affd2, 0x1aa7b8, 0x1a4f9e,
++ 0x19f784, 0x199f6a, 0x194750, 0x18ef36, 0x18971c, 0x183f02,
++ 0x17e6e8, 0x178ece, 0x1736b4, 0x16de9a, 0x168680, 0x162e66,
++ 0x15d64c, 0x157e32, 0x152618, 0x14cdfe, 0x1475e4, 0x141dca,
++ 0x13c5b0, 0x136d96, 0x13157c, 0x12bd62, 0x126548, 0x120d2e,
++ 0x11b514, 0x115cfa, 0x1104e0, 0x10acc6, 0x1054ac, 0x0ffc92,
++ 0x0fa478, 0x0f4c5e, 0x0ef444, 0x0e9c2a, 0x0e4410, 0x0debf6,
++ 0x0d93dc, 0x0d3bc2, 0x0ce3a8, 0x0c8b8e, 0x0c3374, 0x0bdb5a,
++ 0x0b8340, 0x0b2b26, 0x0ad30c, 0x0a7af2, 0x0a22d8, 0x09cabe,
++ 0x0972a4, 0x091a8a, 0x08c270, 0x086a56, 0x08123c, 0x07ba22,
++ 0x076208, 0x0709ee, 0x06b1d4, 0x0659ba, 0x0601a0, 0x05a986,
++ 0x05516c, 0x04f952, 0x04a138, 0x04491e, 0x03f104, 0x0398ea,
++ 0x0340d0, 0x02e8b6, 0x02909c, 0x023882, 0x01e068, 0x01884e,
++ 0x013034, 0x00d81a, 0x008000, 0x0027e6, -0x003034, -0x00884e,
++ -0x00e068, -0x013882, -0x01909c, -0x01e8b6, -0x0240d0, -0x0298ea,
++ -0x02f104, -0x03491e, -0x03a138, -0x03f952, -0x04516c, -0x04a986,
++ -0x0501a0, -0x0559ba, -0x05b1d4, -0x0609ee, -0x066208, -0x06ba22,
++ -0x07123c, -0x076a56, -0x07c270, -0x081a8a, -0x0872a4, -0x08cabe,
++ -0x0922d8, -0x097af2, -0x09d30c, -0x0a2b26, -0x0a8340, -0x0adb5a,
++ -0x0b3374, -0x0b8b8e, -0x0be3a8, -0x0c3bc2, -0x0c93dc, -0x0cebf6,
++ -0x0d4410, -0x0d9c2a, -0x0df444, -0x0e4c5e, -0x0ea478, -0x0efc92,
++ -0x0f54ac, -0x0facc6, -0x1004e0, -0x105cfa, -0x10b514, -0x110d2e,
++ -0x116548, -0x11bd62, -0x12157c, -0x126d96, -0x12c5b0, -0x131dca,
++ -0x1375e4, -0x13cdfe, -0x142618, -0x147e32, -0x14d64c, -0x152e66,
++ -0x158680, -0x15de9a, -0x1636b4, -0x168ece, -0x16e6e8, -0x173f02,
++ -0x17971c, -0x17ef36, -0x184750, -0x189f6a, -0x18f784, -0x194f9e,
++ -0x19a7b8, -0x19ffd2, -0x1a57ec, -0x1ab006, -0x1b0820, -0x1b603a,
++ -0x1bb854, -0x1c106e, -0x1c6888, -0x1cc0a2, -0x1d18bc, -0x1d70d6,
++ -0x1dc8f0, -0x1e210a, -0x1e7924, -0x1ed13e, -0x1f2958, -0x1f8172,
++ -0x1fd98c, -0x2031a6, -0x2089c0, -0x20e1da, -0x2139f4, -0x21920e,
++ -0x21ea28, -0x224242, -0x229a5c, -0x22f276, -0x234a90, -0x23a2aa,
++ -0x23fac4, -0x2452de, -0x24aaf8, -0x250312, -0x255b2c, -0x25b346,
++ -0x260b60, -0x26637a, -0x26bb94, -0x2713ae, -0x276bc8, -0x27c3e2,
++ -0x281bfc, -0x287416, -0x28cc30, -0x29244a, -0x297c64, -0x29d47e,
++ -0x2a2c98, -0x2a84b2, -0x2adccc, -0x2b34e6,
++ };
++
++
++/* We assume that right shift corresponds to signed division by 2 with
++ * rounding towards minus infinity. This is correct for typical "arithmetic
++ * shift" instructions that shift in copies of the sign bit. But some
++ * C compilers implement >> with an unsigned shift. For these machines you
++ * must define RIGHT_SHIFT_IS_UNSIGNED.
++ * RIGHT_SHIFT provides a proper signed right shift of an INT32 quantity.
++ * It is only applied with constant shift counts. SHIFT_TEMPS must be
++ * included in the variables of any routine using RIGHT_SHIFT.
++ */
++
++#ifdef RIGHT_SHIFT_IS_UNSIGNED
++#define SHIFT_TEMPS INT32 shift_temp;
++#define RIGHT_SHIFT(x,shft) \
++ ((shift_temp = (x)) < 0 ? \
++ (shift_temp >> (shft)) | ((~((INT32) 0)) << (32-(shft))) : \
++ (shift_temp >> (shft)))
++#else
++#define SHIFT_TEMPS
++#define RIGHT_SHIFT(x,shft) ((x) >> (shft))
+#endif
-
-
++
++
++METHODDEF(void)
++ycc_rgb_convert_argb (j_decompress_ptr cinfo,
++ JSAMPIMAGE input_buf, JDIMENSION input_row,
++ JSAMPARRAY output_buf, int num_rows)
++{
++ JDIMENSION num_cols = cinfo->output_width;
++ JSAMPLE * range_limit = cinfo->sample_range_limit;
++
++ SHIFT_TEMPS
++
++ /* This is used if we don't have SSE2 */
++
++ while (--num_rows >= 0) {
++ JSAMPROW inptr0 = input_buf[0][input_row];
++ JSAMPROW inptr1 = input_buf[1][input_row];
++ JSAMPROW inptr2 = input_buf[2][input_row];
++ input_row++;
++ uint32_t *outptr = (uint32_t *) *output_buf++;
++ for (JDIMENSION col = 0; col < num_cols; col++) {
++ int y = GETJSAMPLE(inptr0[col]);
++ int cb = GETJSAMPLE(inptr1[col]);
++ int cr = GETJSAMPLE(inptr2[col]);
++ JSAMPLE * range_limit_y = range_limit + y;
++ /* Range-limiting is essential due to noise introduced by DCT losses. */
++ outptr[col] = 0xFF000000 |
++ ( range_limit_y[Cr_r_tab[cr]] << 16 ) |
++ ( range_limit_y[((int) RIGHT_SHIFT(Cb_g_tab[cb] + Cr_g_tab[cr], SCALEBITS))] << 8 ) |
++ ( range_limit_y[Cb_b_tab[cb]] );
++ }
++ }
++}
++#endif
++
++
/**************** Inverted CMYK -> RGB conversion **************/
/*
+ * Input is (Inverted) CMYK stored as 4 bytes per pixel.
diff --git a/mail/thunderbird/files/patch-bug791366 b/mail/thunderbird/files/patch-bug791366
deleted file mode 100644
index 90e9e523bbbe..000000000000
--- a/mail/thunderbird/files/patch-bug791366
+++ /dev/null
@@ -1,95 +0,0 @@
-diff --git mozilla/xpcom/base/nsMemoryReporterManager.cpp mozilla/xpcom/base/nsMemoryReporterManager.cpp
-index a9aff58..674e757 100644
---- mozilla/xpcom/base/nsMemoryReporterManager.cpp
-+++ mozilla/xpcom/base/nsMemoryReporterManager.cpp
-@@ -32,7 +32,7 @@ using namespace mozilla;
- # include "jemalloc.h"
- #endif // MOZ_MEMORY
-
--#if defined(XP_LINUX) || defined(XP_MACOSX) || defined(SOLARIS)
-+#ifdef XP_UNIX
-
- #include <sys/time.h>
- #include <sys/resource.h>
-@@ -95,6 +95,81 @@ static nsresult GetResident(PRInt64 *n)
- return GetProcSelfStatmField(1, n);
- }
-
-+#elif defined(__DragonFly__) || defined(__FreeBSD__) \
-+ || defined(__NetBSD__) || defined(__OpenBSD__)
-+
-+#include <sys/param.h>
-+#include <sys/sysctl.h>
-+#if defined(__DragonFly__) || defined(__FreeBSD__)
-+#include <sys/user.h>
-+#endif
-+
-+#include <unistd.h>
-+
-+#if defined(__NetBSD__)
-+#undef KERN_PROC
-+#define KERN_PROC KERN_PROC2
-+#define KINFO_PROC struct kinfo_proc2
-+#else
-+#define KINFO_PROC struct kinfo_proc
-+#endif
-+
-+#if defined(__DragonFly__)
-+#define KP_SIZE(kp) (kp.kp_vm_map_size)
-+#define KP_RSS(kp) (kp.kp_vm_rssize * getpagesize())
-+#elif defined(__FreeBSD__)
-+#define KP_SIZE(kp) (kp.ki_size)
-+#define KP_RSS(kp) (kp.ki_rssize * getpagesize())
-+#elif defined(__NetBSD__)
-+#define KP_SIZE(kp) (kp.p_vm_msize * getpagesize())
-+#define KP_RSS(kp) (kp.p_vm_rssize * getpagesize())
-+#elif defined(__OpenBSD__)
-+#define KP_SIZE(kp) ((kp.p_vm_dsize + kp.p_vm_ssize \
-+ + kp.p_vm_tsize) * getpagesize())
-+#define KP_RSS(kp) (kp.p_vm_rssize * getpagesize())
-+#endif
-+
-+static nsresult GetKinfoProcSelf(KINFO_PROC *proc)
-+{
-+ int mib[] = {
-+ CTL_KERN,
-+ KERN_PROC,
-+ KERN_PROC_PID,
-+ getpid(),
-+#if defined(__NetBSD__) || defined(__OpenBSD__)
-+ sizeof(KINFO_PROC),
-+ 1,
-+#endif
-+ };
-+ u_int miblen = sizeof(mib) / sizeof(mib[0]);
-+ size_t size = sizeof(KINFO_PROC);
-+ if (sysctl(mib, miblen, proc, &size, NULL, 0))
-+ return NS_ERROR_FAILURE;
-+
-+ return NS_OK;
-+}
-+
-+#define HAVE_VSIZE_AND_RESIDENT_REPORTERS 1
-+static nsresult GetVsize(PRInt64 *n)
-+{
-+ KINFO_PROC proc;
-+ nsresult rv = GetKinfoProcSelf(&proc);
-+ if (NS_SUCCEEDED(rv))
-+ *n = KP_SIZE(proc);
-+
-+ return rv;
-+}
-+
-+static nsresult GetResident(PRInt64 *n)
-+{
-+ KINFO_PROC proc;
-+ nsresult rv = GetKinfoProcSelf(&proc);
-+ if (NS_SUCCEEDED(rv))
-+ *n = KP_RSS(proc);
-+
-+ return rv;
-+}
-+
- #elif defined(SOLARIS)
-
- #include <procfs.h>
diff --git a/mail/thunderbird/files/patch-bug799441 b/mail/thunderbird/files/patch-bug799441
deleted file mode 100644
index acfe8d9302c6..000000000000
--- a/mail/thunderbird/files/patch-bug799441
+++ /dev/null
@@ -1,116 +0,0 @@
-commit b9accdd
-Author: Mike Hommey <mh+mozilla@glandium.org>
-Date: Thu Oct 18 14:47:10 2012 +0200
-
- Bug 799441 - Build GIO module in libxul. r=ted
----
- configure.in | 6 ++++++
- extensions/gio/Makefile.in | 14 +++-----------
- toolkit/library/Makefile.in | 5 +++++
- toolkit/library/nsStaticXULComponents.cpp | 7 +++++++
- toolkit/toolkit-tiers.mk | 4 ++++
- 5 files changed, 25 insertions(+), 11 deletions(-)
-
-diff --git configure.in configure.in
-index a9fb5f1..37e6db8 100644
---- mozilla/configure.in
-+++ mozilla/configure.in
-@@ -6086,6 +6086,12 @@ if test -n "$LIBXUL_SDK_DIR" -a `echo "$MOZ_EXTENSIONS" | grep -c gio` -ne 0; th
- MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gio||'`
- fi
-
-+if test `echo "$MOZ_EXTENSIONS" | grep -c gio` -ne 0; then
-+ MOZ_GIO_COMPONENT=1
-+ MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gio||'`
-+fi
-+AC_SUBST(MOZ_GIO_COMPONENT)
-+
- if test -z "$MOZ_JSDEBUGGER" -a `echo "$MOZ_EXTENSIONS" | grep -c venkman` -ne 0; then
- AC_MSG_WARN([Cannot build venkman without JavaScript debug library. Removing venkman from MOZ_EXTENSIONS.])
- MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|venkman||'`
-diff --git extensions/gio/Makefile.in extensions/gio/Makefile.in
-index ccf2846..79112a8 100644
---- mozilla/extensions/gio/Makefile.in
-+++ mozilla/extensions/gio/Makefile.in
-@@ -14,6 +14,9 @@ MODULE = nkgio
- LIBRARY_NAME = nkgio
- SHORT_LIBNAME = nkgio
- IS_COMPONENT = 1
-+EXPORT_LIBRARY = 1
-+MODULE_NAME = nsGIOModule
-+LIBXUL_LIBRARY = 1
-
- CPPSRCS = \
- nsGIOProtocolHandler.cpp \
-@@ -21,15 +24,4 @@ CPPSRCS = \
-
- LOCAL_INCLUDES = $(MOZ_GIO_CFLAGS)
-
--EXTRA_DSO_LDOPTS = \
-- $(XPCOM_GLUE_LDOPTS) \
-- $(NSPR_LIBS) \
-- $(MOZ_GIO_LIBS) \
-- $(NULL)
--
--# make sure this component is never statically linked into the main
--# application. this is necessary since we don't want to force users
--# to install gio in order to use the rest of mozilla ;-)
--FORCE_SHARED_LIB= 1
--
- include $(topsrcdir)/config/rules.mk
-diff --git toolkit/library/Makefile.in toolkit/library/Makefile.in
-index 7f9046e..6499758 100644
---- mozilla/toolkit/library/Makefile.in
-+++ mozilla/toolkit/library/Makefile.in
-@@ -333,6 +333,11 @@ COMPONENT_LIBS += gkdebug
- endif
- endif
-
-+ifdef MOZ_GIO_COMPONENT
-+DEFINES += -DMOZ_GIO_COMPONENT
-+COMPONENT_LIBS += nkgio
-+endif
-+
- ifdef MOZ_APP_COMPONENT_LIBS
- COMPONENT_LIBS += $(MOZ_APP_COMPONENT_LIBS)
- endif
-diff --git toolkit/library/nsStaticXULComponents.cpp toolkit/library/nsStaticXULComponents.cpp
-index e1d90f2..85b21a2 100644
---- mozilla/toolkit/library/nsStaticXULComponents.cpp
-+++ mozilla/toolkit/library/nsStaticXULComponents.cpp
-@@ -164,6 +164,12 @@
- #define PROFILER_MODULE
- #endif
-
-+#if defined(MOZ_GIO_COMPONENT)
-+#define GIO_MODULE MODULE(nsGIOModule)
-+#else
-+#define GIO_MODULE
-+#endif
-+
- #define XUL_MODULES \
- MODULE(nsUConvModule) \
- MODULE(nsI18nModule) \
-@@ -220,6 +226,7 @@
- MODULE(nsTelemetryModule) \
- MODULE(jsinspector) \
- MODULE(jsdebugger) \
-+ GIO_MODULE \
- /* end of list */
-
- #define MODULE(_name) \
-diff --git toolkit/toolkit-tiers.mk toolkit/toolkit-tiers.mk
-index e87d7af..4b16d23 100644
---- mozilla/toolkit/toolkit-tiers.mk
-+++ mozilla/toolkit/toolkit-tiers.mk
-@@ -252,6 +252,10 @@ tier_platform_dirs += js/ductwork/debugger
-
- tier_platform_dirs += other-licenses/snappy
-
-+ifdef MOZ_GIO_COMPONENT
-+tier_platform_dirs += extensions/gio
-+endif
-+
- ifdef APP_LIBXUL_STATICDIRS
- # Applications can cheat and ask for code to be
- # built before libxul so libxul can be linked against it.
diff --git a/mail/thunderbird/files/patch-bug803480 b/mail/thunderbird/files/patch-bug803480
new file mode 100644
index 000000000000..3a64220a6ad7
--- /dev/null
+++ b/mail/thunderbird/files/patch-bug803480
@@ -0,0 +1,102 @@
+diff --git configure.in configure.in
+index a0575dc..be327fd 100644
+--- mozilla/configure.in
++++ mozilla/configure.in
+@@ -4306,7 +4306,6 @@ NS_PRINTING=1
+ MOZ_PDF_PRINTING=
+ MOZ_DISABLE_CRYPTOLEGACY=
+ NSS_DISABLE_DBM=
+-NECKO_WIFI=1
+ NECKO_COOKIES=1
+ NECKO_PROTOCOLS_DEFAULT="about data file ftp http res viewsource websocket wyciwyg device"
+ USE_ARM_KUSER=
+@@ -4336,11 +4335,6 @@ case "${target}" in
+ fi
+
+ NSS_DISABLE_DBM=1
+- if test -z "$gonkdir"; then
+- NECKO_WIFI=
+- else
+- NECKO_WIFI=1
+- fi
+ MOZ_THEME_FASTSTRIPE=1
+ MOZ_TREE_FREETYPE=1
+ MOZ_MEMORY=1
+@@ -8485,28 +8479,39 @@ done
+ dnl
+ dnl option to disable necko's wifi scanner
+ dnl
++
++case "$OS_TARGET" in
++ OS2)
++ dnl OS/2 implementation of Necko-WiFi support will be added in bug 506566
++ ;;
++ Android)
++ if test -n "$gonkdir"; then
++ NECKO_WIFI=1
++ fi
++ ;;
++ Darwin|SunOS|WINNT)
++ NECKO_WIFI=1
++ ;;
++ Linux)
++ if test -z "$MOZ_ENABLE_DBUS"; then
++ AC_MSG_ERROR([Necko WiFi scanning needs DBus on your platform, remove --disable-dbus or use --disable-necko-wifi])
++ fi
++ NECKO_WIFI=1
++ NECKO_WIFI_DBUS=1
++ ;;
++esac
++
+ MOZ_ARG_DISABLE_BOOL(necko-wifi,
+ [ --disable-necko-wifi Disable necko wifi scanner],
+ NECKO_WIFI=,
+ NECKO_WIFI=1)
+
+-if test "$OS_ARCH" = "OS2"; then
+- dnl OS/2 implementation of Necko-WiFi support will be added in bug 506566
+- NECKO_WIFI=
+-fi
+-if test "$NECKO_WIFI" -a \
+- "$OS_ARCH" != "Linux" -a \
+- "$OS_ARCH" != "Darwin" -a \
+- "$OS_ARCH" != "SunOS" -a \
+- "$OS_ARCH" != "WINNT"; then
+- AC_MSG_ERROR([Necko WiFi scanning not supported on your platform, use --disable-necko-wifi])
+-fi
+-
+ if test "$NECKO_WIFI"; then
+ AC_DEFINE(NECKO_WIFI)
+ _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_WIFI"
+ fi
+ AC_SUBST(NECKO_WIFI)
++AC_SUBST(NECKO_WIFI_DBUS)
+
+ dnl
+ dnl option to disable cookies
+diff --git netwerk/wifi/Makefile.in netwerk/wifi/Makefile.in
+index 26dbd79..4cbf912 100644
+--- mozilla/netwerk/wifi/Makefile.in
++++ mozilla/netwerk/wifi/Makefile.in
+@@ -20,7 +20,7 @@ ifeq ($(OS_ARCH),SunOS)
+ OS_INCLUDES += $(GLIB_CFLAGS)
+ endif
+
+-ifdef MOZ_ENABLE_DBUS
++ifdef NECKO_WIFI_DBUS
+ OS_INCLUDES += $(MOZ_DBUS_GLIB_CFLAGS)
+ endif
+
+diff --git netwerk/wifi/moz.build netwerk/wifi/moz.build
+index 5e70211..07b01de 100644
+--- mozilla/netwerk/wifi/moz.build
++++ mozilla/netwerk/wifi/moz.build
+@@ -43,7 +43,7 @@ elif CONFIG['OS_ARCH'] == 'SunOS':
+ 'nsWifiScannerSolaris.cpp',
+ ]
+
+-if CONFIG['MOZ_ENABLE_DBUS']:
++if CONFIG['NECKO_WIFI_DBUS']:
+ CPP_SOURCES += [
+ 'nsWifiScannerDBus.cpp',
+ ]
diff --git a/mail/thunderbird/files/patch-bug806139 b/mail/thunderbird/files/patch-bug806139
deleted file mode 100644
index d3676869659b..000000000000
--- a/mail/thunderbird/files/patch-bug806139
+++ /dev/null
@@ -1,29 +0,0 @@
---- mozilla/content/html/content/public/nsHTMLMediaElement.h~
-+++ mozilla/content/html/content/public/nsHTMLMediaElement.h
-@@ -311,7 +311,7 @@ public:
- static bool IsH264Enabled();
- static bool IsH264Type(const nsACString& aType);
- static const char gH264Types[3][16];
-- static char const *const gH264Codecs[7];
-+ static char const *const gH264Codecs[9];
- #endif
-
- #ifdef MOZ_MEDIA_PLUGINS
---- mozilla/content/html/content/src/nsHTMLMediaElement.cpp~
-+++ mozilla/content/html/content/src/nsHTMLMediaElement.cpp
-@@ -2114,12 +2114,14 @@ const char nsHTMLMediaElement::gH264Type
- "video/quicktime",
- };
-
--char const *const nsHTMLMediaElement::gH264Codecs[7] = {
-+char const *const nsHTMLMediaElement::gH264Codecs[9] = {
- "avc1.42E01E",
- "avc1.42001E",
- "avc1.58A01E",
- "avc1.4D401E",
- "avc1.64001E",
-+ "avc1.64001F",
-+ "mp4v.20.3",
- "mp4a.40.2",
- nullptr
- };
diff --git a/mail/thunderbird/files/patch-bug807492 b/mail/thunderbird/files/patch-bug807492
new file mode 100644
index 000000000000..f486428a2a4d
--- /dev/null
+++ b/mail/thunderbird/files/patch-bug807492
@@ -0,0 +1,628 @@
+JJdiff --git configure.in configure.in
+index c167461..8346c11 100644
+--- mozilla/configure.in
++++ mozilla/configure.in
+@@ -5246,17 +5246,17 @@ if test "$NS_PRINTING"; then
+ AC_DEFINE(NS_PRINT_PREVIEW)
+ fi
+
+ dnl Turn off webrtc for OS's we don't handle yet, but allow
+ dnl --enable-webrtc to override. Can disable for everything in
+ dnl the master list above.
+ if test -n "$MOZ_WEBRTC"; then
+ case "$target" in
+- *-linux*|*-mingw*|*-darwin*|*-android*|*-linuxandroid*)
++ *-linux*|*-mingw*|*-darwin*|*-android*|*-linuxandroid*|*-dragonfly*|*-freebsd*|*-netbsd*|*-openbsd*)
+ dnl Leave enabled
+ ;;
+ *)
+ dnl default to disabled for all others
+ MOZ_WEBRTC=
+ ;;
+ esac
+ fi
+diff --git media/mtransport/objs.mk media/mtransport/objs.mk
+index f1fc85f..141e8ca 100644
+--- mozilla/media/mtransport/objs.mk
++++ mozilla/media/mtransport/objs.mk
+@@ -18,22 +18,26 @@ LOCAL_INCLUDES += \
+ -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/util/libekr \
+ -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/log \
+ -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/registry \
+ -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/stats \
+ -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/plugin \
+ -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/event \
+ $(NULL)
+
+-ifeq ($(OS_TARGET), Darwin)
++ifneq (,$(filter Darwin DragonFly FreeBSD NetBSD OpenBSD,$(OS_TARGET)))
+ LOCAL_INCLUDES += \
+ -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/darwin/include \
+ -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/generic/include \
+ $(NULL)
++ifeq ($(OS_TARGET), Darwin)
+ DEFINES += -DDARWIN
++else
++DEFINES += -DBSD
++endif
+ endif
+
+ ifeq ($(OS_TARGET), Linux)
+ LOCAL_INCLUDES += \
+ -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/linux/include \
+ -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/generic/include \
+ $(NULL)
+ DEFINES += -DLINUX
+diff --git media/mtransport/test/Makefile.in media/mtransport/test/Makefile.in
+index c1d5bf4..2ecf2c7 100644
+--- mozilla/media/mtransport/test/Makefile.in
++++ mozilla/media/mtransport/test/Makefile.in
+@@ -73,22 +73,24 @@ DEFINES += -D__Userspace_os_FreeBSD=1
+ else
+ #default_fallback; probably doesn't work
+ DEFINES += -D__Userspace_os_$(OS_TARGET)=1
+ endif
+ endif
+ endif
+ endif
+
+-ifeq ($(OS_TARGET), Darwin)
++ifneq (,$(filter Darwin DragonFly FreeBSD NetBSD OpenBSD,$(OS_TARGET)))
+ LOCAL_INCLUDES += -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/darwin/include
++ifeq ($(OS_TARGET), Darwin)
+ DEFINES += \
+ -DGTEST_USE_OWN_TR1_TUPLE=1 \
+ $(NULL)
+ endif
++endif
+
+ ifeq ($(OS_TARGET), Linux)
+ LOCAL_INCLUDES += -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/linux/include
+ endif
+
+ ifeq ($(OS_TARGET), Android)
+ LOCAL_INCLUDES += -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/android/include
+
+diff --git media/mtransport/third_party/nICEr/nicer.gyp media/mtransport/third_party/nICEr/nicer.gyp
+index 0e1f8b4..9a4b995 100644
+--- mozilla/media/mtransport/third_party/nICEr/nicer.gyp
++++ mozilla/media/mtransport/third_party/nICEr/nicer.gyp
+@@ -126,26 +126,36 @@
+ 'R_DEFINED_UINT2=uint16_t',
+ 'R_DEFINED_INT4=int32_t',
+ 'R_DEFINED_UINT4=uint32_t',
+ 'R_DEFINED_INT8=int64_t',
+ 'R_DEFINED_UINT8=uint64_t',
+ ],
+
+ 'conditions' : [
+- ## Mac
++ ## Mac and BSDs
+ [ 'OS == "mac"', {
++ 'defines' : [
++ 'DARWIN',
++ 'HAVE_XLOCALE',
++ ],
++ }],
++ [ 'os_bsd == 1', {
++ 'defines' : [
++ 'BSD',
++ ],
++ }],
++ [ 'OS == "mac" or os_bsd == 1', {
+ 'cflags_mozilla': [
+ '-Wall',
+ '-Wno-parentheses',
+ '-Wno-strict-prototypes',
+ '-Wmissing-prototypes',
+ ],
+ 'defines' : [
+- 'DARWIN',
+ 'HAVE_LIBM=1',
+ 'HAVE_STRDUP=1',
+ 'HAVE_STRLCPY=1',
+ 'HAVE_SYS_TIME_H=1',
+ 'HAVE_VFPRINTF=1',
+ 'NEW_STDIO'
+ 'RETSIGTYPE=void',
+ 'TIME_WITH_SYS_TIME_H=1',
+diff --git media/mtransport/third_party/nICEr/src/stun/addrs.c media/mtransport/third_party/nICEr/src/stun/addrs.c
+index b0b66b2..04fea94 100644
+--- mozilla/media/mtransport/third_party/nICEr/src/stun/addrs.c
++++ mozilla/media/mtransport/third_party/nICEr/src/stun/addrs.c
+@@ -50,17 +50,19 @@ static char *RCSSTRING __UNUSED__="$Id: addrs.c,v 1.2 2008/04/28 18:21:30 ekr Ex
+ #else
+ #include <syslog.h>
+ /* Work around an Android NDK < r8c bug */
+ #undef __unused
+ #include <linux/sysctl.h>
+ #endif
+ #include <net/if.h>
+ #ifndef LINUX
++#if !defined(__OpenBSD__) && !defined(__NetBSD__)
+ #include <net/if_var.h>
++#endif
+ #include <net/if_dl.h>
+ #include <net/if_types.h>
+ #include <sys/sockio.h>
+ #else
+ #include <linux/if.h>
+ #endif
+ #include <net/route.h>
+
+@@ -75,17 +77,17 @@ static char *RCSSTRING __UNUSED__="$Id: addrs.c,v 1.2 2008/04/28 18:21:30 ekr Ex
+ #include <netdb.h>
+ #endif /* UNIX */
+
+ #include "stun.h"
+ #include "addrs.h"
+
+
+
+-#ifdef DARWIN
++#if defined(BSD) || defined(DARWIN)
+ /*
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+@@ -685,17 +687,17 @@ nr_stun_remove_duplicate_addrs(nr_transport_addr addrs[], int remove_loopback, i
+ }
+
+ int
+ nr_stun_get_addrs(nr_transport_addr addrs[], int maxaddrs, int drop_loopback, int *count)
+ {
+ int _status=0;
+ int i;
+
+-#ifdef DARWIN
++#if defined(BSD) || defined(DARWIN)
+ _status = stun_get_mib_addrs(addrs, maxaddrs, count);
+ #elif defined(WIN32)
+ _status = stun_get_win32_addrs(addrs, maxaddrs, count);
+ #elif defined(__sparc__)
+ _status = stun_get_sparc_addrs(addrs, maxaddrs, count);
+ #else
+ _status = stun_get_siocgifconf_addrs(addrs, maxaddrs, count);
+ #endif
+diff --git media/mtransport/third_party/nICEr/src/stun/stun.h media/mtransport/third_party/nICEr/src/stun/stun.h
+index a3c51f9..eb65ac8 100644
+--- mozilla/media/mtransport/third_party/nICEr/src/stun/stun.h
++++ mozilla/media/mtransport/third_party/nICEr/src/stun/stun.h
+@@ -36,21 +36,25 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ #ifdef WIN32
+ #include <winsock2.h>
+ #else
+ #include <sys/param.h>
+ #include <sys/socket.h>
+ #include <net/if.h>
+ #ifndef LINUX
++#if !defined(__OpenBSD__) && !defined(__NetBSD__)
+ #include <net/if_var.h>
++#endif
+ #include <net/if_dl.h>
+ #include <net/if_types.h>
+ #endif
++#ifndef BSD
+ #include <net/route.h>
++#endif
+ #include <netinet/in.h>
+ #ifndef LINUX
+ #include <netinet/in_var.h>
+ #endif
+ #include <arpa/inet.h>
+ #include <netdb.h>
+ #endif
+ #include <time.h>
+diff --git media/mtransport/third_party/nICEr/src/util/mbslen.c media/mtransport/third_party/nICEr/src/util/mbslen.c
+index cc260b7..66af2d7 100644
+--- mozilla/media/mtransport/third_party/nICEr/src/util/mbslen.c
++++ mozilla/media/mtransport/third_party/nICEr/src/util/mbslen.c
+@@ -38,50 +38,58 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ #include <errno.h>
+ #include <csi_platform.h>
+
+ #include <assert.h>
+ #include <locale.h>
+ #include <stdlib.h>
+ #include <wchar.h>
+-#ifdef DARWIN
++
++#ifdef __FreeBSD__
++#include <osreldate.h>
++# if __FreeBSD_version > 900505
++# define HAVE_XLOCALE
++# endif
++#endif
++
++#ifdef HAVE_XLOCALE
+ #include <xlocale.h>
+-#endif /* DARWIN */
++#endif /* HAVE_XLOCALE */
+
+ #include "nr_api.h"
+ #include "mbslen.h"
+
+ /* get number of characters in a mult-byte character string */
+ int
+ mbslen(const char *s, size_t *ncharsp)
+ {
+-#ifdef DARWIN
++#ifdef HAVE_XLOCALE
+ static locale_t loc = 0;
+ static int initialized = 0;
+-#endif /* DARWIN */
++#endif /* HAVE_XLOCALE */
+ #ifdef WIN32
+ char *my_locale=0;
+ unsigned int i;
+ #endif /* WIN32 */
+ int _status;
+ size_t nbytes;
+ int nchars;
+ mbstate_t mbs;
+
+-#ifdef DARWIN
++#ifdef HAVE_XLOCALE
+ if (! initialized) {
+ initialized = 1;
+ loc = newlocale(LC_CTYPE_MASK, "UTF-8", LC_GLOBAL_LOCALE);
+ }
+
+ if (loc == 0) {
+ /* unable to create the UTF-8 locale */
+ assert(loc != 0); /* should never happen */
+-#endif /* DARWIN */
++#endif /* HAVE_XLOCALE */
+
+ #ifdef WIN32
+ if (!setlocale(LC_CTYPE, 0))
+ ABORT(R_INTERNAL);
+
+ if (!(my_locale = r_strdup(setlocale(LC_CTYPE, 0))))
+ ABORT(R_NO_MEMORY);
+
+@@ -94,28 +102,28 @@ mbslen(const char *s, size_t *ncharsp)
+ /* can't count UTF-8 characters with mbrlen if the locale isn't UTF-8 */
+ /* null-checking setlocale is required because Android */
+ char *locale = setlocale(LC_CTYPE, 0);
+ /* some systems use "utf8" instead of "UTF-8" like Fedora 17 */
+ if (!locale || (!strcasestr(locale, "UTF-8") && !strcasestr(locale, "UTF8")))
+ ABORT(R_NOT_FOUND);
+ #endif
+
+-#ifdef DARWIN
++#ifdef HAVE_XLOCALE
+ }
+-#endif /* DARWIN */
++#endif /* HAVE_XLOCALE */
+
+ memset(&mbs, 0, sizeof(mbs));
+ nchars = 0;
+
+-#ifdef DARWIN
++#ifdef HAVE_XLOCALE
+ while (*s != '\0' && (nbytes = mbrlen_l(s, strlen(s), &mbs, loc)) != 0)
+ #else
+ while (*s != '\0' && (nbytes = mbrlen(s, strlen(s), &mbs)) != 0)
+-#endif /* DARWIN */
++#endif /* HAVE_XLOCALE */
+ {
+ if (nbytes == (size_t)-1) /* should never happen */ {
+ ABORT(R_INTERNAL);
+ }
+ if (nbytes == (size_t)-2) /* encoding error */ {
+ ABORT(R_BAD_DATA);
+ }
+
+diff --git media/mtransport/third_party/nrappkit/nrappkit.gyp media/mtransport/third_party/nrappkit/nrappkit.gyp
+index 3cc8e1c..74016c6 100644
+--- mozilla/media/mtransport/third_party/nrappkit/nrappkit.gyp
++++ mozilla/media/mtransport/third_party/nrappkit/nrappkit.gyp
+@@ -142,26 +142,35 @@
+ 'R_DEFINED_UINT2=uint16_t',
+ 'R_DEFINED_INT4=int32_t',
+ 'R_DEFINED_UINT4=uint32_t',
+ 'R_DEFINED_INT8=int64_t',
+ 'R_DEFINED_UINT8=uint64_t',
+ ],
+
+ 'conditions' : [
+- ## Mac
++ ## Mac and BSDs
+ [ 'OS == "mac"', {
++ 'defines' : [
++ 'DARWIN',
++ ],
++ }],
++ [ 'os_bsd == 1', {
++ 'defines' : [
++ 'BSD',
++ ],
++ }],
++ [ 'OS == "mac" or os_bsd == 1', {
+ 'cflags_mozilla': [
+ '-Wall',
+ '-Wno-parentheses',
+ '-Wno-strict-prototypes',
+ '-Wmissing-prototypes',
+ ],
+ 'defines' : [
+- 'DARWIN',
+ 'HAVE_LIBM=1',
+ 'HAVE_STRDUP=1',
+ 'HAVE_STRLCPY=1',
+ 'HAVE_SYS_TIME_H=1',
+ 'HAVE_VFPRINTF=1',
+ 'NEW_STDIO'
+ 'RETSIGTYPE=void',
+ 'TIME_WITH_SYS_TIME_H=1',
+diff --git media/mtransport/third_party/nrappkit/src/log/r_log.c media/mtransport/third_party/nrappkit/src/log/r_log.c
+index efb7ef2..aebf578 100644
+--- mozilla/media/mtransport/third_party/nrappkit/src/log/r_log.c
++++ mozilla/media/mtransport/third_party/nrappkit/src/log/r_log.c
+@@ -43,16 +43,17 @@ static char *RCSSTRING __UNUSED__ ="$Id: r_log.c,v 1.10 2008/11/25 22:25:18 adam
+ #ifdef LINUX
+ #define _BSD_SOURCE
+ #endif
+
+ #include "r_log.h"
+ #include "hex.h"
+
+ #include <string.h>
++#include <errno.h>
+ #ifndef _MSC_VER
+ #include <strings.h>
+ #include <syslog.h>
+ #endif
+ #include <registry.h>
+ #include <time.h>
+
+
+diff --git media/mtransport/third_party/nrappkit/src/port/generic/include/sys/queue.h media/mtransport/third_party/nrappkit/src/port/generic/include/sys/queue.h
+index bcb1ec0..bb73591 100644
+--- mozilla/media/mtransport/third_party/nrappkit/src/port/generic/include/sys/queue.h
++++ mozilla/media/mtransport/third_party/nrappkit/src/port/generic/include/sys/queue.h
+@@ -33,7 +33,7 @@
+ #ifndef _SYS_QUEUE_H_
+ #define _SYS_QUEUE_H_
+
+-#ifndef DARWIN
++#if !defined(__FreeBSD__) && !defined(DARWIN)
+ #include <stddef.h>
+ #define __offsetof offsetof
+ #endif
+diff --git media/mtransport/third_party/nrappkit/src/util/util.c media/mtransport/third_party/nrappkit/src/util/util.c
+index a7d4ff1..ff11a60 100644
+--- mozilla/media/mtransport/third_party/nrappkit/src/util/util.c
++++ mozilla/media/mtransport/third_party/nrappkit/src/util/util.c
+@@ -40,16 +40,17 @@
+ static char *RCSSTRING __UNUSED__ ="$Id: util.c,v 1.5 2007/11/21 00:09:13 adamcain Exp $";
+
+ #ifndef WIN32
+ #include <sys/uio.h>
+ #include <pwd.h>
+ #include <dirent.h>
+ #endif
+ #include <string.h>
++#include <errno.h>
+ #include <ctype.h>
+ #include <sys/stat.h>
+ #ifdef OPENSSL
+ #include <openssl/evp.h>
+ #endif
+ #include "nr_common.h"
+ #include "r_common.h"
+ #include "registry.h"
+diff --git media/webrtc/signaling/signaling.gyp media/webrtc/signaling/signaling.gyp
+index 2a91e3d..31de641 100644
+--- mozilla/media/webrtc/signaling/signaling.gyp
++++ mozilla/media/webrtc/signaling/signaling.gyp
+@@ -212,16 +212,29 @@
+ 'SIPCC_BUILD',
+ 'HAVE_WINSOCK2_H',
+ 'CPR_STDINT_INCLUDE=\\"mozilla/StandardInteger.h\\"'
+ ],
+
+ 'cflags_mozilla': [
+ ],
+ }],
++ ['os_bsd==1', {
++ 'include_dirs': [
++ ],
++ 'defines': [
++ # avoiding pointless ifdef churn
++ 'SIP_OS_OSX',
++ 'OSX',
++ 'SECLIB_OPENSSL',
++ ],
++
++ 'cflags_mozilla': [
++ ],
++ }],
+ ['OS=="mac"', {
+ 'include_dirs': [
+ ],
+ 'defines': [
+ 'SIP_OS_OSX',
+ 'OSX',
+ '_FORTIFY_SOURCE=2',
+ ],
+@@ -747,17 +760,17 @@
+ 'EXTERNAL_TICK_REQUIRED',
+ 'GIPS_VER=3480',
+ ],
+
+ 'cflags_mozilla': [
+ ],
+
+ }],
+- ['OS=="mac"', {
++ ['OS=="mac" or os_bsd==1', {
+
+ 'include_dirs': [
+ ],
+
+ 'sources': [
+ # SIPSTACK
+ './src/sipcc/core/sipstack/sip_platform_task.c',
+
+@@ -792,24 +805,23 @@
+ './src/sipcc/cpr/darwin/cpr_darwin_timers_using_select.c',
+ './src/sipcc/cpr/darwin/cpr_darwin_tst.h',
+ './src/sipcc/cpr/darwin/cpr_darwin_types.h',
+ ],
+
+
+ 'defines' : [
+ 'SIP_OS_OSX',
+- '_POSIX_SOURCE',
++ # using BSD extensions, leave _POSIX_SOURCE undefined
+ 'CPR_MEMORY_LITTLE_ENDIAN',
+ 'NO_SOCKET_POLLING',
+ 'USE_TIMER_SELECT_BASED',
+ 'FULL_BUILD',
+ 'STUBBED_OUT',
+ 'USE_PRINTF',
+- '_DARWIN_C_SOURCE',
+ 'NO_NSPR_10_SUPPORT',
+ ],
+
+ 'cflags_mozilla': [
+ ],
+ }],
+ ],
+
+diff --git media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_ipc.c media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_ipc.c
+index a7c47e1..4f191de 100644
+--- mozilla/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_ipc.c
++++ mozilla/media/webrtc/signaling/src/sipcc/cpr/darwin/cpr_darwin_ipc.c
+@@ -317,21 +317,25 @@ cprGetMessage (cprMsgQueue_t msgQueue, boolean waitForever, void **ppUserData)
+ {
+ static const char fname[] = "cprGetMessage";
+
+ void *buffer = 0;
+ cpr_msg_queue_t *msgq;
+ cpr_msgq_node_t *node;
+ struct timespec timeout;
+ struct timeval tv;
++#ifndef __APPLE__
++ struct timezone tz;
++#else
+ // On the iPhone, there is a DarwinAlias problem with "timezone"
+ struct _timezone {
+ int tz_minuteswest; /* of Greenwich */
+ int tz_dsttime; /* type of dst correction to apply */
+ } tz;
++#endif
+
+ /* Initialize ppUserData */
+ if (ppUserData) {
+ *ppUserData = NULL;
+ }
+
+ msgq = (cpr_msg_queue_t *) msgQueue;
+ if (msgq == NULL) {
+diff --git media/webrtc/signaling/test/Makefile.in media/webrtc/signaling/test/Makefile.in
+index a30e330..cfbd8a3 100644
+--- mozilla/media/webrtc/signaling/test/Makefile.in
++++ mozilla/media/webrtc/signaling/test/Makefile.in
+@@ -81,17 +81,17 @@ endif
+ ifeq (qt,$(MOZ_WIDGET_TOOLKIT))
+ LIBS += \
+ $(XLIBS) \
+ $(TK_LIBS) \
+ $(MOZ_PANGO_LIBS) \
+ $(NULL)
+ endif
+
+-ifeq ($(OS_TARGET),Linux)
++ifneq (,$(filter Linux DragonFly FreeBSD NetBSD OpenBSD,$(OS_TARGET)))
+ LIBS += \
+ $(MOZ_CAIRO_OSLIBS) \
+ $(NULL)
+ endif
+
+ ifeq ($(OS_TARGET),Darwin)
+ LIBS += \
+ -framework AudioToolbox \
+diff --git media/webrtc/trunk/tools/gyp/pylib/gyp/generator/mozmake.py media/webrtc/trunk/tools/gyp/pylib/gyp/generator/mozmake.py
+index 338d0b7..2241d41 100644
+--- mozilla/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/mozmake.py
++++ mozilla/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/mozmake.py
+@@ -1,16 +1,17 @@
+ # Copyright (c) 2012 Mozilla Foundation. All rights reserved.
+ # Use of this source code is governed by a BSD-style license that can be
+ # found in the LICENSE file.
+
+ import collections
+ import gyp
+ import gyp.common
+ import sys
++import platform
+ import os
+ import re
+ import shlex
+
+ generator_wants_sorted_dependencies = True
+
+ generator_default_variables = {
+ }
+@@ -107,30 +108,44 @@ endif
+
+ def ensure_directory_exists(path):
+ dir = os.path.dirname(path)
+ if dir and not os.path.exists(dir):
+ os.makedirs(dir)
+
+ def GetFlavor(params):
+ """Returns |params.flavor| if it's set, the system's default flavor else."""
++ system = platform.system().lower()
+ flavors = {
+- 'win32': 'win',
+- 'darwin': 'mac',
+- 'sunos5': 'solaris',
+- 'freebsd7': 'freebsd',
+- 'freebsd8': 'freebsd',
++ 'microsoft': 'win',
++ 'windows' : 'win',
++ 'darwin' : 'mac',
++ 'sunos' : 'solaris',
++ 'dragonfly': 'bsd',
++ 'freebsd' : 'bsd',
++ 'netbsd' : 'bsd',
++ 'openbsd' : 'bsd',
+ }
+- flavor = flavors.get(sys.platform, 'linux')
+- return params.get('flavor', flavor)
++
++ if 'flavor' in params:
++ return params['flavor']
++ if system.startswith('cygwin'):
++ return 'win'
++ if system in flavors:
++ return flavors[system]
++
++ return 'linux'
+
+
+ def CalculateVariables(default_variables, params):
++ flavor = GetFlavor(params)
++ if flavor == 'bsd':
++ flavor = platform.system().lower()
+ generator_flags = params.get('generator_flags', {})
+- default_variables['OS'] = generator_flags.get('os', GetFlavor(params))
++ default_variables['OS'] = generator_flags.get('os', flavor)
+
+
+ def CalculateGeneratorInputInfo(params):
+ """Calculate the generator specific info that gets fed to input (called by
+ gyp)."""
+ generator_flags = params.get('generator_flags', {})
+ if generator_flags.get('adjust_static_libraries', False):
+ global generator_wants_static_library_dependencies_adjusted
diff --git a/mail/thunderbird/files/patch-bug810716 b/mail/thunderbird/files/patch-bug810716
index 93e59a2d7929..05637dc71251 100644
--- a/mail/thunderbird/files/patch-bug810716
+++ b/mail/thunderbird/files/patch-bug810716
@@ -1,32 +1,5 @@
diff --git configure.in configure.in
index 2084be9..eb6eeb2 100644
---- configure.in
-+++ configure.in
-@@ -3369,14 +3369,19 @@ fi
- AC_CACHE_CHECK(
- [for res_ninit()],
- ac_cv_func_res_ninit,
-- [AC_TRY_LINK([
-+ [AC_TRY_RUN([
- #ifdef linux
- #define _BSD_SOURCE 1
- #endif
-+ #include <sys/types.h>
-+ #include <netinet/in.h>
-+ #include <arpa/nameser.h>
- #include <resolv.h>
-- ],
-- [int foo = res_ninit(&_res);],
-+ int main(int argc, char **argv){
-+ int foo = res_ninit(&_res);
-+ }],
- [ac_cv_func_res_ninit=yes],
-+ [ac_cv_func_res_ninit=no],
- [ac_cv_func_res_ninit=no])
- ])
-
-diff --git configure.in configure.in
-index 2084be9..eb6eeb2 100644
--- mozilla/configure.in
+++ mozilla/configure.in
@@ -3369,14 +3369,19 @@ fi
diff --git a/mail/thunderbird/files/patch-bug826985 b/mail/thunderbird/files/patch-bug826985
new file mode 100644
index 000000000000..c7bd5a99a7f9
--- /dev/null
+++ b/mail/thunderbird/files/patch-bug826985
@@ -0,0 +1,164 @@
+commit 8024d93
+Author: Henrik Gulbrandsen <henrik@gulbra.net>
+Date: Fri Jan 4 13:49:22 2013 +0100
+
+ Bug 826985 - Support more video formats for WebRTC via libv4l2 on Linux.
+---
+ configure.in | 7 +++++++
+ media/webrtc/signaling/test/Makefile.in | 1 +
+ .../modules/video_capture/linux/device_info_linux.cc | 17 +++++++++++++++++
+ .../modules/video_capture/linux/video_capture_linux.cc | 16 +++++++++++++++-
+ .../webrtc/modules/video_capture/video_capture.gypi | 11 +++++++++++
+ toolkit/library/Makefile.in | 1 +
+ 6 files changed, 52 insertions(+), 1 deletion(-)
+
+diff --git configure.in configure.in
+index 55e4cd1..76567b3 100644
+--- mozilla/configure.in
++++ mozilla/configure.in
+@@ -5309,6 +5309,9 @@ if test -n "$MOZ_WEBRTC"; then
+ MOZ_VP8_ENCODER=1
+ MOZ_VP8_ERROR_CONCEALMENT=1
+
++ dnl with libv4l2 we can support more cameras
++ PKG_CHECK_MODULES(MOZ_LIBV4L2, libv4l2)
++
+ dnl enable once Signaling lands
+ MOZ_WEBRTC_SIGNALING=1
+ AC_DEFINE(MOZ_WEBRTC_SIGNALING)
+@@ -8981,6 +8984,10 @@ elif test "${OS_TARGET}" = "Android"; then
+ fi
+ fi
+
++if test -n "$MOZ_LIBV4L2_LIBS"; then
++ EXTRA_GYP_DEFINES="$EXTRA_GYP_DEFINES -D use_libv4l2=1"
++fi
++
+ if test -n "$MOZ_WEBRTC"; then
+ AC_MSG_RESULT("generating WebRTC Makefiles...")
+
+diff --git media/webrtc/signaling/test/Makefile.in media/webrtc/signaling/test/Makefile.in
+index b483cd1..f1dd1f0 100644
+--- mozilla/media/webrtc/signaling/test/Makefile.in
++++ mozilla/media/webrtc/signaling/test/Makefile.in
+@@ -17,6 +17,7 @@ LIBS = \
+ $(NSPR_LIBS) \
+ $(NSS_LIBS) \
+ $(REALTIME_LIBS) \
++ $(MOZ_LIBV4L2_LIBS) \
+ $(DEPTH)/xpcom/glue/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) \
+ $(DEPTH)/media/mtransport/standalone/$(LIB_PREFIX)mtransport_s.$(LIB_SUFFIX) \
+ $(DEPTH)/media/webrtc/signalingtest/signaling_ecc/$(LIB_PREFIX)ecc.$(LIB_SUFFIX) \
+diff --git media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc
+index 239a292..bab496c 100644
+--- mozilla/media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc
++++ mozilla/media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc
+@@ -26,11 +26,23 @@
+ #else
+ #include <linux/videodev2.h>
+ #endif
++#ifdef HAVE_LIBV4L2
++#include <libv4l2.h>
++#endif
+
+ #include "ref_count.h"
+ #include "trace.h"
+
+
++#ifdef HAVE_LIBV4L2
++#define open v4l2_open
++#define close v4l2_close
++#define dup v4l2_dup
++#define ioctl v4l2_ioctl
++#define mmap v4l2_mmap
++#define munmap v4l2_munmap
++#endif
++
+ namespace webrtc
+ {
+ namespace videocapturemodule
+@@ -130,6 +142,11 @@ WebRtc_Word32 DeviceInfoLinux::GetDeviceName(
+ memset(deviceNameUTF8, 0, deviceNameLength);
+ memcpy(cameraName, cap.card, sizeof(cap.card));
+
++ if (cameraName[0] == '\0')
++ {
++ sprintf(cameraName, "Camera at /dev/video%d", deviceNumber);
++ }
++
+ if (deviceNameLength >= strlen(cameraName))
+ {
+ memcpy(deviceNameUTF8, cameraName, strlen(cameraName));
+diff --git media/webrtc/trunk/webrtc/modules/video_capture/linux/video_capture_linux.cc media/webrtc/trunk/webrtc/modules/video_capture/linux/video_capture_linux.cc
+index 12df1b3..e9863ba 100644
+--- mozilla/media/webrtc/trunk/webrtc/modules/video_capture/linux/video_capture_linux.cc
++++ mozilla/media/webrtc/trunk/webrtc/modules/video_capture/linux/video_capture_linux.cc
+@@ -25,6 +25,9 @@
+ #else
+ #include <linux/videodev2.h>
+ #endif
++#ifdef HAVE_LIBV4L2
++#include <libv4l2.h>
++#endif
+
+ #include <new>
+
+@@ -26,6 +31,15 @@
+ #include "critical_section_wrapper.h"
+ #include "video_capture_linux.h"
+
++#ifdef HAVE_LIBV4L2
++#define open v4l2_open
++#define close v4l2_close
++#define dup v4l2_dup
++#define ioctl v4l2_ioctl
++#define mmap v4l2_mmap
++#define munmap v4l2_munmap
++#endif
++
+ namespace webrtc
+ {
+ namespace videocapturemodule
+diff --git media/webrtc/trunk/webrtc/modules/video_capture/video_capture.gypi media/webrtc/trunk/webrtc/modules/video_capture/video_capture.gypi
+index d46b5aa..e452223 100644
+--- mozilla/media/webrtc/trunk/webrtc/modules/video_capture/video_capture.gypi
++++ mozilla/media/webrtc/trunk/webrtc/modules/video_capture/video_capture.gypi
+@@ -7,6 +7,9 @@
+ # be found in the AUTHORS file in the root of the source tree.
+
+ {
++ 'variables': {
++ 'use_libv4l2%': 0,
++ },
+ 'targets': [
+ {
+ 'target_name': 'video_capture_module',
+@@ -49,6 +52,16 @@
+ }, { # include_internal_video_capture == 1
+ 'conditions': [
+ ['include_v4l2_video_capture==1', {
++ 'conditions': [
++ ['use_libv4l2==1', {
++ 'defines': [
++ 'HAVE_LIBV4L2',
++ ],
++ 'libraries': [
++ '-lv4l2',
++ ],
++ }],
++ ],
+ 'include_dirs': [
+ 'linux',
+ ],
+diff --git toolkit/library/Makefile.in toolkit/library/Makefile.in
+index 9c16ffa..1db3794 100644
+--- mozilla/toolkit/library/Makefile.in
++++ mozilla/toolkit/library/Makefile.in
+@@ -405,6 +405,7 @@ endif
+ EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME_PATH,gkmedias,$(DIST)/lib)
+
+ ifdef MOZ_WEBRTC
++EXTRA_DSO_LDOPTS += $(MOZ_LIBV4L2_LIBS)
+ ifdef MOZ_PEERCONNECTION
+ COMPONENT_LIBS += peerconnection
+ endif
diff --git a/mail/thunderbird/files/patch-bug828003 b/mail/thunderbird/files/patch-bug828003
deleted file mode 100644
index 9313b9c77fb0..000000000000
--- a/mail/thunderbird/files/patch-bug828003
+++ /dev/null
@@ -1,36 +0,0 @@
---- mozilla/gfx/qcms/qcmstypes.h
-+++ mozilla/gfx/qcms/qcmstypes.h
-@@ -7,30 +7,12 @@
- #include "mozilla/StandardInteger.h"
-
- /* prtypes.h defines IS_LITTLE_ENDIAN and IS_BIG ENDIAN */
-+/* StandardInteger.h defines int*_t and uintptr_t */
-
--#if defined (__SVR4) && defined (__sun)
--/* int_types.h gets included somehow, so avoid redefining the types differently */
--#include <sys/int_types.h>
--#elif defined (_AIX)
-+#if defined(_AIX)
- #include <sys/types.h>
--#elif defined(__OpenBSD__)
--#include <inttypes.h>
--#elif !defined(ANDROID)
--typedef int8_t int8_t;
--typedef uint8_t uint8_t;
--typedef int16_t int16_t;
--typedef uint16_t uint16_t;
--typedef int32_t int32_t;
--typedef uint32_t uint32_t;
--typedef int64_t int64_t;
--typedef uint64_t uint64_t;
--
--#ifdef __OS2__
--/* OS/2's stdlib typdefs uintptr_t. So we'll just include that so we don't collide */
-+#elif defined(__OS2__)
- #include <stdlib.h>
--#elif !defined(__intptr_t_defined) && !defined(_UINTPTR_T_DEFINED)
--typedef PRUptrdiff uintptr_t;
--#endif
- #endif
-
- #else // MOZ_QCMS
diff --git a/mail/thunderbird/files/patch-bug851992 b/mail/thunderbird/files/patch-bug851992
new file mode 100644
index 000000000000..59e39f81d68d
--- /dev/null
+++ b/mail/thunderbird/files/patch-bug851992
@@ -0,0 +1,373 @@
+diff --git a/config/Makefile.in b/config/Makefile.in
+--- mozilla/config/Makefile.in
++++ mozilla/config/Makefile.in
+@@ -97,16 +97,17 @@ export:: $(export-preqs)
+ -DMOZ_TREE_PIXMAN=$(MOZ_TREE_PIXMAN) \
+ -DMOZ_NATIVE_HUNSPELL=$(MOZ_NATIVE_HUNSPELL) \
+ -DMOZ_NATIVE_BZ2=$(MOZ_NATIVE_BZ2) \
+ -DMOZ_NATIVE_ZLIB=$(MOZ_NATIVE_ZLIB) \
+ -DMOZ_NATIVE_PNG=$(MOZ_NATIVE_PNG) \
+ -DMOZ_NATIVE_JPEG=$(MOZ_NATIVE_JPEG) \
+ -DMOZ_NATIVE_LIBEVENT=$(MOZ_NATIVE_LIBEVENT) \
+ -DMOZ_NATIVE_LIBVPX=$(MOZ_NATIVE_LIBVPX) \
++ -DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \
+ $(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers
+ $(INSTALL) system_wrappers $(DIST)
+
+ GARBAGE_DIRS += system_wrappers
+ endif
+
+ ifdef WRAP_STL_INCLUDES
+ ifdef GNU_CXX
+diff --git a/config/system-headers b/config/system-headers
+--- mozilla/config/system-headers
++++ mozilla/config/system-headers
+@@ -1125,8 +1125,19 @@ gst/video/video.h
+ sys/msg.h
+ sys/ipc.h
+ sys/thr.h
+ sys/user.h
+ kvm.h
+ spawn.h
+ err.h
+ xlocale.h
++#if MOZ_NATIVE_ICU==1
++unicode/locid.h
++unicode/numsys.h
++unicode/ucal.h
++unicode/ucol.h
++unicode/udat.h
++unicode/udatpg.h
++unicode/uenum.h
++unicode/unum.h
++unicode/ustring.h
++#endif
+diff --git a/configure.in b/configure.in
+--- mozilla/configure.in
++++ mozilla/configure.in
+@@ -4134,16 +4134,32 @@ if test -n "$MOZ_NATIVE_FFI"; then
+ PKG_CHECK_MODULES(MOZ_FFI, libffi > 3.0.9)
+ else
+ PKG_CHECK_MODULES(MOZ_FFI, libffi >= 3.0.9)
+ fi
+ MOZ_JS_STATIC_LIBS="$MOZ_JS_STATIC_LIBS $MOZ_FFI_LIBS"
+ fi
+
+ dnl ========================================================
++dnl system icu support
++dnl ========================================================
++MOZ_NATIVE_ICU=
++MOZ_ARG_WITH_BOOL(system-icu,
++[ --with-system-icu
++ Use system icu (located with pkgconfig)],
++ MOZ_NATIVE_ICU=1)
++
++if test -n "$MOZ_NATIVE_ICU"; then
++ PKG_CHECK_MODULES(MOZ_ICU, icu-i18n >= 50.1)
++ MOZ_JS_STATIC_LIBS="$MOZ_JS_STATIC_LIBS $MOZ_ICU_LIBS"
++fi
++
++AC_SUBST(MOZ_NATIVE_ICU)
++
++dnl ========================================================
+ dnl Java SDK support
+ dnl ========================================================
+
+ JAVA_BIN_PATH=
+ MOZ_ARG_WITH_STRING(java-bin-path,
+ [ --with-java-bin-path=dir
+ Location of Java binaries (java, javac, jar)],
+ JAVA_BIN_PATH=$withval)
+diff --git a/js/src/Makefile.in b/js/src/Makefile.in
+--- mozilla/js/src/Makefile.in
++++ mozilla/js/src/Makefile.in
+@@ -232,48 +232,54 @@ endif
+
+ #############################################
+ # BEGIN ECMAScript Internationalization API
+ #
+
+ # ICU headers need to be available whether we build with the complete
+ # Internationalization API or not - ICU stubs rely on them.
+
++ifdef MOZ_NATIVE_ICU
++LOCAL_INCLUDES += $(MOZ_ICU_CFLAGS)
++else
+ LOCAL_INCLUDES += \
+ -I$(topsrcdir)/../../intl/icu/source/common \
+ -I$(topsrcdir)/../../intl/icu/source/i18n \
+ $(NULL)
++endif
+
+ ifdef ENABLE_INTL_API
+
+ ifeq ($(OS_ARCH),WINNT)
+ # Parallel gmake is buggy on Windows
+ ICU_GMAKE_OPTIONS="-j1"
+ # Library names: On Windows, ICU uses modified library names for static
+ # and debug libraries.
+ ifdef MOZ_DEBUG
+ ICU_LIB_SUFFIX=d
+ endif
+ ICU_LIB_RENAME = $(foreach libname,$(ICU_LIB_NAMES),\
+ cp -p intl/icu/lib/s$(libname)$(ICU_LIB_SUFFIX).lib intl/icu/lib/$(libname).lib;)
+ endif
+
++ifndef MOZ_NATIVE_ICU
+ # - Build ICU as part of the "export" target, so things get built
+ # in the right order.
+ # - ICU requires GNU make according to its readme.html. pymake can't be used
+ # because it doesn't support order only dependencies.
+ # - Force ICU to use the standard suffix for object files because expandlibs
+ # will discard all files with a non-standard suffix (bug 857450).
+ # - Options for genrb: -k strict parsing; -R omit collation tailoring rules.
+ export::
+ $(GMAKE) $(ICU_GMAKE_OPTIONS) -C intl/icu STATIC_O=$(OBJ_SUFFIX) GENRBOPTS='-k -R'
+ $(ICU_LIB_RENAME)
+
+ distclean clean::
+ $(call SUBMAKE,$@,intl/icu)
++endif
+
+ endif
+
+ #
+ # END ECMAScript Internationalization API
+ #############################################
+
+
+@@ -398,17 +404,21 @@ CFLAGS += $(MOZ_ZLIB_CFLAGS)
+ EXTRA_LIBS += $(MOZ_ZLIB_LIBS)
+ # Enable zlib usage if zlib has been located. When building the browser on
+ # Windows, MOZ_ZLIB_LIBS is empty because zlib is part of libmozglue. We thus
+ # also enable zlib if mozglue is present.
+ ifneq (,$(MOZ_ZLIB_LIBS)$(MOZ_GLUE_LDFLAGS))
+ DEFINES += -DUSE_ZLIB
+ endif
+
+-SHARED_LIBRARY_LIBS += $(ICU_LIBS)
++ifdef MOZ_NATIVE_ICU
++EXTRA_DSO_LDOPTS += $(MOZ_ICU_LIBS)
++else
++SHARED_LIBRARY_LIBS += $(MOZ_ICU_LIBS)
++endif
+
+ # Prevent floating point errors caused by VC++ optimizations
+ ifdef _MSC_VER
+ # XXX We should add this to CXXFLAGS, too?
+ CFLAGS += -fp:precise
+
+ ifeq ($(CPU_ARCH),x86)
+ # Workaround compiler bug on PGO (Bug 721284)
+diff --git a/js/src/config/Makefile.in b/js/src/config/Makefile.in
+--- mozilla/js/src/config/Makefile.in
++++ mozilla/js/src/config/Makefile.in
+@@ -54,16 +54,17 @@ include $(topsrcdir)/config/rules.mk
+
+ HOST_CFLAGS += -DUNICODE -D_UNICODE
+
+ ifdef WRAP_SYSTEM_INCLUDES
+ export:: \
+ $(call mkdir_deps,system_wrappers_js) \
+ $(NULL)
+ $(PYTHON) $(srcdir)/Preprocessor.py $(DEFINES) $(ACDEFINES) \
++ -DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \
+ $(srcdir)/system-headers | $(PERL) $(srcdir)/make-system-wrappers.pl system_wrappers_js
+ $(INSTALL) system_wrappers_js $(DIST)
+
+ GARBAGE_DIRS += system_wrappers_js
+ endif
+
+ GARBAGE += $(srcdir)/*.pyc *.pyc
+
+diff --git a/js/src/config/system-headers b/js/src/config/system-headers
+--- mozilla/js/src/config/system-headers
++++ mozilla/js/src/config/system-headers
+@@ -1125,8 +1125,19 @@ gst/video/video.h
+ sys/msg.h
+ sys/ipc.h
+ sys/thr.h
+ sys/user.h
+ kvm.h
+ spawn.h
+ err.h
+ xlocale.h
++#if MOZ_NATIVE_ICU==1
++unicode/locid.h
++unicode/numsys.h
++unicode/ucal.h
++unicode/ucol.h
++unicode/udat.h
++unicode/udatpg.h
++unicode/uenum.h
++unicode/unum.h
++unicode/ustring.h
++#endif
+diff --git a/js/src/configure.in b/js/src/configure.in
+--- mozilla/js/src/configure.in
++++ mozilla/js/src/configure.in
+@@ -4406,59 +4406,68 @@ if test "$ACCESSIBILITY" -a "$MOZ_ENABLE
+ AC_DEFINE_UNQUOTED(ATK_MINOR_VERSION, $ATK_MINOR_VERSION)
+ AC_DEFINE_UNQUOTED(ATK_REV_VERSION, $ATK_REV_VERSION)
+ fi
+
+
+ dnl ========================================================
+ dnl ECMAScript Internationalization API Support (uses ICU)
+ dnl ========================================================
++ICU_LIB_NAMES=
++MOZ_NATIVE_ICU=
++MOZ_ARG_WITH_BOOL(system-icu,
++[ --with-system-icu
++ Use system icu (located with pkgconfig)],
++ MOZ_NATIVE_ICU=1)
++
++if test -n "$MOZ_NATIVE_ICU"; then
++ PKG_CHECK_MODULES(MOZ_ICU, icu-i18n >= 50.1)
++fi
+
+ if test -n "$JS_STANDALONE"; then
+ ENABLE_INTL_API=1
+ fi
+ MOZ_ARG_ENABLE_BOOL(intl-api,
+ [ --enable-intl-api Enable ECMAScript Internationalization API (default=yes for standalone JS)],
+ ENABLE_INTL_API=1,
+ ENABLE_INTL_API= )
+
+ dnl Settings for the implementation of the ECMAScript Internationalization API
+ if test -n "$ENABLE_INTL_API"; then
+ AC_DEFINE(ENABLE_INTL_API)
+- # We build ICU as a static library.
+- AC_DEFINE(U_STATIC_IMPLEMENTATION)
+-
+- case "$OS_TARGET" in
+- WINNT)
+- ICU_LIB_NAMES="icuin icuuc icudt"
+- ;;
+- Darwin|Linux)
+- ICU_LIB_NAMES="icui18n icuuc icudata"
+- ;;
+- *)
+- AC_MSG_ERROR([ECMAScript Internationalization API is not yet supported on this platform])
+- esac
+-
+- ICU_LIBS='$(call EXPAND_LIBNAME_PATH,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/lib)'
+-else
+- ICU_LIB_NAMES=
+- ICU_LIBS=
++
++ if test -z "$MOZ_NATIVE_ICU"; then
++ case "$OS_TARGET" in
++ WINNT)
++ ICU_LIB_NAMES="icuin icuuc icudt"
++ ;;
++ Darwin|Linux)
++ ICU_LIB_NAMES="icui18n icuuc icudata"
++ ;;
++ *)
++ AC_MSG_ERROR([ECMAScript Internationalization API is not yet supported on this platform])
++ esac
++ MOZ_ICU_LIBS='$(call EXPAND_LIBNAME_PATH,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/lib)'
++ fi
+ fi
+
+ AC_SUBST(ENABLE_INTL_API)
+ AC_SUBST(ICU_LIB_NAMES)
+-AC_SUBST(ICU_LIBS)
+-
+-dnl Source files that use ICU should have control over which parts of the ICU
+-dnl namespace they want to use.
+-AC_DEFINE(U_USING_ICU_NAMESPACE,0)
+-
++AC_SUBST(MOZ_ICU_LIBS)
++AC_SUBST(MOZ_NATIVE_ICU)
+
+ dnl Settings for ICU
+-if test -n "$ENABLE_INTL_API" ; then
++if test -n "$ENABLE_INTL_API" -a -z "$MOZ_NATIVE_ICU"; then
++ dnl We build ICU as a static library.
++ AC_DEFINE(U_STATIC_IMPLEMENTATION)
++
++ dnl Source files that use ICU should have control over which parts of the ICU
++ dnl namespace they want to use.
++ AC_DEFINE(U_USING_ICU_NAMESPACE,0)
++
+ # Set ICU compile options
+ ICU_CPPFLAGS=""
+ # don't use icu namespace automatically in client code
+ ICU_CPPFLAGS="$ICU_CPPFLAGS -DU_USING_ICU_NAMESPACE=0"
+ # don't include obsolete header files
+ ICU_CPPFLAGS="$ICU_CPPFLAGS -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1"
+ # remove chunks of the library that we don't need (yet)
+ ICU_CPPFLAGS="$ICU_CPPFLAGS -DUCONFIG_NO_LEGACY_CONVERSION"
+diff --git a/js/src/gdb/Makefile.in b/js/src/gdb/Makefile.in
+--- mozilla/js/src/gdb/Makefile.in
++++ mozilla/js/src/gdb/Makefile.in
+@@ -14,16 +14,20 @@ include $(DEPTH)/config/autoconf.mk
+ # Building against js_static requires that we declare mfbt sybols "exported"
+ # on its behalf.
+ DEFINES += -DEXPORT_JS_API -DIMPL_MFBT
+
+ LIBS = $(DEPTH)/$(LIB_PREFIX)js_static.$(LIB_SUFFIX) $(NSPR_LIBS) $(MOZ_ZLIB_LIBS)
+
+ LOCAL_INCLUDES += -I$(topsrcdir) -I..
+
++ifdef MOZ_NATIVE_ICU
++EXTRA_LIBS += $(MOZ_ICU_LIBS)
++endif
++
+ EXTRA_LIBS += $(MOZ_FFI_LIBS)
+
+ # Place a GDB Python auto-load file next to the gdb-tests executable, both
+ # in the build directory and in the dist/bin directory.
+ PP_TARGETS += GDB_AUTOLOAD
+ GDB_AUTOLOAD := gdb-tests-gdb.py.in
+ GDB_AUTOLOAD_FLAGS := -Dtopsrcdir=$(abspath $(topsrcdir))
+
+diff --git a/js/src/jsapi-tests/Makefile.in b/js/src/jsapi-tests/Makefile.in
+--- mozilla/js/src/jsapi-tests/Makefile.in
++++ mozilla/js/src/jsapi-tests/Makefile.in
+@@ -15,16 +15,20 @@ DEFINES += -DEXPORT_JS_API
+ # Building against js_static requires that we declare mfbt sybols "exported"
+ # on its behalf.
+ DEFINES += -DIMPL_MFBT
+
+ LIBS = $(DEPTH)/$(LIB_PREFIX)js_static.$(LIB_SUFFIX) $(NSPR_LIBS) $(MOZ_ZLIB_LIBS)
+
+ LOCAL_INCLUDES += -I$(topsrcdir) -I..
+
++ifdef MOZ_NATIVE_ICU
++EXTRA_LIBS += $(MOZ_ICU_LIBS)
++endif
++
+ EXTRA_LIBS += $(MOZ_FFI_LIBS)
+
+ ifdef QEMU_EXE
+ MOZ_POST_PROGRAM_COMMAND = $(topsrcdir)/build/qemu-wrap --qemu $(QEMU_EXE) --libdir $(CROSS_LIB)
+ endif
+
+ # Place a GDB Python auto-load file next to the jsapi-tests executable in
+ # the build directory.
+diff --git a/js/src/shell/Makefile.in b/js/src/shell/Makefile.in
+--- mozilla/js/src/shell/Makefile.in
++++ mozilla/js/src/shell/Makefile.in
+@@ -22,16 +22,19 @@ DEFINES += -DEXPORT_JS_API
+ # Building against js_static requires that we declare mfbt sybols "exported"
+ # on its behalf.
+ DEFINES += -DIMPL_MFBT
+
+ LIBS = $(NSPR_LIBS) $(EDITLINE_LIBS) $(DEPTH)/$(LIB_PREFIX)js_static.$(LIB_SUFFIX) $(MOZ_ZLIB_LIBS)
+ ifdef MOZ_NATIVE_FFI
+ EXTRA_LIBS += $(MOZ_FFI_LIBS)
+ endif
++ifdef MOZ_NATIVE_ICU
++EXTRA_LIBS += $(MOZ_ICU_LIBS)
++endif
+
+ LOCAL_INCLUDES += -I$(topsrcdir) -I..
+
+ ifeq ($(OS_ARCH),Darwin)
+ ifeq ($(TARGET_CPU),x86_64)
+ DARWIN_EXE_LDFLAGS += -pagezero_size 10000 -image_base 100000000
+ endif
+ endif
diff --git a/mail/thunderbird/files/patch-bug876156 b/mail/thunderbird/files/patch-bug876156
new file mode 100644
index 000000000000..91e93b9b4cae
--- /dev/null
+++ b/mail/thunderbird/files/patch-bug876156
@@ -0,0 +1,13 @@
+diff --git mfbt/Atomics.h mfbt/Atomics.h
+index d79af6c..40b9336 100644
+--- mozilla/mfbt/Atomics.h
++++ mozilla/mfbt/Atomics.h
+@@ -35,7 +35,7 @@
+ */
+ # if !defined(__linux__) && !defined(__OpenBSD__) && \
+ (__cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)) && \
+- __has_include(<atomic>)
++ __has_include_next(<atomic>)
+ # define MOZ_HAVE_CXX11_ATOMICS
+ # endif
+ /*
diff --git a/mail/thunderbird/files/patch-bug878791 b/mail/thunderbird/files/patch-bug878791
new file mode 100644
index 000000000000..aa22938269e3
--- /dev/null
+++ b/mail/thunderbird/files/patch-bug878791
@@ -0,0 +1,11 @@
+--- mozilla/toolkit/components/osfile/osfile_unix_allthreads.jsm.orig 2013-05-11 21:19:53.000000000 +0200
++++ mozilla/toolkit/components/osfile/osfile_unix_allthreads.jsm 2013-06-02 17:15:05.000000000 +0200
+@@ -40,7 +40,7 @@ if (typeof Components != "undefined") {
+ // Open libc
+ let libc;
+ let libc_candidates = [ "libSystem.B.dylib",
+- "libc.so.6",
++ "libc.so.7",
+ "libc.so" ];
+ for (let i = 0; i < libc_candidates.length; ++i) {
+ try {
diff --git a/mail/thunderbird/files/patch-bug886181 b/mail/thunderbird/files/patch-bug886181
new file mode 100644
index 000000000000..892f123b4a52
--- /dev/null
+++ b/mail/thunderbird/files/patch-bug886181
@@ -0,0 +1,11 @@
+--- mozilla/modules/libpref/src/init/all.js~
++++ mozilla/modules/libpref/src/init/all.js
+@@ -193,7 +193,7 @@ pref("media.webm.enabled", true);
+ pref("media.dash.enabled", false);
+ #endif
+ #ifdef MOZ_GSTREAMER
+-pref("media.gstreamer.enabled", false);
++pref("media.gstreamer.enabled", true);
+ #endif
+ #ifdef MOZ_WEBRTC
+ pref("media.navigator.enabled", true);
diff --git a/mail/thunderbird/files/patch-bug889699 b/mail/thunderbird/files/patch-bug889699
new file mode 100644
index 000000000000..13cc64c9a171
--- /dev/null
+++ b/mail/thunderbird/files/patch-bug889699
@@ -0,0 +1,175 @@
+commit 7eb5827
+Author: Edwin Flores <eflores@mozilla.com>
+Date: Sat Jul 20 12:03:08 2013 +1200
+
+ Bug 889699 - Make gstreamer backend return more accurate results for canPlayType() r=alessandro.d
+---
+ content/media/gstreamer/GStreamerFormatHelper.cpp | 90 +++++++++++++++++------
+ 1 file changed, 66 insertions(+), 24 deletions(-)
+
+diff --git content/media/gstreamer/GStreamerFormatHelper.cpp content/media/gstreamer/GStreamerFormatHelper.cpp
+index f05ff8f..39f1fdf 100644
+--- mozilla/content/media/gstreamer/GStreamerFormatHelper.cpp
++++ mozilla/content/media/gstreamer/GStreamerFormatHelper.cpp
+@@ -6,7 +6,7 @@
+
+ #include "GStreamerFormatHelper.h"
+ #include "nsCharSeparatedTokenizer.h"
+-#include "nsXPCOMStrings.h"
++#include "nsString.h"
+ #include "GStreamerLoader.h"
+
+ #define ENTRY_FORMAT(entry) entry[0]
+@@ -36,7 +36,7 @@ void GStreamerFormatHelper::Shutdown() {
+ }
+ }
+
+-char const *const GStreamerFormatHelper::mContainers[6][2] = {
++static char const *const sContainers[6][2] = {
+ {"video/mp4", "video/quicktime"},
+ {"video/quicktime", "video/quicktime"},
+ {"audio/mp4", "audio/x-m4a"},
+@@ -45,7 +45,7 @@ char const *const GStreamerFormatHelper::mContainers[6][2] = {
+ {"audio/mp3", "audio/mpeg, mpegversion=(int)1"},
+ };
+
+-char const *const GStreamerFormatHelper::mCodecs[9][2] = {
++static char const *const sCodecs[9][2] = {
+ {"avc1.42E01E", "video/x-h264"},
+ {"avc1.42001E", "video/x-h264"},
+ {"avc1.58A01E", "video/x-h264"},
+@@ -57,6 +57,15 @@ char const *const GStreamerFormatHelper::mCodecs[9][2] = {
+ {"mp3", "audio/mpeg, mpegversion=(int)1"},
+ };
+
++static char const * const sDefaultCodecCaps[][2] = {
++ {"video/mp4", "video/x-h264"},
++ {"video/quicktime", "video/x-h264"},
++ {"audio/mp4", "audio/mpeg, mpegversion=(int)4"},
++ {"audio/x-m4a", "audio/mpeg, mpegversion=(int)4"},
++ {"audio/mp3", "audio/mpeg, layer=(int)3"},
++ {"audio/mpeg", "audio/mpeg, layer=(int)3"}
++};
++
+ GStreamerFormatHelper::GStreamerFormatHelper()
+ : mFactories(nullptr),
+ mCookie(static_cast<uint32_t>(-1))
+@@ -66,15 +75,15 @@ GStreamerFormatHelper::GStreamerFormatHelper()
+ }
+
+ mSupportedContainerCaps = gst_caps_new_empty();
+- for (unsigned int i = 0; i < G_N_ELEMENTS(mContainers); i++) {
+- const char* capsString = mContainers[i][1];
++ for (unsigned int i = 0; i < G_N_ELEMENTS(sContainers); i++) {
++ const char* capsString = sContainers[i][1];
+ GstCaps* caps = gst_caps_from_string(capsString);
+ gst_caps_append(mSupportedContainerCaps, caps);
+ }
+
+ mSupportedCodecCaps = gst_caps_new_empty();
+- for (unsigned int i = 0; i < G_N_ELEMENTS(mCodecs); i++) {
+- const char* capsString = mCodecs[i][1];
++ for (unsigned int i = 0; i < G_N_ELEMENTS(sCodecs); i++) {
++ const char* capsString = sCodecs[i][1];
+ GstCaps* caps = gst_caps_from_string(capsString);
+ gst_caps_append(mSupportedCodecCaps, caps);
+ }
+@@ -92,6 +101,41 @@ GStreamerFormatHelper::~GStreamerFormatHelper() {
+ g_list_free(mFactories);
+ }
+
++static GstCaps *
++GetContainerCapsFromMIMEType(const char *aType) {
++ /* convert aMIMEType to gst container caps */
++ const char* capsString = nullptr;
++ for (uint32_t i = 0; i < G_N_ELEMENTS(sContainers); i++) {
++ if (!strcmp(ENTRY_FORMAT(sContainers[i]), aType)) {
++ capsString = ENTRY_CAPS(sContainers[i]);
++ break;
++ }
++ }
++
++ if (!capsString) {
++ /* we couldn't find any matching caps */
++ return nullptr;
++ }
++
++ return gst_caps_from_string(capsString);
++}
++
++static GstCaps *
++GetDefaultCapsFromMIMEType(const char *aType) {
++ GstCaps *caps = GetContainerCapsFromMIMEType(aType);
++
++ for (uint32_t i = 0; i < G_N_ELEMENTS(sDefaultCodecCaps); i++) {
++ if (!strcmp(sDefaultCodecCaps[i][0], aType)) {
++ GstCaps *tmp = gst_caps_from_string(sDefaultCodecCaps[i][1]);
++
++ gst_caps_append(caps, tmp);
++ return caps;
++ }
++ }
++
++ return nullptr;
++}
++
+ bool GStreamerFormatHelper::CanHandleMediaType(const nsACString& aMIMEType,
+ const nsAString* aCodecs) {
+ if (!sLoadOK) {
+@@ -101,7 +145,15 @@ bool GStreamerFormatHelper::CanHandleMediaType(const nsACString& aMIMEType,
+ const char *type;
+ NS_CStringGetData(aMIMEType, &type, NULL);
+
+- GstCaps* caps = ConvertFormatsToCaps(type, aCodecs);
++ GstCaps *caps;
++ if (aCodecs && !aCodecs->IsEmpty()) {
++ caps = ConvertFormatsToCaps(type, aCodecs);
++ } else {
++ // Get a minimal set of codec caps for this MIME type we should support so
++ // that we don't overreport MIME types we are able to play.
++ caps = GetDefaultCapsFromMIMEType(type);
++ }
++
+ if (!caps) {
+ return false;
+ }
+@@ -118,21 +170,11 @@ GstCaps* GStreamerFormatHelper::ConvertFormatsToCaps(const char* aMIMEType,
+
+ unsigned int i;
+
+- /* convert aMIMEType to gst container caps */
+- const char* capsString = nullptr;
+- for (i = 0; i < G_N_ELEMENTS(mContainers); i++) {
+- if (!strcmp(ENTRY_FORMAT(mContainers[i]), aMIMEType)) {
+- capsString = ENTRY_CAPS(mContainers[i]);
+- break;
+- }
+- }
+-
+- if (!capsString) {
+- /* we couldn't find any matching caps */
++ GstCaps *caps = GetContainerCapsFromMIMEType(aMIMEType);
++ if (!caps) {
+ return nullptr;
+ }
+
+- GstCaps* caps = gst_caps_from_string(capsString);
+ /* container only */
+ if (!aCodecs) {
+ return caps;
+@@ -141,11 +183,11 @@ GstCaps* GStreamerFormatHelper::ConvertFormatsToCaps(const char* aMIMEType,
+ nsCharSeparatedTokenizer tokenizer(*aCodecs, ',');
+ while (tokenizer.hasMoreTokens()) {
+ const nsSubstring& codec = tokenizer.nextToken();
+- capsString = nullptr;
++ const char *capsString = nullptr;
+
+- for (i = 0; i < G_N_ELEMENTS(mCodecs); i++) {
+- if (codec.EqualsASCII(ENTRY_FORMAT(mCodecs[i]))) {
+- capsString = ENTRY_CAPS(mCodecs[i]);
++ for (i = 0; i < G_N_ELEMENTS(sCodecs); i++) {
++ if (codec.EqualsASCII(ENTRY_FORMAT(sCodecs[i]))) {
++ capsString = ENTRY_CAPS(sCodecs[i]);
+ break;
+ }
+ }
diff --git a/mail/thunderbird/files/patch-bug893397 b/mail/thunderbird/files/patch-bug893397
new file mode 100644
index 000000000000..091d15fb41e5
--- /dev/null
+++ b/mail/thunderbird/files/patch-bug893397
@@ -0,0 +1,206 @@
+diff --git configure.in configure.in
+index 549ad06..2878d9f 100644
+--- mozilla/configure.in
++++ mozilla/configure.in
+@@ -8491,7 +8491,7 @@ case "$OS_TARGET" in
+ NECKO_WIFI=1
+ fi
+ ;;
+- Darwin|SunOS|WINNT)
++ Darwin|FreeBSD|SunOS|WINNT)
+ NECKO_WIFI=1
+ ;;
+ Linux)
+diff --git netwerk/wifi/moz.build netwerk/wifi/moz.build
+index 07b01de..11706af 100644
+--- mozilla/netwerk/wifi/moz.build
++++ mozilla/netwerk/wifi/moz.build
+@@ -34,6 +34,10 @@ if CONFIG['OS_ARCH'] == 'Darwin':
+ CMMSRCS += [
+ 'osx_corewlan.mm',
+ ]
++elif CONFIG['OS_ARCH'] == 'FreeBSD':
++ CPP_SOURCES += [
++ 'nsWifiScannerFreeBSD.cpp',
++ ]
+ elif CONFIG['OS_ARCH'] == 'WINNT':
+ CPP_SOURCES += [
+ 'nsWifiScannerWin.cpp',
+diff --git netwerk/wifi/nsWifiScannerFreeBSD.cpp netwerk/wifi/nsWifiScannerFreeBSD.cpp
+new file mode 100644
+index 0000000..80d4cb6
+--- /dev/null
++++ mozilla/netwerk/wifi/nsWifiScannerFreeBSD.cpp
+@@ -0,0 +1,172 @@
++/* This Source Code Form is subject to the terms of the Mozilla Public
++ * License, v. 2.0. If a copy of the MPL was not distributed with this
++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
++
++// Developed by J.R. Oldroyd <fbsd@opal.com>, December 2012.
++
++// For FreeBSD we use the getifaddrs(3) to obtain the list of interfaces
++// and then check for those with an 802.11 media type and able to return
++// a list of stations. This is similar to ifconfig(8).
++
++#include <sys/types.h>
++#include <sys/ioctl.h>
++#include <sys/socket.h>
++#include <net/if.h>
++#include <net/if_media.h>
++#include <net80211/ieee80211_ioctl.h>
++
++#include <ifaddrs.h>
++#include <string.h>
++#include <unistd.h>
++
++#include "nsWifiAccessPoint.h"
++
++using namespace mozilla;
++
++static nsresult
++FreeBSDGetAccessPointData(nsCOMArray<nsWifiAccessPoint> &accessPoints)
++{
++ bool res = false;
++ char *dupn = NULL;
++ struct ifaddrs *ifal, *ifa;
++ unsigned len;
++
++ // get list of interfaces
++ if (getifaddrs(&ifal) < 0)
++ return NS_ERROR_FAILURE;
++
++ accessPoints.Clear();
++
++ // loop through the interfaces
++ for (ifa = ifal; ifa; ifa = ifa->ifa_next) {
++ int s;
++ struct ifreq ifr;
++ struct ifmediareq ifmr;
++ struct ieee80211req i802r;
++ char iscanbuf[32*1024], *vsr;
++
++ memset(&ifr, 0, sizeof(ifr));
++
++ // list can contain duplicates, so ignore those
++ if (dupn != NULL && strcmp(dupn, ifa->ifa_name) == 0)
++ continue;
++ dupn = ifa->ifa_name;
++
++ // store interface name in socket structure
++ strncpy(ifr.ifr_name, ifa->ifa_name, sizeof(ifr.ifr_name));
++ ifr.ifr_addr.sa_family = AF_LOCAL;
++
++ // open socket to interface
++ if ((s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0)) < 0)
++ continue;
++
++ // clear interface media structure
++ (void) memset(&ifmr, 0, sizeof(ifmr));
++ (void) strncpy(ifmr.ifm_name, ifa->ifa_name, sizeof(ifmr.ifm_name));
++
++ // get interface media information
++ if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) < 0) {
++ close(s);
++ continue;
++ }
++
++ // check interface is a WiFi interface
++ if (IFM_TYPE(ifmr.ifm_active) != IFM_IEEE80211) {
++ close(s);
++ continue;
++ }
++
++ // perform WiFi scan
++ (void) memset(&i802r, 0, sizeof(i802r));
++ (void) strncpy(i802r.i_name, ifa->ifa_name, sizeof(i802r.i_name));
++ i802r.i_type = IEEE80211_IOC_SCAN_RESULTS;
++ i802r.i_data = iscanbuf;
++ i802r.i_len = sizeof(iscanbuf);
++ if (ioctl(s, SIOCG80211, &i802r) < 0) {
++ close(s);
++ continue;
++ }
++
++ // close socket
++ close(s);
++
++ // loop through WiFi networks and build geoloc-lookup structure
++ vsr = (char *) i802r.i_data;
++ len = i802r.i_len;
++ while (len >= sizeof(struct ieee80211req_scan_result)) {
++ struct ieee80211req_scan_result *isr;
++ char *id;
++ int idlen;
++ char ssid[IEEE80211_NWID_LEN+1];
++ nsWifiAccessPoint *ap;
++
++ isr = (struct ieee80211req_scan_result *) vsr;
++
++ // determine size of this entry
++ if (isr->isr_meshid_len) {
++ id = vsr + isr->isr_ie_off + isr->isr_ssid_len;
++ idlen = isr->isr_meshid_len;
++ }
++ else {
++ id = vsr + isr->isr_ie_off;
++ idlen = isr->isr_ssid_len;
++ }
++
++ // copy network data
++ strncpy(ssid, id, idlen);
++ ssid[idlen] = '\0';
++ ap = new nsWifiAccessPoint();
++ ap->setSSID(ssid, strlen(ssid));
++ ap->setMac(isr->isr_bssid);
++ ap->setSignal(isr->isr_rssi);
++ accessPoints.AppendObject(ap);
++ res = true;
++
++ // log the data
++ LOG(( "FreeBSD access point: "
++ "SSID: %s, MAC: %02x-%02x-%02x-%02x-%02x-%02x, "
++ "Strength: %d, Channel: %dMHz\n",
++ ssid, isr->isr_bssid[0], isr->isr_bssid[1], isr->isr_bssid[2],
++ isr->isr_bssid[3], isr->isr_bssid[4], isr->isr_bssid[5],
++ isr->isr_rssi, isr->isr_freq));
++
++ // increment pointers
++ len -= isr->isr_len;
++ vsr += isr->isr_len;
++ }
++ }
++
++ freeifaddrs(ifal);
++
++ return res ? NS_OK : NS_ERROR_FAILURE;
++}
++
++nsresult
++nsWifiMonitor::DoScan()
++{
++ // Regularly get the access point data.
++
++ nsCOMArray<nsWifiAccessPoint> lastAccessPoints;
++ nsCOMArray<nsWifiAccessPoint> accessPoints;
++
++ do {
++ nsresult rv = FreeBSDGetAccessPointData(accessPoints);
++ if (NS_FAILED(rv))
++ return rv;
++
++ bool accessPointsChanged = !AccessPointsEqual(accessPoints, lastAccessPoints);
++ ReplaceArray(lastAccessPoints, accessPoints);
++
++ rv = CallWifiListeners(lastAccessPoints, accessPointsChanged);
++ NS_ENSURE_SUCCESS(rv, rv);
++
++ // wait for some reasonable amount of time. pref?
++ LOG(("waiting on monitor\n"));
++
++ ReentrantMonitorAutoEnter mon(mReentrantMonitor);
++ mon.Wait(PR_SecondsToInterval(60));
++ }
++ while (mKeepGoing);
++
++ return NS_OK;
++}
diff --git a/mail/thunderbird/files/patch-bug910875 b/mail/thunderbird/files/patch-bug910875
new file mode 100644
index 000000000000..41fc23b3653d
--- /dev/null
+++ b/mail/thunderbird/files/patch-bug910875
@@ -0,0 +1,102 @@
+diff --git media/webrtc/trunk/webrtc/modules/audio_device/audio_device_impl.cc media/webrtc/trunk/webrtc/modules/audio_device/audio_device_impl.cc
+index f231b1e..6087696 100644
+--- mozilla/media/webrtc/trunk/webrtc/modules/audio_device/audio_device_impl.cc
++++ mozilla/media/webrtc/trunk/webrtc/modules/audio_device/audio_device_impl.cc
+@@ -16,7 +16,9 @@
+ #include <assert.h>
+ #include <string.h>
+
+-#if defined(_WIN32)
++#if defined(WEBRTC_DUMMY_AUDIO_BUILD)
++// do not include platform specific headers
++#elif defined(_WIN32)
+ #include "audio_device_utility_win.h"
+ #include "audio_device_wave_win.h"
+ #if defined(WEBRTC_WINDOWS_CORE_AUDIO_BUILD)
+@@ -32,14 +34,8 @@
+ #include <stdlib.h>
+ #include "audio_device_utility_android.h"
+ #include "audio_device_jni_android.h"
+-#elif defined(WEBRTC_LINUX)
++#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)
+ #include "audio_device_utility_linux.h"
+- #if defined(LINUX_ALSA)
+- #include "audio_device_alsa_linux.h"
+- #endif
+- #if defined(LINUX_PULSE)
+- #include "audio_device_pulse_linux.h"
+- #endif
+ #elif defined(WEBRTC_IOS)
+ #include "audio_device_utility_ios.h"
+ #include "audio_device_ios.h"
+@@ -47,6 +43,12 @@
+ #include "audio_device_utility_mac.h"
+ #include "audio_device_mac.h"
+ #endif
++#if defined(LINUX_ALSA)
++ #include "audio_device_alsa_linux.h"
++#endif
++#if defined(LINUX_PULSE)
++ #include "audio_device_pulse_linux.h"
++#endif
+ #include "audio_device_dummy.h"
+ #include "audio_device_utility_dummy.h"
+ #include "critical_section_wrapper.h"
+@@ -161,7 +163,7 @@ WebRtc_Word32 AudioDeviceModuleImpl::Che
+ #elif defined(WEBRTC_ANDROID)
+ platform = kPlatformAndroid;
+ WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "current platform is ANDROID");
+-#elif defined(WEBRTC_LINUX)
++#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)
+ platform = kPlatformLinux;
+ WEBRTC_TRACE(kTraceInfo, kTraceAudioDevice, _id, "current platform is LINUX");
+ #elif defined(WEBRTC_IOS)
+@@ -309,7 +311,7 @@ int32_t AudioDeviceModuleImpl::CreatePlatformSpecificObjects()
+
+ // Create the *Linux* implementation of the Audio Device
+ //
+-#elif defined(WEBRTC_LINUX)
++#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)
+ if ((audioLayer == kLinuxPulseAudio) || (audioLayer == kPlatformDefaultAudio))
+ {
+ #if defined(LINUX_PULSE)
+@@ -355,7 +357,7 @@ int32_t AudioDeviceModuleImpl::CreatePlatformSpecificObjects()
+ //
+ ptrAudioDeviceUtility = new AudioDeviceUtilityLinux(Id());
+ }
+-#endif // #if defined(WEBRTC_LINUX)
++#endif // #if defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)
+
+ // Create the *iPhone* implementation of the Audio Device
+ //
+diff --git media/webrtc/trunk/webrtc/modules/audio_device/test/audio_device_test_api.cc media/webrtc/trunk/webrtc/modules/audio_device/test/audio_device_test_api.cc
+index defd7f8..906c4a2 100644
+--- mozilla/media/webrtc/trunk/webrtc/modules/audio_device/test/audio_device_test_api.cc
++++ mozilla/media/webrtc/trunk/webrtc/modules/audio_device/test/audio_device_test_api.cc
+@@ -197,7 +197,7 @@ class AudioDeviceAPITest: public testing::Test {
+ // Create default implementation instance
+ EXPECT_TRUE((audio_device_ = AudioDeviceModuleImpl::Create(
+ kId, AudioDeviceModule::kPlatformDefaultAudio)) != NULL);
+-#elif defined(WEBRTC_LINUX)
++#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)
+ EXPECT_TRUE((audio_device_ = AudioDeviceModuleImpl::Create(
+ kId, AudioDeviceModule::kWindowsWaveAudio)) == NULL);
+ EXPECT_TRUE((audio_device_ = AudioDeviceModuleImpl::Create(
+@@ -1690,7 +1690,7 @@ TEST_F(AudioDeviceAPITest, CPULoad) {
+
+ // TODO(kjellander): Fix flakiness causing failures on Windows.
+ // TODO(phoglund): Fix flakiness causing failures on Linux.
+-#if !defined(_WIN32) && !defined(WEBRTC_LINUX)
++#if !defined(_WIN32) && !defined(WEBRTC_LINUX) && !defined(WEBRTC_BSD)
+ TEST_F(AudioDeviceAPITest, StartAndStopRawOutputFileRecording) {
+ // NOTE: this API is better tested in a functional test
+ CheckInitialPlayoutStates();
+@@ -1759,7 +1759,7 @@ TEST_F(AudioDeviceAPITest, StartAndStopRawInputFileRecording) {
+ // - size of raw_input_not_recording.pcm shall be 0
+ // - size of raw_input_not_recording.pcm shall be > 0
+ }
+-#endif // !WIN32 && !WEBRTC_LINUX
++#endif // !WIN32 && !WEBRTC_LINUX && !defined(WEBRTC_BSD)
+
+ TEST_F(AudioDeviceAPITest, RecordingSampleRate) {
+ uint32_t sampleRate(0);
diff --git a/mail/thunderbird/files/patch-bug916216 b/mail/thunderbird/files/patch-bug916216
new file mode 100644
index 000000000000..2dd125855cb9
--- /dev/null
+++ b/mail/thunderbird/files/patch-bug916216
@@ -0,0 +1,39 @@
+--- mozilla/media/webrtc/trunk/build/build_config.h~
++++ mozilla/media/webrtc/trunk/build/build_config.h
+@@ -37,9 +37,15 @@
+ #elif defined(_WIN32)
+ #define OS_WIN 1
+ #define TOOLKIT_VIEWS 1
+-#elif defined(__FreeBSD__)
++#elif defined(__DragonFly__)
++#define OS_DRAGONFLY 1
++#define TOOLKIT_GTK
++#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ #define OS_FREEBSD 1
+ #define TOOLKIT_GTK
++#elif defined(__NetBSD__)
++#define OS_NETBSD 1
++#define TOOLKIT_GTK
+ #elif defined(__OpenBSD__)
+ #define OS_OPENBSD 1
+ #define TOOLKIT_GTK
+@@ -56,15 +62,15 @@
+
+ // For access to standard BSD features, use OS_BSD instead of a
+ // more specific macro.
+-#if defined(OS_FREEBSD) || defined(OS_OPENBSD)
++#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD) \
++ || defined(OS_NETBSD) || defined(OS_OPENBSD)
+ #define OS_BSD 1
+ #endif
+
+ // For access to standard POSIXish features, use OS_POSIX instead of a
+ // more specific macro.
+-#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_FREEBSD) || \
+- defined(OS_OPENBSD) || defined(OS_SOLARIS) || defined(OS_ANDROID) || \
+- defined(OS_NACL)
++#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) || \
++ defined(OS_SOLARIS) || defined(OS_ANDROID) || defined(OS_NACL)
+ #define OS_POSIX 1
+ #endif
+
diff --git a/mail/thunderbird/files/patch-bug916589 b/mail/thunderbird/files/patch-bug916589
new file mode 100644
index 000000000000..be2c2bc97fd4
--- /dev/null
+++ b/mail/thunderbird/files/patch-bug916589
@@ -0,0 +1,40 @@
+diff --git media/mtransport/third_party/nrappkit/src/port/generic/include/sys/queue.h media/mtransport/third_party/nrappkit/src/port/generic/include/sys/queue.h
+index 5b50785..7cf47d5 100644
+--- mozilla/media/mtransport/third_party/nrappkit/src/port/generic/include/sys/queue.h
++++ mozilla/media/mtransport/third_party/nrappkit/src/port/generic/include/sys/queue.h
+@@ -31,11 +31,14 @@
+ */
+
+-#ifndef _SYS_QUEUE_H_
++#if (defined(BSD) && !defined(__OpenBSD__)) || defined(DARWIN)
++#include_next <sys/queue.h>
++#elif !defined(_SYS_QUEUE_H_)
+ #define _SYS_QUEUE_H_
+
+-#if !defined(__FreeBSD__) && !defined(DARWIN)
+ #include <stddef.h>
+-#define __offsetof offsetof
++
++#ifndef offsetof
++#define offsetof(type, field) ((size_t)(&((type *)0)->field))
+ #endif
+
+ #define STAILQ_FOREACH_SAFE(var, head, field, tvar) \
+@@ -43,8 +46,6 @@
+ (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \
+ (var) = (tvar))
+
+-// #define __offsetof(type, field) ((size_t)(&((type *)0)->field))
+-
+ /*
+ * This file defines four types of data structures: singly-linked lists,
+ * singly-linked tail queues, lists and tail queues.
+@@ -285,7 +286,7 @@ struct { \
+ (STAILQ_EMPTY((head)) ? \
+ NULL : \
+ ((struct type *) \
+- ((char *)((head)->stqh_last) - __offsetof(struct type, field))))
++ ((char *)((head)->stqh_last) - offsetof(struct type, field))))
+
+ #define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next)
+
diff --git a/mail/thunderbird/files/patch-clang32-libc++-visibility-hack b/mail/thunderbird/files/patch-clang32-libc++-visibility-hack
index 9b920f63be0f..881e4ed94b5a 100644
--- a/mail/thunderbird/files/patch-clang32-libc++-visibility-hack
+++ b/mail/thunderbird/files/patch-clang32-libc++-visibility-hack
@@ -1,22 +1,3 @@
---- configure.in~
-+++ configure.in
-@@ -2855,6 +2855,7 @@ EOF
- #pragma GCC visibility push(hidden)
- #pragma GCC visibility push(default)
- #include <string.h>
-+#include <iterator>
- #pragma GCC visibility pop
-
- __attribute__ ((visibility ("default"))) void Func() {
-@@ -2863,7 +2864,7 @@ __attribute__ ((visibility ("default"))) void Func() {
- }
- EOF
- ac_cv_have_visibility_builtin_bug=no
-- if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
-+ if ! ${CXX-c++} ${CXXFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
- ac_cv_have_visibility_builtin_bug=yes
- else
- if test `grep -c "@PLT" conftest.S` = 0; then
--- mozilla/configure.in~
+++ mozilla/configure.in
@@ -2855,6 +2855,7 @@ EOF
diff --git a/mail/thunderbird/files/patch-clang33 b/mail/thunderbird/files/patch-clang33
deleted file mode 100644
index 520639b339d1..000000000000
--- a/mail/thunderbird/files/patch-clang33
+++ /dev/null
@@ -1,25 +0,0 @@
---- mozilla/js/src/jspropertycacheinlines.h~
-+++ mozilla/js/src/jspropertycacheinlines.h
-@@ -31,7 +31,7 @@ JS_ALWAYS_INLINE void
- js::PropertyCache::test(JSContext *cx, jsbytecode *pc, JSObject *&obj,
- JSObject *&pobj, PropertyCacheEntry *&entry, PropertyName *&name)
- {
-- AssertRootingUnnecessary assert(cx);
-+ js::AssertRootingUnnecessary assert(cx);
-
- JS_ASSERT(this == &JS_PROPERTY_CACHE(cx));
-
---- mozilla/js/src/vm/ObjectImpl-inl.h~
-+++ mozilla/js/src/vm/ObjectImpl-inl.h
-@@ -176,9 +176,9 @@ js::ObjectImpl::initializeSlotRange(uint
- JSCompartment *comp = compartment();
- uint32_t offset = start;
- for (HeapSlot *sp = fixedStart; sp < fixedEnd; sp++)
-- sp->init(comp, this->asObjectPtr(), offset++, UndefinedValue());
-+ sp->init(comp, this->asObjectPtr(), offset++, js::UndefinedValue());
- for (HeapSlot *sp = slotsStart; sp < slotsEnd; sp++)
-- sp->init(comp, this->asObjectPtr(), offset++, UndefinedValue());
-+ sp->init(comp, this->asObjectPtr(), offset++, js::UndefinedValue());
- }
-
- inline bool
diff --git a/mail/thunderbird/files/patch-configure.in b/mail/thunderbird/files/patch-configure.in
deleted file mode 100644
index c03ce706001e..000000000000
--- a/mail/thunderbird/files/patch-configure.in
+++ /dev/null
@@ -1,49 +0,0 @@
---- configure.in.orig 2012-07-14 00:40:08.000000000 +0200
-+++ configure.in 2012-08-18 18:16:06.000000000 +0200
-@@ -3101,6 +3118,8 @@
-
- AC_SUBST(VISIBILITY_FLAGS)
-
-+MOZ_COMPILER_OPTS
-+
- dnl Checks for header files.
- dnl ========================================================
- AC_HEADER_DIRENT
-@@ -4067,29 +4086,29 @@
-
- AC_CACHE_CHECK(for __attribute__((always_inline)),
- ac_cv_attribute_always_inline,
-- [AC_TRY_COMPILE([],
-- [inline void f(void) __attribute__((always_inline));],
-+ [AC_TRY_COMPILE([inline void f(void) __attribute__((always_inline));],
-+ [],
- ac_cv_attribute_always_inline=yes,
- ac_cv_attribute_always_inline=no)])
-
- AC_CACHE_CHECK(for __attribute__((malloc)),
- ac_cv_attribute_malloc,
-- [AC_TRY_COMPILE([],
-- [void* f(int) __attribute__((malloc));],
-+ [AC_TRY_COMPILE([void* f(int) __attribute__((malloc));],
-+ [],
- ac_cv_attribute_malloc=yes,
- ac_cv_attribute_malloc=no)])
-
- AC_CACHE_CHECK(for __attribute__((warn_unused_result)),
- ac_cv_attribute_warn_unused,
-- [AC_TRY_COMPILE([],
-- [int f(void) __attribute__((warn_unused_result));],
-+ [AC_TRY_COMPILE([int f(void) __attribute__((warn_unused_result));],
-+ [],
- ac_cv_attribute_warn_unused=yes,
- ac_cv_attribute_warn_unused=no)])
-
- AC_CACHE_CHECK(for __attribute__((noreturn)),
- ac_cv_attribute_noreturn,
-- [AC_TRY_COMPILE([],
-- [void f(void) __attribute__((noreturn));],
-+ [AC_TRY_COMPILE([void f(void) __attribute__((noreturn));],
-+ [],
- ac_cv_attribute_noreturn=yes,
- ac_cv_attribute_noreturn=no)])
-
diff --git a/mail/thunderbird/files/patch-ldap-sdks-c-sdk-ldap-libraries-libprldap-Makefile.in b/mail/thunderbird/files/patch-ldap-sdks-c-sdk-ldap-libraries-libprldap-Makefile.in
index df2e10326632..4b6a5bcca21a 100644
--- a/mail/thunderbird/files/patch-ldap-sdks-c-sdk-ldap-libraries-libprldap-Makefile.in
+++ b/mail/thunderbird/files/patch-ldap-sdks-c-sdk-ldap-libraries-libprldap-Makefile.in
@@ -1,5 +1,5 @@
--- ldap/sdks/c-sdk/ldap/libraries/libprldap/Makefile.in.orig 2008-09-11 16:38:35.000000000 +0200
-+++ ldap/sdks/c-sdk/ldap/libraries/libprldap/Makefile.in 2009-12-09 08:53:46.000000000 +0100
++++ ldap/sdks/c-sdk/ldap/libraries/libprldap/Makefile.in 2009-12-01 10:18:43.000000000 +0100
@@ -147,6 +147,11 @@
CUSTOM_LIBS=1
endif
diff --git a/mail/thunderbird/files/patch-ldap-sdks-c-sdk-ldap-libraries-libssldap-Makefile.in b/mail/thunderbird/files/patch-ldap-sdks-c-sdk-ldap-libraries-libssldap-Makefile.in
index 4ec8205074ee..98aa2319501a 100644
--- a/mail/thunderbird/files/patch-ldap-sdks-c-sdk-ldap-libraries-libssldap-Makefile.in
+++ b/mail/thunderbird/files/patch-ldap-sdks-c-sdk-ldap-libraries-libssldap-Makefile.in
@@ -1,12 +1,13 @@
---- ldap/sdks/c-sdk/ldap/libraries/libssldap/Makefile.in~
-+++ ldap/sdks/c-sdk/ldap/libraries/libssldap/Makefile.in
-@@ -188,6 +188,9 @@ endif
+--- ldap/sdks/c-sdk/ldap/libraries/libssldap/Makefile.in.orig 2009-09-10 17:36:39.000000000 +0200
++++ ldap/sdks/c-sdk/ldap/libraries/libssldap/Makefile.in 2009-09-10 17:37:28.000000000 +0200
+@@ -180,6 +180,10 @@
+ CUSTOM_LIBS=1
+ endif
- OBJDEST = $(OBJDIR_NAME)
-
-+# accept -pthread with MOZ_NATIVE_NSS
-+LINK_DLL = $(CC_FOR_LINK) -shared -o $@ $(OBJS) $(EXTRA_DLL_LIBS)
++ifeq ($(OS_ARCH), FreeBSD)
++CUSTOM_LIBS=1
++endif
+
- ###########################################################################
-
- ifeq ($(USE_DLL_EXPORTS_FILE), 1)
+ ifndef CUSTOM_LIBS
+ EXTRA_LIBS = -L$(dist_libdir) -l$(LDAP_LIBNAME) -l$(PRLDAP_LIBNAME)
+ EXTRA_LIBS += $(NSSLINK)
diff --git a/mail/thunderbird/files/patch-ldap-xpcom-src-Makefile.in b/mail/thunderbird/files/patch-ldap-xpcom-src-Makefile.in
new file mode 100644
index 000000000000..dc1db6b622e9
--- /dev/null
+++ b/mail/thunderbird/files/patch-ldap-xpcom-src-Makefile.in
@@ -0,0 +1,13 @@
+--- ldap/xpcom/src/Makefile.in.orig 2012-03-12 10:25:35.000000000 +0100
++++ ldap/xpcom/src/Makefile.in 2012-03-12 10:26:09.000000000 +0100
+@@ -89,6 +89,10 @@
+ $(NULL)
+ endif
+
++ifeq ($(OS_ARCH), FreeBSD)
++EXTRA_LIBS = -L$(dist_libdir) -l$(LBER_LIBNAME) -lpthread
++endif
++
+ EXTRA_DSO_LDOPTS += $(LDAP_LIBS)
+ ifndef MOZ_INCOMPLETE_EXTERNAL_LINKAGE
+ EXTRA_DSO_LDOPTS += $(MOZ_COMPONENT_LIBS)
diff --git a/mail/thunderbird/files/patch-mozilla-config-baseconfig.mk b/mail/thunderbird/files/patch-mozilla-config-baseconfig.mk
deleted file mode 100644
index f789129c3ba4..000000000000
--- a/mail/thunderbird/files/patch-mozilla-config-baseconfig.mk
+++ /dev/null
@@ -1,16 +0,0 @@
---- mozilla/config/baseconfig.mk~
-+++ mozilla/config/baseconfig.mk
-@@ -1,9 +1,9 @@
- INCLUDED_AUTOCONF_MK = 1
-
--includedir := $(includedir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
--idldir = $(datadir)/idl/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
--installdir = $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
--sdkdir = $(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION)
-+includedir := $(includedir)/%%MOZILLA%%
-+idldir = $(datadir)/idl/%%MOZILLA%%
-+installdir = $(libdir)/%%MOZILLA%%
-+sdkdir = $(libdir)/%%MOZILLA%%
- DIST = $(DEPTH)/dist
-
- # We do magic with OBJ_SUFFIX in config.mk, the following ensures we don't
diff --git a/mail/thunderbird/files/patch-mozilla-ipc-chromium-Makefile.in b/mail/thunderbird/files/patch-mozilla-ipc-chromium-Makefile.in
index 294e8270334a..727a86a4c3bc 100644
--- a/mail/thunderbird/files/patch-mozilla-ipc-chromium-Makefile.in
+++ b/mail/thunderbird/files/patch-mozilla-ipc-chromium-Makefile.in
@@ -1,20 +1,5 @@
--- mozilla/ipc/chromium/Makefile.in~
+++ mozilla/ipc/chromium/Makefile.in
-@@ -43,6 +43,14 @@ include $(DEPTH)/config/autoconf.mk
-
- OS_CXXFLAGS := $(filter-out -fshort-wchar,$(OS_CXXFLAGS))
-
-+# workaround IPC hang with libevent2
-+ifndef MOZ_DEBUG
-+ifneq (,$(filter 4.2.%, $(CXX_VERSION)))
-+MOZ_OPTIMIZE_FLAGS = -O1
-+OS_CXXFLAGS += $(MOZ_OPTIMIZE_FLAGS)
-+endif
-+endif
-+
- LIBRARY_NAME = chromium_s
- FORCE_STATIC_LIB = 1
- LIBXUL_LIBRARY = 1
@@ -55,9 +60,7 @@ vpath %.c \
$(srcdir)/src/third_party/libevent \
$(NULL)
diff --git a/mail/thunderbird/files/patch-mozilla-ipc-chromium-src-base-message_pump_libevent.cc b/mail/thunderbird/files/patch-mozilla-ipc-chromium-src-base-message_pump_libevent.cc
index 3fe4995aa0f8..ba9c0d6d3416 100644
--- a/mail/thunderbird/files/patch-mozilla-ipc-chromium-src-base-message_pump_libevent.cc
+++ b/mail/thunderbird/files/patch-mozilla-ipc-chromium-src-base-message_pump_libevent.cc
@@ -1,9 +1,9 @@
--- mozilla/ipc/chromium/src/base/message_pump_libevent.cc~
+++ mozilla/ipc/chromium/src/base/message_pump_libevent.cc
-@@ -15,7 +15,7 @@
- #include "base/scoped_nsautorelease_pool.h"
+@@ -16,7 +16,7 @@
#include "base/scoped_ptr.h"
#include "base/time.h"
+ #include "nsDependentSubstring.h"
-#include "third_party/libevent/event.h"
+#include "event.h"
diff --git a/mail/thunderbird/files/patch-mozilla-js-src-methodjit-MethodJIT.cpp b/mail/thunderbird/files/patch-mozilla-js-src-methodjit-MethodJIT.cpp
deleted file mode 100644
index 009b469dcd7f..000000000000
--- a/mail/thunderbird/files/patch-mozilla-js-src-methodjit-MethodJIT.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
---- mozilla/js/src/methodjit/MethodJIT.cpp~
-+++ mozilla/js/src/methodjit/MethodJIT.cpp
-@@ -171,7 +171,7 @@
-
- JS_STATIC_ASSERT(offsetof(FrameRegs, sp) == 0);
-
--#if defined(__linux__) && defined(JS_CPU_X64)
-+#if defined(__ELF__) && defined(JS_CPU_X64)
- # define SYMBOL_STRING_RELOC(name) #name "@plt"
- #else
- # define SYMBOL_STRING_RELOC(name) SYMBOL_STRING(name)
-@@ -149,7 +149,7 @@
-
- #if defined(XP_MACOSX)
- # define HIDE_SYMBOL(name) ".private_extern _" #name
--#elif defined(__linux__)
-+#elif defined(__ELF__)
- # define HIDE_SYMBOL(name) ".hidden" #name
- #else
- # define HIDE_SYMBOL(name)
diff --git a/mail/thunderbird/files/patch-mozilla-media-libsydneyaudio-src-sydney_audio_oss.c b/mail/thunderbird/files/patch-mozilla-media-libsydneyaudio-src-sydney_audio_oss.c
deleted file mode 100644
index ddb42a92a1e3..000000000000
--- a/mail/thunderbird/files/patch-mozilla-media-libsydneyaudio-src-sydney_audio_oss.c
+++ /dev/null
@@ -1,13 +0,0 @@
---- mozilla/media/libsydneyaudio/src/sydney_audio_oss.c~
-+++ mozilla/media/libsydneyaudio/src/sydney_audio_oss.c
-@@ -446,6 +446,10 @@ static void audio_callback(void* data)
- printf("!"); /* not enough audio data */
- #endif
- bytes = bytes-bytes_to_copy;
-+ struct timespec ts = {0, 1000000};
-+ pthread_mutex_unlock(&s->mutex);
-+ nanosleep(&ts, NULL);
-+ pthread_mutex_lock(&s->mutex);
- break;
- }
- free(s->bl_head);
diff --git a/mail/thunderbird/files/patch-mozilla-media-webrtc-trunk-src-system_wrappers-source-spreadsortlib-spreadsort.hpp b/mail/thunderbird/files/patch-mozilla-media-webrtc-trunk-src-system_wrappers-source-spreadsortlib-spreadsort.hpp
new file mode 100644
index 000000000000..31f7a8cff08a
--- /dev/null
+++ b/mail/thunderbird/files/patch-mozilla-media-webrtc-trunk-src-system_wrappers-source-spreadsortlib-spreadsort.hpp
@@ -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
diff --git a/mail/thunderbird/files/patch-mozilla-toolkit-xre-Makefile.in b/mail/thunderbird/files/patch-mozilla-toolkit-xre-Makefile.in
deleted file mode 100644
index 224a65d1efe0..000000000000
--- a/mail/thunderbird/files/patch-mozilla-toolkit-xre-Makefile.in
+++ /dev/null
@@ -1,8 +0,0 @@
---- mozilla/toolkit/xre/Makefile.in.orig 2007-09-10 10:31:53.000000000 -0400
-+++ mozilla/toolkit/xre/Makefile.in 2007-09-10 10:35:00.000000000 -0400
-@@ -263,5 +263,3 @@
- libs:: platform.ini
- $(INSTALL) $^ $(DIST)/bin
-
--install::
-- $(INSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir)
diff --git a/mail/thunderbird/files/patch-no-videoio.h b/mail/thunderbird/files/patch-no-videoio.h
new file mode 100644
index 000000000000..f23d04ad6157
--- /dev/null
+++ b/mail/thunderbird/files/patch-no-videoio.h
@@ -0,0 +1,22 @@
+--- mozilla/media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc
++++ mozilla/media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc
+@@ -19,7 +19,7 @@
+ #include <stdlib.h>
+
+ //v4l includes
+-#if defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__)
++#if defined(__NetBSD__) || defined(__OpenBSD__)
+ #include <sys/videoio.h>
+ #elif defined(__sun)
+ #include <sys/videodev2.h>
+--- mozilla/media/webrtc/trunk/webrtc/modules/video_capture/linux/video_capture_linux.cc
++++ mozilla/media/webrtc/trunk/webrtc/modules/video_capture/linux/video_capture_linux.cc
+@@ -18,7 +18,7 @@
+ #include <string.h>
+
+ //v4l includes
+-#if defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__)
++#if defined(__NetBSD__) || defined(__OpenBSD__)
+ #include <sys/videoio.h>
+ #elif defined(__sun)
+ #include <sys/videodev2.h>
diff --git a/mail/thunderbird/files/patch-z-bug762445 b/mail/thunderbird/files/patch-z-bug762445
deleted file mode 100644
index 648492dfa700..000000000000
--- a/mail/thunderbird/files/patch-z-bug762445
+++ /dev/null
@@ -1,70 +0,0 @@
-commit b44dc8e
-Author: Jan Beich <jbeich@tormail.org>
-Date: Fri Oct 12 18:49:59 2012 +0000
-
- Bug 762445 - Add jemalloc3 glue for heap-committed, heap-dirty in about:memory.
----
- memory/build/mozjemalloc_compat.c | 34 ++++++++++++++++++++++++++++------
- 1 file changed, 28 insertions(+), 6 deletions(-)
-
-diff --git memory/build/mozjemalloc_compat.c memory/build/mozjemalloc_compat.c
-index 94ad96e..7adfef5 100644
---- mozilla/memory/build/mozjemalloc_compat.c
-+++ mozilla/memory/build/mozjemalloc_compat.c
-@@ -11,15 +11,50 @@
- #define wrap(a) je_ ## a
- #endif
-
--extern MOZ_IMPORT_API(int)
-+/*
-+ * CTL_* macros are from memory/jemalloc/src/src/stats.c with changes:
-+ * - drop `t' argument to avoid redundancy in calculating type size
-+ * - require `i' argument for arena number explicitly
-+ */
-+
-+#define CTL_GET(n, v) do { \
-+ size_t sz = sizeof(v); \
-+ wrap(mallctl)(n, &v, &sz, NULL, 0); \
-+} while (0)
-+
-+#define CTL_I_GET(n, v, i) do { \
-+ size_t mib[6]; \
-+ size_t miblen = sizeof(mib) / sizeof(mib[0]); \
-+ size_t sz = sizeof(v); \
-+ wrap(mallctlnametomib)(n, mib, &miblen); \
-+ mib[2] = i; \
-+ wrap(mallctlbymib)(mib, miblen, &v, &sz, NULL, 0); \
-+} while (0)
-+
-+MOZ_IMPORT_API(int)
- wrap(mallctl)(const char*, void*, size_t*, void*, size_t);
-+MOZ_IMPORT_API(int)
-+wrap(mallctlnametomib)(const char *name, size_t *mibp, size_t *miblenp);
-+MOZ_IMPORT_API(int)
-+wrap(mallctlbymib)(const size_t *mib, size_t miblen, void *oldp, size_t *oldlenp, void *newp, size_t newlen);
-
- MOZ_EXPORT_API(void)
- jemalloc_stats(jemalloc_stats_t *stats)
- {
-- size_t size = sizeof(stats->mapped);
-- wrap(mallctl)("stats.mapped", &stats->mapped, &size, NULL, 0);
-- wrap(mallctl)("stats.allocated", &stats->allocated, &size, NULL, 0);
-- stats->committed = -1;
-- stats->dirty = -1;
-+ unsigned narenas;
-+ size_t active, allocated, mapped, page, pdirty;
-+
-+ CTL_GET("arenas.narenas", narenas);
-+ CTL_GET("arenas.page", page);
-+ CTL_GET("stats.active", active);
-+ CTL_GET("stats.allocated", allocated);
-+ CTL_GET("stats.mapped", mapped);
-+
-+ /* get the summation for all arenas, i == narenas */
-+ CTL_I_GET("stats.arenas.0.pdirty", pdirty, narenas);
-+
-+ stats->allocated = allocated;
-+ stats->mapped = mapped;
-+ stats->dirty = pdirty * page;
-+ stats->committed = active + stats->dirty;
- }