View | Details | Raw Unified | Return to bug 278851
Collapse All | Expand All

(-)b/www/tor-browser/Makefile (-2 / +2 lines)
Lines 1-11 Link Here
1
PORTNAME=	tor-browser
1
PORTNAME=	tor-browser
2
DISTVERSION=	13.0.14
2
DISTVERSION=	13.5a7
3
CATEGORIES=	www net security wayland
3
CATEGORIES=	www net security wayland
4
MASTER_SITES=	TOR \
4
MASTER_SITES=	TOR \
5
		https://build-sources.tbb.torproject.org/:source1 \
5
		https://build-sources.tbb.torproject.org/:source1 \
6
		LOCAL/jsm:source2
6
		LOCAL/jsm:source2
7
MASTER_SITE_SUBDIR=	torbrowser/${DISTVERSION}
7
MASTER_SITE_SUBDIR=	torbrowser/${DISTVERSION}
8
DISTNAME=	src-firefox-tor-browser-115.10.0esr-13.0-1-build1
8
DISTNAME=	src-firefox-tor-browser-115.10.0esr-13.5-1-build2
9
DISTFILES=	${DISTNAME}.tar.xz \
9
DISTFILES=	${DISTNAME}.tar.xz \
10
		manual_112141.zip:source1 \
10
		manual_112141.zip:source1 \
11
		firefox-tor-browser-13.0.1-build2-firefox-1l0n-out.tar:source2
11
		firefox-tor-browser-13.0.1-build2-firefox-1l0n-out.tar:source2
(-)b/www/tor-browser/distinfo (-3 / +3 lines)
Lines 1-6 Link Here
1
TIMESTAMP = 1713253525
1
TIMESTAMP = 1715113596
2
SHA256 (src-firefox-tor-browser-115.10.0esr-13.0-1-build1.tar.xz) = 5ce221443bd9dfbec37e92c263f0098572fb7c44a0236fbba98b02370eda11bf
2
SHA256 (src-firefox-tor-browser-115.10.0esr-13.5-1-build2.tar.xz) = 4d6359dfd62d834eccef626dab721092924903cc9418049b0f07de3306575384
3
SIZE (src-firefox-tor-browser-115.10.0esr-13.0-1-build1.tar.xz) = 551419804
3
SIZE (src-firefox-tor-browser-115.10.0esr-13.5-1-build2.tar.xz) = 552033160
4
SHA256 (manual_112141.zip) = f767bc5f655f1263623b7af588cfb045d3e41ee019dc7ecd713decc5c1a0ea9b
4
SHA256 (manual_112141.zip) = f767bc5f655f1263623b7af588cfb045d3e41ee019dc7ecd713decc5c1a0ea9b
5
SIZE (manual_112141.zip) = 26293073
5
SIZE (manual_112141.zip) = 26293073
6
SHA256 (firefox-tor-browser-13.0.1-build2-firefox-1l0n-out.tar) = bbd290cd134e3a114241077ba82582617ab6c5117ff2226381943c504bd09775
6
SHA256 (firefox-tor-browser-13.0.1-build2-firefox-1l0n-out.tar) = bbd290cd134e3a114241077ba82582617ab6c5117ff2226381943c504bd09775
(-)b/www/tor-browser/files/patch-dom_media_flac_FlacDecoder.cpp (-1 / +1 lines)
Lines 17-23 Enable FLAC on platforms without ffvpx like powerpc* Link Here
17
+#elif defined(MOZ_FFMPEG)
17
+#elif defined(MOZ_FFMPEG)
18
+  RefPtr<PDMFactory> platform = new PDMFactory();
18
+  RefPtr<PDMFactory> platform = new PDMFactory();
19
+  return StaticPrefs::media_flac_enabled() &&
19
+  return StaticPrefs::media_flac_enabled() &&
20
+         platform->SupportsMimeType("audio/flac"_ns);
20
+         !platform->SupportsMimeType("audio/flac"_ns).isEmpty();
21
 #else
21
 #else
22
   return false;
22
   return false;
23
 #endif
23
 #endif
(-)b/www/tor-browser/files/patch-toolkit_components_processtools_procinfo__bsd.c (+104 lines)
Added Link Here
1
diff --git toolkit/components/processtools/ProcInfo_bsd.cpp toolkit/components/processtools/ProcInfo_bsd.cpp
2
index a6ff4881940c..f041ed5e50ce 100644
3
--- toolkit/components/processtools/ProcInfo_bsd.cpp
4
+++ toolkit/components/processtools/ProcInfo_bsd.cpp
5
@@ -18,6 +18,9 @@
6
 #include <cstdio>
7
 #include <cstring>
8
 #include <unistd.h>
9
+#ifdef __FreeBSD__
10
+#include <sys/user.h>
11
+#endif
12
 
13
 namespace mozilla {
14
 
15
@@ -50,25 +53,39 @@ ProcInfoPromise::ResolveOrRejectValue GetProcInfoSync(
16
   }
17
   for (const auto& request : aRequests) {
18
     size_t size;
19
+#ifdef __FreeBSD__
20
+    int mib[4];
21
+    int mibsize = 4;
22
+    mib[0] = CTL_KERN;
23
+    mib[1] = KERN_PROC;
24
+    mib[2] = KERN_PROC_PID | KERN_PROC_INC_THREAD;
25
+    mib[3] = request.pid;
26
+#else
27
     int mib[6];
28
+    int mibsize = 6;
29
     mib[0] = CTL_KERN;
30
     mib[1] = KERN_PROC;
31
     mib[2] = KERN_PROC_PID | KERN_PROC_SHOW_THREADS;
32
     mib[3] = request.pid;
33
     mib[4] = sizeof(kinfo_proc);
34
     mib[5] = 0;
35
-    if (sysctl(mib, 6, nullptr, &size, nullptr, 0) == -1) {
36
+#endif
37
+    if (sysctl(mib, mibsize, nullptr, &size, nullptr, 0) == -1) {
38
       // Can't get info for this process. Skip it.
39
       continue;
40
     }
41
 
42
+#ifdef __FreeBSD__
43
+    auto procs = MakeUniqueFallible<kinfo_proc[]>(size / sizeof(kinfo_proc));
44
+#else
45
     mib[5] = size / sizeof(kinfo_proc);
46
     auto procs = MakeUniqueFallible<kinfo_proc[]>(mib[5]);
47
+#endif
48
     if (!procs) {
49
       result.SetReject(NS_ERROR_OUT_OF_MEMORY);
50
       return result;
51
     }
52
-    if (sysctl(mib, 6, procs.get(), &size, nullptr, 0) == -1 &&
53
+    if (sysctl(mib, mibsize, procs.get(), &size, nullptr, 0) == -1 &&
54
         errno != ENOMEM) {
55
       continue;
56
     }
57
@@ -84,19 +101,34 @@ ProcInfoPromise::ResolveOrRejectValue GetProcInfoSync(
58
     bool found = false;
59
     for (size_t i = 0; i < size / sizeof(kinfo_proc); i++) {
60
       const auto& p = procs[i];
61
+#ifdef __FreeBSD__
62
+      if (i == 0) {
63
+#else
64
       if (p.p_tid == -1) {
65
+#endif
66
         // This is the process.
67
         found = true;
68
+#ifdef __FreeBSD__
69
+        info.cpuTime = uint64_t(p.ki_runtime) * 1'000u;
70
+        info.memory = (p.ki_tsize + p.ki_dsize + p.ki_ssize) * getpagesize();
71
+#else
72
         info.cpuTime = uint64_t(p.p_rtime_sec) * 1'000'000'000u +
73
                        uint64_t(p.p_rtime_usec) * 1'000u;
74
         info.memory =
75
             (p.p_vm_tsize + p.p_vm_dsize + p.p_vm_ssize) * getpagesize();
76
+#endif
77
+
78
       } else {
79
         // This is one of its threads.
80
         ThreadInfo threadInfo;
81
+#ifdef __FreeBSD__
82
+        threadInfo.tid = p.ki_tid;
83
+        threadInfo.cpuTime = uint64_t(p.ki_runtime) * 1'000u;
84
+#else
85
         threadInfo.tid = p.p_tid;
86
         threadInfo.cpuTime = uint64_t(p.p_rtime_sec) * 1'000'000'000u +
87
                              uint64_t(p.p_rtime_usec) * 1'000u;
88
+#endif
89
         info.threads.AppendElement(threadInfo);
90
       }
91
     }
92
diff --git toolkit/components/processtools/moz.build toolkit/components/processtools/moz.build
93
index b7c164c1b0ac..a41dad52c343 100644
94
--- toolkit/components/processtools/moz.build
95
+++ toolkit/components/processtools/moz.build
96
@@ -39,7 +39,7 @@ BROWSER_CHROME_MANIFESTS += ["tests/browser/browser.ini"]
97
 # Platform-specific implementations of `ProcInfo`.
98
 toolkit = CONFIG["MOZ_WIDGET_TOOLKIT"]
99
 if toolkit == "gtk" or toolkit == "android":
100
-    if CONFIG["OS_TARGET"] == "OpenBSD":
101
+    if CONFIG["OS_TARGET"] == "FreeBSD" or CONFIG["OS_TARGET"] == "OpenBSD":
102
         UNIFIED_SOURCES += ["ProcInfo_bsd.cpp"]
103
     else:
104
         UNIFIED_SOURCES += ["ProcInfo_linux.cpp"]
(-)b/www/tor-browser/files/patch-toolkit_components_tor-launcher_TorProcess.sys.mjs (+34 lines)
Added Link Here
1
Let geoip/geoip6 file paths be set by prefs like everything else and let
2
the new getTorFile() deal with it.
3
4
Index: toolkit/components/tor-launcher/TorProcess.sys.mjs
5
--- toolkit/components/tor-launcher/TorProcess.sys.mjs.orig	2024-04-22 21:47:56 UTC
6
+++ toolkit/components/tor-launcher/TorProcess.sys.mjs
7
@@ -216,6 +216,7 @@ export class TorProcess {
8
     }
9
 
10
     this.#args = [];
11
+    this.#args.push("--ignore-missing-torrc");
12
     this.#args.push("-f", torrcFile.path);
13
     this.#args.push("DataDirectory", this.#dataDir.path);
14
     this.#args.push("ClientOnionAuthDir", onionAuthDir.path);
15
@@ -230,11 +231,15 @@ export class TorProcess {
16
       // The geoip and geoip6 files are in the same directory as torrc-defaults.
17
       // TODO: Change TorFile to return the generic path to these files to make
18
       // them independent from the torrc-defaults.
19
-      const geoipFile = torrcDefaultsFile.clone();
20
-      geoipFile.leafName = "geoip";
21
+      // const geoipFile = torrcDefaultsFile.clone();
22
+      // geoipFile.leafName = "geoip";
23
+      // this.#args.push("GeoIPFile", geoipFile.path);
24
+      // const geoip6File = torrcDefaultsFile.clone();
25
+      // geoip6File.leafName = "geoip6";
26
+      // this.#args.push("GeoIPv6File", geoip6File.path);
27
+      const geoipFile = lazy.TorLauncherUtil.getTorFile("geoip", false);
28
+      const geoip6File = lazy.TorLauncherUtil.getTorFile("geoip6", false);
29
       this.#args.push("GeoIPFile", geoipFile.path);
30
-      const geoip6File = torrcDefaultsFile.clone();
31
-      geoip6File.leafName = "geoip6";
32
       this.#args.push("GeoIPv6File", geoip6File.path);
33
     } else {
34
       logger.warn(
(-)a/www/tor-browser/files/patch-toolkit_components_tor-launcher_TorProcess_sys_mjs (-26 lines)
Removed Link Here
1
Let geoip/geoip6 file paths be set by prefs like everything else and let
2
the new getTorFile() deal with it.
3
4
Index: toolkit/components/tor-launcher/TorProcess.sys.mjs
5
--- toolkit/components/tor-launcher/TorProcess.sys.mjs.orig
6
+++ toolkit/components/tor-launcher/TorProcess.sys.mjs
7
@@ -254,16 +254,14 @@ export class TorProcess {
8
       "torrc-defaults",
9
       false
10
     );
11
-    // The geoip and geoip6 files are in the same directory as torrc-defaults.
12
-    const geoipFile = torrcDefaultsFile.clone();
13
-    geoipFile.leafName = "geoip";
14
-    const geoip6File = torrcDefaultsFile.clone();
15
-    geoip6File.leafName = "geoip6";
16
+    const geoipFile = lazy.TorLauncherUtil.getTorFile("geoip", false);
17
+    const geoip6File = lazy.TorLauncherUtil.getTorFile("geoip6", false);
18
 
19
     this.#args = [];
20
     if (torrcDefaultsFile) {
21
       this.#args.push("--defaults-torrc", torrcDefaultsFile.path);
22
     }
23
+    this.#args.push("--ignore-missing-torrc");
24
     this.#args.push("-f", torrcFile.path);
25
     this.#args.push("DataDirectory", this.#dataDir.path);
26
     this.#args.push("ClientOnionAuthDir", onionAuthDir.path);

Return to bug 278851