pkgsrc-WIP-changes archive

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

wip/tor-browser: import tor-browser-11.0.1



Module Name:	pkgsrc-wip
Committed By:	Thomas Klausner <tk%giga.or.at@localhost>
Pushed By:	wiz
Date:		Sat Nov 27 14:31:20 2021 +0100
Changeset:	5dd1554d046b8cec879aec6d08666453822f1730

Added Files:
	tor-browser/DESCR
	tor-browser/MESSAGE
	tor-browser/Makefile
	tor-browser/PLIST
	tor-browser/PLIST.tor-launcher
	tor-browser/distinfo
	tor-browser/files/desktop.in
	tor-browser/files/node-wrapper.sh
	tor-browser/files/tor-browser.sh
	tor-browser/options.mk
	tor-browser/patches/patch-.mozconfig
	tor-browser/patches/patch-aa
	tor-browser/patches/patch-browser_app_profile_000-tor-browser.js
	tor-browser/patches/patch-browser_app_profile_firefox.js
	tor-browser/patches/patch-build_moz.configure_rust.configure
	tor-browser/patches/patch-config_gcc-stl-wrapper.template.h
	tor-browser/patches/patch-config_makefiles_rust.mk
	tor-browser/patches/patch-dom_base_nsAttrName.h
	tor-browser/patches/patch-gfx_angle_checkout_src_common_third__party_smhasher_src_PMurHash.cpp
	tor-browser/patches/patch-gfx_angle_checkout_src_compiler_translator_InfoSink.h
	tor-browser/patches/patch-gfx_cairo_cairo_src_cairo-type1-subset.c
	tor-browser/patches/patch-gfx_skia_skia_src_core_SkCpu.cpp
	tor-browser/patches/patch-gfx_thebes_gfxPlatform.cpp
	tor-browser/patches/patch-gfx_wr_swgl_build.rs
	tor-browser/patches/patch-ipc_chromium_src_base_message__pump__libevent.cc
	tor-browser/patches/patch-ipc_chromium_src_base_platform__thread__posix.cc
	tor-browser/patches/patch-ipc_glue_GeckoChildProcessHost.cpp
	tor-browser/patches/patch-js_src_jit_ProcessExecutableMemory.cpp
	tor-browser/patches/patch-js_src_jit_arm64_vixl_MozCpu-vixl.cpp
	tor-browser/patches/patch-js_src_jsfriendapi.h
	tor-browser/patches/patch-js_src_util_NativeStack.cpp
	tor-browser/patches/patch-js_src_vm_ArrayBufferObject.cpp
	tor-browser/patches/patch-media_ffvpx_libavutil_arm_bswap.h
	tor-browser/patches/patch-media_libcubeb_src_cubeb__alsa.c
	tor-browser/patches/patch-media_libcubeb_src_moz.build
	tor-browser/patches/patch-media_libpng_pngpriv.h
	tor-browser/patches/patch-media_libtheora_lib_info.c
	tor-browser/patches/patch-media_webrtc_trunk_webrtc_modules_video__capture_linux_device__info__linux.cc
	tor-browser/patches/patch-modules_fdlibm_src_math__private.h
	tor-browser/patches/patch-mozglue_misc_Uptime.cpp
	tor-browser/patches/patch-nsprpub_pr_src_pthreads_ptsynch.c
	tor-browser/patches/patch-security_nss_lib_freebl_mpi_mpi.c
	tor-browser/patches/patch-toolkit_components_terminator_nsTerminator.cpp
	tor-browser/patches/patch-toolkit_modules_subprocess_subprocess__shared__unix.js
	tor-browser/patches/patch-toolkit_moz.configure
	tor-browser/patches/patch-toolkit_mozapps_installer_packager.mk
	tor-browser/patches/patch-widget_gtk_DMABufSurface.cpp
	tor-browser/patches/patch-xpcom_base_nscore.h
	tor-browser/patches/patch-xpcom_io_TorFileUtils.cpp
	tor-browser/patches/patch-xpcom_reflect_xptcall_md_unix_moz.build

Log Message:
wip/tor-browser: import tor-browser-11.0.1

Update candidate.
Packages fine, but does not work.

The Tor software protects you by bouncing your communications around
a distributed network of relays run by volunteers all around the
world: it prevents somebody watching your Internet connection from
learning what sites you visit, it prevents the sites you visit from
learning your physical location, and it lets you access sites which
are blocked.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=5dd1554d046b8cec879aec6d08666453822f1730

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

diffstat:
 tor-browser/DESCR                                  |   8 +
 tor-browser/MESSAGE                                |   6 +
 tor-browser/Makefile                               | 187 ++++++++++++++++++++
 tor-browser/PLIST                                  |  75 ++++++++
 tor-browser/PLIST.tor-launcher                     |  88 ++++++++++
 tor-browser/distinfo                               |  51 ++++++
 tor-browser/files/desktop.in                       | 191 +++++++++++++++++++++
 tor-browser/files/node-wrapper.sh                  |   9 +
 tor-browser/files/tor-browser.sh                   |   5 +
 tor-browser/options.mk                             |  71 ++++++++
 tor-browser/patches/patch-.mozconfig               |  17 ++
 tor-browser/patches/patch-aa                       |  26 +++
 .../patch-browser_app_profile_000-tor-browser.js   |  37 ++++
 .../patches/patch-browser_app_profile_firefox.js   |  17 ++
 .../patch-build_moz.configure_rust.configure       |  15 ++
 .../patch-config_gcc-stl-wrapper.template.h        |  31 ++++
 tor-browser/patches/patch-config_makefiles_rust.mk |  17 ++
 tor-browser/patches/patch-dom_base_nsAttrName.h    |  18 ++
 ...c_common_third__party_smhasher_src_PMurHash.cpp |  17 ++
 ...gle_checkout_src_compiler_translator_InfoSink.h |  16 ++
 .../patch-gfx_cairo_cairo_src_cairo-type1-subset.c |  19 ++
 .../patches/patch-gfx_skia_skia_src_core_SkCpu.cpp |  15 ++
 .../patches/patch-gfx_thebes_gfxPlatform.cpp       |  28 +++
 tor-browser/patches/patch-gfx_wr_swgl_build.rs     |  27 +++
 ...pc_chromium_src_base_message__pump__libevent.cc |  22 +++
 ...pc_chromium_src_base_platform__thread__posix.cc |  18 ++
 .../patch-ipc_glue_GeckoChildProcessHost.cpp       |  21 +++
 .../patch-js_src_jit_ProcessExecutableMemory.cpp   |  38 ++++
 .../patch-js_src_jit_arm64_vixl_MozCpu-vixl.cpp    |  38 ++++
 tor-browser/patches/patch-js_src_jsfriendapi.h     |  14 ++
 .../patches/patch-js_src_util_NativeStack.cpp      |  32 ++++
 .../patches/patch-js_src_vm_ArrayBufferObject.cpp  |  24 +++
 .../patch-media_ffvpx_libavutil_arm_bswap.h        |  22 +++
 .../patches/patch-media_libcubeb_src_cubeb__alsa.c |  12 ++
 .../patches/patch-media_libcubeb_src_moz.build     |  19 ++
 tor-browser/patches/patch-media_libpng_pngpriv.h   |  17 ++
 .../patches/patch-media_libtheora_lib_info.c       |  19 ++
 ...les_video__capture_linux_device__info__linux.cc |  63 +++++++
 .../patch-modules_fdlibm_src_math__private.h       |  18 ++
 tor-browser/patches/patch-mozglue_misc_Uptime.cpp  |  15 ++
 .../patch-nsprpub_pr_src_pthreads_ptsynch.c        | 110 ++++++++++++
 .../patch-security_nss_lib_freebl_mpi_mpi.c        |  35 ++++
 ...-toolkit_components_terminator_nsTerminator.cpp |  27 +++
 ..._modules_subprocess_subprocess__shared__unix.js |  26 +++
 tor-browser/patches/patch-toolkit_moz.configure    |  33 ++++
 .../patch-toolkit_mozapps_installer_packager.mk    |  15 ++
 .../patches/patch-widget_gtk_DMABufSurface.cpp     |  32 ++++
 tor-browser/patches/patch-xpcom_base_nscore.h      |  15 ++
 .../patches/patch-xpcom_io_TorFileUtils.cpp        |  25 +++
 .../patch-xpcom_reflect_xptcall_md_unix_moz.build  |  15 ++
 50 files changed, 1716 insertions(+)

diffs:
diff --git a/tor-browser/DESCR b/tor-browser/DESCR
new file mode 100644
index 0000000000..2321787fd2
--- /dev/null
+++ b/tor-browser/DESCR
@@ -0,0 +1,8 @@
+What is the Tor Browser?
+
+The Tor software protects you by bouncing your communications around
+a distributed network of relays run by volunteers all around the
+world: it prevents somebody watching your Internet connection from
+learning what sites you visit, it prevents the sites you visit from
+learning your physical location, and it lets you access sites which
+are blocked.
diff --git a/tor-browser/MESSAGE b/tor-browser/MESSAGE
new file mode 100644
index 0000000000..d7d00806b2
--- /dev/null
+++ b/tor-browser/MESSAGE
@@ -0,0 +1,6 @@
+===========================================================================
+$NetBSD: MESSAGE,v 1.4 2020/04/30 07:52:39 wiz Exp $
+
+Be sure to start the Tor daemon before you start Tor Browser!
+
+===========================================================================
diff --git a/tor-browser/Makefile b/tor-browser/Makefile
new file mode 100644
index 0000000000..108403f032
--- /dev/null
+++ b/tor-browser/Makefile
@@ -0,0 +1,187 @@
+# $NetBSD: Makefile,v 1.99 2021/11/01 21:41:59 wiz Exp $
+FIREFOX_MAINTAINER=yes
+#
+# How to update this package:
+#
+# replace all patches with the one from the correspoding www/firefox${ESR_RELEASE}
+# compare e.g. the output of
+# diff -r -I NetBSD . ../../www/firefox91
+# BUT keep:
+# patch-.mozconfig (if still necessary)
+# patch-browser_app_profile_000-tor-browser.js
+# patch-toolkit_moz.configure (second chunk)
+# patch-xpcom_io_TorFileUtils.cpp
+# make the patches apply
+#
+# when packaged up, read MESSAGE and test by visiting https://check.torproject.org
+# and https://panopticlick.eff.org
+
+DISTNAME=	src-firefox-tor-browser-91.3.0esr-11.0-1-build4
+PKGNAME=	tor-browser-11.0.1
+CATEGORIES=	security www
+MASTER_SITES=	https://dist.torproject.org/torbrowser/${PKGVERSION_NOREV}/
+EXTRACT_SUFX=	.tar.xz
+DISTFILES=	${DISTNAME}${EXTRACT_SUFX}
+DISTFILES+=	tor-browser-linux64-${PKGVERSION_NOREV}_en-US${EXTRACT_SUFX}
+#DISTFILES+=	src-tor-launcher-0.2.32${EXTRACT_SUFX}
+DISTFILES+=	nodejs-output-11.0.1.tgz
+SITES.nodejs-output-11.0.1.tgz=	${MASTER_SITE_LOCAL}
+
+MAINTAINER=	wiz%NetBSD.org@localhost
+HOMEPAGE=	https://www.torproject.org/projects/torbrowser.html.en
+COMMENT=	Tor Browser based on Firefox
+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).
+#
+# -----------------------------------------------------------------------
+UNLIMIT_RESOURCES+=	datasize virtualsize
+
+WRKSRC=		${WRKDIR}/${DISTNAME:S/src-//}
+
+MOZILLA_DIR=	# empty
+
+DEPENDS+=	tor-[0-9]*:../../net/tor
+DEPENDS+=	tor-browser-https-everywhere>=2020.5.20:../../security/tor-browser-https-everywhere
+DEPENDS+=	tor-browser-noscript>=11.0.32:../../security/tor-browser-noscript
+
+.include "../../mk/bsd.prefs.mk"
+
+CONFIGURE_ARGS+=	--enable-tor-browser-data-outside-app-dir
+CONFIGURE_ARGS+=	--with-tor-browser-version=${PKGVERSION_NOREV}
+CFLAGS+=		-DTOR_BROWSER_DATA_IN_HOME_DIR=1
+CFLAGS+=		-DTOR_BROWSER_DATA_OUTSIDE_APP_DIR=1
+
+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
+
+ALL_ENV+=		MOZ_APP_NAME=${PKGBASE}
+
+# 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+=		fonts
+SUBST_STAGE.fonts=	pre-configure
+SUBST_FILES.fonts+=	tor-browser_en-US/Browser/TorBrowser/Data/fontconfig/fonts.conf
+SUBST_SED.fonts+=	-e 's,<dir>fonts</dir>,<dir>${PREFIX}/lib/tor-browser/browser/fonts</dir>,'
+SUBST_MESSAGE.fonts=	Fixing path to bundled fonts directory.
+
+.include "../../www/firefox91/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}
+MOZILLA_ICON=	${WRKSRC}/browser/branding/official/default48.png
+MOZILLA_NAME=	TorBrowser
+
+post-extract:
+	mv ${WRKDIR}/tor-browser_en-US ${WRKSRC}
+#	mv ${WRKDIR}/tor-launcher* ${WRKSRC}/browser/extensions/tor-launcher
+
+pre-configure:
+	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
+
+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
+	${SED} -e 's|@PREFIX@|${PREFIX}|g'				\
+	  < ${FILESDIR}/tor-browser.sh					\
+	  > ${WRKDIR}/tor-browser.sh
+
+INSTALLATION_DIRS+=	share/applications
+INSTALLATION_DIRS+=	share/pixmaps
+INSTALLATION_DIRS+=	${PREFIX}/lib/tor-browser/browser/fontconfig
+INSTALLATION_DIRS+=	${PREFIX}/lib/tor-browser/browser/fonts
+
+post-install:
+	${INSTALL_SCRIPT} ${WRKDIR}/tor-browser.sh \
+		${DESTDIR}${PREFIX}/bin/tor-browser
+	${INSTALL_DATA} ${WRKDIR}/desktop				\
+		${DESTDIR}${PREFIX}/share/applications/${MOZILLA}.desktop
+	${INSTALL_DATA} ${MOZILLA_ICON}					\
+		${DESTDIR}${PREFIX}/share/pixmaps/${MOZILLA}.png
+	${INSTALL_DATA} ${WRKSRC}/tor-browser_en-US/Browser/TorBrowser/Data/fontconfig/fonts.conf \
+		${DESTDIR}${PREFIX}/lib/tor-browser/browser/fontconfig
+	${INSTALL_DATA} ${WRKSRC}/tor-browser_en-US/Browser/fonts/* \
+		${DESTDIR}${PREFIX}/lib/tor-browser/browser/fonts
+
+.include "../../sysutils/desktop-file-utils/desktopdb.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/tor-browser/PLIST b/tor-browser/PLIST
new file mode 100644
index 0000000000..06d4381175
--- /dev/null
+++ b/tor-browser/PLIST
@@ -0,0 +1,75 @@
+@comment $NetBSD$
+bin/tor-browser
+lib/tor-browser/application.ini
+lib/tor-browser/browser/chrome/icons/default/default128.png
+lib/tor-browser/browser/chrome/icons/default/default16.png
+lib/tor-browser/browser/chrome/icons/default/default32.png
+lib/tor-browser/browser/chrome/icons/default/default48.png
+lib/tor-browser/browser/chrome/icons/default/default64.png
+lib/tor-browser/browser/features/onboarding%mozilla.org.xpi@localhost
+lib/tor-browser/browser/fontconfig/fonts.conf
+lib/tor-browser/browser/fonts/Arimo-Bold.ttf
+lib/tor-browser/browser/fonts/Arimo-BoldItalic.ttf
+lib/tor-browser/browser/fonts/Arimo-Italic.ttf
+lib/tor-browser/browser/fonts/Arimo-Regular.ttf
+lib/tor-browser/browser/fonts/Cousine-Regular.ttf
+lib/tor-browser/browser/fonts/NotoEmoji-Regular.ttf
+lib/tor-browser/browser/fonts/NotoNaskhArabic-Regular.ttf
+lib/tor-browser/browser/fonts/NotoSansArmenian-Regular.ttf
+lib/tor-browser/browser/fonts/NotoSansBengali-Regular.ttf
+lib/tor-browser/browser/fonts/NotoSansBuginese-Regular.ttf
+lib/tor-browser/browser/fonts/NotoSansCanadianAboriginal-Regular.ttf
+lib/tor-browser/browser/fonts/NotoSansCherokee-Regular.ttf
+lib/tor-browser/browser/fonts/NotoSansDevanagari-Regular.ttf
+lib/tor-browser/browser/fonts/NotoSansEthiopic-Regular.ttf
+lib/tor-browser/browser/fonts/NotoSansGeorgian-Regular.ttf
+lib/tor-browser/browser/fonts/NotoSansGujarati-Regular.ttf
+lib/tor-browser/browser/fonts/NotoSansGurmukhi-Regular.ttf
+lib/tor-browser/browser/fonts/NotoSansHebrew-Regular.ttf
+lib/tor-browser/browser/fonts/NotoSansJP-Regular.otf
+lib/tor-browser/browser/fonts/NotoSansKR-Regular.otf
+lib/tor-browser/browser/fonts/NotoSansKannada-Regular.ttf
+lib/tor-browser/browser/fonts/NotoSansKhmer-Regular.ttf
+lib/tor-browser/browser/fonts/NotoSansLao-Regular.ttf
+lib/tor-browser/browser/fonts/NotoSansMalayalam-Regular.ttf
+lib/tor-browser/browser/fonts/NotoSansMongolian-Regular.ttf
+lib/tor-browser/browser/fonts/NotoSansMyanmar-Regular.ttf
+lib/tor-browser/browser/fonts/NotoSansOriya-Regular.ttf
+lib/tor-browser/browser/fonts/NotoSansSC-Regular.otf
+lib/tor-browser/browser/fonts/NotoSansSinhala-Regular.ttf
+lib/tor-browser/browser/fonts/NotoSansTC-Regular.otf
+lib/tor-browser/browser/fonts/NotoSansTamil-Regular.ttf
+lib/tor-browser/browser/fonts/NotoSansTelugu-Regular.ttf
+lib/tor-browser/browser/fonts/NotoSansThaana-Regular.ttf
+lib/tor-browser/browser/fonts/NotoSansThai-Regular.ttf
+lib/tor-browser/browser/fonts/NotoSansTibetan-Regular.ttf
+lib/tor-browser/browser/fonts/NotoSansYi-Regular.ttf
+lib/tor-browser/browser/fonts/NotoSerifArmenian-Regular.ttf
+lib/tor-browser/browser/fonts/NotoSerifKhmer-Regular.ttf
+lib/tor-browser/browser/fonts/NotoSerifLao-Regular.ttf
+lib/tor-browser/browser/fonts/NotoSerifThai-Regular.ttf
+lib/tor-browser/browser/fonts/STIXMath-Regular.otf
+lib/tor-browser/browser/fonts/Tinos-Bold.ttf
+lib/tor-browser/browser/fonts/Tinos-BoldItalic.ttf
+lib/tor-browser/browser/fonts/Tinos-Italic.ttf
+lib/tor-browser/browser/fonts/Tinos-Regular.ttf
+lib/tor-browser/browser/fonts/TwemojiMozilla.ttf
+lib/tor-browser/browser/omni.ja
+lib/tor-browser/defaults/pref/channel-prefs.js
+lib/tor-browser/dependentlibs.list
+lib/tor-browser/fonts/TwemojiMozilla.ttf
+lib/tor-browser/liblgpllibs.so
+lib/tor-browser/libmozavcodec.so
+lib/tor-browser/libmozavutil.so
+lib/tor-browser/libmozgtk.so
+lib/tor-browser/libmozsqlite3.so
+lib/tor-browser/libmozwayland.so
+lib/tor-browser/libxul.so
+lib/tor-browser/omni.ja
+lib/tor-browser/platform.ini
+lib/tor-browser/plugin-container
+lib/tor-browser/removed-files
+lib/tor-browser/tor-browser
+lib/tor-browser/tor-browser-bin
+share/applications/tor-browser.desktop
+share/pixmaps/tor-browser.png
diff --git a/tor-browser/PLIST.tor-launcher b/tor-browser/PLIST.tor-launcher
new file mode 100644
index 0000000000..9632f0f817
--- /dev/null
+++ b/tor-browser/PLIST.tor-launcher
@@ -0,0 +1,88 @@
+@comment $NetBSD: PLIST.tor-launcher,v 1.1 2020/03/13 17:59:27 wiz Exp $
+lib/tor-browser/browser/chrome/torlauncher/components/tl-process.js
+lib/tor-browser/browser/chrome/torlauncher/components/tl-protocol.js
+lib/tor-browser/browser/chrome/torlauncher/content/localePicker.xul
+lib/tor-browser/browser/chrome/torlauncher/content/network-settings-shared.js
+lib/tor-browser/browser/chrome/torlauncher/content/network-settings-wizard.xul
+lib/tor-browser/browser/chrome/torlauncher/content/network-settings.js
+lib/tor-browser/browser/chrome/torlauncher/content/network-settings.xul
+lib/tor-browser/browser/chrome/torlauncher/locale/ar/network-settings.dtd
+lib/tor-browser/browser/chrome/torlauncher/locale/ar/torlauncher.properties
+lib/tor-browser/browser/chrome/torlauncher/locale/ca/network-settings.dtd
+lib/tor-browser/browser/chrome/torlauncher/locale/ca/torlauncher.properties
+lib/tor-browser/browser/chrome/torlauncher/locale/cs/network-settings.dtd
+lib/tor-browser/browser/chrome/torlauncher/locale/cs/torlauncher.properties
+lib/tor-browser/browser/chrome/torlauncher/locale/da/network-settings.dtd
+lib/tor-browser/browser/chrome/torlauncher/locale/da/torlauncher.properties
+lib/tor-browser/browser/chrome/torlauncher/locale/de/network-settings.dtd
+lib/tor-browser/browser/chrome/torlauncher/locale/de/torlauncher.properties
+lib/tor-browser/browser/chrome/torlauncher/locale/el/network-settings.dtd
+lib/tor-browser/browser/chrome/torlauncher/locale/el/torlauncher.properties
+lib/tor-browser/browser/chrome/torlauncher/locale/en-US/network-settings.dtd
+lib/tor-browser/browser/chrome/torlauncher/locale/en-US/torlauncher.properties
+lib/tor-browser/browser/chrome/torlauncher/locale/es-AR/network-settings.dtd
+lib/tor-browser/browser/chrome/torlauncher/locale/es-AR/torlauncher.properties
+lib/tor-browser/browser/chrome/torlauncher/locale/es-ES/network-settings.dtd
+lib/tor-browser/browser/chrome/torlauncher/locale/es-ES/torlauncher.properties
+lib/tor-browser/browser/chrome/torlauncher/locale/fa/network-settings.dtd
+lib/tor-browser/browser/chrome/torlauncher/locale/fa/torlauncher.properties
+lib/tor-browser/browser/chrome/torlauncher/locale/fr/network-settings.dtd
+lib/tor-browser/browser/chrome/torlauncher/locale/fr/torlauncher.properties
+lib/tor-browser/browser/chrome/torlauncher/locale/ga-IE/network-settings.dtd
+lib/tor-browser/browser/chrome/torlauncher/locale/ga-IE/torlauncher.properties
+lib/tor-browser/browser/chrome/torlauncher/locale/he/network-settings.dtd
+lib/tor-browser/browser/chrome/torlauncher/locale/he/torlauncher.properties
+lib/tor-browser/browser/chrome/torlauncher/locale/hu/network-settings.dtd
+lib/tor-browser/browser/chrome/torlauncher/locale/hu/torlauncher.properties
+lib/tor-browser/browser/chrome/torlauncher/locale/id/network-settings.dtd
+lib/tor-browser/browser/chrome/torlauncher/locale/id/torlauncher.properties
+lib/tor-browser/browser/chrome/torlauncher/locale/is/network-settings.dtd
+lib/tor-browser/browser/chrome/torlauncher/locale/is/torlauncher.properties
+lib/tor-browser/browser/chrome/torlauncher/locale/it/network-settings.dtd
+lib/tor-browser/browser/chrome/torlauncher/locale/it/torlauncher.properties
+lib/tor-browser/browser/chrome/torlauncher/locale/ja/network-settings.dtd
+lib/tor-browser/browser/chrome/torlauncher/locale/ja/torlauncher.properties
+lib/tor-browser/browser/chrome/torlauncher/locale/ka/network-settings.dtd
+lib/tor-browser/browser/chrome/torlauncher/locale/ka/torlauncher.properties
+lib/tor-browser/browser/chrome/torlauncher/locale/ko/network-settings.dtd
+lib/tor-browser/browser/chrome/torlauncher/locale/ko/torlauncher.properties
+lib/tor-browser/browser/chrome/torlauncher/locale/lt/network-settings.dtd
+lib/tor-browser/browser/chrome/torlauncher/locale/lt/torlauncher.properties
+lib/tor-browser/browser/chrome/torlauncher/locale/mk/network-settings.dtd
+lib/tor-browser/browser/chrome/torlauncher/locale/mk/torlauncher.properties
+lib/tor-browser/browser/chrome/torlauncher/locale/ms/network-settings.dtd
+lib/tor-browser/browser/chrome/torlauncher/locale/ms/torlauncher.properties
+lib/tor-browser/browser/chrome/torlauncher/locale/nb-NO/network-settings.dtd
+lib/tor-browser/browser/chrome/torlauncher/locale/nb-NO/torlauncher.properties
+lib/tor-browser/browser/chrome/torlauncher/locale/nl/network-settings.dtd
+lib/tor-browser/browser/chrome/torlauncher/locale/nl/torlauncher.properties
+lib/tor-browser/browser/chrome/torlauncher/locale/pl/network-settings.dtd
+lib/tor-browser/browser/chrome/torlauncher/locale/pl/torlauncher.properties
+lib/tor-browser/browser/chrome/torlauncher/locale/pt-BR/network-settings.dtd
+lib/tor-browser/browser/chrome/torlauncher/locale/pt-BR/torlauncher.properties
+lib/tor-browser/browser/chrome/torlauncher/locale/ro/network-settings.dtd
+lib/tor-browser/browser/chrome/torlauncher/locale/ro/torlauncher.properties
+lib/tor-browser/browser/chrome/torlauncher/locale/ru/network-settings.dtd
+lib/tor-browser/browser/chrome/torlauncher/locale/ru/torlauncher.properties
+lib/tor-browser/browser/chrome/torlauncher/locale/sv-SE/network-settings.dtd
+lib/tor-browser/browser/chrome/torlauncher/locale/sv-SE/torlauncher.properties
+lib/tor-browser/browser/chrome/torlauncher/locale/th/network-settings.dtd
+lib/tor-browser/browser/chrome/torlauncher/locale/th/torlauncher.properties
+lib/tor-browser/browser/chrome/torlauncher/locale/tr/network-settings.dtd
+lib/tor-browser/browser/chrome/torlauncher/locale/tr/torlauncher.properties
+lib/tor-browser/browser/chrome/torlauncher/locale/vi/network-settings.dtd
+lib/tor-browser/browser/chrome/torlauncher/locale/vi/torlauncher.properties
+lib/tor-browser/browser/chrome/torlauncher/locale/zh-CN/network-settings.dtd
+lib/tor-browser/browser/chrome/torlauncher/locale/zh-CN/torlauncher.properties
+lib/tor-browser/browser/chrome/torlauncher/locale/zh-TW/network-settings.dtd
+lib/tor-browser/browser/chrome/torlauncher/locale/zh-TW/torlauncher.properties
+lib/tor-browser/browser/chrome/torlauncher/modules/tl-bridgedb.jsm
+lib/tor-browser/browser/chrome/torlauncher/modules/tl-logger.jsm
+lib/tor-browser/browser/chrome/torlauncher/modules/tl-util.jsm
+lib/tor-browser/browser/chrome/torlauncher/skin/activity.svg
+lib/tor-browser/browser/chrome/torlauncher/skin/default48.png
+lib/tor-browser/browser/chrome/torlauncher/skin/network-settings.css
+lib/tor-browser/browser/chrome/torlauncher/skin/reload.svg
+lib/tor-browser/browser/chrome/torlauncher/skin/tbb-logo.svg
+lib/tor-browser/browser/chrome/torlauncher/skin/warning.png
+lib/tor-browser/browser/defaults/preferences/torlauncher-prefs.js
diff --git a/tor-browser/distinfo b/tor-browser/distinfo
new file mode 100644
index 0000000000..3d4b879b96
--- /dev/null
+++ b/tor-browser/distinfo
@@ -0,0 +1,51 @@
+$NetBSD: distinfo,v 1.48 2021/11/01 21:41:59 wiz Exp $
+
+BLAKE2s (nodejs-output-11.0.1.tgz) = f5b4503c8940bb24aa15435bb5831a4888b55ef8021064940bf000280382a9ea
+SHA512 (nodejs-output-11.0.1.tgz) = 6ae617a4a673be0d08e1e5ac584b055f4a9d0c0e163b7fe57e43135b3a1c122c5d1fcdc79335dba08d6719cc7511a2a3689f7c518d8ee5e888b44015e56012a5
+Size (nodejs-output-11.0.1.tgz) = 200870 bytes
+BLAKE2s (src-firefox-tor-browser-91.3.0esr-11.0-1-build4.tar.xz) = d5e1bb697ad0e8dd8588423cd905c5c9a60af1318302682d0ca91467c82cec06
+SHA512 (src-firefox-tor-browser-91.3.0esr-11.0-1-build4.tar.xz) = c3e25ade42e9f4b550ecc60aea216c05dcd438ad7e0c85d2dc139334f811332ee8963f63a185e16f145645a81aca620ba344c19dcc39f60faaf3693ed2c8cab0
+Size (src-firefox-tor-browser-91.3.0esr-11.0-1-build4.tar.xz) = 413488416 bytes
+BLAKE2s (tor-browser-linux64-11.0.1_en-US.tar.xz) = b39b258b8e50ecd906f443111e75bef28ca9ff4a35c2c76c3ef51b96f55ad6db
+SHA512 (tor-browser-linux64-11.0.1_en-US.tar.xz) = 75d9c7676cd38f55fe7d844e6b22df117db13425a11123813f892671ef629dd3f2ddda9418873b03dea07175bde1c5aae4cb83a42bb15c3770a1e4452d2cad84
+Size (tor-browser-linux64-11.0.1_en-US.tar.xz) = 86368976 bytes
+SHA1 (patch-.mozconfig) = 949472d011d40b02146c06e90ed07673667d192b
+SHA1 (patch-aa) = 15b8567cee2af9853f6949c80345ffcb1fd3852a
+SHA1 (patch-browser_app_profile_000-tor-browser.js) = 84a0a15605fff0e22f3150bce901a296fc920280
+SHA1 (patch-browser_app_profile_firefox.js) = 89cea0a66457c96ad0b94aaa524aa5942ad781d0
+SHA1 (patch-build_moz.configure_rust.configure) = 25ddfacd29cebbc6db005dbe61a2a7446d480678
+SHA1 (patch-config_gcc-stl-wrapper.template.h) = 9d88c7b1ccfdd3c6bd2dcd9530a36ad4a501d97a
+SHA1 (patch-config_makefiles_rust.mk) = 72d7e9ecee3ccf7ef5f741aac8e35509b41ab7b8
+SHA1 (patch-dom_base_nsAttrName.h) = ac7ba441a3b27df2855cf2673eea36b1cb44ad49
+SHA1 (patch-gfx_angle_checkout_src_common_third__party_smhasher_src_PMurHash.cpp) = e458c9c8dc66edc69c1874734af28a77fc5e3993
+SHA1 (patch-gfx_angle_checkout_src_compiler_translator_InfoSink.h) = 2f73c76c48852613e0c55c1680fcc2a9eb3cf4ef
+SHA1 (patch-gfx_cairo_cairo_src_cairo-type1-subset.c) = 89a9d934ef76706c552c0b81e6cbc0f45b1ffd2c
+SHA1 (patch-gfx_skia_skia_src_core_SkCpu.cpp) = 36218819254f3681b9c717d652ea78c9f20d49ad
+SHA1 (patch-gfx_thebes_gfxPlatform.cpp) = f6f8996f0818a1b890698c7cc5054d49cb1e8924
+SHA1 (patch-gfx_wr_swgl_build.rs) = df6ebfaabb4d27994e59a9d0eaf12c7cf08415fb
+SHA1 (patch-ipc_chromium_src_base_message__pump__libevent.cc) = 4a6606da590cfb8d855bde58b9c6f90e98d0870c
+SHA1 (patch-ipc_chromium_src_base_platform__thread__posix.cc) = 35d20981d33ccdb1d8ffb8039e48798777f11658
+SHA1 (patch-ipc_glue_GeckoChildProcessHost.cpp) = 260c29bacd8bf265951b7a412f850bf2b292c836
+SHA1 (patch-js_src_jit_ProcessExecutableMemory.cpp) = fad103cc698f9828ad58f742231984ec2bc27605
+SHA1 (patch-js_src_jit_arm64_vixl_MozCpu-vixl.cpp) = fdc522e3fb626b1b8a2ebf19ad60bfc25dfa4183
+SHA1 (patch-js_src_jsfriendapi.h) = b5cb687dbbda314fe0f16521c1c042c105c4bbe4
+SHA1 (patch-js_src_util_NativeStack.cpp) = a0a16d8d8d78d3cc3f4d2a508586f1a7821f7dba
+SHA1 (patch-js_src_vm_ArrayBufferObject.cpp) = 0501fdcae11568ae4ea78e0d2f6b3750b7a67d47
+SHA1 (patch-media_ffvpx_libavutil_arm_bswap.h) = de58daa0fd23d4fec50426602b65c9ea5862558a
+SHA1 (patch-media_libcubeb_src_cubeb__alsa.c) = 31536f36cb33f16da309527b50eda9b721608115
+SHA1 (patch-media_libcubeb_src_moz.build) = e4e64a1135cf4157ae5b6f7c1710ebd076953479
+SHA1 (patch-media_libpng_pngpriv.h) = c8084332560017cd7c9b519b61d125fa28af0dbc
+SHA1 (patch-media_libtheora_lib_info.c) = f6dbf536d73859a1ff78304c2e9f6a6f74dac01f
+SHA1 (patch-media_webrtc_trunk_webrtc_modules_video__capture_linux_device__info__linux.cc) = f495b64d33db4940c0dfe8c36ddf82aa752b25d9
+SHA1 (patch-modules_fdlibm_src_math__private.h) = 6ae3b0077b4a8c6088c35769fa1972cfc44ea9c1
+SHA1 (patch-mozglue_misc_Uptime.cpp) = daefe25ef1ebc8e4d3735017b9e8ac68c4710a00
+SHA1 (patch-nsprpub_pr_src_pthreads_ptsynch.c) = 13e512c7ee9fa1e14ba415d62fa853e5fbfc91c0
+SHA1 (patch-security_nss_lib_freebl_mpi_mpi.c) = a7cd867916524770609d1c307a65b315b88456f4
+SHA1 (patch-toolkit_components_terminator_nsTerminator.cpp) = 1c1397f6177728cf9deb2b74708069b9d09509c3
+SHA1 (patch-toolkit_modules_subprocess_subprocess__shared__unix.js) = 22a39e54e042ab2270a3cb54e4e307c8900cad12
+SHA1 (patch-toolkit_moz.configure) = b4f93aadfac74bcf93c9987bd8ed06c7191e7041
+SHA1 (patch-toolkit_mozapps_installer_packager.mk) = 706635b76a7b525794aba95e95544f09e18bb662
+SHA1 (patch-widget_gtk_DMABufSurface.cpp) = 72bc9554f075734df12e1748fb8965dce8318de5
+SHA1 (patch-xpcom_base_nscore.h) = 1ac4d34d3c9e80bc1ac966c6c84cb320bc0fa1ec
+SHA1 (patch-xpcom_io_TorFileUtils.cpp) = 8c23e8618e6edd5020c01a92c4c164c8ec1e71c1
+SHA1 (patch-xpcom_reflect_xptcall_md_unix_moz.build) = f7e491c7b62a5332066473bfc815e0050672a372
diff --git a/tor-browser/files/desktop.in b/tor-browser/files/desktop.in
new file mode 100644
index 0000000000..d72090e1aa
--- /dev/null
+++ b/tor-browser/files/desktop.in
@@ -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;
diff --git a/tor-browser/files/node-wrapper.sh b/tor-browser/files/node-wrapper.sh
new file mode 100755
index 0000000000..2f6b52bdd6
--- /dev/null
+++ b/tor-browser/files/node-wrapper.sh
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+VERS=v14.18.1
+
+if [ "$1" = "-v" ] || [ "$1" = "--version" ]; then
+	printf "${VERS}\n"
+fi
+
+exit 0
diff --git a/tor-browser/files/tor-browser.sh b/tor-browser/files/tor-browser.sh
new file mode 100755
index 0000000000..5cdd228de7
--- /dev/null
+++ b/tor-browser/files/tor-browser.sh
@@ -0,0 +1,5 @@
+#! /bin/sh
+export FONTCONFIG_PATH="@PREFIX@/lib/tor-browser/browser/fontconfig/"
+export FONTCONFIG_FILE="fonts.conf"
+
+exec @PREFIX@/lib/tor-browser/tor-browser-bin "$@"
diff --git a/tor-browser/options.mk b/tor-browser/options.mk
new file mode 100644
index 0000000000..b258e71c90
--- /dev/null
+++ b/tor-browser/options.mk
@@ -0,0 +1,71 @@
+# $NetBSD: options.mk,v 1.10 2020/11/18 22:38:21 riastradh Exp $
+
+PKG_OPTIONS_VAR=	PKG_OPTIONS.tor-browser
+
+PKG_SUPPORTED_OPTIONS+=	debug debug-info mozilla-jemalloc webrtc
+PKG_SUPPORTED_OPTIONS+=	alsa pulseaudio dbus
+
+.if ${OPSYS} == "Linux"
+PKG_SUGGESTED_OPTIONS+=	pulseaudio mozilla-jemalloc dbus webrtc
+.else
+PKG_SUGGESTED_OPTIONS+=	dbus
+.endif
+
+.if ${OPSYS} == "NetBSD" && empty(OS_VERSION:M[0-8].*)
+PKG_SUGGESTED_OPTIONS+=	webrtc
+.endif
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Malsa)
+CONFIGURE_ARGS+=	--enable-alsa
+.include "../../audio/alsa-lib/buildlink3.mk"
+.else
+CONFIGURE_ARGS+=	--disable-alsa
+.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)
+.include "../../audio/pulseaudio/buildlink3.mk"
+CONFIGURE_ARGS+=	--enable-pulseaudio
+.else
+CONFIGURE_ARGS+=	--disable-pulseaudio
+.endif
+
+.if !empty(PKG_OPTIONS:Mdbus)
+.include "../../sysutils/dbus-glib/buildlink3.mk"
+CONFIGURE_ARGS+=	--enable-dbus
+.else
+CONFIGURE_ARGS+=	--disable-dbus
+.endif
+
+.if !empty(PKG_OPTIONS:Mwebrtc)
+.include "../../graphics/libv4l/buildlink3.mk"
+CONFIGURE_ARGS+=	--enable-webrtc
+.else
+CONFIGURE_ARGS+=	--disable-webrtc
+.endif
diff --git a/tor-browser/patches/patch-.mozconfig b/tor-browser/patches/patch-.mozconfig
new file mode 100644
index 0000000000..a133f5afb8
--- /dev/null
+++ b/tor-browser/patches/patch-.mozconfig
@@ -0,0 +1,17 @@
+$NetBSD: patch-.mozconfig,v 1.3 2020/10/07 11:10:34 wiz Exp $
+
+mozbuild.configure.options.InvalidOptionError: --disable-eme is not available in this configuration
+disable tor-launcher - assume tor is started as system process
+
+--- .mozconfig.orig	2020-09-19 17:21:46.000000000 +0000
++++ .mozconfig
+@@ -26,8 +26,7 @@ ac_add_options --disable-debug
+ ac_add_options --disable-crashreporter
+ ac_add_options --disable-webrtc
+ ac_add_options --disable-parental-controls
+-# Let's make sure no preference is enabling either Adobe's or Google's CDM.
+-ac_add_options --disable-eme
++ac_add_options --disable-tor-launcher
+ ac_add_options --enable-proxy-bypass-protection
+ 
+ # Disable telemetry
diff --git a/tor-browser/patches/patch-aa b/tor-browser/patches/patch-aa
new file mode 100644
index 0000000000..2a043a7592
--- /dev/null
+++ b/tor-browser/patches/patch-aa
@@ -0,0 +1,26 @@
+$NetBSD: patch-aa,v 1.1 2021/09/08 22:19:50 nia Exp $
+
+* Add Sun audio support
+
+--- old-configure.in.orig	Tue Jan  7 17:23:36 2020
++++ old-configure.in	Fri Jan 17 16:03:40 2020
+@@ -1960,6 +1960,19 @@
+ AC_DEFINE(MOZ_WEBM_ENCODER)
+ AC_SUBST(MOZ_WEBM_ENCODER)
+ 
++dnl ==================================
++dnl = Check sunaudio availability
++dnl ==================================
++
++dnl If using Solaris or NetBSD, ensure that sunaudio is available
++case "$OS_TARGET" in
++SunOS|NetBSD)
++    MOZ_SUNAUDIO=1
++    ;;
++esac
++
++AC_SUBST(MOZ_SUNAUDIO)
++
+ dnl ========================================================
+ dnl NegotiateAuth
+ dnl ========================================================
diff --git a/tor-browser/patches/patch-browser_app_profile_000-tor-browser.js b/tor-browser/patches/patch-browser_app_profile_000-tor-browser.js
new file mode 100644
index 0000000000..e19c7c1d8f
--- /dev/null
+++ b/tor-browser/patches/patch-browser_app_profile_000-tor-browser.js
@@ -0,0 +1,37 @@
+$NetBSD: patch-browser_app_profile_000-tor-browser.js,v 1.2 2020/05/01 07:01:46 wiz Exp $
+
+First chunk:
+
+Despite the warning at the top of this file, we change the default for the socks
+port in pkgsrc from 9150 to 9050.
+
+9150 is used for distributions where tor is bundled with tor-browser, so the
+standard port can't be used because another tor may already be running there.
+
+pkgsrc's tor-browser uses the system-wide installation of tor and thus should use
+its default port to minimize manual setup steps for the end users.
+
+
+Second chunk:
+Hardcode font list on all pkgsrc platforms to make it harder to fingerprint.
+
+--- browser/app/profile/000-tor-browser.js.orig	2020-04-04 03:09:31.000000000 +0000
++++ browser/app/profile/000-tor-browser.js
+@@ -161,7 +161,7 @@ pref("network.predictor.enabled", false)
+ 
+ // Proxy and proxy security
+ pref("network.proxy.socks", "127.0.0.1");
+-pref("network.proxy.socks_port", 9150);
++pref("network.proxy.socks_port", 9050);
+ pref("network.proxy.socks_remote_dns", true);
+ pref("network.proxy.no_proxies_on", ""); // For fingerprinting and local service vulns (#10419)
+ pref("network.proxy.allow_hijacking_localhost", true); // Allow proxies for localhost (#31065)
+@@ -370,7 +370,7 @@ pref("font.name.sans-serif.ar", "Arial")
+ pref("font.system.whitelist", "Arial, Batang, 바탕, Cambria Math, Courier New, Euphemia, Gautami, Georgia, Gulim, 굴림, GulimChe, 굴림체, Iskoola Pota, Kalinga, Kartika, Latha, Lucida Console, MS Gothic, MS ゴシック, MS Mincho, MS 明朝, MS PGothic, MS Pゴシック, MS PMincho, MS P明朝, MV Boli, Malgun Gothic, Mangal, Meiryo, Meiryo UI, Microsoft Himalaya, Microsoft JhengHei, Microsoft JhengHei UI, Microsoft YaHei, 微软雅黑, Microsoft YaHei UI, MingLiU, 細明體, Noto Sans Buginese, Noto Sans Khmer, Noto Sans Lao, Noto Sans Myanmar, Noto Sans Yi, Nyala, PMingLiU, 新細明體, Plantagenet Cherokee, Raavi, Segoe UI, Shruti, SimSun, 宋体, Sylfaen, Tahoma, Times New Roman, Tunga, Verdana, Vrinda, Yu Gothic UI");
+ #endif
+ 
+-#ifdef XP_LINUX
++#if 1
+ pref("font.default.lo", "Noto Sans Lao");
+ pref("font.default.my", "Noto Sans Myanmar");
+ pref("font.default.x-western", "sans-serif");
diff --git a/tor-browser/patches/patch-browser_app_profile_firefox.js b/tor-browser/patches/patch-browser_app_profile_firefox.js
new file mode 100644
index 0000000000..0a68fe69ab
--- /dev/null
+++ b/tor-browser/patches/patch-browser_app_profile_firefox.js
@@ -0,0 +1,17 @@
+$NetBSD: patch-browser_app_profile_firefox.js,v 1.1 2021/09/08 22:19:50 nia Exp $
+
+--- browser/app/profile/firefox.js.orig	2019-07-06 01:48:29.000000000 +0000
++++ browser/app/profile/firefox.js
+@@ -1851,6 +1851,12 @@ pref("fission.frontend.simulate-messages
+ 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);
++
+ // Discovery prefs
+ pref("browser.discovery.enabled", true);
+ pref("browser.discovery.containers.enabled", true);
diff --git a/tor-browser/patches/patch-build_moz.configure_rust.configure b/tor-browser/patches/patch-build_moz.configure_rust.configure
new file mode 100644
index 0000000000..dd65d00424
--- /dev/null
+++ b/tor-browser/patches/patch-build_moz.configure_rust.configure
@@ -0,0 +1,15 @@
+$NetBSD: patch-build_moz.configure_rust.configure,v 1.1 2021/09/08 22:19:50 nia 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
diff --git a/tor-browser/patches/patch-config_gcc-stl-wrapper.template.h b/tor-browser/patches/patch-config_gcc-stl-wrapper.template.h
new file mode 100644
index 0000000000..9889fceff3
--- /dev/null
+++ b/tor-browser/patches/patch-config_gcc-stl-wrapper.template.h
@@ -0,0 +1,31 @@
+$NetBSD: patch-config_gcc-stl-wrapper.template.h,v 1.1 2021/09/08 22:19:50 nia Exp $
+
+--- config/gcc-stl-wrapper.template.h.orig	2021-04-08 21:20:01.000000000 +0000
++++ config/gcc-stl-wrapper.template.h
+@@ -32,8 +32,8 @@
+ // 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_type_traits
+@@ -51,7 +51,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
+@@ -80,4 +80,6 @@
+ #  include "mozilla/throw_gcc.h"
+ #endif
+ 
++#undef moz_dont_include_mzalloc_for_${HEADER}
++
+ #endif  // if mozilla_${HEADER}_h
diff --git a/tor-browser/patches/patch-config_makefiles_rust.mk b/tor-browser/patches/patch-config_makefiles_rust.mk
new file mode 100644
index 0000000000..4b4e223f85
--- /dev/null
+++ b/tor-browser/patches/patch-config_makefiles_rust.mk
@@ -0,0 +1,17 @@
+$NetBSD: patch-config_makefiles_rust.mk,v 1.1 2021/09/08 22:19:50 nia Exp $
+
+NetBSD doesn't get along with parallel rust builds (it causes issues
+with ld.so) which are the default. Force -j1.
+
+--- config/makefiles/rust.mk.orig	2021-01-14 21:11:33.000000000 +0000
++++ config/makefiles/rust.mk
+@@ -52,6 +52,9 @@ endif
+ ifeq (1,$(MOZ_PARALLEL_BUILD))
+ cargo_build_flags += -j1
+ endif
++ifeq ($(OS_ARCH),NetBSD)
++cargo_build_flags += -j1
++endif
+ 
+ # We also need to rebuild the rust stdlib so that it's instrumented. Because
+ # build-std is still pretty experimental, we need to explicitly request
diff --git a/tor-browser/patches/patch-dom_base_nsAttrName.h b/tor-browser/patches/patch-dom_base_nsAttrName.h
new file mode 100644
index 0000000000..ee8243ff97
--- /dev/null
+++ b/tor-browser/patches/patch-dom_base_nsAttrName.h
@@ -0,0 +1,18 @@
+$NetBSD: patch-dom_base_nsAttrName.h,v 1.1 2021/09/08 22:19:50 nia 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 {
diff --git a/tor-browser/patches/patch-gfx_angle_checkout_src_common_third__party_smhasher_src_PMurHash.cpp b/tor-browser/patches/patch-gfx_angle_checkout_src_common_third__party_smhasher_src_PMurHash.cpp
new file mode 100644
index 0000000000..7fd375dbc3
--- /dev/null
+++ b/tor-browser/patches/patch-gfx_angle_checkout_src_common_third__party_smhasher_src_PMurHash.cpp
@@ -0,0 +1,17 @@
+$NetBSD: patch-gfx_angle_checkout_src_common_third__party_smhasher_src_PMurHash.cpp,v 1.1 2021/09/08 22:19:50 nia 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
diff --git a/tor-browser/patches/patch-gfx_angle_checkout_src_compiler_translator_InfoSink.h b/tor-browser/patches/patch-gfx_angle_checkout_src_compiler_translator_InfoSink.h
new file mode 100644
index 0000000000..76ed10bf17
--- /dev/null
+++ b/tor-browser/patches/patch-gfx_angle_checkout_src_compiler_translator_InfoSink.h
@@ -0,0 +1,16 @@
+$NetBSD: patch-gfx_angle_checkout_src_compiler_translator_InfoSink.h,v 1.1 2021/09/08 22:19:50 nia 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	2018-10-18 20:06:05.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 "compiler/translator/Common.h"
+ #include "compiler/translator/Severity.h"
diff --git a/tor-browser/patches/patch-gfx_cairo_cairo_src_cairo-type1-subset.c b/tor-browser/patches/patch-gfx_cairo_cairo_src_cairo-type1-subset.c
new file mode 100644
index 0000000000..1206b4ff75
--- /dev/null
+++ b/tor-browser/patches/patch-gfx_cairo_cairo_src_cairo-type1-subset.c
@@ -0,0 +1,19 @@
+$NetBSD: patch-gfx_cairo_cairo_src_cairo-type1-subset.c,v 1.1 2021/09/08 22:19:50 nia Exp $
+
+Fix undefined behavior when calling <ctype.h> functions with illegal values.
+
+gfx/cairo/cairo/src/cairo-type1-subset.c:273:11: error: array subscript is of type 'char' [-Werror,-Wchar-subscripts]
+
+https://bugzilla.mozilla.org/show_bug.cgi?id=1642081
+
+--- gfx/cairo/cairo/src/cairo-type1-subset.c.orig	2020-05-07 18:34:10.000000000 +0000
++++ gfx/cairo/cairo/src/cairo-type1-subset.c
+@@ -270,7 +270,7 @@ cairo_type1_font_subset_find_segments (c
+ 	font->eexec_segment = (char *) p + font->header_segment_size;
+ 	font->eexec_segment_is_ascii = TRUE;
+ 	for (i = 0; i < 4; i++) {
+-	    if (!isxdigit(font->eexec_segment[i]))
++	    if (!isxdigit((unsigned char) font->eexec_segment[i]))
+ 		font->eexec_segment_is_ascii = FALSE;
+ 	}
+     }
diff --git a/tor-browser/patches/patch-gfx_skia_skia_src_core_SkCpu.cpp b/tor-browser/patches/patch-gfx_skia_skia_src_core_SkCpu.cpp
new file mode 100644
index 0000000000..d09ff3e1a4
--- /dev/null
+++ b/tor-browser/patches/patch-gfx_skia_skia_src_core_SkCpu.cpp
@@ -0,0 +1,15 @@
+$NetBSD: patch-gfx_skia_skia_src_core_SkCpu.cpp,v 1.1 2021/09/08 22:19:50 nia 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() {
diff --git a/tor-browser/patches/patch-gfx_thebes_gfxPlatform.cpp b/tor-browser/patches/patch-gfx_thebes_gfxPlatform.cpp
new file mode 100644
index 0000000000..72364e2084
--- /dev/null
+++ b/tor-browser/patches/patch-gfx_thebes_gfxPlatform.cpp
@@ -0,0 +1,28 @@
+$NetBSD: patch-gfx_thebes_gfxPlatform.cpp,v 1.1 2021/09/08 22:19:50 nia Exp $
+
+Don't rely on CrossProcessSemaphore on NetBSD. It has some implementation
+issues that cause issues (kern/55386, not available on NetBSD<9)
+
+This idea is borrowed from macOS which has the same limitation.
+
+--- gfx/thebes/gfxPlatform.cpp.orig	2020-06-03 01:04:50.000000000 +0000
++++ gfx/thebes/gfxPlatform.cpp
+@@ -2922,6 +2922,10 @@ bool gfxPlatform::UsesOffMainThreadCompo
+ }
+ 
+ bool gfxPlatform::UsesTiling() const {
++#ifdef __NetBSD__
++  // Avoid relying on CrossProcessSemaphore
++  return true;
++#else
+   bool usesSkia = GetDefaultContentBackend() == BackendType::SKIA;
+ 
+   // We can't just test whether the PaintThread is initialized here because
+@@ -2934,6 +2938,7 @@ bool gfxPlatform::UsesTiling() const {
+   return StaticPrefs::layers_enable_tiles_AtStartup() ||
+          (StaticPrefs::layers_enable_tiles_if_skia_pomtp_AtStartup() &&
+           usesSkia && usesPOMTP);
++#endif
+ }
+ 
+ bool gfxPlatform::ContentUsesTiling() const {
diff --git a/tor-browser/patches/patch-gfx_wr_swgl_build.rs b/tor-browser/patches/patch-gfx_wr_swgl_build.rs
new file mode 100644
index 0000000000..6cdde220f5
--- /dev/null
+++ b/tor-browser/patches/patch-gfx_wr_swgl_build.rs
@@ -0,0 +1,27 @@
+$NetBSD: patch-gfx_wr_swgl_build.rs,v 1.1 2021/09/08 22:19:50 nia 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)
diff --git a/tor-browser/patches/patch-ipc_chromium_src_base_message__pump__libevent.cc b/tor-browser/patches/patch-ipc_chromium_src_base_message__pump__libevent.cc
new file mode 100644
index 0000000000..7803fb00f1
--- /dev/null
+++ b/tor-browser/patches/patch-ipc_chromium_src_base_message__pump__libevent.cc
@@ -0,0 +1,22 @@
+$NetBSD: patch-ipc_chromium_src_base_message__pump__libevent.cc,v 1.1 2021/09/08 22:19:50 nia Exp $
+
+Allow older libevent
+
+--- ipc/chromium/src/base/message_pump_libevent.cc.orig	2019-03-07 16:53:35.000000000 +0000
++++ ipc/chromium/src/base/message_pump_libevent.cc
+@@ -22,6 +22,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), \
+@@ -41,6 +42,7 @@ CHECK_EVENT_SIZEOF(PTHREAD_T, pthread_t)
+ CHECK_EVENT_SIZEOF(SHORT, short);
+ CHECK_EVENT_SIZEOF(SIZE_T, size_t);
+ CHECK_EVENT_SIZEOF(VOID_P, void*);
++#endif
+ 
+ // Lifecycle of struct event
+ // Libevent uses two main data structures:
diff --git a/tor-browser/patches/patch-ipc_chromium_src_base_platform__thread__posix.cc b/tor-browser/patches/patch-ipc_chromium_src_base_platform__thread__posix.cc
new file mode 100644
index 0000000000..7712aeed3e
--- /dev/null
+++ b/tor-browser/patches/patch-ipc_chromium_src_base_platform__thread__posix.cc
@@ -0,0 +1,18 @@
+$NetBSD: patch-ipc_chromium_src_base_platform__thread__posix.cc,v 1.1 2021/09/08 22:19:50 nia 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>
diff --git a/tor-browser/patches/patch-ipc_glue_GeckoChildProcessHost.cpp b/tor-browser/patches/patch-ipc_glue_GeckoChildProcessHost.cpp
new file mode 100644
index 0000000000..bc12ac4df1
--- /dev/null
+++ b/tor-browser/patches/patch-ipc_glue_GeckoChildProcessHost.cpp
@@ -0,0 +1,21 @@
+$NetBSD: patch-ipc_glue_GeckoChildProcessHost.cpp,v 1.1 2021/09/08 22:19:50 nia Exp $
+
+* Support Solaris
+* Fix NetBSD linking
+
+--- ipc/glue/GeckoChildProcessHost.cpp.orig	2017-07-31 16:20:47.000000000 +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/string_util.h"
diff --git a/tor-browser/patches/patch-js_src_jit_ProcessExecutableMemory.cpp b/tor-browser/patches/patch-js_src_jit_ProcessExecutableMemory.cpp
new file mode 100644
index 0000000000..38c511c397
--- /dev/null
+++ b/tor-browser/patches/patch-js_src_jit_ProcessExecutableMemory.cpp
@@ -0,0 +1,38 @@
+$NetBSD: patch-js_src_jit_ProcessExecutableMemory.cpp,v 1.1 2021/09/08 22:19:50 nia Exp $
+
+PaX MPROTECT safety for NetBSD.
+
+--- 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;
diff --git a/tor-browser/patches/patch-js_src_jit_arm64_vixl_MozCpu-vixl.cpp b/tor-browser/patches/patch-js_src_jit_arm64_vixl_MozCpu-vixl.cpp
new file mode 100644
index 0000000000..7791f80ecc
--- /dev/null
+++ b/tor-browser/patches/patch-js_src_jit_arm64_vixl_MozCpu-vixl.cpp
@@ -0,0 +1,38 @@
+$NetBSD: patch-js_src_jit_arm64_vixl_MozCpu-vixl.cpp,v 1.1 2021/09/08 22:19:50 nia Exp $
+
+NetBSD/aarch64 does not have the Linux-specific membarrier(2) syscall.
+
+--- js/src/jit/arm64/vixl/MozCpu-vixl.cpp.orig	2020-11-12 18:04:48.000000000 +0000
++++ js/src/jit/arm64/vixl/MozCpu-vixl.cpp
+@@ -42,6 +42,8 @@
+ #   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
+@@ -49,7 +51,11 @@
+ #  include "vm/JSContext.h" // TlsContext
+ 
+ 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
+@@ -116,7 +122,9 @@ uint32_t CPU::GetCacheType() {
+ }
+ 
+ bool CPU::CanFlushICacheFromBackgroundThreads() {
+-#if defined(__aarch64__) && (defined(__linux__) || defined(__android__))
++#if defined(__NetBSD__) && defined(__aarch64__)
++  return false;
++#elif defined(__aarch64__) && (defined(__linux__) || defined(__android__))
+   // On linux, check the kernel supports membarrier(2), that is, it's a kernel
+   // above Linux 4.16 included.
+   //
diff --git a/tor-browser/patches/patch-js_src_jsfriendapi.h b/tor-browser/patches/patch-js_src_jsfriendapi.h
new file mode 100644
index 0000000000..0959f6384d
--- /dev/null
+++ b/tor-browser/patches/patch-js_src_jsfriendapi.h
@@ -0,0 +1,14 @@
+$NetBSD: patch-js_src_jsfriendapi.h,v 1.1 2021/09/08 22:19:50 nia Exp $
+
+* Fix va_list error.
+
+--- js/src/jsfriendapi.h.orig	2020-09-17 00:32:45.000000000 +0000
++++ js/src/jsfriendapi.h
+@@ -10,6 +10,7 @@
+ #include "mozilla/MemoryReporting.h"
+ #include "mozilla/PodOperations.h"
+ 
++#include <stdarg.h>
+ #include "jspubtd.h"
+ 
+ #include "js/CallArgs.h"
diff --git a/tor-browser/patches/patch-js_src_util_NativeStack.cpp b/tor-browser/patches/patch-js_src_util_NativeStack.cpp
new file mode 100644
index 0000000000..1e7c05cbc0
--- /dev/null
+++ b/tor-browser/patches/patch-js_src_util_NativeStack.cpp
@@ -0,0 +1,32 @@
+$NetBSD: patch-js_src_util_NativeStack.cpp,v 1.1 2021/09/08 22:19:50 nia 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;
diff --git a/tor-browser/patches/patch-js_src_vm_ArrayBufferObject.cpp b/tor-browser/patches/patch-js_src_vm_ArrayBufferObject.cpp
new file mode 100644
index 0000000000..6cfefcb384
--- /dev/null
+++ b/tor-browser/patches/patch-js_src_vm_ArrayBufferObject.cpp
@@ -0,0 +1,24 @@
+$NetBSD: patch-js_src_vm_ArrayBufferObject.cpp,v 1.1 2021/09/08 22:19:50 nia Exp $
+
+PaX MPROTECT safety for NetBSD.
+
+--- 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;
+   }
diff --git a/tor-browser/patches/patch-media_ffvpx_libavutil_arm_bswap.h b/tor-browser/patches/patch-media_ffvpx_libavutil_arm_bswap.h
new file mode 100644
index 0000000000..e7dd36204b
--- /dev/null
+++ b/tor-browser/patches/patch-media_ffvpx_libavutil_arm_bswap.h
@@ -0,0 +1,22 @@
+$NetBSD: patch-media_ffvpx_libavutil_arm_bswap.h,v 1.1 2021/09/08 22:19:50 nia 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 */
diff --git a/tor-browser/patches/patch-media_libcubeb_src_cubeb__alsa.c b/tor-browser/patches/patch-media_libcubeb_src_cubeb__alsa.c
new file mode 100644
index 0000000000..ca718e8f7f
--- /dev/null
+++ b/tor-browser/patches/patch-media_libcubeb_src_cubeb__alsa.c
@@ -0,0 +1,12 @@
+$NetBSD: patch-media_libcubeb_src_cubeb__alsa.c,v 1.1 2021/09/08 22:19:50 nia Exp $
+
+--- media/libcubeb/src/cubeb_alsa.c.orig	2019-12-02 12:23:28.000000000 +0000
++++ media/libcubeb/src/cubeb_alsa.c
+@@ -7,6 +7,7 @@
+ #undef NDEBUG
+ #define _DEFAULT_SOURCE
+ #define _BSD_SOURCE
++#define _NETBSD_SOURCE
+ #define _XOPEN_SOURCE 500
+ #include <pthread.h>
+ #include <sys/time.h>
diff --git a/tor-browser/patches/patch-media_libcubeb_src_moz.build b/tor-browser/patches/patch-media_libcubeb_src_moz.build
new file mode 100644
index 0000000000..005c87aa9c
--- /dev/null
+++ b/tor-browser/patches/patch-media_libcubeb_src_moz.build
@@ -0,0 +1,19 @@
+$NetBSD: patch-media_libcubeb_src_moz.build,v 1.1 2021/09/08 22:19:50 nia Exp $
+
+* Add Sun audio support
+
+--- media/libcubeb/src/moz.build.orig	2020-04-03 19:35:03.000000000 +0000
++++ media/libcubeb/src/moz.build
+@@ -23,6 +23,12 @@ if CONFIG['MOZ_ALSA']:
+     ]
+     DEFINES['USE_ALSA'] = True
+ 
++if CONFIG['MOZ_SUNAUDIO']:
++    SOURCES += [
++        'cubeb_sun.c',
++    ]
++    DEFINES['USE_SUN'] = True
++
+ if CONFIG['MOZ_PULSEAUDIO'] or CONFIG['MOZ_JACK']:
+     SOURCES += [
+         'cubeb_resampler.cpp',
diff --git a/tor-browser/patches/patch-media_libpng_pngpriv.h b/tor-browser/patches/patch-media_libpng_pngpriv.h
new file mode 100644
index 0000000000..ecf8b877a7
--- /dev/null
+++ b/tor-browser/patches/patch-media_libpng_pngpriv.h
@@ -0,0 +1,17 @@
+$NetBSD: patch-media_libpng_pngpriv.h,v 1.1 2021/09/08 22:19:50 nia 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: */
diff --git a/tor-browser/patches/patch-media_libtheora_lib_info.c b/tor-browser/patches/patch-media_libtheora_lib_info.c
new file mode 100644
index 0000000000..03e686a912
--- /dev/null
+++ b/tor-browser/patches/patch-media_libtheora_lib_info.c
@@ -0,0 +1,19 @@
+$NetBSD: patch-media_libtheora_lib_info.c,v 1.1 2021/09/08 22:19:50 nia 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]!='=';
+ }
diff --git a/tor-browser/patches/patch-media_webrtc_trunk_webrtc_modules_video__capture_linux_device__info__linux.cc b/tor-browser/patches/patch-media_webrtc_trunk_webrtc_modules_video__capture_linux_device__info__linux.cc
new file mode 100644
index 0000000000..da2d82a67a
--- /dev/null
+++ b/tor-browser/patches/patch-media_webrtc_trunk_webrtc_modules_video__capture_linux_device__info__linux.cc
@@ -0,0 +1,63 @@
+$NetBSD: patch-media_webrtc_trunk_webrtc_modules_video__capture_linux_device__info__linux.cc,v 1.1 2021/09/08 22:19:50 nia Exp $
+
+* Fix buiuld under NetBSD.
+  NetBSD's sys/videoio.h does not have v4l2_capability.device_caps
+  and video capture does not work for me anyway.
+
+--- third_party/libwebrtc/webrtc/modules/video_capture/linux/device_info_linux.cc.orig	2021-05-20 21:30:20.000000000 +0000
++++ third_party/libwebrtc/webrtc/modules/video_capture/linux/device_info_linux.cc
+@@ -207,10 +207,12 @@ uint32_t DeviceInfoLinux::NumberOfDevice
+     sprintf(device, "/dev/video%d", n);
+     if ((fd = open(device, O_RDONLY)) != -1) {
+       // query device capabilities and make sure this is a video capture device
++#if !defined(__NetBSD__)
+       if (ioctl(fd, VIDIOC_QUERYCAP, &cap) < 0 || !IsVideoCaptureDevice(&cap)) {
+         close(fd);
+         continue;
+       }
++#endif
+ 
+       close(fd);
+       count++;
+@@ -241,10 +243,12 @@ int32_t DeviceInfoLinux::GetDeviceName(u
+     sprintf(device, "/dev/video%d", device_index);
+     if ((fd = open(device, O_RDONLY)) != -1) {
+       // query device capabilities and make sure this is a video capture device
++#if !defined(__NetBSD__)
+       if (ioctl(fd, VIDIOC_QUERYCAP, &cap) < 0 || !IsVideoCaptureDevice(&cap)) {
+         close(fd);
+         continue;
+       }
++#endif
+       if (count == deviceNumber) {
+         // Found the device
+         found = true;
+@@ -328,10 +332,12 @@ int32_t DeviceInfoLinux::CreateCapabilit
+     struct v4l2_capability cap;
+     if (ioctl(fd, VIDIOC_QUERYCAP, &cap) == 0) {
+       // skip devices without video capture capability
++#if !defined(__NetBSD__)
+       if (!IsVideoCaptureDevice(&cap)) {
+         close(fd);
+         continue;
+       }
++#endif
+ 
+       if (cap.bus_info[0] != 0) {
+         if (strncmp((const char*)cap.bus_info, (const char*)deviceUniqueIdUTF8,
+@@ -384,6 +390,7 @@ bool DeviceInfoLinux::IsDeviceNameMatche
+   return false;
+ }
+ 
++#ifndef __NetBSD__
+ bool DeviceInfoLinux::IsVideoCaptureDevice(struct v4l2_capability* cap)
+ {
+   if (cap->capabilities & V4L2_CAP_DEVICE_CAPS) {
+@@ -392,6 +399,7 @@ bool DeviceInfoLinux::IsVideoCaptureDevi
+     return cap->capabilities & V4L2_CAP_VIDEO_CAPTURE;
+   }
+ }
++#endif
+ 
+ int32_t DeviceInfoLinux::FillCapabilities(int fd) {
+   // set image format
diff --git a/tor-browser/patches/patch-modules_fdlibm_src_math__private.h b/tor-browser/patches/patch-modules_fdlibm_src_math__private.h
new file mode 100644
index 0000000000..026d9b08c3
--- /dev/null
+++ b/tor-browser/patches/patch-modules_fdlibm_src_math__private.h
@@ -0,0 +1,18 @@
+$NetBSD: patch-modules_fdlibm_src_math__private.h,v 1.1 2021/11/03 19:19:40 nia Exp $
+
+* Fix PR pkg/56457, build failure on NetBSD/i386.
+  Do not use FreeBSD-specific definition.
+
+--- modules/fdlibm/src/math_private.h.orig	2021-09-27 22:47:42.000000000 +0000
++++ modules/fdlibm/src/math_private.h
+@@ -30,8 +30,8 @@
+  * Adapted from https://github.com/freebsd/freebsd-src/search?q=__double_t
+  */
+ 
+-typedef double      __double_t;
+-typedef __double_t  double_t;
++#include <math.h>
++typedef double_t __double_t;
+ 
+ /*
+  * The original fdlibm code used statements like:
diff --git a/tor-browser/patches/patch-mozglue_misc_Uptime.cpp b/tor-browser/patches/patch-mozglue_misc_Uptime.cpp
new file mode 100644
index 0000000000..85639b1e4a
--- /dev/null
+++ b/tor-browser/patches/patch-mozglue_misc_Uptime.cpp
@@ -0,0 +1,15 @@
+$NetBSD: patch-mozglue_misc_Uptime.cpp,v 1.1 2021/09/08 22:19:50 nia Exp $
+
+* Define uptime-related functions for NetBSD too.
+
+--- mozglue/misc/Uptime.cpp.orig	2021-05-20 21:29:40.000000000 +0000
++++ mozglue/misc/Uptime.cpp
+@@ -76,7 +76,7 @@ Maybe<uint64_t> NowIncludingSuspendMs() 
+   return Some(interrupt_time / kHNSperMS);
+ }
+ 
+-#elif defined(XP_LINUX)  // including Android
++#elif defined(OS_LINUX) || defined(XP_UNIX)  // including Android
+ #  include <time.h>
+ 
+ // Number of nanoseconds in a millisecond.
diff --git a/tor-browser/patches/patch-nsprpub_pr_src_pthreads_ptsynch.c b/tor-browser/patches/patch-nsprpub_pr_src_pthreads_ptsynch.c
new file mode 100644
index 0000000000..ee2bc6c565
--- /dev/null
+++ b/tor-browser/patches/patch-nsprpub_pr_src_pthreads_ptsynch.c
@@ -0,0 +1,110 @@
+$NetBSD: patch-nsprpub_pr_src_pthreads_ptsynch.c,v 1.1 2021/09/08 22:19:50 nia 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.
+
+--- 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;
diff --git a/tor-browser/patches/patch-security_nss_lib_freebl_mpi_mpi.c b/tor-browser/patches/patch-security_nss_lib_freebl_mpi_mpi.c
new file mode 100644
index 0000000000..fe8c5ca138
--- /dev/null
+++ b/tor-browser/patches/patch-security_nss_lib_freebl_mpi_mpi.c
@@ -0,0 +1,35 @@
+$NetBSD: patch-security_nss_lib_freebl_mpi_mpi.c,v 1.1 2021/09/08 22:19:50 nia 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;
+ 
diff --git a/tor-browser/patches/patch-toolkit_components_terminator_nsTerminator.cpp b/tor-browser/patches/patch-toolkit_components_terminator_nsTerminator.cpp
new file mode 100644
index 0000000000..f8c597aa4f
--- /dev/null
+++ b/tor-browser/patches/patch-toolkit_components_terminator_nsTerminator.cpp
@@ -0,0 +1,27 @@
+$NetBSD: patch-toolkit_components_terminator_nsTerminator.cpp,v 1.1 2021/09/08 22:19:50 nia Exp $
+
+* Fix segfault on exit under NetBSD
+
+--- toolkit/components/terminator/nsTerminator.cpp.orig	2021-04-08 21:20:12.000000000 +0000
++++ toolkit/components/terminator/nsTerminator.cpp
+@@ -37,7 +37,7 @@
+ #if defined(XP_WIN)
+ #  include <windows.h>
+ #else
+-#  include <unistd.h>
++#  include <time.h>
+ #endif
+ 
+ #include "mozilla/AppShutdown.h"
+@@ -238,7 +238,10 @@ void RunWatchdog(void* arg) {
+ #if defined(XP_WIN)
+     Sleep(1000 /* ms */);
+ #else
+-    usleep(1000000 /* usec */);
++    struct timespec tickd;
++    tickd.tv_sec = 1;
++    tickd.tv_nsec = 0;
++    nanosleep(&tickd, NULL);
+ #endif
+ 
+     // If we are still alive then we just crash.
diff --git a/tor-browser/patches/patch-toolkit_modules_subprocess_subprocess__shared__unix.js b/tor-browser/patches/patch-toolkit_modules_subprocess_subprocess__shared__unix.js
new file mode 100644
index 0000000000..cbabcf1e5f
--- /dev/null
+++ b/tor-browser/patches/patch-toolkit_modules_subprocess_subprocess__shared__unix.js
@@ -0,0 +1,26 @@
+$NetBSD: patch-toolkit_modules_subprocess_subprocess__shared__unix.js,v 1.1 2021/09/08 22:19:50 nia 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	2019-07-06 01:49:01.000000000 +0000
++++ toolkit/modules/subprocess/subprocess_shared_unix.js
+@@ -12,7 +12,15 @@
+ 
+ const 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,
diff --git a/tor-browser/patches/patch-toolkit_moz.configure b/tor-browser/patches/patch-toolkit_moz.configure
new file mode 100644
index 0000000000..895922bb55
--- /dev/null
+++ b/tor-browser/patches/patch-toolkit_moz.configure
@@ -0,0 +1,33 @@
+$NetBSD: patch-toolkit_moz.configure,v 1.5 2021/02/04 13:34:16 wiz Exp $
+
+* skia part: support bigendian architectures
+* second chunk: use bundled fonts to reduce fingerprinting possibilities
+
+--- toolkit/moz.configure.orig	2021-11-12 15:46:54.000000000 +0000
++++ toolkit/moz.configure
+@@ -940,11 +940,11 @@ set_config("MOZ_IPDL_TESTS", depends_if(
+ option("--disable-skia", help="Disable use of Skia")
+ 
+ 
+-@depends("--disable-skia")
+-def skia(value):
+-    if not value:
+-        die("--disable-skia is not supported anymore")
+-    else:
++@depends('--disable-skia', target)
++def skia(value, target):
++    if value.origin == 'default' and target.endianness == 'big':
++        return None
++    if value:
+         return True
+ 
+ 
+@@ -1581,7 +1581,7 @@ set_config(
+ 
+ @depends(target)
+ def bundled_fonts_default(target):
+-    return target.os == "WINNT" or target.kernel == "Linux"
++    return True
+ 
+ 
+ @depends(build_project)
diff --git a/tor-browser/patches/patch-toolkit_mozapps_installer_packager.mk b/tor-browser/patches/patch-toolkit_mozapps_installer_packager.mk
new file mode 100644
index 0000000000..5cdb97e9a4
--- /dev/null
+++ b/tor-browser/patches/patch-toolkit_mozapps_installer_packager.mk
@@ -0,0 +1,15 @@
+$NetBSD: patch-toolkit_mozapps_installer_packager.mk,v 1.1 2021/09/08 22:19:50 nia 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)
diff --git a/tor-browser/patches/patch-widget_gtk_DMABufSurface.cpp b/tor-browser/patches/patch-widget_gtk_DMABufSurface.cpp
new file mode 100644
index 0000000000..e1934fd2d4
--- /dev/null
+++ b/tor-browser/patches/patch-widget_gtk_DMABufSurface.cpp
@@ -0,0 +1,32 @@
+$NetBSD: patch-widget_gtk_DMABufSurface.cpp,v 1.1 2021/09/08 22:19:50 nia Exp $
+
+No eventfd on netbsd, fix build
+
+--- widget/gtk/DMABufSurface.cpp.orig	2021-04-08 21:20:12.000000000 +0000
++++ widget/gtk/DMABufSurface.cpp
+@@ -18,7 +18,9 @@
+ #include <sys/time.h>
+ #include <dlfcn.h>
+ #include <sys/mman.h>
++#ifndef __NetBSD__
+ #include <sys/eventfd.h>
++#endif
+ #include <poll.h>
+ #include <sys/ioctl.h>
+ 
+@@ -97,6 +99,7 @@ void DMABufSurface::GlobalRefAdd() {
+ }
+ 
+ void DMABufSurface::GlobalRefCountCreate() {
++#ifndef __NetBSD__
+   MOZ_ASSERT(!mGlobalRefCountFd);
+   mGlobalRefCountFd = eventfd(0, EFD_CLOEXEC | EFD_NONBLOCK | EFD_SEMAPHORE);
+   if (mGlobalRefCountFd < 0) {
+@@ -106,6 +109,7 @@ void DMABufSurface::GlobalRefCountCreate
+     mGlobalRefCountFd = 0;
+     return;
+   }
++#endif
+ }
+ 
+ void DMABufSurface::GlobalRefCountImport(int aFd) {
diff --git a/tor-browser/patches/patch-xpcom_base_nscore.h b/tor-browser/patches/patch-xpcom_base_nscore.h
new file mode 100644
index 0000000000..c9a4a45581
--- /dev/null
+++ b/tor-browser/patches/patch-xpcom_base_nscore.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-xpcom_base_nscore.h,v 1.1 2021/09/08 22:19:50 nia 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)
diff --git a/tor-browser/patches/patch-xpcom_io_TorFileUtils.cpp b/tor-browser/patches/patch-xpcom_io_TorFileUtils.cpp
new file mode 100644
index 0000000000..47a47ac38f
--- /dev/null
+++ b/tor-browser/patches/patch-xpcom_io_TorFileUtils.cpp
@@ -0,0 +1,25 @@
+$NetBSD: patch-xpcom_io_TorFileUtils.cpp,v 1.3 2020/04/28 19:38:49 wiz Exp $
+
+Set default directory for configuration files and profiles to $HOME/.tor-browser
+
+--- xpcom/io/TorFileUtils.cpp.orig	2021-11-12 15:46:54.000000000 +0000
++++ xpcom/io/TorFileUtils.cpp
+@@ -18,7 +18,17 @@ nsresult TorBrowser_GetUserDataDir(nsIFi
+   NS_ENSURE_ARG_POINTER(aFile);
+   nsCOMPtr<nsIFile> tbDataDir;
+ 
+-#ifdef TOR_BROWSER_DATA_OUTSIDE_APP_DIR
++#if defined(TOR_BROWSER_DATA_IN_HOME_DIR)
++  const char *homeDir = getenv("HOME");
++  if (!homeDir || !*homeDir)
++    return NS_ERROR_FAILURE;
++  nsresult rv = NS_NewNativeLocalFile(nsDependentCString(homeDir), true,
++                                      getter_AddRefs(tbDataDir));
++  NS_ENSURE_SUCCESS(rv, rv);
++  nsAutoCString leafSubdir(".tor-browser");
++  rv = tbDataDir->AppendNative(leafSubdir);
++  NS_ENSURE_SUCCESS(rv, rv);
++#elif TOR_BROWSER_DATA_OUTSIDE_APP_DIR
+   nsAutoCString tbDataLeafName("TorBrowser-Data"_ns);
+   nsCOMPtr<nsIFile> appRootDir;
+   nsresult rv = GetAppRootDir(aExeFile, getter_AddRefs(appRootDir));
diff --git a/tor-browser/patches/patch-xpcom_reflect_xptcall_md_unix_moz.build b/tor-browser/patches/patch-xpcom_reflect_xptcall_md_unix_moz.build
new file mode 100644
index 0000000000..9e7d31bf96
--- /dev/null
+++ b/tor-browser/patches/patch-xpcom_reflect_xptcall_md_unix_moz.build
@@ -0,0 +1,15 @@
+$NetBSD: patch-xpcom_reflect_xptcall_md_unix_moz.build,v 1.1 2021/09/08 22:19:50 nia Exp $
+
+Make NetBSD/sparc64 use the same xptcall bindings as all other sparc64 ports
+
+--- 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