aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/applications/networking/onionshare/fix-paths.patch
blob: a290dd884104ce0eedebeac1024096d6f3c4b987 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
--- a/onionshare_cli/common.py
+++ b/onionshare_cli/common.py
@@ -86,33 +86,10 @@ class Common:
         return path
 
     def get_tor_paths(self):
-        if self.platform == "Linux":
-            tor_path = shutil.which("tor")
-            if not tor_path:
-                raise CannotFindTor()
-            obfs4proxy_file_path = shutil.which("obfs4proxy")
-            prefix = os.path.dirname(os.path.dirname(tor_path))
-            tor_geo_ip_file_path = os.path.join(prefix, "share/tor/geoip")
-            tor_geo_ipv6_file_path = os.path.join(prefix, "share/tor/geoip6")
-        elif self.platform == "Windows":
-            base_path = self.get_resource_path("tor")
-            tor_path = os.path.join(base_path, "Tor", "tor.exe")
-            obfs4proxy_file_path = os.path.join(base_path, "Tor", "obfs4proxy.exe")
-            tor_geo_ip_file_path = os.path.join(base_path, "Data", "Tor", "geoip")
-            tor_geo_ipv6_file_path = os.path.join(base_path, "Data", "Tor", "geoip6")
-        elif self.platform == "Darwin":
-            tor_path = shutil.which("tor")
-            if not tor_path:
-                raise CannotFindTor()
-            obfs4proxy_file_path = shutil.which("obfs4proxy")
-            prefix = os.path.dirname(os.path.dirname(tor_path))
-            tor_geo_ip_file_path = os.path.join(prefix, "share/tor/geoip")
-            tor_geo_ipv6_file_path = os.path.join(prefix, "share/tor/geoip6")
-        elif self.platform == "BSD":
-            tor_path = "/usr/local/bin/tor"
-            tor_geo_ip_file_path = "/usr/local/share/tor/geoip"
-            tor_geo_ipv6_file_path = "/usr/local/share/tor/geoip6"
-            obfs4proxy_file_path = "/usr/local/bin/obfs4proxy"
+        tor_path = "@tor@/bin/tor"
+        tor_geo_ip_file_path = "@geoip@/share/tor/geoip"
+        tor_geo_ipv6_file_path = "@geoip@/share/tor/geoip6"
+        obfs4proxy_file_path = "@obfs4@/bin/obfs4proxy"
 
         return (
             tor_path,