# Buildsheet autogenerated by ravenadm tool -- Do not edit. NAMEBASE= firefox VERSION= 146.0 KEYWORDS= www VARIANTS= std SDESC[std]= Mozilla web browser HOMEPAGE= https://www.mozilla.org/en-US/firefox/ CONTACT= nobody DOWNLOAD_GROUPS= main SITES[main]= MOZILLA/firefox/releases/146.0/source DISTFILE[1]= firefox-146.0.source.tar.xz:main DF_INDEX= 1 SPKGS[std]= single OPTIONS_AVAILABLE= MOLD OPTIONS_STANDARD= MOLD OPT_ON[linux]= MOLD BUILD_DEPENDS= cbindgen:single:std clang:set:std dav1d:dev:std evdev-proto:single:std ffmpeg:dev:std harfbuzz: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 pciutils:dev:std rust:single:std yasm:primary:std zip:primary:std BUILDRUN_DEPENDS= dav1d:primary:std dbus-glib:primary:std ffmpeg:primary:std harfbuzz:primary:std icu:primary:std libcanberra:primary:std libdrm:primary:std libevent:primary:std libffi:primary:std libnotify:primary:std libproxy:primary:std nss:primary:std pciutils:primary:std RUN_DEPENDS= icu:data: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 perl:build pkgconfig png python:build,sqlite zlib GNOME_COMPONENTS= gdkpixbuf gtk3 XORG_COMPONENTS= pixman xcb ice sm LICENSE= MPL:single LICENSE_TERMS= single:{{WRKSRC}}/toolkit/content/license.html LICENSE_FILE= MPL:stock LICENSE_SCHEME= solo CPE_VENDOR= mozilla FPC_EQUIVALENT= www/firefox MUST_CONFIGURE= yes CONFIGURE_OUTSOURCE= yes CONFIGURE_ENV= PYTHON3={{PYTHON_CMD}} SETUPTOOLS_USE_DISTUTILS=stdlib BINDGEN_CFLAGS="-I{{LOCALBASE}}/include" MAKE_ENV= PYTHON3={{PYTHON_CMD}} CXXSTDLIB="stdc++" MOUNT_PROCFS= yes QMAKE_ARGS= --enable-application=browser --enable-chrome-format=omni --enable-default-toolkit=cairo-gtk3 --enable-install-strip --enable-official-branding --enable-optimize --enable-release --enable-strip --enable-libproxy --enable-system-ffi --enable-system-pixman --disable-alsa --disable-debug --disable-debug-symbols --disable-jack --disable-profiling --disable-pulseaudio --disable-tests --disable-updater --disable-webrtc --disable-hardening --prefix="{{PREFIX}}" --with-intl-api --with-system-icu --with-system-jpeg --with-system-libevent --with-system-nspr --with-system-nss --with-system-png --with-system-zlib --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=MOZLDFLAGS=-lrt VAR_OPSYS[midnightbsd]= MAKEFILE_LINE=CONFIGURE_TARGET=x86_64-raven-freebsd12.3 [MOLD].DESCRIPTION= Link Firefox with MOLD rather than ports linker [MOLD].BUILD_DEPENDS_ON= mold:primary:std [MOLD].QMAKE_ARGS_ON= --enable-linker=mold post-patch: ${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ ${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 # disable rust checksums ${REINPLACE_CMD} -e 's/"files":{[^}]*}/"files":{}/' \ ${WRKSRC}/third_party/rust/mtu/.cargo-checksum.json \ ${WRKSRC}/third_party/rust/quinn-udp/.cargo-checksum.json # 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 ${MOZLDFLAGS} -Wl,-rpath,${PREFIX}/lib/firefox\" \ >> ${WRKSRC}/.mozconfig post-install: ${MKDIR} ${STAGEDIR}${PREFIX}/share/pixmaps \ ${STAGEDIR}${PREFIX}/share/applications ${INSTALL_DATA} ${WRKDIR}/firefox.desktop \ ${STAGEDIR}${PREFIX}/share/applications/ (cd ${STAGEDIR}${PREFIX}/share/pixmaps &&\ ${LN} -s ../../lib/firefox/browser/chrome/icons/default/default48.png firefox.png) # Rewrite symlink to make it relative instead of absolute (cd ${STAGEDIR}${PREFIX}/bin &&\ ${RM} firefox &&\ ${LN} -s ../lib/firefox/firefox firefox) post-extract: ${SED} -e 's|@FIREFOX_ICON@|firefox|;s|@MOZILLA@|firefox|' \ < ${FILESDIR}/firefox.desktop.in \ > ${WRKDIR}/firefox.desktop [FILE:527:descriptions/desc.single] Firefox is a full-featured standard-compliant web browser, built on the Mozilla codebase by thousands of contributors around the world. It is extensible through thousands of user-contributed extensions, and features: * Improved Security; * Improved Tabbed Browsing, with tab grouping; * Private Browsing; * Spell Checking; * Search Suggestions; * Session Restore; * Web Feeds (RSS); * Live Titles; * Integrated Search; * Live Bookmarks; * Pop-up Blocker; * Phishing Protection; * Themes; * Search Engine Manager. [FILE:106:distinfo] 08d4cae010abc31603ef74091a5d1f81da8e62d3b66c806690e70f03c422df16 646002476 firefox-146.0.source.tar.xz [FILE:705:manifests/plist.single] %%ONLY-LINUX%%lib/firefox/ crashhelper crashreporter libmozsandbox.so bin/firefox lib/firefox/ application.ini dependentlibs.list firefox firefox-bin glxtest libgkcodecs.so liblgpllibs.so libmozavcodec.so libmozavutil.so libmozgtk.so libmozinference.so libmozsqlite3.so libxul.so omni.ja pingsender platform.ini removed-files vaapitest lib/firefox/browser/omni.ja lib/firefox/browser/chrome/icons/default/ default128.png default16.png default32.png default48.png default64.png lib/firefox/defaults/pref/channel-prefs.js lib/firefox/fonts/TwemojiMozilla.ttf lib/firefox/gmp-clearkey/0.1/ libclearkey.so manifest.json share/applications/firefox.desktop share/pixmaps/firefox.png [FILE:4649:patches/patch-addon-search] https://github.com/mozilla/addons/issues/708 https://github.com/mozilla/addons-frontend/issues/4610 diff --git browser/app/profile/firefox.js browser/app/profile/firefox.js index 5964d40ca3a3..ed81b06af8d5 100644 --- browser/app/profile/firefox.js +++ browser/app/profile/firefox.js @@ -39,7 +39,7 @@ pref("extensions.postDownloadThirdPartyPrompt", true); // Preferences for AMO integration pref("extensions.getAddons.cache.enabled", true); pref("extensions.getAddons.get.url", "https://services.addons.mozilla.org/api/v4/addons/search/?guid=%IDS%&lang=%LOCALE%"); -pref("extensions.getAddons.search.browseURL", "https://addons.mozilla.org/%LOCALE%/firefox/search?q=%TERMS%&platform=%OS%&appver=%VERSION%"); +pref("extensions.getAddons.search.browseURL", "https://addons.mozilla.org/%LOCALE%/firefox/search?q=%TERMS%&platform=Linux&appver=%VERSION%"); pref("extensions.getAddons.link.url", "https://addons.mozilla.org/%LOCALE%/firefox/"); pref("extensions.getAddons.langpacks.url", "https://services.addons.mozilla.org/api/v4/addons/language-tools/?app=firefox&type=language&appversion=%VERSION%"); pref("extensions.getAddons.discovery.api_url", "https://services.addons.mozilla.org/api/v4/discovery/?lang=%LOCALE%&edition=%DISTRIBUTION%"); @@ -214,8 +214,8 @@ pref("app.update.langpack.enabled", true); // .. etc .. // pref("extensions.update.enabled", true); -pref("extensions.update.url", "https://versioncheck.addons.mozilla.org/update/VersionCheck.php?reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=%APP_OS%&appABI=%APP_ABI%&locale=%APP_LOCALE%¤tAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%"); -pref("extensions.update.background.url", "https://versioncheck-bg.addons.mozilla.org/update/VersionCheck.php?reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=%APP_OS%&appABI=%APP_ABI%&locale=%APP_LOCALE%¤tAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%"); +pref("extensions.update.url", "https://versioncheck.addons.mozilla.org/update/VersionCheck.php?reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=Linux&appABI=%APP_ABI%&locale=%APP_LOCALE%¤tAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%"); +pref("extensions.update.background.url", "https://versioncheck-bg.addons.mozilla.org/update/VersionCheck.php?reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=Linux&appABI=%APP_ABI%&locale=%APP_LOCALE%¤tAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%"); pref("extensions.update.interval", 86400); // Check for updates to Extensions and // Themes every day diff --git toolkit/mozapps/extensions/internal/AddonRepository.sys.mjs toolkit/mozapps/extensions/internal/AddonRepository.sys.mjs index e854e04b3ce2..27e8247eb886 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 5d1d2c19706b..4dcba06a95f4 100644 --- toolkit/mozapps/extensions/internal/XPIDatabase.sys.mjs +++ toolkit/mozapps/extensions/internal/XPIDatabase.sys.mjs @@ -632,7 +632,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:642:patches/patch-browser_app_nsBrowserApp.cpp] diff --git browser/app/nsBrowserApp.cpp browser/app/nsBrowserApp.cpp index 87c2e16..a41f1d9 100644 --- browser/app/nsBrowserApp.cpp.orig 2023-06-08 22:09:31 UTC +++ browser/app/nsBrowserApp.cpp @@ -388,6 +388,9 @@ int main(int argc, char* argv[], char* e // Register an external module to report on otherwise uncatchable exceptions. CrashReporter::RegisterRuntimeExceptionModule(); + 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:2405:patches/patch-bug1504834_comment5] https://bugzilla.mozilla.org/show_bug.cgi?id=1504834#c5 https://bugzilla.mozilla.org/attachment.cgi?id=9028600 Rough progress patch diff --git gfx/2d/DrawTargetSkia.cpp gfx/2d/DrawTargetSkia.cpp index 6bbef8d..82b04ba 100644 --- gfx/2d/DrawTargetSkia.cpp.orig 2023-06-08 22:09:35 UTC +++ gfx/2d/DrawTargetSkia.cpp @@ -155,8 +155,7 @@ static IntRect CalculateSurfaceBounds(co return surfaceBounds.Intersect(bounds); } -static const int kARGBAlphaOffset = - SurfaceFormat::A8R8G8B8_UINT32 == SurfaceFormat::B8G8R8A8 ? 3 : 0; +static const int kARGBAlphaOffset = 0; static bool VerifyRGBXFormat(uint8_t* aData, const IntSize& aSize, const int32_t aStride, SurfaceFormat aFormat) { --- gfx/2d/Types.h.orig 2023-06-08 22:09:33 UTC +++ gfx/2d/Types.h @@ -92,15 +92,8 @@ enum class SurfaceFormat : int8_t { // The following values are endian-independent synonyms. The _UINT32 suffix // indicates that the name reflects the layout when viewed as a uint32_t // value. -#if MOZ_LITTLE_ENDIAN() A8R8G8B8_UINT32 = B8G8R8A8, // 0xAARRGGBB X8R8G8B8_UINT32 = B8G8R8X8, // 0x00RRGGBB -#elif MOZ_BIG_ENDIAN() - A8R8G8B8_UINT32 = A8R8G8B8, // 0xAARRGGBB - X8R8G8B8_UINT32 = X8R8G8B8, // 0x00RRGGBB -#else -# error "bad endianness" -#endif // The following values are OS and endian-independent synonyms. // --- gfx/skia/skia/modules/skcms/skcms.cc.orig 2023-06-08 22:09:35 UTC +++ gfx/skia/skia/modules/skcms/skcms.cc @@ -30,6 +30,8 @@ #include #include #endif +#else + #define SKCMS_PORTABLE #endif static bool runtime_cpu_detection = true; @@ -324,20 +326,28 @@ enum { static uint16_t read_big_u16(const uint8_t* ptr) { uint16_t be; memcpy(&be, ptr, sizeof(be)); -#if defined(_MSC_VER) - return _byteswap_ushort(be); +#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ + return be; #else + #if defined(_MSC_VER) + return _byteswap_ushort(be); + #else return __builtin_bswap16(be); + #endif #endif } static uint32_t read_big_u32(const uint8_t* ptr) { uint32_t be; memcpy(&be, ptr, sizeof(be)); -#if defined(_MSC_VER) - return _byteswap_ulong(be); +#if __BYTE_ORDER == __ORDER_BIG_ENDIAN__ + return be; #else + #if defined(_MSC_VER) + return _byteswap_ulong(be); + #else return __builtin_bswap32(be); + #endif #endif } [FILE:2175: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-06-08 22:09:41 UTC +++ media/libcubeb/src/cubeb_alsa.c @@ -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: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-06-08 22:09:32 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:893:patches/patch-env-api-keys] # Accept API keys from environment like before bug 1294585 --- build/moz.configure/keyfiles.configure.orig 2023-06-08 22:09:32 UTC +++ build/moz.configure/keyfiles.configure @@ -19,6 +19,7 @@ def keyfile(desc, default=None, help=Non @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=Non 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:217:patches/patch-image_imgFrame.h] --- image/imgFrame.h.orig 2023-06-08 22:09:34 UTC +++ image/imgFrame.h @@ -9,6 +9,7 @@ #include #include +#include #include "AnimationParams.h" #include "MainThreadUtils.h" [FILE:316:patches/patch-ipc_chromium_src_base_platform__thread__posix.cc] --- ipc/chromium/src/base/platform_thread_posix.cc.orig 2023-06-08 22:35:48 UTC +++ ipc/chromium/src/base/platform_thread_posix.cc @@ -16,6 +16,8 @@ #elif defined(OS_LINUX) # include # include +#elif defined(OS_DRAGONFLY) +# include #endif #if !defined(OS_MACOSX) [FILE:321:patches/patch-ipc_chromium_src_base_process__util__posix.cc] --- ipc/chromium/src/base/process_util_posix.cc.orig 2025-05-12 16:04:52 UTC +++ ipc/chromium/src/base/process_util_posix.cc @@ -55,6 +55,10 @@ # define LOG_AND_ASSERT CHROMIUM_LOG(ERROR) #endif +#ifndef ETIME +#define ETIME ETIMEDOUT +#endif + namespace base { ProcessId GetCurrentProcId() { return getpid(); } [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 16:04:52 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: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:361:patches/patch-media_libcubeb_src_cubeb__jack.cpp] --- media/libcubeb/src/cubeb_jack.cpp.orig 2023-06-08 22:09:41 UTC +++ media/libcubeb/src/cubeb_jack.cpp @@ -8,7 +8,7 @@ */ #define _DEFAULT_SOURCE #define _BSD_SOURCE -#if !defined(__FreeBSD__) && !defined(__NetBSD__) +#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__DragonFly__) #define _POSIX_SOURCE #endif #include "cubeb-internal.h" [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:5140: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 1872a8684132..7e519f9e9cbb 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 @@ -417,7 +417,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 ffba13775363..da6a828a21ee 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 c3abf05b386f..a994c218f5a5 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 f2680b28162c..03476a5fffd0 100644 --- third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc +++ third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc @@ -252,7 +252,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 b8068296745e..7e8be3dc764f 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 b932103f46e6..2c88e28421ec 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:369:patches/patch-security_sandbox_chromium_build_build__config.h] --- security/sandbox/chromium/build/build_config.h.orig 2024-12-09 19:17:31 UTC +++ security/sandbox/chromium/build/build_config.h @@ -51,7 +51,7 @@ #define OS_WIN 1 #elif defined(__Fuchsia__) #define OS_FUCHSIA 1 -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) || defined(__DragonFly__) #define OS_FREEBSD 1 #elif defined(__NetBSD__) #define OS_NETBSD 1 [FILE:488:patches/patch-testing_mozbase_mozinfo_mozinfo_mozinfo.py] --- testing/mozbase/mozinfo/mozinfo/mozinfo.py.orig 2024-10-13 21:12:22 UTC +++ testing/mozbase/mozinfo/mozinfo/mozinfo.py @@ -106,7 +106,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:359:patches/patch-third__party_chromium_build_build__config.h] --- third_party/chromium/build/build_config.h.orig 2024-12-09 19:17:37 UTC +++ third_party/chromium/build/build_config.h @@ -76,7 +76,7 @@ #define OS_WIN 1 #elif defined(__Fuchsia__) #define OS_FUCHSIA 1 -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) || defined(__DragonFly__) #define OS_FREEBSD 1 #elif defined(__NetBSD__) #define OS_NETBSD 1 [FILE:293:patches/patch-third__party_dav1d_src_mem.h] --- third_party/dav1d/src/mem.h.orig 2025-01-13 13:46:01 UTC +++ third_party/dav1d/src/mem.h @@ -33,7 +33,9 @@ #include #if defined(_WIN32) || HAVE_MEMALIGN +# if !defined(__DragonFly__) && !defined(__FreeBSD__) #include +# endif #endif #include "dav1d/dav1d.h" [FILE:452:patches/patch-third__party_llama.cpp_ggml_src_ggml-c.c] --- third_party/llama.cpp/ggml/src/ggml-c.c.orig 2025-12-05 17:43:19 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:355:patches/patch-third__party_rust_mtu_build.rs] --- third_party/rust/mtu/build.rs.orig 2025-04-14 12:07:30 UTC +++ 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:681:patches/patch-third__party_rust_mtu_src_bsd.rs] --- third_party/rust/mtu/src/bsd.rs.orig 2025-04-14 12:07:30 UTC +++ 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:3480:patches/patch-third__party_rust_quinn-udp_src_unix.rs] --- third_party/rust/quinn-udp/src/unix.rs.orig 2025-02-16 23:07:11 UTC +++ 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: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:515:patches/patch-third__party_sqlite3_src_moz.build] --- third_party/sqlite3/src/moz.build.orig 2023-06-08 22:35:48 UTC +++ third_party/sqlite3/src/moz.build @@ -92,7 +92,8 @@ DEFINES['SQLITE_TEMP_FILE_PREFIX'] = '"m # 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-06-08 22:09:52 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:362:patches/patch-toolkit_system_unixproxy_moz.build] --- toolkit/system/unixproxy/moz.build.orig 2024-04-19 17:45:00 UTC +++ toolkit/system/unixproxy/moz.build @@ -10,10 +10,6 @@ with Files("**"): if CONFIG["MOZ_ENABLE_LIBPROXY"]: CXXFLAGS += CONFIG["MOZ_LIBPROXY_CFLAGS"] SOURCES += [ - "nsLibProxySettings.cpp", - ] -else: - SOURCES += [ "nsUnixSystemProxySettings.cpp", ] [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:9130:files/firefox.desktop.in] [Desktop Entry] Version=1.0 Name=Firefox Web Browser Name[ar]=متصفح الويب فَيَرفُكْس Name[ast]=Restolador web Firefox Name[bn]=ফায়ারফক্স ওয়েব ব্রাউজার Name[ca]=Navegador web Firefox Name[cs]=Firefox Webový prohlížeč Name[da]=Firefox - internetbrowser Name[el]=Περιηγητής Firefox Name[es]=Navegador web Firefox Name[et]=Firefoxi veebibrauser Name[fa]=مرورگر اینترنتی Firefox Name[fi]=Firefox-selain Name[fr]=Navigateur Web Firefox Name[gl]=Navegador web Firefox Name[he]=דפדפן האינטרנט Firefox Name[hr]=Firefox web preglednik Name[hu]=Firefox webböngésző Name[it]=Firefox Browser Web Name[ja]=Firefox ウェブ・ブラウザ Name[ko]=Firefox 웹 브라우저 Name[ku]=Geroka torê Firefox Name[lt]=Firefox interneto naršyklė Name[nb]=Firefox Nettleser Name[nl]=Firefox webbrowser Name[nn]=Firefox Nettlesar Name[no]=Firefox Nettleser Name[pl]=Przeglądarka WWW Firefox Name[pt]=Firefox Navegador Web Name[pt_BR]=Navegador Web Firefox Name[ro]=Firefox – Navigator Internet Name[ru]=Веб-браузер Firefox Name[sk]=Firefox - internetový prehliadač Name[sl]=Firefox spletni brskalnik Name[sv]=Firefox webbläsare Name[tr]=Firefox Web Tarayıcısı Name[ug]=Firefox توركۆرگۈ Name[uk]=Веб-браузер Firefox Name[vi]=Trình duyệt web Firefox Name[zh_CN]=Firefox 网络浏览器 Name[zh_TW]=Firefox 網路瀏覽器 Comment=Browse the World Wide Web Comment[ar]=تصفح الشبكة العنكبوتية العالمية Comment[ast]=Restola pela Rede Comment[bn]=ইন্টারনেট ব্রাউজ করুন Comment[ca]=Navegueu per la web Comment[cs]=Prohlížení stránek World Wide Webu Comment[da]=Surf på internettet Comment[de]=Im Internet surfen Comment[el]=Μπορείτε να περιηγηθείτε στο διαδίκτυο (Web) Comment[es]=Navegue por la web Comment[et]=Lehitse veebi Comment[fa]=صفحات شبکه جهانی اینترنت را مرور نمایید Comment[fi]=Selaa Internetin WWW-sivuja Comment[fr]=Naviguer sur le Web Comment[gl]=Navegar pola rede Comment[he]=גלישה ברחבי האינטרנט Comment[hr]=Pretražite web Comment[hu]=A világháló böngészése Comment[it]=Esplora il web Comment[ja]=ウェブを閲覧します Comment[ko]=웹을 돌아 다닙니다 Comment[ku]=Li torê bigere Comment[lt]=Naršykite internete Comment[nb]=Surf på nettet Comment[nl]=Verken het internet Comment[nn]=Surf på nettet Comment[no]=Surf på nettet Comment[pl]=Przeglądanie stron WWW Comment[pt]=Navegue na Internet Comment[pt_BR]=Navegue na Internet Comment[ro]=Navigați pe Internet Comment[ru]=Доступ в Интернет Comment[sk]=Prehliadanie internetu Comment[sl]=Brskajte po spletu Comment[sv]=Surfa på webben Comment[tr]=İnternet'te Gezinin Comment[ug]=دۇنيادىكى توربەتلەرنى كۆرگىلى بولىدۇ Comment[uk]=Перегляд сторінок Інтернету Comment[vi]=Để duyệt các trang web Comment[zh_CN]=浏览互联网 Comment[zh_TW]=瀏覽網際網路 GenericName=Web Browser GenericName[ar]=متصفح ويب GenericName[ast]=Restolador Web GenericName[bn]=ওয়েব ব্রাউজার GenericName[ca]=Navegador web GenericName[cs]=Webový prohlížeč GenericName[da]=Webbrowser GenericName[el]=Περιηγητής διαδικτύου GenericName[es]=Navegador web GenericName[et]=Veebibrauser GenericName[fa]=مرورگر اینترنتی GenericName[fi]=WWW-selain GenericName[fr]=Navigateur Web GenericName[gl]=Navegador Web GenericName[he]=דפדפן אינטרנט GenericName[hr]=Web preglednik GenericName[hu]=Webböngésző GenericName[it]=Browser web GenericName[ja]=ウェブ・ブラウザ GenericName[ko]=웹 브라우저 GenericName[ku]=Geroka torê GenericName[lt]=Interneto naršyklė GenericName[nb]=Nettleser GenericName[nl]=Webbrowser GenericName[nn]=Nettlesar GenericName[no]=Nettleser GenericName[pl]=Przeglądarka WWW GenericName[pt]=Navegador Web GenericName[pt_BR]=Navegador Web GenericName[ro]=Navigator Internet GenericName[ru]=Веб-браузер GenericName[sk]=Internetový prehliadač GenericName[sl]=Spletni brskalnik GenericName[sv]=Webbläsare GenericName[tr]=Web Tarayıcı GenericName[ug]=توركۆرگۈ GenericName[uk]=Веб-браузер GenericName[vi]=Trình duyệt Web GenericName[zh_CN]=网络浏览器 GenericName[zh_TW]=網路瀏覽器 Keywords=Internet;WWW;Browser;Web;Explorer Keywords[ar]=انترنت;إنترنت;متصفح;ويب;وب Keywords[ast]=Internet;WWW;Restolador;Web;Esplorador Keywords[ca]=Internet;WWW;Navegador;Web;Explorador;Explorer Keywords[cs]=Internet;WWW;Prohlížeč;Web;Explorer Keywords[da]=Internet;Internettet;WWW;Browser;Browse;Web;Surf;Nettet Keywords[de]=Internet;WWW;Browser;Web;Explorer;Webseite;Site;surfen;online;browsen Keywords[el]=Internet;WWW;Browser;Web;Explorer;Διαδίκτυο;Περιηγητής;Firefox;Φιρεφοχ;Ιντερνετ Keywords[es]=Explorador;Internet;WWW Keywords[fi]=Internet;WWW;Browser;Web;Explorer;selain;Internet-selain;internetselain;verkkoselain;netti;surffaa Keywords[fr]=Internet;WWW;Browser;Web;Explorer;Fureteur;Surfer;Navigateur Keywords[he]=דפדפן;אינטרנט;רשת;אתרים;אתר;פיירפוקס;מוזילה; Keywords[hr]=Internet;WWW;preglednik;Web Keywords[hu]=Internet;WWW;Böngésző;Web;Háló;Net;Explorer Keywords[it]=Internet;WWW;Browser;Web;Navigatore Keywords[is]=Internet;WWW;Vafri;Vefur;Netvafri;Flakk Keywords[ja]=Internet;WWW;Web;インターネット;ブラウザ;ウェブ;エクスプローラ Keywords[nb]=Internett;WWW;Nettleser;Explorer;Web;Browser;Nettside Keywords[nl]=Internet;WWW;Browser;Web;Explorer;Verkenner;Website;Surfen;Online Keywords[pt]=Internet;WWW;Browser;Web;Explorador;Navegador Keywords[pt_BR]=Internet;WWW;Browser;Web;Explorador;Navegador Keywords[ru]=Internet;WWW;Browser;Web;Explorer;интернет;браузер;веб;файрфокс;огнелис Keywords[sk]=Internet;WWW;Prehliadač;Web;Explorer Keywords[sl]=Internet;WWW;Browser;Web;Explorer;Brskalnik;Splet Keywords[tr]=İnternet;WWW;Tarayıcı;Web;Gezgin;Web sitesi;Site;sörf;çevrimiçi;tara Keywords[uk]=Internet;WWW;Browser;Web;Explorer;Інтернет;мережа;переглядач;оглядач;браузер;веб;файрфокс;вогнелис;перегляд Keywords[vi]=Internet;WWW;Browser;Web;Explorer;Trình duyệt;Trang web Keywords[zh_CN]=Internet;WWW;Browser;Web;Explorer;网页;浏览;上网;火狐;Firefox;ff;互联网;网站; Keywords[zh_TW]=Internet;WWW;Browser;Web;Explorer;網際網路;網路;瀏覽器;上網;網頁;火狐 Exec=@MOZILLA@ %U Terminal=false Type=Application Icon=@FIREFOX_ICON@ Categories=GNOME;GTK;Network;WebBrowser; MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;x-scheme-handler/chrome;video/webm;application/x-xpinstall; StartupNotify=true Actions=NewWindow;NewPrivateWindow; [Desktop Action NewWindow] Name=Open a New Window Name[ar]=افتح نافذة جديدة Name[ast]=Abrir una ventana nueva Name[bn]=Abrir una ventana nueva Name[ca]=Obre una finestra nova Name[cs]=Otevřít nové okno Name[da]=Åbn et nyt vindue Name[de]=Ein neues Fenster öffnen Name[el]=Άνοιγμα νέου παραθύρου Name[es]=Abrir una ventana nueva Name[fi]=Avaa uusi ikkuna Name[fr]=Ouvrir une nouvelle fenêtre Name[gl]=Abrir unha nova xanela Name[he]=פתיחת חלון חדש Name[hr]=Otvori novi prozor Name[hu]=Új ablak nyitása Name[it]=Apri una nuova finestra Name[ja]=新しいウィンドウを開く Name[ko]=새 창 열기 Name[ku]=Paceyeke nû veke Name[lt]=Atverti naują langą Name[nb]=Åpne et nytt vindu Name[nl]=Nieuw venster openen Name[pt]=Abrir nova janela Name[pt_BR]=Abrir nova janela Name[ro]=Deschide o fereastră nouă Name[ru]=Новое окно Name[sk]=Otvoriť nové okno Name[sl]=Odpri novo okno Name[sv]=Öppna ett nytt fönster Name[tr]=Yeni pencere aç Name[ug]=يېڭى كۆزنەك ئېچىش Name[uk]=Відкрити нове вікно Name[vi]=Mở cửa sổ mới Name[zh_CN]=新建窗口 Name[zh_TW]=開啟新視窗 Exec=@MOZILLA@ -new-window [Desktop Action NewPrivateWindow] Name=Open a New Private Window Name[ar]=افتح نافذة جديدة للتصفح الخاص Name[ca]=Obre una finestra nova en mode d'incògnit Name[de]=Ein neues privates Fenster öffnen Name[es]=Abrir una ventana privada nueva Name[fi]=Avaa uusi yksityinen ikkuna Name[fr]=Ouvrir une nouvelle fenêtre de navigation privée Name[he]=פתיחת חלון גלישה פרטית חדש Name[hu]=Új privát ablak nyitása Name[it]=Apri una nuova finestra anonima Name[nb]=Åpne et nytt privat vindu Name[ru]=Новое приватное окно Name[sl]=Odpri novo okno zasebnega brskanja Name[tr]=Yeni bir pencere aç Name[uk]=Відкрити нове вікно у потайливому режимі Name[zh_TW]=開啟新隱私瀏覽視窗 Exec=@MOZILLA@ -private-window [FILE:1745:files/messages-single.ucl] firefox: { type: "install" message: <> .ssh/authorized_keys" The SSH server on `remote_host` must allow pub key authentication. EOM } [FILE:181:files/special.mk] .if defined(BUILD_WITH_CCACHE) # disable sccache - it freezes all the time # MAKE_ENV+= SCCACHE_DIR=${CCACHE_DIR}/sccache # MAKE_ENV+= RUSTC_WRAPPER=${LOCALBASE}/bin/sccache .endif [FILE:591:netbsd/patch-toolkit_mozapps_installer_packager.mk] $NetBSD: patch-toolkit_mozapps_installer_packager.mk,v 1.5 2025/04/30 03:47:13 ryoon Exp $ * Symbolic link to lib/firefox/firefox causes 'Couldn't load XPCOM.' error. --- toolkit/mozapps/installer/packager.mk.orig 2025-06-07 15:37:16 UTC +++ toolkit/mozapps/installer/packager.mk @@ -169,7 +169,6 @@ endif (cd $(DESTDIR)$(installdir) && tar -xf -) $(NSINSTALL) -D $(DESTDIR)$(bindir) $(RM) -f $(DESTDIR)$(bindir)/$(MOZ_APP_NAME) - ln -s $(installdir)/$(MOZ_APP_NAME) $(DESTDIR)$(bindir) upload: $(PYTHON3) -u $(MOZILLA_DIR)/build/upload.py --base-path $(DIST) $(UPLOAD_FILES)