update mail/thunderbird to 78.2.2
See https://support.mozilla.org/en-US/kb/new-thunderbird-78 for major changes in Thunderbird 78, the release announcement in https://blog.thunderbird.net/2020/07/whats-new-in-thunderbird-78/ and https://blog.thunderbird.net/2020/09/openpgp-in-thunderbird-78/ info for OpenPGP users. Also check UPDATING 20200918. Current release notes are in https://www.thunderbird.net/en-US/thunderbird/78.2.2/releasenotes/ PR: 249346 Submitted by: jbeich
This commit is contained in:
parent
95448e02a1
commit
ba9052fd39
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=548882
17
UPDATING
17
UPDATING
@ -5,6 +5,23 @@ they are unavoidable.
|
||||
You should get into the habit of checking this file for changes each time
|
||||
you update your ports collection, before attempting any port upgrades.
|
||||
|
||||
20200918:
|
||||
AFFECTS: users of mail/thunderbird
|
||||
AUTHOR: cmt@FreeBSD.org
|
||||
|
||||
Thunderbird has been updated to the 78esr series. Thunderbird will
|
||||
try to convert old profiles on first start, but conversion may fail
|
||||
especially on old profiles. Also, older versions of Thunderbird will
|
||||
not be able to use a profile once it has been converted. It is
|
||||
strongly recommended to move any ~/.thunderbird folder away before
|
||||
starting Thunderbird 78 for the first time, thus creating a new and
|
||||
empty profile.
|
||||
Also note that OpenPGP functionality has been integrated into Thunderbird,
|
||||
obsoleting the Enigmail extension.
|
||||
Check https://wiki.mozilla.org/Thunderbird:OpenPGP for details, and
|
||||
especially https://wiki.mozilla.org/Thunderbird:OpenPGP:Smartcards
|
||||
if your private key lives on a smartcard.
|
||||
|
||||
20200914:
|
||||
AFFECTS: users of lang/php72
|
||||
AUTHOR: tz@FreeBSD.org
|
||||
|
@ -2,8 +2,7 @@
|
||||
# $FreeBSD$
|
||||
|
||||
PORTNAME= thunderbird
|
||||
DISTVERSION= 68.12.0
|
||||
PORTREVISION= 2
|
||||
DISTVERSION= 78.2.2
|
||||
CATEGORIES= mail news net-im
|
||||
MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \
|
||||
MOZILLA/${PORTNAME}/candidates/${DISTVERSION}-candidates/build1/source
|
||||
@ -14,27 +13,31 @@ COMMENT= Mozilla Thunderbird is standalone mail and news that stands above
|
||||
|
||||
BROKEN_powerpc64= fails to build: gmake[4]: *** [backend.mk:47: .deps/node.stub.stub] Error 246
|
||||
|
||||
BUILD_DEPENDS= nspr>=4.21:devel/nspr \
|
||||
nss>=3.52.1:security/nss \
|
||||
icu>=63.1,1:devel/icu \
|
||||
BUILD_DEPENDS= nspr>=4.26:devel/nspr \
|
||||
nss>=3.56:security/nss \
|
||||
icu>=67.1,1:devel/icu \
|
||||
libevent>=2.1.8:devel/libevent \
|
||||
harfbuzz>=2.4.0:print/harfbuzz \
|
||||
graphite2>=1.3.13:graphics/graphite2 \
|
||||
harfbuzz>=2.6.6:print/harfbuzz \
|
||||
graphite2>=1.3.14:graphics/graphite2 \
|
||||
png>=1.6.35:graphics/png \
|
||||
libvpx>=1.5.0:multimedia/libvpx \
|
||||
sqlite3>=3.28.0:databases/sqlite3 \
|
||||
libvpx>=1.8.2:multimedia/libvpx \
|
||||
py${PYTHON3_DEFAULT:S/.//}-sqlite3>0:databases/py-sqlite3@py${PYTHON3_DEFAULT:S/.//} \
|
||||
v4l_compat>0:multimedia/v4l_compat \
|
||||
autoconf-2.13:devel/autoconf213 \
|
||||
nasm:devel/nasm \
|
||||
yasm:devel/yasm \
|
||||
zip:archivers/zip
|
||||
LIB_DEPENDS= libjson-c.so:devel/json-c \
|
||||
libbotan-2.so:security/botan2
|
||||
|
||||
SSP_UNSAFE= yes
|
||||
USE_GECKO= gecko
|
||||
USE_MOZILLA= -vpx
|
||||
USE_MOZILLA= -sqlite
|
||||
|
||||
USES= tar:xz
|
||||
|
||||
MOZ_OPTIONS= --enable-application=comm/mail --enable-official-branding
|
||||
MOZ_OPTIONS+= --with-system-bz2 --with-system-jsonc --with-system-botan
|
||||
MOZ_MK_OPTIONS= MOZ_THUNDERBIRD=1 MAIL_PKG_SHARED=1
|
||||
MOZ_EXPORT= MOZ_THUNDERBIRD=1 MAIL_PKG_SHARED=1
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
TIMESTAMP = 1598386363
|
||||
SHA256 (thunderbird-68.12.0.source.tar.xz) = 8cf582d03125df86044626072c0d924d4b7c3e984d9228d62acdf4e9918eec02
|
||||
SIZE (thunderbird-68.12.0.source.tar.xz) = 331226160
|
||||
TIMESTAMP = 1599607340
|
||||
SHA256 (thunderbird-78.2.2.source.tar.xz) = 63e8641551d21f6a185e100260bae33d4ab529e30eb0e4d85a57f3aed974ec67
|
||||
SIZE (thunderbird-78.2.2.source.tar.xz) = 353246904
|
||||
|
12
mail/thunderbird/files/patch-browser-app-nsBrowserApp.cpp
Normal file
12
mail/thunderbird/files/patch-browser-app-nsBrowserApp.cpp
Normal file
@ -0,0 +1,12 @@
|
||||
--- browser/app/nsBrowserApp.cpp.orig 2016-09-19 16:19:28 UTC
|
||||
+++ browser/app/nsBrowserApp.cpp
|
||||
@@ -324,6 +324,9 @@ int main(int argc, char* argv[], char* e
|
||||
{
|
||||
mozilla::TimeStamp start = mozilla::TimeStamp::Now();
|
||||
|
||||
+ setenv("MOZ_GMP_PATH", "%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko", 0);
|
||||
+ setenv("MOZ_PLUGIN_PATH", "%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko", 0);
|
||||
+
|
||||
#ifdef HAS_DLL_BLOCKLIST
|
||||
DllBlocklist_Initialize();
|
||||
|
43
mail/thunderbird/files/patch-bug1269654_comment5
Normal file
43
mail/thunderbird/files/patch-bug1269654_comment5
Normal file
@ -0,0 +1,43 @@
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1269654#c5
|
||||
https://bug1269654.bmoattachments.org/attachment.cgi?id=8749234
|
||||
handle big-endian formats in Cairo format conversions
|
||||
|
||||
# HG changeset patch
|
||||
# User Lee Salzman <lsalzman@mozilla.com>
|
||||
# Date 1462463631 14400
|
||||
# Thu May 05 11:53:51 2016 -0400
|
||||
# Node ID 8da374804a09977c8f89af5e6e0cb37cb074595d
|
||||
# Parent 29662e28a9c93ac67ee0b8ddfb65a9f29bbf73f5
|
||||
handle big-endian formats in Cairo format conversions
|
||||
|
||||
--- gfx/2d/HelpersCairo.h.orig 2019-12-02 17:51:16.633474000 +0100
|
||||
+++ gfx/2d/HelpersCairo.h 2019-12-02 17:52:44.939998000 +0100
|
||||
@@ -147,7 +147,14 @@ static inline cairo_format_t GfxFormatToCairoFormat(Su
|
||||
case SurfaceFormat::R5G6B5_UINT16:
|
||||
return CAIRO_FORMAT_RGB16_565;
|
||||
default:
|
||||
- gfxCriticalError() << "Unknown image format " << (int)format;
|
||||
+ // _UINT32 formats don't match B8G8R8[AX]8 on big-endian platforms,
|
||||
+ // and Moz2d uses B8G8R8[AX]8 as if it was _UINT32.
|
||||
+ // See bug 1269654
|
||||
+ if (format == SurfaceFormat::B8G8R8X8) {
|
||||
+ return CAIRO_FORMAT_RGB24;
|
||||
+ } else if (format != SurfaceFormat::B8G8R8A8) {
|
||||
+ gfxCriticalError() << "Unknown image format " << (int)format;
|
||||
+ }
|
||||
return CAIRO_FORMAT_ARGB32;
|
||||
}
|
||||
}
|
||||
@@ -177,7 +184,11 @@ static inline cairo_content_t GfxFormatToCairoContent(
|
||||
case SurfaceFormat::A8:
|
||||
return CAIRO_CONTENT_ALPHA;
|
||||
default:
|
||||
- gfxCriticalError() << "Unknown image content format " << (int)format;
|
||||
+ if (format == SurfaceFormat::B8G8R8X8) {
|
||||
+ return CAIRO_CONTENT_COLOR;
|
||||
+ } else if (format != SurfaceFormat::B8G8R8A8) {
|
||||
+ gfxCriticalError() << "Unknown image content format " << (int)format;
|
||||
+ }
|
||||
return CAIRO_CONTENT_COLOR_ALPHA;
|
||||
}
|
||||
}
|
@ -2,66 +2,36 @@ diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.confi
|
||||
index 855214a..1e91d51 100644
|
||||
--- build/moz.configure/init.configure
|
||||
+++ build/moz.configure/init.configure
|
||||
@@ -165,16 +165,17 @@ option(env='PYTHON', nargs=1, help='Python interpreter')
|
||||
# ==============================================================
|
||||
@depends('PYTHON', check_build_environment, mozconfig, '--help')
|
||||
@imports('os')
|
||||
@imports('sys')
|
||||
@imports('subprocess')
|
||||
@imports(_from='mozbuild.configure.util', _import='LineIO')
|
||||
@imports(_from='mozbuild.virtualenv', _import='VirtualenvManager')
|
||||
@imports(_from='mozbuild.virtualenv', _import='verify_python_version')
|
||||
@@ -251,6 +251,7 @@ option(env='PYTHON3', nargs=1, help='Python 3 interpre
|
||||
@imports(_from='mozbuild.pythonutil', _import='find_python3_executable')
|
||||
@imports(_from='mozbuild.pythonutil', _import='python_executable_version')
|
||||
@imports(_from='six', _import='ensure_text')
|
||||
+@imports(_from='__builtin__', _import='KeyError')
|
||||
@imports('distutils.sysconfig')
|
||||
def virtualenv_python(env_python, build_env, mozconfig, help):
|
||||
def virtualenv_python3(env_python, build_env, mozconfig, help):
|
||||
# Avoid re-executing python when running configure --help.
|
||||
if help:
|
||||
return
|
||||
|
||||
python = env_python[0] if env_python else None
|
||||
|
||||
# Ideally we'd rely on the mozconfig injection from mozconfig_options,
|
||||
@@ -184,16 +185,22 @@ def virtualenv_python(env_python, build_env, mozconfig, help):
|
||||
if 'PYTHON' in mozconfig['env']['added']:
|
||||
python = mozconfig['env']['added']['PYTHON']
|
||||
elif 'PYTHON' in mozconfig['env']['modified']:
|
||||
python = mozconfig['env']['modified']['PYTHON'][1]
|
||||
elif 'PYTHON' in mozconfig['vars']['added']:
|
||||
python = mozconfig['vars']['added']['PYTHON']
|
||||
elif 'PYTHON' in mozconfig['vars']['modified']:
|
||||
python = mozconfig['vars']['modified']['PYTHON'][1]
|
||||
@@ -283,6 +284,12 @@ def virtualenv_python3(env_python, build_env, mozconfi
|
||||
python = mozconfig['vars']['added']['PYTHON3']
|
||||
elif 'PYTHON3' in mozconfig['vars']['modified']:
|
||||
python = mozconfig['vars']['modified']['PYTHON3'][1]
|
||||
+ for i in ('env', 'vars'):
|
||||
+ for j in ('added', 'modified'):
|
||||
+ try:
|
||||
+ del mozconfig[i][j]['PYTHON']
|
||||
+ del mozconfig[i][j]['PYTHON3']
|
||||
+ except KeyError:
|
||||
+ pass
|
||||
|
||||
with LineIO(lambda l: log.error(l)) as out:
|
||||
verify_python_version(out)
|
||||
topsrcdir, topobjdir = build_env.topsrcdir, build_env.topobjdir
|
||||
if topobjdir.endswith('/js/src'):
|
||||
topobjdir = topobjdir[:-7]
|
||||
log.debug("python3: executable from configuration: %r" % python)
|
||||
|
||||
with LineIO(lambda l: log.info(l)) as out:
|
||||
@@ -255,17 +262,20 @@ def virtualenv_python(env_python, build_env, mozconfig
|
||||
log.info('Creating Python environment')
|
||||
manager.build(python)
|
||||
|
||||
python = normsep(manager.python_path)
|
||||
|
||||
if not normsep(sys.executable).startswith(normsep(virtualenvs_root)):
|
||||
log.info('Reexecuting in the virtualenv')
|
||||
@@ -365,7 +372,10 @@ def virtualenv_python3(env_python, build_env, mozconfi
|
||||
sys.executable, manager.python_path))
|
||||
log.info('Re-executing in the virtualenv')
|
||||
if env_python:
|
||||
- del os.environ['PYTHON']
|
||||
+ try:
|
||||
+ del os.environ['PYTHON']
|
||||
+ except KeyError:
|
||||
+ pass
|
||||
# One would prefer to use os.execl, but that's completely borked on
|
||||
# Windows.
|
||||
sys.exit(subprocess.call([python] + sys.argv))
|
||||
|
||||
# We are now in the virtualenv
|
||||
if not distutils.sysconfig.get_python_lib():
|
||||
die('Could not determine python site packages directory')
|
||||
|
||||
- del os.environ['PYTHON3']
|
||||
+ try:
|
||||
+ del os.environ['PYTHON3']
|
||||
+ except KeyError:
|
||||
+ pass
|
||||
# Homebrew on macOS will change Python's sys.executable to a custom
|
||||
# value which messes with mach's virtualenv handling code. Override
|
||||
# Homebrew's changes with the correct sys.executable value.
|
||||
|
34
mail/thunderbird/files/patch-bug1504834_comment10
Normal file
34
mail/thunderbird/files/patch-bug1504834_comment10
Normal file
@ -0,0 +1,34 @@
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1504834#c10
|
||||
https://bug1504834.bmoattachments.org/attachment.cgi?id=9111147
|
||||
mozilla-bmo1504834-part4.patch
|
||||
|
||||
# HG changeset patch
|
||||
# Parent 46ea866ca3acb8bb5e1709ceb799b9c94f591dec
|
||||
Problem description: Tab-titles that are too long to fit into a tab get faded out.
|
||||
On big endian this is broken and instead of fading out, the
|
||||
tab gets white and the font transparent, leading to an unreadable
|
||||
tab-title
|
||||
Solution: This is not a real solution, but a hack. The real solution would have been
|
||||
to byte-swap the correct buffer, but I could not find it.
|
||||
So the next best thing is to deactivate the fading-effect. Now all tab-titles
|
||||
are readable, albeit not as pretty to look at as they could be.
|
||||
Side-effects: I have not yet found an unwanted side-effect.
|
||||
|
||||
diff -r 46ea866ca3ac -r 6ef20eee3f8f gfx/2d/DrawTargetSkia.cpp
|
||||
--- gfx/2d/DrawTargetSkia.cpp Tue Oct 22 12:27:22 2019 +0200
|
||||
+++ gfx/2d/DrawTargetSkia.cpp Thu Oct 31 09:11:56 2019 +0100
|
||||
@@ -1861,6 +1861,14 @@
|
||||
SkCanvas::kPreserveLCDText_SaveLayerFlag |
|
||||
(aCopyBackground ? SkCanvas::kInitWithPrevious_SaveLayerFlag : 0));
|
||||
|
||||
+#if MOZ_BIG_ENDIAN
|
||||
+ // Pushing a layer where an aMask is defined produces wrong output.
|
||||
+ // We _should_ endian swap the data, but I couldn't find a workable way to do so
|
||||
+ // Therefore I deactivate those layers in the meantime.
|
||||
+ // The result is: Tab-titles that are longer than the available space should be faded out.
|
||||
+ // The fading doesn't work, so we deactivate the fading-effect here.
|
||||
+ if (!aMask)
|
||||
+#endif
|
||||
mCanvas->saveLayer(saveRec);
|
||||
|
||||
SetPermitSubpixelAA(aOpaque);
|
80
mail/thunderbird/files/patch-bug1504834_comment5
Normal file
80
mail/thunderbird/files/patch-bug1504834_comment5
Normal file
@ -0,0 +1,80 @@
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1504834#c5
|
||||
https://bugzilla.mozilla.org/attachment.cgi?id=9028600
|
||||
Rough progress patch
|
||||
|
||||
|
||||
diff -r 53107afbc21e gfx/skia/skia/third_party/skcms/skcms.cc
|
||||
--- gfx/skia/skia/third_party/skcms/skcms.cc Wed Nov 07 04:50:21 2018 +0000
|
||||
+++ gfx/skia/skia/third_party/skcms/skcms.cc Thu Nov 29 12:49:35 2018 +0000
|
||||
@@ -30,6 +30,8 @@
|
||||
#include <avx512fintrin.h>
|
||||
#include <avx512dqintrin.h>
|
||||
#endif
|
||||
+#else
|
||||
+ #define SKCMS_PORTABLE
|
||||
#endif
|
||||
|
||||
// sizeof(x) will return size_t, which is 32-bit on some machines and 64-bit on others.
|
||||
@@ -280,20 +282,28 @@ enum {
|
||||
static uint16_t read_big_u16(const uint8_t* ptr) {
|
||||
uint16_t be;
|
||||
memcpy(&be, ptr, sizeof(be));
|
||||
-#if defined(_MSC_VER)
|
||||
- return _byteswap_ushort(be);
|
||||
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
||||
+ return be;
|
||||
#else
|
||||
+ #if defined(_MSC_VER)
|
||||
+ return _byteswap_ushort(be);
|
||||
+ #else
|
||||
return __builtin_bswap16(be);
|
||||
+ #endif
|
||||
#endif
|
||||
}
|
||||
|
||||
static uint32_t read_big_u32(const uint8_t* ptr) {
|
||||
uint32_t be;
|
||||
memcpy(&be, ptr, sizeof(be));
|
||||
-#if defined(_MSC_VER)
|
||||
- return _byteswap_ulong(be);
|
||||
+#if __BYTE_ORDER == __ORDER_BIG_ENDIAN__
|
||||
+ return be;
|
||||
#else
|
||||
+ #if defined(_MSC_VER)
|
||||
+ return _byteswap_ulong(be);
|
||||
+ #else
|
||||
return __builtin_bswap32(be);
|
||||
+ #endif
|
||||
#endif
|
||||
}
|
||||
|
||||
--- gfx/2d/DrawTargetSkia.cpp.orig 2019-09-21 15:51:04.129603000 +0200
|
||||
+++ gfx/2d/DrawTargetSkia.cpp 2019-09-21 15:52:11.900316000 +0200
|
||||
@@ -138,8 +138,7 @@ static IntRect CalculateSurfaceBounds(const IntSize& a
|
||||
return surfaceBounds.Intersect(bounds);
|
||||
}
|
||||
|
||||
-static const int kARGBAlphaOffset =
|
||||
- SurfaceFormat::A8R8G8B8_UINT32 == SurfaceFormat::B8G8R8A8 ? 3 : 0;
|
||||
+static const int kARGBAlphaOffset = 0;
|
||||
|
||||
static bool VerifyRGBXFormat(uint8_t* aData, const IntSize& aSize,
|
||||
const int32_t aStride, SurfaceFormat aFormat) {
|
||||
--- gfx/2d/Types.h.orig 2019-09-21 15:52:47.044803000 +0200
|
||||
+++ gfx/2d/Types.h 2019-09-21 15:53:40.113641000 +0200
|
||||
@@ -87,15 +87,8 @@ enum class SurfaceFormat : int8_t {
|
||||
// The following values are endian-independent synonyms. The _UINT32 suffix
|
||||
// indicates that the name reflects the layout when viewed as a uint32_t
|
||||
// value.
|
||||
-#if MOZ_LITTLE_ENDIAN()
|
||||
A8R8G8B8_UINT32 = B8G8R8A8, // 0xAARRGGBB
|
||||
X8R8G8B8_UINT32 = B8G8R8X8, // 0x00RRGGBB
|
||||
-#elif MOZ_BIG_ENDIAN()
|
||||
- A8R8G8B8_UINT32 = A8R8G8B8, // 0xAARRGGBB
|
||||
- X8R8G8B8_UINT32 = X8R8G8B8, // 0x00RRGGBB
|
||||
-#else
|
||||
-# error "bad endianness"
|
||||
-#endif
|
||||
|
||||
// The following values are OS and endian-independent synonyms.
|
||||
//
|
49
mail/thunderbird/files/patch-bug1504834_comment9
Normal file
49
mail/thunderbird/files/patch-bug1504834_comment9
Normal file
@ -0,0 +1,49 @@
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1504834#c9
|
||||
https://bugzilla.mozilla.org/attachment.cgi?id=9111146
|
||||
mozilla-bmo1504834-part3.patch
|
||||
|
||||
|
||||
# HG changeset patch
|
||||
# Parent aecb4600e5da17443b224c79eee178c1d8e155e3
|
||||
For FF68, AntiAliasing of XULTexts seem to be broken on big endian (s390x). Text and icons of the sandwich-menu to the
|
||||
right of the address bar, as well as plugin-windows appears transparant, which usually means unreadable (white on white).
|
||||
|
||||
diff -r aecb4600e5da gfx/skia/skia/include/private/SkNx.h
|
||||
--- gfx/skia/skia/include/private/SkNx.h Tue Aug 20 09:46:55 2019 +0200
|
||||
+++ gfx/skia/skia/include/private/SkNx.h Mon Sep 09 10:04:06 2019 +0200
|
||||
@@ -238,7 +238,18 @@
|
||||
AI SkNx operator*(const SkNx& y) const { return fVal * y.fVal; }
|
||||
AI SkNx operator/(const SkNx& y) const { return fVal / y.fVal; }
|
||||
|
||||
+ // On Big endian the commented out variant doesn't work,
|
||||
+ // and honestly, I have no idea why it exists in the first place.
|
||||
+ // The reason its broken is, I think, that it defaults to the double-variant of ToBits()
|
||||
+ // which gets a 64-bit integer, and FromBits returns 32-bit,
|
||||
+ // cutting off the wrong half again.
|
||||
+ // Overall, I see no reason to have ToBits and FromBits at all (even for floats/doubles).
|
||||
+ // Still we are only "fixing" this for big endian and leave little endian alone (never touch a running system)
|
||||
+#ifdef SK_CPU_BENDIAN
|
||||
+ AI SkNx operator&(const SkNx& y) const { return fVal & y.fVal; }
|
||||
+#else
|
||||
AI SkNx operator&(const SkNx& y) const { return FromBits(ToBits(fVal) & ToBits(y.fVal)); }
|
||||
+#endif
|
||||
AI SkNx operator|(const SkNx& y) const { return FromBits(ToBits(fVal) | ToBits(y.fVal)); }
|
||||
AI SkNx operator^(const SkNx& y) const { return FromBits(ToBits(fVal) ^ ToBits(y.fVal)); }
|
||||
|
||||
diff -r aecb4600e5da gfx/skia/skia/src/opts/SkBlitMask_opts.h
|
||||
--- gfx/skia/skia/src/opts/SkBlitMask_opts.h Tue Aug 20 09:46:55 2019 +0200
|
||||
+++ gfx/skia/skia/src/opts/SkBlitMask_opts.h Mon Sep 09 10:04:06 2019 +0200
|
||||
@@ -203,7 +203,13 @@
|
||||
// ~~~>
|
||||
// a = 1*aa + d(1-1*aa) = aa + d(1-aa)
|
||||
// c = 0*aa + d(1-1*aa) = d(1-aa)
|
||||
+
|
||||
+ // For big endian we have to swap the alpha-mask from 0,0,0,255 to 255,0,0,0
|
||||
+#ifdef SK_CPU_BENDIAN
|
||||
+ return Sk4px(Sk16b(aa) & Sk16b(255,0,0,0, 255,0,0,0, 255,0,0,0, 255,0,0,0))
|
||||
+#else
|
||||
return Sk4px(Sk16b(aa) & Sk16b(0,0,0,255, 0,0,0,255, 0,0,0,255, 0,0,0,255))
|
||||
+#endif
|
||||
+ d.approxMulDiv255(aa.inv());
|
||||
};
|
||||
while (h --> 0) {
|
80
mail/thunderbird/files/patch-bug1550891
Normal file
80
mail/thunderbird/files/patch-bug1550891
Normal file
@ -0,0 +1,80 @@
|
||||
commit 965eb33c5e86
|
||||
Author: Greg V <greg@unrelenting.technology>
|
||||
Date: Wed Jan 8 15:06:00 2020 -0800
|
||||
|
||||
Bug 1550891 - re-add SHM_ANON support in IPC shared memory, freezing via capabilities
|
||||
---
|
||||
config/system-headers.mozbuild | 1 +
|
||||
ipc/chromium/src/base/shared_memory_posix.cc | 20 +++++++++++++++++---
|
||||
2 files changed, 18 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git config/system-headers.mozbuild config/system-headers.mozbuild
|
||||
index 88afca1070f86..beff3e2542c9f 100644
|
||||
--- config/system-headers.mozbuild
|
||||
+++ config/system-headers.mozbuild
|
||||
@@ -816,6 +816,7 @@ system_headers = [
|
||||
'sys/bitypes.h',
|
||||
'sys/byteorder.h',
|
||||
'syscall.h',
|
||||
+ 'sys/capsicum.h',
|
||||
'sys/cdefs.h',
|
||||
'sys/cfgodm.h',
|
||||
'sys/elf.h',
|
||||
diff --git ipc/chromium/src/base/shared_memory_posix.cc ipc/chromium/src/base/shared_memory_posix.cc
|
||||
index 0be9cce0b4bed..89e67483e4c16 100644
|
||||
--- ipc/chromium/src/base/shared_memory_posix.cc
|
||||
+++ ipc/chromium/src/base/shared_memory_posix.cc
|
||||
@@ -16,6 +16,10 @@
|
||||
# include "mozilla/Ashmem.h"
|
||||
#endif
|
||||
|
||||
+#ifdef __FreeBSD__
|
||||
+# include <sys/capsicum.h>
|
||||
+#endif
|
||||
+
|
||||
#include "base/eintr_wrapper.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/string_util.h"
|
||||
@@ -77,7 +81,7 @@ SharedMemoryHandle SharedMemory::NULLHandle() { return SharedMemoryHandle(); }
|
||||
|
||||
// static
|
||||
bool SharedMemory::AppendPosixShmPrefix(std::string* str, pid_t pid) {
|
||||
-#if defined(ANDROID)
|
||||
+#if defined(ANDROID) || defined(__FreeBSD__)
|
||||
return false;
|
||||
#else
|
||||
*str += '/';
|
||||
@@ -103,7 +107,7 @@ bool SharedMemory::AppendPosixShmPrefix(std::string* str, pid_t pid) {
|
||||
// enough for this.
|
||||
StringAppendF(str, "org.mozilla.ipc.%d.", static_cast<int>(pid));
|
||||
return true;
|
||||
-#endif // !ANDROID
|
||||
+#endif // !ANDROID && !__FreeBSD__
|
||||
}
|
||||
|
||||
bool SharedMemory::CreateInternal(size_t size, bool freezeable) {
|
||||
@@ -125,6 +129,9 @@ bool SharedMemory::CreateInternal(size_t size, bool freezeable) {
|
||||
return false;
|
||||
}
|
||||
needs_truncate = false;
|
||||
+#elif defined(__FreeBSD__)
|
||||
+ // FreeBSD supports anonymous shm_open
|
||||
+ fd.reset(shm_open(SHM_ANON, O_RDWR, 0600));
|
||||
#else
|
||||
// Generic Unix: shm_open + shm_unlink
|
||||
do {
|
||||
@@ -224,6 +231,14 @@ bool SharedMemory::ReadOnlyCopy(SharedMemory* ro_out) {
|
||||
return false;
|
||||
}
|
||||
ro_file = mapped_file_;
|
||||
+#elif defined(__FreeBSD__)
|
||||
+ cap_rights_t rights;
|
||||
+ cap_rights_init(&rights, CAP_MMAP_R);
|
||||
+ if (cap_rights_limit(mapped_file_, &rights) != 0) {
|
||||
+ CHROMIUM_LOG(WARNING) << "failed to freeze shm: " << strerror(errno);
|
||||
+ return false;
|
||||
+ }
|
||||
+ ro_file = mapped_file_;
|
||||
#else
|
||||
DCHECK(frozen_file_ >= 0);
|
||||
DCHECK(mapped_file_ >= 0);
|
24
mail/thunderbird/files/patch-bug1602730_comment5
Normal file
24
mail/thunderbird/files/patch-bug1602730_comment5
Normal file
@ -0,0 +1,24 @@
|
||||
--- gfx/layers/composite/CompositableHost.cpp.orig 2020-09-12 21:47:42 UTC
|
||||
+++ gfx/layers/composite/CompositableHost.cpp
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "ImageHost.h" // for ImageHostBuffered, etc
|
||||
#include "Layers.h"
|
||||
#include "TiledContentHost.h" // for TiledContentHost
|
||||
+#include "mozilla/EndianUtils.h"
|
||||
#include "mozilla/gfx/gfxVars.h"
|
||||
#include "mozilla/layers/LayersSurfaces.h" // for SurfaceDescriptor
|
||||
#include "mozilla/layers/TextureHost.h" // for TextureHost, etc
|
||||
@@ -92,9 +93,13 @@ bool CompositableHost::AddMaskEffect(EffectChain& aEff
|
||||
}
|
||||
MOZ_ASSERT(source);
|
||||
|
||||
+ // Setting an alpha-mask here breaks the URL-bar on big endian (s390x)
|
||||
+ // if the typed URL is too long for the textbox (automatic scrolling needed)
|
||||
+#if MOZ_LITTLE_ENDIAN()
|
||||
RefPtr<EffectMask> effect =
|
||||
new EffectMask(source, source->GetSize(), aTransform);
|
||||
aEffects.mSecondaryEffects[EffectTypes::MASK] = effect;
|
||||
+#endif
|
||||
return true;
|
||||
}
|
||||
|
191
mail/thunderbird/files/patch-bug1612181_comment1
Normal file
191
mail/thunderbird/files/patch-bug1612181_comment1
Normal file
@ -0,0 +1,191 @@
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1612181
|
||||
https://bug1612181.bmoattachments.org/attachment.cgi?id=9123550
|
||||
|
||||
|
||||
--- xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_ppc64_linux.S.orig 2020-01-29 19:25:30.967574000 +0100
|
||||
+++ xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_ppc64_linux.S 2020-01-29 19:26:50.465737000 +0100
|
||||
@@ -62,11 +62,11 @@ NS_InvokeByIndex:
|
||||
.NS_InvokeByIndex:
|
||||
#endif
|
||||
mflr 0
|
||||
- std 0,16(r1)
|
||||
+ std 0,16(%r1)
|
||||
|
||||
- std r29,-24(r1)
|
||||
- std r30,-16(r1)
|
||||
- std r31,-8(r1)
|
||||
+ std r29,-24(%r1)
|
||||
+ std r30,-16(%r1)
|
||||
+ std r31,-8(%r1)
|
||||
|
||||
mr r29,r3 # Save 'that' in r29
|
||||
mr r30,r4 # Save 'methodIndex' in r30
|
||||
@@ -79,7 +79,7 @@ NS_InvokeByIndex:
|
||||
#
|
||||
# | (fixed area + | | 7 GP | 13 FP | 3 NV |
|
||||
# | param. save) |(params)........| regs | regs | regs |
|
||||
- # (r1)......(+STACK_PARAMS)... (-23*8).(-16*8).(-3*8)..(r31)
|
||||
+ # (%r1)......(+STACK_PARAMS)... (-23*8).(-16*8).(-3*8)..(%r31)
|
||||
|
||||
# +stack frame, -unused stack params, +regs storage, +1 for alignment
|
||||
addi r7,r5,((STACK_PARAMS/8)-7+7+13+3+1)
|
||||
@@ -105,56 +105,56 @@ NS_InvokeByIndex:
|
||||
|
||||
# Set up to invoke function
|
||||
|
||||
- ld r9,0(r29) # vtable (r29 is 'that')
|
||||
+ ld r9,0(%r29) # vtable (%r29 is 'that')
|
||||
mr r3,r29 # self is first arg, obviously
|
||||
|
||||
sldi r30,r30,3 # Find function descriptor
|
||||
add r9,r9,r30
|
||||
- ld r12,0(r9)
|
||||
+ ld r12,0(%r9)
|
||||
|
||||
- std r2,STACK_TOC(r1) # Save r2 (TOC pointer)
|
||||
+ std r2,STACK_TOC(%r1) # Save r2 (TOC pointer)
|
||||
|
||||
#if _CALL_ELF == 2
|
||||
mtctr r12
|
||||
#else
|
||||
- ld r0,0(r12) # Actual address from fd.
|
||||
+ ld r0,0(%r12) # Actual address from fd.
|
||||
mtctr 0
|
||||
- ld r11,16(r12) # Environment pointer from fd.
|
||||
- ld r2,8(r12) # TOC pointer from fd.
|
||||
+ ld r11,16(%r12) # Environment pointer from fd.
|
||||
+ ld r2,8(%r12) # TOC pointer from fd.
|
||||
#endif
|
||||
|
||||
# Load FP and GP registers as required
|
||||
- ld r4, -(23*8)(r31)
|
||||
- ld r5, -(22*8)(r31)
|
||||
- ld r6, -(21*8)(r31)
|
||||
- ld r7, -(20*8)(r31)
|
||||
- ld r8, -(19*8)(r31)
|
||||
- ld r9, -(18*8)(r31)
|
||||
- ld r10, -(17*8)(r31)
|
||||
+ ld r4, -(23*8)(%r31)
|
||||
+ ld r5, -(22*8)(%r31)
|
||||
+ ld r6, -(21*8)(%r31)
|
||||
+ ld r7, -(20*8)(%r31)
|
||||
+ ld r8, -(19*8)(%r31)
|
||||
+ ld r9, -(18*8)(%r31)
|
||||
+ ld r10, -(17*8)(%r31)
|
||||
|
||||
- lfd f1, -(16*8)(r31)
|
||||
- lfd f2, -(15*8)(r31)
|
||||
- lfd f3, -(14*8)(r31)
|
||||
- lfd f4, -(13*8)(r31)
|
||||
- lfd f5, -(12*8)(r31)
|
||||
- lfd f6, -(11*8)(r31)
|
||||
- lfd f7, -(10*8)(r31)
|
||||
- lfd f8, -(9*8)(r31)
|
||||
- lfd f9, -(8*8)(r31)
|
||||
- lfd f10, -(7*8)(r31)
|
||||
- lfd f11, -(6*8)(r31)
|
||||
- lfd f12, -(5*8)(r31)
|
||||
- lfd f13, -(4*8)(r31)
|
||||
+ lfd f1, -(16*8)(%r31)
|
||||
+ lfd f2, -(15*8)(%r31)
|
||||
+ lfd f3, -(14*8)(%r31)
|
||||
+ lfd f4, -(13*8)(%r31)
|
||||
+ lfd f5, -(12*8)(%r31)
|
||||
+ lfd f6, -(11*8)(%r31)
|
||||
+ lfd f7, -(10*8)(%r31)
|
||||
+ lfd f8, -(9*8)(%r31)
|
||||
+ lfd f9, -(8*8)(%r31)
|
||||
+ lfd f10, -(7*8)(%r31)
|
||||
+ lfd f11, -(6*8)(%r31)
|
||||
+ lfd f12, -(5*8)(%r31)
|
||||
+ lfd f13, -(4*8)(%r31)
|
||||
|
||||
bctrl # Do it
|
||||
|
||||
- ld r2,STACK_TOC(r1) # Load our own TOC pointer
|
||||
- ld r1,0(r1) # Revert stack frame
|
||||
- ld 0,16(r1) # Reload lr
|
||||
+ ld r2,STACK_TOC(%r1) # Load our own TOC pointer
|
||||
+ ld r1,0(%r1) # Revert stack frame
|
||||
+ ld 0,16(%r1) # Reload lr
|
||||
mtlr 0
|
||||
- ld 29,-24(r1) # Restore NVGPRS
|
||||
- ld 30,-16(r1)
|
||||
- ld 31,-8(r1)
|
||||
+ ld 29,-24(%r1) # Restore NVGPRS
|
||||
+ ld 30,-16(%r1)
|
||||
+ ld 31,-8(%r1)
|
||||
blr
|
||||
|
||||
#if _CALL_ELF == 2
|
||||
--- xpcom/reflect/xptcall/md/unix/xptcstubs_asm_ppc64_linux.S.orig 2020-01-29 19:25:51.465953000 +0100
|
||||
+++ xpcom/reflect/xptcall/md/unix/xptcstubs_asm_ppc64_linux.S 2020-01-29 19:28:53.055137000 +0100
|
||||
@@ -58,35 +58,35 @@ SharedStub:
|
||||
#endif
|
||||
mflr r0
|
||||
|
||||
- std r4, -56(r1) # Save all GPRS
|
||||
- std r5, -48(r1)
|
||||
- std r6, -40(r1)
|
||||
- std r7, -32(r1)
|
||||
- std r8, -24(r1)
|
||||
- std r9, -16(r1)
|
||||
- std r10, -8(r1)
|
||||
+ std r4, -56(%r1) # Save all GPRS
|
||||
+ std r5, -48(%r1)
|
||||
+ std r6, -40(%r1)
|
||||
+ std r7, -32(%r1)
|
||||
+ std r8, -24(%r1)
|
||||
+ std r9, -16(%r1)
|
||||
+ std r10, -8(%r1)
|
||||
|
||||
- stfd f13, -64(r1) # ... and FPRS
|
||||
- stfd f12, -72(r1)
|
||||
- stfd f11, -80(r1)
|
||||
- stfd f10, -88(r1)
|
||||
- stfd f9, -96(r1)
|
||||
- stfd f8, -104(r1)
|
||||
- stfd f7, -112(r1)
|
||||
- stfd f6, -120(r1)
|
||||
- stfd f5, -128(r1)
|
||||
- stfd f4, -136(r1)
|
||||
- stfd f3, -144(r1)
|
||||
- stfd f2, -152(r1)
|
||||
- stfd f1, -160(r1)
|
||||
+ stfd f13, -64(%r1) # ... and FPRS
|
||||
+ stfd f12, -72(%r1)
|
||||
+ stfd f11, -80(%r1)
|
||||
+ stfd f10, -88(%r1)
|
||||
+ stfd f9, -96(%r1)
|
||||
+ stfd f8, -104(%r1)
|
||||
+ stfd f7, -112(%r1)
|
||||
+ stfd f6, -120(%r1)
|
||||
+ stfd f5, -128(%r1)
|
||||
+ stfd f4, -136(%r1)
|
||||
+ stfd f3, -144(%r1)
|
||||
+ stfd f2, -152(%r1)
|
||||
+ stfd f1, -160(%r1)
|
||||
|
||||
subi r6,r1,56 # r6 --> gprData
|
||||
subi r7,r1,160 # r7 --> fprData
|
||||
addi r5,r1,STACK_PARAMS # r5 --> extra stack args
|
||||
|
||||
- std r0, 16(r1)
|
||||
+ std r0, 16(%r1)
|
||||
|
||||
- stdu r1,-288(r1)
|
||||
+ stdu r1,-288(%r1)
|
||||
# r3 has the 'self' pointer
|
||||
# already
|
||||
|
||||
@@ -97,8 +97,8 @@ SharedStub:
|
||||
bl PrepareAndDispatch
|
||||
nop
|
||||
|
||||
- ld 1,0(r1) # restore stack
|
||||
- ld r0,16(r1) # restore LR
|
||||
+ ld 1,0(%r1) # restore stack
|
||||
+ ld r0,16(%r1) # restore LR
|
||||
mtlr r0
|
||||
blr
|
||||
|
25961
mail/thunderbird/files/patch-bug1612184
Normal file
25961
mail/thunderbird/files/patch-bug1612184
Normal file
File diff suppressed because it is too large
Load Diff
@ -4,7 +4,7 @@ diff --git widget/gtk/WindowSurfaceWayland.cpp widget/gtk/WindowSurfaceWayland.c
|
||||
index 9a73326399bd5..9e42a7f1c5d18 100644
|
||||
--- widget/gtk/WindowSurfaceWayland.cpp
|
||||
+++ widget/gtk/WindowSurfaceWayland.cpp
|
||||
@@ -235,23 +235,24 @@
|
||||
@@ -222,20 +222,21 @@ static int WaylandAllocateShmMemory(int aSize) {
|
||||
#ifdef HAVE_POSIX_FALLOCATE
|
||||
do {
|
||||
ret = posix_fallocate(fd, 0, aSize);
|
||||
@ -12,11 +12,9 @@ index 9a73326399bd5..9e42a7f1c5d18 100644
|
||||
- if (ret != 0) {
|
||||
+ if (ret == 0) {
|
||||
+ return fd;
|
||||
+ } else if (ret != EINVAL && ret != EOPNOTSUPP) {
|
||||
+ } else if (ret != ENODEV && ret != EINVAL && ret != EOPNOTSUPP) {
|
||||
close(fd);
|
||||
MOZ_CRASH_UNSAFE_PRINTF(
|
||||
"posix_fallocate() fails on %s size %d error code %d\n", filename,
|
||||
aSize, ret);
|
||||
MOZ_CRASH("posix_fallocate() fails to allocate shm memory");
|
||||
}
|
||||
-#else
|
||||
+#endif
|
||||
@ -25,19 +23,19 @@ index 9a73326399bd5..9e42a7f1c5d18 100644
|
||||
} while (ret < 0 && errno == EINTR);
|
||||
if (ret < 0) {
|
||||
close(fd);
|
||||
MOZ_CRASH_UNSAFE_PRINTF("ftruncate() fails on %s size %d error code %d\n",
|
||||
filename, aSize, ret);
|
||||
MOZ_CRASH("ftruncate() fails to allocate shm memory");
|
||||
}
|
||||
-#endif
|
||||
|
||||
return fd;
|
||||
}
|
||||
@@ -265,7 +266,7 @@ bool WaylandShmPool::Resize(int aSize) {
|
||||
@@ -265,8 +266,8 @@ bool WaylandShmPool::Resize(int aSize) {
|
||||
#ifdef HAVE_POSIX_FALLOCATE
|
||||
do {
|
||||
errno = posix_fallocate(mShmPoolFd, 0, aSize);
|
||||
} while (errno == EINTR);
|
||||
- if (errno != 0) return false;
|
||||
+ if (errno != 0 && errno != EINVAL && errno != EOPNOTSUPP) return false;
|
||||
+ if (errno != 0 && errno != ENODEV && errno != EINVAL && errno != EOPNOTSUPP) return false;
|
||||
#endif
|
||||
|
||||
wl_shm_pool_resize(mShmPool, aSize);
|
||||
|
@ -1,70 +0,0 @@
|
||||
commit 2a981b96abf3
|
||||
Author: Kevin Jacobs <kjacobs@mozilla.com>
|
||||
Date: Tue Apr 14 18:32:19 2020 +0000
|
||||
|
||||
Bug 1624128 - Update CK_GCM_PARAMS uses for PKCS11 v3.0 definition r=keeler
|
||||
|
||||
This patch initializes the ulIvBits member of CK_GCM_PARAMS, which is new in PKCS11 v3.
|
||||
|
||||
For libprio, we instead define NSS_PKCS11_2_0_COMPAT, which yields the old struct definition.
|
||||
|
||||
Differential Revision: https://phabricator.services.mozilla.com/D67740
|
||||
|
||||
--HG--
|
||||
extra : moz-landing-system : lando
|
||||
---
|
||||
dom/crypto/WebCryptoTask.cpp | 1 +
|
||||
netwerk/srtp/src/crypto/cipher/aes_gcm_nss.c | 1 +
|
||||
security/manager/ssl/OSKeyStore.cpp | 1 +
|
||||
third_party/prio/moz.build | 5 +++++
|
||||
4 files changed, 8 insertions(+)
|
||||
|
||||
diff --git dom/crypto/WebCryptoTask.cpp dom/crypto/WebCryptoTask.cpp
|
||||
index ad0d1432738f0..60a265972d212 100644
|
||||
--- dom/crypto/WebCryptoTask.cpp
|
||||
+++ dom/crypto/WebCryptoTask.cpp
|
||||
@@ -600,6 +600,7 @@ class AesTask : public ReturnArrayBufferViewTask, public DeferredData {
|
||||
case CKM_AES_GCM:
|
||||
gcmParams.pIv = mIv.Elements();
|
||||
gcmParams.ulIvLen = mIv.Length();
|
||||
+ gcmParams.ulIvBits = gcmParams.ulIvLen * 8;
|
||||
gcmParams.pAAD = mAad.Elements();
|
||||
gcmParams.ulAADLen = mAad.Length();
|
||||
gcmParams.ulTagBits = mTagLength;
|
||||
diff --git netwerk/srtp/src/crypto/cipher/aes_gcm_nss.c netwerk/srtp/src/crypto/cipher/aes_gcm_nss.c
|
||||
index e1fdbe36fbf85..2be2ce932ddf1 100644
|
||||
--- netwerk/srtp/src/crypto/cipher/aes_gcm_nss.c
|
||||
+++ netwerk/srtp/src/crypto/cipher/aes_gcm_nss.c
|
||||
@@ -271,6 +271,7 @@ static srtp_err_status_t srtp_aes_gcm_nss_do_crypto(void *cv,
|
||||
|
||||
c->params.pIv = c->iv;
|
||||
c->params.ulIvLen = GCM_IV_LEN;
|
||||
+ c->params.ulIvBits = GCM_IV_LEN * 8;
|
||||
c->params.pAAD = c->aad;
|
||||
c->params.ulAADLen = c->aad_size;
|
||||
|
||||
diff --git security/manager/ssl/OSKeyStore.cpp security/manager/ssl/OSKeyStore.cpp
|
||||
index 00bc918c5fdd7..c83a559d9c1ea 100644
|
||||
--- security/manager/ssl/OSKeyStore.cpp
|
||||
+++ security/manager/ssl/OSKeyStore.cpp
|
||||
@@ -663,6 +663,7 @@ nsresult AbstractOSKeyStore::DoCipher(const UniquePK11SymKey& aSymKey,
|
||||
CK_GCM_PARAMS gcm_params;
|
||||
gcm_params.pIv = const_cast<unsigned char*>(ivp);
|
||||
gcm_params.ulIvLen = mIVLength;
|
||||
+ gcm_params.ulIvBits = gcm_params.ulIvLen * 8;
|
||||
gcm_params.ulTagBits = 128;
|
||||
gcm_params.pAAD = nullptr;
|
||||
gcm_params.ulAADLen = 0;
|
||||
diff --git third_party/prio/moz.build third_party/prio/moz.build
|
||||
index 3e10fe71ce8ed..0a6e3c74a2696 100644
|
||||
--- third_party/prio/moz.build
|
||||
+++ third_party/prio/moz.build
|
||||
@@ -42,3 +42,8 @@ SOURCES += [
|
||||
]
|
||||
|
||||
FINAL_LIBRARY = 'xul'
|
||||
+
|
||||
+# Use PKCS11 v2 struct definitions for now, otherwise NSS requires
|
||||
+# CK_GCM_PARAMS.ulIvBits to be set. This workaround is only required
|
||||
+# until NSS 3.52 RTM and upstream correctly initializes the field.
|
||||
+DEFINES['NSS_PKCS11_2_0_COMPAT'] = True
|
88
mail/thunderbird/files/patch-bug1626236
Normal file
88
mail/thunderbird/files/patch-bug1626236
Normal file
@ -0,0 +1,88 @@
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1626236
|
||||
https://bug1626236.bmoattachments.org/attachment.cgi?id=9137096
|
||||
|
||||
# HG changeset patch
|
||||
# User msirringhaus@suse.de
|
||||
# Date 1582805876 -3600
|
||||
# Thu Feb 27 13:17:56 2020 +0100
|
||||
# Node ID cc3d09abea31068e57f1ab918782f9f86fc6a158
|
||||
# Parent 9cd90914846f667f18babc491a74c164ae5d6e9f
|
||||
imported patch decoder_workaround.patch
|
||||
|
||||
diff -r 9cd90914846f image/decoders/nsGIFDecoder2.cpp
|
||||
--- image/decoders/nsGIFDecoder2.cpp Thu Feb 27 12:57:14 2020 +0100
|
||||
+++ image/decoders/nsGIFDecoder2.cpp Fri Mar 27 13:06:18 2020 +0100
|
||||
@@ -422,6 +422,9 @@
|
||||
MOZ_ASSERT(mSwizzleFn);
|
||||
uint8_t* data = reinterpret_cast<uint8_t*>(aColormap);
|
||||
mSwizzleFn(data, data, aColors);
|
||||
+#if MOZ_BIG_ENDIAN()
|
||||
+ SwizzleRow(SurfaceFormat::A8R8G8B8, SurfaceFormat::B8G8R8A8)(data, data, aColors);
|
||||
+#endif
|
||||
}
|
||||
|
||||
LexerResult nsGIFDecoder2::DoDecode(SourceBufferIterator& aIterator,
|
||||
diff -r 9cd90914846f image/decoders/nsJPEGDecoder.cpp
|
||||
--- image/decoders/nsJPEGDecoder.cpp Thu Feb 27 12:57:14 2020 +0100
|
||||
+++ image/decoders/nsJPEGDecoder.cpp Fri Mar 27 13:06:18 2020 +0100
|
||||
@@ -263,6 +263,9 @@
|
||||
case JCS_YCbCr:
|
||||
// By default, we will output directly to BGRA. If we need to apply
|
||||
// special color transforms, this may change.
|
||||
+#if MOZ_BIG_ENDIAN()
|
||||
+ mInfo.out_color_space = MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB;
|
||||
+#else
|
||||
switch (SurfaceFormat::OS_RGBX) {
|
||||
case SurfaceFormat::B8G8R8X8:
|
||||
mInfo.out_color_space = JCS_EXT_BGRX;
|
||||
@@ -277,6 +280,7 @@
|
||||
mState = JPEG_ERROR;
|
||||
return Transition::TerminateFailure();
|
||||
}
|
||||
+#endif
|
||||
break;
|
||||
case JCS_CMYK:
|
||||
case JCS_YCCK:
|
||||
diff -r 9cd90914846f image/decoders/nsPNGDecoder.cpp
|
||||
--- image/decoders/nsPNGDecoder.cpp Thu Feb 27 12:57:14 2020 +0100
|
||||
+++ image/decoders/nsPNGDecoder.cpp Fri Mar 27 13:06:18 2020 +0100
|
||||
@@ -361,7 +361,7 @@
|
||||
IResumable* aOnResume) {
|
||||
MOZ_ASSERT(!HasError(), "Shouldn't call DoDecode after error!");
|
||||
|
||||
- return mLexer.Lex(aIterator, aOnResume,
|
||||
+ LexerResult res = mLexer.Lex(aIterator, aOnResume,
|
||||
[=](State aState, const char* aData, size_t aLength) {
|
||||
switch (aState) {
|
||||
case State::PNG_DATA:
|
||||
@@ -371,6 +371,14 @@
|
||||
}
|
||||
MOZ_CRASH("Unknown State");
|
||||
});
|
||||
+
|
||||
+#if MOZ_BIG_ENDIAN()
|
||||
+ if(res.is<TerminalState>() && res.as<TerminalState>() == TerminalState::SUCCESS) {
|
||||
+ NativeEndian::swapToLittleEndianInPlace<uint32_t>((uint32_t*)(mImageData), mImageDataLength / 4);
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
+ return res;
|
||||
}
|
||||
|
||||
LexerTransition<nsPNGDecoder::State> nsPNGDecoder::ReadPNGData(
|
||||
diff -r 9cd90914846f image/decoders/nsWebPDecoder.cpp
|
||||
--- image/decoders/nsWebPDecoder.cpp Thu Feb 27 12:57:14 2020 +0100
|
||||
+++ image/decoders/nsWebPDecoder.cpp Fri Mar 27 13:06:18 2020 +0100
|
||||
@@ -237,7 +237,12 @@
|
||||
// WebP doesn't guarantee that the alpha generated matches the hint in the
|
||||
// header, so we always need to claim the input is BGRA. If the output is
|
||||
// BGRX, swizzling will mask off the alpha channel.
|
||||
+#if MOZ_BIG_ENDIAN()
|
||||
+ mBuffer.colorspace = MODE_ARGB;
|
||||
+ SurfaceFormat inFormat = mFormat;
|
||||
+#else
|
||||
SurfaceFormat inFormat = SurfaceFormat::OS_RGBA;
|
||||
+#endif
|
||||
|
||||
SurfacePipeFlags pipeFlags = SurfacePipeFlags();
|
||||
if (mFormat == SurfaceFormat::OS_RGBA &&
|
34
mail/thunderbird/files/patch-bug1628567
Normal file
34
mail/thunderbird/files/patch-bug1628567
Normal file
@ -0,0 +1,34 @@
|
||||
Don't pass --target when CC/CXX contains clang
|
||||
|
||||
--- third_party/rust/cc/src/lib.rs.orig 2020-04-10 00:57:23 UTC
|
||||
+++ third_party/rust/cc/src/lib.rs
|
||||
@@ -2344,28 +2344,7 @@ impl Tool {
|
||||
}
|
||||
|
||||
fn with_features(path: PathBuf, clang_driver: Option<&str>, cuda: bool) -> Self {
|
||||
- // Try to detect family of the tool from its name, falling back to Gnu.
|
||||
- let family = if let Some(fname) = path.file_name().and_then(|p| p.to_str()) {
|
||||
- if fname.contains("clang-cl") {
|
||||
- ToolFamily::Msvc { clang_cl: true }
|
||||
- } else if fname.contains("cl")
|
||||
- && !fname.contains("cloudabi")
|
||||
- && !fname.contains("uclibc")
|
||||
- && !fname.contains("clang")
|
||||
- {
|
||||
- ToolFamily::Msvc { clang_cl: false }
|
||||
- } else if fname.contains("clang") {
|
||||
- match clang_driver {
|
||||
- Some("cl") => ToolFamily::Msvc { clang_cl: true },
|
||||
- _ => ToolFamily::Clang,
|
||||
- }
|
||||
- } else {
|
||||
- ToolFamily::Gnu
|
||||
- }
|
||||
- } else {
|
||||
- ToolFamily::Gnu
|
||||
- };
|
||||
-
|
||||
+ let family = ToolFamily::Gnu;
|
||||
Tool {
|
||||
path: path,
|
||||
cc_wrapper_path: None,
|
15
mail/thunderbird/files/patch-bug1640982
Normal file
15
mail/thunderbird/files/patch-bug1640982
Normal file
@ -0,0 +1,15 @@
|
||||
Unbreak build with Rust 1.45.0
|
||||
|
||||
error: options `-C embed-bitcode=no` and `-C lto` are incompatible
|
||||
|
||||
--- config/makefiles/rust.mk.orig 2020-05-12 09:36:22 UTC
|
||||
+++ config/makefiles/rust.mk
|
||||
@@ -61,7 +61,7 @@ ifndef MOZ_DEBUG_RUST
|
||||
# Enable link-time optimization for release builds, but not when linking
|
||||
# gkrust_gtest.
|
||||
ifeq (,$(findstring gkrust_gtest,$(RUST_LIBRARY_FILE)))
|
||||
-cargo_rustc_flags += -Clto
|
||||
+cargo_rustc_flags +=
|
||||
endif
|
||||
endif
|
||||
endif
|
35
mail/thunderbird/files/patch-bug1659612
Normal file
35
mail/thunderbird/files/patch-bug1659612
Normal file
@ -0,0 +1,35 @@
|
||||
media/libcubeb/src/cubeb_alsa.c:613:9: error: implicitly declaring library function 'snprintf' with type 'int (char *, unsigned int, const char *, ...)' [-Werror,-Wimplicit-function-declaration]
|
||||
r = snprintf(node_name, sizeof(node_name), "pcm.%s", string);
|
||||
^
|
||||
media/libcubeb/src/cubeb_alsa.c:613:9: note: include the header <stdio.h> or explicitly provide a declaration for 'snprintf'
|
||||
media/libcubeb/src/cubeb_alsa.c:1168:3: error: implicitly declaring library function 'alloca' with type 'void *(unsigned int)' [-Werror,-Wimplicit-function-declaration]
|
||||
snd_pcm_hw_params_alloca(&hw_params);
|
||||
^
|
||||
/usr/local/include/alsa/pcm.h:737:39: note: expanded from macro 'snd_pcm_hw_params_alloca'
|
||||
#define snd_pcm_hw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_hw_params)
|
||||
^
|
||||
/usr/local/include/alsa/global.h:106:57: note: expanded from macro '__snd_alloca'
|
||||
#define __snd_alloca(ptr,type) do { *ptr = (type##_t *) alloca(type##_sizeof()); memset(*ptr, 0, type##_sizeof()); } while (0)
|
||||
^
|
||||
media/libcubeb/src/cubeb_alsa.c:1168:3: note: include the header <stdlib.h> or explicitly provide a declaration for 'alloca'
|
||||
/usr/local/include/alsa/pcm.h:737:39: note: expanded from macro 'snd_pcm_hw_params_alloca'
|
||||
#define snd_pcm_hw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_hw_params)
|
||||
^
|
||||
/usr/local/include/alsa/global.h:106:57: note: expanded from macro '__snd_alloca'
|
||||
#define __snd_alloca(ptr,type) do { *ptr = (type##_t *) alloca(type##_sizeof()); memset(*ptr, 0, type##_sizeof()); } while (0)
|
||||
^
|
||||
2 errors generated.
|
||||
|
||||
--- media/libcubeb/src/cubeb_alsa.c~
|
||||
+++ media/libcubeb/src/cubeb_alsa.c
|
||||
@@ -5,9 +5,7 @@
|
||||
* accompanying file LICENSE for details.
|
||||
*/
|
||||
#undef NDEBUG
|
||||
-#define _DEFAULT_SOURCE
|
||||
-#define _BSD_SOURCE
|
||||
-#define _XOPEN_SOURCE 500
|
||||
+#define _GNU_SOURCE 1
|
||||
#include <pthread.h>
|
||||
#include <sys/time.h>
|
||||
#include <assert.h>
|
49
mail/thunderbird/files/patch-bug1664607
Normal file
49
mail/thunderbird/files/patch-bug1664607
Normal file
@ -0,0 +1,49 @@
|
||||
# HG changeset patch
|
||||
# User Rob Lemley <rob@thunderbird.net>
|
||||
# Date 1600079976 -10800
|
||||
# Node ID 6379c3b860f7a1acc01dc549b6ce3cedf250831b
|
||||
# Parent d1ffffd30cb1c6b4c636f89006c89cfa73282216
|
||||
Bug 1664607 - Don't try to load what's new page when built with updater disabled. r=mkmelin DONTBUILD
|
||||
|
||||
When Thunderbird is built with --disable-updater, as it done by most Linux
|
||||
distributions, accessing the nsIUpdateManager service will throw an error
|
||||
resulting in a broken UI. Check AppConstants.MOZ_UPDATER when using
|
||||
nsIUpdateManger to prevent errors.
|
||||
|
||||
Differential Revision: https://phabricator.services.mozilla.com/D90023
|
||||
|
||||
diff --git a/mail/base/content/specialTabs.js b/mail/base/content/specialTabs.js
|
||||
--- comm/mail/base/content/specialTabs.js
|
||||
+++ comm/mail/base/content/specialTabs.js
|
||||
@@ -1048,18 +1048,20 @@ var specialTabs = {
|
||||
Services.prefs.setCharPref("mailnews.start_page_override.mstone", mstone);
|
||||
}
|
||||
|
||||
- let update = Cc["@mozilla.org/updates/update-manager;1"].getService(
|
||||
- Ci.nsIUpdateManager
|
||||
- ).activeUpdate;
|
||||
+ if (AppConstants.MOZ_UPDATER) {
|
||||
+ let update = Cc["@mozilla.org/updates/update-manager;1"].getService(
|
||||
+ Ci.nsIUpdateManager
|
||||
+ ).activeUpdate;
|
||||
|
||||
- if (update && Services.vc.compare(update.appVersion, old_mstone) > 0) {
|
||||
- let overridePage = Services.urlFormatter.formatURLPref(
|
||||
- "mailnews.start_page.override_url"
|
||||
- );
|
||||
- overridePage = this.getPostUpdateOverridePage(update, overridePage);
|
||||
- overridePage = overridePage.replace("%OLD_VERSION%", old_mstone);
|
||||
- if (overridePage) {
|
||||
- openLinkExternally(overridePage);
|
||||
+ if (update && Services.vc.compare(update.appVersion, old_mstone) > 0) {
|
||||
+ let overridePage = Services.urlFormatter.formatURLPref(
|
||||
+ "mailnews.start_page.override_url"
|
||||
+ );
|
||||
+ overridePage = this.getPostUpdateOverridePage(update, overridePage);
|
||||
+ overridePage = overridePage.replace("%OLD_VERSION%", old_mstone);
|
||||
+ if (overridePage) {
|
||||
+ openLinkExternally(overridePage);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
},
|
@ -1,237 +0,0 @@
|
||||
commit b92dbf54798e
|
||||
Author: Ben Iofel <iofelben@gmail.com>
|
||||
Date: Mon Jan 6 12:03:38 2020 +0000
|
||||
|
||||
Bug 726479 - Use GTK's support for startup notifications, r=karlt
|
||||
|
||||
Original author: Ben Iofel <iofelben@gmail.com>
|
||||
|
||||
Differential Revision: https://phabricator.services.mozilla.com/D58594
|
||||
|
||||
--HG--
|
||||
extra : moz-landing-system : lando
|
||||
---
|
||||
config/system-headers.mozbuild | 10 ----------
|
||||
old-configure.in | 35 -----------------------------------
|
||||
toolkit/library/moz.build | 3 ---
|
||||
toolkit/xre/nsAppRunner.cpp | 6 ------
|
||||
widget/gtk/moz.build | 4 ----
|
||||
widget/gtk/mozgtk/mozgtk.c | 1 +
|
||||
widget/gtk/nsWindow.cpp | 37 +------------------------------------
|
||||
7 files changed, 2 insertions(+), 94 deletions(-)
|
||||
|
||||
diff --git config/system-headers.mozbuild config/system-headers.mozbuild
|
||||
index 33ba01eaea3ae..2081d0c683a4c 100644
|
||||
--- config/system-headers.mozbuild
|
||||
+++ config/system-headers.mozbuild
|
||||
@@ -1267,16 +1267,6 @@ if CONFIG['MOZ_SYSTEM_ZLIB']:
|
||||
'zlib.h',
|
||||
]
|
||||
|
||||
-if CONFIG['MOZ_ENABLE_STARTUP_NOTIFICATION']:
|
||||
- system_headers += [
|
||||
- 'libsn/sn-common.h',
|
||||
- 'libsn/sn.h',
|
||||
- 'libsn/sn-launchee.h',
|
||||
- 'libsn/sn-launcher.h',
|
||||
- 'libsn/sn-monitor.h',
|
||||
- 'libsn/sn-util.h',
|
||||
- ]
|
||||
-
|
||||
if CONFIG['MOZ_SYSTEM_LIBEVENT']:
|
||||
system_headers += [
|
||||
'event2/event_compat.h',
|
||||
diff --git old-configure.in old-configure.in
|
||||
index f9278ba3f8451..2ac7fd92dfaa7 100644
|
||||
--- old-configure.in
|
||||
+++ old-configure.in
|
||||
@@ -61,7 +61,6 @@ GTK2_VERSION=2.18.0
|
||||
GTK3_VERSION=3.4.0
|
||||
GDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_4
|
||||
W32API_VERSION=3.14
|
||||
-STARTUP_NOTIFICATION_VERSION=0.8
|
||||
DBUS_VERSION=0.60
|
||||
SQLITE_VERSION=3.30.1
|
||||
|
||||
@@ -1759,40 +1758,6 @@ fi # COMPILE_ENVIRONMENT
|
||||
|
||||
AC_SUBST(MOZ_FS_LAYOUT)
|
||||
|
||||
-dnl ========================================================
|
||||
-dnl = startup-notification support module
|
||||
-dnl ========================================================
|
||||
-
|
||||
-if test "$MOZ_ENABLE_GTK"
|
||||
-then
|
||||
- MOZ_ENABLE_STARTUP_NOTIFICATION=
|
||||
-
|
||||
- MOZ_ARG_ENABLE_BOOL(startup-notification,
|
||||
- [ --enable-startup-notification
|
||||
- Enable startup-notification support (default: disabled) ],
|
||||
- MOZ_ENABLE_STARTUP_NOTIFICATION=force,
|
||||
- MOZ_ENABLE_STARTUP_NOTIFICATION=)
|
||||
- if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"
|
||||
- then
|
||||
- PKG_CHECK_MODULES(MOZ_STARTUP_NOTIFICATION,
|
||||
- libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION,
|
||||
- [MOZ_ENABLE_STARTUP_NOTIFICATION=1], [
|
||||
- if test "$MOZ_ENABLE_STARTUP_NOTIFICATION" = "force"
|
||||
- then
|
||||
- AC_MSG_ERROR([* * * Could not find startup-notification >= $STARTUP_NOTIFICATION_VERSION])
|
||||
- fi
|
||||
- MOZ_ENABLE_STARTUP_NOTIFICATION=
|
||||
- ])
|
||||
- fi
|
||||
-
|
||||
- if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"; then
|
||||
- AC_DEFINE(MOZ_ENABLE_STARTUP_NOTIFICATION)
|
||||
- fi
|
||||
-
|
||||
- TK_LIBS="$TK_LIBS $MOZ_STARTUP_NOTIFICATION_LIBS"
|
||||
-fi
|
||||
-AC_SUBST(MOZ_ENABLE_STARTUP_NOTIFICATION)
|
||||
-
|
||||
AC_SUBST_LIST(TK_CFLAGS)
|
||||
AC_SUBST_LIST(TK_LIBS)
|
||||
|
||||
diff --git toolkit/library/moz.build toolkit/library/moz.build
|
||||
index 736acbaae7fa9..af8400f4931f6 100644
|
||||
--- toolkit/library/moz.build
|
||||
+++ toolkit/library/moz.build
|
||||
@@ -285,9 +285,6 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
|
||||
'gthread-2.0',
|
||||
]
|
||||
|
||||
-if CONFIG['MOZ_ENABLE_STARTUP_NOTIFICATION']:
|
||||
- OS_LIBS += CONFIG['MOZ_STARTUP_NOTIFICATION_LIBS']
|
||||
-
|
||||
if CONFIG['MOZ_ENABLE_LIBPROXY']:
|
||||
OS_LIBS += CONFIG['MOZ_LIBPROXY_LIBS']
|
||||
|
||||
diff --git toolkit/xre/nsAppRunner.cpp toolkit/xre/nsAppRunner.cpp
|
||||
index 219265cbfda75..5e8dfb68e1ca5 100644
|
||||
--- toolkit/xre/nsAppRunner.cpp
|
||||
+++ toolkit/xre/nsAppRunner.cpp
|
||||
@@ -278,7 +278,6 @@ nsString gAbsoluteArgv0Path;
|
||||
# ifdef MOZ_X11
|
||||
# include <gdk/gdkx.h>
|
||||
# endif /* MOZ_X11 */
|
||||
-# include "nsGTKToolkit.h"
|
||||
# include <fontconfig/fontconfig.h>
|
||||
#endif
|
||||
#include "BinaryPath.h"
|
||||
@@ -3851,7 +3850,6 @@ int XREMain::XRE_mainStartup(bool* aExitFlag) {
|
||||
#endif
|
||||
#if defined(MOZ_WIDGET_GTK)
|
||||
g_set_application_name(mAppData->name);
|
||||
- gtk_window_set_auto_startup_notification(false);
|
||||
|
||||
#endif /* defined(MOZ_WIDGET_GTK) */
|
||||
#ifdef MOZ_X11
|
||||
@@ -4492,10 +4490,6 @@ nsresult XREMain::XRE_mainRun() {
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_DESKTOP_STARTUP_ID) && defined(MOZ_WIDGET_GTK)
|
||||
- nsGTKToolkit* toolkit = nsGTKToolkit::GetToolkit();
|
||||
- if (toolkit && !mDesktopStartupID.IsEmpty()) {
|
||||
- toolkit->SetDesktopStartupID(mDesktopStartupID);
|
||||
- }
|
||||
// Clear the environment variable so it won't be inherited by
|
||||
// child processes and confuse things.
|
||||
g_unsetenv("DESKTOP_STARTUP_ID");
|
||||
diff --git widget/gtk/moz.build widget/gtk/moz.build
|
||||
index 2cbd226ef2222..1c8ee424aeb11 100644
|
||||
--- widget/gtk/moz.build
|
||||
+++ widget/gtk/moz.build
|
||||
@@ -146,8 +146,6 @@ DEFINES['CAIRO_GFX'] = True
|
||||
|
||||
DEFINES['MOZ_APP_NAME'] = '"%s"' % CONFIG['MOZ_APP_NAME']
|
||||
|
||||
-CFLAGS += CONFIG['MOZ_STARTUP_NOTIFICATION_CFLAGS']
|
||||
-
|
||||
# When building with GTK3, the widget code always needs to use
|
||||
# system Cairo headers, regardless of whether we are also linked
|
||||
# against and using in-tree Cairo. By not using in-tree Cairo
|
||||
@@ -158,8 +156,6 @@ CFLAGS += CONFIG['MOZ_STARTUP_NOTIFICATION_CFLAGS']
|
||||
if not (CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk' and CONFIG['MOZ_TREE_CAIRO']):
|
||||
CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
|
||||
|
||||
-CXXFLAGS += CONFIG['MOZ_STARTUP_NOTIFICATION_CFLAGS']
|
||||
-
|
||||
CFLAGS += CONFIG['TK_CFLAGS']
|
||||
CXXFLAGS += CONFIG['TK_CFLAGS']
|
||||
|
||||
diff --git widget/gtk/mozgtk/mozgtk.c widget/gtk/mozgtk/mozgtk.c
|
||||
index 9954083d5c1ef..84599830ca00a 100644
|
||||
--- widget/gtk/mozgtk/mozgtk.c
|
||||
+++ widget/gtk/mozgtk/mozgtk.c
|
||||
@@ -529,6 +529,7 @@ STUB(gtk_window_set_geometry_hints)
|
||||
STUB(gtk_window_set_icon_name)
|
||||
STUB(gtk_window_set_modal)
|
||||
STUB(gtk_window_set_skip_taskbar_hint)
|
||||
+STUB(gtk_window_set_startup_id)
|
||||
STUB(gtk_window_set_title)
|
||||
STUB(gtk_window_set_transient_for)
|
||||
STUB(gtk_window_set_type_hint)
|
||||
diff --git widget/gtk/nsWindow.cpp widget/gtk/nsWindow.cpp
|
||||
index 05902ac3bfb26..89748404988c3 100644
|
||||
--- widget/gtk/nsWindow.cpp
|
||||
+++ widget/gtk/nsWindow.cpp
|
||||
@@ -64,11 +64,6 @@
|
||||
|
||||
#include "nsGkAtoms.h"
|
||||
|
||||
-#ifdef MOZ_ENABLE_STARTUP_NOTIFICATION
|
||||
-# define SN_API_NOT_YET_FROZEN
|
||||
-# include <startup-notification-1.0/libsn/sn.h>
|
||||
-#endif
|
||||
-
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/Likely.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
@@ -1393,8 +1388,6 @@ void nsWindow::SetSizeMode(nsSizeMode aMode) {
|
||||
|
||||
typedef void (*SetUserTimeFunc)(GdkWindow* aWindow, guint32 aTimestamp);
|
||||
|
||||
-// This will become obsolete when new GTK APIs are widely supported,
|
||||
-// as described here: http://bugzilla.gnome.org/show_bug.cgi?id=347375
|
||||
static void SetUserTimeAndStartupIDForActivatedWindow(GtkWidget* aWindow) {
|
||||
nsGTKToolkit* GTKToolkit = nsGTKToolkit::GetToolkit();
|
||||
if (!GTKToolkit) return;
|
||||
@@ -1414,35 +1407,7 @@ static void SetUserTimeAndStartupIDForActivatedWindow(
|
||||
return;
|
||||
}
|
||||
|
||||
-#if defined(MOZ_ENABLE_STARTUP_NOTIFICATION)
|
||||
- // TODO - Implement for non-X11 Gtk backends (Bug 726479)
|
||||
- if (GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
|
||||
- GdkWindow* gdkWindow = gtk_widget_get_window(aWindow);
|
||||
-
|
||||
- GdkScreen* screen = gdk_window_get_screen(gdkWindow);
|
||||
- SnDisplay* snd = sn_display_new(
|
||||
- gdk_x11_display_get_xdisplay(gdk_window_get_display(gdkWindow)),
|
||||
- nullptr, nullptr);
|
||||
- if (!snd) return;
|
||||
- SnLauncheeContext* ctx = sn_launchee_context_new(
|
||||
- snd, gdk_screen_get_number(screen), desktopStartupID.get());
|
||||
- if (!ctx) {
|
||||
- sn_display_unref(snd);
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- if (sn_launchee_context_get_id_has_timestamp(ctx)) {
|
||||
- gdk_x11_window_set_user_time(gdkWindow,
|
||||
- sn_launchee_context_get_timestamp(ctx));
|
||||
- }
|
||||
-
|
||||
- sn_launchee_context_setup_window(ctx, gdk_x11_window_get_xid(gdkWindow));
|
||||
- sn_launchee_context_complete(ctx);
|
||||
-
|
||||
- sn_launchee_context_unref(ctx);
|
||||
- sn_display_unref(snd);
|
||||
- }
|
||||
-#endif
|
||||
+ gtk_window_set_startup_id(GTK_WINDOW(aWindow), desktopStartupID.get());
|
||||
|
||||
// If we used the startup ID, that already contains the focus timestamp;
|
||||
// we don't want to reuse the timestamp next time we raise the window
|
@ -4,8 +4,8 @@ diff --git config/system-headers.mozbuild config/system-headers.mozbuild
|
||||
index 7620b4d00623..09d3db5ca8c0 100644
|
||||
--- config/system-headers.mozbuild
|
||||
+++ config/system-headers.mozbuild
|
||||
@@ -1300,6 +1300,19 @@ if CONFIG['MOZ_ENABLE_CONTENTMANAGER']:
|
||||
'SelectSingleContentItemPage.h',
|
||||
@@ -1299,6 +1299,19 @@ if CONFIG['MOZ_ENABLE_LIBPROXY']:
|
||||
'proxy.h',
|
||||
]
|
||||
|
||||
+if CONFIG['MOZ_SYSTEM_GRAPHITE2']:
|
||||
@ -28,16 +28,43 @@ diff --git dom/base/moz.build dom/base/moz.build
|
||||
index 8e19020315ae..2fcdbb6f7b42 100644
|
||||
--- dom/base/moz.build
|
||||
+++ dom/base/moz.build
|
||||
@@ -495,6 +495,9 @@ if CONFIG['MOZ_BUILD_APP'] in ['browser', 'mobile/android', 'xulrunner']:
|
||||
@@ -543,6 +543,9 @@ if CONFIG['MOZ_BUILD_APP'] in ['browser', 'mobile/android', 'xulrunner']:
|
||||
if CONFIG['MOZ_X11']:
|
||||
CXXFLAGS += CONFIG['TK_CFLAGS']
|
||||
|
||||
+if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
|
||||
+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
|
||||
+
|
||||
GENERATED_FILES += [
|
||||
'PropertyUseCounterMap.inc',
|
||||
'UseCounterList.h',
|
||||
GeneratedFile('UseCounterList.h', script='gen-usecounters.py',
|
||||
entry_point='use_counter_list', inputs=['UseCounters.conf'])
|
||||
|
||||
diff --git gfx/graphite2/geckoextra/moz.build gfx/graphite2/geckoextra/moz.build
|
||||
new file mode 100644
|
||||
index 0000000000000..24e8d7a03274a
|
||||
--- /dev/null
|
||||
+++ gfx/graphite2/geckoextra/moz.build
|
||||
@@ -0,0 +1,21 @@
|
||||
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
+# vim: set filetype=python:
|
||||
+# 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/.
|
||||
+
|
||||
+EXPORTS.graphite2 += [
|
||||
+ 'include/GraphiteExtra.h',
|
||||
+ 'include/GraphiteStructsForRLBox.h',
|
||||
+]
|
||||
+
|
||||
+UNIFIED_SOURCES += [
|
||||
+ '../geckoextra/src/GraphiteExtra.cpp',
|
||||
+]
|
||||
+
|
||||
+CXXFLAGS += CONFIG['MOZ_GRAPHITE2_CFLAGS']
|
||||
+
|
||||
+# Match bundled graphite2 configuration
|
||||
+AllowCompilerWarnings()
|
||||
+
|
||||
+FINAL_LIBRARY = 'gkmedias'
|
||||
diff --git gfx/graphite2/moz-gr-update.sh gfx/graphite2/moz-gr-update.sh
|
||||
index faaab1b17971..04eff5f09882 100644
|
||||
--- gfx/graphite2/moz-gr-update.sh
|
||||
@ -85,11 +112,13 @@ diff --git gfx/moz.build gfx/moz.build
|
||||
index 771f652e837a..3b358d84e384 100644
|
||||
--- gfx/moz.build
|
||||
+++ gfx/moz.build
|
||||
@@ -10,6 +10,12 @@ with Files('**'):
|
||||
@@ -13,6 +13,14 @@ with Files('wr/**'):
|
||||
if CONFIG['MOZ_TREE_CAIRO']:
|
||||
DIRS += ['cairo']
|
||||
|
||||
+if not CONFIG['MOZ_SYSTEM_GRAPHITE2']:
|
||||
+if CONFIG['MOZ_SYSTEM_GRAPHITE2']:
|
||||
+ DIRS += ['graphite2/geckoextra']
|
||||
+else:
|
||||
+ DIRS += ['graphite2/src' ]
|
||||
+
|
||||
+if not CONFIG['MOZ_SYSTEM_HARFBUZZ']:
|
||||
@ -98,7 +127,7 @@ index 771f652e837a..3b358d84e384 100644
|
||||
DIRS += [
|
||||
'2d',
|
||||
'ycbcr',
|
||||
@@ -18,8 +24,6 @@ DIRS += [
|
||||
@@ -21,8 +29,6 @@ DIRS += [
|
||||
'qcms',
|
||||
'gl',
|
||||
'layers',
|
||||
@ -111,35 +140,35 @@ diff --git gfx/skia/generate_mozbuild.py gfx/skia/generate_mozbuild.py
|
||||
index e06ae3457a47..93faa61594a3 100755
|
||||
--- gfx/skia/generate_mozbuild.py
|
||||
+++ gfx/skia/generate_mozbuild.py
|
||||
@@ -148,6 +148,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
|
||||
@@ -117,6 +117,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
|
||||
'-Wno-unused-private-field',
|
||||
]
|
||||
|
||||
+if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
|
||||
+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
|
||||
+
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk3', 'android'):
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk', 'android'):
|
||||
CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
|
||||
CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
|
||||
diff --git gfx/skia/moz.build gfx/skia/moz.build
|
||||
index 2118677ca3a8..e4978b413784 100644
|
||||
--- gfx/skia/moz.build
|
||||
+++ gfx/skia/moz.build
|
||||
@@ -822,6 +822,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
|
||||
@@ -493,6 +493,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
|
||||
'-Wno-unused-private-field',
|
||||
]
|
||||
|
||||
+if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
|
||||
+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
|
||||
+
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk3', 'android'):
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk', 'android'):
|
||||
CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
|
||||
CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
|
||||
diff --git gfx/thebes/moz.build gfx/thebes/moz.build
|
||||
index 56f1b9fe3f4b..0ac1100b0df3 100644
|
||||
--- gfx/thebes/moz.build
|
||||
+++ gfx/thebes/moz.build
|
||||
@@ -288,7 +288,13 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
|
||||
@@ -284,7 +284,13 @@ if CONFIG['MOZ_WAYLAND']:
|
||||
|
||||
LOCAL_INCLUDES += CONFIG['SKIA_INCLUDES']
|
||||
|
||||
@ -170,7 +199,7 @@ diff --git netwerk/dns/moz.build netwerk/dns/moz.build
|
||||
index 79c26e3e7001..c4d93bc5f7dc 100644
|
||||
--- netwerk/dns/moz.build
|
||||
+++ netwerk/dns/moz.build
|
||||
@@ -76,3 +76,6 @@ USE_LIBS += ['icu']
|
||||
@@ -86,3 +86,6 @@ USE_LIBS += ['icu']
|
||||
|
||||
if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
|
||||
CXXFLAGS += ['-Wno-error=shadow']
|
||||
@ -181,7 +210,7 @@ diff --git old-configure.in old-configure.in
|
||||
index 95a58b634593..b614eef85c89 100644
|
||||
--- old-configure.in
|
||||
+++ old-configure.in
|
||||
@@ -3951,6 +3951,27 @@ dnl ========================================================
|
||||
@@ -2639,6 +2639,27 @@ dnl ========================================================
|
||||
|
||||
AC_SUBST(MOZ_LINUX_32_SSE2_STARTUP_ERROR)
|
||||
|
||||
@ -198,7 +227,7 @@ index 95a58b634593..b614eef85c89 100644
|
||||
+ * 100 + GR2_VERSION_BUGFIX >= \
|
||||
+ (major) * 10000 + (minor) * 100 + (bugfix) )
|
||||
+ ], [
|
||||
+ #if !GR2_VERSION_REQUIRE(1,3,12)
|
||||
+ #if !GR2_VERSION_REQUIRE(1,3,14)
|
||||
+ #error "Insufficient graphite2 version."
|
||||
+ #endif
|
||||
+ ], [],
|
||||
@ -213,7 +242,7 @@ diff --git toolkit/library/moz.build toolkit/library/moz.build
|
||||
index 24f940e1ed7e..079a575adec3 100644
|
||||
--- toolkit/library/moz.build
|
||||
+++ toolkit/library/moz.build
|
||||
@@ -226,6 +226,12 @@ if CONFIG['MOZ_SYSTEM_PNG']:
|
||||
@@ -248,6 +248,12 @@ if CONFIG['MOZ_SYSTEM_PNG']:
|
||||
if CONFIG['MOZ_SYSTEM_WEBP']:
|
||||
OS_LIBS += CONFIG['MOZ_WEBP_LIBS']
|
||||
|
||||
@ -230,7 +259,7 @@ diff --git toolkit/moz.configure toolkit/moz.configure
|
||||
index 9297e4d6f501..d8e273887e4b 100644
|
||||
--- toolkit/moz.configure
|
||||
+++ toolkit/moz.configure
|
||||
@@ -894,6 +894,26 @@ add_old_configure_assignment('FT2_LIBS',
|
||||
@@ -937,6 +937,25 @@ add_old_configure_assignment('FT2_LIBS',
|
||||
add_old_configure_assignment('FT2_CFLAGS',
|
||||
ft2_info.cflags)
|
||||
|
||||
@ -249,11 +278,10 @@ index 9297e4d6f501..d8e273887e4b 100644
|
||||
+option('--with-system-harfbuzz',
|
||||
+ help="Use system harfbuzz (located with pkgconfig)")
|
||||
+
|
||||
+system_harfbuzz = pkg_check_modules('MOZ_HARFBUZZ', 'harfbuzz >= 2.4.0',
|
||||
+system_harfbuzz = pkg_check_modules('MOZ_HARFBUZZ', 'harfbuzz >= 2.6.6',
|
||||
+ when='--with-system-harfbuzz')
|
||||
+
|
||||
+set_config('MOZ_SYSTEM_HARFBUZZ', depends_if(system_harfbuzz)(lambda _: True))
|
||||
+
|
||||
# Marionette remote protocol
|
||||
|
||||
# Remote agent (part of CDP based remote protocol)
|
||||
# ==============================================================
|
||||
#
|
||||
|
@ -1,793 +0,0 @@
|
||||
https://github.com/kinetiknz/cubeb/pull/539
|
||||
|
||||
diff --git media/libcubeb/gtest/moz.build media/libcubeb/gtest/moz.build
|
||||
index 1ff0c02545251..ca364d1ef7845 100644
|
||||
--- media/libcubeb/gtest/moz.build
|
||||
+++ media/libcubeb/gtest/moz.build
|
||||
@@ -67,13 +67,6 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'uikit':
|
||||
'-framework CoreFoundation',
|
||||
'-framework AudioToolbox',
|
||||
]
|
||||
-elif CONFIG['OS_TARGET'] == 'OpenBSD':
|
||||
- OS_LIBS += [
|
||||
- 'sndio',
|
||||
- ]
|
||||
-else:
|
||||
- OS_LIBS += CONFIG['MOZ_ALSA_LIBS']
|
||||
- OS_LIBS += CONFIG['MOZ_PULSEAUDIO_LIBS']
|
||||
|
||||
if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
|
||||
CXXFLAGS += ['-Wno-error=shadow']
|
||||
diff --git media/libcubeb/src/cubeb.c media/libcubeb/src/cubeb.c
|
||||
index 98a735f..db294b3 100644
|
||||
--- media/libcubeb/src/cubeb.c
|
||||
+++ media/libcubeb/src/cubeb.c
|
||||
@@ -180,6 +180,9 @@ cubeb_init(cubeb ** context, char const * context_name, char const * backend_nam
|
||||
#if defined(USE_JACK)
|
||||
jack_init,
|
||||
#endif
|
||||
+#if defined(USE_SNDIO)
|
||||
+ sndio_init,
|
||||
+#endif
|
||||
#if defined(USE_ALSA)
|
||||
alsa_init,
|
||||
#endif
|
||||
@@ -192,9 +195,6 @@ cubeb_init(cubeb ** context, char const * context_name, char const * backend_nam
|
||||
#if defined(USE_WINMM)
|
||||
winmm_init,
|
||||
#endif
|
||||
-#if defined(USE_SNDIO)
|
||||
- sndio_init,
|
||||
-#endif
|
||||
#if defined(USE_OPENSL)
|
||||
opensl_init,
|
||||
#endif
|
||||
diff --git media/libcubeb/src/cubeb_alsa.c media/libcubeb/src/cubeb_alsa.c
|
||||
index bfd4d8f..a29eed0 100644
|
||||
--- media/libcubeb/src/cubeb_alsa.c
|
||||
+++ media/libcubeb/src/cubeb_alsa.c
|
||||
@@ -14,10 +14,58 @@
|
||||
#include <limits.h>
|
||||
#include <poll.h>
|
||||
#include <unistd.h>
|
||||
+#include <dlfcn.h>
|
||||
#include <alsa/asoundlib.h>
|
||||
#include "cubeb/cubeb.h"
|
||||
#include "cubeb-internal.h"
|
||||
|
||||
+#ifdef DISABLE_LIBASOUND_DLOPEN
|
||||
+#define WRAP(x) x
|
||||
+#else
|
||||
+#define WRAP(x) cubeb_##x
|
||||
+#define LIBASOUND_API_VISIT(X) \
|
||||
+ X(snd_config) \
|
||||
+ X(snd_config_add) \
|
||||
+ X(snd_config_copy) \
|
||||
+ X(snd_config_delete) \
|
||||
+ X(snd_config_get_id) \
|
||||
+ X(snd_config_get_string) \
|
||||
+ X(snd_config_imake_integer) \
|
||||
+ X(snd_config_search) \
|
||||
+ X(snd_config_search_definition) \
|
||||
+ X(snd_lib_error_set_handler) \
|
||||
+ X(snd_pcm_avail_update) \
|
||||
+ X(snd_pcm_close) \
|
||||
+ X(snd_pcm_delay) \
|
||||
+ X(snd_pcm_drain) \
|
||||
+ X(snd_pcm_frames_to_bytes) \
|
||||
+ X(snd_pcm_get_params) \
|
||||
+ X(snd_pcm_hw_params_any) \
|
||||
+ X(snd_pcm_hw_params_get_channels_max) \
|
||||
+ X(snd_pcm_hw_params_get_rate) \
|
||||
+ X(snd_pcm_hw_params_set_rate_near) \
|
||||
+ X(snd_pcm_hw_params_sizeof) \
|
||||
+ X(snd_pcm_nonblock) \
|
||||
+ X(snd_pcm_open) \
|
||||
+ X(snd_pcm_open_lconf) \
|
||||
+ X(snd_pcm_pause) \
|
||||
+ X(snd_pcm_poll_descriptors) \
|
||||
+ X(snd_pcm_poll_descriptors_count) \
|
||||
+ X(snd_pcm_poll_descriptors_revents) \
|
||||
+ X(snd_pcm_readi) \
|
||||
+ X(snd_pcm_recover) \
|
||||
+ X(snd_pcm_set_params) \
|
||||
+ X(snd_pcm_start) \
|
||||
+ X(snd_pcm_state) \
|
||||
+ X(snd_pcm_writei) \
|
||||
+
|
||||
+#define MAKE_TYPEDEF(x) static typeof(x) * cubeb_##x;
|
||||
+LIBASOUND_API_VISIT(MAKE_TYPEDEF);
|
||||
+#undef MAKE_TYPEDEF
|
||||
+/* snd_pcm_hw_params_alloca is actually a macro */
|
||||
+#define snd_pcm_hw_params_sizeof cubeb_snd_pcm_hw_params_sizeof
|
||||
+#endif
|
||||
+
|
||||
#define CUBEB_STREAM_MAX 16
|
||||
#define CUBEB_WATCHDOG_MS 10000
|
||||
|
||||
@@ -36,6 +84,7 @@ static struct cubeb_ops const alsa_ops;
|
||||
|
||||
struct cubeb {
|
||||
struct cubeb_ops const * ops;
|
||||
+ void * libasound;
|
||||
|
||||
pthread_t thread;
|
||||
|
||||
@@ -245,8 +294,8 @@ set_timeout(struct timeval * timeout, unsigned int ms)
|
||||
static void
|
||||
stream_buffer_decrement(cubeb_stream * stm, long count)
|
||||
{
|
||||
- char * bufremains = stm->buffer + snd_pcm_frames_to_bytes(stm->pcm, count);
|
||||
- memmove(stm->buffer, bufremains, snd_pcm_frames_to_bytes(stm->pcm, stm->bufframes - count));
|
||||
+ char * bufremains = stm->buffer + WRAP(snd_pcm_frames_to_bytes)(stm->pcm, count);
|
||||
+ memmove(stm->buffer, bufremains, WRAP(snd_pcm_frames_to_bytes)(stm->pcm, stm->bufframes - count));
|
||||
stm->bufframes -= count;
|
||||
}
|
||||
|
||||
@@ -278,9 +327,9 @@ alsa_process_stream(cubeb_stream * stm)
|
||||
/* Call _poll_descriptors_revents() even if we don't use it
|
||||
to let underlying plugins clear null events. Otherwise poll()
|
||||
may wake up again and again, producing unnecessary CPU usage. */
|
||||
- snd_pcm_poll_descriptors_revents(stm->pcm, stm->fds, stm->nfds, &revents);
|
||||
+ WRAP(snd_pcm_poll_descriptors_revents)(stm->pcm, stm->fds, stm->nfds, &revents);
|
||||
|
||||
- avail = snd_pcm_avail_update(stm->pcm);
|
||||
+ avail = WRAP(snd_pcm_avail_update)(stm->pcm);
|
||||
|
||||
/* Got null event? Bail and wait for another wakeup. */
|
||||
if (avail == 0) {
|
||||
@@ -303,7 +352,7 @@ alsa_process_stream(cubeb_stream * stm)
|
||||
// TODO: should it be marked as DRAINING?
|
||||
}
|
||||
|
||||
- got = snd_pcm_readi(stm->pcm, stm->buffer+stm->bufframes, avail);
|
||||
+ got = WRAP(snd_pcm_readi)(stm->pcm, stm->buffer+stm->bufframes, avail);
|
||||
|
||||
if (got < 0) {
|
||||
avail = got; // the error handler below will recover us
|
||||
@@ -347,7 +396,7 @@ alsa_process_stream(cubeb_stream * stm)
|
||||
(!stm->other_stream || stm->other_stream->bufframes > 0)) {
|
||||
long got = avail - stm->bufframes;
|
||||
void * other_buffer = stm->other_stream ? stm->other_stream->buffer : NULL;
|
||||
- char * buftail = stm->buffer + snd_pcm_frames_to_bytes(stm->pcm, stm->bufframes);
|
||||
+ char * buftail = stm->buffer + WRAP(snd_pcm_frames_to_bytes)(stm->pcm, stm->bufframes);
|
||||
|
||||
/* Correct read size to the other stream available frames */
|
||||
if (stm->other_stream && got > (snd_pcm_sframes_t) stm->other_stream->bufframes) {
|
||||
@@ -374,8 +423,8 @@ alsa_process_stream(cubeb_stream * stm)
|
||||
long drain_frames = avail - stm->bufframes;
|
||||
double drain_time = (double) drain_frames / stm->params.rate;
|
||||
|
||||
- char * buftail = stm->buffer + snd_pcm_frames_to_bytes(stm->pcm, stm->bufframes);
|
||||
- memset(buftail, 0, snd_pcm_frames_to_bytes(stm->pcm, drain_frames));
|
||||
+ char * buftail = stm->buffer + WRAP(snd_pcm_frames_to_bytes)(stm->pcm, stm->bufframes);
|
||||
+ memset(buftail, 0, WRAP(snd_pcm_frames_to_bytes)(stm->pcm, drain_frames));
|
||||
stm->bufframes = avail;
|
||||
|
||||
/* Mark as draining, unless we're waiting for capture */
|
||||
@@ -402,7 +451,7 @@ alsa_process_stream(cubeb_stream * stm)
|
||||
}
|
||||
}
|
||||
|
||||
- wrote = snd_pcm_writei(stm->pcm, stm->buffer, avail);
|
||||
+ wrote = WRAP(snd_pcm_writei)(stm->pcm, stm->buffer, avail);
|
||||
if (wrote < 0) {
|
||||
avail = wrote; // the error handler below will recover us
|
||||
} else {
|
||||
@@ -415,13 +464,13 @@ alsa_process_stream(cubeb_stream * stm)
|
||||
|
||||
/* Got some error? Let's try to recover the stream. */
|
||||
if (avail < 0) {
|
||||
- avail = snd_pcm_recover(stm->pcm, avail, 0);
|
||||
+ avail = WRAP(snd_pcm_recover)(stm->pcm, avail, 0);
|
||||
|
||||
/* Capture pcm must be started after initial setup/recover */
|
||||
if (avail >= 0 &&
|
||||
stm->stream_type == SND_PCM_STREAM_CAPTURE &&
|
||||
- snd_pcm_state(stm->pcm) == SND_PCM_STATE_PREPARED) {
|
||||
- avail = snd_pcm_start(stm->pcm);
|
||||
+ WRAP(snd_pcm_state)(stm->pcm) == SND_PCM_STATE_PREPARED) {
|
||||
+ avail = WRAP(snd_pcm_start)(stm->pcm);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -537,26 +586,26 @@ get_slave_pcm_node(snd_config_t * lconf, snd_config_t * root_pcm)
|
||||
|
||||
slave_def = NULL;
|
||||
|
||||
- r = snd_config_search(root_pcm, "slave", &slave_pcm);
|
||||
+ r = WRAP(snd_config_search)(root_pcm, "slave", &slave_pcm);
|
||||
if (r < 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
- r = snd_config_get_string(slave_pcm, &string);
|
||||
+ r = WRAP(snd_config_get_string)(slave_pcm, &string);
|
||||
if (r >= 0) {
|
||||
- r = snd_config_search_definition(lconf, "pcm_slave", string, &slave_def);
|
||||
+ r = WRAP(snd_config_search_definition)(lconf, "pcm_slave", string, &slave_def);
|
||||
if (r < 0) {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
do {
|
||||
- r = snd_config_search(slave_def ? slave_def : slave_pcm, "pcm", &pcm);
|
||||
+ r = WRAP(snd_config_search)(slave_def ? slave_def : slave_pcm, "pcm", &pcm);
|
||||
if (r < 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
- r = snd_config_get_string(slave_def ? slave_def : slave_pcm, &string);
|
||||
+ r = WRAP(snd_config_get_string)(slave_def ? slave_def : slave_pcm, &string);
|
||||
if (r < 0) {
|
||||
break;
|
||||
}
|
||||
@@ -565,7 +614,7 @@ get_slave_pcm_node(snd_config_t * lconf, snd_config_t * root_pcm)
|
||||
if (r < 0 || r > (int) sizeof(node_name)) {
|
||||
break;
|
||||
}
|
||||
- r = snd_config_search(lconf, node_name, &pcm);
|
||||
+ r = WRAP(snd_config_search)(lconf, node_name, &pcm);
|
||||
if (r < 0) {
|
||||
break;
|
||||
}
|
||||
@@ -574,7 +623,7 @@ get_slave_pcm_node(snd_config_t * lconf, snd_config_t * root_pcm)
|
||||
} while (0);
|
||||
|
||||
if (slave_def) {
|
||||
- snd_config_delete(slave_def);
|
||||
+ WRAP(snd_config_delete)(slave_def);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -597,22 +646,22 @@ init_local_config_with_workaround(char const * pcm_name)
|
||||
|
||||
lconf = NULL;
|
||||
|
||||
- if (snd_config == NULL) {
|
||||
+ if (*WRAP(snd_config) == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
- r = snd_config_copy(&lconf, snd_config);
|
||||
+ r = WRAP(snd_config_copy)(&lconf, *WRAP(snd_config));
|
||||
if (r < 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
do {
|
||||
- r = snd_config_search_definition(lconf, "pcm", pcm_name, &pcm_node);
|
||||
+ r = WRAP(snd_config_search_definition)(lconf, "pcm", pcm_name, &pcm_node);
|
||||
if (r < 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
- r = snd_config_get_id(pcm_node, &string);
|
||||
+ r = WRAP(snd_config_get_id)(pcm_node, &string);
|
||||
if (r < 0) {
|
||||
break;
|
||||
}
|
||||
@@ -621,7 +670,7 @@ init_local_config_with_workaround(char const * pcm_name)
|
||||
if (r < 0 || r > (int) sizeof(node_name)) {
|
||||
break;
|
||||
}
|
||||
- r = snd_config_search(lconf, node_name, &pcm_node);
|
||||
+ r = WRAP(snd_config_search)(lconf, node_name, &pcm_node);
|
||||
if (r < 0) {
|
||||
break;
|
||||
}
|
||||
@@ -632,12 +681,12 @@ init_local_config_with_workaround(char const * pcm_name)
|
||||
}
|
||||
|
||||
/* Fetch the PCM node's type, and bail out if it's not the PulseAudio plugin. */
|
||||
- r = snd_config_search(pcm_node, "type", &node);
|
||||
+ r = WRAP(snd_config_search)(pcm_node, "type", &node);
|
||||
if (r < 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
- r = snd_config_get_string(node, &string);
|
||||
+ r = WRAP(snd_config_get_string)(node, &string);
|
||||
if (r < 0) {
|
||||
break;
|
||||
}
|
||||
@@ -648,18 +697,18 @@ init_local_config_with_workaround(char const * pcm_name)
|
||||
|
||||
/* Don't clobber an explicit existing handle_underrun value, set it only
|
||||
if it doesn't already exist. */
|
||||
- r = snd_config_search(pcm_node, "handle_underrun", &node);
|
||||
+ r = WRAP(snd_config_search)(pcm_node, "handle_underrun", &node);
|
||||
if (r != -ENOENT) {
|
||||
break;
|
||||
}
|
||||
|
||||
/* Disable pcm_pulse's asynchronous underrun handling. */
|
||||
- r = snd_config_imake_integer(&node, "handle_underrun", 0);
|
||||
+ r = WRAP(snd_config_imake_integer)(&node, "handle_underrun", 0);
|
||||
if (r < 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
- r = snd_config_add(pcm_node, node);
|
||||
+ r = WRAP(snd_config_add)(pcm_node, node);
|
||||
if (r < 0) {
|
||||
break;
|
||||
}
|
||||
@@ -667,7 +716,7 @@ init_local_config_with_workaround(char const * pcm_name)
|
||||
return lconf;
|
||||
} while (0);
|
||||
|
||||
- snd_config_delete(lconf);
|
||||
+ WRAP(snd_config_delete)(lconf);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -679,9 +728,9 @@ alsa_locked_pcm_open(snd_pcm_t ** pcm, char const * pcm_name, snd_pcm_stream_t s
|
||||
|
||||
pthread_mutex_lock(&cubeb_alsa_mutex);
|
||||
if (local_config) {
|
||||
- r = snd_pcm_open_lconf(pcm, pcm_name, stream, SND_PCM_NONBLOCK, local_config);
|
||||
+ r = WRAP(snd_pcm_open_lconf)(pcm, pcm_name, stream, SND_PCM_NONBLOCK, local_config);
|
||||
} else {
|
||||
- r = snd_pcm_open(pcm, pcm_name, stream, SND_PCM_NONBLOCK);
|
||||
+ r = WRAP(snd_pcm_open)(pcm, pcm_name, stream, SND_PCM_NONBLOCK);
|
||||
}
|
||||
pthread_mutex_unlock(&cubeb_alsa_mutex);
|
||||
|
||||
@@ -694,7 +743,7 @@ alsa_locked_pcm_close(snd_pcm_t * pcm)
|
||||
int r;
|
||||
|
||||
pthread_mutex_lock(&cubeb_alsa_mutex);
|
||||
- r = snd_pcm_close(pcm);
|
||||
+ r = WRAP(snd_pcm_close)(pcm);
|
||||
pthread_mutex_unlock(&cubeb_alsa_mutex);
|
||||
|
||||
return r;
|
||||
@@ -750,6 +799,7 @@ silent_error_handler(char const * file, int line, char const * function,
|
||||
alsa_init(cubeb ** context, char const * context_name)
|
||||
{
|
||||
(void)context_name;
|
||||
+ void * libasound = NULL;
|
||||
cubeb * ctx;
|
||||
int r;
|
||||
int i;
|
||||
@@ -760,9 +810,27 @@ alsa_init(cubeb ** context, char const * context_name)
|
||||
assert(context);
|
||||
*context = NULL;
|
||||
|
||||
+#ifndef DISABLE_LIBASOUND_DLOPEN
|
||||
+ libasound = dlopen("libasound.so", RTLD_LAZY);
|
||||
+ if (!libasound) {
|
||||
+ return CUBEB_ERROR;
|
||||
+ }
|
||||
+
|
||||
+#define LOAD(x) { \
|
||||
+ cubeb_##x = dlsym(libasound, #x); \
|
||||
+ if (!cubeb_##x) { \
|
||||
+ dlclose(libasound); \
|
||||
+ return CUBEB_ERROR; \
|
||||
+ } \
|
||||
+ }
|
||||
+
|
||||
+ LIBASOUND_API_VISIT(LOAD);
|
||||
+#undef LOAD
|
||||
+#endif
|
||||
+
|
||||
pthread_mutex_lock(&cubeb_alsa_mutex);
|
||||
if (!cubeb_alsa_error_handler_set) {
|
||||
- snd_lib_error_set_handler(silent_error_handler);
|
||||
+ WRAP(snd_lib_error_set_handler)(silent_error_handler);
|
||||
cubeb_alsa_error_handler_set = 1;
|
||||
}
|
||||
pthread_mutex_unlock(&cubeb_alsa_mutex);
|
||||
@@ -771,6 +839,7 @@ alsa_init(cubeb ** context, char const * context_name)
|
||||
assert(ctx);
|
||||
|
||||
ctx->ops = &alsa_ops;
|
||||
+ ctx->libasound = libasound;
|
||||
|
||||
r = pthread_mutex_init(&ctx->mutex, NULL);
|
||||
assert(r == 0);
|
||||
@@ -819,7 +888,7 @@ alsa_init(cubeb ** context, char const * context_name)
|
||||
config fails with EINVAL, the PA PCM is too old for this workaround. */
|
||||
if (r == -EINVAL) {
|
||||
pthread_mutex_lock(&cubeb_alsa_mutex);
|
||||
- snd_config_delete(ctx->local_config);
|
||||
+ WRAP(snd_config_delete)(ctx->local_config);
|
||||
pthread_mutex_unlock(&cubeb_alsa_mutex);
|
||||
ctx->local_config = NULL;
|
||||
} else if (r >= 0) {
|
||||
@@ -861,10 +930,14 @@ alsa_destroy(cubeb * ctx)
|
||||
|
||||
if (ctx->local_config) {
|
||||
pthread_mutex_lock(&cubeb_alsa_mutex);
|
||||
- snd_config_delete(ctx->local_config);
|
||||
+ WRAP(snd_config_delete)(ctx->local_config);
|
||||
pthread_mutex_unlock(&cubeb_alsa_mutex);
|
||||
}
|
||||
|
||||
+ if (ctx->libasound) {
|
||||
+ dlclose(ctx->libasound);
|
||||
+ }
|
||||
+
|
||||
free(ctx);
|
||||
}
|
||||
|
||||
@@ -948,7 +1021,7 @@ alsa_stream_init_single(cubeb * ctx, cubeb_stream ** stream, char const * stream
|
||||
return CUBEB_ERROR;
|
||||
}
|
||||
|
||||
- r = snd_pcm_nonblock(stm->pcm, 1);
|
||||
+ r = WRAP(snd_pcm_nonblock)(stm->pcm, 1);
|
||||
assert(r == 0);
|
||||
|
||||
latency_us = latency_frames * 1e6 / stm->params.rate;
|
||||
@@ -961,7 +1034,7 @@ alsa_stream_init_single(cubeb * ctx, cubeb_stream ** stream, char const * stream
|
||||
latency_us = latency_us < min_latency ? min_latency: latency_us;
|
||||
}
|
||||
|
||||
- r = snd_pcm_set_params(stm->pcm, format, SND_PCM_ACCESS_RW_INTERLEAVED,
|
||||
+ r = WRAP(snd_pcm_set_params)(stm->pcm, format, SND_PCM_ACCESS_RW_INTERLEAVED,
|
||||
stm->params.channels, stm->params.rate, 1,
|
||||
latency_us);
|
||||
if (r < 0) {
|
||||
@@ -969,20 +1042,20 @@ alsa_stream_init_single(cubeb * ctx, cubeb_stream ** stream, char const * stream
|
||||
return CUBEB_ERROR_INVALID_FORMAT;
|
||||
}
|
||||
|
||||
- r = snd_pcm_get_params(stm->pcm, &stm->buffer_size, &period_size);
|
||||
+ r = WRAP(snd_pcm_get_params)(stm->pcm, &stm->buffer_size, &period_size);
|
||||
assert(r == 0);
|
||||
|
||||
/* Double internal buffer size to have enough space when waiting for the other side of duplex connection */
|
||||
stm->buffer_size *= 2;
|
||||
- stm->buffer = calloc(1, snd_pcm_frames_to_bytes(stm->pcm, stm->buffer_size));
|
||||
+ stm->buffer = calloc(1, WRAP(snd_pcm_frames_to_bytes)(stm->pcm, stm->buffer_size));
|
||||
assert(stm->buffer);
|
||||
|
||||
- stm->nfds = snd_pcm_poll_descriptors_count(stm->pcm);
|
||||
+ stm->nfds = WRAP(snd_pcm_poll_descriptors_count)(stm->pcm);
|
||||
assert(stm->nfds > 0);
|
||||
|
||||
stm->saved_fds = calloc(stm->nfds, sizeof(struct pollfd));
|
||||
assert(stm->saved_fds);
|
||||
- r = snd_pcm_poll_descriptors(stm->pcm, stm->saved_fds, stm->nfds);
|
||||
+ r = WRAP(snd_pcm_poll_descriptors)(stm->pcm, stm->saved_fds, stm->nfds);
|
||||
assert((nfds_t) r == stm->nfds);
|
||||
|
||||
if (alsa_register_stream(ctx, stm) != 0) {
|
||||
@@ -1054,7 +1127,7 @@ alsa_stream_destroy(cubeb_stream * stm)
|
||||
pthread_mutex_lock(&stm->mutex);
|
||||
if (stm->pcm) {
|
||||
if (stm->state == DRAINING) {
|
||||
- snd_pcm_drain(stm->pcm);
|
||||
+ WRAP(snd_pcm_drain)(stm->pcm);
|
||||
}
|
||||
alsa_locked_pcm_close(stm->pcm);
|
||||
stm->pcm = NULL;
|
||||
@@ -1100,12 +1173,12 @@ alsa_get_max_channel_count(cubeb * ctx, uint32_t * max_channels)
|
||||
|
||||
assert(stm);
|
||||
|
||||
- r = snd_pcm_hw_params_any(stm->pcm, hw_params);
|
||||
+ r = WRAP(snd_pcm_hw_params_any)(stm->pcm, hw_params);
|
||||
if (r < 0) {
|
||||
return CUBEB_ERROR;
|
||||
}
|
||||
|
||||
- r = snd_pcm_hw_params_get_channels_max(hw_params, max_channels);
|
||||
+ r = WRAP(snd_pcm_hw_params_get_channels_max)(hw_params, max_channels);
|
||||
if (r < 0) {
|
||||
return CUBEB_ERROR;
|
||||
}
|
||||
@@ -1126,34 +1199,34 @@ alsa_get_preferred_sample_rate(cubeb * ctx, uint32_t * rate) {
|
||||
|
||||
/* get a pcm, disabling resampling, so we get a rate the
|
||||
* hardware/dmix/pulse/etc. supports. */
|
||||
- r = snd_pcm_open(&pcm, CUBEB_ALSA_PCM_NAME, SND_PCM_STREAM_PLAYBACK, SND_PCM_NO_AUTO_RESAMPLE);
|
||||
+ r = WRAP(snd_pcm_open)(&pcm, CUBEB_ALSA_PCM_NAME, SND_PCM_STREAM_PLAYBACK, SND_PCM_NO_AUTO_RESAMPLE);
|
||||
if (r < 0) {
|
||||
return CUBEB_ERROR;
|
||||
}
|
||||
|
||||
- r = snd_pcm_hw_params_any(pcm, hw_params);
|
||||
+ r = WRAP(snd_pcm_hw_params_any)(pcm, hw_params);
|
||||
if (r < 0) {
|
||||
- snd_pcm_close(pcm);
|
||||
+ WRAP(snd_pcm_close)(pcm);
|
||||
return CUBEB_ERROR;
|
||||
}
|
||||
|
||||
- r = snd_pcm_hw_params_get_rate(hw_params, rate, &dir);
|
||||
+ r = WRAP(snd_pcm_hw_params_get_rate)(hw_params, rate, &dir);
|
||||
if (r >= 0) {
|
||||
/* There is a default rate: use it. */
|
||||
- snd_pcm_close(pcm);
|
||||
+ WRAP(snd_pcm_close)(pcm);
|
||||
return CUBEB_OK;
|
||||
}
|
||||
|
||||
/* Use a common rate, alsa may adjust it based on hw/etc. capabilities. */
|
||||
*rate = 44100;
|
||||
|
||||
- r = snd_pcm_hw_params_set_rate_near(pcm, hw_params, rate, NULL);
|
||||
+ r = WRAP(snd_pcm_hw_params_set_rate_near)(pcm, hw_params, rate, NULL);
|
||||
if (r < 0) {
|
||||
- snd_pcm_close(pcm);
|
||||
+ WRAP(snd_pcm_close)(pcm);
|
||||
return CUBEB_ERROR;
|
||||
}
|
||||
|
||||
- snd_pcm_close(pcm);
|
||||
+ WRAP(snd_pcm_close)(pcm);
|
||||
|
||||
return CUBEB_OK;
|
||||
}
|
||||
@@ -1186,10 +1259,10 @@ alsa_stream_start(cubeb_stream * stm)
|
||||
pthread_mutex_lock(&stm->mutex);
|
||||
/* Capture pcm must be started after initial setup/recover */
|
||||
if (stm->stream_type == SND_PCM_STREAM_CAPTURE &&
|
||||
- snd_pcm_state(stm->pcm) == SND_PCM_STATE_PREPARED) {
|
||||
- snd_pcm_start(stm->pcm);
|
||||
+ WRAP(snd_pcm_state)(stm->pcm) == SND_PCM_STATE_PREPARED) {
|
||||
+ WRAP(snd_pcm_start)(stm->pcm);
|
||||
}
|
||||
- snd_pcm_pause(stm->pcm, 0);
|
||||
+ WRAP(snd_pcm_pause)(stm->pcm, 0);
|
||||
gettimeofday(&stm->last_activity, NULL);
|
||||
pthread_mutex_unlock(&stm->mutex);
|
||||
|
||||
@@ -1229,7 +1302,7 @@ alsa_stream_stop(cubeb_stream * stm)
|
||||
pthread_mutex_unlock(&ctx->mutex);
|
||||
|
||||
pthread_mutex_lock(&stm->mutex);
|
||||
- snd_pcm_pause(stm->pcm, 1);
|
||||
+ WRAP(snd_pcm_pause)(stm->pcm, 1);
|
||||
pthread_mutex_unlock(&stm->mutex);
|
||||
|
||||
return CUBEB_OK;
|
||||
@@ -1245,8 +1318,8 @@ alsa_stream_get_position(cubeb_stream * stm, uint64_t * position)
|
||||
pthread_mutex_lock(&stm->mutex);
|
||||
|
||||
delay = -1;
|
||||
- if (snd_pcm_state(stm->pcm) != SND_PCM_STATE_RUNNING ||
|
||||
- snd_pcm_delay(stm->pcm, &delay) != 0) {
|
||||
+ if (WRAP(snd_pcm_state)(stm->pcm) != SND_PCM_STATE_RUNNING ||
|
||||
+ WRAP(snd_pcm_delay)(stm->pcm, &delay) != 0) {
|
||||
*position = stm->last_position;
|
||||
pthread_mutex_unlock(&stm->mutex);
|
||||
return CUBEB_OK;
|
||||
@@ -1271,7 +1344,7 @@ alsa_stream_get_latency(cubeb_stream * stm, uint32_t * latency)
|
||||
snd_pcm_sframes_t delay;
|
||||
/* This function returns the delay in frames until a frame written using
|
||||
snd_pcm_writei is sent to the DAC. The DAC delay should be < 1ms anyways. */
|
||||
- if (snd_pcm_delay(stm->pcm, &delay)) {
|
||||
+ if (WRAP(snd_pcm_delay)(stm->pcm, &delay)) {
|
||||
return CUBEB_ERROR;
|
||||
}
|
||||
|
||||
diff --git media/libcubeb/src/cubeb_sndio.c media/libcubeb/src/cubeb_sndio.c
|
||||
index 9e99b2c..0559af4 100644
|
||||
--- media/libcubeb/src/cubeb_sndio.c
|
||||
+++ media/libcubeb/src/cubeb_sndio.c
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
+#include <dlfcn.h>
|
||||
#include <assert.h>
|
||||
#include "cubeb/cubeb.h"
|
||||
#include "cubeb-internal.h"
|
||||
@@ -22,10 +23,35 @@
|
||||
#define DPR(...) do {} while(0)
|
||||
#endif
|
||||
|
||||
+#ifdef DISABLE_LIBSNDIO_DLOPEN
|
||||
+#define WRAP(x) x
|
||||
+#else
|
||||
+#define WRAP(x) cubeb_##x
|
||||
+#define LIBSNDIO_API_VISIT(X) \
|
||||
+ X(sio_close) \
|
||||
+ X(sio_eof) \
|
||||
+ X(sio_getpar) \
|
||||
+ X(sio_initpar) \
|
||||
+ X(sio_onmove) \
|
||||
+ X(sio_open) \
|
||||
+ X(sio_pollfd) \
|
||||
+ X(sio_read) \
|
||||
+ X(sio_revents) \
|
||||
+ X(sio_setpar) \
|
||||
+ X(sio_start) \
|
||||
+ X(sio_stop) \
|
||||
+ X(sio_write) \
|
||||
+
|
||||
+#define MAKE_TYPEDEF(x) static typeof(x) * cubeb_##x;
|
||||
+LIBSNDIO_API_VISIT(MAKE_TYPEDEF);
|
||||
+#undef MAKE_TYPEDEF
|
||||
+#endif
|
||||
+
|
||||
static struct cubeb_ops const sndio_ops;
|
||||
|
||||
struct cubeb {
|
||||
struct cubeb_ops const * ops;
|
||||
+ void * libsndio;
|
||||
};
|
||||
|
||||
struct cubeb_stream {
|
||||
@@ -119,7 +145,7 @@ sndio_mainloop(void *arg)
|
||||
DPR("sndio_mainloop()\n");
|
||||
s->state_cb(s, s->arg, CUBEB_STATE_STARTED);
|
||||
pthread_mutex_lock(&s->mtx);
|
||||
- if (!sio_start(s->hdl)) {
|
||||
+ if (!WRAP(sio_start)(s->hdl)) {
|
||||
pthread_mutex_unlock(&s->mtx);
|
||||
return NULL;
|
||||
}
|
||||
@@ -203,7 +229,7 @@ sndio_mainloop(void *arg)
|
||||
events |= POLLIN;
|
||||
if ((s->mode & SIO_PLAY) && pstart < pend)
|
||||
events |= POLLOUT;
|
||||
- nfds = sio_pollfd(s->hdl, pfds, events);
|
||||
+ nfds = WRAP(sio_pollfd)(s->hdl, pfds, events);
|
||||
|
||||
if (nfds > 0) {
|
||||
pthread_mutex_unlock(&s->mtx);
|
||||
@@ -213,7 +239,7 @@ sndio_mainloop(void *arg)
|
||||
continue;
|
||||
}
|
||||
|
||||
- revents = sio_revents(s->hdl, pfds);
|
||||
+ revents = WRAP(sio_revents)(s->hdl, pfds);
|
||||
|
||||
if (revents & POLLHUP) {
|
||||
state = CUBEB_STATE_ERROR;
|
||||
@@ -221,8 +247,8 @@ sndio_mainloop(void *arg)
|
||||
}
|
||||
|
||||
if (revents & POLLOUT) {
|
||||
- n = sio_write(s->hdl, s->pbuf + pstart, pend - pstart);
|
||||
- if (n == 0 && sio_eof(s->hdl)) {
|
||||
+ n = WRAP(sio_write)(s->hdl, s->pbuf + pstart, pend - pstart);
|
||||
+ if (n == 0 && WRAP(sio_eof)(s->hdl)) {
|
||||
DPR("sndio_mainloop() werr\n");
|
||||
state = CUBEB_STATE_ERROR;
|
||||
break;
|
||||
@@ -231,8 +257,8 @@ sndio_mainloop(void *arg)
|
||||
}
|
||||
|
||||
if (revents & POLLIN) {
|
||||
- n = sio_read(s->hdl, s->rbuf + rstart, rend - rstart);
|
||||
- if (n == 0 && sio_eof(s->hdl)) {
|
||||
+ n = WRAP(sio_read)(s->hdl, s->rbuf + rstart, rend - rstart);
|
||||
+ if (n == 0 && WRAP(sio_eof)(s->hdl)) {
|
||||
DPR("sndio_mainloop() rerr\n");
|
||||
state = CUBEB_STATE_ERROR;
|
||||
break;
|
||||
@@ -244,7 +270,7 @@ sndio_mainloop(void *arg)
|
||||
if (prime > 0 && (s->mode & SIO_REC))
|
||||
rstart = rend;
|
||||
}
|
||||
- sio_stop(s->hdl);
|
||||
+ WRAP(sio_stop)(s->hdl);
|
||||
s->hwpos = s->swpos;
|
||||
pthread_mutex_unlock(&s->mtx);
|
||||
s->state_cb(s, s->arg, state);
|
||||
@@ -254,8 +280,31 @@ sndio_mainloop(void *arg)
|
||||
/*static*/ int
|
||||
sndio_init(cubeb **context, char const *context_name)
|
||||
{
|
||||
+ void * libsndio = NULL;
|
||||
+
|
||||
+#ifndef DISABLE_LIBSNDIO_DLOPEN
|
||||
+ libsndio = dlopen("libsndio.so", RTLD_LAZY);
|
||||
+ if (!libsndio) {
|
||||
+ DPR("sndio_init(%s) failed dlopen(libsndio.so)\n", context_name);
|
||||
+ return CUBEB_ERROR;
|
||||
+ }
|
||||
+
|
||||
+#define LOAD(x) { \
|
||||
+ cubeb_##x = dlsym(libsndio, #x); \
|
||||
+ if (!cubeb_##x) { \
|
||||
+ DPR("sndio_init(%s) failed dlsym(%s)\n", context_name, #x); \
|
||||
+ dlclose(libsndio); \
|
||||
+ return CUBEB_ERROR; \
|
||||
+ } \
|
||||
+ }
|
||||
+
|
||||
+ LIBSNDIO_API_VISIT(LOAD);
|
||||
+#undef LOAD
|
||||
+#endif
|
||||
+
|
||||
DPR("sndio_init(%s)\n", context_name);
|
||||
*context = malloc(sizeof(*context));
|
||||
+ (*context)->libsndio = libsndio;
|
||||
(*context)->ops = &sndio_ops;
|
||||
(void)context_name;
|
||||
return CUBEB_OK;
|
||||
@@ -271,6 +320,8 @@ static void
|
||||
sndio_destroy(cubeb *context)
|
||||
{
|
||||
DPR("sndio_destroy()\n");
|
||||
+ if (context->libsndio)
|
||||
+ dlclose(context->libsndio);
|
||||
free(context);
|
||||
}
|
||||
|
||||
@@ -323,12 +374,12 @@ sndio_stream_init(cubeb * context,
|
||||
goto err;
|
||||
}
|
||||
s->context = context;
|
||||
- s->hdl = sio_open(NULL, s->mode, 1);
|
||||
+ s->hdl = WRAP(sio_open)(NULL, s->mode, 1);
|
||||
if (s->hdl == NULL) {
|
||||
DPR("sndio_stream_init(), sio_open() failed\n");
|
||||
goto err;
|
||||
}
|
||||
- sio_initpar(&wpar);
|
||||
+ WRAP(sio_initpar)(&wpar);
|
||||
wpar.sig = 1;
|
||||
wpar.bits = 16;
|
||||
switch (format) {
|
||||
@@ -351,7 +402,7 @@ sndio_stream_init(cubeb * context,
|
||||
if (s->mode & SIO_PLAY)
|
||||
wpar.pchan = output_stream_params->channels;
|
||||
wpar.appbufsz = latency_frames;
|
||||
- if (!sio_setpar(s->hdl, &wpar) || !sio_getpar(s->hdl, &rpar)) {
|
||||
+ if (!WRAP(sio_setpar)(s->hdl, &wpar) || !WRAP(sio_getpar)(s->hdl, &rpar)) {
|
||||
DPR("sndio_stream_init(), sio_setpar() failed\n");
|
||||
goto err;
|
||||
}
|
||||
@@ -362,7 +413,7 @@ sndio_stream_init(cubeb * context,
|
||||
DPR("sndio_stream_init() unsupported params\n");
|
||||
goto err;
|
||||
}
|
||||
- sio_onmove(s->hdl, sndio_onmove, s);
|
||||
+ WRAP(sio_onmove)(s->hdl, sndio_onmove, s);
|
||||
s->active = 0;
|
||||
s->nfr = rpar.round;
|
||||
s->rbpf = rpar.bps * rpar.rchan;
|
||||
@@ -400,7 +451,7 @@ sndio_stream_init(cubeb * context,
|
||||
return CUBEB_OK;
|
||||
err:
|
||||
if (s->hdl)
|
||||
- sio_close(s->hdl);
|
||||
+ WRAP(sio_close)(s->hdl);
|
||||
if (s->pbuf)
|
||||
free(s->pbuf);
|
||||
if (s->rbuf)
|
||||
@@ -446,7 +497,7 @@ static void
|
||||
sndio_stream_destroy(cubeb_stream *s)
|
||||
{
|
||||
DPR("sndio_stream_destroy()\n");
|
||||
- sio_close(s->hdl);
|
||||
+ WRAP(sio_close)(s->hdl);
|
||||
if (s->mode & SIO_PLAY)
|
||||
free(s->pbuf);
|
||||
if (s->mode & SIO_REC)
|
||||
diff --git toolkit/library/moz.build toolkit/library/moz.build
|
||||
index 8ce595ff96bff..c318e96a1fdfc 100644
|
||||
--- toolkit/library/moz.build
|
||||
+++ toolkit/library/moz.build
|
||||
@@ -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['HAVE_CLOCK_MONOTONIC']:
|
||||
OS_LIBS += CONFIG['REALTIME_LIBS']
|
||||
|
||||
@@ -242,11 +239,6 @@ OS_LIBS += CONFIG['ICONV_LIBS']
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('cocoa', 'uikit'):
|
||||
OS_LIBS += CONFIG['TK_LIBS']
|
||||
|
||||
-if CONFIG['OS_ARCH'] == 'OpenBSD':
|
||||
- OS_LIBS += [
|
||||
- 'sndio',
|
||||
- ]
|
||||
-
|
||||
if CONFIG['MOZ_ENABLE_DBUS']:
|
||||
OS_LIBS += CONFIG['MOZ_DBUS_GLIB_LIBS']
|
||||
|
@ -56,12 +56,12 @@ https://github.com/kinetiknz/cubeb/pull/600
|
||||
+#if defined (USE_OSS)
|
||||
+ oss_init,
|
||||
+#endif
|
||||
#if defined(USE_AUDIOUNIT)
|
||||
audiounit_rust,
|
||||
#if defined(USE_AUDIOUNIT_RUST)
|
||||
audiounit_rust_init,
|
||||
#endif
|
||||
--- /dev/null
|
||||
+++ media/libcubeb/src/cubeb_oss.c
|
||||
@@ -0,0 +1,1151 @@
|
||||
@@ -0,0 +1,1152 @@
|
||||
+/*
|
||||
+ * Copyright © 2019-2020 Nia Alarie <nia@NetBSD.org>
|
||||
+ * Copyright © 2020 Ka Ho Ng <khng300@gmail.com>
|
||||
@ -1208,6 +1208,7 @@ https://github.com/kinetiknz/cubeb/pull/600
|
||||
+ .stream_reset_default_device = NULL,
|
||||
+ .stream_get_position = oss_stream_get_position,
|
||||
+ .stream_get_latency = oss_stream_get_latency,
|
||||
+ .stream_get_input_latency = NULL,
|
||||
+ .stream_set_volume = oss_stream_set_volume,
|
||||
+ .stream_get_current_device = oss_get_current_device,
|
||||
+ .stream_device_destroy = oss_stream_device_destroy,
|
||||
|
@ -1,113 +0,0 @@
|
||||
https://github.com/kinetiknz/cubeb/commit/a71f116501fe39962599c435ef65066f7e7ea9f5
|
||||
https://github.com/kinetiknz/cubeb/commit/3025cbec70f3ed097ec9a2f33a4823316a29efc4
|
||||
https://github.com/kinetiknz/cubeb/commit/bb2735fa2ff680fdc615edbb363b19ff4a759503
|
||||
https://github.com/kinetiknz/cubeb/pull/564
|
||||
|
||||
diff --git a/src/cubeb_sndio.c b/src/cubeb_sndio.c
|
||||
index 4a05bd84..34b3513d 100644
|
||||
--- media/libcubeb/src/cubeb_sndio.c
|
||||
+++ media/libcubeb/src/cubeb_sndio.c
|
||||
@@ -32,6 +32,7 @@
|
||||
X(sio_eof) \
|
||||
X(sio_getpar) \
|
||||
X(sio_initpar) \
|
||||
+ X(sio_nfds) \
|
||||
X(sio_onmove) \
|
||||
X(sio_open) \
|
||||
X(sio_pollfd) \
|
||||
@@ -124,6 +125,23 @@ s16_to_float(void *ptr, long nsamp)
|
||||
*(--dst) = (1. / 32768) * *(--src);
|
||||
}
|
||||
|
||||
+static const char *
|
||||
+sndio_get_device()
|
||||
+{
|
||||
+#ifdef __linux__
|
||||
+ /*
|
||||
+ * On other platforms default to sndio devices,
|
||||
+ * so cubebs other backends can be used instead.
|
||||
+ */
|
||||
+ const char *dev = getenv("AUDIODEVICE");
|
||||
+ if (dev == NULL || *dev == '\0')
|
||||
+ return "snd/0";
|
||||
+ return dev;
|
||||
+#else
|
||||
+ return SIO_DEVANY;
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
static void
|
||||
sndio_onmove(void *arg, int delta)
|
||||
{
|
||||
@@ -135,18 +153,23 @@ sndio_onmove(void *arg, int delta)
|
||||
static void *
|
||||
sndio_mainloop(void *arg)
|
||||
{
|
||||
-#define MAXFDS 8
|
||||
- struct pollfd pfds[MAXFDS];
|
||||
+ struct pollfd *pfds;
|
||||
cubeb_stream *s = arg;
|
||||
int n, eof = 0, prime, nfds, events, revents, state = CUBEB_STATE_STARTED;
|
||||
size_t pstart = 0, pend = 0, rstart = 0, rend = 0;
|
||||
long nfr;
|
||||
|
||||
+ nfds = WRAP(sio_nfds)(s->hdl);
|
||||
+ pfds = calloc(nfds, sizeof (struct pollfd));
|
||||
+ if (pfds == NULL)
|
||||
+ return NULL;
|
||||
+
|
||||
DPR("sndio_mainloop()\n");
|
||||
s->state_cb(s, s->arg, CUBEB_STATE_STARTED);
|
||||
pthread_mutex_lock(&s->mtx);
|
||||
if (!WRAP(sio_start)(s->hdl)) {
|
||||
pthread_mutex_unlock(&s->mtx);
|
||||
+ free(pfds);
|
||||
return NULL;
|
||||
}
|
||||
DPR("sndio_mainloop(), started\n");
|
||||
@@ -274,6 +297,7 @@ sndio_mainloop(void *arg)
|
||||
s->hwpos = s->swpos;
|
||||
pthread_mutex_unlock(&s->mtx);
|
||||
s->state_cb(s, s->arg, state);
|
||||
+ free(pfds);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -281,6 +305,9 @@ sndio_mainloop(void *arg)
|
||||
sndio_init(cubeb **context, char const *context_name)
|
||||
{
|
||||
void * libsndio = NULL;
|
||||
+ struct sio_hdl *hdl;
|
||||
+
|
||||
+ assert(context);
|
||||
|
||||
#ifndef DISABLE_LIBSNDIO_DLOPEN
|
||||
libsndio = dlopen("libsndio.so.7.0", RTLD_LAZY);
|
||||
@@ -305,8 +332,17 @@ sndio_init(cubeb **context, char const *context_name)
|
||||
#undef LOAD
|
||||
#endif
|
||||
|
||||
+ /* test if sndio works */
|
||||
+ hdl = WRAP(sio_open)(sndio_get_device(), SIO_PLAY, 1);
|
||||
+ if (hdl == NULL) {
|
||||
+ return CUBEB_ERROR;
|
||||
+ }
|
||||
+ WRAP(sio_close)(hdl);
|
||||
+
|
||||
DPR("sndio_init(%s)\n", context_name);
|
||||
- *context = malloc(sizeof(*context));
|
||||
+ *context = malloc(sizeof(**context));
|
||||
+ if (*context == NULL)
|
||||
+ return CUBEB_ERROR;
|
||||
(*context)->libsndio = libsndio;
|
||||
(*context)->ops = &sndio_ops;
|
||||
(void)context_name;
|
||||
@@ -377,7 +413,7 @@ sndio_stream_init(cubeb * context,
|
||||
goto err;
|
||||
}
|
||||
s->context = context;
|
||||
- s->hdl = WRAP(sio_open)(NULL, s->mode, 1);
|
||||
+ s->hdl = WRAP(sio_open)(sndio_get_device(), s->mode, 1);
|
||||
if (s->hdl == NULL) {
|
||||
DPR("sndio_stream_init(), sio_open() failed\n");
|
||||
goto err;
|
@ -7,18 +7,19 @@ index 53fc3c9937f7..b23771ab80fa 100644
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "FlacDecoder.h"
|
||||
#include "MediaContainerType.h"
|
||||
#include "mozilla/StaticPrefs.h"
|
||||
#include "mozilla/StaticPrefs_media.h"
|
||||
+#include "PDMFactory.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
@@ -15,6 +16,10 @@ FlacDecoder::IsEnabled()
|
||||
{
|
||||
@@ -14,6 +15,11 @@ namespace mozilla {
|
||||
bool FlacDecoder::IsEnabled() {
|
||||
#ifdef MOZ_FFVPX
|
||||
return StaticPrefs::MediaFlacEnabled();
|
||||
return StaticPrefs::media_flac_enabled();
|
||||
+#elif defined(MOZ_FFMPEG)
|
||||
+ RefPtr<PDMFactory> platform = new PDMFactory();
|
||||
+ return StaticPrefs::MediaFlacEnabled() && platform->SupportsMimeType(NS_LITERAL_CSTRING("audio/flac"),
|
||||
+ return StaticPrefs::media_flac_enabled() &&
|
||||
+ platform->SupportsMimeType(NS_LITERAL_CSTRING("audio/flac"),
|
||||
+ /* DecoderDoctorDiagnostics* */ nullptr);
|
||||
#else
|
||||
// Until bug 1295886 is fixed.
|
||||
|
60
mail/thunderbird/files/patch-freebsd11.3
Normal file
60
mail/thunderbird/files/patch-freebsd11.3
Normal file
@ -0,0 +1,60 @@
|
||||
Drop after FreeBSD 11.3 EOL around 2020-09-20.
|
||||
https://svnweb.freebsd.org/changeset/base/351766
|
||||
|
||||
mozglue/baseprofiler/core/shared-libraries-linux.cc:374:34: error: use of undeclared
|
||||
identifier 'NT_GNU_BUILD_ID'
|
||||
if (note_header->n_type == NT_GNU_BUILD_ID) break;
|
||||
^
|
||||
In file included from Unified_cpp_mozglue_baseprofiler0.cpp:137:
|
||||
mozglue/baseprofiler/lul/LulElf.cpp:762:32: error: use of undeclared identifier
|
||||
'NT_GNU_BUILD_ID'
|
||||
if (note_header->n_type == NT_GNU_BUILD_ID) break;
|
||||
^
|
||||
In file included from Unified_cpp_tools_profiler1.cpp:38:
|
||||
tools/profiler/lul/LulElf.cpp:776:32: error: use of undeclared identifier
|
||||
'NT_GNU_BUILD_ID'
|
||||
if (note_header->n_type == NT_GNU_BUILD_ID) break;
|
||||
^
|
||||
|
||||
--- mozglue/baseprofiler/core/shared-libraries-linux.cc.orig 2020-06-25 17:04:48 UTC
|
||||
+++ mozglue/baseprofiler/core/shared-libraries-linux.cc
|
||||
@@ -50,6 +50,11 @@ extern "C" MOZ_EXPORT __attribute__((weak)) int dl_ite
|
||||
# define ElfW(type) Elf_##type
|
||||
#endif
|
||||
|
||||
+#if defined(GP_OS_freebsd) && !defined(NT_GNU_BUILD_ID)
|
||||
+// FreeBSD < 11.4 doesn't define NT_GNU_BUILD_ID
|
||||
+# define NT_GNU_BUILD_ID 3
|
||||
+#endif
|
||||
+
|
||||
// ----------------------------------------------------------------------------
|
||||
// Starting imports from toolkit/crashreporter/google-breakpad/, as needed by
|
||||
// this file when moved to mozglue.
|
||||
--- mozglue/baseprofiler/lul/LulElf.cpp.orig 2020-06-25 17:04:48 UTC
|
||||
+++ mozglue/baseprofiler/lul/LulElf.cpp
|
||||
@@ -79,6 +79,11 @@
|
||||
# define EM_AARCH64 183
|
||||
#endif
|
||||
|
||||
+#if defined(GP_OS_freebsd) && !defined(NT_GNU_BUILD_ID)
|
||||
+// FreeBSD < 11.4 doesn't define NT_GNU_BUILD_ID
|
||||
+# define NT_GNU_BUILD_ID 3
|
||||
+#endif
|
||||
+
|
||||
// This namespace contains helper functions.
|
||||
namespace {
|
||||
|
||||
--- tools/profiler/lul/LulElf.cpp.orig 2020-06-25 17:05:05 UTC
|
||||
+++ tools/profiler/lul/LulElf.cpp
|
||||
@@ -84,6 +84,11 @@
|
||||
# define EM_AARCH64 183
|
||||
#endif
|
||||
|
||||
+#if defined(GP_OS_freebsd) && !defined(NT_GNU_BUILD_ID)
|
||||
+// FreeBSD < 11.4 doesn't define NT_GNU_BUILD_ID
|
||||
+# define NT_GNU_BUILD_ID 3
|
||||
+#endif
|
||||
+
|
||||
// This namespace contains helper functions.
|
||||
namespace {
|
||||
|
@ -4,9 +4,9 @@ gfx/skia/skia/src/core/SkCpu.cpp:81:27: error: use of undeclared identifier 'get
|
||||
uint32_t hwcaps = getauxval(AT_HWCAP);
|
||||
^
|
||||
|
||||
--- gfx/skia/skia/src/core/SkCpu.cpp.orig 2020-02-10 09:43:20 UTC
|
||||
--- gfx/skia/skia/src/core/SkCpu.cpp.orig 2020-02-07 22:13:22 UTC
|
||||
+++ gfx/skia/skia/src/core/SkCpu.cpp
|
||||
@@ -70,6 +70,23 @@
|
||||
@@ -72,6 +72,23 @@
|
||||
return features;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user