biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / applications / misc / electron-cash / default.nix
blobe9854ac3ef94da427e6db014e9bfb65f15f8dec5
1 { lib, stdenv, fetchFromGitHub, python3Packages, wrapQtAppsHook
2 , secp256k1, qtwayland }:
4 python3Packages.buildPythonApplication rec {
5   pname = "electron-cash";
6   version = "4.3.1";
8   src = fetchFromGitHub {
9     owner = "Electron-Cash";
10     repo = "Electron-Cash";
11     rev = "refs/tags/${version}";
12     sha256 = "sha256-xOyj5XerOwgfvI0qj7+7oshDvd18h5IeZvcJTis8nWo=";
13   };
15   build-system = with python3Packages; [
16     cython
17   ];
19   propagatedBuildInputs = with python3Packages; [
20     # requirements
21     pyaes
22     ecdsa
23     requests
24     qrcode
25     protobuf
26     jsonrpclib-pelix
27     pysocks
28     qdarkstyle
29     python-dateutil
30     stem
31     certifi
32     pathvalidate
33     dnspython
34     bitcoinrpc
36     # requirements-binaries
37     pyqt5
38     psutil
39     pycryptodomex
40     cryptography
42     # requirements-hw
43     trezor
44     keepkey
45     btchip-python
46     hidapi
47     pyopenssl
48     pyscard
49     pysatochip
50   ];
52   nativeBuildInputs = [ wrapQtAppsHook ];
54   buildInputs = [ ] ++ lib.optional stdenv.hostPlatform.isLinux qtwayland;
56   postPatch = ''
57     substituteInPlace contrib/requirements/requirements.txt \
58       --replace "qdarkstyle==2.6.8" "qdarkstyle<3"
60     substituteInPlace setup.py \
61       --replace "(share_dir" "(\"share\""
62   '';
64   postInstall = lib.optionalString stdenv.hostPlatform.isLinux ''
65     substituteInPlace $out/share/applications/electron-cash.desktop \
66       --replace "Exec=electron-cash" "Exec=$out/bin/electron-cash"
67   '';
69   # If secp256k1 wasn't added to the library path, the following warning is given:
70   #
71   #   Electron Cash was unable to find the secp256k1 library on this system.
72   #   Elliptic curve cryptography operations will be performed in slow
73   #   Python-only mode.
74   preFixup = ''
75     makeWrapperArgs+=("''${qtWrapperArgs[@]}")
76     makeWrapperArgs+=(
77       "--prefix" "LD_LIBRARY_PATH" ":" "${secp256k1}/lib"
78     )
79   '';
81   doInstallCheck = true;
82   installCheckPhase = ''
83     $out/bin/electron-cash help >/dev/null
84   '';
86   meta = with lib; {
87     description = "Bitcoin Cash SPV Wallet";
88     mainProgram = "electron-cash";
89     longDescription = ''
90       An easy-to-use Bitcoin Cash client featuring wallets generated from
91       mnemonic seeds (in addition to other, more advanced, wallet options)
92       and the ability to perform transactions without downloading a copy
93       of the blockchain.
94     '';
95     homepage = "https://www.electroncash.org/";
96     platforms = platforms.unix;
97     maintainers = with maintainers; [ lassulus nyanloutre oxalica ];
98     license = licenses.mit;
99   };