about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/misc/electron-cash/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/misc/electron-cash/default.nix')
-rw-r--r--nixpkgs/pkgs/applications/misc/electron-cash/default.nix81
1 files changed, 81 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/misc/electron-cash/default.nix b/nixpkgs/pkgs/applications/misc/electron-cash/default.nix
new file mode 100644
index 000000000000..cc7b9cf27c2a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/electron-cash/default.nix
@@ -0,0 +1,81 @@
+{ lib, fetchurl, python3Packages, qtbase, makeWrapper }:
+
+python3Packages.buildPythonApplication rec {
+  pname = "electron-cash";
+  version = "4.0.7";
+
+  src = fetchurl {
+    url = "https://electroncash.org/downloads/${version}/win-linux/Electron-Cash-${version}.tar.gz";
+    # Verified using official SHA-1 and signature from
+    # https://github.com/fyookball/keys-n-hashes
+    sha256 = "d63ef2d52cff0b821b745067d752fd0c7f2902fa23eaf8e9392c54864cae5c77";
+  };
+
+  propagatedBuildInputs = with python3Packages; [
+    dnspython
+    ecdsa
+    jsonrpclib-pelix
+    matplotlib
+    pbkdf2
+    pyaes
+    pycrypto
+    pyqt5
+    pysocks
+    qrcode
+    requests
+    tlslite-ng
+    qdarkstyle
+
+    # plugins
+    keepkey
+    trezor
+    btchip
+  ];
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  postPatch = ''
+    substituteInPlace contrib/requirements/requirements.txt \
+      --replace "qdarkstyle<2.6" "qdarkstyle<3"
+
+    substituteInPlace setup.py \
+      --replace "(share_dir" "(\"share\""
+  '';
+
+  checkInputs = with python3Packages; [
+    pytest
+  ];
+
+  checkPhase = ''
+    unset HOME
+    pytest lib/tests
+  '';
+
+  postInstall = ''
+    substituteInPlace $out/share/applications/electron-cash.desktop \
+      --replace "Exec=electron-cash" "Exec=$out/bin/electron-cash"
+
+    # Please remove this when #44047 is fixed
+    wrapProgram $out/bin/electron-cash \
+      --prefix QT_PLUGIN_PATH : ${qtbase}/lib/qt-5.${lib.versions.minor qtbase.version}/plugins
+  '';
+
+  doInstallCheck = true;
+  installCheckPhase = ''
+    $out/bin/electron-cash help >/dev/null
+  '';
+
+  meta = with lib; {
+    description = "A Bitcoin Cash SPV Wallet";
+    longDescription = ''
+      An easy-to-use Bitcoin Cash client featuring wallets generated from
+      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/;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ lassulus nyanloutre ];
+    license = licenses.mit;
+  };
+}