nixpkgs/pkgs/applications/networking/onionshare/fix-paths.patch

42 lines
1.9 KiB
Diff
Raw Normal View History

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