diff --git a/www/tor-browser/Makefile b/www/tor-browser/Makefile index a8c42904445f..40358f41ab31 100644 --- a/www/tor-browser/Makefile +++ b/www/tor-browser/Makefile @@ -1,125 +1,125 @@ PORTNAME= tor-browser -DISTVERSION= 13.0.14 +DISTVERSION= 13.5a7 CATEGORIES= www net security wayland MASTER_SITES= TOR \ https://build-sources.tbb.torproject.org/:source1 \ LOCAL/jsm:source2 MASTER_SITE_SUBDIR= torbrowser/${DISTVERSION} -DISTNAME= src-firefox-tor-browser-115.10.0esr-13.0-1-build1 +DISTNAME= src-firefox-tor-browser-115.10.0esr-13.5-1-build2 DISTFILES= ${DISTNAME}.tar.xz \ manual_112141.zip:source1 \ firefox-tor-browser-13.0.1-build2-firefox-1l0n-out.tar:source2 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.94:security/nss \ icu>=73.1:devel/icu \ libevent>=2.1.8:devel/libevent \ harfbuzz>=8.2.2:print/harfbuzz \ graphite2>=1.3.14:graphics/graphite2 \ png>=1.6.39:graphics/png \ dav1d>=1.0.0:multimedia/dav1d \ libvpx>=1.13.1: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 \ zip:archivers/zip USE_GITLAB=nodefault GL_SITE= https://gitlab.torproject.org/ GL_ACCOUNT= tpo GL_PROJECT= translation:basebrowser translation:torbrowser GL_TAGNAME= 3faf7dcd545109f7bbd8a6374838e139ca422d6c:basebrowser 51bc08246d73990d461f747fb3c8cc7b6f66c1f4:torbrowser RUN_DEPENDS= tor:security/tor \ obfs4proxy:security/obfs4proxy-tor USES= compiler:c++11-lib libtool \ perl5 pkgconfig python shebangfix localbase:ldflags tar:xz python:3 USE_GECKO= gecko SSP_UNSAFE= yes SUB_FILES= torrc-defaults tor-browser.desktop BUNDLE_LIBS= yes USE_MOZILLA= -sqlite MOZILLA_VER=115.4.0 CFLAGS_powerpc64le= -DSQLITE_BYTEORDER=1234 CONFIGURE_ENV+= BINDGEN_CFLAGS="-I${LOCALBASE}/include" \ MOZ_CHROME_MULTILOCALE="ar ca cs da de el es-ES fa fi fr ga-IE he hu id is it ja ka ko lt mk ms my nb-NO nl pl pt-BR ro ru sq sv-SE th tr uk vi zh-CN zh-TW en-US" MAKE_ENV+= AB_CD="multi" \ LOCALES="ar ca cs da de el es-ES fa fi fr ga-IE he hu id is it ja ka ko lt mk ms my nb-NO nl pl pt-BR ro ru sq sv-SE th tr uk vi zh-CN zh-TW en-US" 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="ar ca cs da de el es-ES fa fi fr ga-IE he hu id is it ja ka ko lt mk ms my nb-NO nl pl pt-BR ro ru sq sv-SE th tr uk vi zh-CN zh-TW en-US" 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 WRKSRC= ${WRKDIR}/${DISTNAME:S/src-//} SHEBANG_FILES+= mach .include "${.CURDIR}/../../www/firefox/Makefile.options" .include .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 \ wasi-compiler-rt${LLVM_VERSION}>0:devel/wasi-compiler-rt${LLVM_VERSION} MOZILLA_PLIST_DIRS= bin lib share/pixmaps share/applications 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" ${MKDIR} ${WRKSRC}/tmp-manual unzip -d ${WRKSRC}/tmp-manual ${DISTDIR}/manual_112141.zip ${MKDIR} ${WRKSRC}/tmp-l10n-central tar -C ${WRKSRC}/tmp-l10n-central -xf ${DISTDIR}/firefox-tor-browser-13.0.1-build2-firefox-1l0n-out.tar 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-build: ${MKDIR} -p ${WRKSRC}/../.mozbuild/l10n-central find ${WRKSRC}/tmp-l10n-central -name "*.tar.xz" -exec tar -C ${WRKSRC}/../.mozbuild/l10n-central -xvf {} \; cd ${WRKSRC}/../.build/ && MOZBUILD_STATE_PATH=${WRKSRC}/../.mozbuild MOZ_AUTOMATION="1" ${WRKSRC}/mach package-multi-locale --locales ar ca cs da de el es-ES fa fi fr ga-IE he hu id is it ja ka ko lt mk ms my nb-NO nl pl pt-BR ro ru sq sv-SE th tr uk vi zh-CN zh-TW .for i in ar ca cs da de el es-ES fa fi fr ga-IE he hu id is it ja ka ko lt mk ms my nb-NO nl pl pt-BR ro ru sq sv-SE th tr uk vi zh-CN zh-TW ${CP} ${WRKDIR}/translation-3faf7dcd545109f7bbd8a6374838e139ca422d6c/${i}/base-browser.ftl ${WRKDIR}/.build/dist/bin/browser/localization/${i}/browser/base-browser.ftl ${CP} ${WRKDIR}/translation-3faf7dcd545109f7bbd8a6374838e139ca422d6c/${i}/newIdentity.properties ${WRKDIR}/.build/dist/bin/browser/chrome/${i}/locale/browser/newIdentity.properties ${CP} ${WRKDIR}/translation-3faf7dcd545109f7bbd8a6374838e139ca422d6c/${i}/securityLevel.properties ${WRKDIR}/.build/dist/bin/browser/chrome/${i}/locale/browser/securityLevel.properties ${MKDIR} ${WRKDIR}/.build/dist/bin/chrome/torbutton/locale/${i}/browser test -f ${WRKDIR}/translation-51bc08246d73990d461f747fb3c8cc7b6f66c1f4/${i}/tor-browser.ftl && ${CP} ${WRKDIR}/translation-51bc08246d73990d461f747fb3c8cc7b6f66c1f4/${i}/tor-browser.ftl ${WRKDIR}/.build/dist/bin/browser/localization/${i}/browser/tor-browser.ftl ${CP} ${WRKDIR}/translation-51bc08246d73990d461f747fb3c8cc7b6f66c1f4/${i}/cryptoSafetyPrompt.properties ${WRKDIR}/.build/dist/bin/browser/chrome/${i}/locale/browser/cryptoSafetyPrompt.properties .for j in brand.dtd aboutDialog.dtd aboutTBUpdate.dtd torbutton.dtd onboarding.properties brand.properties torlauncher.properties branding/brand.ftl rulesets.properties settings.properties torConnect.properties onionLocation.properties aboutTor.dtd torbutton.properties browserOnboarding.properties ${MKDIR} ${WRKDIR}/.build/dist/bin/chrome/torbutton/locale/${i}/branding ${CP} ${WRKDIR}/translation-51bc08246d73990d461f747fb3c8cc7b6f66c1f4/${i}/${j} ${WRKDIR}/.build/dist/bin/chrome/torbutton/locale/${i}/${j} .endfor .endfor post-install: @${MKDIR} ${STAGEDIR}${DATADIR} ${INSTALL_DATA} ${WRKDIR}/torrc-defaults ${STAGEDIR}${DATADIR}/torrc-defaults ${INSTALL_DATA} ${WRKDIR}/tor-browser.desktop ${STAGEDIR}${PREFIX}/share/applications/tor-browser.desktop .include diff --git a/www/tor-browser/distinfo b/www/tor-browser/distinfo index a0e748a76e5b..ea4c726915ec 100644 --- a/www/tor-browser/distinfo +++ b/www/tor-browser/distinfo @@ -1,11 +1,11 @@ -TIMESTAMP = 1713253525 -SHA256 (src-firefox-tor-browser-115.10.0esr-13.0-1-build1.tar.xz) = 5ce221443bd9dfbec37e92c263f0098572fb7c44a0236fbba98b02370eda11bf -SIZE (src-firefox-tor-browser-115.10.0esr-13.0-1-build1.tar.xz) = 551419804 +TIMESTAMP = 1715113596 +SHA256 (src-firefox-tor-browser-115.10.0esr-13.5-1-build2.tar.xz) = 4d6359dfd62d834eccef626dab721092924903cc9418049b0f07de3306575384 +SIZE (src-firefox-tor-browser-115.10.0esr-13.5-1-build2.tar.xz) = 552033160 SHA256 (manual_112141.zip) = f767bc5f655f1263623b7af588cfb045d3e41ee019dc7ecd713decc5c1a0ea9b SIZE (manual_112141.zip) = 26293073 SHA256 (firefox-tor-browser-13.0.1-build2-firefox-1l0n-out.tar) = bbd290cd134e3a114241077ba82582617ab6c5117ff2226381943c504bd09775 SIZE (firefox-tor-browser-13.0.1-build2-firefox-1l0n-out.tar) = 18848768 SHA256 (tpo-translation-3faf7dcd545109f7bbd8a6374838e139ca422d6c_GL0.tar.gz) = e6fdc79f74d2c438a44e5ffb6404e3d64bab879cf146e88a170ccdcef3596d9b SIZE (tpo-translation-3faf7dcd545109f7bbd8a6374838e139ca422d6c_GL0.tar.gz) = 108057 SHA256 (tpo-translation-51bc08246d73990d461f747fb3c8cc7b6f66c1f4_GL0.tar.gz) = a57dd8210d347ca69f5731cd768862673d692c0a5a3364f411cc5fa1fb88c98e SIZE (tpo-translation-51bc08246d73990d461f747fb3c8cc7b6f66c1f4_GL0.tar.gz) = 1059523 diff --git a/www/tor-browser/files/patch-dom_media_flac_FlacDecoder.cpp b/www/tor-browser/files/patch-dom_media_flac_FlacDecoder.cpp index 954b78f5bf37..6dc197d9455e 100644 --- a/www/tor-browser/files/patch-dom_media_flac_FlacDecoder.cpp +++ b/www/tor-browser/files/patch-dom_media_flac_FlacDecoder.cpp @@ -1,23 +1,23 @@ Enable FLAC on platforms without ffvpx like powerpc* --- dom/media/flac/FlacDecoder.cpp.orig 2021-04-15 19:44:28 UTC +++ dom/media/flac/FlacDecoder.cpp @@ -7,6 +7,7 @@ #include "FlacDecoder.h" #include "MediaContainerType.h" #include "mozilla/StaticPrefs_media.h" +#include "PDMFactory.h" namespace mozilla { @@ -14,6 +15,10 @@ namespace mozilla { bool FlacDecoder::IsEnabled() { #ifdef MOZ_FFVPX return StaticPrefs::media_flac_enabled(); +#elif defined(MOZ_FFMPEG) + RefPtr platform = new PDMFactory(); + return StaticPrefs::media_flac_enabled() && -+ platform->SupportsMimeType("audio/flac"_ns); ++ !platform->SupportsMimeType("audio/flac"_ns).isEmpty(); #else return false; #endif diff --git a/www/tor-browser/files/patch-toolkit_components_processtools_procinfo__bsd.c b/www/tor-browser/files/patch-toolkit_components_processtools_procinfo__bsd.c new file mode 100644 index 000000000000..e2e9a3cc88f4 --- /dev/null +++ b/www/tor-browser/files/patch-toolkit_components_processtools_procinfo__bsd.c @@ -0,0 +1,104 @@ +diff --git toolkit/components/processtools/ProcInfo_bsd.cpp toolkit/components/processtools/ProcInfo_bsd.cpp +index a6ff4881940c..f041ed5e50ce 100644 +--- toolkit/components/processtools/ProcInfo_bsd.cpp ++++ toolkit/components/processtools/ProcInfo_bsd.cpp +@@ -18,6 +18,9 @@ + #include + #include + #include ++#ifdef __FreeBSD__ ++#include ++#endif + + namespace mozilla { + +@@ -50,25 +53,39 @@ ProcInfoPromise::ResolveOrRejectValue GetProcInfoSync( + } + for (const auto& request : aRequests) { + size_t size; ++#ifdef __FreeBSD__ ++ int mib[4]; ++ int mibsize = 4; ++ mib[0] = CTL_KERN; ++ mib[1] = KERN_PROC; ++ mib[2] = KERN_PROC_PID | KERN_PROC_INC_THREAD; ++ mib[3] = request.pid; ++#else + int mib[6]; ++ int mibsize = 6; + mib[0] = CTL_KERN; + mib[1] = KERN_PROC; + mib[2] = KERN_PROC_PID | KERN_PROC_SHOW_THREADS; + mib[3] = request.pid; + mib[4] = sizeof(kinfo_proc); + mib[5] = 0; +- if (sysctl(mib, 6, nullptr, &size, nullptr, 0) == -1) { ++#endif ++ if (sysctl(mib, mibsize, nullptr, &size, nullptr, 0) == -1) { + // Can't get info for this process. Skip it. + continue; + } + ++#ifdef __FreeBSD__ ++ auto procs = MakeUniqueFallible(size / sizeof(kinfo_proc)); ++#else + mib[5] = size / sizeof(kinfo_proc); + auto procs = MakeUniqueFallible(mib[5]); ++#endif + if (!procs) { + result.SetReject(NS_ERROR_OUT_OF_MEMORY); + return result; + } +- if (sysctl(mib, 6, procs.get(), &size, nullptr, 0) == -1 && ++ if (sysctl(mib, mibsize, procs.get(), &size, nullptr, 0) == -1 && + errno != ENOMEM) { + continue; + } +@@ -84,19 +101,34 @@ ProcInfoPromise::ResolveOrRejectValue GetProcInfoSync( + bool found = false; + for (size_t i = 0; i < size / sizeof(kinfo_proc); i++) { + const auto& p = procs[i]; ++#ifdef __FreeBSD__ ++ if (i == 0) { ++#else + if (p.p_tid == -1) { ++#endif + // This is the process. + found = true; ++#ifdef __FreeBSD__ ++ info.cpuTime = uint64_t(p.ki_runtime) * 1'000u; ++ info.memory = (p.ki_tsize + p.ki_dsize + p.ki_ssize) * getpagesize(); ++#else + info.cpuTime = uint64_t(p.p_rtime_sec) * 1'000'000'000u + + uint64_t(p.p_rtime_usec) * 1'000u; + info.memory = + (p.p_vm_tsize + p.p_vm_dsize + p.p_vm_ssize) * getpagesize(); ++#endif ++ + } else { + // This is one of its threads. + ThreadInfo threadInfo; ++#ifdef __FreeBSD__ ++ threadInfo.tid = p.ki_tid; ++ threadInfo.cpuTime = uint64_t(p.ki_runtime) * 1'000u; ++#else + threadInfo.tid = p.p_tid; + threadInfo.cpuTime = uint64_t(p.p_rtime_sec) * 1'000'000'000u + + uint64_t(p.p_rtime_usec) * 1'000u; ++#endif + info.threads.AppendElement(threadInfo); + } + } +diff --git toolkit/components/processtools/moz.build toolkit/components/processtools/moz.build +index b7c164c1b0ac..a41dad52c343 100644 +--- toolkit/components/processtools/moz.build ++++ toolkit/components/processtools/moz.build +@@ -39,7 +39,7 @@ BROWSER_CHROME_MANIFESTS += ["tests/browser/browser.ini"] + # Platform-specific implementations of `ProcInfo`. + toolkit = CONFIG["MOZ_WIDGET_TOOLKIT"] + if toolkit == "gtk" or toolkit == "android": +- if CONFIG["OS_TARGET"] == "OpenBSD": ++ if CONFIG["OS_TARGET"] == "FreeBSD" or CONFIG["OS_TARGET"] == "OpenBSD": + UNIFIED_SOURCES += ["ProcInfo_bsd.cpp"] + else: + UNIFIED_SOURCES += ["ProcInfo_linux.cpp"] diff --git a/www/tor-browser/files/patch-toolkit_components_tor-launcher_TorProcess.sys.mjs b/www/tor-browser/files/patch-toolkit_components_tor-launcher_TorProcess.sys.mjs new file mode 100644 index 000000000000..247ead0c3c9a --- /dev/null +++ b/www/tor-browser/files/patch-toolkit_components_tor-launcher_TorProcess.sys.mjs @@ -0,0 +1,34 @@ +Let geoip/geoip6 file paths be set by prefs like everything else and let +the new getTorFile() deal with it. + +Index: toolkit/components/tor-launcher/TorProcess.sys.mjs +--- toolkit/components/tor-launcher/TorProcess.sys.mjs.orig 2024-04-22 21:47:56 UTC ++++ toolkit/components/tor-launcher/TorProcess.sys.mjs +@@ -216,6 +216,7 @@ export class TorProcess { + } + + this.#args = []; ++ this.#args.push("--ignore-missing-torrc"); + this.#args.push("-f", torrcFile.path); + this.#args.push("DataDirectory", this.#dataDir.path); + this.#args.push("ClientOnionAuthDir", onionAuthDir.path); +@@ -230,11 +231,15 @@ export class TorProcess { + // The geoip and geoip6 files are in the same directory as torrc-defaults. + // TODO: Change TorFile to return the generic path to these files to make + // them independent from the torrc-defaults. +- const geoipFile = torrcDefaultsFile.clone(); +- geoipFile.leafName = "geoip"; ++ // const geoipFile = torrcDefaultsFile.clone(); ++ // geoipFile.leafName = "geoip"; ++ // this.#args.push("GeoIPFile", geoipFile.path); ++ // const geoip6File = torrcDefaultsFile.clone(); ++ // geoip6File.leafName = "geoip6"; ++ // this.#args.push("GeoIPv6File", geoip6File.path); ++ const geoipFile = lazy.TorLauncherUtil.getTorFile("geoip", false); ++ const geoip6File = lazy.TorLauncherUtil.getTorFile("geoip6", false); + this.#args.push("GeoIPFile", geoipFile.path); +- const geoip6File = torrcDefaultsFile.clone(); +- geoip6File.leafName = "geoip6"; + this.#args.push("GeoIPv6File", geoip6File.path); + } else { + logger.warn( diff --git a/www/tor-browser/files/patch-toolkit_components_tor-launcher_TorProcess_sys_mjs b/www/tor-browser/files/patch-toolkit_components_tor-launcher_TorProcess_sys_mjs deleted file mode 100644 index ec2731f31d1f..000000000000 --- a/www/tor-browser/files/patch-toolkit_components_tor-launcher_TorProcess_sys_mjs +++ /dev/null @@ -1,26 +0,0 @@ -Let geoip/geoip6 file paths be set by prefs like everything else and let -the new getTorFile() deal with it. - -Index: toolkit/components/tor-launcher/TorProcess.sys.mjs ---- toolkit/components/tor-launcher/TorProcess.sys.mjs.orig -+++ toolkit/components/tor-launcher/TorProcess.sys.mjs -@@ -254,16 +254,14 @@ export class TorProcess { - "torrc-defaults", - false - ); -- // The geoip and geoip6 files are in the same directory as torrc-defaults. -- const geoipFile = torrcDefaultsFile.clone(); -- geoipFile.leafName = "geoip"; -- const geoip6File = torrcDefaultsFile.clone(); -- geoip6File.leafName = "geoip6"; -+ const geoipFile = lazy.TorLauncherUtil.getTorFile("geoip", false); -+ const geoip6File = lazy.TorLauncherUtil.getTorFile("geoip6", false); - - this.#args = []; - if (torrcDefaultsFile) { - this.#args.push("--defaults-torrc", torrcDefaultsFile.path); - } -+ this.#args.push("--ignore-missing-torrc"); - this.#args.push("-f", torrcFile.path); - this.#args.push("DataDirectory", this.#dataDir.path); - this.#args.push("ClientOnionAuthDir", onionAuthDir.path);