diff --git a/www/tor-browser/Makefile b/www/tor-browser/Makefile index 8a3e221a5214..dc17a4db1534 100644 --- a/www/tor-browser/Makefile +++ b/www/tor-browser/Makefile @@ -1,183 +1,183 @@ PORTNAME= tor-browser -DISTVERSION= 15.0.3 +DISTVERSION= 16.0a1 CATEGORIES= www net security wayland -TAG_BASE= dff70d135408cfc24931c170efa91fbaded19914 -TAG_TOR= ca310e42296a7085ea59fc323592f3dc702123ac +TAG_BASE= d366318349af0977ff23b492fa87e436e8672fdd +TAG_TOR= 45b67d3be52f79e8a4b361fd04ab12f342ab0016 MASTER_SITES= TOR \ LOCAL/vvd \ https://build-sources.tbb.torproject.org/:source1 \ LOCAL/vvd:source1 \ LOCAL/jsm:source2 \ LOCAL/vvd:source2 \ - https://secure.informaction.com/download/releases/:source3 \ + https://dist.torproject.org/torbrowser/noscript/:source3 \ LOCAL/vvd:source3 \ https://gitlab.torproject.org/tpo/translation/-/archive/${TAG_BASE}.tar.gz?dummy=/:source4 \ LOCAL/vvd:source4 \ https://gitlab.torproject.org/tpo/translation/-/archive/${TAG_TOR}.tar.gz?dummy=/:source5 \ LOCAL/vvd:source5 MASTER_SITE_SUBDIR= torbrowser/${DISTVERSION}/:DEFAULT \ download/releases/:source3 -DISTNAME= src-firefox-tor-browser-140.6.0esr-15.0-1-build5 +DISTNAME= src-firefox-tor-browser-146.0a1-16.0-2-build2 MANUAL= manual_215922.zip -NOSCRIPT= noscript-13.5.2.xpi +NOSCRIPT= noscript-13.5.4.1984.xpi DISTFILES= ${DISTNAME}.tar.xz \ ${MANUAL}:source1 \ fonts-3--4348e1.tar.zst:source2 \ ${NOSCRIPT}:source3 \ tpo-translation-${TAG_BASE}_GL0.tar.gz:source4 \ tpo-translation-${TAG_TOR}_GL0.tar.gz:source5 MAINTAINER= freebsd@sysctl.cz COMMENT= Tor Browser for FreeBSD WWW= https://www.torproject.org/ LICENSE= MPL20 LICENSE_FILE= ${WRKSRC}/LICENSE BUILD_DEPENDS= nspr>=4.32:devel/nspr \ nss>=3.112:security/nss \ icu>=76.1:devel/icu \ libevent>=2.1.8:devel/libevent \ harfbuzz>=10.1.0:print/harfbuzz \ graphite2>=1.3.14:graphics/graphite2 \ png>=1.6.45:graphics/png \ dav1d>=1.0.0:multimedia/dav1d \ libvpx>=1.14:multimedia/libvpx \ ${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR} \ v4l_compat>0:multimedia/v4l_compat \ autoconf2.13:devel/autoconf2.13 \ nasm:devel/nasm \ yasm:devel/yasm RUN_DEPENDS= tor:security/tor \ obfs4proxy:security/obfs4proxy-tor \ snowflake-client:security/snowflake-tor USES= compiler:c++11-lib libtool localbase:ldflags perl5 pkgconfig \ python shebangfix tar:xz USE_GECKO= gecko USE_GITHUB= nodefault -TAG_L10N= 412690f1368e37f70af57eecabb93497167eb9ba +TAG_L10N= 4b41b2ae00d50633e5e9d8204b0f45e468920743 GH_TUPLE= mozilla-l10n:firefox-l10n:${TAG_L10N}:ffl10n USE_MOZILLA= -sqlite LOCALES= af ar az be bg bs ca cs da de el es-ES et fa fi fr ga-IE gu-IN \ he hi-IN hr hu hy-AM id is it ja ka km ko lt lv mk mr ms my \ nb-NO nl nn-NO pa-IN pl pt-BR pt-PT ro ru sk sl sq sr sv-SE ta \ te th tl tr uk ur vi zh-CN zh-TW CONFIGURE_ENV+= BINDGEN_CFLAGS="-I${LOCALBASE}/include" CONFIGURE_ENV+= MOZ_CHROME_MULTILOCALE="${LOCALES}" MAKE_ENV+= LOCALES="${LOCALES}" CFLAGS_powerpc64le= -DSQLITE_BYTEORDER=1234 SSP_UNSAFE= yes BUNDLE_LIBS= yes SUB_FILES= fonts.conf tor-browser.desktop torrc-defaults WRKSRC= ${WRKDIR}/${DISTNAME:S/src-//} MOZ_EXPORT= MOZ_TELEMETRY_REPORTING="" \ MOZILLA_OFFICIAL="1" \ MOZ_OFFICIAL_BRANDING="1" \ MOZ_APP_DISPLAYNAME="Tor Browser" \ MOZ_APP_NAME="tor-browser" \ MOZ_CHROME_MULTILOCALE="${LOCALES}" MOZ_OPTIONS= --with-base-browser-version=${DISTVERSION} \ --enable-official-branding \ --enable-optimize \ --enable-bundled-fonts \ --disable-tests \ --disable-debug \ --disable-crashreporter \ --disable-webrtc \ --disable-parental-controls \ --enable-proxy-bypass-protection \ --disable-system-policies \ --disable-backgroundtasks \ --with-distribution-id=org.torproject \ --with-branding=browser/branding/tb-release .include "${.CURDIR}/../../www/firefox/Makefile.options" .include .if ${ARCH} == i386 && ${MACHINE_CPU:Msse2} # is not enabled on i386 by default # Fix for error: always_inline function '_mm_setzero_si64' requires target feature 'sse2' CFLAGS_i386+= -msse2 .endif .if ${ARCH} == amd64 MOZ_OPTIONS+= --enable-rust-simd .endif .if ${ARCH} == powerpc64 MOZ_OPTIONS+= --without-wasm-sandboxed-libraries .else BUILD_DEPENDS+= ${LOCALBASE}/share/wasi-sysroot/lib/wasm32-wasi/libc++abi.a:devel/wasi-libcxx${LLVM_VERSION} \ ${LOCALBASE}/share/wasi-sysroot/lib/wasm32-wasi/libc.a:devel/wasi-libc@${LLVM_VERSION} \ wasi-compiler-rt${LLVM_VERSION}>0:devel/wasi-compiler-rt${LLVM_VERSION} MOZILLA_PLIST_DIRS= bin lib share/applications share/pixmaps \ share/tor-browser MOZ_OPTIONS+= --with-wasi-sysroot=${LOCALBASE}/share/wasi-sysroot .endif post-patch: @${REINPLACE_CMD} 's|LOCALBASE|${LOCALBASE}|g' \ "${WRKSRC}/browser/app/profile/000-tor-browser.js" @${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|g' \ ${WRKSRC}/browser/app/nsBrowserApp.cpp ${MKDIR} ${WRKSRC}/tmp-manual ${UNZIP_NATIVE_CMD} -d ${WRKSRC}/tmp-manual ${DISTDIR}/${MANUAL} pre-configure: @${REINPLACE_CMD} 's|export MOZ_GOOGLE_.*||g' ${WRKSRC}/.mozconfig ${PYTHON_CMD} ${FILESDIR}/packagemanual.py ${WRKSRC}/tmp-manual/public \ ${WRKSRC}/browser/base/content/manual post-configure: ${MKDIR} ${WRKDIR}/.mozbuild/l10n-central ${CP} -r ${WRKDIR}/firefox-l10n-${TAG_L10N}/* \ ${WRKDIR}/.mozbuild/l10n-central .for i in ${LOCALES} ${CP} ${WRKDIR}/translation-${TAG_BASE}/${i}/base-browser.ftl \ ${WRKDIR}/.mozbuild/l10n-central/${i}/toolkit/toolkit/global/ ${CP} ${WRKDIR}/translation-${TAG_TOR}/${i}/tor-browser.ftl \ ${WRKDIR}/.mozbuild/l10n-central/${i}/toolkit/toolkit/global/ ${MKDIR} ${WRKDIR}/.mozbuild/l10n-central/${i}/browser/branding/tb-release \ ${WRKSRC}/toolkit/torbutton/chrome/locale/${i} ${CP} ${WRKDIR}/translation-${TAG_TOR}/${i}/brand.properties \ ${WRKDIR}/translation-${TAG_TOR}/${i}/branding/brand.ftl \ ${WRKDIR}/.mozbuild/l10n-central/${i}/browser/branding/tb-release . for j in onionLocation.properties settings.properties torConnect.properties \ torlauncher.properties ${CP} ${WRKDIR}/translation-${TAG_TOR}/${i}/${j} \ ${WRKSRC}/toolkit/torbutton/chrome/locale/${i}/ . endfor ${CP} -r ${WRKDIR}/translation-${TAG_TOR}/${i}/branding \ ${WRKSRC}/toolkit/torbutton/chrome/locale/${i}/ .endfor post-build: MOZBUILD_STATE_PATH=${WRKDIR}/.mozbuild AB_CD="multi" MOZ_AUTOMATION="1" \ PATH="`find ${WRKRDIR}/.mozbuild/srcdirs -name build -type d -print`/bin:${PATH}" \ ${WRKSRC}/mach package-multi-locale --locales ${LOCALES} post-install: ${MKDIR} ${STAGEDIR}${DATADIR} \ ${STAGEDIR}${PREFIX}/lib/tor-browser/fontconfig \ ${STAGEDIR}${PREFIX}/lib/tor-browser/fonts \ ${STAGEDIR}${PREFIX}/lib/tor-browser/distribution/extensions ${INSTALL_DATA} ${WRKDIR}/torrc-defaults \ ${STAGEDIR}${DATADIR}/torrc-defaults ${INSTALL_DATA} ${WRKDIR}/tor-browser.desktop ${STAGEDIR}${DESKTOPDIR} ${INSTALL_DATA} ${WRKDIR}/fonts.conf \ ${STAGEDIR}${PREFIX}/lib/tor-browser/fontconfig/fonts.conf (cd ${WRKDIR}/fonts && \ ${COPYTREE_SHARE} "*.otf *.ttf" ${STAGEDIR}${PREFIX}/lib/tor-browser/fonts) ${INSTALL_DATA} ${DISTDIR}/${NOSCRIPT} \ "${STAGEDIR}${PREFIX}/lib/tor-browser/distribution/extensions/{73a6fe31-595d-460b-a920-fcc0f8843232}.xpi" .include diff --git a/www/tor-browser/distinfo b/www/tor-browser/distinfo index 8a8a9fa683fd..9dc1dc197464 100644 --- a/www/tor-browser/distinfo +++ b/www/tor-browser/distinfo @@ -1,15 +1,15 @@ -TIMESTAMP = 1765298059 -SHA256 (src-firefox-tor-browser-140.6.0esr-15.0-1-build5.tar.xz) = 5aeaf4ae95002273d5be947c55f0abe6c509305ea676933778b5696dbf17fb06 -SIZE (src-firefox-tor-browser-140.6.0esr-15.0-1-build5.tar.xz) = 693406452 +TIMESTAMP = 1765909794 +SHA256 (src-firefox-tor-browser-146.0a1-16.0-2-build2.tar.xz) = 669e5cc998224f1ba1624cade95d4344615f8cdd21066f1b6ad44c9025e1fb67 +SIZE (src-firefox-tor-browser-146.0a1-16.0-2-build2.tar.xz) = 704013880 SHA256 (manual_215922.zip) = b5ed703f54d52e9f197320f3698e936d585a3fed23cc4f9fbf59edce2869f885 SIZE (manual_215922.zip) = 28305786 SHA256 (fonts-3--4348e1.tar.zst) = 7fbbecece6de777f196982f6eb567970a6d8e7ac2bf5b1ad6b90e1ea36374032 SIZE (fonts-3--4348e1.tar.zst) = 27441580 -SHA256 (noscript-13.5.2.xpi) = 1ba8ee4620b19502e4d95c5a3ea0520856028365ff9a6561882d914aa3968e2a -SIZE (noscript-13.5.2.xpi) = 1049291 -SHA256 (tpo-translation-dff70d135408cfc24931c170efa91fbaded19914_GL0.tar.gz) = caceab3ddbb4b7a0e7b85d0fd8e67023473e746e8d5c5caf18b7f97cd0abb3c5 -SIZE (tpo-translation-dff70d135408cfc24931c170efa91fbaded19914_GL0.tar.gz) = 1022345 -SHA256 (tpo-translation-ca310e42296a7085ea59fc323592f3dc702123ac_GL0.tar.gz) = 0af26f717359fdd1ed951d6376e6e350641acf5ee5f4bf28316108caff3086dd -SIZE (tpo-translation-ca310e42296a7085ea59fc323592f3dc702123ac_GL0.tar.gz) = 2904329 -SHA256 (mozilla-l10n-firefox-l10n-412690f1368e37f70af57eecabb93497167eb9ba_GH0.tar.gz) = f4d29be04a7f29934b772988e0a677f8a15ce7d6c131d6e3232642168742fb4a -SIZE (mozilla-l10n-firefox-l10n-412690f1368e37f70af57eecabb93497167eb9ba_GH0.tar.gz) = 72166951 +SHA256 (noscript-13.5.4.1984.xpi) = ce83b75d2d6c15c3ffbab412dddbb26ddf55977aacd2ba8f99301b9a0b1766f1 +SIZE (noscript-13.5.4.1984.xpi) = 1049081 +SHA256 (tpo-translation-d366318349af0977ff23b492fa87e436e8672fdd_GL0.tar.gz) = 190fe79bc223db676cd6d405adddeb8ef16175e13de806d1daff04ec06aeabce +SIZE (tpo-translation-d366318349af0977ff23b492fa87e436e8672fdd_GL0.tar.gz) = 1024797 +SHA256 (tpo-translation-45b67d3be52f79e8a4b361fd04ab12f342ab0016_GL0.tar.gz) = 1474e0c3bbfdc50cd0930fb941677ee45a35d5bfd84a1876464c194a49b243fa +SIZE (tpo-translation-45b67d3be52f79e8a4b361fd04ab12f342ab0016_GL0.tar.gz) = 2901730 +SHA256 (mozilla-l10n-firefox-l10n-4b41b2ae00d50633e5e9d8204b0f45e468920743_GH0.tar.gz) = cdd9341832325d24067bf752250e52e61035b762066c7cb0b4dde2b6c4b951d2 +SIZE (mozilla-l10n-firefox-l10n-4b41b2ae00d50633e5e9d8204b0f45e468920743_GH0.tar.gz) = 72440248 diff --git a/www/tor-browser/files/patch-bug1876632 b/www/tor-browser/files/patch-bug1876632 deleted file mode 100644 index 3932b1deccc9..000000000000 --- a/www/tor-browser/files/patch-bug1876632 +++ /dev/null @@ -1,35 +0,0 @@ -commit 4f531ca86d24be5d4de673f6e652ed899151d20c -Author: Jesper Schmitz Mouridsen -Date: Wed Jul 23 22:01:31 2025 +0000 - - Bug 1876632 Fix aslr allocations on FreeBSD r=spidermonkey-reviewers,sfink - - Without the alignment flag the desired address - gets randomized by aslr in a way which causes it to not - be aligned. Furthermore the TryToAlignChunk almost always - fails. With this fix it never gets to TryToAlignChunk - because the flag guarantees upfront alignment. - - Differential Revision: https://phabricator.services.mozilla.com/D257824 - -diff --git js/src/gc/Memory.cpp js/src/gc/Memory.cpp -index e790f1784ede..13639c9a6eb4 100644 ---- js/src/gc/Memory.cpp -+++ js/src/gc/Memory.cpp -@@ -608,7 +608,16 @@ static void* MapAlignedPagesRandom(size_t length, size_t alignment) { - for (size_t i = 1; i <= 1024; ++i) { - if (i & 0xf) { - uint64_t desired = alignment * GetNumberInRange(minNum, maxNum); -+# if defined(__FreeBSD__) && defined(__aarch64__) -+ int flags = MAP_PRIVATE | MAP_ANON | -+ MAP_ALIGNED(mozilla::CeilingLog2Size(alignment)); -+ region = MozTaggedAnonymousMmap((void*)(uintptr_t)desired, length, -+ int(PageAccess::ReadWrite), flags, -1, 0, -+ "js-gc-heap"); -+# else - region = MapMemoryAtFuzzy(reinterpret_cast(desired), length); -+ -+# endif - if (!region) { - continue; - } diff --git a/www/tor-browser/files/patch-build_gn__processor.py b/www/tor-browser/files/patch-build_gn__processor.py index be5e10347483..08e7f1211613 100644 --- a/www/tor-browser/files/patch-build_gn__processor.py +++ b/www/tor-browser/files/patch-build_gn__processor.py @@ -1,49 +1,49 @@ -commit 0e5bcbefae64b35a5c8df360e3980258a565fa72 -Author: Christoph Moench-Tegeder +commit bcf74d8c7a315c4f8ef70f1a60d4ce957cebac1d +Author: Christoph Moench-Tegeder - chase gn_processor.py move + FreeBSD workings for webrtc configure (gn_processor.py) diff --git build/gn_processor.py build/gn_processor.py -index 2ba8b92c2751..91170efb9a5d 100644 +index 36cc6bdfe492..ed0fb2b7aa45 100644 --- build/gn_processor.py +++ build/gn_processor.py @@ -186,6 +186,7 @@ def filter_gn_config(path, gn_result, sandbox_vars, input_vars, gn_target): } oses = { "android": "Android", + "freebsd": "FreeBSD", "linux": "Linux", "mac": "Darwin", "openbsd": "OpenBSD", -@@ -780,17 +781,17 @@ def main(): +@@ -801,17 +802,17 @@ def main(): vars_set = [] for is_debug in (True, False): - for target_os in ("android", "linux", "mac", "openbsd", "win"): + for target_os in ("freebsd",): target_cpus = ["x64"] - if target_os in ("android", "linux", "mac", "win", "openbsd"): + if target_os in ("android", "freebsd", "linux", "mac", "win", "openbsd"): target_cpus.append("arm64") if target_os in ("android", "linux"): target_cpus.append("arm") - if target_os in ("android", "linux", "win"): + if target_os in ("android", "freebsd", "linux", "win"): target_cpus.append("x86") - if target_os in ("linux", "openbsd"): + if target_os in ("freebsd", "linux", "openbsd"): target_cpus.append("riscv64") - if target_os == "linux": + if target_os in ("freebsd", "linux"): target_cpus.extend(["loong64", "ppc64", "mipsel", "mips64el"]) for target_cpu in target_cpus: vars = { -@@ -799,7 +800,7 @@ def main(): +@@ -820,7 +821,7 @@ def main(): "target_cpu": target_cpu, "target_os": target_os, } - if target_os == "linux": + if target_os in ("freebsd", "linux"): - for use_x11 in (True, False): - vars["use_x11"] = use_x11 + for enable_x11 in (True, False): + vars["ozone_platform_x11"] = enable_x11 vars_set.append(vars.copy()) diff --git a/www/tor-browser/files/patch-dom_media_webrtc_libwebrtc__overrides_moz.build b/www/tor-browser/files/patch-dom_media_webrtc_libwebrtc__overrides_moz.build new file mode 100644 index 000000000000..ac01cff0e211 --- /dev/null +++ b/www/tor-browser/files/patch-dom_media_webrtc_libwebrtc__overrides_moz.build @@ -0,0 +1,25 @@ +commit 18ea032974539d7f4db64d21a87fd174333b9e2c +Author: Christoph Moench-Tegeder + + build XErrorTrap for FreeBSD, too + +diff --git dom/media/webrtc/libwebrtc_overrides/moz.build dom/media/webrtc/libwebrtc_overrides/moz.build +index ed9c450e5649..1ac213e48b28 100644 +--- dom/media/webrtc/libwebrtc_overrides/moz.build ++++ dom/media/webrtc/libwebrtc_overrides/moz.build +@@ -49,13 +49,13 @@ + "call/call_basic_stats.cc", + ] + +-if CONFIG["OS_TARGET"] == "OpenBSD": ++if CONFIG["OS_TARGET"] in ("FreeBSD", "OpenBSD"): + CXXFLAGS += CONFIG["MOZ_X11_CFLAGS"] + UNIFIED_SOURCES += [ + "modules/desktop_capture/linux/x11/x_error_trap.cc", + ] + +-if CONFIG["TARGET_CPU"] in ("loongarch64", "ppc64"): ++if CONFIG["TARGET_CPU"] in ("loongarch64"): + UNIFIED_SOURCES += [ + "modules/desktop_capture/linux/x11/x_error_trap.cc", + ] diff --git a/www/tor-browser/files/patch-python_sites_mach.txt b/www/tor-browser/files/patch-python_sites_mach.txt index dc2caf9bdfc6..706f285b0731 100644 --- a/www/tor-browser/files/patch-python_sites_mach.txt +++ b/www/tor-browser/files/patch-python_sites_mach.txt @@ -1,18 +1,18 @@ commit 10ee367cbe7ff5a19acfcfe3bfb75a49671e4132 Author: Christoph Moench-Tegeder bump psutil (same as ports) 5.9.x breaks mach diff --git python/sites/mach.txt python/sites/mach.txt index 6e3db1c848f7..10ba12c2f13b 100644 --- python/sites/mach.txt +++ python/sites/mach.txt @@ -108,5 +108,5 @@ pypi-optional:glean-sdk==63.1.0:telemetry will not be collected # Mach gracefully handles the case where `psutil` is unavailable. # We aren't (yet) able to pin packages in automation, so we have to # support down to the oldest locally-installed version (5.4.2). -pypi-optional:psutil>=5.4.2,<=5.9.4:telemetry will be missing some data +pypi-optional:psutil>=5.4.2,<=7.0.0:telemetry will be missing some data - pypi-optional:zstandard>=0.11.1,<=0.23.0:zstd archives will not be possible to extract + pypi-optional:zstandard>=0.11.1,<=0.24.0:zstd archives will not be possible to extract diff --git a/www/tor-browser/files/patch-third__party_chromium_build_toolchain_toolchain.gni b/www/tor-browser/files/patch-third__party_chromium_build_toolchain_toolchain.gni new file mode 100644 index 000000000000..7cfd8c79d2da --- /dev/null +++ b/www/tor-browser/files/patch-third__party_chromium_build_toolchain_toolchain.gni @@ -0,0 +1,18 @@ +commit 66fb0f122ef1ddf961b333c8377b84b603d75b27 +Author: Christoph Moench-Tegeder + + support FreeBSD as a host platform + +diff --git third_party/chromium/build/toolchain/toolchain.gni third_party/chromium/build/toolchain/toolchain.gni +index 754f0e3bbd7e..238d79631ba8 100644 +--- third_party/chromium/build/toolchain/toolchain.gni ++++ third_party/chromium/build/toolchain/toolchain.gni +@@ -75,7 +75,7 @@ if (host_os == "mac") { + host_shlib_extension = ".dylib" + } else if (host_os == "win") { + host_shlib_extension = ".dll" +-} else if (host_os == "linux" || host_os == "aix" || host_os == "zos") { ++} else if (host_os == "linux" || host_os == "aix" || host_os == "freebsd" || host_os == "zos") { + host_shlib_extension = ".so" + } else { + assert(false, "Host platform not supported") diff --git a/www/tor-browser/files/patch-third__party_libwebrtc_build_config_BUILDCONFIG.gn b/www/tor-browser/files/patch-third__party_libwebrtc_build_config_BUILDCONFIG.gn index e4607283ebcf..7774855c7941 100644 --- a/www/tor-browser/files/patch-third__party_libwebrtc_build_config_BUILDCONFIG.gn +++ b/www/tor-browser/files/patch-third__party_libwebrtc_build_config_BUILDCONFIG.gn @@ -1,132 +1,141 @@ -commit da40b474fba2247ffc07696a2c565d830e900c9c +commit e8a3b91abdc00edd7633aabbe5e63bfc0d0825e4 Author: Christoph Moench-Tegeder enable pipewire on bsd diff --git third_party/chromium/build/config/BUILDCONFIG.gn third_party/chromium/build/config/BUILDCONFIG.gn -index 889bdb92354c..ccda96d998c5 100644 +index 4bb38fe31ff2..b10eb19f521a 100644 --- third_party/chromium/build/config/BUILDCONFIG.gn +++ third_party/chromium/build/config/BUILDCONFIG.gn -@@ -132,6 +132,7 @@ declare_args() { +@@ -137,6 +137,7 @@ declare_args() { # Set to true when compiling with the Clang compiler. is_clang = current_os != "linux" || current_os == "openbsd" || + current_os == "freebsd" || (current_cpu != "s390x" && current_cpu != "s390" && current_cpu != "ppc64" && current_cpu != "ppc" && current_cpu != "mips" && current_cpu != "mips64" && -@@ -184,7 +185,7 @@ if (host_toolchain == "") { +@@ -206,7 +207,7 @@ if (host_toolchain == "") { # TODO(dpranke): Add some sort of assert here that verifies that # no toolchain omitted host_toolchain from its toolchain_args(). - if (host_os == "linux" || host_os == "openbsd") { + if (host_os == "linux" || host_os == "openbsd" || host_os == "freebsd") { if (target_os != "linux") { host_toolchain = "//chromium/build/toolchain/linux:clang_$host_cpu" } else if (is_clang) { -@@ -222,7 +223,7 @@ if (target_os == "android") { - assert(host_os == "linux" || host_os == "mac", - "Android builds are only supported on Linux and Mac hosts.") +@@ -246,7 +247,7 @@ if (target_os == "android") { + # Targeting android on Mac is best-effort and not guaranteed to work. + #assert(host_os == "linux", "Android builds are only supported on Linux.") _default_toolchain = "//chromium/build/toolchain/android:android_clang_$target_cpu" -} else if (target_os == "chromeos" || target_os == "linux" || target_os == "openbsd") { +} else if (target_os == "chromeos" || target_os == "linux" || target_os == "openbsd" || target_os == "freebsd") { # See comments in build/toolchain/cros/BUILD.gn about board compiles. if (is_clang) { _default_toolchain = "//chromium/build/toolchain/linux:clang_$target_cpu" -@@ -288,7 +289,7 @@ is_chromeos = current_os == "chromeos" +@@ -314,7 +315,7 @@ is_chromeos = current_os == "chromeos" is_fuchsia = current_os == "fuchsia" is_ios = current_os == "ios" is_linux = current_os == "linux" -is_bsd = current_os == "openbsd" +is_bsd = current_os == "openbsd" || current_os == "freebsd" is_mac = current_os == "mac" is_nacl = current_os == "nacl" - is_win = current_os == "win" || current_os == "winuwp" + is_wasm = current_os == "emscripten" diff --git third_party/libwebrtc/BUILD.gn third_party/libwebrtc/BUILD.gn -index 397df7b27b24..8a587feed6b9 100644 +index ac8569efaa40..5d6c5953491c 100644 --- third_party/libwebrtc/BUILD.gn +++ third_party/libwebrtc/BUILD.gn -@@ -107,7 +107,7 @@ if (!build_with_chromium && !build_with_mozilla) { +@@ -111,7 +111,7 @@ if (!build_with_chromium && !build_with_mozilla) { "tools_webrtc/perf:webrtc_dashboard_upload", ] } - if ((is_linux || is_chromeos) && rtc_use_pipewire) { + if ((is_linux || is_chromeos || is_bsd) && rtc_use_pipewire) { deps += [ "modules/desktop_capture:shared_screencast_stream_test" ] } } diff --git third_party/libwebrtc/modules/desktop_capture/BUILD.gn third_party/libwebrtc/modules/desktop_capture/BUILD.gn -index de00f688871c..e32c19d38c8d 100644 +index 5c843cfc2b6a..0ed9f98a964f 100644 --- third_party/libwebrtc/modules/desktop_capture/BUILD.gn +++ third_party/libwebrtc/modules/desktop_capture/BUILD.gn -@@ -74,7 +74,7 @@ if (rtc_include_tests) { +@@ -76,7 +76,7 @@ if (rtc_include_tests) { "window_finder_unittest.cc", ] - if ((is_linux || is_chromeos) && rtc_use_pipewire) { + if ((is_linux || is_chromeos || is_bsd) && rtc_use_pipewire) { configs += [ "../portal:gio" ] } -@@ -86,7 +86,7 @@ if (rtc_include_tests) { +@@ -88,7 +88,7 @@ if (rtc_include_tests) { } } - if ((is_linux || is_chromeos) && rtc_use_pipewire) { + if ((is_linux || is_chromeos || is_bsd) && rtc_use_pipewire) { rtc_test("shared_screencast_stream_test") { testonly = true -@@ -145,7 +145,7 @@ if (rtc_include_tests) { +@@ -148,7 +148,7 @@ if (rtc_include_tests) { "test_utils_unittest.cc", ] - if ((is_linux || is_chromeos) && rtc_use_pipewire) { + if ((is_linux || is_chromeos || is_bsd) && rtc_use_pipewire) { configs += [ "../portal:gio" ] } +@@ -215,7 +215,7 @@ if (rtc_include_tests) { + "screen_drawer.h", + ] + +- if (is_linux || is_chromeos) { ++ if (is_linux || is_chromeos || is_bsd) { + sources += [ "screen_drawer_linux.cc" ] + libs = [ "X11" ] + } +@@ -254,7 +254,7 @@ if (rtc_include_tests) { + "mock_desktop_capturer_callback.h", + ] + +- if ((is_linux || is_chromeos) && rtc_use_pipewire) { ++ if ((is_linux || is_chromeos || us_bsd) && rtc_use_pipewire) { + configs += [ "../portal:gio" ] + } + @@ -267,7 +267,7 @@ if (rtc_include_tests) { } # TODO(bugs.webrtc.org/14187): remove when all users are gone -if ((is_linux || is_chromeos) && rtc_use_pipewire) { +if ((is_linux || is_chromeos || is_bsd) && rtc_use_pipewire) { config("pipewire_config") { configs = [ "../portal:pipewire_config" ] } -@@ -330,7 +330,7 @@ rtc_library("desktop_capture") { - "window_finder.cc", - "window_finder.h", - ] -- if (is_linux && !is_castos && rtc_use_pipewire) { -+ if ((is_linux || is_bsd) && !is_castos && rtc_use_pipewire) { - sources += [ "desktop_capture_metadata.h" ] - } - if (is_mac) { diff --git third_party/libwebrtc/modules/portal/BUILD.gn third_party/libwebrtc/modules/portal/BUILD.gn -index 6828388b31af..7e1857d861c5 100644 +index 70b4739ad0c4..99ab95d441f3 100644 --- third_party/libwebrtc/modules/portal/BUILD.gn +++ third_party/libwebrtc/modules/portal/BUILD.gn @@ -10,7 +10,7 @@ import("//chromium/build/config/linux/pkg_config.gni") import("//tools/generate_stubs/rules.gni") import("../../webrtc.gni") -if ((is_linux || is_chromeos) && rtc_use_pipewire) { +if ((is_linux || is_chromeos || is_bsd) && rtc_use_pipewire) { if (!build_with_mozilla) { pkg_config("gio") { packages = [ diff --git third_party/libwebrtc/webrtc.gni third_party/libwebrtc/webrtc.gni -index 58b450cbb16e..00b9ca49c71f 100644 +index 1e87de20e545..77a8a55d8659 100644 --- third_party/libwebrtc/webrtc.gni +++ third_party/libwebrtc/webrtc.gni -@@ -154,7 +154,7 @@ declare_args() { +@@ -151,7 +151,7 @@ declare_args() { # By default it's only enabled on desktop Linux (excludes ChromeOS) and # only when using the sysroot as PipeWire is not available in older and # supported Ubuntu and Debian distributions. - rtc_use_pipewire = is_linux && use_sysroot + rtc_use_pipewire = (is_linux || is_bsd) && use_sysroot # Set this to link PipeWire and required libraries directly instead of using the dlopen. rtc_link_pipewire = false diff --git a/www/tor-browser/files/patch-third__party_libwebrtc_modules_desktop__capture_linux_wayland__egl__dmabuf.cc b/www/tor-browser/files/patch-third__party_libwebrtc_modules_desktop__capture_linux_wayland__egl__dmabuf.cc index e83c56760a7c..13a23c835960 100644 --- a/www/tor-browser/files/patch-third__party_libwebrtc_modules_desktop__capture_linux_wayland__egl__dmabuf.cc +++ b/www/tor-browser/files/patch-third__party_libwebrtc_modules_desktop__capture_linux_wayland__egl__dmabuf.cc @@ -1,26 +1,19 @@ -commit 3524023ca1d2184ab9a5a7cc61695923e6834cc1 -Author: Christoph Moench-Tegeder +commit f53507857647459d4a48935901f80f27a5ae58a9 +Author: Christoph Moench-Tegeder avoid linux-only includes diff --git third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc -index 6a019c64b4b3..18bb43d797dd 100644 +index 821fdfb487b7..e000c1c104fe 100644 --- third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc +++ third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc -@@ -10,12 +10,16 @@ - - #include "modules/desktop_capture/linux/wayland/egl_dmabuf.h" - +@@ -15,7 +15,9 @@ + #include + #include + #include +#if !defined(__FreeBSD__) #include +#endif #include #include - #include - #include -+#if !defined(__FreeBSD__) - #include -+#endif - #include - #include - #include + #include diff --git a/www/tor-browser/files/patch-third__party_libwebrtc_modules_portal_pipewire__utils.h b/www/tor-browser/files/patch-third__party_libwebrtc_modules_portal_pipewire__utils.h new file mode 100644 index 000000000000..14ed30920d6a --- /dev/null +++ b/www/tor-browser/files/patch-third__party_libwebrtc_modules_portal_pipewire__utils.h @@ -0,0 +1,19 @@ +commit 9f34111f6f4e2ebefd878a3c256fc012826e6936 +Author: Christoph Moench-Tegeder + + FreeBSD does not know asm-generic/ioctl.h + +diff --git third_party/libwebrtc/modules/portal/pipewire_utils.h third_party/libwebrtc/modules/portal/pipewire_utils.h +index c3d4f347a8cd..14a36260c292 100644 +--- third_party/libwebrtc/modules/portal/pipewire_utils.h ++++ third_party/libwebrtc/modules/portal/pipewire_utils.h +@@ -11,7 +11,9 @@ + #ifndef MODULES_PORTAL_PIPEWIRE_UTILS_H_ + #define MODULES_PORTAL_PIPEWIRE_UTILS_H_ + ++#if !defined(__FreeBSD__) + #include ++#endif + #include + #include +