2020-09-09 23:27:30 +01:00
|
|
|
{ lib, fetchFromGitHub, python3Packages, qtbase, fetchpatch, wrapQtAppsHook
|
|
|
|
, secp256k1 }:
|
2017-09-27 16:44:35 +01:00
|
|
|
|
2017-12-13 19:55:40 +00:00
|
|
|
python3Packages.buildPythonApplication rec {
|
2019-03-13 17:24:13 +00:00
|
|
|
pname = "electron-cash";
|
2020-09-09 23:27:30 +01:00
|
|
|
version = "4.1.0";
|
2017-09-27 16:44:35 +01:00
|
|
|
|
2019-12-02 22:30:55 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Electron-Cash";
|
|
|
|
repo = "Electron-Cash";
|
|
|
|
rev = version;
|
2020-09-09 23:27:30 +01:00
|
|
|
sha256 = "1ccfm6kkmbkvykfdzrisxvr0lx9kgq4l43ixk6v3xnvhnbfwz4s2";
|
2017-09-27 16:44:35 +01:00
|
|
|
};
|
|
|
|
|
2017-12-13 19:55:40 +00:00
|
|
|
propagatedBuildInputs = with python3Packages; [
|
2017-12-10 14:27:06 +00:00
|
|
|
dnspython
|
2017-09-27 16:44:35 +01:00
|
|
|
ecdsa
|
2017-12-13 19:55:40 +00:00
|
|
|
jsonrpclib-pelix
|
|
|
|
matplotlib
|
2017-09-27 16:44:35 +01:00
|
|
|
pbkdf2
|
|
|
|
pyaes
|
|
|
|
pycrypto
|
2017-12-13 19:55:40 +00:00
|
|
|
pyqt5
|
2017-09-27 16:44:35 +01:00
|
|
|
pysocks
|
|
|
|
qrcode
|
|
|
|
requests
|
2018-12-07 14:29:24 +00:00
|
|
|
tlslite-ng
|
2019-03-13 17:24:13 +00:00
|
|
|
qdarkstyle
|
2020-03-28 12:17:08 +00:00
|
|
|
stem
|
2017-09-27 16:44:35 +01:00
|
|
|
|
|
|
|
# plugins
|
|
|
|
keepkey
|
|
|
|
trezor
|
2018-10-01 23:13:03 +01:00
|
|
|
btchip
|
2017-09-27 16:44:35 +01:00
|
|
|
];
|
|
|
|
|
2019-07-05 16:42:08 +01:00
|
|
|
nativeBuildInputs = [ wrapQtAppsHook ];
|
2018-09-12 17:03:36 +01:00
|
|
|
|
2020-09-09 23:27:30 +01:00
|
|
|
patches = [
|
|
|
|
# Patch a failed test, this can be removed in next version
|
|
|
|
(fetchpatch {
|
|
|
|
url =
|
|
|
|
"https://github.com/Electron-Cash/Electron-Cash/commit/1a9122d59be0c351b14c174a60880c2e927e6168.patch";
|
|
|
|
sha256 = "0zw629ypn9jxb1y124s3dkbbf2q3wj1i97j16lzdxpjy3sk0p5hk";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2018-01-07 20:35:58 +00:00
|
|
|
postPatch = ''
|
2019-03-13 17:24:13 +00:00
|
|
|
substituteInPlace contrib/requirements/requirements.txt \
|
2020-03-10 11:15:25 +00:00
|
|
|
--replace "qdarkstyle==2.6.8" "qdarkstyle<3"
|
2018-01-07 20:35:58 +00:00
|
|
|
|
2019-03-13 17:24:13 +00:00
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "(share_dir" "(\"share\""
|
2017-09-27 16:44:35 +01:00
|
|
|
'';
|
|
|
|
|
2020-09-09 23:27:30 +01:00
|
|
|
checkInputs = with python3Packages; [ pytest ];
|
2019-05-03 00:17:58 +01:00
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
unset HOME
|
|
|
|
pytest lib/tests
|
|
|
|
'';
|
2017-12-13 19:55:40 +00:00
|
|
|
|
2017-09-27 16:44:35 +01:00
|
|
|
postInstall = ''
|
2017-11-09 22:58:57 +00:00
|
|
|
substituteInPlace $out/share/applications/electron-cash.desktop \
|
2019-03-13 17:24:13 +00:00
|
|
|
--replace "Exec=electron-cash" "Exec=$out/bin/electron-cash"
|
2017-09-27 16:44:35 +01: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.
|
2019-09-26 15:23:57 +01:00
|
|
|
postFixup = ''
|
2020-03-28 12:17:08 +00:00
|
|
|
wrapQtApp $out/bin/electron-cash \
|
|
|
|
--prefix LD_LIBRARY_PATH : ${secp256k1}/lib
|
2019-09-26 15:23:57 +01:00
|
|
|
'';
|
|
|
|
|
2017-09-27 16:44:35 +01:00
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
2018-09-12 17:03:36 +01:00
|
|
|
$out/bin/electron-cash help >/dev/null
|
2017-09-27 16:44:35 +01:00
|
|
|
'';
|
|
|
|
|
2019-03-13 17:24:13 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A Bitcoin Cash SPV Wallet";
|
2017-09-27 16:44:35 +01:00
|
|
|
longDescription = ''
|
2019-03-13 17:24:13 +00:00
|
|
|
An easy-to-use Bitcoin Cash client featuring wallets generated from
|
2017-09-27 16:44:35 +01:00
|
|
|
mnemonic seeds (in addition to other, more advanced, wallet options)
|
|
|
|
and the ability to perform transactions without downloading a copy
|
|
|
|
of the blockchain.
|
|
|
|
'';
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://www.electroncash.org/";
|
2018-01-09 19:40:28 +00:00
|
|
|
platforms = platforms.linux;
|
2019-03-13 17:24:13 +00:00
|
|
|
maintainers = with maintainers; [ lassulus nyanloutre ];
|
2017-09-27 16:44:35 +01:00
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|