pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/www/firefox115



Module Name:    pkgsrc
Committed By:   ryoon
Date:           Mon Sep 11 12:33:25 UTC 2023

Added Files:
        pkgsrc/www/firefox115: DESCR Makefile PLIST PLIST.Linux distinfo
            mozilla-common.mk options.mk
        pkgsrc/www/firefox115/files: desktop.in firefox.sh node-wrapper.sh
            replace-moz.build.awk
        pkgsrc/www/firefox115/patches: patch-browser_app_profile_firefox.js
            patch-build_moz.configure_rust.configure
            patch-config_gcc-stl-wrapper.template.h
            patch-config_makefiles_rust.mk patch-dom_base_nsAttrName.h
            patch-dom_webtransport_api_WebTransportDatagramDuplexStream.cpp
            patch-gfx_angle_checkout_src_common_third__party_smhasher_src_PMurHash.cpp
            patch-gfx_angle_checkout_src_compiler_translator_InfoSink.h
            patch-gfx_skia_skia_src_core_SkCpu.cpp
            patch-gfx_skia_skia_src_core_SkVM.cpp patch-gfx_wr_swgl_build.rs
            patch-ipc_chromium_src_base_message__pump__libevent.cc
            patch-ipc_chromium_src_base_platform__thread__posix.cc
            patch-ipc_glue_GeckoChildProcessHost.cpp
            patch-js_src_jit_FlushICache.cpp
            patch-js_src_jit_ProcessExecutableMemory.cpp
            patch-js_src_util_NativeStack.cpp
            patch-js_src_vm_ArrayBufferObject.cpp
            patch-media_ffvpx_libavutil_arm_bswap.h
            patch-media_libpng_pngpriv.h patch-media_libtheora_lib_info.c
            patch-modules_fdlibm_src_math__private.h
            patch-nsprpub_pr_src_pthreads_ptsynch.c
            patch-security_nss_lib_freebl_mpi_mpi.c
            patch-third__party_js_cfworker_build.sh
            patch-third__party_libwebrtc_modules_desktop__capture_linux_wayland_egl__dmabuf.cc
            patch-third__party_libwebrtc_modules_video__capture_linux_device__info__v4l2.cc
            patch-third__party_libwebrtc_modules_video__capture_linux_video__capture__v4l2.cc
            patch-third__party_libwebrtc_system__wrappers_source_cpu__features__linux.cc
            patch-third__party_sqlite3_src_moz.build
            patch-third__party_wasm2c_src_prebuilt_wasm2c__source__includes.cc
            patch-third__party_wasm2c_wasm2c_wasm-rt-impl.c
            patch-toolkit_components_terminator_nsTerminator.cpp
            patch-toolkit_modules_subprocess_subprocess__shared__unix.js
            patch-toolkit_moz.configure
            patch-toolkit_mozapps_installer_packager.mk
            patch-toolkit_xre_glxtest.cpp patch-widget_gtk_DMABufSurface.cpp
            patch-xpcom_base_nscore.h
            patch-xpcom_reflect_xptcall_md_unix_moz.build

Log Message:
www/firefox115: import firefox115-115.2.0

Mozilla Firefox is a free, open-source and cross-platform web browser
for Windows, Linux, MacOS X and many other operating systems.

It is fast and easy to use, and offers many advantages over other web
browsers, such as tabbed browsing and the ability to block pop-up
windows.

Firefox also offers excellent bookmark and history management, and it
can be extended by developers using industry standards such as XML,
CSS, JavaScript, C++, etc. Many extensions are available.

Note: Due to upstream's trademark policies, this package identifies as
"Nightly" rather than "Firefox" by default.

This package provides Firefox 115 Extended Support Release.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 pkgsrc/www/firefox115/DESCR \
    pkgsrc/www/firefox115/Makefile pkgsrc/www/firefox115/PLIST \
    pkgsrc/www/firefox115/PLIST.Linux pkgsrc/www/firefox115/distinfo \
    pkgsrc/www/firefox115/mozilla-common.mk pkgsrc/www/firefox115/options.mk
cvs rdiff -u -r0 -r1.1 pkgsrc/www/firefox115/files/desktop.in \
    pkgsrc/www/firefox115/files/firefox.sh \
    pkgsrc/www/firefox115/files/node-wrapper.sh \
    pkgsrc/www/firefox115/files/replace-moz.build.awk
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/www/firefox115/patches/patch-browser_app_profile_firefox.js \
    pkgsrc/www/firefox115/patches/patch-build_moz.configure_rust.configure \
    pkgsrc/www/firefox115/patches/patch-config_gcc-stl-wrapper.template.h \
    pkgsrc/www/firefox115/patches/patch-config_makefiles_rust.mk \
    pkgsrc/www/firefox115/patches/patch-dom_base_nsAttrName.h \
    pkgsrc/www/firefox115/patches/patch-dom_webtransport_api_WebTransportDatagramDuplexStream.cpp \
    pkgsrc/www/firefox115/patches/patch-gfx_angle_checkout_src_common_third__party_smhasher_src_PMurHash.cpp \
    pkgsrc/www/firefox115/patches/patch-gfx_angle_checkout_src_compiler_translator_InfoSink.h \
    pkgsrc/www/firefox115/patches/patch-gfx_skia_skia_src_core_SkCpu.cpp \
    pkgsrc/www/firefox115/patches/patch-gfx_skia_skia_src_core_SkVM.cpp \
    pkgsrc/www/firefox115/patches/patch-gfx_wr_swgl_build.rs \
    pkgsrc/www/firefox115/patches/patch-ipc_chromium_src_base_message__pump__libevent.cc \
    pkgsrc/www/firefox115/patches/patch-ipc_chromium_src_base_platform__thread__posix.cc \
    pkgsrc/www/firefox115/patches/patch-ipc_glue_GeckoChildProcessHost.cpp \
    pkgsrc/www/firefox115/patches/patch-js_src_jit_FlushICache.cpp \
    pkgsrc/www/firefox115/patches/patch-js_src_jit_ProcessExecutableMemory.cpp \
    pkgsrc/www/firefox115/patches/patch-js_src_util_NativeStack.cpp \
    pkgsrc/www/firefox115/patches/patch-js_src_vm_ArrayBufferObject.cpp \
    pkgsrc/www/firefox115/patches/patch-media_ffvpx_libavutil_arm_bswap.h \
    pkgsrc/www/firefox115/patches/patch-media_libpng_pngpriv.h \
    pkgsrc/www/firefox115/patches/patch-media_libtheora_lib_info.c \
    pkgsrc/www/firefox115/patches/patch-modules_fdlibm_src_math__private.h \
    pkgsrc/www/firefox115/patches/patch-nsprpub_pr_src_pthreads_ptsynch.c \
    pkgsrc/www/firefox115/patches/patch-security_nss_lib_freebl_mpi_mpi.c \
    pkgsrc/www/firefox115/patches/patch-third__party_js_cfworker_build.sh \
    pkgsrc/www/firefox115/patches/patch-third__party_libwebrtc_modules_desktop__capture_linux_wayland_egl__dmabuf.cc \
    pkgsrc/www/firefox115/patches/patch-third__party_libwebrtc_modules_video__capture_linux_device__info__v4l2.cc \
    pkgsrc/www/firefox115/patches/patch-third__party_libwebrtc_modules_video__capture_linux_video__capture__v4l2.cc \
    pkgsrc/www/firefox115/patches/patch-third__party_libwebrtc_system__wrappers_source_cpu__features__linux.cc \
    pkgsrc/www/firefox115/patches/patch-third__party_sqlite3_src_moz.build \
    pkgsrc/www/firefox115/patches/patch-third__party_wasm2c_src_prebuilt_wasm2c__source__includes.cc \
    pkgsrc/www/firefox115/patches/patch-third__party_wasm2c_wasm2c_wasm-rt-impl.c \
    pkgsrc/www/firefox115/patches/patch-toolkit_components_terminator_nsTerminator.cpp \
    pkgsrc/www/firefox115/patches/patch-toolkit_modules_subprocess_subprocess__shared__unix.js \
    pkgsrc/www/firefox115/patches/patch-toolkit_moz.configure \
    pkgsrc/www/firefox115/patches/patch-toolkit_mozapps_installer_packager.mk \
    pkgsrc/www/firefox115/patches/patch-toolkit_xre_glxtest.cpp \
    pkgsrc/www/firefox115/patches/patch-widget_gtk_DMABufSurface.cpp \
    pkgsrc/www/firefox115/patches/patch-xpcom_base_nscore.h \
    pkgsrc/www/firefox115/patches/patch-xpcom_reflect_xptcall_md_unix_moz.build

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: pkgsrc/www/firefox115/DESCR
diff -u /dev/null pkgsrc/www/firefox115/DESCR:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/DESCR Mon Sep 11 12:33:25 2023
@@ -0,0 +1,15 @@
+Mozilla Firefox is a free, open-source and cross-platform web browser
+for Windows, Linux, MacOS X and many other operating systems.
+
+It is fast and easy to use, and offers many advantages over other web
+browsers, such as tabbed browsing and the ability to block pop-up
+windows.
+
+Firefox also offers excellent bookmark and history management, and it
+can be extended by developers using industry standards such as XML,
+CSS, JavaScript, C++, etc. Many extensions are available.
+
+Note: Due to upstream's trademark policies, this package identifies as
+"Nightly" rather than "Firefox" by default.
+
+This package provides Firefox 115 Extended Support Release.
Index: pkgsrc/www/firefox115/Makefile
diff -u /dev/null pkgsrc/www/firefox115/Makefile:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/Makefile      Mon Sep 11 12:33:25 2023
@@ -0,0 +1,187 @@
+# $NetBSD: Makefile,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+FIREFOX_VER=           ${MOZ_BRANCH}${MOZ_BRANCH_MINOR}
+MOZ_BRANCH=            115.2
+MOZ_BRANCH_MINOR=      .0esr
+
+DISTNAME=      firefox-${FIREFOX_VER}.source
+PKGNAME=       ${DISTNAME:S/.source//:S/b/beta/:S/esr//:S/firefox-/firefox115-/}
+CATEGORIES=    www
+MASTER_SITES+= ${MASTER_SITE_MOZILLA:=firefox/releases/${FIREFOX_VER}/source/}
+MASTER_SITES+= ${MASTER_SITE_MOZILLA_ALL:=firefox/releases/${FIREFOX_VER}/source/}
+EXTRACT_SUFX=  .tar.xz
+
+NODEJSKIT=             nodejs-output-115.0.tgz
+DISTFILES=             ${DEFAULT_DISTFILES} ${NODEJSKIT}
+SITES.${NODEJSKIT}=    ${MASTER_SITE_LOCAL}
+
+MAINTAINER=    ryoon%NetBSD.org@localhost
+HOMEPAGE=      https://www.mozilla.org/en-US/firefox/
+COMMENT=       Web browser with support for extensions (version ${FIREFOX_VER:tu:C/\\.[[:digit:]\.]*//})
+LICENSE=       mpl-1.1
+
+# -------- BEFORE UPDATING THIS PACKAGE PLEASE READ & UNDERSTAND: -------
+#
+# This package works around a (stupid) build time dependency on nodejs
+# (which is not available for all architectures and unnecessary for the
+# real build). To do this, it places some additional burden on the
+# maintainer.
+#
+# While working on the package, please make sure you have
+#
+#      FIREFOX_MAINTAINER=yes
+#
+# set in your build environment.
+# When the package is ready for commit (but before commit), do:
+#
+#      make maintainer-files
+#
+# This will do another round (depending on state of your work dir at this
+# moment) of one or two builds and generate a cache of all output that
+# nodejs generates during a build.
+#
+# When this is done, just commit the results (they will be in the files/
+# directory).
+#
+# -----------------------------------------------------------------------
+
+WRKSRC=                ${WRKDIR}/firefox-${PKGVERSION_NOREV}
+
+MOZILLA_DIR=   # empty
+
+# Note: In --enable-chrome-format=flat case,
+#       when updating remember to conditionalise about-background.png in PLIST
+CONFIGURE_ARGS+=       --enable-application=browser
+
+#CFLAGS+=      -I${PREFIX}/include/nspr
+# for lang/gcc6
+CFLAGS+=       -D_GLIBCXX_INCLUDE_NEXT_C_HEADERS
+CFLAGS.SunOS+= -D_POSIX_PTHREAD_SEMANTICS
+# Do not use uselocale() in third_party/pipewire.
+CFLAGS.NetBSD+=        -D__LOCALE_C_ONLY
+
+LDFLAGS+=              ${COMPILER_RPATH_FLAG}${PREFIX}/lib/${PKGBASE}
+LDFLAGS+=              ${COMPILER_RPATH_FLAG}${PREFIX}/lib
+LDFLAGS.DragonFly+=    -lplc4 -lnspr4
+LDFLAGS.FreeBSD+=      -lplc4 -lnspr4
+LDFLAGS.Linux+=                -lnspr4
+LDFLAGS.SunOS+=                -lm
+
+# XXX not sure how to test this! likely unnecessary
+NOT_PAX_MPROTECT_SAFE+=        lib/${PKGBASE}/plugin-container
+# Should revisit to complete mprotect support.
+NOT_PAX_MPROTECT_SAFE+=        lib/${PKGBASE}/${MOZILLA}
+NOT_PAX_MPROTECT_SAFE+=        lib/${PKGBASE}/${MOZILLA}-bin
+
+# Avoid ld "invalid section index" errors.
+BUILDLINK_TRANSFORM.SunOS+=    rm:-fdata-sections
+BUILDLINK_TRANSFORM.SunOS+=    rm:-ffunction-sections
+BUILDLINK_TRANSFORM.SunOS+=    rm:-pie
+
+# Workaround for https://bugs.llvm.org/show_bug.cgi?id=46366
+BUILDLINK_TRANSFORM.NetBSD+=   rm:-fexperimental-new-pass-manager
+
+SUBST_CLASSES+=                        dfly_malloc_h
+SUBST_STAGE.dfly_malloc_h=     pre-configure
+SUBST_MESSAGE.dfly_malloc_h=   Dont include malloc.h on dragonflybsd
+SUBST_SED.dfly_malloc_h=       -e 's,HAVE_MALLOC_H,HAVE_MALLOC_H \&\& !defined(__DragonFly__),g'
+SUBST_FILES.dfly_malloc_h+=    media/ffvpx/libavutil/mem.c
+
+.include "mozilla-common.mk"
+.include "options.mk"
+
+CHECK_INTERPRETER_SKIP+=       lib/firefox-sdk/sdk/bin/header.py
+CHECK_INTERPRETER_SKIP+=       lib/firefox-sdk/sdk/bin/typelib.py
+CHECK_INTERPRETER_SKIP+=       lib/firefox-sdk/sdk/bin/xpidl.py
+CHECK_INTERPRETER_SKIP+=       lib/firefox-sdk/sdk/bin/xpt.py
+
+CHECK_WRKREF_SKIP+=    lib/${MOZILLA}/omni.ja
+
+MOZILLA=       ${PKGBASE}
+
+.if !empty(PKG_OPTIONS:Mofficial-mozilla-branding)
+MOZILLA_NAME=          Firefox
+MOZILLA_BRANDING=      official
+.else
+MOZILLA_NAME=          Browser
+MOZILLA_BRANDING=      unofficial
+.endif
+
+pre-configure:
+# As of 106.0, .in template files are not patched.
+#      cd ${WRKSRC} && autoconf
+#      cd ${WRKSRC}/js/src && autoconf
+       cd ${WRKSRC} && mkdir ${OBJDIR}
+       cd ${WRKSRC}/${OBJDIR} && touch old-configure.vars
+#      Do not fetch Rust Cargo file via network during build
+.if !defined(FIREFOX_MAINTAINER)
+       mv ${WRKDIR}/dist ${WRKSRC}/${OBJDIR}
+.endif
+
+.if defined(FIREFOX_MAINTAINER)
+# Create files needed only by the firefox maintainer when updating
+# the package
+# XXX - manually removing the .*_done files is wrong!
+.PHONY: build-list
+build-list:
+       cd ${WRKSRC}/${OBJDIR}/dist/bin/browser/chrome && \
+               find . -type f | sort > ${OUT:Q}
+
+NODE_LIST=     "${WRKDIR}/node.list"
+NO_NODE_LIST=  "${WRKDIR}/no-node.list"
+NODE_FILES=    "${WRKDIR}/node.flist"
+
+.PHONY: maintainer-files
+maintainer-files:
+       rm -f ${FILESDIR}/node-wrapper.sh
+       V=$$( node -v ) && \
+           printf '#! /bin/sh\n\nVERS=%s\n\nif [ "$$1" = "-v" ] || [ "$$1" = "--version" ]; then\n\tprintf "$${VERS}\\n"\nfi\n\nexit 0\n' $$V \
+           > ${FILESDIR}/node-wrapper.sh && \
+           chmod 0755 ${FILESDIR}/node-wrapper.sh
+       rm -f ${WRKDIR}/.build_done ${WRKDIR}/.configure_done
+       ${MAKE} MAINTAINER_INTERNAL=yes build
+       ${MAKE} MAINTAINER_INTERNAL=yes OUT="${NO_NODE_LIST}" build-list
+       ${MAKE} OUT="${NODE_LIST}" build-list
+       ${DIFF} -u "${NO_NODE_LIST}" "${NODE_LIST}" | \
+           ${AWK} \
+           '/^\+\.\//{ printf("dist/bin/browser/chrome/%s\n", gensub(/^\+\.\//, "", "")) }' \
+           > "${NODE_FILES}"
+       cd ${WRKSRC}/${OBJDIR} && tar -c -T "${NODE_FILES}" -z \
+           -f ${FILESDIR}/nodejs-output-${PKGVERSION_NOREV}.tgz
+.endif
+
+pre-patch:
+       for f in $$(find ${WRKSRC}/third_party/libwebrtc -name moz.build -type f) ; \
+       do \
+               ${AWK} -f ${FILESDIR}/replace-moz.build.awk $$f > $$f.new; mv $$f.new $$f ; \
+       done
+
+post-build:
+       ${SED} -e 's|@MOZILLA@|${MOZILLA}|g'                            \
+         -e 's|@MOZILLA_NAME@|${MOZILLA_NAME}|g'                       \
+         -e 's|@FIREFOX_ICON@|${MOZILLA}|g'                            \
+         < ${FILESDIR}/desktop.in                                      \
+         > ${WRKDIR}/desktop
+
+INSTALLATION_DIRS+=    share/applications
+
+post-install:
+.if ${OPSYS} == "NetBSD" && ${X11_TYPE} == "native"
+       ${INSTALL_SCRIPT} ${FILESDIR}/firefox.sh ${DESTDIR}${PREFIX}/bin/${MOZILLA}
+.else
+       ${ECHO} '#! /bin/sh' > ${DESTDIR}${PREFIX}/bin/${MOZILLA}
+       ${ECHO} '${PREFIX}/lib/${MOZILLA}/${MOZILLA} "$$@"' >> \
+               ${DESTDIR}${PREFIX}/bin/${MOZILLA}
+       ${CHMOD} 755 ${DESTDIR}${PREFIX}/bin/${MOZILLA}
+.endif
+       ${INSTALL_DATA} ${WRKDIR}/desktop                               \
+         ${DESTDIR}${PREFIX}/share/applications/${MOZILLA}.desktop
+.for i in 16 22 24 32 48 64 128 256
+       ${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/icons/hicolor/${i}x${i}/apps
+       ${INSTALL_DATA} ${WRKSRC}/browser/branding/${MOZILLA_BRANDING}/default${i}.png \
+         ${DESTDIR}${PREFIX}/share/icons/hicolor/${i}x${i}/apps/${MOZILLA}.png
+.endfor
+
+.include "../../graphics/hicolor-icon-theme/buildlink3.mk"
+.include "../../sysutils/desktop-file-utils/desktopdb.mk"
+.include "../../mk/bsd.pkg.mk"
Index: pkgsrc/www/firefox115/PLIST
diff -u /dev/null pkgsrc/www/firefox115/PLIST:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/PLIST Mon Sep 11 12:33:25 2023
@@ -0,0 +1,45 @@
+@comment $NetBSD: PLIST,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+bin/firefox115
+lib/firefox115/application.ini
+lib/firefox115/browser/chrome/icons/default/default128.png
+lib/firefox115/browser/chrome/icons/default/default16.png
+lib/firefox115/browser/chrome/icons/default/default32.png
+lib/firefox115/browser/chrome/icons/default/default48.png
+lib/firefox115/browser/chrome/icons/default/default64.png
+lib/firefox115/browser/features/formautofill%mozilla.org.xpi@localhost
+lib/firefox115/browser/features/pictureinpicture%mozilla.org.xpi@localhost
+lib/firefox115/browser/features/screenshots%mozilla.org.xpi@localhost
+lib/firefox115/browser/features/webcompat-reporter%mozilla.org.xpi@localhost
+lib/firefox115/browser/features/webcompat%mozilla.org.xpi@localhost
+lib/firefox115/browser/omni.ja
+lib/firefox115/defaults/pref/channel-prefs.js
+lib/firefox115/dependentlibs.list
+lib/firefox115/firefox115
+lib/firefox115/firefox115-bin
+lib/firefox115/fonts/TwemojiMozilla.ttf
+lib/firefox115/glxtest
+lib/firefox115/gmp-clearkey/0.1/libclearkey.so
+lib/firefox115/gmp-clearkey/0.1/manifest.json
+lib/firefox115/libipcclientcerts.so
+lib/firefox115/liblgpllibs.so
+${PLIST.ffvpx}lib/firefox115/libmozavcodec.so
+${PLIST.ffvpx}lib/firefox115/libmozavutil.so
+lib/firefox115/libmozgtk.so
+lib/firefox115/libmozsqlite3.so
+${PLIST.wayland}lib/firefox115/libmozwayland.so
+lib/firefox115/libxul.so
+lib/firefox115/omni.ja
+lib/firefox115/pingsender
+lib/firefox115/platform.ini
+lib/firefox115/plugin-container
+lib/firefox115/removed-files
+${PLIST.wayland}lib/firefox115/vaapitest
+share/applications/firefox115.desktop
+share/icons/hicolor/128x128/apps/firefox115.png
+share/icons/hicolor/16x16/apps/firefox115.png
+share/icons/hicolor/22x22/apps/firefox115.png
+share/icons/hicolor/24x24/apps/firefox115.png
+share/icons/hicolor/256x256/apps/firefox115.png
+share/icons/hicolor/32x32/apps/firefox115.png
+share/icons/hicolor/48x48/apps/firefox115.png
+share/icons/hicolor/64x64/apps/firefox115.png
Index: pkgsrc/www/firefox115/PLIST.Linux
diff -u /dev/null pkgsrc/www/firefox115/PLIST.Linux:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/PLIST.Linux   Mon Sep 11 12:33:25 2023
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST.Linux,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+lib/firefox/libmozsandbox.so
Index: pkgsrc/www/firefox115/distinfo
diff -u /dev/null pkgsrc/www/firefox115/distinfo:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/distinfo      Mon Sep 11 12:33:25 2023
@@ -0,0 +1,48 @@
+$NetBSD: distinfo,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+BLAKE2s (firefox-115.2.0esr.source.tar.xz) = eb64581135bb1c9a5207d79fffd319c59817d03e334d659ead42aa2a54a72e86
+SHA512 (firefox-115.2.0esr.source.tar.xz) = df3b4efd9607e8eb4932717760c865eb31ac7a96246cb4385190c33316c9595e0793a1f3c45ebb9674a9ba4fce98d83f71b063bef09ef307d92d1cd78d30d812
+Size (firefox-115.2.0esr.source.tar.xz) = 514055028 bytes
+BLAKE2s (nodejs-output-115.0.tgz) = 95d25628b865aa71e85c63001f4054d03ff58b273ca05784a021fa176b2b1425
+SHA512 (nodejs-output-115.0.tgz) = 345108033cfbff90e3244bb5591b307e1fcf56c7290b5112e949d400bdadf08c1e4a6d109b5f7264ac417c2cc4e76371cc14678417f6cb017649cc883bdbb4d4
+Size (nodejs-output-115.0.tgz) = 221458 bytes
+SHA1 (patch-browser_app_profile_firefox.js) = 3b01cf7e37ea39bdd358fb14de5ce382b945ae39
+SHA1 (patch-build_moz.configure_rust.configure) = 25ddfacd29cebbc6db005dbe61a2a7446d480678
+SHA1 (patch-config_gcc-stl-wrapper.template.h) = 9d1f15ff487efa9202114d19ed5668b4e7aa032a
+SHA1 (patch-config_makefiles_rust.mk) = 788ab8fed45625bc5552c56a3ab05b5ed7d49a8f
+SHA1 (patch-dom_base_nsAttrName.h) = ac7ba441a3b27df2855cf2673eea36b1cb44ad49
+SHA1 (patch-dom_webtransport_api_WebTransportDatagramDuplexStream.cpp) = b93b4c6367bd2fb3d1868ab7d97ca56c100be414
+SHA1 (patch-gfx_angle_checkout_src_common_third__party_smhasher_src_PMurHash.cpp) = e458c9c8dc66edc69c1874734af28a77fc5e3993
+SHA1 (patch-gfx_angle_checkout_src_compiler_translator_InfoSink.h) = b2adce9e65662283a11b6dcff40e95523e940045
+SHA1 (patch-gfx_skia_skia_src_core_SkCpu.cpp) = 36218819254f3681b9c717d652ea78c9f20d49ad
+SHA1 (patch-gfx_skia_skia_src_core_SkVM.cpp) = 11d8084e933f68496fc4d2f57d1eb1065483bf9c
+SHA1 (patch-gfx_wr_swgl_build.rs) = df6ebfaabb4d27994e59a9d0eaf12c7cf08415fb
+SHA1 (patch-ipc_chromium_src_base_message__pump__libevent.cc) = 298642a3527804115b398fb7904a3596962932e3
+SHA1 (patch-ipc_chromium_src_base_platform__thread__posix.cc) = 35d20981d33ccdb1d8ffb8039e48798777f11658
+SHA1 (patch-ipc_glue_GeckoChildProcessHost.cpp) = 6cdd0fe60455eab8f9846257c2bfea207f19478b
+SHA1 (patch-js_src_jit_FlushICache.cpp) = b7536050d06e87612fbedc7ce269b5f120eb0ce9
+SHA1 (patch-js_src_jit_ProcessExecutableMemory.cpp) = 1e25924a29e3700b0e0e5d143f1db35029b431fb
+SHA1 (patch-js_src_util_NativeStack.cpp) = a0a16d8d8d78d3cc3f4d2a508586f1a7821f7dba
+SHA1 (patch-js_src_vm_ArrayBufferObject.cpp) = 374ffc0ce12e1c5babf2e553aba96612b0a30b1e
+SHA1 (patch-media_ffvpx_libavutil_arm_bswap.h) = de58daa0fd23d4fec50426602b65c9ea5862558a
+SHA1 (patch-media_libpng_pngpriv.h) = c8084332560017cd7c9b519b61d125fa28af0dbc
+SHA1 (patch-media_libtheora_lib_info.c) = f6dbf536d73859a1ff78304c2e9f6a6f74dac01f
+SHA1 (patch-modules_fdlibm_src_math__private.h) = e20b6c23011d7123cbbd64a500eb8ce8c426620e
+SHA1 (patch-nsprpub_pr_src_pthreads_ptsynch.c) = b0d1f6a6e0eb852b0fd0238ad3f8ed3166c60a50
+SHA1 (patch-security_nss_lib_freebl_mpi_mpi.c) = a7cd867916524770609d1c307a65b315b88456f4
+SHA1 (patch-third__party_js_cfworker_build.sh) = 46cdf97b99cf01080f290ae8d9a33b5f869fc3e4
+SHA1 (patch-third__party_libwebrtc_modules_desktop__capture_linux_wayland_egl__dmabuf.cc) = 455be625b5de2f6f1f4b2dbb6c8cb33ca16c2583
+SHA1 (patch-third__party_libwebrtc_modules_video__capture_linux_device__info__v4l2.cc) = 8848fb05c1e8b45234f74db71602a8a84c0404a4
+SHA1 (patch-third__party_libwebrtc_modules_video__capture_linux_video__capture__v4l2.cc) = 8111952a107eb2cd665525ddd0e27c79eee3c1cd
+SHA1 (patch-third__party_libwebrtc_system__wrappers_source_cpu__features__linux.cc) = b90e22b50879f7adcc1da3a993f52c0701b720f8
+SHA1 (patch-third__party_sqlite3_src_moz.build) = b26856a4b87aa12211575d9982f62dc899474b52
+SHA1 (patch-third__party_wasm2c_src_prebuilt_wasm2c__source__includes.cc) = 99d0db944f0c2d0c623460991efd423d9127c988
+SHA1 (patch-third__party_wasm2c_wasm2c_wasm-rt-impl.c) = cd5fd67f53d7a448cc9075a3756e2a03d4f43e4b
+SHA1 (patch-toolkit_components_terminator_nsTerminator.cpp) = e905e38ef1b88d764c695c019f15609350c1c43b
+SHA1 (patch-toolkit_modules_subprocess_subprocess__shared__unix.js) = 2303b753066298305ccae80d72765dbc4da5e0dc
+SHA1 (patch-toolkit_moz.configure) = c183f8b1566ffed0df17bf856f693b3a288affeb
+SHA1 (patch-toolkit_mozapps_installer_packager.mk) = 706635b76a7b525794aba95e95544f09e18bb662
+SHA1 (patch-toolkit_xre_glxtest.cpp) = adcd5b05fcbd7b41c01a2aa66f3e8f05ed230444
+SHA1 (patch-widget_gtk_DMABufSurface.cpp) = 7d1d2d7770e563c7b912e24444254ae2791710ea
+SHA1 (patch-xpcom_base_nscore.h) = 1ac4d34d3c9e80bc1ac966c6c84cb320bc0fa1ec
+SHA1 (patch-xpcom_reflect_xptcall_md_unix_moz.build) = 81d43a046fcef6bf6717d52485686ba8e8738254
Index: pkgsrc/www/firefox115/mozilla-common.mk
diff -u /dev/null pkgsrc/www/firefox115/mozilla-common.mk:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/mozilla-common.mk     Mon Sep 11 12:33:25 2023
@@ -0,0 +1,263 @@
+# $NetBSD: mozilla-common.mk,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+#
+# common Makefile fragment for mozilla packages based on gecko 2.0.
+#
+# used by www/firefox/Makefile
+
+.include "../../mk/bsd.prefs.mk"
+
+PYTHON_VERSIONS_INCOMPATIBLE=  27
+PYTHON_FOR_BUILD_ONLY=         tool
+ALL_ENV+=                      PYTHON3=${PYTHONBIN}
+
+REPLACE_PYTHON=                build/cargo-linker
+
+HAS_CONFIGURE=         yes
+CONFIGURE_ARGS+=       --prefix=${PREFIX}
+USE_TOOLS+=            pkg-config perl gmake gm4 unzip zip # autoconf213
+UNLIMIT_RESOURCES+=    datasize virtualsize
+
+USE_LANGUAGES+=                c c++
+
+# XXX: As of 114.0.2
+# For nested constant initializer support in rlbox, requires 8.
+GCC_REQD+=             8
+
+TOOL_DEPENDS+=         cbindgen>=0.24.3:../../devel/cbindgen
+
+.if defined(FIREFOX_MAINTAINER) && !defined(MAINTAINER_INTERNAL)
+TOOL_DEPENDS+=         nodejs-[0-9]*:../../lang/nodejs
+USE_TOOLS+=            diff
+.else
+CONFIGURE_ENV+=                NODEJS="${FILESDIR}/node-wrapper.sh"
+.endif
+
+TOOL_DEPENDS+=         ${PYPKGPREFIX}-curses-[0-9]*:../../devel/py-curses
+TOOL_DEPENDS+=         ${PYPKGPREFIX}-sqlite3-[0-9]*:../../databases/py-sqlite3
+TOOL_DEPENDS+=         ${PYPKGPREFIX}-expat-[0-9]*:../../textproc/py-expat
+
+# malloc_usable_size()
+LDFLAGS.NetBSD+=       -ljemalloc
+
+.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
+TOOL_DEPENDS+=         nasm>=2.14:../../devel/nasm
+TOOL_DEPENDS+=         yasm>=1.1:../../devel/yasm
+CFLAGS+=               -msse2
+.endif
+
+# This is to work around build failures where an upstream configuration script
+# is confused by having more than one approximate match to MACHINE_GNU_PLATFORM
+# "i486" when attempting to select the Rust compiler target.
+.if !empty(MACHINE_PLATFORM:MNetBSD-*-i386)
+CONFIGURE_ARGS+=       --target=i586-unknown-netbsd
+CONFIGURE_ARGS+=       --host=i586-unknown-netbsd
+.else
+CONFIGURE_ARGS+=       --target=${MACHINE_GNU_PLATFORM}
+CONFIGURE_ARGS+=       --host=${MACHINE_GNU_PLATFORM}
+.endif
+
+CONFIGURE_ENV+=                BINDGEN_CFLAGS="-isystem${PREFIX}/include/nspr \
+                       -isystem${X11BASE}/include/pixman-1"
+
+do-test:
+       cd ${WRKSRC}/${OBJDIR}/dist/bin &&      \
+            ./run-mozilla.sh ${WRKSRC}/mach check-spidermonkey
+
+# tar(1) of OpenBSD 5.5 has no --exclude command line option.
+.if ${OPSYS} == "OpenBSD"
+TOOLS_PLATFORM.tar=    ${TOOLS_PATH.bsdtar}
+USE_TOOLS+=            bsdtar
+.else
+USE_TOOLS+=            tar
+.endif
+
+.if ${MACHINE_ARCH} == "i386"
+# This is required for SSE2 code under i386.
+CXXFLAGS+=     -mstackrealign
+.endif
+
+CHECK_PORTABILITY_SKIP+=       ${MOZILLA_DIR}security/nss/tests/*/*.sh
+CHECK_PORTABILITY_SKIP+=       ${MOZILLA_DIR}js/src/tests/update-test262.sh
+CHECK_PORTABILITY_SKIP+=       ${MOZILLA_DIR}intl/icu/source/configure
+CHECK_PORTABILITY_SKIP+=       ${MOZILLA_DIR}browser/components/loop/run-all-loop-tests.sh
+CHECK_PORTABILITY_SKIP+=       ${MOZILLA_DIR}browser/extensions/loop/run-all-loop-tests.sh
+CHECK_PORTABILITY_SKIP+=       ${MOZILLA_DIR}third_party/libwebrtc/tools_webrtc/iwyu/apply-iwyu
+
+CONFIGURE_ARGS+=       --enable-release
+# Disable Rust SIMD option to fix build with lang/rust-1.33.0
+# This should be enabled later again.
+#CONFIGURE_ARGS+=      --enable-rust-simd
+CONFIGURE_ARGS+=       --disable-tests
+# Mozilla Bug 1432751
+#CONFIGURE_ARGS+=      --enable-system-cairo
+CONFIGURE_ARGS+=       --enable-system-pixman
+CONFIGURE_ARGS+=       --with-system-libvpx
+CONFIGURE_ARGS+=       --enable-system-ffi
+CONFIGURE_ARGS+=       --with-system-icu
+CONFIGURE_ARGS+=       --with-system-nss
+CONFIGURE_ARGS+=       --with-system-nspr
+#CONFIGURE_ARGS+=      --with-system-jpeg
+CONFIGURE_ARGS+=       --with-system-zlib
+CONFIGURE_ARGS+=       --with-system-libevent
+CONFIGURE_ARGS+=       --disable-crashreporter
+CONFIGURE_ARGS+=       --enable-chrome-format=omni
+CONFIGURE_ARGS+=       --with-system-webp
+
+#CONFIGURE_ARGS+=      --enable-readline
+CONFIGURE_ARGS+=       --disable-icf
+CONFIGURE_ARGS+=       --disable-updater
+
+.include "../../mk/compiler.mk"
+
+.if empty(PKGSRC_COMPILER:Mclang)
+# Set path to "clang for cbindgen" when target compiler is not clang.
+CONFIGURE_ARGS+=       --with-clang-path=${PREFIX}/bin/clang
+.endif
+CONFIGURE_ARGS+=       --with-libclang-path=${PREFIX}/lib
+
+# RLBox WASM sandbox
+.if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "i386"
+# For wasm-ld command
+TOOL_DEPENDS+=         lld-[0-9]*:../../devel/lld
+.include "../../lang/wasi-libc/buildlink3.mk"
+.include "../../lang/wasi-libcxx/buildlink3.mk"
+# NB the exact versions of the clang and wasi-compiler-rt dependencies must
+# be kept in sync, or build failures will occur due to path mismatches.
+.include "../../lang/wasi-compiler-rt/buildlink3.mk"
+CONFIGURE_ARGS+=       --with-wasi-sysroot=${PREFIX}/wasi
+CONFIGURE_ENV+=                WASM_CC=${PREFIX}/bin/clang
+CONFIGURE_ENV+=                WASM_CXX=${PREFIX}/bin/clang++
+.else
+CONFIGURE_ARGS+=       --without-wasm-sandboxed-libraries
+.endif
+
+.include "../../sysutils/pciutils/libname.mk"
+SUBST_CLASSES+=                                fix-libpci-soname
+SUBST_STAGE.fix-libpci-soname=         pre-configure
+SUBST_MESSAGE.fix-libpci-soname=       Fixing libpci soname
+SUBST_FILES.fix-libpci-soname+=                ${MOZILLA_DIR}toolkit/xre/glxtest/glxtest.cpp
+SUBST_SED.fix-libpci-soname+=          -e 's,"libpci.so, "lib${PCIUTILS_LIBNAME}.so,'
+
+.if !empty(MACHINE_PLATFORM:MNetBSD-*-i386)
+SQLITE3OPTFLAG=                '-O0',
+.else
+SQLITE3OPTFLAG=                # empty
+.endif
+SUBST_CLASSES+=                                sqlite3-opt
+SUBST_STAGE.sqlite3-opt=               pre-configure
+SUBST_MESSAGE.sqlite3-opt=             Fixing segfault in libmozsqlite3.so
+SUBST_FILES.sqlite3-opt+=              ${MOZILLA_DIR}third_party/sqlite3/src/moz.build
+SUBST_VARS.sqlite3-opt+=               SQLITE3OPTFLAG
+
+# Do not pass '-j1 -j1' for MAKE_JOBS=1 for NetBSD 9.3 or rearlier.
+RUST_MAKE_JOBS=                # empty by default
+.if ${OPSYS} == "NetBSD" && ${OPSYS_VERSION} < 090400
+.  if defined(MAKE_JOBS) && !empty(MAKE_JOBS) && !(defined(MAKE_JOBS_SAFE) && ${MAKE_JOBS_SAFE:U:tl} == no)
+.    if ${MAKE_JOBS} > 1
+RUST_MAKE_JOBS=                -j1 # for MAKE_JOBS=1, RUST_MAKE_JOBS should be empty.
+.    endif
+.  endif
+.endif
+
+SUBST_CLASSES+=                njobs
+SUBST_STAGE.njobs=     pre-configure
+SUBST_MESSAGE.njobs=   Setting MAKE_JOBS for cairo
+SUBST_FILES.njobs+=    ${MOZILLA_DIR}config/makefiles/rust.mk
+SUBST_VARS.njobs+=     RUST_MAKE_JOBS
+
+# Workaround for link of libxul.so as of 96.0.
+# There are too many -ldl under third_paty/libwebrtc.
+.include "../../mk/dlopen.buildlink3.mk"
+BUILDLINK_TRANSFORM+=  opt:-ldl:${BUILDLINK_LDADD.dl:Q}
+
+CONFIG_GUESS_OVERRIDE+=                ${MOZILLA_DIR}build/autoconf/config.guess
+CONFIG_GUESS_OVERRIDE+=                ${MOZILLA_DIR}js/src/build/autoconf/config.guess
+CONFIG_GUESS_OVERRIDE+=                ${MOZILLA_DIR}nsprpub/build/autoconf/config.guess
+CONFIG_GUESS_OVERRIDE+=                ${MOZILLA_DIR}/js/ctypes/libffi/config.guess
+CONFIG_SUB_OVERRIDE+=          ${MOZILLA_DIR}build/autoconf/config.sub
+CONFIG_SUB_OVERRIDE+=          ${MOZILLA_DIR}js/src/build/autoconf/config.sub
+CONFIG_SUB_OVERRIDE+=          ${MOZILLA_DIR}nsprpub/build/autoconf/config.sub
+CONFIG_SUB_OVERRIDE+=          ${MOZILLA_DIR}/js/ctypes/libffi/config.sub
+
+CONFIGURE_ENV+=                CPP=${CPP:Q}
+ALL_ENV+=              SHELL=${CONFIG_SHELL:Q}
+ALL_ENV+=              MOZ_APP_NAME=${MOZILLA}
+
+# Build outside ${WRKSRC}
+# Try to avoid conflict with config/makefiles/xpidl/Makefile.in
+.if ${MAINTAINER_INTERNAL:Uno} == "yes"
+OBJDIR=                        ../no-node-build
+.else
+OBJDIR=                        ../build
+.endif
+CONFIGURE_DIRS=                ${OBJDIR}
+CONFIGURE_SCRIPT=      ${WRKSRC}/configure
+
+PLIST_VARS+=   ffvpx
+
+.if ${MACHINE_ARCH} == "aarch64" || \
+    ${MACHINE_ARCH:M*arm*} || \
+    ${MACHINE_ARCH} == "i386" || \
+    ${MACHINE_ARCH} == "x86_64"
+PLIST.ffvpx=   yes     # see media/ffvpx/ffvpxcommon.mozbuild
+.endif
+
+# See ${WRKSRC}/security/sandbox/mac/Sandbox.mm: On Darwin, sandboxing
+# support is only available when the toolkit is cairo-cocoa.
+CONFIGURE_ARGS.Darwin+=        --disable-sandbox
+
+# Makefiles sometimes call "rm -f" without more arguments. Kludge around ...
+.PHONY: create-rm-wrapper
+pre-configure: create-rm-wrapper
+create-rm-wrapper:
+       printf '#!/bin/sh\n[ "$$*" = "-f" ] && exit 0\nexec /bin/rm $$@\n' > \
+         ${WRAPPER_DIR}/bin/rm
+       chmod +x ${WRAPPER_DIR}/bin/rm
+
+# The configure test for __thread succeeds, but later we end up with:
+# dist/bin/libxul.so: undefined reference to `__tls_get_addr'
+CONFIGURE_ENV.NetBSD+= ac_cv_thread_keyword=no
+# In unspecified case, clock_gettime(CLOCK_MONOTONIC, ...) fails.
+CONFIGURE_ENV.NetBSD+= ac_cv_clock_monotonic=
+
+.include "../../sysutils/pciutils/buildlink3.mk"
+.include "../../mk/atomic64.mk"
+BUILDLINK_API_DEPENDS.libevent+=       libevent>=1.1
+.include "../../devel/libevent/buildlink3.mk"
+.include "../../devel/libffi/buildlink3.mk"
+BUILDLINK_API_DEPENDS.nspr+=   nspr>=4.34
+.include "../../devel/nspr/buildlink3.mk"
+.include "../../textproc/icu/buildlink3.mk"
+BUILDLINK_API_DEPENDS.nss+=    nss>=3.90
+.include "../../devel/nss/buildlink3.mk"
+.include "../../devel/zlib/buildlink3.mk"
+#.include "../../mk/jpeg.buildlink3.mk"
+.include "../../graphics/MesaLib/buildlink3.mk"
+#BUILDLINK_API_DEPENDS.cairo+= cairo>=1.10.2nb4
+#.include "../../graphics/cairo/buildlink3.mk"
+BUILDLINK_API_DEPENDS.libwebp+=        libwebp>=1.0.2
+.include "../../graphics/libwebp/buildlink3.mk"
+BUILDLINK_DEPMETHOD.clang=     build
+.include "../../lang/clang/buildlink3.mk"
+RUST_REQ=      1.66.0
+.include "../../lang/rust/rust.mk"
+BUILDLINK_API_DEPENDS.libvpx+= libvpx>=1.13.0
+.include "../../multimedia/libvpx/buildlink3.mk"
+.include "../../net/libIDL/buildlink3.mk"
+# TODO: check again, pkgsrc has hunspell 1.7
+# was: textproc/hunspell 1.3 is too old
+#.include "../../textproc/hunspell/buildlink3.mk"
+.include "../../multimedia/ffmpeg6/buildlink3.mk"
+.include "../../x11/libXt/buildlink3.mk"
+.include "../../x11/libXtst/buildlink3.mk"
+BUILDLINK_API_DEPENDS.pixman+= pixman>=0.25.2
+.include "../../x11/pixman/buildlink3.mk"
+.include "../../x11/gtk3/buildlink3.mk"
+PLIST_VARS+=           wayland
+.if ${PKG_BUILD_OPTIONS.gtk3:Mwayland}
+CONFIGURE_ARGS+=       --enable-default-toolkit=cairo-gtk3-x11-wayland
+PLIST.wayland=         yes
+.else
+CONFIGURE_ARGS+=       --enable-default-toolkit=cairo-gtk3
+.endif
+.include "../../lang/python/application.mk"
Index: pkgsrc/www/firefox115/options.mk
diff -u /dev/null pkgsrc/www/firefox115/options.mk:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/options.mk    Mon Sep 11 12:33:25 2023
@@ -0,0 +1,96 @@
+# $NetBSD: options.mk,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+PKG_OPTIONS_VAR=       PKG_OPTIONS.firefox115
+
+PKG_SUPPORTED_OPTIONS= official-mozilla-branding
+PKG_SUPPORTED_OPTIONS+=        debug debug-info mozilla-jemalloc webrtc
+PKG_SUPPORTED_OPTIONS+=        dbus
+PKG_SUPPORTED_OPTIONS+=        alsa pulseaudio sunaudio jack
+
+.if ${OPSYS} == "Linux"
+PKG_SUGGESTED_OPTIONS+=        dbus
+PKG_SUGGESTED_OPTIONS+=        pulseaudio mozilla-jemalloc webrtc
+.endif
+
+.if ${OPSYS} == "NetBSD" || ${OPSYS} == "SunOS"
+PKG_SUGGESTED_OPTIONS+=        sunaudio
+.endif
+
+.if ${OPSYS} == "NetBSD" && ${OPSYS_VERSION} >= 090000
+PKG_SUGGESTED_OPTIONS+=        webrtc
+.endif
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Malsa)
+AUDIO_BACKENDS+=       alsa
+.include "../../audio/alsa-lib/buildlink3.mk"
+.endif
+
+.if !empty(PKG_OPTIONS:Mmozilla-jemalloc)
+CONFIGURE_ARGS+=       --enable-jemalloc
+CONFIGURE_ARGS+=       --enable-replace-malloc
+.else
+CONFIGURE_ARGS+=       --disable-jemalloc
+.endif
+
+.if !empty(PKG_OPTIONS:Mdebug)
+CONFIGURE_ARGS+=       --enable-debug="-g -Og"
+CONFIGURE_ARGS+=       --disable-optimize
+CONFIGURE_ARGS+=       --enable-debug-js-modules
+CONFIGURE_ARGS+=       --disable-install-strip
+.else
+.  if !empty(PKG_OPTIONS:Mdebug-info)
+CONFIGURE_ARGS+=       --enable-debug-symbols
+CONFIGURE_ARGS+=       --enable-optimize=-O2
+CONFIGURE_ARGS+=       --disable-install-strip
+.  else
+CONFIGURE_ARGS+=       --disable-debug-symbols
+CONFIGURE_ARGS+=       --enable-optimize=-O2
+CONFIGURE_ARGS+=       --enable-install-strip
+.  endif
+CONFIGURE_ARGS+=       --disable-debug
+.endif
+
+.if !empty(PKG_OPTIONS:Mpulseaudio)
+AUDIO_BACKENDS+=       pulseaudio
+.include "../../audio/pulseaudio/buildlink3.mk"
+.endif
+
+.if !empty(PKG_OPTIONS:Mdbus)
+.include "../../sysutils/dbus-glib/buildlink3.mk"
+CONFIGURE_ARGS+=       --enable-dbus
+.else
+CONFIGURE_ARGS+=       --disable-dbus
+.  if ${OPSYS} == "Linux"
+CONFIGURE_ARGS+=       --disable-necko-wifi
+.  endif
+.endif
+
+.if !empty(PKG_OPTIONS:Mofficial-mozilla-branding)
+CONFIGURE_ARGS+=       --enable-official-branding
+LICENSE+=              AND mozilla-trademark-license
+RESTRICTED=            Trademark holder prohibits distribution of modified versions.
+NO_BIN_ON_CDROM=       ${RESTRICTED}
+NO_BIN_ON_FTP=         ${RESTRICTED}
+.else
+CONFIGURE_ARGS+=       --with-branding=browser/branding/unofficial
+.endif
+
+.if !empty(PKG_OPTIONS:Msunaudio)
+AUDIO_BACKENDS+=       sunaudio
+.endif
+
+.if !empty(PKG_OPTIONS:Mjack)
+AUDIO_BACKENDS+=       jack
+.include "../../audio/jack/buildlink3.mk"
+.endif
+
+.if !empty(PKG_OPTIONS:Mwebrtc)
+.include "../../graphics/libv4l/buildlink3.mk"
+CONFIGURE_ARGS+=       --enable-webrtc
+.else
+CONFIGURE_ARGS+=       --disable-webrtc
+.endif
+
+CONFIGURE_ARGS+=       --audio-backends=${AUDIO_BACKENDS:ts,}

Index: pkgsrc/www/firefox115/files/desktop.in
diff -u /dev/null pkgsrc/www/firefox115/files/desktop.in:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/files/desktop.in      Mon Sep 11 12:33:25 2023
@@ -0,0 +1,191 @@
+[Desktop Entry]
+Encoding=UTF-8
+Name=@MOZILLA_NAME@ Web Browser
+Name[am]=
+Name[ar]=
+Name[az]=@MOZILLA_NAME@ Veb Səyyahı
+Name[be]=
+Name[bg]=Интернет браузър @MOZILLA_NAME@
+Name[bn]=
+Name[bs]=@MOZILLA_NAME@ web preglednik
+Name[ca]=Navegador web @MOZILLA_NAME@
+Name[cs]=Prohlížeč WWW @MOZILLA_NAME@
+Name[cy]=Y Porwr Gwe @MOZILLA_NAME@
+Name[da]=@MOZILLA_NAME@ - internetsurfning
+Name[de]=@MOZILLA_NAME@ Webbrowser
+Name[el]=Περιηγητής Διαδικτύου @MOZILLA_NAME@
+Name[en_CA]=@MOZILLA_NAME@ Web Browser
+Name[en_GB]=@MOZILLA_NAME@ Web Browser
+Name[es]=Navegador Web @MOZILLA_NAME@
+Name[et]=@MOZILLA_NAME@ veebibrauser
+Name[eu]=@MOZILLA_NAME@ web arakatzailea
+Name[fi]=@MOZILLA_NAME@, WWW-selain
+Name[fr]=Navigateur Web @MOZILLA_NAME@
+Name[ga]=Brabhsálaí Lín @MOZILLA_NAME@
+Name[gu]=એપીફની વૅબ બ્રાઉઝર
+Name[he]=דפדפן @MOZILLA_NAME@
+Name[hi]=
+Name[hr]=@MOZILLA_NAME@ Web preglednik
+Name[hu]=@MOZILLA_NAME@ webböngésző
+Name[id]=Web Browser @MOZILLA_NAME@
+Name[it]=Browser web @MOZILLA_NAME@
+Name[ja]=@MOZILLA_NAME@ ウェブ・ブラウザ
+Name[ko]=@MOZILLA_NAME@ 웹 브라우저
+Name[li]=@MOZILLA_NAME@ Web Browser
+Name[lt]=@MOZILLA_NAME@ web naršyklė
+Name[mk]=@MOZILLA_NAME@ веб прелистувач
+Name[ml]=എപ്പിഫാനി വെബ്ബ് ബ്രൌസ‌ര്
+Name[mn]=@MOZILLA_NAME@ веб хөтөч
+Name[ms]=Pelungsur Web @MOZILLA_NAME@
+Name[nb]=@MOZILLA_NAME@ nettleser
+Name[nl]=@MOZILLA_NAME@ Webbrowser
+Name[nn]=@MOZILLA_NAME@ nettlesar
+Name[no]=@MOZILLA_NAME@ nettleser
+Name[pa]=ਏਪੀਫਾਨੀ ਵੈੱਬ ਬਰਾਊਜ਼ਰ
+Name[pl]=Przeglądarka WWW @MOZILLA_NAME@
+Name[pt]=Navegador Web @MOZILLA_NAME@
+Name[pt_BR]=Navegador Web @MOZILLA_NAME@
+Name[ro]=Navigatorul @MOZILLA_NAME@
+Name[ru]=Веб-браузер @MOZILLA_NAME@
+Name[sk]=
+Name[sl]=Spletni brskalnik @MOZILLA_NAME@
+Name[sq]=@MOZILLA_NAME@ - Shfletuesi Web
+Name[sr]=
+Name[sr@Latn]=Veb čitač Spoznaja
+Name[sv]=Webbläsaren @MOZILLA_NAME@
+Name[ta]=எபிபனி வலை உலாவி
+Name[tk]=@MOZILLA_NAME@ Web Ahtarçisi
+Name[tr]=@MOZILLA_NAME@ Web Tarayıcı
+Name[uk]=Переглядач web @MOZILLA_NAME@
+Name[vi]=Trình Duyệt Web @MOZILLA_NAME@
+Name[wa]=Betchteu waibe epiphany
+Name[zh_CN]=@MOZILLA_NAME@ Web 浏览器
+Name[zh_TW]=@MOZILLA_NAME@ 網頁瀏覽器
+GenericName=Web Browser
+GenericName[ar]=متصفّح الانترنت
+GenericName[az]=Veb Səyyahı
+GenericName[be]=Вандроўнік па павуціньню
+GenericName[bg]=Браузър
+GenericName[bn]=ওয়েব ব্রাউজার
+GenericName[bs]=Web preglednik
+GenericName[ca]=Navegador web
+GenericName[cs]=Prohlížeč WWW
+GenericName[cy]=Porwr Gwe
+GenericName[da]=Internetsurfning
+GenericName[de]=Webbrowser
+GenericName[el]=Περιηγητής Ιστοσελίδων
+GenericName[en_CA]=Web Browser
+GenericName[en_GB]=Web Browser
+GenericName[es]=Navegador web
+GenericName[et]=Veebilehitseja
+GenericName[eu]=Web arakatzailea
+GenericName[fi]=WWW-selain
+GenericName[fr]=Navigateur Web @MOZILLA_NAME@
+GenericName[ga]=Brabhsálaí Lín
+GenericName[gu]=વેબ બ્રાઉઝર
+GenericName[he]=דפדפן אינטרנט
+GenericName[hi]=वेब ब्राउज़र
+GenericName[hr]=Web preglednik
+GenericName[hu]=Webböngésző
+GenericName[id]=Browser Web
+GenericName[it]=Browser web
+GenericName[ja]=GNOME ウェブ・ブラウザ
+GenericName[ko]=웹 브라우저
+GenericName[li]=Wèb Browser
+GenericName[lt]=Web naršyklė
+GenericName[mk]=Веб прелистувач
+GenericName[mn]=Веб хөтөч
+GenericName[ms]=Pelungsur Web
+GenericName[nb]=Nettleser
+GenericName[nl]=Web-browser
+GenericName[nn]=Nettlesar
+GenericName[no]=Nettleser
+GenericName[pa]=ਵੈਬ ਬਰਾਊਜ਼
+GenericName[pl]=Przeglądarka WWW
+GenericName[pt]=Navegador Web
+GenericName[pt_BR]=Navegador Web
+GenericName[ro]=Navigator Internet
+GenericName[ru]=Веб-браузер
+GenericName[sk]=WWW prehliadač
+GenericName[sl]=Spletni brskalnik
+GenericName[sq]=Shfletuesi Web
+GenericName[sr]=Веб читач
+GenericName[sr@Latn]=Veb čitač
+GenericName[sv]=Webbläsare
+GenericName[ta]=வலை உலாவி
+GenericName[th]=เว็บบราวเซอร์
+GenericName[tk]=Web Ahtarçysy
+GenericName[tr]=Web Tarayıcı
+GenericName[uk]=Переглядач web-сторінок
+GenericName[vi]=Trình duyệt Web
+GenericName[wa]=Betchteu waibe
+GenericName[zh_CN]=Web 浏览器
+GenericName[zh_TW]=網頁瀏覽器
+Comment=Browse the web
+Comment[ar]=تصفح الانترنت
+Comment[az]=Vebi gəzin
+Comment[be]=Вандраваць па павуціньню
+Comment[bg]=Сърфиране в интернет
+Comment[bn]=ওয়েব ব্রাউজ করুন
+Comment[bs]=Pregledaj na internetu
+Comment[ca]=Navegueu per la web
+Comment[cs]=Prohlížet WWW
+Comment[cy]=Pori'r we
+Comment[da]=Surf på internettet
+Comment[de]=Im Web surfen
+Comment[el]=Περιήγηση στον παγκόσμιο ιστό
+Comment[en_CA]=Browse the web
+Comment[en_GB]=Browse the web
+Comment[es]=Navegar por la web
+Comment[et]=Sirvi veebi
+Comment[eu]=Arakatu web-a
+Comment[fi]=Selaa WWW:tä
+Comment[fr]=Naviguer sur Internet
+Comment[ga]=Brabhsáil an Líon
+Comment[gu]=વેબમાં શોધો
+Comment[he]=גלוש ברשת
+Comment[hi]=वेब ब्राउज़ करें
+Comment[hr]=Pregledaj Web
+Comment[hu]=A világháló böngészése
+Comment[id]=Jelajah web
+Comment[it]=Esplora il web
+Comment[ja]=ウェブを閲覧します
+Comment[ko]=웹을 돌아 다닙니다
+Comment[li]=Blajere op internet
+Comment[lt]=Naršyti internete
+Comment[mk]=Прелистувајте на веб
+Comment[ml]=വലക്കെട്ട് തിരയുക
+Comment[mn]=Веб броузе хийх
+Comment[ms]=Layari web
+Comment[nb]=Surf på nettet
+Comment[nl]=Websurfen
+Comment[nn]=Surf på nettet
+Comment[no]=Surf på nettet
+Comment[pa]=ਵੈਬ ਬਰਾਊਜ਼
+Comment[pl]=Przeglądanie stron WWW
+Comment[pt]=Navegar na web
+Comment[pt_BR]=Navegar na web
+Comment[ro]=Navigare Internet
+Comment[ru]=Веб-браузер
+Comment[sk]=Prehliadať internet
+Comment[sl]=Brskaj po spletu
+Comment[sq]=Eksploro web-in
+Comment[sr]=Прегледај веб
+Comment[sr@Latn]=Pregledaj veb
+Comment[sv]=Surfa på nätet
+Comment[ta]=வலையில் உலாவு
+Comment[th]=ใช้งานเว็บบราวเซอร์ @MOZILLA_NAME@
+Comment[tk]=Webi Ahtar
+Comment[tr]=Web'e Gözat
+Comment[uk]=Програма перегляду web-сторінок
+Comment[vi]=Duyệt web
+Comment[wa]=Naivyî avå les waibes
+Comment[zh_CN]=浏览 Web
+Comment[zh_TW]=瀏覽網頁
+Exec=@MOZILLA@ %u
+Icon=@FIREFOX_ICON@
+StartupNotify=false
+Terminal=false
+Type=Application
+Categories=Application;Network;
+MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;
Index: pkgsrc/www/firefox115/files/firefox.sh
diff -u /dev/null pkgsrc/www/firefox115/files/firefox.sh:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/files/firefox.sh      Mon Sep 11 12:33:25 2023
@@ -0,0 +1,14 @@
+#!/bin/sh
+if [ -f /usr/X11R7/lib/libEGL.so ] && [ -z "$LD_PRELOAD" ] && \
+  nm /usr/X11R7/lib/libGL.so | grep -Fq "B _glapi_tls_Dispatch"; then
+    # Temporary workaround for PR#57445
+    # This may not avoid a crash 100% of the time, but changes at least some
+    # cases of 100% crash on startup to "have not yet seen crash on startup"
+    echo "Applying libEGL LD_PRELOAD workaround for NetBSD" >&2
+    export LD_PRELOAD=/usr/X11R7/lib/libEGL.so
+    # Note that there is an _additional_ issue with firefox >= 111 that
+    # needs to be addressed, and that is worked around by disabling webgl
+    # by default, but it's not even worth looking at that on a system without
+    # the fixed libGL
+fi
+exec /usr/pkg/lib/firefox/firefox "$@"
Index: pkgsrc/www/firefox115/files/node-wrapper.sh
diff -u /dev/null pkgsrc/www/firefox115/files/node-wrapper.sh:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/files/node-wrapper.sh Mon Sep 11 12:33:25 2023
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+VERS=v20.3.1
+
+if [ "$1" = "-v" ] || [ "$1" = "--version" ]; then
+       printf "${VERS}\n"
+fi
+
+exit 0
Index: pkgsrc/www/firefox115/files/replace-moz.build.awk
diff -u /dev/null pkgsrc/www/firefox115/files/replace-moz.build.awk:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/files/replace-moz.build.awk   Mon Sep 11 12:33:25 2023
@@ -0,0 +1,46 @@
+/^if CONFIG\[\"OS_TARGET\"\] == \"Android\":/{
+       flag = 1;
+       print $0;
+       next;
+}
+/^if CONFIG\[\"OS_TARGET\"\] == \"Linux\":/{
+       flag = 0;
+       sub(/^if CONFIG\[\"OS_TARGET\"\] == \"Linux\":/, "if CONFIG[\"OS_TARGET\"] == \"Linux\" or CONFIG[\"OS_TARGET\"] == \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] 
== \"FreeBSD\":");
+       print $0;
+       next;
+}
+/^if CONFIG\[\"CPU_ARCH\"\] == \"arm\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/{
+       flag = 0;
+       sub(/^if CONFIG\[\"CPU_ARCH\"\] == \"arm\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/, "if CONFIG\[\"CPU_ARCH\"\] == \"arm\" and (CONFIG[\"OS_TARGET\"] == \"Linux\" or CONFIG[\"OS_TARGET\"] 
== \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+       print $0;
+       next;
+}
+/^if CONFIG\[\"CPU_ARCH\"\] == \"aarch64\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/{
+       flag = 0;
+       sub(/^if CONFIG\[\"CPU_ARCH\"\] == \"aarch64\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/, "if CONFIG\[\"CPU_ARCH\"\] == \"aarch64\" and (CONFIG[\"OS_TARGET\"] == \"Linux\" or 
CONFIG[\"OS_TARGET\"] == \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+       print $0;
+       next;
+}
+/^if CONFIG\[\"CPU_ARCH\"\] == \"x86\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/{
+       flag = 0;
+       sub(/^if CONFIG\[\"CPU_ARCH\"\] == \"x86\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/, "if CONFIG\[\"CPU_ARCH\"\] == \"x86\" and (CONFIG[\"OS_TARGET\"] == \"Linux\" or CONFIG[\"OS_TARGET\"] 
== \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+       print $0;
+       next;
+}
+/^if CONFIG\[\"CPU_ARCH\"\] == \"x86_64\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/{
+       flag = 0;
+       sub(/^if CONFIG\[\"CPU_ARCH\"\] == \"x86_64\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/, "if CONFIG\[\"CPU_ARCH\"\] == \"x86_64\" and (CONFIG[\"OS_TARGET\"] == \"Linux\" or 
CONFIG[\"OS_TARGET\"] == \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+       print $0;
+       next;
+}
+{
+       if (flag != 1) {
+               sub(/^    DEFINES\[\"WEBRTC_LINUX\"\] = True/, "    if CONFIG\[\"OS_TARGET\"\] == \"Linux\":\n        DEFINES\[\"WEBRTC_LINUX\"\] = True\n    else:\n        DEFINES\[\"WEBRTC_BSD\"\] 
= True");
+               sub(/^if not CONFIG\[\"MOZ_DEBUG\"\] and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/, "if not CONFIG[\"MOZ_DEBUG\"] and (CONFIG[\"OS_TARGET\"] == \"Linux\" or CONFIG[\"OS_TARGET\"] == 
\"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+               sub(/^if CONFIG\[\"MOZ_DEBUG\"\] == \"1\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/, "if CONFIG[\"MOZ_DEBUG\"] == \"1\" and (CONFIG[\"OS_TARGET\"] == \"Linux\" or 
CONFIG[\"OS_TARGET\"] == \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+               sub(/^if CONFIG\[\"CPU_ARCH\"\] == \"aarch64\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/, "if CONFIG[\"CPU_ARCH\"] == \"aarch64\" and (CONFIG[\"OS_TARGET\"] == \"Linux\" or 
CONFIG[\"OS_TARGET\"] == \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+               sub(/^if CONFIG\[\"CPU_ARCH\"\] == \"x86\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/, "if CONFIG[\"CPU_ARCH\"] == \"x86\" and (CONFIG[\"OS_TARGET\"] == \"Linux\" or 
CONFIG[\"OS_TARGET\"] == \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+               sub(/^if CONFIG\[\"CPU_ARCH\"\] == \"x86_64\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/, "if CONFIG[\"CPU_ARCH\"] == \"x86_64\" and (CONFIG[\"OS_TARGET\"] == \"Linux\" or 
CONFIG[\"OS_TARGET\"] == \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+       }
+       print $0;
+}

Index: pkgsrc/www/firefox115/patches/patch-browser_app_profile_firefox.js
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-browser_app_profile_firefox.js:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-browser_app_profile_firefox.js  Mon Sep 11 12:33:25 2023
@@ -0,0 +1,51 @@
+$NetBSD: patch-browser_app_profile_firefox.js,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+This patch modifies default Firefox settings - see the comments above
+each one.
+
+--- browser/app/profile/firefox.js.orig        2023-05-22 16:53:55.000000000 +0000
++++ browser/app/profile/firefox.js
+@@ -2120,7 +2120,11 @@ pref("reader.pocket.ctaVersion", "");
+ 
+ pref("view_source.tab", true);
+ 
+-pref("dom.serviceWorkers.enabled", true);
++// On NetBSD, many web applications (e.g. Telegram, Mastodon, Twitter)
++// will freeze until the service worker is restarted in about:serviceworkers.
++// This is a workaround that makes most of these sites function.
++// The root cause of this should be investigated.
++pref("dom.serviceWorkers.enabled", false);
+ 
+ // Enable Push API.
+ pref("dom.push.enabled", true);
+@@ -2329,6 +2333,30 @@ pref("app.normandy.onsync_skew_sec", 600
+ pref("toolkit.coverage.enabled", false);
+ pref("toolkit.coverage.endpoint.base", "https://coverage.mozilla.org";);
+ 
++// Select UI locale from LANG/LC_MESSAGE environmental variables
++pref("intl.locale.requested", "");
++
++// Enable system addons, for example langpacks from www/firefox-l10n
++pref("extensions.autoDisableScopes", 11);
++
++// Firefox includes a complex mechanism for "blacklisting" GPUs that
++// appears to fail on a NetBSD system where the only available OpenGL
++// implementations are all from Mesa.  WebRender was supposed to be
++// enabled by default from Firefox 91 onwards and appears to greatly
++// improve performance even with acceleration disabled at the kernel
++// level.
++pref("gfx.webrender.all", true);
++
++// Disable Web MIDI support
++// NetBSD gets immediate SIGSEGV when Web MIDI is enabled.
++pref("midi.testing", true);
++pref("dom.webmidi.enabled", true);
++pref("midi.prompt.testing", true);
++pref("media.navigator.permission.disabled", true);
++
++// DIsable WebGL for NetBSD systems
++pref("webgl.disabled", true);
++
+ // Discovery prefs
+ pref("browser.discovery.enabled", true);
+ pref("browser.discovery.containers.enabled", true);
Index: pkgsrc/www/firefox115/patches/patch-build_moz.configure_rust.configure
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-build_moz.configure_rust.configure:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-build_moz.configure_rust.configure      Mon Sep 11 12:33:25 2023
@@ -0,0 +1,15 @@
+$NetBSD: patch-build_moz.configure_rust.configure,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+* Do not match rumprun toolchain for NetBSD,
+  narrowed should be one not two.
+
+--- build/moz.configure/rust.configure.orig    2020-12-03 23:12:39.000000000 +0000
++++ build/moz.configure/rust.configure
+@@ -371,6 +371,7 @@ def detect_rustc_target(
+             for c in candidates
+             if c.target.raw_os == host_or_target.raw_os
+             and c.target.raw_cpu == host_or_target.raw_cpu
++            and not c.rust_target.endswith("-rumprun-netbsd")
+         ]
+         if len(narrowed) == 1:
+             return narrowed[0].rust_target
Index: pkgsrc/www/firefox115/patches/patch-config_gcc-stl-wrapper.template.h
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-config_gcc-stl-wrapper.template.h:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-config_gcc-stl-wrapper.template.h       Mon Sep 11 12:33:25 2023
@@ -0,0 +1,31 @@
+$NetBSD: patch-config_gcc-stl-wrapper.template.h,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+--- config/gcc-stl-wrapper.template.h.orig     2021-09-04 13:24:51.000000000 +0000
++++ config/gcc-stl-wrapper.template.h
+@@ -32,8 +32,8 @@
+ // limits) and bug 1694575 (iosfwd).
+ // Please be careful when adding more exceptions, especially regarding
+ // the header not directly or indirectly including <new>.
+-#ifndef moz_dont_include_mozalloc_for_cstdlib
+-#  define moz_dont_include_mozalloc_for_cstdlib
++#ifndef moz_dont_include_mozalloc_for_${HEADER}
++#  define moz_dont_include_mozalloc_for_${HEADER}
+ #endif
+ 
+ #ifndef moz_dont_include_mozalloc_for_cmath
+@@ -55,7 +55,7 @@
+ // Include mozalloc after the STL header and all other headers it includes
+ // have been preprocessed.
+ #if !defined(MOZ_INCLUDE_MOZALLOC_H) && \
+-    !defined(moz_dont_include_mozalloc_for_${HEADER})
++    !defined(moz_dont_include_mozalloc_for_cstdlib)
+ #  define MOZ_INCLUDE_MOZALLOC_H
+ #  define MOZ_INCLUDE_MOZALLOC_H_FROM_${HEADER}
+ #endif
+@@ -84,4 +84,6 @@
+ #  include "mozilla/throw_gcc.h"
+ #endif
+ 
++#undef moz_dont_include_mzalloc_for_${HEADER}
++
+ #endif  // if mozilla_${HEADER}_h
Index: pkgsrc/www/firefox115/patches/patch-config_makefiles_rust.mk
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-config_makefiles_rust.mk:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-config_makefiles_rust.mk        Mon Sep 11 12:33:25 2023
@@ -0,0 +1,29 @@
+$NetBSD: patch-config_makefiles_rust.mk,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+NetBSD doesn't get along with parallel rust builds (it causes issues
+with ld.so) which are the default. Force -j1.
+
+Use less memory to fix build under NetBSD/i386.
+From: https://bugzilla.mozilla.org/show_bug.cgi?id=1644409
+
+--- config/makefiles/rust.mk.orig      2023-06-22 21:19:03.000000000 +0000
++++ config/makefiles/rust.mk
+@@ -60,6 +60,9 @@ ifdef MOZ_TSAN
+ cargo_build_flags += -Zbuild-std=std,panic_abort
+ RUSTFLAGS += -Zsanitizer=thread
+ endif
++ifeq ($(OS_ARCH),NetBSD)
++cargo_build_flags += @RUST_MAKE_JOBS@
++endif
+ 
+ rustflags_sancov =
+ ifdef LIBFUZZER
+@@ -92,7 +95,7 @@ ifndef rustflags_sancov
+ # Never enable when coverage is enabled to work around https://github.com/rust-lang/rust/issues/90045.
+ ifndef MOZ_CODE_COVERAGE
+ ifeq (,$(findstring gkrust_gtest,$(RUST_LIBRARY_FILE)))
+-cargo_rustc_flags += -Clto$(if $(filter full,$(MOZ_LTO_RUST_CROSS)),=fat)
++cargo_rustc_flags += -Clto$(if $(filter full,$(MOZ_LTO_RUST_CROSS)),=thin)
+ endif
+ # We need -Cembed-bitcode=yes for all crates when using -Clto.
+ RUSTFLAGS += -Cembed-bitcode=yes
Index: pkgsrc/www/firefox115/patches/patch-dom_base_nsAttrName.h
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-dom_base_nsAttrName.h:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-dom_base_nsAttrName.h   Mon Sep 11 12:33:25 2023
@@ -0,0 +1,18 @@
+$NetBSD: patch-dom_base_nsAttrName.h,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+cbindgen gets confused by NetBSD's types being macros too
+https://mail-index.netbsd.org/tech-pkg/2018/10/25/msg020395.html
+
+--- dom/base/nsAttrName.h.orig 2019-01-18 00:20:23.000000000 +0000
++++ dom/base/nsAttrName.h
+@@ -16,6 +16,10 @@
+ #include "mozilla/dom/NodeInfo.h"
+ #include "nsAtom.h"
+ #include "nsDOMString.h"
++#ifdef __NetBSD__
++/* This is also a macro which causes problems with cbindgen */
++#undef uintptr_t
++#endif
+ 
+ #define NS_ATTRNAME_NODEINFO_BIT 1
+ class nsAttrName {
Index: pkgsrc/www/firefox115/patches/patch-dom_webtransport_api_WebTransportDatagramDuplexStream.cpp
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-dom_webtransport_api_WebTransportDatagramDuplexStream.cpp:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-dom_webtransport_api_WebTransportDatagramDuplexStream.cpp       Mon Sep 11 12:33:25 2023
@@ -0,0 +1,40 @@
+$NetBSD: patch-dom_webtransport_api_WebTransportDatagramDuplexStream.cpp,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+--- dom/webtransport/api/WebTransportDatagramDuplexStream.cpp.orig     2023-04-23 21:17:18.000000000 +0000
++++ dom/webtransport/api/WebTransportDatagramDuplexStream.cpp
+@@ -62,7 +62,7 @@ void WebTransportDatagramDuplexStream::S
+                                                          ErrorResult& aRv) {
+   // https://w3c.github.io/webtransport/#dom-webtransportdatagramduplexstream-incomingmaxage
+   // Step 1
+-  if (isnan(aMaxAge) || aMaxAge < 0.) {
++  if (std::isnan(aMaxAge) || aMaxAge < 0.) {
+     aRv.ThrowRangeError("Invalid IncomingMaxAge");
+     return;
+   }
+@@ -78,7 +78,7 @@ void WebTransportDatagramDuplexStream::S
+                                                          ErrorResult& aRv) {
+   // https://w3c.github.io/webtransport/#dom-webtransportdatagramduplexstream-outgoingmaxage
+   // Step 1
+-  if (isnan(aMaxAge) || aMaxAge < 0.) {
++  if (std::isnan(aMaxAge) || aMaxAge < 0.) {
+     aRv.ThrowRangeError("Invalid OutgoingMaxAge");
+     return;
+   }
+@@ -94,7 +94,7 @@ void WebTransportDatagramDuplexStream::S
+     double aWaterMark, ErrorResult& aRv) {
+   // https://w3c.github.io/webtransport/#dom-webtransportdatagramduplexstream-incominghighwatermark
+   // Step 1
+-  if (isnan(aWaterMark) || aWaterMark < 0.) {
++  if (std::isnan(aWaterMark) || aWaterMark < 0.) {
+     aRv.ThrowRangeError("Invalid OutgoingMaxAge");
+     return;
+   }
+@@ -110,7 +110,7 @@ void WebTransportDatagramDuplexStream::S
+     double aWaterMark, ErrorResult& aRv) {
+   // https://w3c.github.io/webtransport/#dom-webtransportdatagramduplexstream-outgoinghighwatermark
+   // Step 1
+-  if (isnan(aWaterMark) || aWaterMark < 0.) {
++  if (std::isnan(aWaterMark) || aWaterMark < 0.) {
+     aRv.ThrowRangeError("Invalid OutgoingHighWaterMark");
+     return;
+   }
Index: pkgsrc/www/firefox115/patches/patch-gfx_angle_checkout_src_common_third__party_smhasher_src_PMurHash.cpp
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-gfx_angle_checkout_src_common_third__party_smhasher_src_PMurHash.cpp:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-gfx_angle_checkout_src_common_third__party_smhasher_src_PMurHash.cpp    Mon Sep 11 12:33:25 2023
@@ -0,0 +1,17 @@
+$NetBSD: patch-gfx_angle_checkout_src_common_third__party_smhasher_src_PMurHash.cpp,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+Fix build where _LITTLE_ENDIAN is not an integer.
+
+--- gfx/angle/checkout/src/common/third_party/smhasher/src/PMurHash.cpp.orig   2019-07-06 01:48:31.000000000 +0000
++++ gfx/angle/checkout/src/common/third_party/smhasher/src/PMurHash.cpp
+@@ -91,8 +91,8 @@ on big endian machines, or a byte-by-byt
+ /* gcc 'may' define __LITTLE_ENDIAN__ or __BIG_ENDIAN__ to 1 (Note the trailing __),
+  * or even _LITTLE_ENDIAN or _BIG_ENDIAN (Note the single _ prefix) */
+ #if !defined(__BYTE_ORDER)
+-#    if defined(__LITTLE_ENDIAN__) && __LITTLE_ENDIAN__ == 1 || \
+-        defined(_LITTLE_ENDIAN) && _LITTLE_ENDIAN == 1
++#    if defined(__LITTLE_ENDIAN__) && __LITTLE_ENDIAN__-0 == 1 || \
++        defined(_LITTLE_ENDIAN) && _LITTLE_ENDIAN-0 == 1
+ #        define __BYTE_ORDER __LITTLE_ENDIAN
+ #    elif defined(__BIG_ENDIAN__) && __BIG_ENDIAN__ == 1 || defined(_BIG_ENDIAN) && _BIG_ENDIAN == 1
+ #        define __BYTE_ORDER __BIG_ENDIAN
Index: pkgsrc/www/firefox115/patches/patch-gfx_angle_checkout_src_compiler_translator_InfoSink.h
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-gfx_angle_checkout_src_compiler_translator_InfoSink.h:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-gfx_angle_checkout_src_compiler_translator_InfoSink.h   Mon Sep 11 12:33:25 2023
@@ -0,0 +1,16 @@
+$NetBSD: patch-gfx_angle_checkout_src_compiler_translator_InfoSink.h,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+* isinf/isnan in make.h is defined as macro. Use non-macro version
+  to fix build.
+
+--- gfx/angle/checkout/src/compiler/translator/InfoSink.h.orig 2021-10-28 18:03:11.000000000 +0000
++++ gfx/angle/checkout/src/compiler/translator/InfoSink.h
+@@ -7,7 +7,7 @@
+ #ifndef COMPILER_TRANSLATOR_INFOSINK_H_
+ #define COMPILER_TRANSLATOR_INFOSINK_H_
+ 
+-#include <math.h>
++#include <cmath>
+ #include <stdlib.h>
+ #include "GLSLANG/ShaderLang.h"
+ #include "compiler/translator/Common.h"
Index: pkgsrc/www/firefox115/patches/patch-gfx_skia_skia_src_core_SkCpu.cpp
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-gfx_skia_skia_src_core_SkCpu.cpp:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-gfx_skia_skia_src_core_SkCpu.cpp        Mon Sep 11 12:33:25 2023
@@ -0,0 +1,15 @@
+$NetBSD: patch-gfx_skia_skia_src_core_SkCpu.cpp,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+NetBSD/aarch64 doesn't have <sys/auxv.h>.
+
+--- gfx/skia/skia/src/core/SkCpu.cpp.orig      2019-03-05 00:32:47.658232017 +0900
++++ gfx/skia/skia/src/core/SkCpu.cpp   2019-03-05 00:33:10.203589997 +0900
+@@ -70,7 +70,7 @@
+         return features;
+     }
+ 
+-#elif defined(SK_CPU_ARM64) && __has_include(<sys/auxv.h>)
++#elif defined(SK_CPU_ARM64) && __has_include(<sys/auxv.h>) && !defined(__NetBSD__)
+     #include <sys/auxv.h>
+ 
+     static uint32_t read_cpu_features() {
Index: pkgsrc/www/firefox115/patches/patch-gfx_skia_skia_src_core_SkVM.cpp
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-gfx_skia_skia_src_core_SkVM.cpp:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-gfx_skia_skia_src_core_SkVM.cpp Mon Sep 11 12:33:25 2023
@@ -0,0 +1,21 @@
+$NetBSD: patch-gfx_skia_skia_src_core_SkVM.cpp,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+Work with PaX MPROTECT on NetBSD by stating that we will later make this memory
+block executable.
+
+https://bugzilla.mozilla.org/show_bug.cgi?id=1811913
+
+--- gfx/skia/skia/src/core/SkVM.cpp.orig       2023-05-25 21:19:29.000000000 +0000
++++ gfx/skia/skia/src/core/SkVM.cpp
+@@ -57,7 +57,11 @@ bool gSkVMJITViaDylib{false};
+             // mprotect doesn't round up for you, and instead requires *len is at page granularity.
+             const size_t page = sysconf(_SC_PAGESIZE);
+             *len = ((*len + page - 1) / page) * page;
++#ifdef PROT_MPROTECT
++            return mmap(nullptr,*len, PROT_READ|PROT_WRITE|PROT_MPROTECT(PROT_EXEC), MAP_ANONYMOUS|MAP_PRIVATE, -1,0);
++#else
+             return mmap(nullptr,*len, PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, -1,0);
++#endif
+         }
+         static void remap_as_executable(void* ptr, size_t len) {
+             mprotect(ptr, len, PROT_READ|PROT_EXEC);
Index: pkgsrc/www/firefox115/patches/patch-gfx_wr_swgl_build.rs
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-gfx_wr_swgl_build.rs:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-gfx_wr_swgl_build.rs    Mon Sep 11 12:33:25 2023
@@ -0,0 +1,27 @@
+$NetBSD: patch-gfx_wr_swgl_build.rs,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+Work around an internal compiler error on i386 when optimization is enabled:
+
+  cargo:warning=In file included from src/gl.cc:2637:0:
+  cargo:warning=src/rasterize.h: In function 'void draw_quad_spans(int, Point2D*, uint32_t, glsl::Interpolants*, Texture&, Texture&, const ClipRect&) [with P = unsigned char]':
+  cargo:warning=src/rasterize.h:782:20: internal compiler error: in convert_move, at expr.c:231
+  cargo:warning= static inline void draw_quad_spans(int nump, Point2D p[4], uint32_t z,
+  cargo:warning=                    ^~~~~~~~~~~~~~~
+
+
+--- gfx/wr/swgl/build.rs.orig  2021-08-23 14:57:16.000000000 +0000
++++ gfx/wr/swgl/build.rs
+@@ -196,6 +196,13 @@ fn main() {
+         }
+     }
+ 
++    // Work around a compiler bug
++    let target_triple = std::env::var("TARGET").expect("The TARGET environment variable must be set");
++    let target_name = target_triple.split('-').next().unwrap();
++    if ["i386", "i586", "i686"].contains(&target_name) { 
++        build.flag("-O0");
++    }
++
+     build.file("src/gl.cc")
+         .define("_GLIBCXX_USE_CXX11_ABI", Some("0"))
+         .include(shader_dir)
Index: pkgsrc/www/firefox115/patches/patch-ipc_chromium_src_base_message__pump__libevent.cc
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-ipc_chromium_src_base_message__pump__libevent.cc:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-ipc_chromium_src_base_message__pump__libevent.cc        Mon Sep 11 12:33:25 2023
@@ -0,0 +1,22 @@
+$NetBSD: patch-ipc_chromium_src_base_message__pump__libevent.cc,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+Allow older libevent
+
+--- ipc/chromium/src/base/message_pump_libevent.cc.orig        2022-06-16 21:32:07.000000000 +0000
++++ ipc/chromium/src/base/message_pump_libevent.cc
+@@ -24,6 +24,7 @@
+ 
+ // This macro checks that the _EVENT_SIZEOF_* constants defined in
+ // ipc/chromiume/src/third_party/<platform>/event2/event-config.h are correct.
++#if 0
+ #if defined(_EVENT_SIZEOF_SHORT)
+ #  define CHECK_EVENT_SIZEOF(TYPE, type)                \
+     static_assert(_EVENT_SIZEOF_##TYPE == sizeof(type), \
+@@ -44,6 +45,7 @@ CHECK_EVENT_SIZEOF(SHORT, short);
+ CHECK_EVENT_SIZEOF(SIZE_T, size_t);
+ CHECK_EVENT_SIZEOF(TIME_T, time_t);
+ CHECK_EVENT_SIZEOF(VOID_P, void*);
++#endif
+ 
+ // Lifecycle of struct event
+ // Libevent uses two main data structures:
Index: pkgsrc/www/firefox115/patches/patch-ipc_chromium_src_base_platform__thread__posix.cc
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-ipc_chromium_src_base_platform__thread__posix.cc:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-ipc_chromium_src_base_platform__thread__posix.cc        Mon Sep 11 12:33:25 2023
@@ -0,0 +1,18 @@
+$NetBSD: patch-ipc_chromium_src_base_platform__thread__posix.cc,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+* Support NetBSD
+* Support Solaris (we can't rely on pthread_setname_np so ignore it).
+
+--- ipc/chromium/src/base/platform_thread_posix.cc.orig        2019-03-07 16:53:35.000000000 +0000
++++ ipc/chromium/src/base/platform_thread_posix.cc
+@@ -12,7 +12,9 @@
+ #if defined(OS_MACOSX)
+ #  include <mach/mach.h>
+ #elif defined(OS_NETBSD)
+-#  include <lwp.h>
++_Pragma("GCC visibility push(default)")
++#include <lwp.h>
++_Pragma("GCC visibility pop")
+ #elif defined(OS_LINUX)
+ #  include <sys/syscall.h>
+ #  include <sys/prctl.h>
Index: pkgsrc/www/firefox115/patches/patch-ipc_glue_GeckoChildProcessHost.cpp
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-ipc_glue_GeckoChildProcessHost.cpp:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-ipc_glue_GeckoChildProcessHost.cpp      Mon Sep 11 12:33:25 2023
@@ -0,0 +1,21 @@
+$NetBSD: patch-ipc_glue_GeckoChildProcessHost.cpp,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+* Support Solaris
+* Fix NetBSD linking
+
+--- ipc/glue/GeckoChildProcessHost.cpp.orig    2022-01-08 15:41:40.900244448 +0000
++++ ipc/glue/GeckoChildProcessHost.cpp
+@@ -4,7 +4,13 @@
+  * 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/. */
+ 
++#if defined(__NetBSD__)
++_Pragma("GCC visibility push(default)")
++#endif
+ #include "GeckoChildProcessHost.h"
++#if defined(__NetBSD__)
++_Pragma("GCC visibility pop")
++#endif
+ 
+ #include "base/command_line.h"
+ #include "base/process_util.h"
Index: pkgsrc/www/firefox115/patches/patch-js_src_jit_FlushICache.cpp
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-js_src_jit_FlushICache.cpp:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-js_src_jit_FlushICache.cpp      Mon Sep 11 12:33:25 2023
@@ -0,0 +1,25 @@
+$NetBSD: patch-js_src_jit_FlushICache.cpp,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+NetBSD does not have the Linux-specific membarrier(2) syscall.
+
+--- js/src/jit/FlushICache.cpp.orig    2022-09-08 19:35:33.000000000 +0000
++++ js/src/jit/FlushICache.cpp
+@@ -31,12 +31,18 @@
+ #    elif defined(__android__)
+ #      include <sys/syscall.h>
+ #      include <unistd.h>
++#    elif defined(__NetBSD__)
++       // nothing
+ #    else
+ #      error "Missing platform-specific declarations for membarrier syscall!"
+ #    endif  // __linux__ / ANDROID
+ 
+ static int membarrier(int cmd, int flags) {
++#if defined(__NetBSD__)
++  return ENOSYS;
++#else
+   return syscall(__NR_membarrier, cmd, flags);
++#endif
+ }
+ 
+ // These definitions come from the Linux kernel source, for kernels before 4.16
Index: pkgsrc/www/firefox115/patches/patch-js_src_jit_ProcessExecutableMemory.cpp
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-js_src_jit_ProcessExecutableMemory.cpp:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-js_src_jit_ProcessExecutableMemory.cpp  Mon Sep 11 12:33:25 2023
@@ -0,0 +1,40 @@
+$NetBSD: patch-js_src_jit_ProcessExecutableMemory.cpp,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+PaX MPROTECT safety for NetBSD.
+
+https://bugzilla.mozilla.org/show_bug.cgi?id=1811913
+
+--- js/src/jit/ProcessExecutableMemory.cpp.orig        2021-02-11 21:17:13.000000000 +0000
++++ js/src/jit/ProcessExecutableMemory.cpp
+@@ -362,9 +362,16 @@ static void* ReserveProcessExecutableMem
+   // Note that randomAddr is just a hint: if the address is not available
+   // mmap will pick a different address.
+   void* randomAddr = ComputeRandomAllocationAddress();
++#ifdef PROT_MPROTECT
++  void* p = MozTaggedAnonymousMmap(randomAddr, bytes,
++                                   PROT_MPROTECT(PROT_EXEC | PROT_WRITE | PROT_READ),
++                                   MAP_PRIVATE | MAP_ANON, -1, 0,
++                                   "js-executable-memory");
++#else
+   void* p = MozTaggedAnonymousMmap(randomAddr, bytes, PROT_NONE,
+                                    MAP_NORESERVE | MAP_PRIVATE | MAP_ANON, -1,
+                                    0, "js-executable-memory");
++#endif
+   if (p == MAP_FAILED) {
+     return nullptr;
+   }
+@@ -409,8 +416,12 @@ static unsigned ProtectionSettingToFlags
+ 
+ [[nodiscard]] static bool CommitPages(void* addr, size_t bytes,
+                                       ProtectionSetting protection) {
+-  void* p = MozTaggedAnonymousMmap(
+-      addr, bytes, ProtectionSettingToFlags(protection),
++  void* p = MozTaggedAnonymousMmap(addr, bytes,
++#ifdef PROT_MPROTECT
++      ProtectionSettingToFlags(protection) | PROT_MPROTECT(PROT_EXEC | PROT_WRITE | PROT_READ),
++#else
++      ProtectionSettingToFlags(protection),
++#endif
+       MAP_FIXED | MAP_PRIVATE | MAP_ANON, -1, 0, "js-executable-memory");
+   if (p == MAP_FAILED) {
+     return false;
Index: pkgsrc/www/firefox115/patches/patch-js_src_util_NativeStack.cpp
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-js_src_util_NativeStack.cpp:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-js_src_util_NativeStack.cpp     Mon Sep 11 12:33:25 2023
@@ -0,0 +1,32 @@
+$NetBSD: patch-js_src_util_NativeStack.cpp,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+Support SunOS.
+
+--- js/src/util/NativeStack.cpp.orig   2020-04-03 19:34:51.000000000 +0000
++++ js/src/util/NativeStack.cpp
+@@ -13,7 +13,7 @@
+ #  if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
+ #    include <pthread_np.h>
+ #  endif
+-#  if defined(SOLARIS) || defined(AIX)
++#  if defined(__sun) || defined(AIX)
+ #    include <ucontext.h>
+ #  endif
+ #  if defined(ANDROID) && !defined(__aarch64__)
+@@ -40,7 +40,7 @@ void* js::GetNativeStackBaseImpl() {
+   return static_cast<void*>(pTib->StackBase);
+ }
+ 
+-#elif defined(SOLARIS)
++#elif defined(__sun)
+ 
+ static_assert(JS_STACK_GROWTH_DIRECTION < 0);
+ 
+@@ -128,6 +128,7 @@ void* js::GetNativeStackBaseImpl() {
+ #    elif defined(PTHREAD_NP_H) || defined(_PTHREAD_NP_H_) || defined(NETBSD)
+   /* e.g. on FreeBSD 4.8 or newer, neundorf%kde.org@localhost */
+   pthread_attr_get_np(thread, &sattr);
++#    elif defined(__sun)
+ #    else
+   /*
+    * FIXME: this function is non-portable;
Index: pkgsrc/www/firefox115/patches/patch-js_src_vm_ArrayBufferObject.cpp
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-js_src_vm_ArrayBufferObject.cpp:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-js_src_vm_ArrayBufferObject.cpp Mon Sep 11 12:33:25 2023
@@ -0,0 +1,26 @@
+$NetBSD: patch-js_src_vm_ArrayBufferObject.cpp,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+PaX MPROTECT safety for NetBSD.
+
+https://bugzilla.mozilla.org/show_bug.cgi?id=1811913
+
+--- js/src/vm/ArrayBufferObject.cpp.orig       2021-05-20 21:29:34.000000000 +0000
++++ js/src/vm/ArrayBufferObject.cpp
+@@ -189,9 +189,17 @@ void* js::MapBufferMemory(size_t mappedS
+   MOZ_ASSERT(data);
+   memset(data, 0, mappedSize);
+ #else   // !XP_WIN && !__wasi__
++
++#ifdef PROT_MPROTECT
++  void* data =
++      MozTaggedAnonymousMmap(nullptr, mappedSize,
++                             PROT_MPROTECT(PROT_EXEC | PROT_WRITE | PROT_READ),
++                             MAP_PRIVATE | MAP_ANON, -1, 0, "wasm-reserved");
++#else
+   void* data =
+       MozTaggedAnonymousMmap(nullptr, mappedSize, PROT_NONE,
+                              MAP_PRIVATE | MAP_ANON, -1, 0, "wasm-reserved");
++#endif
+   if (data == MAP_FAILED) {
+     return nullptr;
+   }
Index: pkgsrc/www/firefox115/patches/patch-media_ffvpx_libavutil_arm_bswap.h
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-media_ffvpx_libavutil_arm_bswap.h:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-media_ffvpx_libavutil_arm_bswap.h       Mon Sep 11 12:33:25 2023
@@ -0,0 +1,22 @@
+$NetBSD: patch-media_ffvpx_libavutil_arm_bswap.h,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+Fix NetBSD aarch64 build.
+
+--- media/ffvpx/libavutil/arm/bswap.h.orig     2019-10-30 17:35:56.000000000 +0000
++++ media/ffvpx/libavutil/arm/bswap.h
+@@ -23,6 +23,8 @@
+ #include "config.h"
+ #include "libavutil/attributes.h"
+ 
++#ifndef __aarch64__
++
+ #ifdef __ARMCC_VERSION
+ 
+ #if HAVE_ARMV6
+@@ -64,4 +66,6 @@ static av_always_inline av_const uint32_
+ 
+ #endif /* __ARMCC_VERSION */
+ 
++#endif /* __aarch64__ */
++
+ #endif /* AVUTIL_ARM_BSWAP_H */
Index: pkgsrc/www/firefox115/patches/patch-media_libpng_pngpriv.h
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-media_libpng_pngpriv.h:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-media_libpng_pngpriv.h  Mon Sep 11 12:33:25 2023
@@ -0,0 +1,17 @@
+$NetBSD: patch-media_libpng_pngpriv.h,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+Fix _POSIX_SOURCE on SunOS.
+
+--- media/libpng/pngpriv.h.orig        2018-06-05 19:47:32.000000000 +0000
++++ media/libpng/pngpriv.h
+@@ -36,8 +36,10 @@
+  * still required (as of 2011-05-02.)
+  */
+ #ifndef _POSIX_SOURCE
++#if !defined(__sun) || (__STDC_VERSION__-0 < 199901L)
+ # define _POSIX_SOURCE 1 /* Just the POSIX 1003.1 and C89 APIs */
+ #endif
++#endif
+ 
+ #ifndef PNG_VERSION_INFO_ONLY
+ /* Standard library headers not required by png.h: */
Index: pkgsrc/www/firefox115/patches/patch-media_libtheora_lib_info.c
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-media_libtheora_lib_info.c:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-media_libtheora_lib_info.c      Mon Sep 11 12:33:25 2023
@@ -0,0 +1,19 @@
+$NetBSD: patch-media_libtheora_lib_info.c,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+Fix undefined behavior when calling <ctype.h> functions with illegal values.
+
+media/libtheora/lib/info.c:32:8: error: array subscript is of type 'char' [-Werror,-Wchar-subscripts]
+
+https://bugzilla.mozilla.org/show_bug.cgi?id=1642081
+
+--- media/libtheora/lib/info.c.orig    2020-05-07 18:34:12.000000000 +0000
++++ media/libtheora/lib/info.c
+@@ -29,7 +29,7 @@
+ static int oc_tagcompare(const char *_s1,const char *_s2,int _n){
+   int c;
+   for(c=0;c<_n;c++){
+-    if(toupper(_s1[c])!=toupper(_s2[c]))return !0;
++    if(toupper((unsigned char)_s1[c])!=toupper((unsigned char)_s2[c]))return !0;
+   }
+   return _s1[c]!='=';
+ }
Index: pkgsrc/www/firefox115/patches/patch-modules_fdlibm_src_math__private.h
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-modules_fdlibm_src_math__private.h:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-modules_fdlibm_src_math__private.h      Mon Sep 11 12:33:25 2023
@@ -0,0 +1,20 @@
+$NetBSD: patch-modules_fdlibm_src_math__private.h,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+* Fix PR pkg/56457, build failure on NetBSD/i386.
+  Do not use FreeBSD-specific definition.
+
+--- modules/fdlibm/src/math_private.h.orig     2022-11-03 21:19:39.000000000 +0000
++++ modules/fdlibm/src/math_private.h
+@@ -30,9 +30,9 @@
+  * Adapted from https://github.com/freebsd/freebsd-src/search?q=__double_t
+  */
+ 
+-typedef double      __double_t;
+-typedef __double_t  double_t;
+-typedef float       __float_t;
++#include <math.h>
++typedef double_t __double_t;
++typedef float_t __float_t;
+ 
+ /*
+  * The original fdlibm code used statements like:
Index: pkgsrc/www/firefox115/patches/patch-nsprpub_pr_src_pthreads_ptsynch.c
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-nsprpub_pr_src_pthreads_ptsynch.c:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-nsprpub_pr_src_pthreads_ptsynch.c       Mon Sep 11 12:33:25 2023
@@ -0,0 +1,112 @@
+$NetBSD: patch-nsprpub_pr_src_pthreads_ptsynch.c,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+firefox: Workaround broken pthread_equal() usage
+
+Switch to an internal version of pthread_equal() without sanity checks.
+
+Problems detected on NetBSD 9.99.46.
+
+https://bugzilla.mozilla.org/show_bug.cgi?id=1718838
+
+--- nsprpub/pr/src/pthreads/ptsynch.c.orig     2020-01-17 21:34:42.000000000 +0000
++++ nsprpub/pr/src/pthreads/ptsynch.c
+@@ -25,6 +25,13 @@ static pthread_condattr_t _pt_cvar_attr;
+ extern PTDebug pt_debug;  /* this is shared between several modules */
+ #endif  /* defined(DEBUG) */
+ 
++/* XXX, pthread_equal() is misused to compare non-valid thread pointers */
++static int
++pt_pthread_equal(pthread_t t1, pthread_t t2)
++{
++      return t1 == t2;
++}
++
+ #if defined(FREEBSD)
+ /*
+  * On older versions of FreeBSD, pthread_mutex_trylock returns EDEADLK.
+@@ -197,9 +204,9 @@ PR_IMPLEMENT(PRStatus) PR_Unlock(PRLock 
+     PR_ASSERT(lock != NULL);
+     PR_ASSERT(_PT_PTHREAD_MUTEX_IS_LOCKED(lock->mutex));
+     PR_ASSERT(PR_TRUE == lock->locked);
+-    PR_ASSERT(pthread_equal(lock->owner, self));
++    PR_ASSERT(pt_pthread_equal(lock->owner, self));
+ 
+-    if (!lock->locked || !pthread_equal(lock->owner, self)) {
++    if (!lock->locked || !pt_pthread_equal(lock->owner, self)) {
+         return PR_FAILURE;
+     }
+ 
+@@ -225,7 +232,7 @@ PR_IMPLEMENT(void) PR_AssertCurrentThrea
+      * to the correctness of PR_AssertCurrentThreadOwnsLock(), but
+      * this particular order makes the assertion more likely to
+      * catch errors. */
+-    PR_ASSERT(lock->locked && pthread_equal(lock->owner, pthread_self()));
++    PR_ASSERT(lock->locked && pt_pthread_equal(lock->owner, pthread_self()));
+ }
+ 
+ /**************************************************************/
+@@ -281,7 +288,7 @@ static void pt_PostNotifyToCvar(PRCondVa
+     _PT_Notified *notified = &cvar->lock->notified;
+ 
+     PR_ASSERT(PR_TRUE == cvar->lock->locked);
+-    PR_ASSERT(pthread_equal(cvar->lock->owner, pthread_self()));
++    PR_ASSERT(pt_pthread_equal(cvar->lock->owner, pthread_self()));
+     PR_ASSERT(_PT_PTHREAD_MUTEX_IS_LOCKED(cvar->lock->mutex));
+ 
+     while (1)
+@@ -369,7 +376,7 @@ PR_IMPLEMENT(PRStatus) PR_WaitCondVar(PR
+     PR_ASSERT(_PT_PTHREAD_MUTEX_IS_LOCKED(cvar->lock->mutex));
+     PR_ASSERT(PR_TRUE == cvar->lock->locked);
+     /* and it better be by us */
+-    PR_ASSERT(pthread_equal(cvar->lock->owner, pthread_self()));
++    PR_ASSERT(pt_pthread_equal(cvar->lock->owner, pthread_self()));
+ 
+     if (_PT_THREAD_INTERRUPTED(thred)) {
+         goto aborted;
+@@ -582,7 +589,7 @@ PR_IMPLEMENT(PRIntn) PR_GetMonitorEntryC
+ 
+     rv = pthread_mutex_lock(&mon->lock);
+     PR_ASSERT(0 == rv);
+-    if (pthread_equal(mon->owner, self)) {
++    if (pt_pthread_equal(mon->owner, self)) {
+         count = mon->entryCount;
+     }
+     rv = pthread_mutex_unlock(&mon->lock);
+@@ -598,7 +605,7 @@ PR_IMPLEMENT(void) PR_AssertCurrentThrea
+     rv = pthread_mutex_lock(&mon->lock);
+     PR_ASSERT(0 == rv);
+     PR_ASSERT(mon->entryCount != 0 &&
+-              pthread_equal(mon->owner, pthread_self()));
++              pt_pthread_equal(mon->owner, pthread_self()));
+     rv = pthread_mutex_unlock(&mon->lock);
+     PR_ASSERT(0 == rv);
+ #endif
+@@ -614,7 +621,7 @@ PR_IMPLEMENT(void) PR_EnterMonitor(PRMon
+     PR_ASSERT(0 == rv);
+     if (mon->entryCount != 0)
+     {
+-        if (pthread_equal(mon->owner, self)) {
++        if (pt_pthread_equal(mon->owner, self)) {
+             goto done;
+         }
+         while (mon->entryCount != 0)
+@@ -646,8 +653,8 @@ PR_IMPLEMENT(PRStatus) PR_ExitMonitor(PR
+     PR_ASSERT(0 == rv);
+     /* the entries should be > 0 and we'd better be the owner */
+     PR_ASSERT(mon->entryCount > 0);
+-    PR_ASSERT(pthread_equal(mon->owner, self));
+-    if (mon->entryCount == 0 || !pthread_equal(mon->owner, self))
++    PR_ASSERT(pt_pthread_equal(mon->owner, self));
++    if (mon->entryCount == 0 || !pt_pthread_equal(mon->owner, self))
+     {
+         rv = pthread_mutex_unlock(&mon->lock);
+         PR_ASSERT(0 == rv);
+@@ -695,7 +702,7 @@ PR_IMPLEMENT(PRStatus) PR_Wait(PRMonitor
+     /* the entries better be positive */
+     PR_ASSERT(mon->entryCount > 0);
+     /* and it better be owned by us */
+-    PR_ASSERT(pthread_equal(mon->owner, pthread_self()));
++    PR_ASSERT(pt_pthread_equal(mon->owner, pthread_self()));
+ 
+     /* tuck these away 'till later */
+     saved_entries = mon->entryCount;
Index: pkgsrc/www/firefox115/patches/patch-security_nss_lib_freebl_mpi_mpi.c
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-security_nss_lib_freebl_mpi_mpi.c:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-security_nss_lib_freebl_mpi_mpi.c       Mon Sep 11 12:33:25 2023
@@ -0,0 +1,35 @@
+$NetBSD: patch-security_nss_lib_freebl_mpi_mpi.c,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+Fix undefined behavior when calling <ctype.h> functions with illegal values.
+
+security/nss/lib/freebl/mpi/mpi.c:4565:15: error: array subscript is of type 'char' [-Werror,-Wchar-subscripts]
+        xch = toupper(ch);
+
+security/nss/lib/freebl/mpi/mpi.c:4611:14: error: array subscript is of type 'char' [-Werror,-Wchar-subscripts]
+        ch = tolower(ch);
+
+https://bugzilla.mozilla.org/show_bug.cgi?id=1642081
+
+--- security/nss/lib/freebl/mpi/mpi.c.orig     2020-05-07 18:35:01.000000000 +0000
++++ security/nss/lib/freebl/mpi/mpi.c
+@@ -4560,9 +4560,9 @@ s_mp_tovalue(char ch, int r)
+     int val, xch;
+ 
+     if (r > 36)
+-        xch = ch;
++        xch = (unsigned char) ch;
+     else
+-        xch = toupper(ch);
++        xch = toupper((unsigned char) ch);
+ 
+     if (isdigit(xch))
+         val = xch - '0';
+@@ -4608,7 +4608,7 @@ s_mp_todigit(mp_digit val, int r, int lo
+     ch = s_dmap_1[val];
+ 
+     if (r <= 36 && low)
+-        ch = tolower(ch);
++        ch = tolower((unsigned char) ch);
+ 
+     return ch;
+ 
Index: pkgsrc/www/firefox115/patches/patch-third__party_js_cfworker_build.sh
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-third__party_js_cfworker_build.sh:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-third__party_js_cfworker_build.sh       Mon Sep 11 12:33:25 2023
@@ -0,0 +1,20 @@
+$NetBSD: patch-third__party_js_cfworker_build.sh,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+shell portability
+
+--- third_party/js/cfworker/build.sh.orig      2022-04-28 22:03:47.000000000 +0000
++++ third_party/js/cfworker/build.sh
+@@ -4,9 +4,10 @@ set -euo pipefail
+ # Path to mach relative to /third_party/js/cfworker
+ MACH=$(realpath "../../../mach")
+ 
+-if [[ $(uname -a) == *MSYS* ]]; then
+-  MACH="python ${MACH}"
+-fi
++# uname -a is not a good idea here. Someone could have MSYS in the hostname.
++#if uname -a | grep MSYS > /dev/null; then
++#  MACH="python ${MACH}"
++#fi
+ 
+ NODE="${MACH} node"
+ NPM="${MACH} npm"
Index: pkgsrc/www/firefox115/patches/patch-third__party_libwebrtc_modules_desktop__capture_linux_wayland_egl__dmabuf.cc
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-third__party_libwebrtc_modules_desktop__capture_linux_wayland_egl__dmabuf.cc:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-third__party_libwebrtc_modules_desktop__capture_linux_wayland_egl__dmabuf.cc    Mon Sep 11 12:33:25 2023
@@ -0,0 +1,21 @@
+$NetBSD: patch-third__party_libwebrtc_modules_desktop__capture_linux_wayland_egl__dmabuf.cc,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+--- third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc.orig     2023-03-30 21:16:09.000000000 +0000
++++ third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc
+@@ -10,12 +10,16 @@
+ 
+ #include "modules/desktop_capture/linux/wayland/egl_dmabuf.h"
+ 
++#if defined(__linux__)
+ #include <asm/ioctl.h>
++#endif
+ #include <dlfcn.h>
+ #include <fcntl.h>
+ #include <gdk/gdk.h>
+ #include <libdrm/drm_fourcc.h>
++#if defined(__linux__)
+ #include <linux/types.h>
++#endif
+ #include <spa/param/video/format-utils.h>
+ #include <unistd.h>
+ #include <xf86drm.h>
Index: pkgsrc/www/firefox115/patches/patch-third__party_libwebrtc_modules_video__capture_linux_device__info__v4l2.cc
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-third__party_libwebrtc_modules_video__capture_linux_device__info__v4l2.cc:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-third__party_libwebrtc_modules_video__capture_linux_device__info__v4l2.cc       Mon Sep 11 12:33:25 2023
@@ -0,0 +1,67 @@
+$NetBSD: patch-third__party_libwebrtc_modules_video__capture_linux_device__info__v4l2.cc,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+* Fix build under NetBSD 9 and older.
+  The older NetBSD's sys/videoio.h does not have v4l2_capability.device_caps.
+
+--- third_party/libwebrtc/modules/video_capture/linux/device_info_v4l2.cc.orig 2022-10-19 18:00:20.000000000 +0000
++++ third_party/libwebrtc/modules/video_capture/linux/device_info_v4l2.cc
+@@ -193,11 +193,13 @@ uint32_t DeviceInfoV4l2::NumberOfDevices
+   for (int n = 0; n < 64; n++) {
+     snprintf(device, sizeof(device), "/dev/video%d", n);
+     if ((fd = open(device, O_RDONLY)) != -1) {
++#if defined(VIDIOC_QUERYCAP)
+       // query device capabilities and make sure this is a video capture device
+       if (ioctl(fd, VIDIOC_QUERYCAP, &cap) < 0 || !IsVideoCaptureDevice(&cap)) {
+         close(fd);
+         continue;
+       }
++#endif
+ 
+       close(fd);
+       count++;
+@@ -225,11 +227,13 @@ int32_t DeviceInfoV4l2::GetDeviceName(ui
+   for (device_index = 0; device_index < 64; device_index++) {
+     sprintf(device, "/dev/video%d", device_index);
+     if ((fd = open(device, O_RDONLY)) != -1) {
++#if defined(VIDIOC_QUERYCAP)
+       // query device capabilities and make sure this is a video capture device
+       if (ioctl(fd, VIDIOC_QUERYCAP, &cap) < 0 || !IsVideoCaptureDevice(&cap)) {
+         close(fd);
+         continue;
+       }
++#endif
+       if (count == deviceNumber) {
+         // Found the device
+         found = true;
+@@ -307,6 +311,7 @@ int32_t DeviceInfoV4l2::CreateCapability
+     if (fd == -1)
+       continue;
+ 
++#if defined(VIDIOC_QUERYCAP)
+     // query device capabilities
+     struct v4l2_capability cap;
+     if (ioctl(fd, VIDIOC_QUERYCAP, &cap) == 0) {
+@@ -331,6 +336,7 @@ int32_t DeviceInfoV4l2::CreateCapability
+         }
+       }
+     }
++#endif
+     close(fd);  // close since this is not the matching device
+   }
+ 
+@@ -376,11 +382,15 @@ bool DeviceInfoV4l2::IsDeviceNameMatches
+ 
+ bool DeviceInfoV4l2::IsVideoCaptureDevice(struct v4l2_capability* cap)
+ {
++#if defined(V4L2_CAP_DEVICE_CAPS)
+   if (cap->capabilities & V4L2_CAP_DEVICE_CAPS) {
+     return cap->device_caps & V4L2_CAP_VIDEO_CAPTURE;
+   } else {
+     return cap->capabilities & V4L2_CAP_VIDEO_CAPTURE;
+   }
++#else
++    return cap->capabilities & V4L2_CAP_VIDEO_CAPTURE;
++#endif
+ }
+ 
+ int32_t DeviceInfoV4l2::FillCapabilities(int fd) {
Index: pkgsrc/www/firefox115/patches/patch-third__party_libwebrtc_modules_video__capture_linux_video__capture__v4l2.cc
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-third__party_libwebrtc_modules_video__capture_linux_video__capture__v4l2.cc:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-third__party_libwebrtc_modules_video__capture_linux_video__capture__v4l2.cc     Mon Sep 11 12:33:25 2023
@@ -0,0 +1,23 @@
+$NetBSD: patch-third__party_libwebrtc_modules_video__capture_linux_video__capture__v4l2.cc,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+* Fix build under NetBSD 9 and older.
+  The older NetBSD's sys/videoio.h does not have v4l2_capability.device_caps.
+
+--- third_party/libwebrtc/modules/video_capture/linux/video_capture_v4l2.cc.orig       2022-10-06 21:19:29.000000000 +0000
++++ third_party/libwebrtc/modules/video_capture/linux/video_capture_v4l2.cc
+@@ -77,6 +77,7 @@ int32_t VideoCaptureModuleV4L2::Init(con
+     if ((fd = open(device, O_RDONLY)) != -1) {
+       // query device capabilities
+       struct v4l2_capability cap;
++#if defined(VIDIOC_QUERYCAP)
+       if (ioctl(fd, VIDIOC_QUERYCAP, &cap) == 0) {
+         if (cap.bus_info[0] != 0) {
+           if (strncmp((const char*)cap.bus_info,
+@@ -89,6 +90,7 @@ int32_t VideoCaptureModuleV4L2::Init(con
+           }
+         }
+       }
++#endif
+       close(fd);  // close since this is not the matching device
+     }
+   }
Index: pkgsrc/www/firefox115/patches/patch-third__party_libwebrtc_system__wrappers_source_cpu__features__linux.cc
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-third__party_libwebrtc_system__wrappers_source_cpu__features__linux.cc:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-third__party_libwebrtc_system__wrappers_source_cpu__features__linux.cc  Mon Sep 11 12:33:25 2023
@@ -0,0 +1,25 @@
+$NetBSD: patch-third__party_libwebrtc_system__wrappers_source_cpu__features__linux.cc,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+* Fix build under NetBSD at least.
+
+--- third_party/libwebrtc/system_wrappers/source/cpu_features_linux.cc.orig    2022-01-13 19:26:15.000000000 +0000
++++ third_party/libwebrtc/system_wrappers/source/cpu_features_linux.cc
+@@ -8,7 +8,9 @@
+  *  be found in the AUTHORS file in the root of the source tree.
+  */
+ 
++#if !defined(__NetBSD__)
+ #include <features.h>
++#endif
+ #include <stdlib.h>
+ #include <string.h>
+ 
+@@ -30,7 +32,7 @@
+ #include "rtc_base/system/arch.h"
+ #include "system_wrappers/include/cpu_features_wrapper.h"
+ 
+-#if defined(WEBRTC_ARCH_ARM_FAMILY)
++#if defined(WEBRTC_ARCH_ARM_FAMILY) && defined(__linux__)
+ #include <asm/hwcap.h>
+ 
+ namespace webrtc {
Index: pkgsrc/www/firefox115/patches/patch-third__party_sqlite3_src_moz.build
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-third__party_sqlite3_src_moz.build:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-third__party_sqlite3_src_moz.build      Mon Sep 11 12:33:25 2023
@@ -0,0 +1,15 @@
+$NetBSD: patch-third__party_sqlite3_src_moz.build,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+* Fix segfault under NetBSD/i386 9 and pkgsrc/lang/gcc8-8.5.0
+  For NetBSD/i386 9, @SQLITE3OPTFLAG@ will be replaced with "'-O0',".
+
+--- third_party/sqlite3/src/moz.build.orig     2023-06-22 21:19:22.000000000 +0000
++++ third_party/sqlite3/src/moz.build
+@@ -108,6 +108,7 @@ if CONFIG['CC_TYPE'] in ('clang', 'gcc')
+     CFLAGS += [
+         '-Wno-sign-compare',
+         '-Wno-type-limits',
++        @SQLITE3OPTFLAG@
+     ]
+ 
+ # Set a default journal size limit. Note an hot journal can grow over this
Index: pkgsrc/www/firefox115/patches/patch-third__party_wasm2c_src_prebuilt_wasm2c__source__includes.cc
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-third__party_wasm2c_src_prebuilt_wasm2c__source__includes.cc:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-third__party_wasm2c_src_prebuilt_wasm2c__source__includes.cc    Mon Sep 11 12:33:25 2023
@@ -0,0 +1,13 @@
+$NetBSD: patch-third__party_wasm2c_src_prebuilt_wasm2c__source__includes.cc,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+--- third_party/wasm2c/src/prebuilt/wasm2c_source_includes.cc.orig     2023-05-25 21:19:41.000000000 +0000
++++ third_party/wasm2c/src/prebuilt/wasm2c_source_includes.cc
+@@ -20,7 +20,7 @@ R"w2c_template(#include <malloc.h>
+ )w2c_template"
+ R"w2c_template(#define alloca _alloca
+ )w2c_template"
+-R"w2c_template(#elif defined(__FreeBSD__) || defined(__OpenBSD__)
++R"w2c_template(#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
+ )w2c_template"
+ R"w2c_template(#include <stdlib.h>
+ )w2c_template"
Index: pkgsrc/www/firefox115/patches/patch-third__party_wasm2c_wasm2c_wasm-rt-impl.c
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-third__party_wasm2c_wasm2c_wasm-rt-impl.c:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-third__party_wasm2c_wasm2c_wasm-rt-impl.c       Mon Sep 11 12:33:25 2023
@@ -0,0 +1,18 @@
+$NetBSD: patch-third__party_wasm2c_wasm2c_wasm-rt-impl.c,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+* I believe that this is insufficient.
+
+--- third_party/wasm2c/wasm2c/wasm-rt-impl.c.orig      2023-05-25 21:19:41.000000000 +0000
++++ third_party/wasm2c/wasm2c/wasm-rt-impl.c
+@@ -144,6 +144,11 @@ static void os_cleanup_signal_handler(vo
+ #else
+ static void* os_mmap(size_t size) {
+   int map_prot = PROT_NONE;
++#ifdef PROT_MPROTECT
++    map_prot |= PROT_MPROTECT(PROT_READ);
++    map_prot |= PROT_MPROTECT(PROT_WRITE);
++    map_prot |= PROT_MPROTECT(PROT_EXEC);
++#endif
+   int map_flags = MAP_ANONYMOUS | MAP_PRIVATE;
+   uint8_t* addr = mmap(NULL, size, map_prot, map_flags, -1, 0);
+   if (addr == MAP_FAILED)
Index: pkgsrc/www/firefox115/patches/patch-toolkit_components_terminator_nsTerminator.cpp
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-toolkit_components_terminator_nsTerminator.cpp:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-toolkit_components_terminator_nsTerminator.cpp  Mon Sep 11 12:33:25 2023
@@ -0,0 +1,27 @@
+$NetBSD: patch-toolkit_components_terminator_nsTerminator.cpp,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+* Fix segfault on exit under NetBSD
+
+--- toolkit/components/terminator/nsTerminator.cpp.orig        2022-06-16 21:35:58.000000000 +0000
++++ toolkit/components/terminator/nsTerminator.cpp
+@@ -34,7 +34,7 @@
+ #if defined(XP_WIN)
+ #  include <windows.h>
+ #else
+-#  include <unistd.h>
++#  include <time.h>
+ #endif
+ 
+ #include "mozilla/AppShutdown.h"
+@@ -184,7 +184,10 @@ void RunWatchdog(void* arg) {
+ #if defined(XP_WIN)
+     Sleep(HEARTBEAT_INTERVAL_MS /* ms */);
+ #else
+-    usleep(HEARTBEAT_INTERVAL_MS * 1000 /* usec */);
++    struct timespec tickd;
++    tickd.tv_sec = 0;
++    tickd.tv_nsec = HEARTBEAT_INTERVAL_MS * 1000 * 1000;
++    nanosleep(&tickd, NULL);
+ #endif
+ 
+     if (gHeartbeat++ < timeToLive) {
Index: pkgsrc/www/firefox115/patches/patch-toolkit_modules_subprocess_subprocess__shared__unix.js
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-toolkit_modules_subprocess_subprocess__shared__unix.js:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-toolkit_modules_subprocess_subprocess__shared__unix.js  Mon Sep 11 12:33:25 2023
@@ -0,0 +1,26 @@
+$NetBSD: patch-toolkit_modules_subprocess_subprocess__shared__unix.js,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+Fix broken native messaging on NetBSD and possibly other BSDs too:
+https://bugzilla.mozilla.org/show_bug.cgi?id=1543602
+
+Please remove this patch when the upstream issue is resolved.
+
+--- toolkit/modules/subprocess/subprocess_shared_unix.js.orig  2022-05-20 10:44:23.277253777 +0000
++++ toolkit/modules/subprocess/subprocess_shared_unix.js
+@@ -13,7 +13,15 @@
+ 
+ var LIBC = OS.Constants.libc;
+ 
+-const LIBC_CHOICES = ["libc.so", "libSystem.B.dylib", "a.out"];
++/* libc.so isn't meant to be dlopen'ed. On Linux it's usually an ld
++ * script so one cannot dlopen it. On NetBSD (and possibly other
++ * BSDs too) dlopen'ing libc.so will succeed, but some global symbols,
++ * especially environ(7), are pointing to unused memory regions
++ * because they are meant to be overridden by the main executable.
++ * So the most portable way to access libc symbols is to do it through
++ * the NULL handle, i.e. the one which NSPR calls "a.out".
++ */
++const LIBC_CHOICES = ["a.out"];
+ 
+ const unix = {
+   pid_t: ctypes.int32_t,
Index: pkgsrc/www/firefox115/patches/patch-toolkit_moz.configure
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-toolkit_moz.configure:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-toolkit_moz.configure   Mon Sep 11 12:33:25 2023
@@ -0,0 +1,14 @@
+$NetBSD: patch-toolkit_moz.configure,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+* Enable ALSA for NetBSD too.
+
+--- toolkit/moz.configure.orig 2023-03-02 21:15:57.000000000 +0000
++++ toolkit/moz.configure
+@@ -243,6 +243,7 @@ def imply_alsa(values, target):
+         any("alsa" in value for value in values)
+         and target.kernel != "Linux"
+         and target.os != "FreeBSD"
++        and target.os != "NetBSD"
+     ):
+         die("Cannot enable ALSA on %s", target.os)
+     return any("alsa" in value for value in values) or None
Index: pkgsrc/www/firefox115/patches/patch-toolkit_mozapps_installer_packager.mk
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-toolkit_mozapps_installer_packager.mk:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-toolkit_mozapps_installer_packager.mk   Mon Sep 11 12:33:25 2023
@@ -0,0 +1,15 @@
+$NetBSD: patch-toolkit_mozapps_installer_packager.mk,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+* Symbolic link to lib/firefox/firefox causes 'Couldn't load XPCOM.' error.
+
+--- toolkit/mozapps/installer/packager.mk.orig 2020-01-29 07:05:13.000000000 +0000
++++ toolkit/mozapps/installer/packager.mk
+@@ -145,7 +145,7 @@ 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)
++      #ln -s $(installdir)/$(MOZ_APP_NAME) $(DESTDIR)$(bindir)
+ 
+ upload:
+       $(PYTHON3) -u $(MOZILLA_DIR)/build/upload.py --base-path $(DIST) $(UPLOAD_FILES)
Index: pkgsrc/www/firefox115/patches/patch-toolkit_xre_glxtest.cpp
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-toolkit_xre_glxtest.cpp:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-toolkit_xre_glxtest.cpp Mon Sep 11 12:33:25 2023
@@ -0,0 +1,22 @@
+$NetBSD: patch-toolkit_xre_glxtest.cpp,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+* Do not test Linux-specific entry for non-Linux.
+
+--- toolkit/xre/glxtest/glxtest.cpp.orig       2023-05-25 21:19:41.000000000 +0000
++++ toolkit/xre/glxtest/glxtest.cpp
+@@ -195,11 +195,15 @@ extern "C" {
+ static void get_pci_status() {
+   log("GLX_TEST: get_pci_status start\n");
+ 
++#if defined(__linux__)
+   if (access("/sys/bus/pci/", F_OK) != 0 &&
+       access("/sys/bus/pci_express/", F_OK) != 0) {
+     record_warning("cannot access /sys/bus/pci");
+     return;
+   }
++#else
++  return;
++#endif
+ 
+   void* libpci = dlopen("libpci.so.3", RTLD_LAZY);
+   if (!libpci) {
Index: pkgsrc/www/firefox115/patches/patch-widget_gtk_DMABufSurface.cpp
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-widget_gtk_DMABufSurface.cpp:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-widget_gtk_DMABufSurface.cpp    Mon Sep 11 12:33:25 2023
@@ -0,0 +1,42 @@
+$NetBSD: patch-widget_gtk_DMABufSurface.cpp,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+No eventfd on NetBSD 9 and older, fix build
+
+--- widget/gtk/DMABufSurface.cpp.orig  2023-06-22 21:19:23.000000000 +0000
++++ widget/gtk/DMABufSurface.cpp
+@@ -6,6 +6,9 @@
+ 
+ #include "DMABufSurface.h"
+ 
++#if defined(__NetBSD__)
++#include <sys/param.h>
++#endif
+ #include <fcntl.h>
+ #include <getopt.h>
+ #include <signal.h>
+@@ -18,7 +21,9 @@
+ #include <sys/time.h>
+ #include <dlfcn.h>
+ #include <sys/mman.h>
++#if !(defined(__NetBSD__) && (__NetBSD_Version__ - 0 < 1000000000))
+ #include <sys/eventfd.h>
++#endif
+ #include <poll.h>
+ #include <sys/ioctl.h>
+ 
+@@ -147,6 +152,7 @@ void DMABufSurface::GlobalRefAdd() {
+ }
+ 
+ void DMABufSurface::GlobalRefCountCreate() {
++#if !(defined(__NetBSD__) && (__NetBSD_Version__ - 0 < 1000000000))
+   LOGDMABUFREF(("DMABufSurface::GlobalRefCountCreate UID %d", mUID));
+   MOZ_DIAGNOSTIC_ASSERT(!mGlobalRefCountFd);
+   // Create global ref count initialized to 0,
+@@ -159,6 +165,7 @@ void DMABufSurface::GlobalRefCountCreate
+     mGlobalRefCountFd = 0;
+     return;
+   }
++#endif
+ }
+ 
+ void DMABufSurface::GlobalRefCountImport(int aFd) {
Index: pkgsrc/www/firefox115/patches/patch-xpcom_base_nscore.h
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-xpcom_base_nscore.h:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-xpcom_base_nscore.h     Mon Sep 11 12:33:25 2023
@@ -0,0 +1,15 @@
+$NetBSD: patch-xpcom_base_nscore.h,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+* Support llvm/clang
+
+--- xpcom/base/nscore.h.orig   2019-03-07 16:53:44.000000000 +0000
++++ xpcom/base/nscore.h
+@@ -76,7 +76,7 @@
+  *           NS_HIDDEN_(int) NS_FASTCALL func2(char *foo);
+  */
+ 
+-#if defined(__i386__) && defined(__GNUC__)
++#if defined(__i386__) && defined(__GNUC__) && !(defined(__clang__) && __clang_major__ == 3 && __clang_minor__ == 4 && __clang_patchlevel__ == 0)
+ #  define NS_FASTCALL __attribute__((regparm(3), stdcall))
+ #  define NS_CONSTRUCTOR_FASTCALL __attribute__((regparm(3), stdcall))
+ #elif defined(XP_WIN) && !defined(_WIN64)
Index: pkgsrc/www/firefox115/patches/patch-xpcom_reflect_xptcall_md_unix_moz.build
diff -u /dev/null pkgsrc/www/firefox115/patches/patch-xpcom_reflect_xptcall_md_unix_moz.build:1.1
--- /dev/null   Mon Sep 11 12:33:25 2023
+++ pkgsrc/www/firefox115/patches/patch-xpcom_reflect_xptcall_md_unix_moz.build Mon Sep 11 12:33:25 2023
@@ -0,0 +1,17 @@
+$NetBSD: patch-xpcom_reflect_xptcall_md_unix_moz.build,v 1.1 2023/09/11 12:33:25 ryoon Exp $
+
+Make NetBSD/sparc64 use the same xptcall bindings as all other sparc64 ports
+
+https://bugzilla.mozilla.org/show_bug.cgi?id=1505360
+
+--- xpcom/reflect/xptcall/md/unix/moz.build.orig       2020-12-03 23:14:25.000000000 +0000
++++ xpcom/reflect/xptcall/md/unix/moz.build
+@@ -225,7 +225,7 @@ if CONFIG["OS_ARCH"] == "OpenBSD" and CO
+     ]
+ 
+ if (
+-    CONFIG["OS_ARCH"] in ("OpenBSD", "FreeBSD", "Linux", "SunOS")
++    CONFIG["OS_ARCH"] in ("OpenBSD", "FreeBSD", "NetBSD", "Linux", "SunOS")
+     and CONFIG["CPU_ARCH"] == "sparc64"
+ ):
+     SOURCES += [



Home | Main Index | Thread Index | Old Index