summaryrefslogtreecommitdiff
path: root/mail/thunderbird
diff options
context:
space:
mode:
authornia <nia@pkgsrc.org>2020-06-15 15:44:22 +0000
committernia <nia@pkgsrc.org>2020-06-15 15:44:22 +0000
commit9b9502ceb8be2c73a6139a7555642e6bde630b3f (patch)
tree5db7ab9045e760328202417051c0fb73b4fa75e4 /mail/thunderbird
parent352a34b3e59b4fade0998a32863e77cd5633216b (diff)
downloadpkgsrc-9b9502ceb8be2c73a6139a7555642e6bde630b3f.tar.gz
thunderbird: Sync with firefox68
- Re-enable multiprocess mode - Drop hacks for crossprocess semaphores on NetBSD - Drop OSS support - Drop unused gnome option Bump PKGREVISION
Diffstat (limited to 'mail/thunderbird')
-rw-r--r--mail/thunderbird/Makefile3
-rw-r--r--mail/thunderbird/distinfo18
-rw-r--r--mail/thunderbird/options.mk17
-rw-r--r--mail/thunderbird/patches/patch-browser_app_profile_firefox.js9
-rw-r--r--mail/thunderbird/patches/patch-dom_media_CubebUtils.cpp6
-rw-r--r--mail/thunderbird/patches/patch-gfx_thebes_gfxPlatform.cpp27
-rw-r--r--mail/thunderbird/patches/patch-ipc_glue_CrossProcessSemaphore.h18
-rw-r--r--mail/thunderbird/patches/patch-ipc_glue_CrossProcessSemaphore__posix.cpp187
-rw-r--r--mail/thunderbird/patches/patch-media_libcubeb_src_cubeb.c37
-rw-r--r--mail/thunderbird/patches/patch-media_libcubeb_src_cubeb__oss.c458
-rw-r--r--mail/thunderbird/patches/patch-media_libcubeb_src_moz.build20
-rw-r--r--mail/thunderbird/patches/patch-old-configure.in62
-rw-r--r--mail/thunderbird/patches/patch-toolkit_library_moz.build11
13 files changed, 65 insertions, 808 deletions
diff --git a/mail/thunderbird/Makefile b/mail/thunderbird/Makefile
index 4e185b94233..692e67350a3 100644
--- a/mail/thunderbird/Makefile
+++ b/mail/thunderbird/Makefile
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.249 2020/06/15 08:31:19 nia Exp $
+# $NetBSD: Makefile,v 1.250 2020/06/15 15:44:22 nia Exp $
DISTNAME= thunderbird-${TB_VER}.source
PKGNAME= thunderbird-${TB_VER}
+PKGREVISION= 1
TB_VER= 68.9.0
CATEGORIES= mail
MASTER_SITES= ${MASTER_SITE_MOZILLA:=thunderbird/releases/${TB_VER}/source/}
diff --git a/mail/thunderbird/distinfo b/mail/thunderbird/distinfo
index 09aa471b969..60ab8b6cdf5 100644
--- a/mail/thunderbird/distinfo
+++ b/mail/thunderbird/distinfo
@@ -1,41 +1,39 @@
-$NetBSD: distinfo,v 1.228 2020/06/05 03:57:58 ryoon Exp $
+$NetBSD: distinfo,v 1.229 2020/06/15 15:44:22 nia Exp $
SHA1 (thunderbird-68.9.0.source.tar.xz) = aeee38c1a36b07f8e85af1c7371ebb539083ab4a
RMD160 (thunderbird-68.9.0.source.tar.xz) = f3467224d1225ec98085d38a4d38b798e3cebd0b
SHA512 (thunderbird-68.9.0.source.tar.xz) = 891472c95ba6ff46061131504e89010da512a84b0e1dea0482e603fd4c87f11e099280a245c7dd9fc9320c48229c26602565c089d86f1a1f4271b29b6fc606f0
Size (thunderbird-68.9.0.source.tar.xz) = 332239044 bytes
-SHA1 (patch-browser_app_profile_firefox.js) = d3ade5620370965e397ba494ff0495aeef5af0d0
+SHA1 (patch-browser_app_profile_firefox.js) = 775599fae82bf2701b8d45b728537abf3bab86fd
SHA1 (patch-build_moz.configure_old.configure) = edd810f8d607697898ae315453719fe6c8c09bcc
SHA1 (patch-build_moz.configure_rust.configure) = b57a9b1451dc426d75774f73d7c05fc98fe6e317
SHA1 (patch-comm_mail_installer_package-manifest.in) = 14e8977f690e579a8caf73326248323615e04803
SHA1 (patch-comm_mail_installer_removed-files.in) = f360ccac70a7afaee65e4617c015535084eee035
SHA1 (patch-config_gcc-stl-wrapper.template.h) = aa9664c1ba850e7c45b654dcf5d7d591d4994a86
SHA1 (patch-dom_base_nsAttrName.h) = 57a1a15cde53a1c8e22b1b38efdd40b9c0f1f91b
-SHA1 (patch-dom_media_CubebUtils.cpp) = 2b6e750a2336434edd9642e1a78f4b6b7df1354a
+SHA1 (patch-dom_media_CubebUtils.cpp) = 5022ead470ba2b3b75bc423e320be0cc18279b6b
SHA1 (patch-gfx_angle_checkout_src_common_third__party_smhasher_src_PMurHash.cpp) = 795b510b525019f49169d1a594cd3e455e706500
SHA1 (patch-gfx_angle_checkout_src_compiler_translator_InfoSink.h) = 879bb8ae14bc28e9c8b5f2874bf76298daea68c1
SHA1 (patch-gfx_gl_GLContextProviderGLX.cpp) = 936ae039b758c5eaf48dd4661c896d186b340207
SHA1 (patch-gfx_skia_skia_src_core_SkCpu.cpp) = c30cb2ed98d4486fcc23b3a9b464df088a30134a
+SHA1 (patch-gfx_thebes_gfxPlatform.cpp) = fcbe2f980557ff4eff8fcb6b4039a5c0eb956fa6
SHA1 (patch-ipc_chromium_src_base_lock__impl__posix.cc) = 80df98ebde2365cdea7b98e72e474f594934718e
SHA1 (patch-ipc_chromium_src_base_message__pump__libevent.cc) = 0475843fa07f38a3f6255cfb998e64863fd8b9c1
SHA1 (patch-ipc_chromium_src_base_platform__thread__posix.cc) = aa71eee667e920b1c2364b90956a7332906c5d74
SHA1 (patch-ipc_chromium_src_chrome_common_ipc__channel__posix.cc) = 2c03850559c733c37a749fdb86a3e4517878d56c
-SHA1 (patch-ipc_glue_CrossProcessSemaphore.h) = bc05df1cee60b3ae45f111ac451dc098027d8add
-SHA1 (patch-ipc_glue_CrossProcessSemaphore__posix.cpp) = d554afd62ee91241747c42d74df31d8d25bb448f
SHA1 (patch-ipc_glue_GeckoChildProcessHost.cpp) = 007ec171c69059d503977bcef036a89b0f38dc5d
SHA1 (patch-js_src_threading_posix_Thread.cpp) = 5c0e0238208b0928ea2472f15bdbe55aa7bcbb44
SHA1 (patch-js_src_util_NativeStack.cpp) = 9bbfcc09e0166d6611ca813a555f60ea205d418d
SHA1 (patch-media_libcubeb_gtest_moz.build) = da3183625cd058fac97dbf675d6a44fb1ee288f9
-SHA1 (patch-media_libcubeb_src_cubeb.c) = e7f5cdf21e18776a252dd9d602761acc958070d7
+SHA1 (patch-media_libcubeb_src_cubeb.c) = 426aeb9cbcd668bb98edff57550cc5ce7f0c690a
SHA1 (patch-media_libcubeb_src_cubeb__alsa.c) = fdf4e43d90c112f70b00c6a1ab0a0f64aebe7ea7
-SHA1 (patch-media_libcubeb_src_cubeb__oss.c) = 202a10b264f7582c9e9b16a4b97447fadea8ff12
-SHA1 (patch-media_libcubeb_src_moz.build) = fd3b036b3ba4105949c6b0f46bf72c89184e777d
+SHA1 (patch-media_libcubeb_src_moz.build) = 79aa16955f6358b1b7d75b4e30bed4554a0afe7f
SHA1 (patch-media_libcubeb_update.sh) = f8d0f674987519a1a1738be158e8cd4296f6def0
SHA1 (patch-media_libpng_pngpriv.h) = dfd4d345e10f6f74d3a3546732a868481c1d5818
SHA1 (patch-nsprpub_pr_src_pthreads_ptsynch.c) = cd0639f97f2135980bc3036cc858ac061107bc75
-SHA1 (patch-old-configure.in) = 24c2f64250160c9e4c4cdc3b5ff2e6d33a5d6aad
+SHA1 (patch-old-configure.in) = 85efc1242429e1c4974882a965cc09790e098b73
SHA1 (patch-toolkit_components_terminator_nsTerminator.cpp) = cd4d65d6e6358b5b77b6b63441a8550f2d1e97c7
-SHA1 (patch-toolkit_library_moz.build) = 429745ec028ce71d8ba2457679b715ac14b6e2d3
+SHA1 (patch-toolkit_library_moz.build) = eee7849a119569ec74822c5f7d4878c7fd6b4096
SHA1 (patch-toolkit_modules_subprocess_subprocess__shared__unix.js) = bc5293f7bf4885443a131958e4099bbf0f2c4a2c
SHA1 (patch-toolkit_moz.configure) = 994c8ff526984482b0e5fa26176ed6c20380a97d
SHA1 (patch-toolkit_mozapps_installer_packager.mk) = 00241c3e79d833a70753063186093d48956546b2
diff --git a/mail/thunderbird/options.mk b/mail/thunderbird/options.mk
index e2ac6516c41..8c16e8eafc6 100644
--- a/mail/thunderbird/options.mk
+++ b/mail/thunderbird/options.mk
@@ -1,13 +1,13 @@
-# $NetBSD: options.mk,v 1.21 2020/01/07 15:41:22 wiz Exp $
+# $NetBSD: options.mk,v 1.22 2020/06/15 15:44:22 nia Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.thunderbird
-PKG_SUPPORTED_OPTIONS= alsa dbus debug mozilla-jemalloc gnome \
- official-mozilla-branding oss pulseaudio \
+PKG_SUPPORTED_OPTIONS= alsa dbus debug mozilla-jemalloc \
+ official-mozilla-branding pulseaudio \
mozilla-lightning wayland
PKG_SUGGESTED_OPTIONS+= mozilla-lightning
-PLIST_VARS+= branding nobranding debug gnome jemalloc
+PLIST_VARS+= branding nobranding debug jemalloc
.include "../../devel/wayland/platform.mk"
.if ${PLATFORM_SUPPORTS_WAYLAND} == "yes"
@@ -15,9 +15,9 @@ PKG_SUGGESTED_OPTIONS+= wayland
.endif
.if ${OPSYS} == "Linux"
-PKG_SUGGESTED_OPTIONS+= pulseaudio mozilla-jemalloc dbus
+PKG_SUGGESTED_OPTIONS+= alsa pulseaudio mozilla-jemalloc dbus
.else
-PKG_SUGGESTED_OPTIONS+= oss dbus
+PKG_SUGGESTED_OPTIONS+= dbus
.endif
.include "../../mk/bsd.options.mk"
@@ -29,11 +29,6 @@ CONFIGURE_ARGS+= --enable-alsa
CONFIGURE_ARGS+= --disable-alsa
.endif
-.if !empty(PKG_OPTIONS:Moss)
-CONFIGURE_ARGS+= --with-oss
-.include "../../mk/oss.buildlink3.mk"
-.endif
-
.if !empty(PKG_OPTIONS:Mmozilla-jemalloc)
PLIST.jemalloc= yes
CONFIGURE_ARGS+= --enable-jemalloc
diff --git a/mail/thunderbird/patches/patch-browser_app_profile_firefox.js b/mail/thunderbird/patches/patch-browser_app_profile_firefox.js
index 25b5829cc4f..08c1e11b1af 100644
--- a/mail/thunderbird/patches/patch-browser_app_profile_firefox.js
+++ b/mail/thunderbird/patches/patch-browser_app_profile_firefox.js
@@ -1,8 +1,8 @@
-$NetBSD: patch-browser_app_profile_firefox.js,v 1.2 2019/09/21 10:55:17 ryoon Exp $
+$NetBSD: patch-browser_app_profile_firefox.js,v 1.3 2020/06/15 15:44:22 nia Exp $
---- browser/app/profile/firefox.js.orig 2019-09-09 23:43:23.000000000 +0000
+--- browser/app/profile/firefox.js.orig 2020-06-02 14:07:51.000000000 +0000
+++ browser/app/profile/firefox.js
-@@ -1862,6 +1862,15 @@ pref("prio.publicKeyB", "26E6674E65425B8
+@@ -1862,6 +1862,12 @@ pref("prio.publicKeyB", "26E6674E65425B8
pref("toolkit.coverage.enabled", false);
pref("toolkit.coverage.endpoint.base", "https://coverage.mozilla.org");
@@ -12,9 +12,6 @@ $NetBSD: patch-browser_app_profile_firefox.js,v 1.2 2019/09/21 10:55:17 ryoon Ex
+// Enable system addons, for example langpacks from www/firefox-l10n
+pref("extensions.autoDisableScopes", 11);
+
-+// Disable multiprocess window support. Workaround for PR 53273.
-+pref("browser.tabs.remote.autostart", false);
-+
// Discovery prefs
pref("browser.discovery.enabled", true);
pref("browser.discovery.containers.enabled", true);
diff --git a/mail/thunderbird/patches/patch-dom_media_CubebUtils.cpp b/mail/thunderbird/patches/patch-dom_media_CubebUtils.cpp
index d2061bc7bac..64672bc711e 100644
--- a/mail/thunderbird/patches/patch-dom_media_CubebUtils.cpp
+++ b/mail/thunderbird/patches/patch-dom_media_CubebUtils.cpp
@@ -1,13 +1,13 @@
-$NetBSD: patch-dom_media_CubebUtils.cpp,v 1.3 2019/09/21 10:55:17 ryoon Exp $
+$NetBSD: patch-dom_media_CubebUtils.cpp,v 1.4 2020/06/15 15:44:22 nia Exp $
---- dom/media/CubebUtils.cpp.orig 2019-09-09 23:43:26.000000000 +0000
+--- dom/media/CubebUtils.cpp.orig 2020-06-02 14:07:52.000000000 +0000
+++ dom/media/CubebUtils.cpp
@@ -163,7 +163,7 @@ const char kBrandBundleURL[] = "chrome:/
const char* AUDIOSTREAM_BACKEND_ID_STR[] = {
"jack", "pulse", "alsa", "audiounit", "audioqueue", "wasapi",
- "winmm", "directsound", "sndio", "opensl", "audiotrack", "kai"};
-+ "winmm", "directsound", "sndio", "opensl", "audiotrack", "kai", "oss", "sun"};
++ "winmm", "directsound", "sndio", "opensl", "audiotrack", "kai", "sun"};
/* Index for failures to create an audio stream the first time. */
const int CUBEB_BACKEND_INIT_FAILURE_FIRST =
ArrayLength(AUDIOSTREAM_BACKEND_ID_STR);
diff --git a/mail/thunderbird/patches/patch-gfx_thebes_gfxPlatform.cpp b/mail/thunderbird/patches/patch-gfx_thebes_gfxPlatform.cpp
new file mode 100644
index 00000000000..0d5ad7721cf
--- /dev/null
+++ b/mail/thunderbird/patches/patch-gfx_thebes_gfxPlatform.cpp
@@ -0,0 +1,27 @@
+$NetBSD: patch-gfx_thebes_gfxPlatform.cpp,v 1.1 2020/06/15 15:44:22 nia Exp $
+
+Don't rely on CrossProcessSemaphore on NetBSD. It has some implementation
+issues that cause issues (kern/55386, not available on NetBSD<9)
+
+This idea is borrowed from macOS which has the same limitation.
+
+--- gfx/thebes/gfxPlatform.cpp.orig 2020-06-02 14:07:53.000000000 +0000
++++ gfx/thebes/gfxPlatform.cpp
+@@ -2991,6 +2991,9 @@ bool gfxPlatform::UsesOffMainThreadCompo
+ }
+
+ bool gfxPlatform::UsesTiling() const {
++#ifdef __NetBSD__
++ return true;
++#else
+ bool usesSkia = GetDefaultContentBackend() == BackendType::SKIA;
+
+ // We can't just test whether the PaintThread is initialized here because
+@@ -3002,6 +3005,7 @@ bool gfxPlatform::UsesTiling() const {
+
+ return gfxPrefs::LayersTilesEnabled() ||
+ (gfxPrefs::LayersTilesEnabledIfSkiaPOMTP() && usesSkia && usesPOMTP);
++#endif
+ }
+
+ bool gfxPlatform::ContentUsesTiling() const {
diff --git a/mail/thunderbird/patches/patch-ipc_glue_CrossProcessSemaphore.h b/mail/thunderbird/patches/patch-ipc_glue_CrossProcessSemaphore.h
deleted file mode 100644
index f37c1564eef..00000000000
--- a/mail/thunderbird/patches/patch-ipc_glue_CrossProcessSemaphore.h
+++ /dev/null
@@ -1,18 +0,0 @@
-$NetBSD: patch-ipc_glue_CrossProcessSemaphore.h,v 1.1 2018/12/16 08:12:15 ryoon Exp $
-
---- ipc/glue/CrossProcessSemaphore.h.orig 2018-12-04 23:11:48.000000000 +0000
-+++ ipc/glue/CrossProcessSemaphore.h
-@@ -93,7 +93,13 @@ private:
- HANDLE mSemaphore;
- #elif !defined(OS_MACOSX)
- RefPtr<mozilla::ipc::SharedMemoryBasic> mSharedBuffer;
-+#if defined(__NetBSD__)
-+ pthread_mutex_t* mMutex;
-+ pthread_cond_t* mNotZero;
-+ uint32_t* mValue;
-+#else
- sem_t* mSemaphore;
-+#endif
- mozilla::Atomic<int32_t>* mRefCount;
- #endif
- };
diff --git a/mail/thunderbird/patches/patch-ipc_glue_CrossProcessSemaphore__posix.cpp b/mail/thunderbird/patches/patch-ipc_glue_CrossProcessSemaphore__posix.cpp
deleted file mode 100644
index a37a03af315..00000000000
--- a/mail/thunderbird/patches/patch-ipc_glue_CrossProcessSemaphore__posix.cpp
+++ /dev/null
@@ -1,187 +0,0 @@
-$NetBSD: patch-ipc_glue_CrossProcessSemaphore__posix.cpp,v 1.3 2019/09/21 10:55:17 ryoon Exp $
-
---- ipc/glue/CrossProcessSemaphore_posix.cpp.orig 2019-09-09 23:43:28.000000000 +0000
-+++ ipc/glue/CrossProcessSemaphore_posix.cpp
-@@ -9,6 +9,11 @@
- #include "nsDebug.h"
- #include "nsISupportsImpl.h"
- #include <errno.h>
-+#if defined(__NetBSD__)
-+#include <iostream>
-+#include <unistd.h>
-+#include <limits>
-+#endif
-
- static const uint64_t kNsPerMs = 1000000;
- static const uint64_t kNsPerSec = 1000000000;
-@@ -16,7 +21,13 @@ static const uint64_t kNsPerSec = 100000
- namespace {
-
- struct SemaphoreData {
-+#if defined(__NetBSD__)
-+ pthread_mutex_t mMutex;
-+ pthread_cond_t mNotZero;
-+ uint32_t mValue;
-+#else
- sem_t mSemaphore;
-+#endif
- mozilla::Atomic<int32_t> mRefCount;
- uint32_t mInitialValue;
- };
-@@ -43,13 +54,27 @@ CrossProcessSemaphore* CrossProcessSemap
- return nullptr;
- }
-
-+#if defined(__NetBSD__)
-+ data->mValue = aInitialValue;
-+ if (pthread_mutex_init(&data->mMutex, NULL) ||
-+ pthread_cond_init(&data->mNotZero, NULL) ) {
-+ return nullptr;
-+ }
-+#else
- if (sem_init(&data->mSemaphore, 1, aInitialValue)) {
- return nullptr;
- }
-+#endif
-
- CrossProcessSemaphore* sem = new CrossProcessSemaphore;
- sem->mSharedBuffer = sharedBuffer;
-+#if defined(__NetBSD__)
-+ sem->mMutex = &data->mMutex;
-+ sem->mNotZero = &data->mNotZero;
-+ sem->mValue = &data->mValue;
-+#else
- sem->mSemaphore = &data->mSemaphore;
-+#endif
- sem->mRefCount = &data->mRefCount;
- *sem->mRefCount = 1;
-
-@@ -85,23 +110,44 @@ CrossProcessSemaphore* CrossProcessSemap
-
- int32_t oldCount = data->mRefCount++;
- if (oldCount == 0) {
-+#if defined(__NetBSD__)
-+ if (pthread_mutex_init(&data->mMutex, NULL) ||
-+ pthread_cond_init(&data->mNotZero, NULL) ) {
-+ data->mRefCount--;
-+ return nullptr;
-+ }
-+#else
- // The other side has already let go of their CrossProcessSemaphore, so now
- // mSemaphore is garbage. We need to re-initialize it.
- if (sem_init(&data->mSemaphore, 1, data->mInitialValue)) {
- data->mRefCount--;
- return nullptr;
- }
-+#endif
- }
-
- CrossProcessSemaphore* sem = new CrossProcessSemaphore;
- sem->mSharedBuffer = sharedBuffer;
-+#if defined(__NetBSD__)
-+ sem->mMutex = &data->mMutex;
-+ sem->mNotZero = &data->mNotZero;
-+ sem->mValue = &data->mValue;
-+#else
- sem->mSemaphore = &data->mSemaphore;
-+#endif
- sem->mRefCount = &data->mRefCount;
- return sem;
- }
-
- CrossProcessSemaphore::CrossProcessSemaphore()
-- : mSemaphore(nullptr), mRefCount(nullptr) {
-+#if defined(__NetBSD__)
-+ : mMutex (nullptr)
-+ , mNotZero (nullptr)
-+ , mValue (nullptr)
-+#else
-+ : mSemaphore(nullptr)
-+#endif
-+ , mRefCount(nullptr) {
- MOZ_COUNT_CTOR(CrossProcessSemaphore);
- }
-
-@@ -110,16 +156,57 @@ CrossProcessSemaphore::~CrossProcessSema
-
- if (oldCount == 0) {
- // Nothing can be done if the destroy fails so ignore return code.
-+#if defined(__NetBSD__)
-+ (void)pthread_cond_destroy(mNotZero);
-+ (void)pthread_mutex_destroy(mMutex);
-+#else
- Unused << sem_destroy(mSemaphore);
-+#endif
- }
-
- MOZ_COUNT_DTOR(CrossProcessSemaphore);
- }
-
-+#if defined(__NetBSD__)
-+static struct timespec
-+makeAbsTime(const Maybe<TimeDuration>& aWaitTime) {
-+ struct timespec ts;
-+ if (aWaitTime.isSome()) {
-+ clock_gettime(CLOCK_REALTIME, &ts);
-+ ts.tv_nsec += (kNsPerMs * aWaitTime->ToMilliseconds());
-+ ts.tv_sec += ts.tv_nsec / kNsPerSec;
-+ ts.tv_nsec %= kNsPerSec;
-+ }
-+ else {
-+ ts.tv_sec = std::numeric_limits<time_t>::max();
-+ ts.tv_nsec = 0;
-+ }
-+ return ts;
-+}
-+#endif
-+
- bool CrossProcessSemaphore::Wait(const Maybe<TimeDuration>& aWaitTime) {
- MOZ_ASSERT(*mRefCount > 0,
- "Attempting to wait on a semaphore with zero ref count");
- int ret;
-+#if defined(__NetBSD__)
-+ struct timespec ts = makeAbsTime(aWaitTime);
-+
-+ ret = pthread_mutex_lock(mMutex);
-+
-+ if (ret == 0) {
-+ while (ret == 0 && mValue == 0) {
-+ ret = pthread_cond_timedwait(mNotZero, mMutex, &ts);
-+ while (ret == -1 && errno == EINTR) {
-+ ret = pthread_cond_timedwait(mNotZero, mMutex, &ts);
-+ }
-+ }
-+ if (ret == 0) {
-+ --(*mValue);
-+ }
-+ pthread_mutex_unlock(mMutex);
-+ }
-+#else
- if (aWaitTime.isSome()) {
- struct timespec ts;
- if (clock_gettime(CLOCK_REALTIME, &ts) == -1) {
-@@ -136,13 +223,24 @@ bool CrossProcessSemaphore::Wait(const M
- while ((ret = sem_wait(mSemaphore)) == -1 && errno == EINTR) {
- }
- }
-+#endif
- return ret == 0;
- }
-
- void CrossProcessSemaphore::Signal() {
- MOZ_ASSERT(*mRefCount > 0,
- "Attempting to signal a semaphore with zero ref count");
-+#if defined(__NetBSD__)
-+ int ret;
-+ ret = pthread_mutex_lock(mMutex);
-+ if (ret == 0) {
-+ ++(*mValue);
-+ pthread_cond_signal(mNotZero);
-+ pthread_mutex_unlock(mMutex);
-+ }
-+#else
- sem_post(mSemaphore);
-+#endif
- }
-
- CrossProcessSemaphoreHandle CrossProcessSemaphore::ShareToProcess(
diff --git a/mail/thunderbird/patches/patch-media_libcubeb_src_cubeb.c b/mail/thunderbird/patches/patch-media_libcubeb_src_cubeb.c
index e492f76c0ee..8b1548f6ccd 100644
--- a/mail/thunderbird/patches/patch-media_libcubeb_src_cubeb.c
+++ b/mail/thunderbird/patches/patch-media_libcubeb_src_cubeb.c
@@ -1,6 +1,6 @@
-$NetBSD: patch-media_libcubeb_src_cubeb.c,v 1.2 2019/09/21 10:55:17 ryoon Exp $
+$NetBSD: patch-media_libcubeb_src_cubeb.c,v 1.3 2020/06/15 15:44:22 nia Exp $
---- media/libcubeb/src/cubeb.c.orig 2019-09-09 23:43:34.000000000 +0000
+--- media/libcubeb/src/cubeb.c.orig 2020-06-02 14:07:57.000000000 +0000
+++ media/libcubeb/src/cubeb.c
@@ -51,6 +51,9 @@ int wasapi_init(cubeb ** context, char c
#if defined(USE_SNDIO)
@@ -12,28 +12,7 @@ $NetBSD: patch-media_libcubeb_src_cubeb.c,v 1.2 2019/09/21 10:55:17 ryoon Exp $
#if defined(USE_OPENSL)
int opensl_init(cubeb ** context, char const * context_name);
#endif
-@@ -60,6 +63,9 @@ int audiotrack_init(cubeb ** context, ch
- #if defined(USE_KAI)
- int kai_init(cubeb ** context, char const * context_name);
- #endif
-+#if defined(USE_OSS)
-+int oss_init(cubeb ** context, char const * context_name);
-+#endif
-
- static int
- validate_stream_params(cubeb_stream_params * input_stream_params,
-@@ -160,6 +166,10 @@ cubeb_init(cubeb ** context, char const
- #if defined(USE_KAI)
- init_oneshot = kai_init;
- #endif
-+ } else if (!strcmp(backend_name, "oss")) {
-+#if defined(USE_OSS)
-+ init_oneshot = oss_init;
-+#endif
- } else {
- /* Already set */
- }
-@@ -195,6 +205,9 @@ cubeb_init(cubeb ** context, char const
+@@ -195,6 +198,9 @@ cubeb_init(cubeb ** context, char const
#if defined(USE_SNDIO)
sndio_init,
#endif
@@ -43,13 +22,3 @@ $NetBSD: patch-media_libcubeb_src_cubeb.c,v 1.2 2019/09/21 10:55:17 ryoon Exp $
#if defined(USE_OPENSL)
opensl_init,
#endif
-@@ -204,6 +217,9 @@ cubeb_init(cubeb ** context, char const
- #if defined(USE_KAI)
- kai_init,
- #endif
-+#if defined(USE_OSS)
-+ oss_init,
-+#endif
- };
- int i;
-
diff --git a/mail/thunderbird/patches/patch-media_libcubeb_src_cubeb__oss.c b/mail/thunderbird/patches/patch-media_libcubeb_src_cubeb__oss.c
deleted file mode 100644
index 46e624db1c7..00000000000
--- a/mail/thunderbird/patches/patch-media_libcubeb_src_cubeb__oss.c
+++ /dev/null
@@ -1,458 +0,0 @@
-$NetBSD: patch-media_libcubeb_src_cubeb__oss.c,v 1.2 2019/09/21 10:55:17 ryoon Exp $
-
---- media/libcubeb/src/cubeb_oss.c.orig 2019-09-20 11:02:11.665481416 +0000
-+++ media/libcubeb/src/cubeb_oss.c
-@@ -0,0 +1,453 @@
-+/*
-+ * Copyright © 2014 Mozilla Foundation
-+ *
-+ * This program is made available under an ISC-style license. See the
-+ * accompanying file LICENSE for details.
-+ */
-+#if defined(HAVE_SYS_SOUNDCARD_H)
-+#include <sys/soundcard.h>
-+#else
-+#include <soundcard.h>
-+#endif
-+#include <unistd.h>
-+#include <stdlib.h>
-+#include <sys/types.h>
-+#include <sys/stat.h>
-+#include <fcntl.h>
-+#include <sys/ioctl.h>
-+#include <errno.h>
-+#include <pthread.h>
-+#include <stdio.h>
-+#include <assert.h>
-+
-+#include "cubeb/cubeb.h"
-+#include "cubeb-internal.h"
-+
-+#ifndef CUBEB_OSS_DEFAULT_OUTPUT
-+#define CUBEB_OSS_DEFAULT_OUTPUT "/dev/dsp"
-+#endif
-+
-+#define OSS_BUFFER_SIZE 1024
-+
-+struct cubeb {
-+ struct cubeb_ops const * ops;
-+};
-+
-+struct cubeb_stream {
-+ /* Note: Must match cubeb_stream layout in cubeb.c. */
-+ cubeb * context;
-+ void * user_ptr;
-+ /**/
-+
-+ cubeb_data_callback data_callback;
-+ cubeb_state_callback state_callback;
-+ float volume;
-+ float panning;
-+
-+ pthread_mutex_t state_mutex;
-+ pthread_cond_t state_cond;
-+
-+ int running;
-+ int stopped;
-+ int floating;
-+
-+ /* These two vars are needed to support old versions of OSS */
-+ unsigned int position_bytes;
-+ unsigned int last_position_bytes;
-+
-+ uint64_t written_frags; /* The number of fragments written to /dev/dsp */
-+ uint64_t missed_frags; /* fragments output with stopped stream */
-+
-+ cubeb_stream_params params;
-+ int fd;
-+ pthread_t th;
-+};
-+
-+static struct cubeb_ops const oss_ops;
-+
-+int oss_init(cubeb ** context, char const * context_name)
-+{
-+ cubeb* ctx = (cubeb*)malloc(sizeof(cubeb));
-+ ctx->ops = &oss_ops;
-+ *context = ctx;
-+ return CUBEB_OK;
-+}
-+
-+static void oss_destroy(cubeb *ctx)
-+{
-+ free(ctx);
-+}
-+
-+static char const * oss_get_backend_id(cubeb * context)
-+{
-+ static char oss_name[] = "oss";
-+ return oss_name;
-+}
-+
-+static int oss_get_max_channel_count(cubeb * ctx, uint32_t * max_channels)
-+{
-+ *max_channels = 2; /* Let's support only stereo for now */
-+ return CUBEB_OK;
-+}
-+
-+static int oss_get_min_latency(cubeb * context, cubeb_stream_params params,
-+ uint32_t * latency_frames)
-+{
-+ (void)context;
-+ /* 40ms is a big enough number to work ok */
-+ *latency_frames = 40 * params.rate / 1000;
-+ return CUBEB_OK;
-+}
-+
-+static int oss_get_preferred_sample_rate(cubeb *context, uint32_t * rate)
-+{
-+ /* 48000 seems a prefered choice for most audio devices
-+ * and a good choice for OSS */
-+ *rate = 48000;
-+ return CUBEB_OK;
-+}
-+
-+static void run_state_callback(cubeb_stream *stream, cubeb_state state)
-+{
-+ if (stream->state_callback) {
-+ stream->state_callback(stream, stream->user_ptr, state);
-+ }
-+}
-+
-+static long run_data_callback(cubeb_stream *stream, void *buffer, long nframes)
-+{
-+ long got = 0;
-+ pthread_mutex_lock(&stream->state_mutex);
-+ if (stream->data_callback && stream->running && !stream->stopped) {
-+ pthread_mutex_unlock(&stream->state_mutex);
-+ got = stream->data_callback(stream, stream->user_ptr, NULL, buffer, nframes);
-+ } else {
-+ pthread_mutex_unlock(&stream->state_mutex);
-+ }
-+ return got;
-+}
-+
-+static void apply_volume_int(int16_t* buffer, unsigned int n,
-+ float volume, float panning)
-+{
-+ float left = volume;
-+ float right = volume;
-+ unsigned int i;
-+ int pan[2];
-+ if (panning<0) {
-+ right *= (1+panning);
-+ } else {
-+ left *= (1-panning);
-+ }
-+ pan[0] = 128.0*left;
-+ pan[1] = 128.0*right;
-+ for(i=0; i<n; i++){
-+ buffer[i] = ((int)buffer[i])*pan[i%2]/128;
-+ }
-+}
-+
-+static void apply_volume_float(float* buffer, unsigned int n,
-+ float volume, float panning)
-+{
-+ float left = volume;
-+ float right = volume;
-+ unsigned int i;
-+ float pan[2];
-+ if (panning<0) {
-+ right *= (1+panning);
-+ } else {
-+ left *= (1-panning);
-+ }
-+ pan[0] = left;
-+ pan[1] = right;
-+ for(i=0; i<n; i++){
-+ buffer[i] = buffer[i]*pan[i%2];
-+ }
-+}
-+
-+
-+static void *writer(void *stm)
-+{
-+ cubeb_stream* stream = (cubeb_stream*)stm;
-+ int16_t buffer[OSS_BUFFER_SIZE];
-+ float f_buffer[OSS_BUFFER_SIZE];
-+ int got;
-+ unsigned long i;
-+ while (stream->running) {
-+ pthread_mutex_lock(&stream->state_mutex);
-+ if (stream->stopped) {
-+ pthread_mutex_unlock(&stream->state_mutex);
-+ run_state_callback(stream, CUBEB_STATE_STOPPED);
-+ pthread_mutex_lock(&stream->state_mutex);
-+ while (stream->stopped) {
-+ pthread_cond_wait(&stream->state_cond, &stream->state_mutex);
-+ }
-+ pthread_mutex_unlock(&stream->state_mutex);
-+ run_state_callback(stream, CUBEB_STATE_STARTED);
-+ continue;
-+ }
-+ pthread_mutex_unlock(&stream->state_mutex);
-+ if (stream->floating) {
-+ got = run_data_callback(stream, f_buffer,
-+ OSS_BUFFER_SIZE/stream->params.channels);
-+ apply_volume_float(f_buffer, got*stream->params.channels,
-+ stream->volume, stream->panning);
-+ for (i=0; i<((unsigned long)got)*stream->params.channels; i++) {
-+ /* Clipping is prefered to overflow */
-+ if(f_buffer[i]>=1.0){
-+ f_buffer[i]=1.0;
-+ }
-+ if(f_buffer[i]<=-1.0){
-+ f_buffer[i]=-1.0;
-+ }
-+ /* One might think that multipling by 32767.0 is logical but results in clipping */
-+ buffer[i] = f_buffer[i]*32767.0;
-+ }
-+ } else {
-+ got = run_data_callback(stream, buffer,
-+ OSS_BUFFER_SIZE/stream->params.channels);
-+ apply_volume_int(buffer, got*stream->params.channels,
-+ stream->volume, stream->panning);
-+ }
-+ if (got<0) {
-+ run_state_callback(stream, CUBEB_STATE_ERROR);
-+ break;
-+ }
-+ if (!got) {
-+ run_state_callback(stream, CUBEB_STATE_DRAINED);
-+ }
-+ if (got) {
-+ size_t i = 0;
-+ size_t s = got*stream->params.channels*sizeof(int16_t);
-+ while (i < s) {
-+ ssize_t n = write(stream->fd, ((char*)buffer) + i, s - i);
-+ if (n<=0) {
-+ run_state_callback(stream, CUBEB_STATE_ERROR);
-+ break;
-+ }
-+ i+=n;
-+ }
-+ stream->written_frags+=got;
-+ }
-+ }
-+ return NULL;
-+}
-+
-+static void oss_try_set_latency(cubeb_stream* stream, unsigned int latency_frames)
-+{
-+ unsigned int latency_bytes, n_frag;
-+ int frag;
-+ /* fragment size of 1024 is a good choice with good chances to be accepted */
-+ unsigned int frag_log=10; /* 2^frag_log = fragment size */
-+ latency_bytes =
-+ latency_frames*stream->params.channels*sizeof(uint16_t);
-+ n_frag = latency_bytes>>frag_log;
-+ frag = (n_frag<<16) | frag_log;
-+ /* Even if this fails we wish to continue, not checking for errors */
-+ ioctl(stream->fd, SNDCTL_DSP_SETFRAGMENT, &frag);
-+}
-+
-+static int oss_stream_init(cubeb * context, cubeb_stream ** stm,
-+ char const * stream_name,
-+ cubeb_devid input_device,
-+ cubeb_stream_params * input_stream_params,
-+ cubeb_devid output_device,
-+ cubeb_stream_params * output_stream_params,
-+ unsigned int latency_frames,
-+ cubeb_data_callback data_callback,
-+ cubeb_state_callback state_callback, void * user_ptr)
-+{
-+ cubeb_stream* stream = (cubeb_stream*)malloc(sizeof(cubeb_stream));
-+ stream->context = context;
-+ stream->data_callback = data_callback;
-+ stream->state_callback = state_callback;
-+ stream->user_ptr = user_ptr;
-+
-+ assert(!input_stream_params && "not supported.");
-+ if (input_device || output_device) {
-+ /* Device selection not yet implemented. */
-+ return CUBEB_ERROR_DEVICE_UNAVAILABLE;
-+ }
-+
-+ if ((input_stream_params && input_stream_params->prefs & CUBEB_STREAM_PREF_LOOPBACK) ||
-+ (output_stream_params && output_stream_params->prefs & CUBEB_STREAM_PREF_LOOPBACK)) {
-+ return CUBEB_ERROR_NOT_SUPPORTED;
-+ }
-+
-+ if ((stream->fd = open(CUBEB_OSS_DEFAULT_OUTPUT, O_WRONLY)) == -1) {
-+ free(stream);
-+ return CUBEB_ERROR;
-+ }
-+#define SET(what, to) do { unsigned int i = to; \
-+ int j = ioctl(stream->fd, what, &i); \
-+ if (j == -1 || i != to) { \
-+ close(stream->fd); \
-+ free(stream); \
-+ return CUBEB_ERROR_INVALID_FORMAT; } } while (0)
-+
-+ stream->params = *output_stream_params;
-+ stream->volume = 1.0;
-+ stream->panning = 0.0;
-+
-+ oss_try_set_latency(stream, latency_frames);
-+
-+ stream->floating = 0;
-+ SET(SNDCTL_DSP_CHANNELS, stream->params.channels);
-+ SET(SNDCTL_DSP_SPEED, stream->params.rate);
-+ switch (stream->params.format) {
-+ case CUBEB_SAMPLE_S16LE:
-+ SET(SNDCTL_DSP_SETFMT, AFMT_S16_LE);
-+ break;
-+ case CUBEB_SAMPLE_S16BE:
-+ SET(SNDCTL_DSP_SETFMT, AFMT_S16_BE);
-+ break;
-+ case CUBEB_SAMPLE_FLOAT32LE:
-+ SET(SNDCTL_DSP_SETFMT, AFMT_S16_NE);
-+ stream->floating = 1;
-+ break;
-+ default:
-+ close(stream->fd);
-+ free(stream);
-+ return CUBEB_ERROR;
-+ }
-+
-+
-+ pthread_mutex_init(&stream->state_mutex, NULL);
-+ pthread_cond_init(&stream->state_cond, NULL);
-+
-+ stream->running = 1;
-+ stream->stopped = 1;
-+ stream->position_bytes = 0;
-+ stream->last_position_bytes = 0;
-+ stream->written_frags = 0;
-+ stream->missed_frags = 0;
-+
-+ pthread_create(&stream->th, NULL, writer, (void*)stream);
-+
-+ *stm = stream;
-+
-+ return CUBEB_OK;
-+}
-+
-+static void oss_stream_destroy(cubeb_stream * stream)
-+{
-+ pthread_mutex_lock(&stream->state_mutex);
-+
-+ stream->running = 0;
-+ stream->stopped = 0;
-+ pthread_cond_signal(&stream->state_cond);
-+
-+ pthread_mutex_unlock(&stream->state_mutex);
-+
-+ pthread_join(stream->th, NULL);
-+
-+ pthread_mutex_destroy(&stream->state_mutex);
-+ pthread_cond_destroy(&stream->state_cond);
-+ close(stream->fd);
-+ free(stream);
-+}
-+
-+static int oss_stream_get_latency(cubeb_stream * stream, uint32_t * latency)
-+{
-+ if (ioctl(stream->fd, SNDCTL_DSP_GETODELAY, latency)==-1) {
-+ return CUBEB_ERROR;
-+ }
-+ /* Convert latency from bytes to frames */
-+ *latency /= stream->params.channels*sizeof(int16_t);
-+ return CUBEB_OK;
-+}
-+
-+
-+static int oss_stream_current_optr(cubeb_stream * stream, uint64_t * position)
-+{
-+ count_info ci;
-+ /* Unfortunately, this ioctl is only available in OSS 4.x */
-+#ifdef SNDCTL_DSP_CURRENT_OPTR
-+ oss_count_t count;
-+ if (ioctl(stream->fd, SNDCTL_DSP_CURRENT_OPTR, &count) != -1) {
-+ *position = count.samples;// + count.fifo_samples;
-+ return CUBEB_OK;
-+ }
-+#endif
-+ /* Fall back to this ioctl in case the previous one fails */
-+ if (ioctl(stream->fd, SNDCTL_DSP_GETOPTR, &ci) == -1) {
-+ return CUBEB_ERROR;
-+ }
-+ /* ci.bytes is only 32 bit and will start to wrap after arithmetic overflow */
-+ stream->position_bytes += ci.bytes - stream->last_position_bytes;
-+ stream->last_position_bytes = ci.bytes;
-+ *position = stream->position_bytes/stream->params.channels/sizeof(int16_t);
-+ return CUBEB_OK;
-+}
-+
-+static int oss_stream_get_position(cubeb_stream * stream, uint64_t * position)
-+{
-+ if ( oss_stream_current_optr(stream, position) == CUBEB_OK ){
-+ *position -= stream->missed_frags;
-+ return CUBEB_OK;
-+ }
-+ /* If no correct method to get position works we resort to this */
-+ *position = stream->written_frags;
-+ return CUBEB_OK;
-+}
-+
-+
-+static int oss_stream_start(cubeb_stream * stream)
-+{
-+ pthread_mutex_lock(&stream->state_mutex);
-+ if (stream->stopped) {
-+ uint64_t ptr;
-+ oss_stream_current_optr(stream, &ptr);
-+ stream->missed_frags = ptr - stream->written_frags;
-+ stream->stopped = 0;
-+ pthread_cond_signal(&stream->state_cond);
-+ }
-+ pthread_mutex_unlock(&stream->state_mutex);
-+ return CUBEB_OK;
-+}
-+
-+static int oss_stream_stop(cubeb_stream * stream)
-+{
-+ pthread_mutex_lock(&stream->state_mutex);
-+ stream->stopped = 1;
-+ pthread_mutex_unlock(&stream->state_mutex);
-+ return CUBEB_OK;
-+}
-+
-+int oss_stream_set_panning(cubeb_stream * stream, float panning)
-+{
-+ if (stream->params.channels == 2) {
-+ stream->panning=panning;
-+ }
-+ return CUBEB_OK;
-+}
-+
-+int oss_stream_set_volume(cubeb_stream * stream, float volume)
-+{
-+ stream->volume=volume;
-+ return CUBEB_OK;
-+}
-+
-+static struct cubeb_ops const oss_ops = {
-+ .init = oss_init,
-+ .get_backend_id = oss_get_backend_id,
-+ .get_max_channel_count = oss_get_max_channel_count,
-+ .get_min_latency = oss_get_min_latency,
-+ .get_preferred_sample_rate = oss_get_preferred_sample_rate,
-+ .enumerate_devices = NULL,
-+ .device_collection_destroy = NULL,
-+ .destroy = oss_destroy,
-+ .stream_init = oss_stream_init,
-+ .stream_destroy = oss_stream_destroy,
-+ .stream_start = oss_stream_start,
-+ .stream_stop = oss_stream_stop,
-+ .stream_reset_default_device = NULL,
-+ .stream_get_position = oss_stream_get_position,
-+ .stream_get_latency = oss_stream_get_latency,
-+ .stream_set_volume = oss_stream_set_volume,
-+ .stream_set_panning = oss_stream_set_panning,
-+ .stream_get_current_device = NULL,
-+ .stream_device_destroy = NULL,
-+ .stream_register_device_changed_callback = NULL,
-+ .register_device_collection_changed = NULL
-+};
diff --git a/mail/thunderbird/patches/patch-media_libcubeb_src_moz.build b/mail/thunderbird/patches/patch-media_libcubeb_src_moz.build
index 9d62b27a85d..ed0f812c961 100644
--- a/mail/thunderbird/patches/patch-media_libcubeb_src_moz.build
+++ b/mail/thunderbird/patches/patch-media_libcubeb_src_moz.build
@@ -1,17 +1,11 @@
-$NetBSD: patch-media_libcubeb_src_moz.build,v 1.2 2019/09/21 10:55:17 ryoon Exp $
+$NetBSD: patch-media_libcubeb_src_moz.build,v 1.3 2020/06/15 15:44:22 nia Exp $
---- media/libcubeb/src/moz.build.orig 2019-09-09 23:43:34.000000000 +0000
+--- media/libcubeb/src/moz.build.orig 2020-06-02 14:07:57.000000000 +0000
+++ media/libcubeb/src/moz.build
-@@ -23,6 +23,18 @@ if CONFIG['MOZ_ALSA']:
+@@ -23,6 +23,12 @@ if CONFIG['MOZ_ALSA']:
]
DEFINES['USE_ALSA'] = True
-+if CONFIG['MOZ_OSS']:
-+ SOURCES += [
-+ 'cubeb_oss.c',
-+ ]
-+ DEFINES['USE_OSS'] = True
-+
+if CONFIG['MOZ_SUNAUDIO']:
+ SOURCES += [
+ 'cubeb_sun.c',
@@ -21,11 +15,3 @@ $NetBSD: patch-media_libcubeb_src_moz.build,v 1.2 2019/09/21 10:55:17 ryoon Exp
if CONFIG['MOZ_PULSEAUDIO'] or CONFIG['MOZ_JACK']:
SOURCES += [
'cubeb_resampler.cpp',
-@@ -89,6 +101,7 @@ FINAL_LIBRARY = 'gkmedias'
-
- CFLAGS += CONFIG['MOZ_ALSA_CFLAGS']
- CFLAGS += CONFIG['MOZ_JACK_CFLAGS']
-+CFLAGS += CONFIG['MOZ_OSS_CFLAGS']
- CFLAGS += CONFIG['MOZ_PULSEAUDIO_CFLAGS']
-
- # We allow warnings for third-party code that can be updated from upstream.
diff --git a/mail/thunderbird/patches/patch-old-configure.in b/mail/thunderbird/patches/patch-old-configure.in
index 6abb3b7da63..80a564c8f84 100644
--- a/mail/thunderbird/patches/patch-old-configure.in
+++ b/mail/thunderbird/patches/patch-old-configure.in
@@ -1,75 +1,23 @@
-$NetBSD: patch-old-configure.in,v 1.2 2019/09/21 10:55:17 ryoon Exp $
+$NetBSD: patch-old-configure.in,v 1.3 2020/06/15 15:44:22 nia Exp $
---- old-configure.in.orig 2019-09-09 23:43:36.000000000 +0000
+--- old-configure.in.orig 2020-06-02 14:07:57.000000000 +0000
+++ old-configure.in
-@@ -1987,6 +1987,71 @@ MOZ_WEBM_ENCODER=1
+@@ -1987,6 +1987,19 @@ MOZ_WEBM_ENCODER=1
AC_DEFINE(MOZ_WEBM_ENCODER)
AC_SUBST(MOZ_WEBM_ENCODER)
+dnl ==================================
-+dnl = Check OSS/sunaudio availability
++dnl = Check sunaudio availability
+dnl ==================================
+
-+dnl If using Linux, Solaris or BSDs, ensure that OSS/sunaudio is available
++dnl If using Solaris or NetBSD, ensure that sunaudio is available
+case "$OS_TARGET" in
-+Linux|DragonFly|FreeBSD|GNU/kFreeBSD)
-+ MOZ_OSS=1
-+ ;;
+SunOS|NetBSD)
+ MOZ_SUNAUDIO=1
+ ;;
+esac
+
-+MOZ_ARG_WITH_STRING(oss,
-+[ --with-oss[=PFX] Enable OpenSoundSystem support [installed at prefix PFX]],
-+ OSSPREFIX=$withval)
-+
-+if test -n "$OSSPREFIX"; then
-+ if test "$OSSPREFIX" != "no"; then
-+ MOZ_OSS=1
-+ else
-+ MOZ_OSS=
-+ fi
-+fi
-+
-+_SAVE_CFLAGS=$CFLAGS
-+_SAVE_LIBS=$LIBS
-+if test -n "$MOZ_OSS"; then
-+ dnl Prefer 4Front implementation
-+ AC_MSG_CHECKING([MOZ_OSS_CFLAGS])
-+ if test "$OSSPREFIX" != "yes"; then
-+ oss_conf=${OSSPREFIX%/usr}/etc/oss.conf
-+ if test -f "$oss_conf"; then
-+ . "$oss_conf"
-+ else
-+ OSSLIBDIR=$OSSPREFIX/lib/oss
-+ fi
-+ if test -d "$OSSLIBDIR"; then
-+ MOZ_OSS_CFLAGS="$MOZ_OSS_CFLAGS -I$OSSLIBDIR/include"
-+ fi
-+ fi
-+ AC_MSG_RESULT([$MOZ_OSS_CFLAGS])
-+
-+ CFLAGS="$CFLAGS $MOZ_OSS_CFLAGS"
-+ MOZ_CHECK_HEADERS(sys/soundcard.h soundcard.h)
-+
-+ if test "$ac_cv_header_sys_soundcard_h" != "yes" -a \
-+ "$ac_cv_header_soundcard_h" != "yes"; then
-+ AC_MSG_ERROR([Need OSS for Ogg, Wave or WebM decoding on $OS_TARGET. Disable with --without-oss.])
-+ fi
-+
-+ dnl Assume NetBSD implementation over SunAudio
-+ AC_CHECK_LIB(ossaudio, _oss_ioctl,
-+ [AC_DEFINE_UNQUOTED(CUBEB_OSS_DEFAULT_OUTPUT, "/dev/audio")
-+ MOZ_OSS_LIBS="$MOZ_OSS_LIBS -lossaudio"])
-+fi
-+CFLAGS=$_SAVE_CFLAGS
-+LIBS=$_SAVE_LIBS
-+
+AC_SUBST(MOZ_SUNAUDIO)
-+AC_SUBST(MOZ_OSS)
-+AC_SUBST_LIST(MOZ_OSS_CFLAGS)
-+AC_SUBST_LIST(MOZ_OSS_LIBS)
+
dnl ========================================================
dnl NegotiateAuth
diff --git a/mail/thunderbird/patches/patch-toolkit_library_moz.build b/mail/thunderbird/patches/patch-toolkit_library_moz.build
index 17ee2322252..8980dcd3607 100644
--- a/mail/thunderbird/patches/patch-toolkit_library_moz.build
+++ b/mail/thunderbird/patches/patch-toolkit_library_moz.build
@@ -1,15 +1,14 @@
-$NetBSD: patch-toolkit_library_moz.build,v 1.1 2018/12/16 08:12:16 ryoon Exp $
+$NetBSD: patch-toolkit_library_moz.build,v 1.2 2020/06/15 15:44:22 nia Exp $
---- toolkit/library/moz.build.orig 2018-12-04 23:12:02.000000000 +0000
+--- toolkit/library/moz.build.orig 2020-06-02 14:08:02.000000000 +0000
+++ toolkit/library/moz.build
-@@ -247,8 +247,8 @@ if CONFIG['MOZ_SYSTEM_LIBVPX']:
+@@ -231,9 +231,6 @@ if CONFIG['MOZ_SYSTEM_LIBVPX']:
if not CONFIG['MOZ_TREE_PIXMAN']:
OS_LIBS += CONFIG['MOZ_PIXMAN_LIBS']
-if CONFIG['MOZ_ALSA']:
- OS_LIBS += CONFIG['MOZ_ALSA_LIBS']
-+if CONFIG['MOZ_OSS']:
-+ OS_LIBS += CONFIG['MOZ_OSS_LIBS']
-
+-
if CONFIG['HAVE_CLOCK_MONOTONIC']:
OS_LIBS += CONFIG['REALTIME_LIBS']
+