#!/bin/sh # This is a shell archive echo x librewolf mkdir -p librewolf > /dev/null 2>&1 echo x librewolf/Makefile sed 's/^X//' > librewolf/Makefile << 'SHAR_END' XPORTNAME= librewolf XDISTVERSION= 108.0.1-1 XCATEGORIES= www wayland XMASTER_SITES= https://gitlab.com/api/v4/projects/32320088/packages/generic/librewolf-source/${DISTVERSION}/ XDISTNAME= ${PORTNAME}-${DISTVERSION}.source. XEXTRACT_SUFX= tar.gz X XPATCH_SITES= https://gitlab.com/librewolf-community/browser/source/-/raw/${DISTVERSION}/ XPATCHFILES= patches/unity-menubar.patch?inline=false:-p1 X XMAINTAINER= freebsd@sysctl.cz XCOMMENT= Custom version of Firefox, focused on privacy, security and freedom XWWW= https://librewolf.net/ X XBUILD_DEPENDS= nspr>=4.32:devel/nspr \ X nss>=3.84:security/nss \ X icu>=71.1:devel/icu \ X libevent>=2.1.8:devel/libevent \ X harfbuzz>=4.4.1:print/harfbuzz \ X graphite2>=1.3.14:graphics/graphite2 \ X png>=1.6.37:graphics/png \ X dav1d>=1.0.0:multimedia/dav1d \ X libvpx>=1.12.0:multimedia/libvpx \ X ${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR} \ X v4l_compat>0:multimedia/v4l_compat \ X autoconf2.13:devel/autoconf2.13 \ X nasm:devel/nasm \ X yasm:devel/yasm \ X zip:archivers/zip X X.include X.if ${ARCH} != powerpc64 XBUILD_DEPENDS+= ${LOCALBASE}/share/wasi-sysroot/lib/wasm32-wasi/libc++abi.a:devel/wasi-libcxx \ X ${LOCALBASE}/share/wasi-sysroot/lib/wasm32-wasi/libc.a:devel/wasi-libc \ X ${LOCALBASE}/llvm${LLVM_DEFAULT}/lib/clang/${LLVM_VERSION}/lib/wasi/libclang_rt.builtins-wasm32.a:devel/wasi-compiler-rt${LLVM_DEFAULT} X.endif X XUSES= tar:xz XUSE_GECKO= gecko XCONFLICTS_INSTALL= firefox-esr firefox XUSE_MOZILLA= -sqlite XCFLAGS_powerpc64le= -DSQLITE_BYTEORDER=1234 X# work around bindgen not finding ICU, e.g. X# dist/include/mozilla/intl/ICU4CGlue.h:8:10: fatal error: 'unicode/uenum.h' file not found, err: true XCONFIGURE_ENV+= BINDGEN_CFLAGS="-I${LOCALBASE}/include" XCONFIGURE_ENV+= MOZ_REQUIRE_SIGNING="" XMOZ_OPTIONs= --enable-application=browser \ X --allow-addon-sideload \ X --disable-crashreporter \ X --disable-debug \ X --disable-default-browser-agent \ X --disable-tests \ X --disable-updater \ X --enable-hardening \ X --enable-optimize \ X --enable-release \ X --enable-rust-simd \ X --with-app-name=librewolf \ X --with-branding=browser/branding/librewolf \ X --with-unsigned-addon-scopes=app,system \ X --with-l10n-base=$PWD/browser/locales/l10n \ X --enable-bootstrap \ X MOZ_CRASHREPORTER=0 \ X MOZ_DATA_REPORTING=0 \ X MOZ_SERVICES_HEALTHREPORT=0 \ X MOZ_TELEMETRY_REPORTING="" \ X MOZ_APP_DISPLAYNAME="Librewolf" \ X MOZ_APP_NAME="Librewolf" X X# helpful when testing beta XWRKSRC= ${WRKDIR}/${PORTNAME}-${DISTVERSION} X XFIREFOX_ICON= ${MOZILLA}.png XFIREFOX_ICON_SRC= ${PREFIX}/lib/${MOZILLA}/browser/chrome/icons/default/default48.png XFIREFOX_DESKTOP= ${MOZSRC}/taskcluster/docker/firefox-snap/firefox.desktop X X.include X.if ${ARCH} == powerpc64 XMOZ_OPTIONS+= --disable-webrtc --without-wasm-sandboxed-libraries X.else XBUILD_DEPENDS+= ${LOCALBASE}/share/wasi-sysroot/lib/wasm32-wasi/libc++abi.a:devel/wasi-libcxx \ X ${LOCALBASE}/share/wasi-sysroot/lib/wasm32-wasi/libc.a:devel/wasi-libc \ X ${LOCALBASE}/llvm${LLVM_DEFAULT}/lib/clang/${LLVM_VERSION}/lib/wasi/libclang_rt.builtins-wasm32.a:devel/wasi-compiler-rt${LLVM_DEFAULT} XMOZ_OPTIONS+= --with-wasi-sysroot=${LOCALBASE}/share/wasi-sysroot X.endif X Xpost-patch: X @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ X ${WRKSRC}/browser/app/nsBrowserApp.cpp X @${RM} ${WRKSRC}/mozconfig X @${REINPLACE_CMD} -e 's|nsNativeMenuDocListener::NodeWillBeDestroyed(const nsINode \*aNode)|nsNativeMenuDocListener::NodeWillBeDestroyed(nsINode \*aNode)|g' \ X ${WRKSRC}/widget/gtk/nsNativeMenuDocListener.cpp X Xpost-install: X ${INSTALL_DATA} ${FIREFOX_DESKTOP} ${STAGEDIR}${PREFIX}/share/applications/ X ${MKDIR} ${STAGEDIR}${PREFIX}/share/pixmaps X ${LN} -sf ${FIREFOX_ICON_SRC} ${STAGEDIR}${PREFIX}/share/pixmaps/${FIREFOX_ICON} X X.include SHAR_END echo x librewolf/distinfo sed 's/^X//' > librewolf/distinfo << 'SHAR_END' XTIMESTAMP = 1671356421 XSHA256 (librewolf-108.0.1-1.source.tar.gz) = d1978f870ebddbcb71e92da9887e6de99818c4d8045642c46a5b3d2e2b970e81 XSIZE (librewolf-108.0.1-1.source.tar.gz) = 828438372 XSHA256 (patches/unity-menubar.patch?inline=false) = 84c03a4eb5dcc1bb9e2cfc343e0b98bbbc8dc791647747082d3f50ba638de965 XSIZE (patches/unity-menubar.patch?inline=false) = 163635 SHAR_END echo x librewolf/pkg-descr sed 's/^X//' > librewolf/pkg-descr << 'SHAR_END' XLibreWolf is a free and open source web browser descended from the XMozilla Application Suite. It is small, fast and easy to use, and offers Xmany advanced features: X X o Popup Blocking X o Tabbed Browsing X o Live Bookmarks (ie. RSS) X o Extensions X o Themes X o FastFind X o Improved Security X XWWW: https://librewolf-community.gitlab.io/ SHAR_END echo x librewolf/pkg-message sed 's/^X//' > librewolf/pkg-message << 'SHAR_END' X[ X{ type: install X message: <> .ssh/authorized_keys" X XThe SSH server on `remote_host` must allow pub key authentication. XEOM X} X] SHAR_END echo x librewolf/files mkdir -p librewolf/files > /dev/null 2>&1 echo x librewolf/files/patch-bug847568 sed 's/^X//' > librewolf/files/patch-bug847568 << 'SHAR_END' X# Allow building against system-wide graphite2/harfbuzz. X Xdiff --git config/system-headers.mozbuild config/system-headers.mozbuild Xindex a1b58eb..a0a0943 100644 X--- config/system-headers.mozbuild X+++ config/system-headers.mozbuild X@@ -1289,6 +1289,19 @@ if CONFIG['MOZ_ENABLE_LIBPROXY']: X 'proxy.h', X ] X X+if CONFIG['MOZ_SYSTEM_GRAPHITE2']: X+ system_headers += [ X+ 'graphite2/Font.h', X+ 'graphite2/Segment.h', X+ ] X+ X+if CONFIG['MOZ_SYSTEM_HARFBUZZ']: X+ system_headers += [ X+ 'harfbuzz/hb-glib.h', X+ 'harfbuzz/hb-ot.h', X+ 'harfbuzz/hb.h', X+ ] X+ X if CONFIG['MOZ_SYSTEM_LIBVPX']: X system_headers += [ X 'vpx_mem/vpx_mem.h', Xdiff --git dom/base/moz.build dom/base/moz.build Xindex d390adf..4508f19 100644 X--- dom/base/moz.build X+++ dom/base/moz.build X@@ -576,6 +576,9 @@ FINAL_LIBRARY = "xul" X if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": X CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"] X X+if CONFIG["MOZ_SYSTEM_HARFBUZZ"]: X+ CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"] X+ X GeneratedFile( X "UseCounterList.h", X script="gen-usecounters.py", Xdiff --git gfx/graphite2/geckoextra/moz.build gfx/graphite2/geckoextra/moz.build Xnew file mode 100644 Xindex 0000000..24e8d7a X--- /dev/null X+++ gfx/graphite2/geckoextra/moz.build X@@ -0,0 +1,21 @@ X+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- X+# vim: set filetype=python: X+# This Source Code Form is subject to the terms of the Mozilla Public X+# License, v. 2.0. If a copy of the MPL was not distributed with this X+# file, You can obtain one at http://mozilla.org/MPL/2.0/. X+ X+EXPORTS.graphite2 += [ X+ 'include/GraphiteExtra.h', X+ 'include/GraphiteStructsForRLBox.h', X+] X+ X+UNIFIED_SOURCES += [ X+ '../geckoextra/src/GraphiteExtra.cpp', X+] X+ X+CXXFLAGS += CONFIG['MOZ_GRAPHITE2_CFLAGS'] X+ X+# Match bundled graphite2 configuration X+AllowCompilerWarnings() X+ X+FINAL_LIBRARY = 'gkmedias' Xdiff --git gfx/graphite2/moz-gr-update.sh gfx/graphite2/moz-gr-update.sh Xindex b91d9c1..a97e6eb 100755 X--- gfx/graphite2/moz-gr-update.sh X+++ gfx/graphite2/moz-gr-update.sh X@@ -1,6 +1,7 @@ X #!/bin/bash X X # Script used to update the Graphite2 library in the mozilla source tree X+# and bump version for --with-system-graphite2 X X # This script lives in gfx/graphite2, along with the library source, X # but must be run from the top level of the mozilla-central tree. X@@ -37,12 +38,16 @@ echo "See" $0 "for update procedure." >> gfx/graphite2/README.mozilla X #find gfx/graphite2/ -name "*.cpp" -exec perl -p -i -e "s///;s/Windows.h/windows.h/;" {} \; X #find gfx/graphite2/ -name "*.h" -exec perl -p -i -e "s///;s/Windows.h/windows.h/;" {} \; X X+# chase version for --with-system-graphite2 X+perl -p -i -e "s/[0-9]+\,[0-9]+\,[0-9]+/$RELEASE/ and tr/./,/ \ X+ if /GR2_VERSION_REQUIRE/" old-configure.in X+ X # summarize what's been touched X echo Updated to $RELEASE. X echo Here is what changed in the gfx/graphite2 directory: X echo X X-hg stat gfx/graphite2 X+hg stat old-configure.in gfx/graphite2 X X echo X echo If gfx/graphite2/src/files.mk has changed, please make corresponding Xdiff --git gfx/harfbuzz/README-mozilla gfx/harfbuzz/README-mozilla Xindex 3180257..4587a3b 100644 X--- gfx/harfbuzz/README-mozilla X+++ gfx/harfbuzz/README-mozilla X@@ -21,3 +21,8 @@ from within the gfx/harfbuzz directory. X X If the collection of source files changes, manual updates to moz.build may be X needed as we don't use the upstream makefiles. X+ X+The in-tree copy may be omitted during build by --with-system-harfbuzz. X+Make sure to keep pkg-config version check within toolkit/moz.configure in sync X+with checkout version or increment latest tag by one if it's not based X+on upstream release. Xdiff --git gfx/moz.build gfx/moz.build Xindex 4d6d63d..cd57b0c 100644 X--- gfx/moz.build X+++ gfx/moz.build X@@ -10,6 +10,14 @@ with Files("**"): X with Files("wr/**"): X BUG_COMPONENT = ("Core", "Graphics: WebRender") X X+if CONFIG["MOZ_SYSTEM_GRAPHITE2"]: X+ DIRS += ["graphite2/geckoextra"] X+else: X+ DIRS += ["graphite2/src" ] X+ X+if not CONFIG["MOZ_SYSTEM_HARFBUZZ"]: X+ DIRS += ["harfbuzz/src"] X+ X DIRS += [ X "cairo", X "2d", X@@ -19,8 +27,6 @@ DIRS += [ X "qcms", X "gl", X "layers", X- "graphite2/src", X- "harfbuzz/src", X "ots/src", X "thebes", X "ipc", Xdiff --git gfx/skia/generate_mozbuild.py gfx/skia/generate_mozbuild.py Xindex 5e0fd17..860b80a 100755 X--- gfx/skia/generate_mozbuild.py X+++ gfx/skia/generate_mozbuild.py X@@ -96,6 +96,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'): X '-Wno-unused-private-field', X ] X X+if CONFIG['MOZ_SYSTEM_HARFBUZZ']: X+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] X+ X if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk', 'android'): X LOCAL_INCLUDES += [ X "/gfx/cairo/cairo/src", Xdiff --git gfx/skia/moz.build gfx/skia/moz.build Xindex 524bd28..615c93b 100755 X--- gfx/skia/moz.build X+++ gfx/skia/moz.build X@@ -488,6 +488,9 @@ if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'): X '-Wno-unused-private-field', X ] X X+if CONFIG['MOZ_SYSTEM_HARFBUZZ']: X+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] X+ X if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk', 'android'): X LOCAL_INCLUDES += [ X "/gfx/cairo/cairo/src", Xdiff --git gfx/thebes/moz.build gfx/thebes/moz.build Xindex baa6f09..4f02a9e 100644 X--- gfx/thebes/moz.build X+++ gfx/thebes/moz.build X@@ -286,7 +286,13 @@ if CONFIG["MOZ_WAYLAND"]: X X LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"] X X-DEFINES["GRAPHITE2_STATIC"] = True X+if CONFIG["MOZ_SYSTEM_GRAPHITE2"]: X+ CXXFLAGS += CONFIG["MOZ_GRAPHITE2_CFLAGS"] X+else: X+ DEFINES["GRAPHITE2_STATIC"] = True X+ X+if CONFIG["MOZ_SYSTEM_HARFBUZZ"]: X+ CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"] X X if CONFIG["CC_TYPE"] == "clang": X # Suppress warnings from Skia header files. Xdiff --git intl/unicharutil/util/moz.build intl/unicharutil/util/moz.build Xindex 301eb9a..7cece5e 100644 X--- intl/unicharutil/util/moz.build X+++ intl/unicharutil/util/moz.build X@@ -25,6 +25,9 @@ UNIFIED_SOURCES += [ X "nsUnicodeProperties.cpp", X ] X X+if CONFIG["MOZ_SYSTEM_HARFBUZZ"]: X+ CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"] X+ X include("/ipc/chromium/chromium-config.mozbuild") X X GeneratedFile( Xdiff --git netwerk/dns/moz.build netwerk/dns/moz.build Xindex f769e27..315bdd4 100644 X--- netwerk/dns/moz.build X+++ netwerk/dns/moz.build X@@ -102,6 +102,9 @@ GeneratedFile( X "etld_data.inc", script="prepare_tlds.py", inputs=["effective_tld_names.dat"] X ) X X+if CONFIG["MOZ_SYSTEM_HARFBUZZ"]: X+ CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"] X+ X # need to include etld_data.inc X LOCAL_INCLUDES += [ X "/netwerk/base", Xdiff --git old-configure.in old-configure.in Xindex d147957..d332b34 100644 X--- old-configure.in X+++ old-configure.in X@@ -1335,6 +1335,27 @@ fi X AC_DEFINE_UNQUOTED(MOZ_MACBUNDLE_ID,$MOZ_MACBUNDLE_ID) X AC_SUBST(MOZ_MACBUNDLE_ID) X X+dnl ======================================================== X+dnl Check for graphite2 X+dnl ======================================================== X+if test -n "$MOZ_SYSTEM_GRAPHITE2"; then X+ dnl graphite2.pc has bogus version, check manually X+ _SAVE_CFLAGS=$CFLAGS X+ CFLAGS="$CFLAGS $MOZ_GRAPHITE2_CFLAGS" X+ AC_TRY_COMPILE([ #include X+ #define GR2_VERSION_REQUIRE(major,minor,bugfix) \ X+ ( GR2_VERSION_MAJOR * 10000 + GR2_VERSION_MINOR \ X+ * 100 + GR2_VERSION_BUGFIX >= \ X+ (major) * 10000 + (minor) * 100 + (bugfix) ) X+ ], [ X+ #if !GR2_VERSION_REQUIRE(1,3,14) X+ #error "Insufficient graphite2 version." X+ #endif X+ ], [], X+ [AC_MSG_ERROR([--with-system-graphite2 requested but no working libgraphite2 found])]) X+ CFLAGS=$_SAVE_CFLAGS X+fi X+ X dnl ======================================================== X dnl = Child Process Name for IPC X dnl ======================================================== Xdiff --git toolkit/library/moz.build toolkit/library/moz.build Xindex 2c3f869..e8a9d23 100644 X--- toolkit/library/moz.build X+++ toolkit/library/moz.build X@@ -269,6 +269,12 @@ if CONFIG["MOZ_SYSTEM_PNG"]: X if CONFIG["MOZ_SYSTEM_WEBP"]: X OS_LIBS += CONFIG["MOZ_WEBP_LIBS"] X X+if CONFIG["MOZ_SYSTEM_GRAPHITE2"]: X+ OS_LIBS += CONFIG["MOZ_GRAPHITE2_LIBS"] X+ X+if CONFIG["MOZ_SYSTEM_HARFBUZZ"]: X+ OS_LIBS += CONFIG["MOZ_HARFBUZZ_LIBS"] X+ X if CONFIG["MOZ_SYSTEM_LIBEVENT"]: X OS_LIBS += CONFIG["MOZ_LIBEVENT_LIBS"] X Xdiff --git toolkit/moz.configure toolkit/moz.configure Xindex 0069865..9bb1864 100644 X--- toolkit/moz.configure X+++ toolkit/moz.configure X@@ -1058,6 +1058,25 @@ def geckodriver_default(enable_tests, target, cross_compile, hazard, asan, autom X return False X return True X X+# Graphite2 X+# ============================================================== X+option("--with-system-graphite2", X+ help="Use system graphite2 (located with pkgconfig)") X+ X+system_graphite2 = pkg_check_modules("MOZ_GRAPHITE2", "graphite2", X+ when="--with-system-graphite2") X+ X+set_config("MOZ_SYSTEM_GRAPHITE2", depends_if(system_graphite2)(lambda _: True)) X+ X+# HarfBuzz X+# ============================================================== X+option("--with-system-harfbuzz", X+ help="Use system harfbuzz (located with pkgconfig)") X+ X+system_harfbuzz = pkg_check_modules("MOZ_HARFBUZZ", "harfbuzz >= 2.7.4", X+ when="--with-system-harfbuzz") X+ X+set_config("MOZ_SYSTEM_HARFBUZZ", depends_if(system_harfbuzz)(lambda _: True)) X X option( X "--enable-geckodriver", SHAR_END echo x librewolf/files/patch-bug1269654_comment5 sed 's/^X//' > librewolf/files/patch-bug1269654_comment5 << 'SHAR_END' Xhttps://bugzilla.mozilla.org/show_bug.cgi?id=1269654#c5 Xhttps://bug1269654.bmoattachments.org/attachment.cgi?id=8749234 Xhandle big-endian formats in Cairo format conversions X X# HG changeset patch X# User Lee Salzman X# Date 1462463631 14400 X# Thu May 05 11:53:51 2016 -0400 X# Node ID 8da374804a09977c8f89af5e6e0cb37cb074595d X# Parent 29662e28a9c93ac67ee0b8ddfb65a9f29bbf73f5 Xhandle big-endian formats in Cairo format conversions X X--- gfx/2d/HelpersCairo.h.orig 2019-12-02 17:51:16.633474000 +0100 X+++ gfx/2d/HelpersCairo.h 2019-12-02 17:52:44.939998000 +0100 X@@ -147,7 +147,14 @@ static inline cairo_format_t GfxFormatToCairoFormat(Su X case SurfaceFormat::R5G6B5_UINT16: X return CAIRO_FORMAT_RGB16_565; X default: X- gfxCriticalError() << "Unknown image format " << (int)format; X+ // _UINT32 formats don't match B8G8R8[AX]8 on big-endian platforms, X+ // and Moz2d uses B8G8R8[AX]8 as if it was _UINT32. X+ // See bug 1269654 X+ if (format == SurfaceFormat::B8G8R8X8) { X+ return CAIRO_FORMAT_RGB24; X+ } else if (format != SurfaceFormat::B8G8R8A8) { X+ gfxCriticalError() << "Unknown image format " << (int)format; X+ } X return CAIRO_FORMAT_ARGB32; X } X } X@@ -177,7 +184,11 @@ static inline cairo_content_t GfxFormatToCairoContent( X case SurfaceFormat::A8: X return CAIRO_CONTENT_ALPHA; X default: X- gfxCriticalError() << "Unknown image content format " << (int)format; X+ if (format == SurfaceFormat::B8G8R8X8) { X+ return CAIRO_CONTENT_COLOR; X+ } else if (format != SurfaceFormat::B8G8R8A8) { X+ gfxCriticalError() << "Unknown image content format " << (int)format; X+ } X return CAIRO_CONTENT_COLOR_ALPHA; X } X } SHAR_END echo x librewolf/files/patch-bug1504834_comment5 sed 's/^X//' > librewolf/files/patch-bug1504834_comment5 << 'SHAR_END' Xhttps://bugzilla.mozilla.org/show_bug.cgi?id=1504834#c5 Xhttps://bugzilla.mozilla.org/attachment.cgi?id=9028600 XRough progress patch X X Xdiff --git gfx/2d/DrawTargetSkia.cpp gfx/2d/DrawTargetSkia.cpp Xindex 6bbef8d..82b04ba 100644 X--- gfx/2d/DrawTargetSkia.cpp X+++ gfx/2d/DrawTargetSkia.cpp X@@ -154,8 +154,7 @@ static IntRect CalculateSurfaceBounds(const IntSize& aSize, const Rect* aBounds, X return surfaceBounds.Intersect(bounds); X } X X-static const int kARGBAlphaOffset = X- SurfaceFormat::A8R8G8B8_UINT32 == SurfaceFormat::B8G8R8A8 ? 3 : 0; X+static const int kARGBAlphaOffset = 0; X X static bool VerifyRGBXFormat(uint8_t* aData, const IntSize& aSize, X const int32_t aStride, SurfaceFormat aFormat) { Xdiff --git gfx/2d/Types.h gfx/2d/Types.h Xindex 6b3bdc7..7c6c342 100644 X--- gfx/2d/Types.h X+++ gfx/2d/Types.h X@@ -90,15 +90,8 @@ enum class SurfaceFormat : int8_t { X // The following values are endian-independent synonyms. The _UINT32 suffix X // indicates that the name reflects the layout when viewed as a uint32_t X // value. X-#if MOZ_LITTLE_ENDIAN() X A8R8G8B8_UINT32 = B8G8R8A8, // 0xAARRGGBB X X8R8G8B8_UINT32 = B8G8R8X8, // 0x00RRGGBB X-#elif MOZ_BIG_ENDIAN() X- A8R8G8B8_UINT32 = A8R8G8B8, // 0xAARRGGBB X- X8R8G8B8_UINT32 = X8R8G8B8, // 0x00RRGGBB X-#else X-# error "bad endianness" X-#endif X X // The following values are OS and endian-independent synonyms. X // Xdiff --git gfx/skia/skia/third_party/skcms/skcms.cc gfx/skia/skia/third_party/skcms/skcms.cc Xindex 6b4d87b..7c0559d 100644 X--- gfx/skia/skia/third_party/skcms/skcms.cc X+++ gfx/skia/skia/third_party/skcms/skcms.cc X@@ -30,6 +30,8 @@ X #include X #include X #endif X+#else X+ #define SKCMS_PORTABLE X #endif X X // sizeof(x) will return size_t, which is 32-bit on some machines and 64-bit on others. X@@ -280,20 +282,28 @@ enum { X static uint16_t read_big_u16(const uint8_t* ptr) { X uint16_t be; X memcpy(&be, ptr, sizeof(be)); X-#if defined(_MSC_VER) X- return _byteswap_ushort(be); X+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ X+ return be; X #else X+ #if defined(_MSC_VER) X+ return _byteswap_ushort(be); X+ #else X return __builtin_bswap16(be); X+ #endif X #endif X } X X static uint32_t read_big_u32(const uint8_t* ptr) { X uint32_t be; X memcpy(&be, ptr, sizeof(be)); X-#if defined(_MSC_VER) X- return _byteswap_ulong(be); X+#if __BYTE_ORDER == __ORDER_BIG_ENDIAN__ X+ return be; X #else X+ #if defined(_MSC_VER) X+ return _byteswap_ulong(be); X+ #else X return __builtin_bswap32(be); X+ #endif X #endif X } X SHAR_END echo x librewolf/files/patch-bug1504834_comment9 sed 's/^X//' > librewolf/files/patch-bug1504834_comment9 << 'SHAR_END' Xhttps://bugzilla.mozilla.org/show_bug.cgi?id=1504834#c9 Xhttps://bugzilla.mozilla.org/attachment.cgi?id=9111146 Xmozilla-bmo1504834-part3.patch X X X# HG changeset patch X# Parent aecb4600e5da17443b224c79eee178c1d8e155e3 XFor FF68, AntiAliasing of XULTexts seem to be broken on big endian (s390x). Text and icons of the sandwich-menu to the Xright of the address bar, as well as plugin-windows appears transparant, which usually means unreadable (white on white). X Xdiff -r aecb4600e5da gfx/skia/skia/include/private/SkNx.h X--- gfx/skia/skia/include/private/SkNx.h Tue Aug 20 09:46:55 2019 +0200 X+++ gfx/skia/skia/include/private/SkNx.h Mon Sep 09 10:04:06 2019 +0200 X@@ -238,7 +238,18 @@ X AI SkNx operator*(const SkNx& y) const { return fVal * y.fVal; } X AI SkNx operator/(const SkNx& y) const { return fVal / y.fVal; } X X+ // On Big endian the commented out variant doesn't work, X+ // and honestly, I have no idea why it exists in the first place. X+ // The reason its broken is, I think, that it defaults to the double-variant of ToBits() X+ // which gets a 64-bit integer, and FromBits returns 32-bit, X+ // cutting off the wrong half again. X+ // Overall, I see no reason to have ToBits and FromBits at all (even for floats/doubles). X+ // Still we are only "fixing" this for big endian and leave little endian alone (never touch a running system) X+#ifdef SK_CPU_BENDIAN X+ AI SkNx operator&(const SkNx& y) const { return fVal & y.fVal; } X+#else X AI SkNx operator&(const SkNx& y) const { return FromBits(ToBits(fVal) & ToBits(y.fVal)); } X+#endif X AI SkNx operator|(const SkNx& y) const { return FromBits(ToBits(fVal) | ToBits(y.fVal)); } X AI SkNx operator^(const SkNx& y) const { return FromBits(ToBits(fVal) ^ ToBits(y.fVal)); } X Xdiff -r aecb4600e5da gfx/skia/skia/src/opts/SkBlitMask_opts.h X--- gfx/skia/skia/src/opts/SkBlitMask_opts.h Tue Aug 20 09:46:55 2019 +0200 X+++ gfx/skia/skia/src/opts/SkBlitMask_opts.h Mon Sep 09 10:04:06 2019 +0200 X@@ -203,7 +203,13 @@ X // ~~~> X // a = 1*aa + d(1-1*aa) = aa + d(1-aa) X // c = 0*aa + d(1-1*aa) = d(1-aa) X+ X+ // For big endian we have to swap the alpha-mask from 0,0,0,255 to 255,0,0,0 X+#ifdef SK_CPU_BENDIAN X+ return Sk4px(Sk16b(aa) & Sk16b(255,0,0,0, 255,0,0,0, 255,0,0,0, 255,0,0,0)) X+#else X return Sk4px(Sk16b(aa) & Sk16b(0,0,0,255, 0,0,0,255, 0,0,0,255, 0,0,0,255)) X+#endif X + d.approxMulDiv255(aa.inv()); X }; X while (h --> 0) { SHAR_END echo x librewolf/files/patch-bug1504834_comment10 sed 's/^X//' > librewolf/files/patch-bug1504834_comment10 << 'SHAR_END' Xhttps://bugzilla.mozilla.org/show_bug.cgi?id=1504834#c10 Xhttps://bug1504834.bmoattachments.org/attachment.cgi?id=9111147 Xmozilla-bmo1504834-part4.patch X X# HG changeset patch X# Parent 46ea866ca3acb8bb5e1709ceb799b9c94f591dec XProblem description: Tab-titles that are too long to fit into a tab get faded out. X On big endian this is broken and instead of fading out, the X tab gets white and the font transparent, leading to an unreadable X tab-title XSolution: This is not a real solution, but a hack. The real solution would have been X to byte-swap the correct buffer, but I could not find it. X So the next best thing is to deactivate the fading-effect. Now all tab-titles X are readable, albeit not as pretty to look at as they could be. XSide-effects: I have not yet found an unwanted side-effect. X Xdiff --git gfx/2d/DrawTargetSkia.cpp gfx/2d/DrawTargetSkia.cpp Xindex 6bbef8d..161b96f 100644 X--- gfx/2d/DrawTargetSkia.cpp X+++ gfx/2d/DrawTargetSkia.cpp X@@ -1903,6 +1903,14 @@ void DrawTargetSkia::PushLayerWithBlend(bool aOpaque, Float aOpacity, X SkCanvas::kPreserveLCDText_SaveLayerFlag | X (aCopyBackground ? SkCanvas::kInitWithPrevious_SaveLayerFlag : 0)); X X+#if MOZ_BIG_ENDIAN() X+ // Pushing a layer where an aMask is defined produces wrong output. X+ // We _should_ endian swap the data, but I couldn't find a workable way to do so X+ // Therefore I deactivate those layers in the meantime. X+ // The result is: Tab-titles that are longer than the available space should be faded out. X+ // The fading doesn't work, so we deactivate the fading-effect here. X+ if (!aMask) X+#endif X mCanvas->saveLayer(saveRec); X X SetPermitSubpixelAA(aOpaque); X SHAR_END echo x librewolf/files/patch-bug1612181_comment1 sed 's/^X//' > librewolf/files/patch-bug1612181_comment1 << 'SHAR_END' Xhttps://bugzilla.mozilla.org/show_bug.cgi?id=1612181 Xhttps://bug1612181.bmoattachments.org/attachment.cgi?id=9123550 X X X--- xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_ppc64_linux.S.orig 2020-01-29 19:25:30.967574000 +0100 X+++ xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_ppc64_linux.S 2020-01-29 19:26:50.465737000 +0100 X@@ -62,11 +62,11 @@ NS_InvokeByIndex: X .NS_InvokeByIndex: X #endif X mflr 0 X- std 0,16(r1) X+ std 0,16(%r1) X X- std r29,-24(r1) X- std r30,-16(r1) X- std r31,-8(r1) X+ std r29,-24(%r1) X+ std r30,-16(%r1) X+ std r31,-8(%r1) X X mr r29,r3 # Save 'that' in r29 X mr r30,r4 # Save 'methodIndex' in r30 X@@ -79,7 +79,7 @@ NS_InvokeByIndex: X # X # | (fixed area + | | 7 GP | 13 FP | 3 NV | X # | param. save) |(params)........| regs | regs | regs | X- # (r1)......(+STACK_PARAMS)... (-23*8).(-16*8).(-3*8)..(r31) X+ # (%r1)......(+STACK_PARAMS)... (-23*8).(-16*8).(-3*8)..(%r31) X X # +stack frame, -unused stack params, +regs storage, +1 for alignment X addi r7,r5,((STACK_PARAMS/8)-7+7+13+3+1) X@@ -105,56 +105,56 @@ NS_InvokeByIndex: X X # Set up to invoke function X X- ld r9,0(r29) # vtable (r29 is 'that') X+ ld r9,0(%r29) # vtable (%r29 is 'that') X mr r3,r29 # self is first arg, obviously X X sldi r30,r30,3 # Find function descriptor X add r9,r9,r30 X- ld r12,0(r9) X+ ld r12,0(%r9) X X- std r2,STACK_TOC(r1) # Save r2 (TOC pointer) X+ std r2,STACK_TOC(%r1) # Save r2 (TOC pointer) X X #if _CALL_ELF == 2 X mtctr r12 X #else X- ld r0,0(r12) # Actual address from fd. X+ ld r0,0(%r12) # Actual address from fd. X mtctr 0 X- ld r11,16(r12) # Environment pointer from fd. X- ld r2,8(r12) # TOC pointer from fd. X+ ld r11,16(%r12) # Environment pointer from fd. X+ ld r2,8(%r12) # TOC pointer from fd. X #endif X X # Load FP and GP registers as required X- ld r4, -(23*8)(r31) X- ld r5, -(22*8)(r31) X- ld r6, -(21*8)(r31) X- ld r7, -(20*8)(r31) X- ld r8, -(19*8)(r31) X- ld r9, -(18*8)(r31) X- ld r10, -(17*8)(r31) X+ ld r4, -(23*8)(%r31) X+ ld r5, -(22*8)(%r31) X+ ld r6, -(21*8)(%r31) X+ ld r7, -(20*8)(%r31) X+ ld r8, -(19*8)(%r31) X+ ld r9, -(18*8)(%r31) X+ ld r10, -(17*8)(%r31) X X- lfd f1, -(16*8)(r31) X- lfd f2, -(15*8)(r31) X- lfd f3, -(14*8)(r31) X- lfd f4, -(13*8)(r31) X- lfd f5, -(12*8)(r31) X- lfd f6, -(11*8)(r31) X- lfd f7, -(10*8)(r31) X- lfd f8, -(9*8)(r31) X- lfd f9, -(8*8)(r31) X- lfd f10, -(7*8)(r31) X- lfd f11, -(6*8)(r31) X- lfd f12, -(5*8)(r31) X- lfd f13, -(4*8)(r31) X+ lfd f1, -(16*8)(%r31) X+ lfd f2, -(15*8)(%r31) X+ lfd f3, -(14*8)(%r31) X+ lfd f4, -(13*8)(%r31) X+ lfd f5, -(12*8)(%r31) X+ lfd f6, -(11*8)(%r31) X+ lfd f7, -(10*8)(%r31) X+ lfd f8, -(9*8)(%r31) X+ lfd f9, -(8*8)(%r31) X+ lfd f10, -(7*8)(%r31) X+ lfd f11, -(6*8)(%r31) X+ lfd f12, -(5*8)(%r31) X+ lfd f13, -(4*8)(%r31) X X bctrl # Do it X X- ld r2,STACK_TOC(r1) # Load our own TOC pointer X- ld r1,0(r1) # Revert stack frame X- ld 0,16(r1) # Reload lr X+ ld r2,STACK_TOC(%r1) # Load our own TOC pointer X+ ld r1,0(%r1) # Revert stack frame X+ ld 0,16(%r1) # Reload lr X mtlr 0 X- ld 29,-24(r1) # Restore NVGPRS X- ld 30,-16(r1) X- ld 31,-8(r1) X+ ld 29,-24(%r1) # Restore NVGPRS X+ ld 30,-16(%r1) X+ ld 31,-8(%r1) X blr X X #if _CALL_ELF == 2 X--- xpcom/reflect/xptcall/md/unix/xptcstubs_asm_ppc64_linux.S.orig 2020-01-29 19:25:51.465953000 +0100 X+++ xpcom/reflect/xptcall/md/unix/xptcstubs_asm_ppc64_linux.S 2020-01-29 19:28:53.055137000 +0100 X@@ -58,35 +58,35 @@ SharedStub: X #endif X mflr r0 X X- std r4, -56(r1) # Save all GPRS X- std r5, -48(r1) X- std r6, -40(r1) X- std r7, -32(r1) X- std r8, -24(r1) X- std r9, -16(r1) X- std r10, -8(r1) X+ std r4, -56(%r1) # Save all GPRS X+ std r5, -48(%r1) X+ std r6, -40(%r1) X+ std r7, -32(%r1) X+ std r8, -24(%r1) X+ std r9, -16(%r1) X+ std r10, -8(%r1) X X- stfd f13, -64(r1) # ... and FPRS X- stfd f12, -72(r1) X- stfd f11, -80(r1) X- stfd f10, -88(r1) X- stfd f9, -96(r1) X- stfd f8, -104(r1) X- stfd f7, -112(r1) X- stfd f6, -120(r1) X- stfd f5, -128(r1) X- stfd f4, -136(r1) X- stfd f3, -144(r1) X- stfd f2, -152(r1) X- stfd f1, -160(r1) X+ stfd f13, -64(%r1) # ... and FPRS X+ stfd f12, -72(%r1) X+ stfd f11, -80(%r1) X+ stfd f10, -88(%r1) X+ stfd f9, -96(%r1) X+ stfd f8, -104(%r1) X+ stfd f7, -112(%r1) X+ stfd f6, -120(%r1) X+ stfd f5, -128(%r1) X+ stfd f4, -136(%r1) X+ stfd f3, -144(%r1) X+ stfd f2, -152(%r1) X+ stfd f1, -160(%r1) X X subi r6,r1,56 # r6 --> gprData X subi r7,r1,160 # r7 --> fprData X addi r5,r1,STACK_PARAMS # r5 --> extra stack args X X- std r0, 16(r1) X+ std r0, 16(%r1) X X- stdu r1,-288(r1) X+ stdu r1,-288(%r1) X # r3 has the 'self' pointer X # already X X@@ -97,8 +97,8 @@ SharedStub: X bl PrepareAndDispatch X nop X X- ld 1,0(r1) # restore stack X- ld r0,16(r1) # restore LR X+ ld 1,0(%r1) # restore stack X+ ld r0,16(%r1) # restore LR X mtlr r0 X blr X SHAR_END echo x librewolf/files/patch-bug1626236 sed 's/^X//' > librewolf/files/patch-bug1626236 << 'SHAR_END' Xhttps://bugzilla.mozilla.org/show_bug.cgi?id=1626236 Xhttps://bug1626236.bmoattachments.org/attachment.cgi?id=9137096 X X# HG changeset patch X# User msirringhaus@suse.de X# Date 1582805876 -3600 X# Thu Feb 27 13:17:56 2020 +0100 X# Node ID cc3d09abea31068e57f1ab918782f9f86fc6a158 X# Parent 9cd90914846f667f18babc491a74c164ae5d6e9f Ximported patch decoder_workaround.patch X Xdiff --git image/decoders/nsGIFDecoder2.cpp image/decoders/nsGIFDecoder2.cpp Xindex ebb0b7d..d52ef47 100644 X--- image/decoders/nsGIFDecoder2.cpp X+++ image/decoders/nsGIFDecoder2.cpp X@@ -422,6 +422,9 @@ void nsGIFDecoder2::ConvertColormap(uint32_t* aColormap, uint32_t aColors) { X MOZ_ASSERT(mSwizzleFn); X uint8_t* data = reinterpret_cast(aColormap); X mSwizzleFn(data, data, aColors); X+#if MOZ_BIG_ENDIAN() X+ SwizzleRow(SurfaceFormat::A8R8G8B8, SurfaceFormat::B8G8R8A8)(data, data, aColors); X+#endif X } X X LexerResult nsGIFDecoder2::DoDecode(SourceBufferIterator& aIterator, Xdiff --git image/decoders/nsJPEGDecoder.cpp image/decoders/nsJPEGDecoder.cpp Xindex 9ea4403..d82772c 100644 X--- image/decoders/nsJPEGDecoder.cpp X+++ image/decoders/nsJPEGDecoder.cpp X@@ -257,6 +257,9 @@ LexerTransition nsJPEGDecoder::ReadJPEGData( X case JCS_YCbCr: X // By default, we will output directly to BGRA. If we need to apply X // special color transforms, this may change. X+#if MOZ_BIG_ENDIAN() X+ mInfo.out_color_space = MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB; X+#else X switch (SurfaceFormat::OS_RGBX) { X case SurfaceFormat::B8G8R8X8: X mInfo.out_color_space = JCS_EXT_BGRX; X@@ -271,6 +274,7 @@ LexerTransition nsJPEGDecoder::ReadJPEGData( X mState = JPEG_ERROR; X return Transition::TerminateFailure(); X } X+#endif X break; X case JCS_CMYK: X case JCS_YCCK: Xdiff --git image/decoders/nsPNGDecoder.cpp image/decoders/nsPNGDecoder.cpp Xindex e3e4ef4..3cc7315 100644 X--- image/decoders/nsPNGDecoder.cpp X+++ image/decoders/nsPNGDecoder.cpp X@@ -356,7 +356,7 @@ LexerResult nsPNGDecoder::DoDecode(SourceBufferIterator& aIterator, X IResumable* aOnResume) { X MOZ_ASSERT(!HasError(), "Shouldn't call DoDecode after error!"); X X- return mLexer.Lex(aIterator, aOnResume, X+ LexerResult res = mLexer.Lex(aIterator, aOnResume, X [=](State aState, const char* aData, size_t aLength) { X switch (aState) { X case State::PNG_DATA: X@@ -366,6 +366,14 @@ LexerResult nsPNGDecoder::DoDecode(SourceBufferIterator& aIterator, X } X MOZ_CRASH("Unknown State"); X }); X+ X+#if MOZ_BIG_ENDIAN() X+ if(res.is() && res.as() == TerminalState::SUCCESS) { X+ NativeEndian::swapToLittleEndianInPlace((uint32_t*)(mImageData), mImageDataLength / 4); X+ } X+#endif X+ X+ return res; X } X X LexerTransition nsPNGDecoder::ReadPNGData( Xdiff --git image/decoders/nsWebPDecoder.cpp image/decoders/nsWebPDecoder.cpp Xindex e58ca92..2056ebb 100644 X--- image/decoders/nsWebPDecoder.cpp X+++ image/decoders/nsWebPDecoder.cpp X@@ -247,7 +247,12 @@ nsresult nsWebPDecoder::CreateFrame(const OrientedIntRect& aFrameRect) { X // WebP doesn't guarantee that the alpha generated matches the hint in the X // header, so we always need to claim the input is BGRA. If the output is X // BGRX, swizzling will mask off the alpha channel. X+#if MOZ_BIG_ENDIAN() X+ mBuffer.colorspace = MODE_ARGB; X+ SurfaceFormat inFormat = mFormat; X+#else X SurfaceFormat inFormat = SurfaceFormat::OS_RGBA; X+#endif X X SurfacePipeFlags pipeFlags = SurfacePipeFlags(); X if (mFormat == SurfaceFormat::OS_RGBA && SHAR_END echo x librewolf/files/patch-bug1640982 sed 's/^X//' > librewolf/files/patch-bug1640982 << 'SHAR_END' XUnbreak build with Rust 1.45.0 X Xerror: options `-C embed-bitcode=no` and `-C lto` are incompatible X Xdiff --git config/makefiles/rust.mk config/makefiles/rust.mk Xindex 75570d3..94ec33f 100644 X--- config/makefiles/rust.mk X+++ config/makefiles/rust.mk X@@ -97,7 +97,7 @@ ifndef rustflags_sancov X # Never enable when coverage is enabled to work around https://github.com/rust-lang/rust/issues/90045. X ifndef MOZ_CODE_COVERAGE X ifeq (,$(findstring gkrust_gtest,$(RUST_LIBRARY_FILE))) X-cargo_rustc_flags += -Clto X+cargo_rustc_flags += X endif X # We need -Cembed-bitcode=yes for all crates when using -Clto. X RUSTFLAGS += -Cembed-bitcode=yes SHAR_END echo x librewolf/files/patch-bug1659612 sed 's/^X//' > librewolf/files/patch-bug1659612 << 'SHAR_END' Xmedia/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] X r = snprintf(node_name, sizeof(node_name), "pcm.%s", string); X ^ Xmedia/libcubeb/src/cubeb_alsa.c:613:9: note: include the header or explicitly provide a declaration for 'snprintf' Xmedia/libcubeb/src/cubeb_alsa.c:1168:3: error: implicitly declaring library function 'alloca' with type 'void *(unsigned int)' [-Werror,-Wimplicit-function-declaration] X snd_pcm_hw_params_alloca(&hw_params); X ^ X/usr/local/include/alsa/pcm.h:737:39: note: expanded from macro 'snd_pcm_hw_params_alloca' X#define snd_pcm_hw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_hw_params) X ^ X/usr/local/include/alsa/global.h:106:57: note: expanded from macro '__snd_alloca' X#define __snd_alloca(ptr,type) do { *ptr = (type##_t *) alloca(type##_sizeof()); memset(*ptr, 0, type##_sizeof()); } while (0) X ^ Xmedia/libcubeb/src/cubeb_alsa.c:1168:3: note: include the header or explicitly provide a declaration for 'alloca' X/usr/local/include/alsa/pcm.h:737:39: note: expanded from macro 'snd_pcm_hw_params_alloca' X#define snd_pcm_hw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_hw_params) X ^ X/usr/local/include/alsa/global.h:106:57: note: expanded from macro '__snd_alloca' X#define __snd_alloca(ptr,type) do { *ptr = (type##_t *) alloca(type##_sizeof()); memset(*ptr, 0, type##_sizeof()); } while (0) X ^ X2 errors generated. X X--- media/libcubeb/src/cubeb_alsa.c.orig 2021-08-31 14:26:24.530548000 +0200 X+++ media/libcubeb/src/cubeb_alsa.c 2021-08-31 14:26:43.081470000 +0200 X@@ -5,9 +5,7 @@ X * accompanying file LICENSE for details. X */ X #undef NDEBUG X-#define _DEFAULT_SOURCE X-#define _BSD_SOURCE X-#define _XOPEN_SOURCE 500 X+#define _GNU_SOURCE 1 X #include "cubeb-internal.h" X #include "cubeb/cubeb.h" X #include SHAR_END echo x librewolf/files/patch-bug1680982 sed 's/^X//' > librewolf/files/patch-bug1680982 << 'SHAR_END' Xcommit 3204512f58a1 XAuthor: Greg V XDate: Sun Dec 6 22:07:00 2020 +0000 X X Bug 1680982 - Use evdev instead of the Linux legacy joystick API for gamepads X X Using evdev is a prerequisite for adding rumble (haptic feedback) and LED support. X X - BTN_GAMEPAD semantic buttons are interpreted directly, X since all kernel drivers are supposed to use them correctly: X https://www.kernel.org/doc/html/latest/input/gamepad.html X - BTN_JOYSTICK legacy style numbered buttons use the model specific remappers X - we support even strange devices that combine both styles in one device X - the Linux gamepad module is enabled on FreeBSD and DragonFly, because X these kernels provide evdev, and libudev-devd provides enough of libudev X (evdev headers are provided by the devel/evdev-proto package) X X Differential Revision: https://phabricator.services.mozilla.com/D98868 X--- X dom/gamepad/linux/LinuxGamepad.cpp | 262 ++++++++++++++++++++++++++++++++----- X dom/gamepad/moz.build | 2 +- X 2 files changed, 229 insertions(+), 35 deletions(-) X Xdiff --git dom/gamepad/linux/LinuxGamepad.cpp dom/gamepad/linux/LinuxGamepad.cpp Xindex deee47b9d267..31f0aad7ae4a 100644 X--- dom/gamepad/linux/LinuxGamepad.cpp X+++ dom/gamepad/linux/LinuxGamepad.cpp X@@ -5,15 +5,16 @@ X * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ X X /* X- * LinuxGamepadService: A Linux backend for the GamepadService. X- * Derived from the kernel documentation at X- * http://www.kernel.org/doc/Documentation/input/joystick-api.txt X+ * LinuxGamepadService: An evdev backend for the GamepadService. X+ * X+ * Ref: https://www.kernel.org/doc/html/latest/input/gamepad.html X */ X #include X+#include X #include X X #include X-#include X+#include X #include X #include X #include X@@ -21,10 +22,14 @@ X #include "nscore.h" X #include "mozilla/dom/GamepadHandle.h" X #include "mozilla/dom/GamepadPlatformService.h" X+#include "mozilla/dom/GamepadRemapping.h" X #include "mozilla/Tainting.h" X #include "mozilla/UniquePtr.h" X #include "udev.h" X X+#define LONG_BITS (sizeof(long) * 8) X+#define NLONGS(x) (((x) + LONG_BITS - 1) / LONG_BITS) X+ X namespace { X X using namespace mozilla::dom; X@@ -36,19 +41,29 @@ using mozilla::udev_list_entry; X using mozilla::udev_monitor; X using mozilla::UniquePtr; X X-static const float kMaxAxisValue = 32767.0; X-static const char kJoystickPath[] = "/dev/input/js"; X+static const char kEvdevPath[] = "/dev/input/event"; X+ X+static inline bool TestBit(const unsigned long* arr, int bit) { X+ return !!(arr[bit / LONG_BITS] & (1LL << (bit % LONG_BITS))); X+} X+ X+static inline double ScaleAxis(const input_absinfo& info, int value) { X+ return 2.0 * (value - info.minimum) / (double)(info.maximum - info.minimum) - X+ 1.0; X+} X X // TODO: should find a USB identifier for each device so we can X // provide something that persists across connect/disconnect cycles. X-typedef struct { X+struct Gamepad { X GamepadHandle handle; X- guint source_id; X- int numAxes; X- int numButtons; X- char idstring[256]; X- char devpath[PATH_MAX]; X-} Gamepad; X+ RefPtr remapper = nullptr; X+ guint source_id = UINT_MAX; X+ char idstring[256] = {0}; X+ char devpath[PATH_MAX] = {0}; X+ uint8_t key_map[KEY_MAX] = {0}; X+ uint8_t abs_map[ABS_MAX] = {0}; X+ std::unordered_map abs_info; X+}; X X class LinuxGamepadService { X public: X@@ -66,7 +81,7 @@ class LinuxGamepadService { X bool is_gamepad(struct udev_device* dev); X void ReadUdevChange(); X X- // handler for data from /dev/input/jsN X+ // handler for data from /dev/input/eventN X static gboolean OnGamepadData(GIOChannel* source, GIOCondition condition, X gpointer data); X X@@ -114,8 +129,14 @@ void LinuxGamepadService::AddDevice(struct udev_device* dev) { X g_io_channel_set_encoding(channel, nullptr, nullptr); X g_io_channel_set_buffered(channel, FALSE); X int fd = g_io_channel_unix_get_fd(channel); X+ X+ struct input_id id {}; X+ if (ioctl(fd, EVIOCGID, &id) == -1) { X+ return; X+ } X+ X char name[128]; X- if (ioctl(fd, JSIOCGNAME(sizeof(name)), &name) == -1) { X+ if (ioctl(fd, EVIOCGNAME(sizeof(name)), &name) == -1) { X strcpy(name, "unknown"); X } X const char* vendor_id = X@@ -131,20 +152,86 @@ void LinuxGamepadService::AddDevice(struct udev_device* dev) { X model_id = mUdev.udev_device_get_sysattr_value(parent, "id/product"); X } X } X+ if (!vendor_id && id.vendor != 0) { X+ vendor_id = (const char*)alloca(5); X+ snprintf((char*)vendor_id, 5, "%04x", id.vendor); X+ } X+ if (!model_id && id.product != 0) { X+ model_id = (const char*)alloca(5); X+ snprintf((char*)model_id, 5, "%04x", id.product); X+ } X snprintf(gamepad->idstring, sizeof(gamepad->idstring), "%s-%s-%s", X vendor_id ? vendor_id : "unknown", model_id ? model_id : "unknown", X name); X X char numAxes = 0, numButtons = 0; X- ioctl(fd, JSIOCGAXES, &numAxes); X- gamepad->numAxes = numAxes; X- ioctl(fd, JSIOCGBUTTONS, &numButtons); X- gamepad->numButtons = numButtons; X+ unsigned long key_bits[NLONGS(KEY_CNT)] = {0}; X+ unsigned long abs_bits[NLONGS(ABS_CNT)] = {0}; X+ ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(key_bits)), key_bits); X+ ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(abs_bits)), abs_bits); X+ X+ /* Here, we try to support even strange cases where proper semantic X+ * BTN_GAMEPAD button are combined with arbitrary extra buttons. */ X+ for (uint16_t i = BTN_JOYSTICK; i < KEY_MAX; i++) { X+ /* Do not map semantic buttons, they are handled directly */ X+ if (i == BTN_GAMEPAD) { X+ i = BTN_THUMBR + 1; X+ continue; X+ } X+ if (i == BTN_DPAD_UP) { X+ i = BTN_DPAD_RIGHT + 1; X+ continue; X+ } X+ if (TestBit(key_bits, i)) { X+ gamepad->key_map[i] = numButtons++; X+ } X+ } X+ for (uint16_t i = 0; i < BTN_JOYSTICK; i++) { X+ if (TestBit(key_bits, i)) { X+ gamepad->key_map[i] = numButtons++; X+ } X+ } X+ for (uint16_t i = BTN_GAMEPAD; i <= BTN_THUMBR; i++) { X+ /* But if any semantic event exists, count them all */ X+ if (TestBit(key_bits, i)) { X+ numButtons += BUTTON_INDEX_COUNT; X+ break; X+ } X+ } X+ for (uint16_t i = 0; i < ABS_MAX; ++i) { X+ if (TestBit(abs_bits, i)) { X+ gamepad->abs_info.emplace(i, input_absinfo{}); X+ if (ioctl(fd, EVIOCGABS(i), &gamepad->abs_info[i]) < 0) { X+ continue; X+ } X+ if (gamepad->abs_info[i].minimum == gamepad->abs_info[i].maximum) { X+ gamepad->abs_info.erase(i); X+ continue; X+ } X+ gamepad->abs_map[i] = numAxes++; X+ } X+ } X+ X+ if (numAxes == 0) { X+ NS_WARNING("Gamepad with zero axes detected?"); X+ } X+ if (numButtons == 0) { X+ NS_WARNING("Gamepad with zero buttons detected?"); X+ } X+ X+ bool defaultRemapper = false; X+ RefPtr remapper = X+ GetGamepadRemapper(id.vendor, id.product, defaultRemapper); X+ MOZ_ASSERT(remapper); X+ remapper->SetAxisCount(numAxes); X+ remapper->SetButtonCount(numButtons); X X gamepad->handle = service->AddGamepad( X- gamepad->idstring, mozilla::dom::GamepadMappingType::_empty, X- mozilla::dom::GamepadHand::_empty, gamepad->numButtons, gamepad->numAxes, X- 0, 0, 0); // TODO: Bug 680289, implement gamepad haptics for Linux. X+ gamepad->idstring, remapper->GetMappingType(), GamepadHand::_empty, X+ remapper->GetButtonCount(), remapper->GetAxisCount(), 0, X+ remapper->GetLightIndicatorCount(), remapper->GetTouchEventCount()); X+ gamepad->remapper = remapper.forget(); X+ // TODO: Bug 680289, implement gamepad haptics for Linux. X // TODO: Bug 1523355, implement gamepad lighindicator and touch for Linux. X X gamepad->source_id = X@@ -257,7 +344,7 @@ bool LinuxGamepadService::is_gamepad(struct udev_device* dev) { X if (!devpath) { X return false; X } X- if (strncmp(kJoystickPath, devpath, sizeof(kJoystickPath) - 1) != 0) { X+ if (strncmp(kEvdevPath, devpath, sizeof(kEvdevPath) - 1) != 0) { X return false; X } X X@@ -292,7 +379,7 @@ gboolean LinuxGamepadService::OnGamepadData(GIOChannel* source, X if (condition & G_IO_ERR || condition & G_IO_HUP) return FALSE; X X while (true) { X- struct js_event event; X+ struct input_event event {}; X gsize count; X GError* err = nullptr; X if (g_io_channel_read_chars(source, (gchar*)&event, sizeof(event), &count, X@@ -301,18 +388,125 @@ gboolean LinuxGamepadService::OnGamepadData(GIOChannel* source, X break; X } X X- // TODO: store device state? X- if (event.type & JS_EVENT_INIT) { X- continue; X- } X- X switch (event.type) { X- case JS_EVENT_BUTTON: X- service->NewButtonEvent(gamepad->handle, event.number, !!event.value); X+ case EV_KEY: X+ switch (event.code) { X+ /* The gamepad events are meaningful, and according to X+ * https://www.kernel.org/doc/html/latest/input/gamepad.html X+ * "No other devices, that do not look/feel like a gamepad, shall X+ * report these events" */ X+ case BTN_SOUTH: X+ service->NewButtonEvent(gamepad->handle, BUTTON_INDEX_PRIMARY, X+ !!event.value); X+ break; X+ case BTN_EAST: X+ service->NewButtonEvent(gamepad->handle, BUTTON_INDEX_SECONDARY, X+ !!event.value); X+ break; X+ case BTN_NORTH: X+ service->NewButtonEvent(gamepad->handle, BUTTON_INDEX_QUATERNARY, X+ !!event.value); X+ break; X+ case BTN_WEST: X+ service->NewButtonEvent(gamepad->handle, BUTTON_INDEX_TERTIARY, X+ !!event.value); X+ break; X+ case BTN_TL: X+ service->NewButtonEvent(gamepad->handle, BUTTON_INDEX_LEFT_SHOULDER, X+ !!event.value); X+ break; X+ case BTN_TR: X+ service->NewButtonEvent(gamepad->handle, X+ BUTTON_INDEX_RIGHT_SHOULDER, !!event.value); X+ break; X+ case BTN_TL2: X+ service->NewButtonEvent(gamepad->handle, BUTTON_INDEX_LEFT_TRIGGER, X+ !!event.value); X+ break; X+ case BTN_TR2: X+ service->NewButtonEvent(gamepad->handle, BUTTON_INDEX_RIGHT_TRIGGER, X+ !!event.value); X+ break; X+ case BTN_SELECT: X+ service->NewButtonEvent(gamepad->handle, BUTTON_INDEX_BACK_SELECT, X+ !!event.value); X+ break; X+ case BTN_START: X+ service->NewButtonEvent(gamepad->handle, BUTTON_INDEX_START, X+ !!event.value); X+ break; X+ case BTN_MODE: X+ service->NewButtonEvent(gamepad->handle, BUTTON_INDEX_META, X+ !!event.value); X+ break; X+ case BTN_THUMBL: X+ service->NewButtonEvent( X+ gamepad->handle, BUTTON_INDEX_LEFT_THUMBSTICK, !!event.value); X+ break; X+ case BTN_THUMBR: X+ service->NewButtonEvent( X+ gamepad->handle, BUTTON_INDEX_RIGHT_THUMBSTICK, !!event.value); X+ break; X+ case BTN_DPAD_UP: X+ service->NewButtonEvent(gamepad->handle, BUTTON_INDEX_DPAD_UP, X+ !!event.value); X+ break; X+ case BTN_DPAD_DOWN: X+ service->NewButtonEvent(gamepad->handle, BUTTON_INDEX_DPAD_DOWN, X+ !!event.value); X+ break; X+ case BTN_DPAD_LEFT: X+ service->NewButtonEvent(gamepad->handle, BUTTON_INDEX_DPAD_LEFT, X+ !!event.value); X+ break; X+ case BTN_DPAD_RIGHT: X+ service->NewButtonEvent(gamepad->handle, BUTTON_INDEX_DPAD_RIGHT, X+ !!event.value); X+ break; X+ default: X+ /* For non-gamepad events, this is the "anything goes" numbered X+ * handling that should be handled with remappers. */ X+ gamepad->remapper->RemapButtonEvent( X+ gamepad->handle, gamepad->key_map[event.code], !!event.value); X+ break; X+ } X break; X- case JS_EVENT_AXIS: X- service->NewAxisMoveEvent(gamepad->handle, event.number, X- ((float)event.value) / kMaxAxisValue); X+ case EV_ABS: X+ if (!gamepad->abs_info.count(event.code)) continue; X+ switch (event.code) { X+ case ABS_HAT0X: X+ service->NewButtonEvent( X+ gamepad->handle, BUTTON_INDEX_DPAD_LEFT, X+ AxisNegativeAsButton( X+ ScaleAxis(gamepad->abs_info[event.code], event.value))); X+ service->NewButtonEvent( X+ gamepad->handle, BUTTON_INDEX_DPAD_RIGHT, X+ AxisPositiveAsButton( X+ ScaleAxis(gamepad->abs_info[event.code], event.value))); X+ break; X+ case ABS_HAT0Y: X+ service->NewButtonEvent( X+ gamepad->handle, BUTTON_INDEX_DPAD_UP, X+ AxisNegativeAsButton( X+ ScaleAxis(gamepad->abs_info[event.code], event.value))); X+ service->NewButtonEvent( X+ gamepad->handle, BUTTON_INDEX_DPAD_DOWN, X+ AxisPositiveAsButton( X+ ScaleAxis(gamepad->abs_info[event.code], event.value))); X+ break; X+ case ABS_HAT1X: X+ case ABS_HAT1Y: X+ case ABS_HAT2X: X+ case ABS_HAT2Y: X+ case ABS_HAT3X: X+ case ABS_HAT3Y: X+ break; X+ default: X+ gamepad->remapper->RemapAxisMoveEvent( X+ gamepad->handle, gamepad->abs_map[event.code], X+ ScaleAxis(gamepad->abs_info[event.code], event.value)); X+ break; X+ } X break; X } X } Xdiff --git dom/gamepad/moz.build dom/gamepad/moz.build Xindex 5f55d5a95e96..544b7f927736 100644 X--- dom/gamepad/moz.build X+++ dom/gamepad/moz.build X@@ -59,7 +59,7 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows": X UNIFIED_SOURCES += ["windows/WindowsGamepad.cpp"] X elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "android": X UNIFIED_SOURCES += ["android/AndroidGamepad.cpp"] X-elif CONFIG["OS_ARCH"] == "Linux": X+elif CONFIG["OS_ARCH"] in ("Linux", "FreeBSD", "DragonFly"): X UNIFIED_SOURCES += ["linux/LinuxGamepad.cpp"] X else: X UNIFIED_SOURCES += ["fallback/FallbackGamepad.cpp"] SHAR_END echo x librewolf/files/patch-bug1716707 sed 's/^X//' > librewolf/files/patch-bug1716707 << 'SHAR_END' Xcommit ce7a2f400d4f599c72e32e2635fee7ea94c0848c XAuthor: Christoph Moench-Tegeder XDate: Wed Apr 13 14:44:46 2022 +0200 X X big-endian color fixes, but without breaking little-endian X X as le is what most people actually use X Xdiff --git gfx/webrender_bindings/RenderCompositorSWGL.cpp gfx/webrender_bindings/RenderCompositorSWGL.cpp Xindex dbf137c849ee..243a01ff9cf3 100644 X--- gfx/webrender_bindings/RenderCompositorSWGL.cpp X+++ gfx/webrender_bindings/RenderCompositorSWGL.cpp X@@ -7,6 +7,7 @@ X #include "RenderCompositorSWGL.h" X X #include "mozilla/gfx/Logging.h" X+#include "mozilla/gfx/Swizzle.h" X #include "mozilla/widget/CompositorWidget.h" X X #ifdef MOZ_WIDGET_GTK X@@ -235,6 +236,13 @@ void RenderCompositorSWGL::CommitMappedBuffer(bool aDirty) { X } X mDT->Flush(); X X+#if MOZ_BIG_ENDIAN() X+ // One swizzle to rule them all. X+ gfx::SwizzleData(mMappedData, mMappedStride, gfx::SurfaceFormat::B8G8R8A8, X+ mMappedData, mMappedStride, gfx::SurfaceFormat::A8R8G8B8, X+ mDT->GetSize()); X+#endif X+ X // Done with the DT. Hand it back to the widget and clear out any trace of it. X mWidget->EndRemoteDrawingInRegion(mDT, mDirtyRegion); X mDirtyRegion.SetEmpty(); Xdiff --git image/imgFrame.cpp image/imgFrame.cpp Xindex e58c3dd5b2d4..c1e7e77c362b 100644 X--- image/imgFrame.cpp X+++ image/imgFrame.cpp X@@ -372,6 +372,17 @@ nsresult imgFrame::InitWithDrawable(gfxDrawable* aDrawable, X return NS_ERROR_OUT_OF_MEMORY; X } X X+#if MOZ_BIG_ENDIAN() X+ if (aBackend == gfx::BackendType::SKIA && canUseDataSurface) { X+ // SKIA is lying about what format it returns on big endian X+ for (int ii=0; ii < mRawSurface->GetSize().Height()*mRawSurface->Stride() / 4; ++ii) { X+ uint32_t *vals = (uint32_t*)(mRawSurface->GetData()); X+ uint32_t val = ((vals[ii] << 8) & 0xFF00FF00 ) | ((vals[ii] >> 8) & 0xFF00FF ); X+ vals[ii] = (val << 16) | (val >> 16); X+ } X+ } X+#endif X+ X if (!canUseDataSurface) { X // We used an offscreen surface, which is an "optimized" surface from X // imgFrame's perspective. SHAR_END echo x librewolf/files/patch-bug1729459_comment12 sed 's/^X//' > librewolf/files/patch-bug1729459_comment12 << 'SHAR_END' X--- modules/fdlibm/src/math_private.h.orig 2021-09-30 19:32:33.764224000 +0200 X+++ modules/fdlibm/src/math_private.h 2021-10-02 22:15:33.265122000 +0200 X@@ -30,7 +30,11 @@ X * Adapted from https://github.com/freebsd/freebsd-src/search?q=__double_t X */ X X-typedef double __double_t; X+#ifdef __LP64__ X+typedef double __double_t; X+#else X+typedef long double __double_t; X+#endif X typedef __double_t double_t; X X /* X@@ -630,7 +634,37 @@ X return ((double)(x + 0x1.8p52) - 0x1.8p52); X } X X+static inline float X+rnintf(__float_t x) X+{ X+ /* X+ * As for rnint(), except we could just call that to handle the X+ * extra precision case, usually without losing efficiency. X+ */ X+ return ((float)(x + 0x1.8p23F) - 0x1.8p23F); X+} X+ X+#ifdef LDBL_MANT_DIG X /* X+ * The complications for extra precision are smaller for rnintl() since it X+ * can safely assume that the rounding precision has been increased from X+ * its default to FP_PE on x86. We don't exploit that here to get small X+ * optimizations from limiting the rangle to double. We just need it for X+ * the magic number to work with long doubles. ld128 callers should use X+ * rnint() instead of this if possible. ld80 callers should prefer X+ * rnintl() since for amd64 this avoids swapping the register set, while X+ * for i386 it makes no difference (assuming FP_PE), and for other arches X+ * it makes little difference. X+ */ X+static inline long double X+rnintl(long double x) X+{ X+ return (x + __CONCAT(0x1.8p, LDBL_MANT_DIG) / 2 - X+ __CONCAT(0x1.8p, LDBL_MANT_DIG) / 2); X+} X+#endif /* LDBL_MANT_DIG */ X+ X+/* X * irint() and i64rint() give the same result as casting to their integer X * return type provided their arg is a floating point integer. They can X * sometimes be more efficient because no rounding is required. X@@ -644,6 +678,39 @@ X sizeof(x) == sizeof(long double) ? irintl(x) : (int)(x)) X #else X #define irint(x) ((int)(x)) X+#endif X+ X+#define i64rint(x) ((int64_t)(x)) /* only needed for ld128 so not opt. */ X+ X+#if defined(__i386__) && defined(__GNUCLIKE_ASM) X+static __inline int X+irintf(float x) X+{ X+ int n; X+ X+ __asm("fistl %0" : "=m" (n) : "t" (x)); X+ return (n); X+} X+ X+static __inline int X+irintd(double x) X+{ X+ int n; X+ X+ __asm("fistl %0" : "=m" (n) : "t" (x)); X+ return (n); X+} X+#endif X+ X+#if (defined(__amd64__) || defined(__i386__)) && defined(__GNUCLIKE_ASM) X+static __inline int X+irintl(long double x) X+{ X+ int n; X+ X+ __asm("fistl %0" : "=m" (n) : "t" (x)); X+ return (n); X+} X #endif X X #ifdef DEBUG SHAR_END echo x librewolf/files/patch-bug1628567 sed 's/^X//' > librewolf/files/patch-bug1628567 << 'SHAR_END' XDon't pass --target when CC/CXX contains clang X Xdiff --git third_party/rust/cc/src/lib.rs third_party/rust/cc/src/lib.rs Xindex 8cafd2a..f40b746 100644 X--- third_party/rust/cc/src/lib.rs X+++ third_party/rust/cc/src/lib.rs X@@ -2796,24 +2796,7 @@ impl Tool { X } X X fn with_features(path: PathBuf, clang_driver: Option<&str>, cuda: bool) -> Self { X- // Try to detect family of the tool from its name, falling back to Gnu. X- let family = if let Some(fname) = path.file_name().and_then(|p| p.to_str()) { X- if fname.contains("clang-cl") { X- ToolFamily::Msvc { clang_cl: true } X- } else if fname.ends_with("cl") || fname == "cl.exe" { X- ToolFamily::Msvc { clang_cl: false } X- } else if fname.contains("clang") { X- match clang_driver { X- Some("cl") => ToolFamily::Msvc { clang_cl: true }, X- _ => ToolFamily::Clang, X- } X- } else { X- ToolFamily::Gnu X- } X- } else { X- ToolFamily::Gnu X- }; X- X+ let family = ToolFamily::Gnu; X Tool { X path: path, X cc_wrapper_path: None, SHAR_END echo x librewolf/files/patch-third__party_libwebrtc_build_config_BUILDCONFIG.gn sed 's/^X//' > librewolf/files/patch-third__party_libwebrtc_build_config_BUILDCONFIG.gn << 'SHAR_END' X--- third_party/libwebrtc/build/config/BUILDCONFIG.gn.orig 2022-10-09 20:42:58.113963000 +0200 X+++ third_party/libwebrtc/build/config/BUILDCONFIG.gn 2022-10-09 20:46:16.128220000 +0200 X@@ -132,6 +132,7 @@ X X # Set to true when compiling with the Clang compiler. X is_clang = current_os != "linux" || current_os == "openbsd" || X+ current_os == "freebsd" || X (current_cpu != "s390x" && current_cpu != "s390" && X current_cpu != "ppc64" && current_cpu != "ppc" && X current_cpu != "mips" && current_cpu != "mips64" && X@@ -184,7 +185,7 @@ X # TODO(dpranke): Add some sort of assert here that verifies that X # no toolchain omitted host_toolchain from its toolchain_args(). X X- if (host_os == "linux" || host_os == "openbsd") { X+ if (host_os == "linux" || host_os == "openbsd" || host_os == "freebsd") { X if (target_os != "linux") { X host_toolchain = "//build/toolchain/linux:clang_$host_cpu" X } else if (is_clang) { X@@ -222,7 +223,7 @@ X assert(host_os == "linux" || host_os == "mac", X "Android builds are only supported on Linux and Mac hosts.") X _default_toolchain = "//build/toolchain/android:android_clang_$target_cpu" X-} else if (target_os == "chromeos" || target_os == "linux" || target_os == "openbsd") { X+} else if (target_os == "chromeos" || target_os == "linux" || target_os == "openbsd" || target_os == "freebsd") { X # See comments in build/toolchain/cros/BUILD.gn about board compiles. X if (is_clang) { X _default_toolchain = "//build/toolchain/linux:clang_$target_cpu" X@@ -288,7 +289,7 @@ X is_fuchsia = current_os == "fuchsia" X is_ios = current_os == "ios" X is_linux = current_os == "linux" X-is_bsd = current_os == "openbsd" X+is_bsd = current_os == "openbsd" || current_os == "freebsd" X is_mac = current_os == "mac" X is_nacl = current_os == "nacl" X is_win = current_os == "win" || current_os == "winuwp" SHAR_END echo x librewolf/files/patch-third__party_libwebrtc_rtc__base_ip__address.cc sed 's/^X//' > librewolf/files/patch-third__party_libwebrtc_rtc__base_ip__address.cc << 'SHAR_END' Xcommit d1f5a45c1906e9f1e6a51f3b44c52d981bb3958c XAuthor: Christoph Moench-Tegeder XDate: Wed Oct 12 19:57:20 2022 +0200 X X pull in sys/types.h for u_XXX typedefs on FreeBSD 12 X X In file included from /wrkdirs/usr/ports/www/firefox/work/firefox-106.0/third_party/libwebrtc/rtc_base/ip_address.cc:20: X /usr/include/netinet/ip.h:53:2: error: unknown type name 'u_char'; did you mean 'char'? X u_char ip_hl:4, /* header length */ X Xdiff --git third_party/libwebrtc/rtc_base/ip_address.cc third_party/libwebrtc/rtc_base/ip_address.cc Xindex d544b611e149..ef9b742dac5f 100644 X--- third_party/libwebrtc/rtc_base/ip_address.cc X+++ third_party/libwebrtc/rtc_base/ip_address.cc X@@ -11,6 +11,8 @@ X #if defined(WEBRTC_POSIX) X #include X #include X+/* for u_char/u_short etc on FreeBSD 12 */ X+#include X X #include "absl/strings/string_view.h" X #ifdef OPENBSD SHAR_END echo x librewolf/files/patch-third__party_libwebrtc_third__party_pffft_src_pffft.c sed 's/^X//' > librewolf/files/patch-third__party_libwebrtc_third__party_pffft_src_pffft.c << 'SHAR_END' X--- third_party/libwebrtc/third_party/pffft/src/pffft.c.orig 2022-02-10 18:57:48 UTC X+++ third_party/libwebrtc/third_party/pffft/src/pffft.c X@@ -100,6 +100,7 @@ X Altivec support macros X */ X #if !defined(PFFFT_SIMD_DISABLE) && (defined(__ppc__) || defined(__ppc64__)) X+#include X typedef vector float v4sf; X # define SIMD_SZ 4 X # define VZERO() ((vector float) vec_splat_u8(0)) SHAR_END echo x librewolf/files/patch-third__party_sqlite3_src_moz.build sed 's/^X//' > librewolf/files/patch-third__party_sqlite3_src_moz.build << 'SHAR_END' X--- third_party/sqlite3/src/moz.build.old 2021-08-09 16:08:59.381182000 -0500 X+++ third_party/sqlite3/src/moz.build 2021-08-09 16:10:25.370954000 -0500 X@@ -92,7 +92,8 @@ X X # Enabling sqlite math functions X DEFINES['SQLITE_ENABLE_MATH_FUNCTIONS'] = True X-if CONFIG["OS_TARGET"] == "Linux" or CONFIG["OS_TARGET"] == "Android": X+if CONFIG["OS_TARGET"] == "Linux" or CONFIG["OS_TARGET"] == "Android" or \ X+ CONFIG["OS_TARGET"] == "FreeBSD": X OS_LIBS += [ X "m" X ] SHAR_END exit