3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/networking/onionshare/fix-paths.patch

41 lines
1.9 KiB
Diff
Raw Normal View History

2020-11-14 21:43:49 +00:00
--- a/onionshare_cli/common.py
+++ b/onionshare_cli/common.py
@@ -86,33 +86,10 @@ class Common:
return path
2020-04-21 21:57:48 +01:00
def get_tor_paths(self):
- if self.platform == "Linux":
2020-11-14 21:43:49 +00:00
- 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")
2020-04-21 21:57:48 +01:00
- elif self.platform == "Windows":
2020-11-14 21:43:49 +00:00
- 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")
2020-04-21 21:57:48 +01:00
- elif self.platform == "Darwin":
2020-11-14 21:43:49 +00:00
- 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")
2020-04-21 21:57:48 +01:00
- 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"
2020-11-14 21:43:49 +00:00
2020-04-21 21:57:48 +01:00
return (
tor_path,