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

37 lines
1.8 KiB
Diff
Raw Normal View History

2020-11-14 21:43:49 +00:00
--- a/onionshare/gui_common.py
+++ b/onionshare/gui_common.py
2021-06-02 08:51:09 +01:00
@@ -391,29 +391,10 @@ class GuiCommon:
2020-11-14 21:43:49 +00:00
}
def get_tor_paths(self):
- if self.common.platform == "Linux":
- tor_path = shutil.which("tor")
- 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.common.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.common.platform == "Darwin":
- base_path = self.get_resource_path("tor")
- tor_path = os.path.join(base_path, "tor")
2021-06-02 08:51:09 +01:00
- obfs4proxy_file_path = os.path.join(base_path, "obfs4proxy")
2020-11-14 21:43:49 +00:00
- tor_geo_ip_file_path = os.path.join(base_path, "geoip")
- tor_geo_ipv6_file_path = os.path.join(base_path, "geoip6")
- elif self.common.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,