nixpkgs/pkgs/applications/misc/electron-cash/default.nix

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

101 lines
2.4 KiB
Nix
Raw Normal View History

2021-11-13 22:28:25 +00:00
{ lib, stdenv, fetchFromGitHub, python3Packages, wrapQtAppsHook
2020-09-09 22:27:30 +00:00
, secp256k1 }:
2017-09-27 15:44:35 +00:00
2017-12-13 19:55:40 +00:00
python3Packages.buildPythonApplication rec {
pname = "electron-cash";
2022-07-07 12:48:56 +00:00
version = "4.2.10";
2017-09-27 15:44:35 +00:00
2019-12-02 22:30:55 +00:00
src = fetchFromGitHub {
owner = "Electron-Cash";
repo = "Electron-Cash";
2022-07-07 12:48:56 +00:00
rev = "refs/tags/${version}";
sha256 = "sha256-m13wJlNBG3BxOdKUyd3qmIhFBM7263FzMKr5lfD1tys=";
2017-09-27 15:44:35 +00:00
};
2017-12-13 19:55:40 +00:00
propagatedBuildInputs = with python3Packages; [
2021-04-07 11:57:34 +00:00
# requirements
pyaes
2017-09-27 15:44:35 +00:00
ecdsa
2021-04-07 11:57:34 +00:00
requests
qrcode
protobuf
2017-12-13 19:55:40 +00:00
jsonrpclib-pelix
2017-09-27 15:44:35 +00:00
pysocks
qdarkstyle
2021-04-07 11:57:34 +00:00
python-dateutil
2020-03-28 12:17:08 +00:00
stem
2021-04-07 11:57:34 +00:00
certifi
pathvalidate
dnspython
2017-09-27 15:44:35 +00:00
2021-04-07 11:57:34 +00:00
# requirements-binaries
pyqt5
psutil
pycryptodomex
cryptography
# requirements-hw
cython
2017-09-27 15:44:35 +00:00
trezor
2021-04-07 11:57:34 +00:00
keepkey
btchip-python
2021-04-07 11:57:34 +00:00
hidapi
2022-03-21 14:59:12 +00:00
pyopenssl
2021-04-07 11:57:34 +00:00
pyscard
pysatochip
2017-09-27 15:44:35 +00:00
];
nativeBuildInputs = [ wrapQtAppsHook ];
2018-09-12 16:03:36 +00:00
2018-01-07 20:35:58 +00:00
postPatch = ''
substituteInPlace contrib/requirements/requirements.txt \
--replace "qdarkstyle==2.6.8" "qdarkstyle<3"
2018-01-07 20:35:58 +00:00
substituteInPlace setup.py \
--replace "(share_dir" "(\"share\""
2017-09-27 15:44:35 +00:00
'';
nativeCheckInputs = with python3Packages; [ pytest ];
2019-05-02 23:17:58 +00:00
checkPhase = ''
unset HOME
2020-10-26 23:06:52 +00:00
pytest electroncash/tests
2019-05-02 23:17:58 +00:00
'';
2017-12-13 19:55:40 +00:00
2021-07-06 17:24:47 +00:00
postInstall = lib.optionalString stdenv.isLinux ''
substituteInPlace $out/share/applications/electron-cash.desktop \
--replace "Exec=electron-cash" "Exec=$out/bin/electron-cash"
2017-09-27 15:44:35 +00:00
'';
2020-03-28 12:17:08 +00:00
# If secp256k1 wasn't added to the library path, the following warning is given:
#
# Electron Cash was unable to find the secp256k1 library on this system.
# Elliptic curve cryptography operations will be performed in slow
# Python-only mode.
preFixup = ''
makeWrapperArgs+=("''${qtWrapperArgs[@]}")
makeWrapperArgs+=(
"--prefix" "LD_LIBRARY_PATH" ":" "${secp256k1}/lib"
)
2019-09-26 14:23:57 +00:00
'';
2017-09-27 15:44:35 +00:00
doInstallCheck = true;
installCheckPhase = ''
2018-09-12 16:03:36 +00:00
$out/bin/electron-cash help >/dev/null
2017-09-27 15:44:35 +00:00
'';
meta = with lib; {
description = "A Bitcoin Cash SPV Wallet";
2017-09-27 15:44:35 +00:00
longDescription = ''
An easy-to-use Bitcoin Cash client featuring wallets generated from
2017-09-27 15:44:35 +00:00
mnemonic seeds (in addition to other, more advanced, wallet options)
and the ability to perform transactions without downloading a copy
of the blockchain.
'';
homepage = "https://www.electroncash.org/";
2021-07-06 17:24:47 +00:00
platforms = platforms.unix;
2021-04-07 11:57:34 +00:00
maintainers = with maintainers; [ lassulus nyanloutre oxalica ];
2017-09-27 15:44:35 +00:00
license = licenses.mit;
};
}