# Buildsheet autogenerated by ravenadm tool -- Do not edit. NAMEBASE= thunderbird VERSION= 147.0.1 KEYWORDS= mail net_im news VARIANTS= std SDESC[std]= Mozilla Thunderbird mail/newsgroup client HOMEPAGE= https://www.thunderbird.net/ CONTACT= nobody DOWNLOAD_GROUPS= main SITES[main]= MOZILLA/thunderbird/releases/147.0.1/source DISTFILE[1]= thunderbird-147.0.1.source.tar.xz:main DF_INDEX= 1 SPKGS[std]= single OPTIONS_AVAILABLE= none OPTIONS_STANDARD= none BUILD_DEPENDS= aom:dev:std botan:dev:std cbindgen:single:std clang:set:std dav1d:dev:std evdev-proto:single:std ffmpeg:dev:std icu:dev:std libcanberra:dev:std libevent:dev:std libnotify:dev:std libproxy:dev:std llvm:tools:std nasm:primary:std nodejs:primary:std nss:dev:std rust:single:std WebP:dev:std yasm:primary:std zip:primary:std dbus-glib:dev:std pciutils:dev:std startup-notification:dev:std BUILDRUN_DEPENDS= aom:primary:std botan:primary:std dav1d:primary:std dbus-glib:primary:std ffmpeg:primary:std harfbuzz:primary:std icu:primary:std libcanberra:primary:std libevent:primary:std libffi:primary:std libnotify:primary:std libproxy:primary:std nss:primary:std startup-notification:primary:std WebP:primary:std pciutils:primary:std B_DEPS[linux]= alsa-lib:dev:std sndio:dev:std B_DEPS[netbsd]= sndio:dev:std BR_DEPS[linux]= sndio:primary:std alsa-lib:primary:std BR_DEPS[netbsd]= sndio:primary:std USES= cpe desktop-utils:single gmake jpeg png zlib perl:build pkgconfig iconv bz2 python:build,sqlite GNOME_COMPONENTS= gconf gtk3 gdkpixbuf pango XORG_COMPONENTS= x11 xcb xcomposite xdamage xext xfixes xrender xt pixman LICENSE= MPL:single LICENSE_TERMS= single:{{WRKSRC}}/toolkit/content/license.html LICENSE_FILE= MPL:stock LICENSE_SCHEME= solo CPE_VENDOR= mozilla FPC_EQUIVALENT= mail/thunderbird MUST_CONFIGURE= yes CONFIGURE_OUTSOURCE= yes CONFIGURE_ENV= PYTHON3={{PYTHON_CMD}} SETUPTOOLS_USE_DISTUTILS=stdlib MAKE_ENV= PYTHON3={{PYTHON_CMD}} CXXSTDLIB="stdc++" SUB_FILES= launch MOUNT_PROCFS= yes QMAKE_ARGS= --prefix="{{PREFIX}}" --with-system-nss --with-system-nspr --with-system-zlib --with-system-icu --with-system-png --with-system-jpeg --with-system-libevent --with-system-harfbuzz --with-system-graphite2 --with-system-av1 --with-system-webp --with-system-botan --enable-system-ffi --enable-system-pixman --enable-install-strip --enable-strip --enable-libproxy --enable-release --enable-optimize --enable-official-branding --enable-application=comm/mail --enable-update-channel=release --with-intl-api --disable-alsa --disable-debug --disable-debug-symbols --disable-jack --disable-webrtc --disable-profiling --disable-pulseaudio --disable-tests --disable-updater --disable-hardening --without-wasm-sandboxed-libraries VAR_OPSYS[linux]= QMAKE_ARGS=--disable-elf-hack QMAKE_ARGS=--enable-audio-backends=sndio CONFIGURE_ENV=PKG_CONFIG_LIBDIR={{LOCALBASE}}/lib/pkgconfig VAR_OPSYS[netbsd]= QMAKE_ARGS=--enable-audio-backends=sndio MAKEFILE_LINE=NBSD=-lrt VAR_OPSYS[midnightbsd]= MAKEFILE_LINE=CONFIGURE_TARGET=x86_64-raven-freebsd12.3 post-patch: ${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ ${WRKSRC}/comm/mail/app/nsMailApp.cpp \ ${WRKSRC}/browser/app/nsBrowserApp.cpp (cd ${WRKSRC}/gfx/angle/checkout/src/compiler/translator && \ ${REINPLACE_CMD} -e 's|||' \ InfoSink.h IntermNode.cpp) # disable SCTP ${REINPLACE_CMD} -e 's|MOZ_SCTP|MOZ_DISABLE_SCTP|' \ ${WRKSRC}/netwerk/moz.build # alsa headers use 'u_int32_t' and other BerkeleyDB/nvi # fixed types (_XOPEN_SOURCE) ${REINPLACE_CMD} -e 's@_XOPEN_SOURCE@&___@g' \ ${WRKSRC}/media/libcubeb/src/cubeb_alsa.c ${REINPLACE_CMD} -e 's@_POSIX_SOURCE@&___@g' \ ${WRKSRC}/media/libcubeb/src/cubeb_jack.cpp # Fix midnight ${REINPLACE_CMD} -e "s|%%MBSD64_TGT%%|x86_64-raven-freebsd12.3|" \ ${WRKSRC}/build/autoconf/config.guess # Set mozilla options @${ECHO_CMD} "--=> Setting configuration <=--" @for arg in ${QMAKE_ARGS}; do \ ${ECHO_CMD} ".mozconfig << $$arg" ;\ ${ECHO_CMD} ac_add_options $$arg >> ${WRKSRC}/.mozconfig ;\ done @${ECHO_CMD} LDFLAGS=\"-lm ${NBSD} -Wl,-rpath,${PREFIX}/lib/thunderbird\" \ >> ${WRKSRC}/.mozconfig # disable rust checksums .for RD in mtu quinn-udp wgpu-hal minimal-lexical sfv glslopt wasi yaml-rust2 ${REINPLACE_CMD} -e 's/"files":{[^}]*}/"files":{}/' \ ${WRKSRC}/comm/third_party/rust/${RD}/.cargo-checksum.json .endfor post-extract-linux: # remove patch that breaks linux ${RM} ${PATCHDIR}/patch-comm_third__party_rust__wgpu-hal_src_vulkan_drm.rs pre-configure-netbsd: # Fix error: expected constructor __RCSID("$NetBSD: keyring.c,v 1.50 2011/06/25 00:37:44 agc Exp $"); ${REINPLACE_CMD} -e 's/__NetBSD__/__NEVER__/' \ ${WRKSRC}/comm/third_party/rnp/src/librekey/key_store_pgp.cpp post-install: ${MKDIR} ${STAGEDIR}${PREFIX}/share/applications ${MKDIR} ${STAGEDIR}${PREFIX}/share/pixmaps ${INSTALL_DATA} ${FILESDIR}/thunderbird.desktop \ ${STAGEDIR}${PREFIX}/share/applications (cd ${STAGEDIR}${PREFIX}/share/pixmaps && ${LN} -sf \ ../../lib/thunderbird/chrome/icons/default/default48.png \ thunderbird.png) # replace symlink with a launch script ${RM} ${STAGEDIR}${PREFIX}/bin/thunderbird ${INSTALL_SCRIPT} ${WRKDIR}/launch ${STAGEDIR}${PREFIX}/bin/thunderbird pre-configure: ${REINPLACE_CMD} -e "s|%%MBSD64_TGT%%|x86_64-raven-freebsd12.3|" \ ${WRKSRC}/build/autoconf/config.guess post-install-netbsd: ${PAXCTL} +m ${STAGEDIR}${PREFIX}/lib/thunderbird/thunderbird ${PAXCTL} +m ${STAGEDIR}${PREFIX}/lib/thunderbird/thunderbird-bin post-extract-netbsd: # remove patch that breaks netbsd ${RM} ${PATCHDIR}/patch-comm_third__party_rust__wgpu-hal_src_vulkan_drm.rs [FILE:391:descriptions/desc.single] Thunderbird is a free and open source email, newsfeed, chat, and calendaring client, that's easy to set up and customize. One of the core principles of Thunderbird is the use and promotion of open standards - this focus is a rejection of our world of closed platforms and services that can't communicate with each other. We want our users to have freedom and choice in how they communicate. [FILE:112:distinfo] 3e8a52c552a983340ced4c8f44ee37ae5028a2c9d717b9b49ee37ae72a6615ce 781853284 thunderbird-147.0.1.source.tar.xz [FILE:1046:manifests/plist.single] %%ONLY-LINUX%%lib/thunderbird/ crashhelper crashreporter libmozsandbox.so %%ONLY-LINUX%%lib/thunderbird/fonts/TwemojiMozilla.ttf bin/thunderbird lib/thunderbird/ application.ini dependentlibs.list glxtest interesting_serverknobs.json libgkcodecs.so liblgpllibs.so libmozavcodec.so libmozavutil.so libmozgtk.so libmozsqlite3.so librnp.so libxul.so omni.ja pingsender platform.ini removed-files rnp-cli rnpkeys thunderbird thunderbird-bin lib/thunderbird/chrome/icons/default/ TB-symbolic.svg calendar-alarm-dialog.png calendar-general-dialog.png default128.png default16.png default22.png default24.png default256.png default32.png default48.png default64.png msgcomposeWindow16.png msgcomposeWindow24.png msgcomposeWindow32.png msgcomposeWindow48.png lib/thunderbird/defaults/messenger/mailViews.dat lib/thunderbird/defaults/pref/channel-prefs.js lib/thunderbird/isp/ Bogofilter.sfd DSPAM.sfd POPFile.sfd SpamAssassin.sfd SpamPal.sfd share/applications/thunderbird.desktop share/pixmaps/thunderbird.png [FILE:1577:patches/patch-addon-search] https://github.com/mozilla/addons/issues/708 https://github.com/mozilla/addons-frontend/issues/4610 diff --git toolkit/mozapps/extensions/internal/AddonRepository.sys.mjs toolkit/mozapps/extensions/internal/AddonRepository.sys.mjs index 8d4d178924..500eaef103 100644 --- toolkit/mozapps/extensions/internal/AddonRepository.sys.mjs +++ toolkit/mozapps/extensions/internal/AddonRepository.sys.mjs @@ -715,7 +715,7 @@ export var AddonRepository = { addon.version = String(aEntry.current_version.version); if (Array.isArray(aEntry.current_version.files)) { for (let file of aEntry.current_version.files) { - if (file.platform == "all" || file.platform == lazy.PLATFORM) { + if (file.platform == "all" || file.platform == "linux" || file.platform == lazy.PLATFORM) { if (file.url) { addon.sourceURI = lazy.NetUtil.newURI(file.url); } diff --git toolkit/mozapps/extensions/internal/XPIDatabase.sys.mjs toolkit/mozapps/extensions/internal/XPIDatabase.sys.mjs index 0b81770b94..19669951dc 100644 --- toolkit/mozapps/extensions/internal/XPIDatabase.sys.mjs +++ toolkit/mozapps/extensions/internal/XPIDatabase.sys.mjs @@ -635,7 +635,7 @@ export class AddonInternal { // Something is causing errors in here try { for (let platform of this.targetPlatforms) { - if (platform.os == Services.appinfo.OS) { + if (platform.os == "Linux" || platform.os == Services.appinfo.OS) { if (platform.abi) { needsABI = true; if (platform.abi === abi) { [FILE:554:patches/patch-browser-app-nsBrowserApp.cpp] diff --git browser/app/nsBrowserApp.cpp browser/app/nsBrowserApp.cpp index e1f11b9cfd..a15b129402 100644 --- browser/app/nsBrowserApp.cpp +++ browser/app/nsBrowserApp.cpp @@ -341,6 +341,9 @@ int main(int argc, char* argv[], char* envp[]) { } # endif + setenv("MOZ_GMP_PATH", "%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko", 0); + setenv("MOZ_PLUGIN_PATH", "%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko", 0); + # ifdef HAS_DLL_BLOCKLIST uint32_t initFlags = gBlocklistInitFlags | eDllBlocklistInitFlagIsChildProcess; [FILE:2223:patches/patch-bug1659612] media/libcubeb/src/cubeb_alsa.c:613:9: error: implicitly declaring library function 'snprintf' with type 'int (char *, unsigned int, const char *, ...)' [-Werror,-Wimplicit-function-declaration] r = snprintf(node_name, sizeof(node_name), "pcm.%s", string); ^ media/libcubeb/src/cubeb_alsa.c:613:9: note: include the header or explicitly provide a declaration for 'snprintf' media/libcubeb/src/cubeb_alsa.c:1168:3: error: implicitly declaring library function 'alloca' with type 'void *(unsigned int)' [-Werror,-Wimplicit-function-declaration] snd_pcm_hw_params_alloca(&hw_params); ^ /usr/local/include/alsa/pcm.h:737:39: note: expanded from macro 'snd_pcm_hw_params_alloca' #define snd_pcm_hw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_hw_params) ^ /usr/local/include/alsa/global.h:106:57: note: expanded from macro '__snd_alloca' #define __snd_alloca(ptr,type) do { *ptr = (type##_t *) alloca(type##_sizeof()); memset(*ptr, 0, type##_sizeof()); } while (0) ^ media/libcubeb/src/cubeb_alsa.c:1168:3: note: include the header or explicitly provide a declaration for 'alloca' /usr/local/include/alsa/pcm.h:737:39: note: expanded from macro 'snd_pcm_hw_params_alloca' #define snd_pcm_hw_params_alloca(ptr) __snd_alloca(ptr, snd_pcm_hw_params) ^ /usr/local/include/alsa/global.h:106:57: note: expanded from macro '__snd_alloca' #define __snd_alloca(ptr,type) do { *ptr = (type##_t *) alloca(type##_sizeof()); memset(*ptr, 0, type##_sizeof()); } while (0) ^ 2 errors generated. --- media/libcubeb/src/cubeb_alsa.c.orig 2023-03-29 20:51:00.139281000 +0200 +++ media/libcubeb/src/cubeb_alsa.c 2023-03-29 20:51:46.219013000 +0200 @@ -5,12 +5,16 @@ * accompanying file LICENSE for details. */ #undef NDEBUG +#if defined(__FreeBSD__) +#define _GNU_SOURCE +#else #define _DEFAULT_SOURCE #define _BSD_SOURCE #if defined(__NetBSD__) #define _NETBSD_SOURCE /* timersub() */ #endif #define _XOPEN_SOURCE 500 +#endif #include "cubeb-internal.h" #include "cubeb/cubeb.h" #include "cubeb_tracing.h" [FILE:2086:patches/patch-bug1716707] commit ce7a2f400d4f599c72e32e2635fee7ea94c0848c Author: Christoph Moench-Tegeder Date: Wed Apr 13 14:44:46 2022 +0200 big-endian color fixes, but without breaking little-endian as le is what most people actually use diff --git gfx/webrender_bindings/RenderCompositorSWGL.cpp gfx/webrender_bindings/RenderCompositorSWGL.cpp index dbf137c849ee..243a01ff9cf3 100644 --- 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 @@ -235,6 +236,13 @@ void RenderCompositorSWGL::CommitMappedBuffer(bool aDirty) { } 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(); diff --git image/imgFrame.cpp image/imgFrame.cpp index e58c3dd5b2d4..c1e7e77c362b 100644 --- image/imgFrame.cpp +++ image/imgFrame.cpp @@ -372,6 +372,17 @@ nsresult imgFrame::InitWithDrawable(gfxDrawable* aDrawable, return NS_ERROR_OUT_OF_MEMORY; } +#if MOZ_BIG_ENDIAN() + 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); + } + } +#endif + if (!canUseDataSurface) { // We used an offscreen surface, which is an "optimized" surface from // imgFrame's perspective. [FILE:7594:patches/patch-bug847568] Allow building against system-wide graphite2/harfbuzz diff --git config/system-headers.mozbuild config/system-headers.mozbuild index af44c89057fc..c0ac271917fb 100644 --- config/system-headers.mozbuild +++ config/system-headers.mozbuild @@ -1304,6 +1304,19 @@ if CONFIG["MOZ_ENABLE_LIBPROXY"]: "proxy.h", ] +if CONFIG['MOZ_SYSTEM_GRAPHITE2']: + system_headers += [ + 'graphite2/Font.h', + 'graphite2/Segment.h', + ] + +if CONFIG['MOZ_SYSTEM_HARFBUZZ']: + system_headers += [ + 'harfbuzz/hb-glib.h', + 'harfbuzz/hb-ot.h', + 'harfbuzz/hb.h', + ] + if CONFIG["MOZ_SYSTEM_ICU"]: system_headers += [ "unicode/calendar.h", diff --git dom/base/moz.build dom/base/moz.build index 170d19f09aa9..a47fc8b1193c 100644 --- dom/base/moz.build +++ dom/base/moz.build @@ -620,6 +620,9 @@ FINAL_LIBRARY = "xul" if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"] +if CONFIG["MOZ_SYSTEM_HARFBUZZ"]: + CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"] + GeneratedFile( "UseCounterList.h", script="gen-usecounters.py", diff --git gfx/graphite2/geckoextra/moz.build gfx/graphite2/geckoextra/moz.build new file mode 100644 index 000000000000..ed0323eba9d5 --- /dev/null +++ gfx/graphite2/geckoextra/moz.build @@ -0,0 +1,21 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +EXPORTS.graphite2 += [ + 'include/GraphiteExtra.h', + 'include/GraphiteStructsForRLBox.h', +] + +UNIFIED_SOURCES += [ + '../geckoextra/src/GraphiteExtra.cpp', +] + +CXXFLAGS += CONFIG['MOZ_GRAPHITE2_CFLAGS'] + +# Match bundled graphite2 configuration +AllowCompilerWarnings() + +FINAL_LIBRARY = 'xul' diff --git gfx/harfbuzz/README-mozilla.fbsd gfx/harfbuzz/README-mozilla.fbsd new file mode 100644 index 000000000000..2a10eb1e2b42 --- /dev/null +++ gfx/harfbuzz/README-mozilla.fbsd @@ -0,0 +1,4 @@ +The in-tree copy may be omitted during build by --with-system-harfbuzz. +Make sure to keep pkg-config version check within toolkit/moz.configure in sync +with checkout version or increment latest tag by one if it's not based +on upstream release. diff --git gfx/moz.build gfx/moz.build index 56ea317bedfc..07dd7f66f1bc 100644 --- gfx/moz.build +++ gfx/moz.build @@ -10,6 +10,14 @@ with Files("**"): with Files("wr/**"): BUG_COMPONENT = ("Core", "Graphics: WebRender") +if CONFIG["MOZ_SYSTEM_GRAPHITE2"]: + DIRS += ["graphite2/geckoextra"] +else: + DIRS += ["graphite2/src" ] + +if not CONFIG["MOZ_SYSTEM_HARFBUZZ"]: + DIRS += ["harfbuzz/src"] + DIRS += [ "cairo", "2d", @@ -19,8 +27,6 @@ DIRS += [ "qcms", "gl", "layers", - "graphite2/src", - "harfbuzz/src", "ots/src", "thebes", "ipc", diff --git gfx/skia/generate_mozbuild.py gfx/skia/generate_mozbuild.py index b589efde1c5c..47f49e10df70 100755 --- gfx/skia/generate_mozbuild.py +++ gfx/skia/generate_mozbuild.py @@ -95,6 +95,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'): LOCAL_INCLUDES += [ "/gfx/cairo/cairo/src", diff --git gfx/skia/moz.build gfx/skia/moz.build index 7fee54534878..ba1a4038e4a0 100644 --- gfx/skia/moz.build +++ gfx/skia/moz.build @@ -623,6 +623,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'): LOCAL_INCLUDES += [ "/gfx/cairo/cairo/src", diff --git gfx/thebes/moz.build gfx/thebes/moz.build index 48f2849e2025..7d0a161a91b4 100644 --- gfx/thebes/moz.build +++ gfx/thebes/moz.build @@ -295,7 +295,13 @@ 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"] CXXFLAGS += ["-Werror=switch"] diff --git intl/unicharutil/util/moz.build intl/unicharutil/util/moz.build index 2396210428ee..092baac6f79c 100644 --- intl/unicharutil/util/moz.build +++ intl/unicharutil/util/moz.build @@ -24,6 +24,9 @@ UNIFIED_SOURCES += [ "nsUnicodeProperties.cpp", ] +if CONFIG["MOZ_SYSTEM_HARFBUZZ"]: + CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"] + include("/ipc/chromium/chromium-config.mozbuild") GeneratedFile( diff --git netwerk/dns/moz.build netwerk/dns/moz.build index 1bb0430f01aa..0360e0f468c0 100644 --- netwerk/dns/moz.build +++ netwerk/dns/moz.build @@ -111,6 +111,9 @@ GeneratedFile( "etld_data.inc", script="prepare_tlds.py", inputs=["effective_tld_names.dat"] ) +if CONFIG["MOZ_SYSTEM_HARFBUZZ"]: + CXXFLAGS += CONFIG["MOZ_HARFBUZZ_CFLAGS"] + # need to include etld_data.inc LOCAL_INCLUDES += [ "/netwerk/base", diff --git security/rlbox/moz.build security/rlbox/moz.build index 7ad8d076f0f1..835b9d905e03 100644 --- security/rlbox/moz.build +++ security/rlbox/moz.build @@ -47,6 +47,8 @@ if CONFIG["MOZ_WASM_SANDBOXING_GRAPHITE"]: for k, v in graphite_defines: WASM_DEFINES[k] = v LOCAL_INCLUDES += ["/gfx/graphite2/src"] + if CONFIG["MOZ_SYSTEM_GRAPHITE2"]: + WASM_CXXFLAGS += CONFIG["MOZ_GRAPHITE2_CFLAGS"] if CONFIG["MOZ_WASM_SANDBOXING_OGG"]: include("/media/libogg/sources.mozbuild") diff --git toolkit/library/moz.build toolkit/library/moz.build index ee6051567c8e..c24a5a513bbc 100644 --- toolkit/library/moz.build +++ toolkit/library/moz.build @@ -298,6 +298,12 @@ if CONFIG["MOZ_SYSTEM_PNG"]: if CONFIG["MOZ_SYSTEM_WEBP"]: OS_LIBS += CONFIG["MOZ_WEBP_LIBS"] +if CONFIG["MOZ_SYSTEM_GRAPHITE2"]: + OS_LIBS += CONFIG["MOZ_GRAPHITE2_LIBS"] + +if CONFIG["MOZ_SYSTEM_HARFBUZZ"]: + OS_LIBS += CONFIG["MOZ_HARFBUZZ_LIBS"] + if CONFIG["MOZ_SYSTEM_LIBEVENT"]: OS_LIBS += CONFIG["MOZ_LIBEVENT_LIBS"] diff --git toolkit/moz.configure toolkit/moz.configure index 1f85d2831f2f..04ce56e2cc0b 100644 --- toolkit/moz.configure +++ toolkit/moz.configure @@ -1397,6 +1397,26 @@ def enable_cairo_ft(target, tree_freetype, freetype2_info): set_config("MOZ_ENABLE_CAIRO_FT", True, when=enable_cairo_ft) set_config("CAIRO_FT_CFLAGS", ft2_info.cflags, when=enable_cairo_ft) +# Graphite2 +# ============================================================== +option("--with-system-graphite2", + help="Use system graphite2 (located with pkgconfig)") + +system_graphite2 = pkg_check_modules("MOZ_GRAPHITE2", "graphite2", + when="--with-system-graphite2") + +set_config("MOZ_SYSTEM_GRAPHITE2", depends_if(system_graphite2)(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)) + # WebDriver (HTTP / BiDi) # ============================================================== [FILE:402:patches/patch-build_autoconf_config.guess] --- build/autoconf/config.guess.orig 2023-03-10 22:19:01 UTC +++ build/autoconf/config.guess @@ -284,7 +284,7 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE ;; *:MidnightBSD:*:*) - GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE + GUESS=%%MBSD64_TGT%% ;; *:ekkoBSD:*:*) GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE [FILE:2094:patches/patch-build_gn__processor.py] commit bcf74d8c7a315c4f8ef70f1a60d4ce957cebac1d Author: Christoph Moench-Tegeder FreeBSD workings for webrtc configure (gn_processor.py) diff --git build/gn_processor.py build/gn_processor.py index 36cc6bdfe492..ed0fb2b7aa45 100644 --- build/gn_processor.py +++ build/gn_processor.py @@ -186,6 +186,7 @@ def filter_gn_config(path, gn_result, sandbox_vars, input_vars, gn_target): } oses = { "android": "Android", + "freebsd": "FreeBSD", "linux": "Linux", "mac": "Darwin", "openbsd": "OpenBSD", @@ -801,17 +802,17 @@ def main(): vars_set = [] for is_debug in (True, False): - for target_os in ("android", "linux", "mac", "openbsd", "win"): + for target_os in ("freebsd",): target_cpus = ["x64"] - if target_os in ("android", "linux", "mac", "win", "openbsd"): + if target_os in ("android", "freebsd", "linux", "mac", "win", "openbsd"): target_cpus.append("arm64") if target_os in ("android", "linux"): target_cpus.append("arm") - if target_os in ("android", "linux", "win"): + if target_os in ("android", "freebsd", "linux", "win"): target_cpus.append("x86") - if target_os in ("linux", "openbsd"): + if target_os in ("freebsd", "linux", "openbsd"): target_cpus.append("riscv64") - if target_os == "linux": + if target_os in ("freebsd", "linux"): target_cpus.extend(["loong64", "ppc64", "mipsel", "mips64el"]) for target_cpu in target_cpus: vars = { @@ -820,7 +821,7 @@ def main(): "target_cpu": target_cpu, "target_os": target_os, } - if target_os == "linux": + if target_os in ("freebsd", "linux"): for enable_x11 in (True, False): vars["ozone_platform_x11"] = enable_x11 vars_set.append(vars.copy()) [FILE:416:patches/patch-comm__third_party__rnpdefs.mozbuild] --- comm/third_party/rnpdefs.mozbuild.orig 2021-08-11 20:13:25.176921000 +0200 +++ comm/third_party/rnpdefs.mozbuild 2021-08-11 20:14:08.855374000 +0200 @@ -43,6 +43,6 @@ OS_LIBS += [static_libdir, "-l:libc++.a", "-l:libc++abi.a"] -if CONFIG["OS_ARCH"] in ("Linux", "SunOS"): +if CONFIG["OS_ARCH"] in ("Linux", "FreeBSD", "DragonFly", "SunOS", "NetBSD"): CFLAGS += ["-fPIC"] CXXFLAGS += ["-fPIC"] [FILE:421:patches/patch-comm_mail_app_nsMailApp.cpp] --- comm/mail/app/nsMailApp.cpp.orig 2020-07-13 18:10:03 UTC +++ comm/mail/app/nsMailApp.cpp @@ -306,6 +306,9 @@ int main(int argc, char* argv[], char* e } #endif + setenv("MOZ_GMP_PATH", "%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko", 0); + setenv("MOZ_PLUGIN_PATH", "%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko", 0); + #ifdef HAS_DLL_BLOCKLIST DllBlocklist_Initialize(gBlocklistInitFlags); #endif [FILE:365:patches/patch-comm_third__party_rust_mtu_build.rs] --- comm/third_party/rust/mtu/build.rs.orig 2025-04-12 05:14:10 UTC +++ comm/third_party/rust/mtu/build.rs @@ -103,6 +103,7 @@ fn main() { target_os = "freebsd", target_os = "openbsd", target_os = "netbsd", + target_os = "dragonfly", target_os = "solaris" ) } [FILE:691:patches/patch-comm_third__party_rust_mtu_src_bsd.rs] --- comm/third_party/rust/mtu/src/bsd.rs.orig 2025-04-12 05:14:10 UTC +++ comm/third_party/rust/mtu/src/bsd.rs @@ -50,7 +50,7 @@ const ALIGN: usize = std::mem::size_of:: // See https://github.com/Arquivotheca/Solaris-8/blob/2ad1d32f9eeed787c5adb07eb32544276e2e2444/osnet_volume/usr/src/cmd/cmd-inet/usr.sbin/route.c#L238-L239 const ALIGN: usize = std::mem::size_of::(); -#[cfg(any(target_os = "macos", target_os = "freebsd", target_os = "openbsd"))] +#[cfg(any(target_os = "macos", target_os = "freebsd", target_os = "openbsd", target_os = "dragonfly"))] asserted_const_with_type!(RTM_ADDRS, i32, RTA_DST, u32); #[cfg(any(target_os = "netbsd", target_os = "solaris"))] [FILE:3490:patches/patch-comm_third__party_rust_quinn-udp_src_unix.rs] --- comm/third_party/rust/quinn-udp/src/unix.rs.orig 2025-04-12 05:14:10 UTC +++ comm/third_party/rust/quinn-udp/src/unix.rs @@ -55,12 +55,14 @@ extern "C" { // rely on this from the libc crate. #[cfg(any(target_os = "openbsd", target_os = "netbsd"))] const IPV6_DONTFRAG: libc::c_int = 62; -#[cfg(not(any(target_os = "openbsd", target_os = "netbsd")))] +#[cfg(not(any(target_os = "openbsd", target_os = "netbsd", target_os = "dragonfly")))] const IPV6_DONTFRAG: libc::c_int = libc::IPV6_DONTFRAG; +#[cfg(target_os = "dragonfly")] +const IPV6_DONTFRAG: libc::c_int = 0; -#[cfg(target_os = "freebsd")] +#[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] type IpTosTy = libc::c_uchar; -#[cfg(not(any(target_os = "freebsd", target_os = "netbsd")))] +#[cfg(not(any(target_os = "freebsd", target_os = "netbsd", target_os = "dragonfly")))] type IpTosTy = libc::c_int; /// Tokio-compatible UDP socket with some useful specializations. @@ -113,7 +115,7 @@ impl UdpSocketState { // mac and ios do not support IP_RECVTOS on dual-stack sockets :( // older macos versions also don't have the flag and will error out if we don't ignore it - #[cfg(not(any(target_os = "openbsd", target_os = "netbsd", solarish)))] + #[cfg(not(any(target_os = "openbsd", target_os = "netbsd", target_os = "dragonfly", solarish)))] if is_ipv4 || !io.only_v6()? { if let Err(_err) = set_socket_option(&*io, libc::IPPROTO_IP, libc::IP_RECVTOS, OPTION_ON) @@ -278,7 +280,7 @@ fn send( ) -> io::Result<()> { #[allow(unused_mut)] // only mutable on FreeBSD let mut encode_src_ip = true; - #[cfg(target_os = "freebsd")] + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] { let addr = io.local_addr()?; let is_ipv4 = addr.family() == libc::AF_INET as libc::sa_family_t; @@ -452,7 +454,7 @@ fn send(state: &UdpSocketState, io: Sock } } -#[cfg(not(any(apple, target_os = "openbsd", target_os = "netbsd", solarish)))] +#[cfg(not(any(apple, target_os = "openbsd", target_os = "netbsd", target_os = "dragonfly", solarish)))] fn recv(io: SockRef<'_>, bufs: &mut [IoSliceMut<'_>], meta: &mut [RecvMeta]) -> io::Result { let mut names = [MaybeUninit::::uninit(); BATCH_SIZE]; let mut ctrls = [cmsg::Aligned(MaybeUninit::<[u8; CMSG_LEN]>::uninit()); BATCH_SIZE]; @@ -519,7 +521,7 @@ fn recv(io: SockRef<'_>, bufs: &mut [IoS Ok(msg_count as usize) } -#[cfg(any(target_os = "openbsd", target_os = "netbsd", solarish, apple_slow))] +#[cfg(any(target_os = "openbsd", target_os = "netbsd", target_os = "dragonfly", solarish, apple_slow))] fn recv(io: SockRef<'_>, bufs: &mut [IoSliceMut<'_>], meta: &mut [RecvMeta]) -> io::Result { let mut name = MaybeUninit::::uninit(); let mut ctrl = cmsg::Aligned(MaybeUninit::<[u8; CMSG_LEN]>::uninit()); @@ -689,7 +691,7 @@ fn decode_recv( ecn_bits = cmsg::decode::(cmsg); }, // FreeBSD uses IP_RECVTOS here, and we can be liberal because cmsgs are opt-in. - #[cfg(not(any(target_os = "openbsd", target_os = "netbsd", solarish)))] + #[cfg(not(any(target_os = "openbsd", target_os = "netbsd", target_os = "dragonfly", solarish)))] (libc::IPPROTO_IP, libc::IP_RECVTOS) => unsafe { ecn_bits = cmsg::decode::(cmsg); }, [FILE:694:patches/patch-config_system-headers.mozbuild] --- config/system-headers.mozbuild.intermediate 2025-12-17 18:42:29 UTC +++ config/system-headers.mozbuild @@ -865,7 +865,6 @@ system_headers = [ "sys/shm.h", "sys/siginfo.h", "sys/signal.h", - "sys/single_threaded.h", "sys/socket.h", "sys/sockio.h", "sys/sparc/frame.h", @@ -1387,9 +1386,10 @@ if CONFIG["MOZ_WAYLAND"]: "wayland-util.h", ] -if CONFIG["OS_TARGET"] in ("Android", "Linux", "FreeBSD"): +if CONFIG["OS_TARGET"] in ("Android", "Linux", "FreeBSD", "DragonFly"): system_headers += [ "sys/auxv.h", + "sys/single_threaded.h", ] if CONFIG["OS_TARGET"] == "Linux" and CONFIG["TARGET_CPU"].startswith("mips"): [FILE:914:patches/patch-env-api-keys] # Accept API keys from environment like before bug 1294585 --- build/moz.configure/keyfiles.configure +++ build/moz.configure/keyfiles.configure @@ -19,6 +19,7 @@ def keyfile(desc, default=None, help=None, callback=lambda x: x): @checking("for the %s key" % desc, lambda x: x and x is not no_key) @imports(_from="__builtin__", _import="open") @imports(_from="__builtin__", _import="IOError") + @imports(_from="os", _import="environ") def keyfile(value): if value: try: @@ -29,7 +30,7 @@ def keyfile(desc, default=None, help=None, callback=lambda x: x): raise FatalCheckError("'%s' is empty." % value[0]) except IOError as e: raise FatalCheckError("'%s': %s." % (value[0], e.strerror)) - return no_key + return environ.get("MOZ_%s_KEY" % desc.upper().replace(" ", "_")) or no_key return keyfile [FILE:742:patches/patch-i386-protobuf-alignment] # On FreeBSD/i386's LLVM, actual alignment for atomic types requires # stricter alignment rules, mostly on 8 byte boundaries instead of 4 byte # as indicated by max_align_t. --- ./toolkit/components/protobuf/src/google/protobuf/arena_impl.h.orig 2022-08-20 20:07:57.096818000 +0200 +++ ./toolkit/components/protobuf/src/google/protobuf/arena_impl.h 2022-08-20 21:40:47.821690000 +0200 @@ -640,7 +640,7 @@ #ifdef _MSC_VER #pragma warning(disable : 4324) #endif - struct alignas(kCacheAlignment) CacheAlignedLifecycleIdGenerator { + struct alignas(alignof(std::atomic)) CacheAlignedLifecycleIdGenerator { std::atomic id; }; static CacheAlignedLifecycleIdGenerator lifecycle_id_generator_; [FILE:712:patches/patch-ipc_glue_GeckoChildProcessHost.cpp] diff --git ipc/glue/GeckoChildProcessHost.cpp ipc/glue/GeckoChildProcessHost.cpp index 9bb8314bd98c..2bc0382a9385 100644 --- ipc/glue/GeckoChildProcessHost.cpp +++ ipc/glue/GeckoChildProcessHost.cpp @@ -1121,7 +1121,7 @@ Result BaseProcessLauncher::DoSetup() { #if defined(MOZ_WIDGET_COCOA) || defined(XP_WIN) geckoargs::sCrashReporter.Put(CrashReporter::GetChildNotificationPipe(), mChildArgs); -#elif defined(XP_UNIX) && !defined(XP_IOS) +#elif defined(XP_UNIX) && defined(__linux__) UniqueFileHandle childCrashFd = CrashReporter::GetChildNotificationPipe(); if (!childCrashFd) { return Err(LaunchError("DuplicateFileHandle failed")); [FILE:443:patches/patch-ipc_glue_SharedMemoryPlatform__posix.cpp] --- ipc/glue/SharedMemoryPlatform_posix.cpp.orig 2025-05-12 17:23:25 UTC +++ ipc/glue/SharedMemoryPlatform_posix.cpp @@ -449,7 +449,7 @@ bool Platform::Protect(char* aAddr, size } void* Platform::FindFreeAddressSpace(size_t aSize) { -#ifndef __FreeBSD__ +#if !defined(__FreeBSD__) && !defined(__DragonFly__) constexpr int flags = MAP_ANONYMOUS | MAP_NORESERVE | MAP_PRIVATE; #else constexpr int flags = MAP_ANONYMOUS | MAP_PRIVATE; [FILE:1584:patches/patch-js_public_Utility.h] commit 57b30241311091b5a6a5a0bb1c19a8e073860fc3 Author: Christoph Moench-Tegeder do not assert on alignment when not having the bits the underlying issue seemed to be win-only anyways? diff --git js/public/Utility.h js/public/Utility.h index 0d745e9df785..f0ca7ea37162 100644 --- js/public/Utility.h +++ js/public/Utility.h @@ -480,6 +480,7 @@ static inline void js_free(void* p) { * Note: Do not add a ; at the end of a use of JS_DECLARE_NEW_METHODS, * or the build will break. */ +#if !defined(__i386__) #define JS_DECLARE_NEW_METHODS(NEWNAME, ALLOCATOR, QUALIFIERS) \ template \ QUALIFIERS T* MOZ_HEAP_ALLOCATOR NEWNAME(Args&&... args) { \ @@ -490,6 +491,15 @@ static inline void js_free(void* p) { return MOZ_LIKELY(memory) ? new (memory) T(std::forward(args)...) \ : nullptr; \ } +#else +#define JS_DECLARE_NEW_METHODS(NEWNAME, ALLOCATOR, QUALIFIERS) \ + template \ + QUALIFIERS T* MOZ_HEAP_ALLOCATOR NEWNAME(Args&&... args) { \ + void* memory = ALLOCATOR(sizeof(T)); \ + return MOZ_LIKELY(memory) ? new (memory) T(std::forward(args)...) \ + : nullptr; \ + } +#endif /* * Given a class which should provide a 'new' method that takes an arena as [FILE:662:patches/patch-mail-app-nsMailApp.cpp] diff --git comm/mail/app/nsMailApp.cpp comm/mail/app/nsMailApp.cpp index 3db646e89d..2318337f7b 100644 --- comm/mail/app/nsMailApp.cpp +++ comm/mail/app/nsMailApp.cpp @@ -280,6 +280,9 @@ int main(int argc, char* argv[], char* envp[]) { mozilla::TimeStamp start = mozilla::TimeStamp::Now(); + setenv("MOZ_GMP_PATH", "%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko", 0); + setenv("MOZ_PLUGIN_PATH", "%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko", 0); + // Make sure we unregister the runtime exception module before returning. // We do this here to cover both registers for child and main processes. auto unregisterRuntimeExceptionModule = [FILE:357:patches/patch-media_ffvpx_libavutil_cpu.c] --- media/ffvpx/libavutil/cpu.c.orig 2025-04-12 05:13:46 UTC +++ media/ffvpx/libavutil/cpu.c @@ -49,6 +49,13 @@ #include #endif +#if defined(__DragonFly__) +#undef HAVE_GETAUXVAL +#undef HAVE_ELF_AUX_INFO +#define HAVE_GETAUXVAL 0 +#define HAVE_ELF_AUX_INFO 0 +#endif + #if HAVE_GETAUXVAL || HAVE_ELF_AUX_INFO #include #endif [FILE:736:patches/patch-modules_fdlibm_src_math__private.h] commit 7a20fbf537ee0867244109d1ea48a8ad9de2e4ea Author: Christoph Moench-Tegeder align typedefs with our libm for historical CPUs diff --git modules/fdlibm/src/math_private.h modules/fdlibm/src/math_private.h index f4373f27834a..3b898241660f 100644 --- modules/fdlibm/src/math_private.h +++ modules/fdlibm/src/math_private.h @@ -30,9 +30,17 @@ * Adapted from https://github.com/freebsd/freebsd-src/search?q=__double_t */ +#ifdef __LP64__ typedef double __double_t; +#else +typedef long double __double_t; +#endif typedef __double_t double_t; +#ifdef __LP64__ typedef float __float_t; +#else +typedef long double __float_t; +#endif /* * The original fdlibm code used statements like: [FILE:2549:patches/patch-mozglue_misc_SSE.h] commit 70c3be521da1296f7ba47bd07b67927e43634d1b Author: Christoph Moench-Tegeder disable SSE and friends in builds for legacy architectures diff --git gfx/thebes/moz.build gfx/thebes/moz.build index 71903756ea19..3591cc0f38e8 100644 --- gfx/thebes/moz.build +++ gfx/thebes/moz.build @@ -174,7 +174,7 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows": ] # Are we targeting x86 or x64? If so, build gfxAlphaRecoverySSE2.cpp. -if CONFIG["INTEL_ARCHITECTURE"]: +if CONFIG["INTEL_ARCHITECTURE"] and CONFIG['TARGET_CPU'] == 'x86_64': SOURCES += ["gfxAlphaRecoverySSE2.cpp"] # The file uses SSE2 intrinsics, so it needs special compile flags on some # compilers. diff --git mozglue/misc/SSE.h mozglue/misc/SSE.h index 0b87366a8043..af0a0b38d23c 100644 --- mozglue/misc/SSE.h +++ mozglue/misc/SSE.h @@ -100,36 +100,50 @@ # define MOZILLA_PRESUME_MMX 1 # endif # ifdef __SSE__ +# if !defined(__386__) // It's ok to use SSE instructions based on the -march option (or // the default for x86_64 or for Intel Mac). # define MOZILLA_PRESUME_SSE 1 # endif +# endif # ifdef __SSE2__ +# if !defined(__386__) // It's ok to use SSE2 instructions based on the -march option (or // the default for x86_64 or for Intel Mac). # define MOZILLA_PRESUME_SSE2 1 # endif +# endif # ifdef __SSE3__ +# if !defined(__386__) // It's ok to use SSE3 instructions based on the -march option (or the // default for Intel Mac). # define MOZILLA_PRESUME_SSE3 1 # endif +# endif # ifdef __SSSE3__ +# if !defined(__386__) // It's ok to use SSSE3 instructions based on the -march option. # define MOZILLA_PRESUME_SSSE3 1 # endif +# endif # ifdef __SSE4A__ +# if !defined(__386__) // It's ok to use SSE4A instructions based on the -march option. # define MOZILLA_PRESUME_SSE4A 1 # endif +# endif # ifdef __SSE4_1__ +# if !defined(__386__) // It's ok to use SSE4.1 instructions based on the -march option. # define MOZILLA_PRESUME_SSE4_1 1 # endif +# endif # ifdef __SSE4_2__ +# if !defined(__386__) // It's ok to use SSE4.2 instructions based on the -march option. # define MOZILLA_PRESUME_SSE4_2 1 # endif +# endif # ifdef __AVX__ // It's ok to use AVX instructions based on the -march option. # define MOZILLA_PRESUME_AVX 1 @@ -144,8 +158,10 @@ # endif # ifdef HAVE_CPUID_H +# if !defined(__i386__) # define MOZILLA_SSE_HAVE_CPUID_DETECTION # endif +# endif #elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64)) [FILE:877:patches/patch-mozglue_static_rust_lib.rs] --- mozglue/static/rust/lib.rs.orig 2024-07-04 17:04:21 UTC +++ mozglue/static/rust/lib.rs @@ -157,7 +157,7 @@ extern "C" { fn _aligned_free(ptr: *mut c_void); #[cfg(not(windows))] - fn memalign(align: usize, size: usize) -> *mut c_void; + fn posix_memalign(ptr: *mut *mut c_void, alignment: usize, size: usize) -> c_int; } #[cfg(windows)] @@ -177,7 +177,9 @@ fn need_memalign(layout: Layout) -> bool unsafe impl GlobalAlloc for GeckoAlloc { unsafe fn alloc(&self, layout: Layout) -> *mut u8 { if need_memalign(layout) { - memalign(layout.align(), layout.size()) as *mut u8 + let mut ptr: *mut c_void = std::ptr::null_mut(); + let _err = posix_memalign(&mut ptr, layout.align(), layout.size()); + return ptr as *mut u8; } else { malloc(layout.size()) as *mut u8 } [FILE:5116:patches/patch-pipewire_init] Chase ABI from multimedia/pipewire/files/patch-src_pipewire_pipewire_init Ref: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1819 diff --git third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc index ab9054f1a1..c59b030dff 100644 --- third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc +++ third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc @@ -412,7 +412,7 @@ bool SharedScreenCastStreamPrivate::StartScreenCastStream( pw_stream_node_id_ = stream_node_id; - pw_init(/*argc=*/nullptr, /*argc=*/nullptr); + pipewire_init(/*argc=*/nullptr, /*argc=*/nullptr); pw_main_loop_ = pw_thread_loop_new("pipewire-main-loop", nullptr); diff --git third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.cc third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.cc index 10551047a9..9ea288ca31 100644 --- third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.cc +++ third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.cc @@ -36,7 +36,7 @@ TestScreenCastStreamProvider::TestScreenCastStreamProvider(Observer* observer, return; } - pw_init(/*argc=*/nullptr, /*argc=*/nullptr); + pipewire_init(/*argc=*/nullptr, /*argc=*/nullptr); pw_main_loop_ = pw_thread_loop_new("pipewire-test-main-loop", nullptr); diff --git third_party/libwebrtc/modules/portal/pipewire.sigs third_party/libwebrtc/modules/portal/pipewire.sigs index c3abf05b38..a994c218f5 100644 --- third_party/libwebrtc/modules/portal/pipewire.sigs +++ third_party/libwebrtc/modules/portal/pipewire.sigs @@ -15,7 +15,7 @@ pw_loop * pw_loop_new(const spa_dict *props); // pipewire.h -void pw_init(int *argc, char **argv[]); +void pipewire_init(int *argc, char **argv[]); const char* pw_get_library_version(); // properties.h diff --git third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc index d52d6aacc8..6def031d77 100644 --- third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc +++ third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc @@ -259,7 +259,7 @@ void PipeWireSession::InitPipeWire(int fd) { } bool PipeWireSession::StartPipeWire(int fd) { - pw_init(/*argc=*/nullptr, /*argv=*/nullptr); + pipewire_init(/*argc=*/nullptr, /*argv=*/nullptr); pw_main_loop_ = pw_thread_loop_new("pipewire-main-loop", nullptr); diff --git third_party/pipewire/libpipewire/mozpipewire.cpp third_party/pipewire/libpipewire/mozpipewire.cpp index b806829674..7e8be3dc76 100644 --- third_party/pipewire/libpipewire/mozpipewire.cpp +++ third_party/pipewire/libpipewire/mozpipewire.cpp @@ -58,7 +58,7 @@ struct pw_context * (*pw_context_new_fn)(struct pw_loop *main_loop, struct pw_properties *props, size_t user_data_size); static int (*pw_core_disconnect_fn)(struct pw_core *core); -static void (*pw_init_fn)(int *argc, char **argv[]); +static void (*pipewire_init_fn)(int *argc, char **argv[]); static void (*pw_proxy_destroy_fn)(struct pw_proxy *proxy); static void (*pw_stream_add_listener_fn)(struct pw_stream *stream, struct spa_hook *listener, @@ -103,7 +103,7 @@ bool IsPwLibraryLoaded() { IS_FUNC_LOADED(pw_context_destroy_fn) && IS_FUNC_LOADED(pw_context_new_fn) && IS_FUNC_LOADED(pw_core_disconnect_fn) && - IS_FUNC_LOADED(pw_init_fn) && + IS_FUNC_LOADED(pipewire_init_fn) && IS_FUNC_LOADED(pw_proxy_destroy_fn) && IS_FUNC_LOADED(pw_stream_add_listener_fn) && IS_FUNC_LOADED(pw_stream_connect_fn) && @@ -146,7 +146,7 @@ bool LoadPWLibrary() { GET_FUNC(pw_context_destroy, pwLib); GET_FUNC(pw_context_new, pwLib); GET_FUNC(pw_core_disconnect, pwLib); - GET_FUNC(pw_init, pwLib); + GET_FUNC(pipewire_init, pwLib); GET_FUNC(pw_stream_add_listener, pwLib); GET_FUNC(pw_stream_connect, pwLib); GET_FUNC(pw_stream_disconnect, pwLib); @@ -226,12 +226,12 @@ pw_core_disconnect(struct pw_core *core) } void -pw_init(int *argc, char **argv[]) +pipewire_init(int *argc, char **argv[]) { if (!LoadPWLibrary()) { return; } - return pw_init_fn(argc, argv); + return pipewire_init_fn(argc, argv); } void diff --git third_party/pipewire/pipewire/pipewire.h third_party/pipewire/pipewire/pipewire.h index b932103f46..2c88e28421 100644 --- third_party/pipewire/pipewire/pipewire.h +++ third_party/pipewire/pipewire/pipewire.h @@ -69,9 +69,9 @@ extern "C" { * \{ */ void -pw_init(int *argc, char **argv[]); +pipewire_init(int *argc, char **argv[]); -void pw_deinit(void); +void pipewire_deinit(void); bool pw_debug_is_category_enabled(const char *name); [FILE:488:patches/patch-testing_mozbase_mozinfo_mozinfo_mozinfo.py] --- testing/mozbase/mozinfo/mozinfo/mozinfo.py.orig 2025-05-12 17:23:32 UTC +++ testing/mozbase/mozinfo/mozinfo/mozinfo.py @@ -103,7 +103,7 @@ elif system == "Linux": info["os"] = "linux" info["linux_distro"] = distribution -elif system in ["DragonFly", "FreeBSD", "NetBSD", "OpenBSD"]: +elif system in ["DragonFly", "FreeBSD", "NetBSD", "OpenBSD", "MidnightBSD"]: info["os"] = "bsd" # community builds version = os_version = sys.platform elif system == "Darwin": [FILE:678:patches/patch-third__party_abseil-cpp_absl_debugging_internal_elf__mem__image.cc] Fix build on NetBSD 10 (and 11) --- third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc.orig 2025-12-04 02:11:46 UTC +++ third_party/abseil-cpp/absl/debugging/internal/elf_mem_image.cc @@ -377,7 +377,7 @@ void ElfMemImage::SymbolIterator::Update const ElfW(Versym) *version_symbol = image->GetVersym(index_); ABSL_RAW_CHECK(symbol && version_symbol, ""); const char *const symbol_name = image->GetDynstr(symbol->st_name); -#if defined(__NetBSD__) +#if defined(__NetBSD__) && ((_SYS_EXEC_ELF_H_ + 0) < 2) const int version_index = version_symbol->vs_vers & VERSYM_VERSION; #else const ElfW(Versym) version_index = version_symbol[0] & VERSYM_VERSION; [FILE:452:patches/patch-third__party_llama.cpp_ggml_src_ggml-c.c] --- third_party/llama.cpp/ggml/src/ggml-c.c.orig 2025-10-16 03:20:40 UTC +++ third_party/llama.cpp/ggml/src/ggml-c.c @@ -16,7 +16,7 @@ #if defined(_MSC_VER) || defined(__MINGW32__) #include // using malloc.h with MSC/MINGW -#elif !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) +#elif !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__DragonFly__) #include #endif [FILE:478:patches/patch-third__party_llama.cpp_ggml_src_ggml-cpu_ggml-cpu-c.c] --- third_party/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-c.c.orig 2025-10-16 03:20:41 UTC +++ third_party/llama.cpp/ggml/src/ggml-cpu/ggml-cpu-c.c @@ -17,7 +17,7 @@ #if defined(_MSC_VER) || defined(__MINGW32__) #include // using malloc.h with MSC/MINGW -#elif !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) +#elif !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__DragonFly__) #include #endif [FILE:395:patches/patch-third__party_sqlite3_ext_sqlite-vec_sqlite-vec.c] diff --git third_party/sqlite3/ext/sqlite-vec/sqlite-vec.c third_party/sqlite3/ext/sqlite-vec/sqlite-vec.c index 96612e26d385..c43c46136bef 100644 --- third_party/sqlite3/ext/sqlite-vec/sqlite-vec.c +++ third_party/sqlite3/ext/sqlite-vec/sqlite-vec.c @@ -11,6 +11,8 @@ #include #include +#include + #ifndef SQLITE_VEC_OMIT_FS #include #endif [FILE:521:patches/patch-third__party_sqlite3_src_moz.build] --- third_party/sqlite3/src/moz.build.old 2021-08-09 16:08:59.381182000 -0500 +++ third_party/sqlite3/src/moz.build 2021-08-09 16:10:25.370954000 -0500 @@ -92,7 +92,8 @@ # Enabling sqlite math functions DEFINES['SQLITE_ENABLE_MATH_FUNCTIONS'] = True -if CONFIG["OS_TARGET"] == "Linux" or CONFIG["OS_TARGET"] == "Android": +if CONFIG["OS_TARGET"] == "Linux" or CONFIG["OS_TARGET"] == "Android" or \ + CONFIG["OS_TARGET"] == "FreeBSD" or CONFIG["OS_TARGET"] == "DragonFly": OS_LIBS += [ "m" ] [FILE:498:patches/patch-toolkit_components_protobuf_src_google_protobuf_stubs_port.h] --- toolkit/components/protobuf/src/google/protobuf/stubs/port.h.orig 2023-09-28 22:51:59 UTC +++ toolkit/components/protobuf/src/google/protobuf/stubs/port.h @@ -59,7 +59,7 @@ #else #ifdef __APPLE__ #include // __BYTE_ORDER -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) || defined(__DragonFly__) #include // __BYTE_ORDER #elif (defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__)) #include // __BYTE_ORDER [FILE:445:patches/patch-toolkit_library_gen__buildid.py] --- toolkit/library/gen_buildid.py.orig 2024-07-04 17:04:30 UTC +++ toolkit/library/gen_buildid.py @@ -78,7 +78,7 @@ def write_file(output, maybe_buildid): #endif struct note {{ - Elf32_Nhdr header; // Elf32 or Elf64 doesn't matter, they're the same size + Elf64_Nhdr header; // Elf32 or Elf64 doesn't matter, they're the same size char name[(sizeof(note_name) + 3) / 4 * 4]; char desc[(sizeof(note_desc) + 3) / 4 * 4]; }}; [FILE:278:patches/patch-tools_profiler_core_platform.cpp] --- tools/profiler/core/platform.cpp.orig 2024-07-04 17:04:30 UTC +++ tools/profiler/core/platform.cpp @@ -7311,7 +7311,7 @@ void profiler_mark_thread_awake() { cpuId = ebx >> 24; } # endif -#else +#elsif !defined(__MidnightBSD__) cpuId = sched_getcpu(); #endif [FILE:53:files/launch.in] #!/bin/sh %%PREFIX%%/lib/thunderbird/thunderbird $@ [FILE:1318:files/patch-bug1269654] commit ff13efe458e7786d8c810342d25a6ba8e90a422b Author: Christoph Moench-Tegeder based on BMO 1269654 : https://bugzilla.mozilla.org/show_bug.cgi?id=1269654#c5 : https://bug1269654.bmoattachments.org/attachment.cgi?id=8749234 : handle big-endian formats in Cairo format conversions : : HG changeset patch : User Lee Salzman : Date 1462463631 14400 : Thu May 05 11:53:51 2016 -0400 : Node ID 8da374804a09977c8f89af5e6e0cb37cb074595d : Parent 29662e28a9c93ac67ee0b8ddfb65a9f29bbf73f5 : handle big-endian formats in Cairo format conversions diff --git gfx/2d/HelpersCairo.h gfx/2d/HelpersCairo.h index a10e01bdd62b..f2007ee189fc 100644 --- gfx/2d/HelpersCairo.h +++ gfx/2d/HelpersCairo.h @@ -185,7 +185,11 @@ static inline cairo_content_t GfxFormatToCairoContent(SurfaceFormat format) { case SurfaceFormat::A8: return CAIRO_CONTENT_ALPHA; default: - gfxCriticalError() << "Unknown image content format " << (int)format; + if (format == SurfaceFormat::B8G8R8X8) { + return CAIRO_CONTENT_COLOR; + } else if (format != SurfaceFormat::B8G8R8A8) { + gfxCriticalError() << "Unknown image content format " << (int)format; + } return CAIRO_CONTENT_COLOR_ALPHA; } } [FILE:995:files/patch-python_sites_mach.txt] commit 9978044775efea5d7c16949bc4755ce4681fb2f8 Author: Christoph Moench-Tegeder bump psutil (same as ports) 5.9.x breaks mach diff --git python/sites/mach.txt python/sites/mach.txt index 4769fe11257e..e77870ec4f42 100644 --- python/sites/mach.txt +++ python/sites/mach.txt @@ -62,7 +62,7 @@ pypi-optional:orjson>=3.10:json operations will be slower in various tools # Mach gracefully handles the case where `psutil` is unavailable. # We aren't (yet) able to pin packages in automation, so we have to # support down to the oldest locally-installed version (5.4.2). -pypi-optional:psutil>=5.4.2:telemetry will be missing some data +pypi-optional:psutil>=5.4.2,<=7.2.0:telemetry will be missing some data pypi-optional:rtoml>=0.11.0:toml operations will be slower in various tools pypi-optional:zstandard>=0.11.1,<=0.24.0:zstd archives will not be possible to extract vendored-fallback:pyyaml:third_party/python/pyyaml/lib/:faster native loading is disabled [FILE:137:files/special.mk] .if defined(BUILD_WITH_CCACHE) # MAKE_ENV+= SCCACHE_DIR=${CCACHE_DIR}/sccache # MAKE_ENV+= RUSTC_WRAPPER=${LOCALBASE}/bin/sccache .endif [FILE:290:files/thunderbird.desktop] [Desktop Entry] Encoding=UTF-8 Name=Thunderbird GenericName=Mail Client Comment=Mail client and News Reader Exec=thunderbird %u Icon=thunderbird.png StartupNotify=true Terminal=false Type=Application Categories=Network;Email;News;InstantMessaging; MimeType=application/mbox;message/rfc822;