New commits:
commit 180a488d95d895ca50aea7783a87eee3a403eae4
Author: Pavel Vinogradov <public AT sourcemaage.org>
Commit: Pavel Vinogradov <public AT sourcemaage.org>
http/firefox: version 89.0.2, SECURITY_PATCH++
commit 642bff6d1f0e1a66fa603da15bbae99841850660
Author: Pavel Vinogradov <public AT sourcemaage.org>
Commit: Pavel Vinogradov <public AT sourcemaage.org>
rust-crates/cbindgen: version 0.19.0
commit c13511a674d59877612f8fb44516681aac299c92
Author: Pavel Vinogradov <public AT sourcemaage.org>
Commit: Pavel Vinogradov <public AT sourcemaage.org>
mozilla.gpg: added 61B7B526D98F0353, "Mozilla Software Releases
<release AT mozilla.com>"
diff --git a/ChangeLog b/ChangeLog
index 94ea447..1965fd9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2021-07-04 Pavel Vinogradov <public AT sourcemage.org>
+ * mozilla.gpg: added 61B7B526D98F0353, "Mozilla Software Releases
<release AT mozilla.com>"
+
2021-07-03 Vlad Glagolev <stealth AT sourcemage.org>
* accounts, groups: added account data for boundary-bin spell
SOURCE_URL[0]="http://releases.mozilla.org/pub/${SPELL}/releases/${VERSION}/source/${SOURCE}"
SOURCE2="${SOURCE}.asc"
diff --git a/http/firefox/HISTORY b/http/firefox/HISTORY
index c2537d6..1b0b98c 100644
--- a/http/firefox/HISTORY
+++ b/http/firefox/HISTORY
@@ -1,3 +1,8 @@
+2021-07-04 Pavel Vinogradov <public AT sourcemage.org>
+ * DETAILS: version 89.0.2, SECURITY_PATCH++
+ * DEPENDS: reenabled icu, sqlite, graphite2 and harfbuzz; nss >= 3.64
+ * patches/*: updated
+
2020-12-31 Florian Franzmann <bwlf AT bandrate.org>
* mozconfig: set distribution id
diff --git a/http/firefox/patches/0001-Don-t-use-build-id.patch
b/http/firefox/patches/0001-Don-t-use-build-id.patch
new file mode 100644
index 0000000..e0b0d49
--- /dev/null
+++ b/http/firefox/patches/0001-Don-t-use-build-id.patch
@@ -0,0 +1,54 @@
+From a13f3e4baeb647cdabe4b73ac639cae16d9c42a4 Mon Sep 17 00:00:00 2001
+From: "Jory A. Pratt" <anarchy AT gentoo.org>
+Date: Mon, 6 Apr 2020 19:14:26 +0200
+Subject: [PATCH 01/37] Don't use build id
+
+We must drop build id as it causes conflicts when merging
+thunderbird/firefox/seamonkey on same system when using
+splitdebug.
+
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ js/src/old-configure.in | 7 -------
+ old-configure.in | 7 -------
+ 2 files changed, 14 deletions(-)
+
+diff --git a/js/src/old-configure.in b/js/src/old-configure.in
+index 636321f598..e848bd321e 100644
+--- a/js/src/old-configure.in
++++ b/js/src/old-configure.in
+@@ -361,13 +361,6 @@ if test "$GNU_CC"; then
+ AC_MSG_RESULT([no])
+ LDFLAGS=$_SAVE_LDFLAGS)
+
+- AC_MSG_CHECKING([for --build-id=sha1 option to ld])
+- _SAVE_LDFLAGS=$LDFLAGS
+- LDFLAGS="$LDFLAGS -Wl,--build-id=sha1"
+- AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
+- AC_MSG_RESULT([no])
+- LDFLAGS=$_SAVE_LDFLAGS)
+-
+ _DEFINES_CFLAGS="-include $jsconfdefs -DMOZILLA_CLIENT"
+ fi
+
+diff --git a/old-configure.in b/old-configure.in
+index a05ac13cd1..4ddc3f5b45 100644
+--- a/old-configure.in
++++ b/old-configure.in
+@@ -349,13 +349,6 @@ if test "$GNU_CC"; then
+ AC_MSG_RESULT([no])
+ LDFLAGS=$_SAVE_LDFLAGS)
+
+- AC_MSG_CHECKING([for --build-id=sha1 option to ld])
+- _SAVE_LDFLAGS=$LDFLAGS
+- LDFLAGS="$LDFLAGS -Wl,--build-id=sha1"
+- AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
+- AC_MSG_RESULT([no])
+- LDFLAGS=$_SAVE_LDFLAGS)
+-
+ AC_MSG_CHECKING([for --ignore-unresolved-symbol option to ld])
+ HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED=
+ _SAVE_LDFLAGS=$LDFLAGS
+--
+2.31.1
+
diff --git a/http/firefox/patches/0002-Fortify-sources-properly.patch
b/http/firefox/patches/0002-Fortify-sources-properly.patch
new file mode 100644
index 0000000..9f9079d
--- /dev/null
+++ b/http/firefox/patches/0002-Fortify-sources-properly.patch
@@ -0,0 +1,41 @@
+From abfce26e906bcb727320ef33294f4fa9102c1ade Mon Sep 17 00:00:00 2001
+From: "Jory A. Pratt" <anarchy AT gentoo.org>
+Date: Mon, 6 Apr 2020 19:16:36 +0200
+Subject: [PATCH 02/37] Fortify sources properly
+
+Ensure we fortify properly, features.h is pulled in via fortification.
+
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ config/system-headers.mozbuild | 1 -
+ third_party/sipcc/sdp_os_defs.h | 3 ---
+ 2 files changed, 4 deletions(-)
+
+diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
+index 6e017df20f..5f7b5bb23e 100644
+--- a/config/system-headers.mozbuild
++++ b/config/system-headers.mozbuild
+@@ -229,7 +229,6 @@ system_headers = [
+ 'execinfo.h',
+ 'extras.h',
+ 'fcntl.h',
+- 'features.h',
+ 'fenv.h',
+ 'ffi.h',
+ 'fibdef.h',
+diff --git a/third_party/sipcc/sdp_os_defs.h
b/third_party/sipcc/sdp_os_defs.h
+index 16c9b33329..df38d9336c 100644
+--- a/third_party/sipcc/sdp_os_defs.h
++++ b/third_party/sipcc/sdp_os_defs.h
+@@ -20,8 +20,5 @@
+ typedef uint8_t tinybool;
+ typedef unsigned short ushort;
+ typedef unsigned long ulong;
+-#ifndef __GNUC_STDC_INLINE__
+-#define inline
+-#endif
+
+ #endif /* _SDP_OS_DEFS_H_ */
+--
+2.31.1
+
diff --git a/http/firefox/patches/0003-Check-additional-plugins-dir.patch
b/http/firefox/patches/0003-Check-additional-plugins-dir.patch
new file mode 100644
index 0000000..e0977cb
--- /dev/null
+++ b/http/firefox/patches/0003-Check-additional-plugins-dir.patch
@@ -0,0 +1,58 @@
+From 13a73ac916e8ca4864d661f3bbb682ed7f55c25c Mon Sep 17 00:00:00 2001
+From: Arfrever Frehtes Taifersar Arahesis <Arfrever AT Apache.Org>
+Date: Mon, 6 Apr 2020 19:17:43 +0200
+Subject: [PATCH 03/37] Check additional plugins dir
+
+Check original plugins dir along with default plugins dir.
+
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ xpcom/io/nsAppFileLocationProvider.cpp | 18 +++++++++++++++++-
+ 1 file changed, 17 insertions(+), 1 deletion(-)
+
+diff --git a/xpcom/io/nsAppFileLocationProvider.cpp
b/xpcom/io/nsAppFileLocationProvider.cpp
+index ef974f9904..6261eafcc8 100644
+--- a/xpcom/io/nsAppFileLocationProvider.cpp
++++ b/xpcom/io/nsAppFileLocationProvider.cpp
+@@ -50,6 +50,7 @@
+ # define NS_MACOSX_LOCAL_PLUGIN_DIR "OSXLocalPlugins"
+ #elif XP_UNIX
+ # define NS_SYSTEM_PLUGINS_DIR "SysPlugins"
++# define NS_SYSTEM_NSBROWSER_PLUGINS_DIR "SysNsBrowserPlugins"
+ #endif
+
+ #define DEFAULTS_DIR_NAME "defaults"_ns
+@@ -172,6 +173,21 @@ nsAppFileLocationProvider::GetFile(const char* aProp,
bool* aPersistent,
+ getter_AddRefs(localFile));
+ # else
+ rv = NS_ERROR_FAILURE;
++# endif
++ } else if (nsCRT::strcmp(aProp, NS_SYSTEM_NSBROWSER_PLUGINS_DIR) == 0) {
++# ifdef ENABLE_SYSTEM_EXTENSION_DIRS
++ static const char* const sysLPlgDir =
++# if defined(HAVE_USR_LIB64_DIR) && defined(__LP64__)
++ "/usr/lib64/nsbrowser/plugins";
++# elif defined(__OpenBSD__) || defined(__FreeBSD__)
++ "/usr/local/lib/nsbrowser/plugins";
++# else
++ "/usr/lib/nsbrowser/plugins";
++# endif
++ rv = NS_NewNativeLocalFile(nsDependentCString(sysLPlgDir), false,
++ getter_AddRefs(localFile));
++# else
++ rv = NS_ERROR_FAILURE;
+ # endif
+ }
+ # endif
+@@ -418,7 +434,7 @@ nsAppFileLocationProvider::GetFiles(const char* aProp,
+ #else
+ # ifdef XP_UNIX
+ static const char* keys[] = {NS_USER_PLUGINS_DIR, NS_SYSTEM_PLUGINS_DIR,
+- nullptr};
++ NS_SYSTEM_NSBROWSER_PLUGINS_DIR, nullptr};
+ # else
+ static const char* keys[] = {NS_USER_PLUGINS_DIR, nullptr};
+ # endif
+--
+2.31.1
+
diff --git
a/http/firefox/patches/0004-bmo-847568-Support-system-harfbuzz.patch
b/http/firefox/patches/0004-bmo-847568-Support-system-harfbuzz.patch
new file mode 100644
index 0000000..c1d1878
--- /dev/null
+++ b/http/firefox/patches/0004-bmo-847568-Support-system-harfbuzz.patch
@@ -0,0 +1,183 @@
+From 0cd112325bbe3a31bb32ca36074203d6aeba20e5 Mon Sep 17 00:00:00 2001
+From: Thomas Deutschmann <whissi AT gentoo.org>
+Date: Mon, 6 Apr 2020 19:32:39 +0200
+Subject: [PATCH 04/37] bmo#847568: Support system harfbuzz
+
+Allow building against system-wide harfbuzz.
+
+Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=847568
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ config/system-headers.mozbuild | 7 +++++++
+ dom/base/moz.build | 3 +++
+ gfx/moz.build | 4 +++-
+ gfx/skia/generate_mozbuild.py | 3 +++
+ gfx/skia/moz.build | 3 +++
+ gfx/thebes/moz.build | 3 +++
+ intl/unicharutil/util/moz.build | 3 +++
+ netwerk/dns/moz.build | 3 +++
+ toolkit/library/moz.build | 3 +++
+ toolkit/moz.configure | 9 +++++++++
+ 10 files changed, 40 insertions(+), 1 deletion(-)
+
+diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
+index 5f7b5bb23e..449328ffaa 100644
+--- a/config/system-headers.mozbuild
++++ b/config/system-headers.mozbuild
+@@ -1236,6 +1236,13 @@ if CONFIG['OS_TARGET'] == 'Android':
+ 'vr/gvr/capi/include/gvr.h',
+ ]
+
++if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
++ system_headers += [
++ 'harfbuzz/hb-glib.h',
++ 'harfbuzz/hb-ot.h',
++ 'harfbuzz/hb.h',
++ ]
++
+ if CONFIG['MOZ_JACK']:
+ system_headers += [
+ 'jack/jack.h',
+diff --git a/dom/base/moz.build b/dom/base/moz.build
+index cadd80e624..4083d9c3fe 100644
+--- a/dom/base/moz.build
++++ b/dom/base/moz.build
+@@ -556,6 +556,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"]
++
+ GeneratedFile(
+ "UseCounterList.h",
+ script="gen-usecounters.py",
+diff --git a/gfx/moz.build b/gfx/moz.build
+index 6d6274e636..c9cb3d592a 100644
+--- a/gfx/moz.build
++++ b/gfx/moz.build
+@@ -13,6 +13,9 @@ with Files("wr/**"):
+ if CONFIG["MOZ_TREE_CAIRO"]:
+ DIRS += ["cairo"]
+
++if not CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
++ DIRS += ["harfbuzz/src"]
++
+ DIRS += [
+ "2d",
+ "ycbcr",
+@@ -22,7 +25,6 @@ DIRS += [
+ "gl",
+ "layers",
+ "graphite2/src",
+- "harfbuzz/src",
+ "ots/src",
+ "thebes",
+ "ipc",
+diff --git a/gfx/skia/generate_mozbuild.py b/gfx/skia/generate_mozbuild.py
+index d5c409b657..9ad751e321 100755
+--- a/gfx/skia/generate_mozbuild.py
++++ b/gfx/skia/generate_mozbuild.py
+@@ -98,6 +98,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 ('gtk', 'android'):
+ CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
+ CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
+diff --git a/gfx/skia/moz.build b/gfx/skia/moz.build
+index 66b21aec25..6f0c015d09 100755
+--- a/gfx/skia/moz.build
++++ b/gfx/skia/moz.build
+@@ -490,6 +490,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 ('gtk', 'android'):
+ CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
+ CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
+diff --git a/gfx/thebes/moz.build b/gfx/thebes/moz.build
+index c284127164..fb2ad5bf34 100644
+--- a/gfx/thebes/moz.build
++++ b/gfx/thebes/moz.build
+@@ -290,6 +290,9 @@ LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]
+
+ DEFINES["GRAPHITE2_STATIC"] = True
+
++if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
++ CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
++
+ if CONFIG["CC_TYPE"] == "clang":
+ # Suppress warnings from Skia header files.
+ SOURCES["gfxPlatform.cpp"].flags += ["-Wno-implicit-fallthrough"]
+diff --git a/intl/unicharutil/util/moz.build
b/intl/unicharutil/util/moz.build
+index 897bfad92a..5a83cdb2c1 100644
+--- a/intl/unicharutil/util/moz.build
++++ b/intl/unicharutil/util/moz.build
+@@ -25,6 +25,9 @@ UNIFIED_SOURCES += [
+ "nsUnicodeProperties.cpp",
+ ]
+
++if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
++ CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
++
+ GeneratedFile(
+ "BaseChars.h",
+ script="base_chars.py",
+diff --git a/netwerk/dns/moz.build b/netwerk/dns/moz.build
+index 31dd7c81b8..08bf561429 100644
+--- a/netwerk/dns/moz.build
++++ b/netwerk/dns/moz.build
+@@ -104,6 +104,9 @@ LOCAL_INCLUDES += [
+ "/netwerk/protocol/http",
+ ]
+
++if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
++ CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
++
+ USE_LIBS += ["icu"]
+
+ if CONFIG["CC_TYPE"] in ("clang", "gcc"):
+diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build
+index 94e5474248..3f393f3316 100644
+--- a/toolkit/library/moz.build
++++ b/toolkit/library/moz.build
+@@ -241,6 +241,9 @@ if CONFIG["MOZ_ANDROID_GOOGLE_VR"]:
+ OS_LIBS += CONFIG["MOZ_CAIRO_OSLIBS"]
+ OS_LIBS += CONFIG["MOZ_WEBRTC_X11_LIBS"]
+
++if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
++ OS_LIBS += CONFIG["MOZ_HARFBUZZ_LIBS"]
++
+ if CONFIG["MOZ_SYSTEM_JPEG"]:
+ OS_LIBS += CONFIG["MOZ_JPEG_LIBS"]
+
+diff --git a/toolkit/moz.configure b/toolkit/moz.configure
+index 0717b912ef..c934a661bd 100644
+--- a/toolkit/moz.configure
++++ b/toolkit/moz.configure
+@@ -475,6 +475,15 @@ add_old_configure_assignment(
+ "_HAVE_FREETYPE2", depends_if(freetype2_info)(lambda _: True)
+ )
+
++# HarfBuzz
++# ==============================================================
++option('--with-system-harfbuzz', help="Use system harfbuzz (located with
pkgconfig)")
++
++system_harfbuzz = pkg_check_modules('MOZ_HARFBUZZ', 'harfbuzz >= 2.7.4',
++ when='--with-system-harfbuzz')
++
++set_config('MOZ_SYSTEM_HARFBUZZ', depends_if(system_harfbuzz)(lambda _:
True))
++
+ # Apple platform decoder support
+ # ==============================================================
+ @depends(toolkit)
+--
+2.31.1
+
diff --git
a/http/firefox/patches/0005-bmo-847568-Support-system-graphite2.patch
b/http/firefox/patches/0005-bmo-847568-Support-system-graphite2.patch
new file mode 100644
index 0000000..41da670
--- /dev/null
+++ b/http/firefox/patches/0005-bmo-847568-Support-system-graphite2.patch
@@ -0,0 +1,208 @@
+From ffc7b194ef0fb5509d27a34063c52048912b8002 Mon Sep 17 00:00:00 2001
+From: Thomas Deutschmann <whissi AT gentoo.org>
+Date: Mon, 6 Apr 2020 19:34:44 +0200
+Subject: [PATCH 05/37] bmo#847568: Support system graphite2
+
+Allow building against system-wide graphite2.
+
+Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=847568
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ config/system-headers.mozbuild | 6 ++++++
+ gfx/graphite2/geckoextra/moz.build | 21 +++++++++++++++++++++
+ gfx/graphite2/moz-gr-update.sh | 7 ++++++-
+ gfx/moz.build | 6 +++++-
+ gfx/thebes/moz.build | 5 ++++-
+ old-configure.in | 21 +++++++++++++++++++++
+ toolkit/library/moz.build | 3 +++
+ toolkit/moz.configure | 13 +++++++++++++
+ 8 files changed, 79 insertions(+), 3 deletions(-)
+ create mode 100644 gfx/graphite2/geckoextra/moz.build
+
+diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
+index 449328ffaa..27b5171d0a 100644
+--- a/config/system-headers.mozbuild
++++ b/config/system-headers.mozbuild
+@@ -1243,6 +1243,12 @@ if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
+ 'harfbuzz/hb.h',
+ ]
+
++if CONFIG['MOZ_SYSTEM_GRAPHITE2']:
++ system_headers += [
++ 'graphite2/Font.h',
++ 'graphite2/Segment.h',
++ ]
++
+ if CONFIG['MOZ_JACK']:
+ system_headers += [
+ 'jack/jack.h',
+diff --git a/gfx/graphite2/geckoextra/moz.build
b/gfx/graphite2/geckoextra/moz.build
+new file mode 100644
+index 0000000000..24e8d7a032
+--- /dev/null
++++ b/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 a/gfx/graphite2/moz-gr-update.sh b/gfx/graphite2/moz-gr-update.sh
+index b91d9c161c..a97e6eb203 100755
+--- a/gfx/graphite2/moz-gr-update.sh
++++ b/gfx/graphite2/moz-gr-update.sh
+@@ -1,6 +1,7 @@
+ #!/bin/bash
+
+ # Script used to update the Graphite2 library in the mozilla source tree
++# and bump version for --with-system-graphite2
+
+ # This script lives in gfx/graphite2, along with the library source,
+ # but must be run from the top level of the mozilla-central tree.
+@@ -37,12 +38,16 @@ echo "See" $0 "for update procedure." >>
gfx/graphite2/README.mozilla
+ #find gfx/graphite2/ -name "*.cpp" -exec perl -p -i -e
"s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \;
+ #find gfx/graphite2/ -name "*.h" -exec perl -p -i -e
"s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \;
+
++# chase version for --with-system-graphite2
++perl -p -i -e "s/[0-9]+\,[0-9]+\,[0-9]+/$RELEASE/ and tr/./,/ \
++ if /GR2_VERSION_REQUIRE/" old-configure.in
++
+ # summarize what's been touched
+ echo Updated to $RELEASE.
+ echo Here is what changed in the gfx/graphite2 directory:
+ echo
+
+-hg stat gfx/graphite2
++hg stat old-configure.in gfx/graphite2
+
+ echo
+ echo If gfx/graphite2/src/files.mk has changed, please make corresponding
+diff --git a/gfx/moz.build b/gfx/moz.build
+index c9cb3d592a..2e822f0134 100644
+--- a/gfx/moz.build
++++ b/gfx/moz.build
+@@ -13,6 +13,11 @@ with Files("wr/**"):
+ if CONFIG["MOZ_TREE_CAIRO"]:
+ DIRS += ["cairo"]
+
++if CONFIG["MOZ_SYSTEM_GRAPHITE2"]:
++ DIRS += ["graphite2/geckoextra"]
++else:
++ DIRS += ["graphite2/src"]
++
+ if not CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
+ DIRS += ["harfbuzz/src"]
+
+@@ -24,7 +29,6 @@ DIRS += [
+ "qcms",
+ "gl",
+ "layers",
+- "graphite2/src",
+ "ots/src",
+ "thebes",
+ "ipc",
+diff --git a/gfx/thebes/moz.build b/gfx/thebes/moz.build
+index fb2ad5bf34..c6ce6f8417 100644
+--- a/gfx/thebes/moz.build
++++ b/gfx/thebes/moz.build
+@@ -288,7 +288,10 @@ if CONFIG["MOZ_WAYLAND"]:
+
+ LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]
+
+-DEFINES["GRAPHITE2_STATIC"] = True
++if CONFIG["MOZ_SYSTEM_GRAPHITE2"]:
++ CXXFLAGS += CONFIG["MOZ_GRAPHITE2_CFLAGS"]
++else:
++ DEFINES["GRAPHITE2_STATIC"] = True
+
+ if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
+ CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"]
+diff --git a/old-configure.in b/old-configure.in
+index 4ddc3f5b45..de727a48bd 100644
+--- a/old-configure.in
++++ b/old-configure.in
+@@ -2283,6 +2283,27 @@ if test "$USE_FC_FREETYPE"; then
+ fi
+ fi
+
++dnl ========================================================
++dnl Check for graphite2
++dnl ========================================================
++if test -n "$MOZ_SYSTEM_GRAPHITE2"; then
++ dnl graphite2.pc has bogus version, check manually
++ _SAVE_CFLAGS=$CFLAGS
++ CFLAGS="$CFLAGS $MOZ_GRAPHITE2_CFLAGS"
++ AC_TRY_COMPILE([ #include <graphite2/Font.h>
++ #define GR2_VERSION_REQUIRE(major,minor,bugfix) \
++ ( GR2_VERSION_MAJOR * 10000 +
GR2_VERSION_MINOR \
++ * 100 + GR2_VERSION_BUGFIX >= \
++ (major) * 10000 + (minor) * 100 + (bugfix) )
++ ], [
++ #if !GR2_VERSION_REQUIRE(1,3,8)
++ #error "Insufficient graphite2 version."
++ #endif
++ ], [],
++ [AC_MSG_ERROR([--with-system-graphite2 requested but no
working libgraphite2 found])])
++ CFLAGS=$_SAVE_CFLAGS
++fi
++
+ dnl ========================================================
+ dnl Check if we need the 32-bit Linux SSE2 error dialog
+ dnl ========================================================
+diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build
+index 3f393f3316..df178bc6cf 100644
+--- a/toolkit/library/moz.build
++++ b/toolkit/library/moz.build
+@@ -241,6 +241,9 @@ if CONFIG["MOZ_ANDROID_GOOGLE_VR"]:
+ OS_LIBS += CONFIG["MOZ_CAIRO_OSLIBS"]
+ OS_LIBS += CONFIG["MOZ_WEBRTC_X11_LIBS"]
+
++if CONFIG["MOZ_SYSTEM_GRAPHITE2"]:
++ OS_LIBS += CONFIG["MOZ_GRAPHITE2_LIBS"]
++
+ if CONFIG["MOZ_SYSTEM_HARFBUZZ"]:
+ OS_LIBS += CONFIG["MOZ_HARFBUZZ_LIBS"]
+
+diff --git a/toolkit/moz.configure b/toolkit/moz.configure
+index c934a661bd..0783019981 100644
+--- a/toolkit/moz.configure
++++ b/toolkit/moz.configure
+@@ -475,6 +475,19 @@ add_old_configure_assignment(
+ "_HAVE_FREETYPE2", depends_if(freetype2_info)(lambda _: True)
+ )
+
++# Graphite2
++# ==============================================================
++option('--with-system-graphite2', help="Use system graphite2 (located with
pkgconfig)")
++
++@depends('--with-system-graphite2')
++def check_for_graphite2(value):
++ return bool(value)
++
++system_graphite2 = pkg_check_modules('MOZ_GRAPHITE2', 'graphite2',
++ when=check_for_graphite2)
++
++set_config('MOZ_SYSTEM_GRAPHITE2', depends_if(system_graphite2)(lambda _:
True))
++
+ # HarfBuzz
+ # ==============================================================
+ option('--with-system-harfbuzz', help="Use system harfbuzz (located with
pkgconfig)")
+--
+2.31.1
+
diff --git a/http/firefox/patches/0006-bmo-1559213-Support-system-av1.patch
b/http/firefox/patches/0006-bmo-1559213-Support-system-av1.patch
new file mode 100644
index 0000000..b82d438
--- /dev/null
+++ b/http/firefox/patches/0006-bmo-1559213-Support-system-av1.patch
@@ -0,0 +1,114 @@
+From e09538bda8756e737af01edbd4aed9975280ca45 Mon Sep 17 00:00:00 2001
+From: Thomas Deutschmann <whissi AT gentoo.org>
+Date: Mon, 6 Apr 2020 19:36:02 +0200
+Subject: [PATCH 06/37] bmo#1559213: Support system av1
+
+Allow building against system-wide av1.
+
+Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1559213
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ config/external/moz.build | 5 +++--
+ config/system-headers.mozbuild | 8 ++++++++
+ dom/media/platforms/moz.build | 5 +++++
+ toolkit/moz.configure | 20 ++++++++++++++++++--
+ 4 files changed, 34 insertions(+), 4 deletions(-)
+
+diff --git a/config/external/moz.build b/config/external/moz.build
+index 4e9888f365..bf1e255107 100644
+--- a/config/external/moz.build
++++ b/config/external/moz.build
+@@ -40,8 +40,9 @@ if not CONFIG["MOZ_SYSTEM_LIBVPX"]:
+ external_dirs += ["media/libvpx"]
+
+ if CONFIG["MOZ_AV1"]:
+- external_dirs += ["media/libaom"]
+- external_dirs += ["media/libdav1d"]
++ if not CONFIG["MOZ_SYSTEM_AV1"]:
++ external_dirs += ["media/libaom"]
++ external_dirs += ["media/libdav1d"]
+
+ if not CONFIG["MOZ_SYSTEM_PNG"]:
+ external_dirs += ["media/libpng"]
+diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
+index 27b5171d0a..c6213f1d96 100644
+--- a/config/system-headers.mozbuild
++++ b/config/system-headers.mozbuild
+@@ -1300,6 +1300,14 @@ if CONFIG['MOZ_ENABLE_LIBPROXY']:
+ 'proxy.h',
+ ]
+
++if CONFIG['MOZ_SYSTEM_AV1']:
++ system_headers += [
++ 'aom/aom_decoder.h',
++ 'aom/aomdx.h',
++ 'aom/aom_image.h',
++ 'dav1d/dav1d.h',
++ ]
++
+ if CONFIG['MOZ_SYSTEM_LIBVPX']:
+ system_headers += [
+ 'vpx_mem/vpx_mem.h',
+diff --git a/dom/media/platforms/moz.build b/dom/media/platforms/moz.build
+index 16ca8a9cbc..b349dcbe6d 100644
+--- a/dom/media/platforms/moz.build
++++ b/dom/media/platforms/moz.build
+@@ -78,6 +78,11 @@ if CONFIG["MOZ_AV1"]:
+ "agnostic/AOMDecoder.cpp",
+ "agnostic/DAV1DDecoder.cpp",
+ ]
++ if CONFIG["MOZ_SYSTEM_AV1"]:
++ CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBAOM_CFLAGS"]
++ OS_LIBS += CONFIG["MOZ_SYSTEM_LIBAOM_LIBS"]
++ CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBDAV1D_CFLAGS"]
++ OS_LIBS += CONFIG["MOZ_SYSTEM_LIBDAV1D_LIBS"]
+
+ if CONFIG["MOZ_OMX"]:
+ EXPORTS += [
+diff --git a/toolkit/moz.configure b/toolkit/moz.configure
+index 0783019981..de0a44bf27 100644
+--- a/toolkit/moz.configure
++++ b/toolkit/moz.configure
+@@ -559,14 +559,29 @@ def av1(value):
+ if value:
+ return True
+
++option("--with-system-av1", help="Use system av1 (located with pkg-config)")
+
+-@depends(target, when=av1 & compile_environment)
++system_libaom_info = pkg_check_modules('MOZ_SYSTEM_LIBAOM', 'aom >= 1.0.0',
++ when='--with-system-av1')
++
++system_libdav1d_info = pkg_check_modules('MOZ_SYSTEM_LIBDAV1D', 'dav1d >=
0.1.1',
++ when='--with-system-av1')
++
++@depends(system_libaom_info, system_libdav1d_info)
++def system_av1(system_libaom_info, system_libdav1d_info):
++ has_av1_libs = False
++ if system_libaom_info and system_libdav1d_info:
++ has_av1_libs = True
++ return has_av1_libs
++
++
++@depends(target, when=av1 & depends(system_av1)(lambda v: not v) &
compile_environment)
+ def dav1d_asm(target):
+ if target.cpu in ("aarch64", "x86", "x86_64"):
+ return True
+
+
+-@depends(target, when=av1 & compile_environment)
++@depends(target, when=av1 & depends(system_av1)(lambda v: not v) &
compile_environment)
+ def dav1d_nasm(target):
+ if target.cpu in ("x86", "x86_64"):
+ return namespace(version="2.14", what="AV1")
+@@ -576,6 +591,7 @@ set_config("MOZ_DAV1D_ASM", dav1d_asm)
+ set_define("MOZ_DAV1D_ASM", dav1d_asm)
+ set_config("MOZ_AV1", av1)
+ set_define("MOZ_AV1", av1)
++set_config("MOZ_SYSTEM_AV1", depends_if(system_av1)(lambda _: True))
+
+ # Built-in fragmented MP4 support.
+ # ==============================================================
+--
+2.31.1
+
diff --git a/http/firefox/patches/0007-Support-sndio-audio-framework.patch
b/http/firefox/patches/0007-Support-sndio-audio-framework.patch
new file mode 100644
index 0000000..373d4a4
--- /dev/null
+++ b/http/firefox/patches/0007-Support-sndio-audio-framework.patch
@@ -0,0 +1,75 @@
+From 09703df20bed8110f898ea3101e2a4eceaeb0712 Mon Sep 17 00:00:00 2001
+From: Thomas Deutschmann <whissi AT gentoo.org>
+Date: Thu, 29 Apr 2021 18:54:42 +0200
+Subject: [PATCH 07/37] Support sndio audio framework
+
+Bug: https://bugs.gentoo.org/785613
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ build/moz.configure/old.configure | 1 +
+ media/libcubeb/src/moz.build | 4 +++-
+ old-configure.in | 17 +++++++++++++++++
+ 3 files changed, 21 insertions(+), 1 deletion(-)
+
+diff --git a/build/moz.configure/old.configure
b/build/moz.configure/old.configure
+index 35ab75df3a..134ecfb2b0 100644
+--- a/build/moz.configure/old.configure
++++ b/build/moz.configure/old.configure
+@@ -87,6 +87,7 @@ def old_configure_options(*options):
+ @old_configure_options(
+ "--cache-file",
+ "--datadir",
++ "--enable-sndio",
+ "--enable-crashreporter",
+ "--enable-dbus",
+ "--enable-debug-js-modules",
+diff --git a/media/libcubeb/src/moz.build b/media/libcubeb/src/moz.build
+index 872484c311..28994a693d 100644
+--- a/media/libcubeb/src/moz.build
++++ b/media/libcubeb/src/moz.build
+@@ -46,11 +46,13 @@ if CONFIG['OS_ARCH'] in ('DragonFly', 'FreeBSD',
'SunOS'):
+ ]
+ DEFINES['USE_OSS'] = True
+
+-if CONFIG['OS_ARCH'] == 'OpenBSD':
++if CONFIG['MOZ_SNDIO']:
+ SOURCES += [
+ 'cubeb_sndio.c',
+ ]
+ DEFINES['USE_SNDIO'] = True
++
++if CONFIG['OS_ARCH'] == 'OpenBSD':
+ DEFINES['DISABLE_LIBSNDIO_DLOPEN'] = True
+
+ if CONFIG['OS_TARGET'] == 'Darwin':
+diff --git a/old-configure.in b/old-configure.in
+index de727a48bd..f0ecc39961 100644
+--- a/old-configure.in
++++ b/old-configure.in
+@@ -2473,6 +2473,23 @@ fi
+ AC_SUBST(NECKO_WIFI)
+ AC_SUBST(NECKO_WIFI_DBUS)
+
++
++dnl ==================================
++dnl = Check sndio availability
++dnl ==================================
++
++MOZ_ARG_ENABLE_BOOL(sndio,
++[ --enable-sndio Enable sndio support],
++ MOZ_SNDIO=1,
++ MOZ_SNDIO=)
++
++if test -n "$MOZ_SNDIO"; then
++ MOZ_SNDIO_LIBS="-lsndio"
++ AC_SUBST_LIST(MOZ_SNDIO_LIBS)
++fi
++
++AC_SUBST(MOZ_SNDIO)
++
+ dnl ========================================================
+ dnl =
+ dnl = Maintainer debug option (no --enable equivalent)
+--
+2.31.1
+
diff --git
a/http/firefox/patches/0008-bmo-878089-Don-t-fail-when-TERM-is-not-set.patch
b/http/firefox/patches/0008-bmo-878089-Don-t-fail-when-TERM-is-not-set.patch
new file mode 100644
index 0000000..531ca09
--- /dev/null
+++
b/http/firefox/patches/0008-bmo-878089-Don-t-fail-when-TERM-is-not-set.patch
@@ -0,0 +1,36 @@
+From ea37aa3783c34119f13cc869cebe527030a696f4 Mon Sep 17 00:00:00 2001
+From: Thomas Deutschmann <whissi AT gentoo.org>
+Date: Mon, 6 Apr 2020 19:41:43 +0200
+Subject: [PATCH 08/37] bmo#878089: Don't fail when TERM is not set
+
+Link: https://github.com/erikrose/blessings/pull/137
+Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=878089
+Bug: https://bugs.gentoo.org/654316
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ third_party/python/blessings/blessings/__init__.py | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/third_party/python/blessings/blessings/__init__.py
b/third_party/python/blessings/blessings/__init__.py
+index 388cece0b8..1283460cc9 100644
+--- a/third_party/python/blessings/blessings/__init__.py
++++ b/third_party/python/blessings/blessings/__init__.py
+@@ -94,8 +94,13 @@ class Terminal(object):
+ # init sequences to the stream if it has a file descriptor, and
+ # send them to stdout as a fallback, since they have to go
+ # somewhere.
+- setupterm(kind or environ.get('TERM', 'unknown'),
+- self._init_descriptor)
++ try:
++ setupterm(kind or environ.get('TERM', 'dumb') or 'dumb',
++ self._init_descriptor)
++ except curses.error:
++ # There was an error setting up the terminal, either curses
is
++ # not supported or TERM is incorrectly set. Fall back to
dumb.
++ self._does_styling = False
+
+ self.stream = stream
+
+--
+2.31.1
+
diff --git a/http/firefox/patches/0009-bmo-1516803-Fix-building-sandbox.patch
b/http/firefox/patches/0009-bmo-1516803-Fix-building-sandbox.patch
new file mode 100644
index 0000000..e9852fb
--- /dev/null
+++ b/http/firefox/patches/0009-bmo-1516803-Fix-building-sandbox.patch
@@ -0,0 +1,28 @@
+From b91d735d3dc25dd4a5ab89c45fbf810dbdcba8a5 Mon Sep 17 00:00:00 2001
+From: Thomas Deutschmann <whissi AT gentoo.org>
+Date: Mon, 6 Apr 2020 19:44:28 +0200
+Subject: [PATCH 09/37] bmo#1516803: Fix building sandbox
+
+Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1516803
+Bug: https://bugs.gentoo.org/666580
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ security/sandbox/linux/moz.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/security/sandbox/linux/moz.build
b/security/sandbox/linux/moz.build
+index 29b53f12f7..31d2e24118 100644
+--- a/security/sandbox/linux/moz.build
++++ b/security/sandbox/linux/moz.build
+@@ -116,7 +116,7 @@ if CONFIG["CC_TYPE"] in ("clang", "gcc"):
+ # forcing there to be only one partition.
+ for f in CONFIG["OS_CXXFLAGS"]:
+ if f.startswith("-flto") and CONFIG["CC_TYPE"] != "clang":
+- LDFLAGS += ["--param lto-partitions=1"]
++ LDFLAGS += ["--param", "lto-partitions=1"]
+
+ DEFINES["NS_NO_XPCOM"] = True
+ DisableStlWrapping()
+--
+2.31.1
+
diff --git
a/http/firefox/patches/0010-Fix-building-spellchecker-when-using-GCC-and-PGO.patch
b/http/firefox/patches/0010-Fix-building-spellchecker-when-using-GCC-and-PGO.patch
new file mode 100644
index 0000000..f81849a
--- /dev/null
+++
b/http/firefox/patches/0010-Fix-building-spellchecker-when-using-GCC-and-PGO.patch
@@ -0,0 +1,27 @@
+From e5793d37db3c95bebbba1b9babededdb10282d1a Mon Sep 17 00:00:00 2001
+From: Thomas Deutschmann <whissi AT gentoo.org>
+Date: Mon, 6 Apr 2020 19:51:22 +0200
+Subject: [PATCH 10/37] Fix building spellchecker when using GCC and PGO
+
+Bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88561
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ extensions/spellcheck/src/moz.build | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/extensions/spellcheck/src/moz.build
b/extensions/spellcheck/src/moz.build
+index dcc1d54f74..06a2ad5a15 100644
+--- a/extensions/spellcheck/src/moz.build
++++ b/extensions/spellcheck/src/moz.build
+@@ -31,3 +31,8 @@ EXPORTS.mozilla += [
+
+ if CONFIG["CC_TYPE"] in ("clang", "gcc"):
+ CXXFLAGS += ["-Wno-error=shadow"]
++
++# spell checker triggers bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88561
++# in GCC 7 and 8. It will be fixed in GCC 7.5 and 8.3
++if CONFIG["CC_TYPE"] in ("gcc"):
++ CXXFLAGS += ["-fno-devirtualize"]
+--
+2.31.1
+
diff --git
a/http/firefox/patches/0011-bmo-1526653-Include-struct-definitions-for-user_vfp-.patch
b/http/firefox/patches/0011-bmo-1526653-Include-struct-definitions-for-user_vfp-.patch
new file mode 100644
index 0000000..366f5c8
--- /dev/null
+++
b/http/firefox/patches/0011-bmo-1526653-Include-struct-definitions-for-user_vfp-.patch
@@ -0,0 +1,38 @@
+From 2fc03ca254baa4d624a7b4b67656be94b63f89e9 Mon Sep 17 00:00:00 2001
+From: Thomas Deutschmann <whissi AT gentoo.org>
+Date: Mon, 6 Apr 2020 19:57:42 +0200
+Subject: [PATCH 11/37] bmo#1526653: Include struct definitions for user_vfp
+ and user_vfp_exc
+
+Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1526653
+Bug: https://bugs.gentoo.org/681036
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ js/src/wasm/WasmSignalHandlers.cpp | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/js/src/wasm/WasmSignalHandlers.cpp
b/js/src/wasm/WasmSignalHandlers.cpp
+index 37bc5a9c19..67b43ada29 100644
+--- a/js/src/wasm/WasmSignalHandlers.cpp
++++ b/js/src/wasm/WasmSignalHandlers.cpp
+@@ -252,7 +252,16 @@ using mozilla::DebugOnly;
+ #endif
+
+ #ifdef WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS
+-# include <sys/user.h>
++struct user_vfp {
++ unsigned long long fpregs[32];
++ unsigned long fpscr;
++};
++
++struct user_vfp_exc {
++ unsigned long fpexc;
++ unsigned long fpinst;
++ unsigned long fpinst2;
++};
+ #endif
+
+ #if defined(ANDROID)
+--
+2.31.1
+
diff --git
a/http/firefox/patches/0013-musl-Add-alternate-name-for-private-siginfo-struct-m.patch
b/http/firefox/patches/0013-musl-Add-alternate-name-for-private-siginfo-struct-m.patch
new file mode 100644
index 0000000..a00174a
--- /dev/null
+++
b/http/firefox/patches/0013-musl-Add-alternate-name-for-private-siginfo-struct-m.patch
@@ -0,0 +1,35 @@
+From 179237ec97ccfb589236400846e99d0e59d4919a Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel AT sholland.org>
+Date: Sun, 8 Jan 2017 19:16:38 -0600
+Subject: [PATCH 13/37] musl: Add alternate name for private siginfo struct
+ member
+
+musl does not provide a macro for detecting its presence. For now,
+assume that it is the only non-glibc-based libc on Linux systems.
+
+Signed-off-by: Samuel Holland <samuel AT sholland.org>
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ security/sandbox/chromium/sandbox/linux/seccomp-bpf/trap.cc | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/security/sandbox/chromium/sandbox/linux/seccomp-bpf/trap.cc
b/security/sandbox/chromium/sandbox/linux/seccomp-bpf/trap.cc
+index 9884be8bb2..86d8f88e30 100644
+--- a/security/sandbox/chromium/sandbox/linux/seccomp-bpf/trap.cc
++++ b/security/sandbox/chromium/sandbox/linux/seccomp-bpf/trap.cc
+@@ -174,7 +174,11 @@ void Trap::SigSys(int nr, LinuxSigInfo* info,
ucontext_t* ctx) {
+ // If the version of glibc doesn't include this information in
+ // siginfo_t (older than 2.17), we need to explicitly copy it
+ // into an arch_sigsys structure.
+- memcpy(&sigsys, &info->_sifields, sizeof(sigsys));
++#if defined(__GLIBC__)
++ memcpy(&sigsys, &info->_sifields, sizeof(sigsys));
++#else
++ memcpy(&sigsys, &info->__si_fields, sizeof(sigsys));
++#endif
+ #endif
+
+ #if defined(__mips__)
+--
+2.31.1
+
diff --git a/http/firefox/patches/0014-musl-Fix-syscall-wrappers.patch
b/http/firefox/patches/0014-musl-Fix-syscall-wrappers.patch
new file mode 100644
index 0000000..e4833ab
--- /dev/null
+++ b/http/firefox/patches/0014-musl-Fix-syscall-wrappers.patch
@@ -0,0 +1,42 @@
+From 47318a554b6f94f8ad46839ddeb70d95cb950c11 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel AT sholland.org>
+Date: Sun, 8 Jan 2017 19:19:23 -0600
+Subject: [PATCH 14/37] musl: Fix syscall wrappers
+
+musl defines p{read,write}64 to their non-suffixed equivalents to avoid
+duplication in its syscall wrappers. This breaks macro expansion here,
+leading to errors such as:
+
+In function size_t sys_pread64(int, void*, size_t, off_t):
+ error: '__NR_pread' was not declared in this scope
+
+The fix here is to undefine the p{read,write}64 macros, so the syscall
+expands to (e.g.) __NR_pread64 instead.
+
+Signed-off-by: Samuel Holland <samuel AT sholland.org>
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ .../src/third_party/lss/linux_syscall_support.h | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git
a/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h
b/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h
+index 1abe0ba5b0..d6087a1674 100644
+---
a/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h
++++
b/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h
+@@ -173,6 +173,13 @@ extern "C" {
+ # undef __NR_waitpid
+ #endif
+
++#ifdef pread64
++#undef pread64
++#endif
++#ifdef pwrite64
++#undef pwrite64
++#endif
++
+ /* As glibc often provides subtly incompatible data structures (and implicit
+ * wrapper functions that convert them), we provide our own kernel data
+ * structures for use by the system calls.
+--
+2.31.1
+
diff --git
a/http/firefox/patches/0015-musl-Only-use-system-heap-reporter-with-glibc.patch
b/http/firefox/patches/0015-musl-Only-use-system-heap-reporter-with-glibc.patch
new file mode 100644
index 0000000..0327f73
--- /dev/null
+++
b/http/firefox/patches/0015-musl-Only-use-system-heap-reporter-with-glibc.patch
@@ -0,0 +1,33 @@
+From f6577f5dcd75e65e58dd008edd2dc84dbd1a9624 Mon Sep 17 00:00:00 2001
+From: "Jory A. Pratt" <anarchy AT gentoo.org>
+Date: Mon, 6 Apr 2020 20:09:26 +0200
+Subject: [PATCH 15/37] musl: Only use system heap reporter with glibc
+
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ xpcom/base/nsMemoryReporterManager.cpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/xpcom/base/nsMemoryReporterManager.cpp
b/xpcom/base/nsMemoryReporterManager.cpp
+index 6aa934812f..ccb8d5255a 100644
+--- a/xpcom/base/nsMemoryReporterManager.cpp
++++ b/xpcom/base/nsMemoryReporterManager.cpp
+@@ -647,6 +647,7 @@ static bool InSharedRegion(mach_vm_address_t aAddr,
cpu_type_t aType) {
+ return NS_OK;
+ }
+
++#ifdef __GLIBC__
+ # define HAVE_SYSTEM_HEAP_REPORTER 1
+ // Windows can have multiple separate heaps, but we should not touch
non-default
+ // heaps because they may be destroyed at anytime while we hold a handle.
So we
+@@ -679,6 +680,7 @@ static bool InSharedRegion(mach_vm_address_t aAddr,
cpu_type_t aType) {
+ *aSizeOut = heapSize;
+ return NS_OK;
+ }
++#endif
+
+ struct SegmentKind {
+ DWORD mState;
+--
+2.31.1
+
diff --git
a/http/firefox/patches/0016-musl-Set-pthread-name-for-non-glibc-systems.patch
b/http/firefox/patches/0016-musl-Set-pthread-name-for-non-glibc-systems.patch
new file mode 100644
index 0000000..8cb83d7
--- /dev/null
+++
b/http/firefox/patches/0016-musl-Set-pthread-name-for-non-glibc-systems.patch
@@ -0,0 +1,29 @@
+From 6cf6da0082d9b01778e671c684659480e91537c7 Mon Sep 17 00:00:00 2001
+From: "Jory A. Pratt" <anarchy AT gentoo.org>
+Date: Mon, 6 Apr 2020 20:10:03 +0200
+Subject: [PATCH 16/37] musl: Set pthread name for non glibc systems
+
+Signed-off-by: Thomas Deutschmann <whissi AT gentoo.org>
+---
+ js/src/threading/posix/PosixThread.cpp | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/js/src/threading/posix/PosixThread.cpp
b/js/src/threading/posix/PosixThread.cpp
+index 35532e375b..983da45326 100644
+--- a/js/src/threading/posix/PosixThread.cpp
++++ b/js/src/threading/posix/PosixThread.cpp
+@@ -115,8 +115,10 @@ void ThisThread::SetName(const char* name) {
+ rv = 0;
+ #elif defined(__NetBSD__)
+ rv = pthread_setname_np(pthread_self(), "%s", (void*)name);
+-#else
++#elif defined(__GLIBC__)
+ rv = pthread_setname_np(pthread_self(), name);
++#else
++ rv = 0;
+ #endif
+ MOZ_RELEASE_ASSERT(!rv);
+ }
+--
+2.31.1
+
diff --git
a/http/firefox/patches/0017-musl-getcontext-is-only-avaliable-on-glibc-systems.patch