uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
147
pkgs/applications/networking/onionshare/default.nix
Normal file
147
pkgs/applications/networking/onionshare/default.nix
Normal file
|
|
@ -0,0 +1,147 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, buildPythonApplication
|
||||
, substituteAll
|
||||
, fetchFromGitHub
|
||||
, isPy3k
|
||||
, colorama
|
||||
, flask
|
||||
, flask-httpauth
|
||||
, flask-socketio
|
||||
, cepa
|
||||
, psutil
|
||||
, pyqt5
|
||||
, pycrypto
|
||||
, pynacl
|
||||
, pyside2
|
||||
, pytestCheckHook
|
||||
, qrcode
|
||||
, qt5
|
||||
, requests
|
||||
, unidecode
|
||||
, tor
|
||||
, obfs4
|
||||
, snowflake
|
||||
}:
|
||||
|
||||
let
|
||||
version = "2.5";
|
||||
src = fetchFromGitHub {
|
||||
owner = "onionshare";
|
||||
repo = "onionshare";
|
||||
rev = "v${version}";
|
||||
sha256 = "xCAM+tjjyDg/gqAXr4YNPhM8R3n9r895jktisAGlpZo=";
|
||||
};
|
||||
meta = with lib; {
|
||||
description = "Securely and anonymously send and receive files";
|
||||
longDescription = ''
|
||||
OnionShare is an open source tool for securely and anonymously sending
|
||||
and receiving files using Tor onion services. It works by starting a web
|
||||
server directly on your computer and making it accessible as an
|
||||
unguessable Tor web address that others can load in Tor Browser to
|
||||
download files from you, or upload files to you. It doesn't require
|
||||
setting up a separate server, using a third party file-sharing service,
|
||||
or even logging into an account.
|
||||
|
||||
Unlike services like email, Google Drive, DropBox, WeTransfer, or nearly
|
||||
any other way people typically send files to each other, when you use
|
||||
OnionShare you don't give any companies access to the files that you're
|
||||
sharing. So long as you share the unguessable web address in a secure way
|
||||
(like pasting it in an encrypted messaging app), no one but you and the
|
||||
person you're sharing with can access the files.
|
||||
'';
|
||||
|
||||
homepage = "https://onionshare.org/";
|
||||
|
||||
license = licenses.gpl3Plus;
|
||||
maintainers = with maintainers; [ lourkeur ];
|
||||
};
|
||||
|
||||
# TODO: package meek https://support.torproject.org/glossary/meek/
|
||||
meek = "/meek-not-available";
|
||||
|
||||
in
|
||||
rec {
|
||||
onionshare = buildPythonApplication {
|
||||
pname = "onionshare-cli";
|
||||
inherit version meta;
|
||||
src = "${src}/cli";
|
||||
patches = [
|
||||
# hardcode store paths of dependencies
|
||||
(substituteAll {
|
||||
src = ./fix-paths.patch;
|
||||
inherit tor meek obfs4 snowflake;
|
||||
inherit (tor) geoip;
|
||||
})
|
||||
];
|
||||
disable = !isPy3k;
|
||||
propagatedBuildInputs = [
|
||||
colorama
|
||||
flask
|
||||
flask-httpauth
|
||||
flask-socketio
|
||||
cepa
|
||||
psutil
|
||||
pycrypto
|
||||
pynacl
|
||||
requests
|
||||
unidecode
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
tor
|
||||
obfs4
|
||||
];
|
||||
|
||||
checkInputs = [
|
||||
pytestCheckHook
|
||||
];
|
||||
|
||||
preCheck = ''
|
||||
# Tests use the home directory
|
||||
export HOME="$(mktemp -d)"
|
||||
'';
|
||||
|
||||
disabledTests = [
|
||||
"test_get_tor_paths_linux" # expects /usr instead of /nix/store
|
||||
] ++ lib.optionals stdenv.isDarwin [
|
||||
# on darwin (and only on darwin) onionshare attempts to discover
|
||||
# user's *real* homedir via /etc/passwd, making it more painful
|
||||
# to fake
|
||||
"test_receive_mode_webhook"
|
||||
];
|
||||
};
|
||||
|
||||
onionshare-gui = buildPythonApplication {
|
||||
pname = "onionshare";
|
||||
inherit version meta;
|
||||
src = "${src}/desktop";
|
||||
patches = [
|
||||
# hardcode store paths of dependencies
|
||||
(substituteAll {
|
||||
src = ./fix-paths-gui.patch;
|
||||
inherit tor meek obfs4 snowflake;
|
||||
inherit (tor) geoip;
|
||||
})
|
||||
];
|
||||
|
||||
disable = !isPy3k;
|
||||
propagatedBuildInputs = [
|
||||
onionshare
|
||||
pyqt5
|
||||
pyside2
|
||||
psutil
|
||||
qrcode
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ qt5.wrapQtAppsHook ];
|
||||
|
||||
preFixup = ''
|
||||
wrapQtApp $out/bin/onionshare
|
||||
'';
|
||||
|
||||
doCheck = false;
|
||||
|
||||
pythonImportsCheck = [ "onionshare" ];
|
||||
};
|
||||
}
|
||||
61
pkgs/applications/networking/onionshare/fix-paths-gui.patch
Normal file
61
pkgs/applications/networking/onionshare/fix-paths-gui.patch
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
--- a/onionshare/gui_common.py
|
||||
+++ b/onionshare/gui_common.py
|
||||
@@ -410,52 +410,12 @@ class GuiCommon:
|
||||
}
|
||||
|
||||
def get_tor_paths(self):
|
||||
- if self.common.platform == "Linux":
|
||||
- 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":
|
||||
- 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")
|
||||
- snowflake_file_path = os.path.join(base_path, "Tor", "snowflake-client.exe")
|
||||
- meek_client_file_path = os.path.join(base_path, "Tor", "meek-client.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")
|
||||
- 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")
|
||||
- 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"
|
||||
- meek_client_file_path = "/usr/local/bin/meek-client"
|
||||
- snowflake_file_path = "/usr/local/bin/snowflake-client"
|
||||
+ 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"
|
||||
+ meek_client_file_path = "@meek@/bin/meek-client"
|
||||
+ snowflake_file_path = "@snowflake@/bin/snowflake-client"
|
||||
|
||||
return (
|
||||
tor_path,
|
||||
76
pkgs/applications/networking/onionshare/fix-paths.patch
Normal file
76
pkgs/applications/networking/onionshare/fix-paths.patch
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
--- a/onionshare_cli/common.py
|
||||
+++ b/onionshare_cli/common.py
|
||||
@@ -318,67 +318,12 @@ 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")
|
||||
- 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")
|
||||
- elif self.platform == "Windows":
|
||||
- # In Windows, the Tor binaries are in the onionshare package, not the onionshare_cli package
|
||||
- base_path = self.get_resource_path("tor")
|
||||
- base_path = base_path.replace("onionshare_cli", "onionshare")
|
||||
- tor_path = os.path.join(base_path, "Tor", "tor.exe")
|
||||
-
|
||||
- # If tor.exe isn't there, mayber we're running from the source tree
|
||||
- if not os.path.exists(tor_path):
|
||||
- base_path = os.path.join(os.getcwd(), "onionshare", "resources", "tor")
|
||||
-
|
||||
- tor_path = os.path.join(base_path, "Tor", "tor.exe")
|
||||
- if not os.path.exists(tor_path):
|
||||
- raise CannotFindTor()
|
||||
-
|
||||
- obfs4proxy_file_path = os.path.join(base_path, "Tor", "obfs4proxy.exe")
|
||||
- snowflake_file_path = os.path.join(base_path, "Tor", "snowflake-client.exe")
|
||||
- meek_client_file_path = os.path.join(base_path, "Tor", "meek-client.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":
|
||||
- # Let's see if we have tor binaries in the onionshare GUI package
|
||||
- base_path = self.get_resource_path("tor")
|
||||
- base_path = base_path.replace("onionshare_cli", "onionshare")
|
||||
- tor_path = os.path.join(base_path, "tor")
|
||||
- if os.path.exists(tor_path):
|
||||
- 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")
|
||||
- tor_geo_ip_file_path = os.path.join(base_path, "geoip")
|
||||
- tor_geo_ipv6_file_path = os.path.join(base_path, "geoip6")
|
||||
- else:
|
||||
- # Fallback to looking in the path
|
||||
- tor_path = shutil.which("tor")
|
||||
- if not os.path.exists(tor_path):
|
||||
- raise CannotFindTor()
|
||||
-
|
||||
- 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")
|
||||
-
|
||||
- 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"
|
||||
- snowflake_file_path = "/usr/local/bin/snowflake-client"
|
||||
- meek_client_file_path = "/usr/local/bin/meek-client"
|
||||
+ 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"
|
||||
+ snowflake_file_path = "@snowflake@/bin/snowflake-client"
|
||||
+ meek_client_file_path = "@meek@/bin/meek-client"
|
||||
|
||||
return (
|
||||
tor_path,
|
||||
Loading…
Add table
Add a link
Reference in a new issue