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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

62 lines
3.3 KiB
Diff
Raw Normal View History

2020-11-14 21:43:49 +00:00
--- a/onionshare/gui_common.py
+++ b/onionshare/gui_common.py
2022-10-10 08:50:49 +00:00
@@ -482,52 +482,12 @@ class GuiCommon:
2020-11-14 21:43:49 +00:00
}
def get_tor_paths(self):
- if self.common.platform == "Linux":
2022-01-18 09:04:53 +00:00
- base_path = self.get_resource_path("tor")
- if base_path and os.path.isdir(base_path):
- self.common.log(
- "GuiCommon", "get_tor_paths", "using paths in resources"
- )
- tor_path = os.path.join(base_path, "tor")
- tor_geo_ip_file_path = os.path.join(base_path, "geoip")
- tor_geo_ipv6_file_path = os.path.join(base_path, "geoip6")
- obfs4proxy_file_path = os.path.join(base_path, "obfs4proxy")
- snowflake_file_path = os.path.join(base_path, "snowflake-client")
- meek_client_file_path = os.path.join(base_path, "meek-client")
- else:
- # Fallback to looking in the path
- self.common.log("GuiCommon", "get_tor_paths", "using paths from PATH")
- tor_path = shutil.which("tor")
- obfs4proxy_file_path = shutil.which("obfs4proxy")
- snowflake_file_path = shutil.which("snowflake-client")
- meek_client_file_path = shutil.which("meek-client")
- 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")
-
- if self.common.platform == "Windows":
2020-11-14 21:43:49 +00:00
- base_path = self.get_resource_path("tor")
2022-10-10 08:50:49 +00:00
- tor_path = os.path.join(base_path, "tor.exe")
- obfs4proxy_file_path = os.path.join(base_path, "obfs4proxy.exe")
- snowflake_file_path = os.path.join(base_path, "snowflake-client.exe")
- meek_client_file_path = os.path.join(base_path, "meek-client.exe")
- tor_geo_ip_file_path = os.path.join(base_path, "geoip")
- tor_geo_ipv6_file_path = os.path.join(base_path, "geoip6")
2020-11-14 21:43:49 +00:00
- elif self.common.platform == "Darwin":
- base_path = self.get_resource_path("tor")
- tor_path = os.path.join(base_path, "tor")
2021-06-02 07:51:09 +00:00
- obfs4proxy_file_path = os.path.join(base_path, "obfs4proxy")
2022-01-18 09:04:53 +00:00
- snowflake_file_path = os.path.join(base_path, "snowflake-client")
- meek_client_file_path = os.path.join(base_path, "meek-client")
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"
2022-01-18 09:04:53 +00:00
- meek_client_file_path = "/usr/local/bin/meek-client"
- snowflake_file_path = "/usr/local/bin/snowflake-client"
2020-11-14 21:43:49 +00:00
+ 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"
2022-01-18 09:04:53 +00:00
+ meek_client_file_path = "@meek@/bin/meek-client"
+ snowflake_file_path = "@snowflake@/bin/snowflake-client"
2020-11-14 21:43:49 +00:00
return (
tor_path,