about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/misc/electrum/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/misc/electrum/default.nix')
-rw-r--r--nixpkgs/pkgs/applications/misc/electrum/default.nix42
1 files changed, 25 insertions, 17 deletions
diff --git a/nixpkgs/pkgs/applications/misc/electrum/default.nix b/nixpkgs/pkgs/applications/misc/electrum/default.nix
index d1011548b2a6..ad26a912e781 100644
--- a/nixpkgs/pkgs/applications/misc/electrum/default.nix
+++ b/nixpkgs/pkgs/applications/misc/electrum/default.nix
@@ -1,7 +1,11 @@
-{ stdenv, fetchurl, fetchFromGitHub, wrapQtAppsHook, python3, python3Packages, zbar, secp256k1
-, enableQt ? !stdenv.isDarwin
-
-
+{ stdenv
+, fetchurl
+, fetchFromGitHub
+, wrapQtAppsHook
+, python3
+, zbar
+, secp256k1
+, enableQt ? true
 # for updater.nix
 , writeScript
 , common-updater-scripts
@@ -15,7 +19,15 @@
 }:
 
 let
-  version = "3.3.8";
+  version = "4.0.3";
+
+  # electrum is not compatible with dnspython 2.0.0 yet
+  # use the latest 1.x release instead
+  py = python3.override {
+    packageOverrides = self: super: {
+      dnspython = super.dnspython_1;
+    };
+  };
 
   libsecp256k1_name =
     if stdenv.isLinux then "libsecp256k1.so.0"
@@ -31,7 +43,7 @@ let
     owner = "spesmilo";
     repo = "electrum";
     rev = version;
-    sha256 = "1di8ba77kgapcys0d7h5nx1qqakv3s60c6sp8skw8p69ramsl73c";
+    sha256 = "1r40i0v7nm35m3pzbd0l5z4qphl13s31l9v5njmyvpfjirdmhjbv";
 
     extraPostFetch = ''
       mv $out ./all
@@ -40,13 +52,13 @@ let
   };
 in
 
-python3Packages.buildPythonApplication {
+py.pkgs.buildPythonApplication {
   pname = "electrum";
   inherit version;
 
   src = fetchurl {
     url = "https://download.electrum.org/${version}/Electrum-${version}.tar.gz";
-    sha256 = "1g00cj1pmckd4xis8r032wmraiv3vd3zc803hnyxa2bnhj8z3bg2";
+    sha256 = "0q891fgzxvyzjxfczynx92hvclfs8i3nr5nr9sgbvz13hsg4s6lg";
   };
 
   postUnpack = ''
@@ -56,31 +68,28 @@ python3Packages.buildPythonApplication {
 
   nativeBuildInputs = stdenv.lib.optionals enableQt [ wrapQtAppsHook ];
 
-  propagatedBuildInputs = with python3Packages; [
-    aiorpcx
+  propagatedBuildInputs = with py.pkgs; [
     aiohttp
     aiohttp-socks
+    aiorpcx
+    attrs
+    bitstring
     dnspython
     ecdsa
     jsonrpclib-pelix
     matplotlib
     pbkdf2
     protobuf
-    pyaes
     pycryptodomex
     pysocks
     qrcode
     requests
     tlslite-ng
-
     # plugins
     ckcc-protocol
     keepkey
     trezor
     btchip
-
-    # TODO plugins
-    # amodem
   ] ++ stdenv.lib.optionals enableQt [ pyqt5 qdarkstyle ];
 
   preBuild = ''
@@ -90,7 +99,6 @@ python3Packages.buildPythonApplication {
   '' + (if enableQt then ''
     substituteInPlace ./electrum/qrscanner.py \
       --replace ${libzbar_name} ${zbar.lib}/lib/libzbar${stdenv.hostPlatform.extensions.sharedLibrary}
-    sed -i 's/qdarkstyle<2.7/qdarkstyle<3.0/' contrib/requirements/requirements.txt
   '' else ''
     sed -i '/qdarkstyle/d' contrib/requirements/requirements.txt
   '');
@@ -113,7 +121,7 @@ python3Packages.buildPythonApplication {
     wrapQtApp $out/bin/electrum
   '';
 
-  checkInputs = with python3Packages; [ pytest ];
+  checkInputs = with py.pkgs; [ pytest ];
 
   checkPhase = ''
     py.test electrum/tests