diff --git a/www/firefox/Makefile b/www/firefox/Makefile index ab713a16dfa7..9304e52ef059 100644 --- a/www/firefox/Makefile +++ b/www/firefox/Makefile @@ -1,75 +1,76 @@ # Created by: Alan Eldridge PORTNAME= firefox DISTVERSION= 99.0.1 +PORTREVISION= 1 PORTEPOCH= 2 CATEGORIES= www MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \ MOZILLA/${PORTNAME}/candidates/${DISTVERSION}${DISTVERSIONSUFFIX}-candidates/build2/source DISTFILES= ${DISTNAME}.source${EXTRACT_SUFX} MAINTAINER= gecko@FreeBSD.org COMMENT= Web browser based on the browser portion of Mozilla BUILD_DEPENDS= nspr>=4.32:devel/nspr \ nss>=3.76:security/nss \ icu>=70.1:devel/icu \ libevent>=2.1.8:devel/libevent \ harfbuzz>=3.4.0:print/harfbuzz \ graphite2>=1.3.14:graphics/graphite2 \ png>=1.6.37:graphics/png \ dav1d>=1.0.0:multimedia/dav1d \ libvpx>=1.8.2:multimedia/libvpx \ ${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR} \ v4l_compat>0:multimedia/v4l_compat \ autoconf-2.13:devel/autoconf213 \ nasm:devel/nasm \ yasm:devel/yasm \ zip:archivers/zip USE_GECKO= gecko CONFLICTS_INSTALL= firefox-esr USE_MOZILLA= -sqlite CFLAGS_powerpc64le= -DSQLITE_BYTEORDER=1234 # work around bindgen not finding ICU, e.g. # dist/include/mozilla/intl/ICU4CGlue.h:8:10: fatal error: 'unicode/uenum.h' file not found, err: true CONFIGURE_ENV+= BINDGEN_CFLAGS="-I${LOCALBASE}/include" USES= tar:xz FIREFOX_ICON= ${MOZILLA}.png FIREFOX_ICON_SRC= ${PREFIX}/lib/${MOZILLA}/browser/chrome/icons/default/default48.png FIREFOX_DESKTOP= ${MOZSRC}/taskcluster/docker/${MOZILLA}-snap/${MOZILLA}.desktop MOZ_OPTIONS= --enable-application=browser \ --enable-official-branding .include "${.CURDIR}/../../www/firefox/Makefile.options" .include .if ${ARCH} == powerpc64 MOZ_OPTIONS+= --disable-webrtc --without-wasm-sandboxed-libraries .else BUILD_DEPENDS+= ${LOCALBASE}/share/wasi-sysroot/lib/wasm32-wasi/libc++abi.a:devel/wasi-libcxx \ ${LOCALBASE}/share/wasi-sysroot/lib/wasm32-wasi/libc.a:devel/wasi-libc \ ${LOCALBASE}/llvm${LLVM_DEFAULT}/lib/clang/${LLVM_VERSION}/lib/wasi/libclang_rt.builtins-wasm32.a:devel/wasi-compiler-rt${LLVM_DEFAULT} MOZ_OPTIONS+= --with-wasi-sysroot=${LOCALBASE}/share/wasi-sysroot .endif post-patch: @${REINPLACE_CMD} -e 's/%u/%U/' -e '/X-MultipleArgs/d' \ -e '/^Icon/s/=.*/=${FIREFOX_ICON:R}/' \ ${FIREFOX_DESKTOP} @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ ${WRKSRC}/browser/app/nsBrowserApp.cpp pre-configure: (cd ${WRKSRC} && ${LOCALBASE}/bin/autoconf-2.13) (cd ${WRKSRC}/js/src/ && ${LOCALBASE}/bin/autoconf-2.13) post-install: ${INSTALL_DATA} ${FIREFOX_DESKTOP} ${STAGEDIR}${PREFIX}/share/applications/ ${MKDIR} ${STAGEDIR}${PREFIX}/share/pixmaps ${LN} -sf ${FIREFOX_ICON_SRC} ${STAGEDIR}${PREFIX}/share/pixmaps/${FIREFOX_ICON} .include diff --git a/www/firefox/files/patch-bug1716707 b/www/firefox/files/patch-bug1716707 new file mode 100644 index 000000000000..73e01ebb0eb1 --- /dev/null +++ b/www/firefox/files/patch-bug1716707 @@ -0,0 +1,59 @@ +diff --git a/image/imgFrame.cpp b/image/imgFrame.cpp +--- image/imgFrame.cpp ++++ image/imgFrame.cpp +@@ -372,6 +372,15 @@ nsresult imgFrame::InitWithDrawable(gfxD + return NS_ERROR_OUT_OF_MEMORY; + } + ++ if (aBackend == gfx::BackendType::SKIA && canUseDataSurface) { ++ // SKIA is lying about what format it returns on big endian ++ for (int ii=0; ii < mRawSurface->GetSize().Height()*mRawSurface->Stride() / 4; ++ii) { ++ uint32_t *vals = (uint32_t*)(mRawSurface->GetData()); ++ uint32_t val = ((vals[ii] << 8) & 0xFF00FF00 ) | ((vals[ii] >> 8) & 0xFF00FF ); ++ vals[ii] = (val << 16) | (val >> 16); ++ } ++ } ++ + if (!canUseDataSurface) { + // We used an offscreen surface, which is an "optimized" surface from + // imgFrame's perspective. +# HG changeset patch +# User M. Sirringhaus +# Date 1645518286 -3600 +# Tue Feb 22 09:24:46 2022 +0100 +# Node ID 494640792b4677f6462e95b90a54a4e22aeb738b +# Parent 81832d035e101471dcf52dd91de287268add7a91 + +diff --git a/gfx/webrender_bindings/RenderCompositorSWGL.cpp b/gfx/webrender_bindings/RenderCompositorSWGL.cpp +--- gfx/webrender_bindings/RenderCompositorSWGL.cpp ++++ gfx/webrender_bindings/RenderCompositorSWGL.cpp +@@ -7,6 +7,7 @@ + #include "RenderCompositorSWGL.h" + + #include "mozilla/gfx/Logging.h" ++#include "mozilla/gfx/Swizzle.h" + #include "mozilla/widget/CompositorWidget.h" + + #ifdef MOZ_WIDGET_GTK +@@ -134,6 +135,7 @@ bool RenderCompositorSWGL::AllocateMappe + mMappedData = map.mData; + mMappedStride = map.mStride; + } ++ + MOZ_ASSERT(mMappedData != nullptr && mMappedStride > 0); + wr_swgl_init_default_framebuffer(mContext, bounds.x, bounds.y, bounds.width, + bounds.height, mMappedStride, mMappedData); +@@ -235,6 +237,13 @@ void RenderCompositorSWGL::CommitMappedB + } + mDT->Flush(); + ++#if MOZ_BIG_ENDIAN() ++ // One swizzle to rule them all. ++ gfx::SwizzleData(mMappedData, mMappedStride, gfx::SurfaceFormat::B8G8R8A8, ++ mMappedData, mMappedStride, gfx::SurfaceFormat::A8R8G8B8, ++ mDT->GetSize()); ++#endif ++ + // Done with the DT. Hand it back to the widget and clear out any trace of it. + mWidget->EndRemoteDrawingInRegion(mDT, mDirtyRegion); + mDirtyRegion.SetEmpty();