onionshare: cleanup, fix crash (#309950)

* onionshare: cleanup dependencies according to used upstream ones

* python3Packages.cepa: drop that it is now unused

* onionshare: fix starting under none qt desktops

* onionshare: fix crash with presumable newer pyside6
This commit is contained in:
Sandro
2024-05-12 20:41:29 +02:00
committed by GitHub
parent a08f9c05e7
commit ea75c38b31
4 changed files with 20 additions and 61 deletions
@@ -1,20 +1,18 @@
{ lib
, stdenv
, buildPythonApplication
, cepa
, colorama
, fetchFromGitHub
, fetchpatch
, flask
, flask-compress
, flask-httpauth
, flask-socketio
, gevent-socketio
, gevent-websocket
, obfs4
, psutil
, packaging
, pycrypto
, pynacl
, pyqt5
, pyside6
, pysocks
, pytestCheckHook
@@ -22,10 +20,12 @@
, qt5
, requests
, snowflake
, stem
, substituteAll
, tor
, unidecode
, waitress
, werkzeug
}:
let
@@ -79,23 +79,25 @@ rec {
})
];
propagatedBuildInputs = [
cepa
colorama
flask
flask-compress
flask-httpauth
flask-socketio
gevent-socketio
gevent-websocket
packaging
psutil
pycrypto
pynacl
pyside6
pysocks
qrcode
qrcode
requests
stem
unidecode
waitress
];
werkzeug
] ++ requests.optional-dependencies.socks;
buildInputs = [
obfs4
@@ -138,19 +140,25 @@ rec {
inherit tor meek obfs4 snowflake;
inherit (tor) geoip;
})
# https://github.com/onionshare/onionshare/pull/1903
(fetchpatch {
url = "https://github.com/onionshare/onionshare/pull/1903/commits/f20db8fcbd18e51b58814ae8f98f3a7502b4f456.patch";
stripLen = 1;
hash = "sha256-wfIjdPhdUYAvbK5XyE1o2OtFOlJRj0X5mh7QQRjdyP0=";
})
];
propagatedBuildInputs = [
onionshare
psutil
pyqt5
pyside6
pysocks
qrcode
];
nativeBuildInputs = [ qt5.wrapQtAppsHook ];
buildInputs = [ qt5.qtwayland ];
postInstall = ''
mkdir -p $out/share/{appdata,applications,icons}
cp $src/org.onionshare.OnionShare.desktop $out/share/applications
@@ -1,48 +0,0 @@
{ lib
, buildPythonPackage
, fetchpatch
, fetchPypi
, python
, mock
}:
buildPythonPackage rec {
pname = "cepa";
version = "1.8.4";
format = "setuptools";
src = fetchPypi {
inherit pname version;
hash = "sha256-P7xwGsP8ic1/abxYptDXNbAU+kC2Hiwu/Tge0g21ipY=";
};
patches = [
(fetchpatch {
name = "python-3.11-compatibility.patch";
url = "https://github.com/onionshare/cepa/commit/0bf9aee7151e65594c532826bb04636e1d80fb6f.patch";
hash = "sha256-roSt9N5OvnOOxKZUee86zGXt0AsZCcbBdV2cLz1MB2k=";
})
];
postPatch = ''
rm test/unit/installation.py
sed -i "/test.unit.installation/d" test/settings.cfg
# https://github.com/torproject/stem/issues/56
sed -i '/MOCK_VERSION/d' run_tests.py
'';
nativeCheckInputs = [ mock ];
checkPhase = ''
touch .gitignore
${python.interpreter} run_tests.py -u
'';
meta = with lib; {
description = "Controller library that allows applications to interact with Tor";
mainProgram = "tor-prompt";
homepage = "https://github.com/onionshare/cepa";
license = licenses.lgpl3Only;
maintainers = with maintainers; [ bbjubjub ];
};
}
+1
View File
@@ -82,6 +82,7 @@ mapAliases ({
cacheyou = throw "cacheyou has been removed, as it was no longer used for the only consumer pdm"; # added 2023-12-21
carrot = throw "carrot has been removed, as its development was discontinued in 2012"; # added 2022-01-18
cchardet = faust-cchardet; # added 2023-03-02
cepa = throw "cepa has been removed, as onionshare switched back to stem"; # added 2024-05-07
class-registry = phx-class-registry; # added 2021-10-05
cntk = throw "cntk has been removed from nixpkgs, as it was broken and unmaintained"; # Added 2023-10-09
codespell = throw "codespell has been promoted to a top-level attribute name: `pkgs.codespell`"; # Added 2022-10-02
-2
View File
@@ -2004,8 +2004,6 @@ self: super: with self; {
coqpit = callPackage ../development/python-modules/coqpit { };
cepa = callPackage ../development/python-modules/cepa { };
cerberus = callPackage ../development/python-modules/cerberus { };
cert-chain-resolver = callPackage ../development/python-modules/cert-chain-resolver { };