From ae98b68b62ab0378b38c67f7ff4ab41014ef4821 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Thu, 9 May 2019 15:17:48 -0500 Subject: [PATCH 1/5] python3Packages.aiorpcx: 0.10.5 -> 0.17.0 (electrum dep) --- pkgs/development/python-modules/aiorpcx/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/aiorpcx/default.nix b/pkgs/development/python-modules/aiorpcx/default.nix index fd853e631a7..a5f54d8e96c 100644 --- a/pkgs/development/python-modules/aiorpcx/default.nix +++ b/pkgs/development/python-modules/aiorpcx/default.nix @@ -2,12 +2,12 @@ buildPythonPackage rec { pname = "aiorpcx"; - version = "0.10.5"; + version = "0.17.0"; src = fetchPypi { inherit version; pname = "aiorpcX"; - sha256 = "0c4kan020s09ap5qai7p1syxjz2wk6g9ydhxj6fc35s4103x7b91"; + sha256 = "14np5r75rs0v45vsv20vbzmnv3qisvm9mdllj1j9s1633cvcik0k"; }; propagatedBuildInputs = [ attrs ]; From d6ec298e3eafb46a54a388d8404340fd4c5f8ba0 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Thu, 9 May 2019 14:30:30 -0500 Subject: [PATCH 2/5] electrum: 3.3.4 -> 3.3.5 https://github.com/spesmilo/electrum/blob/3.3.5/RELEASE-NOTES --- pkgs/applications/misc/electrum/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/misc/electrum/default.nix b/pkgs/applications/misc/electrum/default.nix index 5f252d97d86..1c82572b0f9 100644 --- a/pkgs/applications/misc/electrum/default.nix +++ b/pkgs/applications/misc/electrum/default.nix @@ -14,13 +14,13 @@ in python3Packages.buildPythonApplication rec { pname = "electrum"; - version = "3.3.4"; + version = "3.3.5"; src = fetchFromGitHub { owner = "spesmilo"; repo = "electrum"; rev = version; - sha256 = "0yxdpc602jnd14xz3px85ka0b6db98zwbgfi9a3vj8p1k3mmiwaj"; + sha256 = "039y0z8v65ffzz6qm9wv9n29l3i2ik59xs6z6mg5pi4f5mjq05jj"; }; propagatedBuildInputs = with python3Packages; [ From 9cae933ce7cc8f46023b8952562bb728b2df13f0 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Thu, 9 May 2019 15:12:50 -0500 Subject: [PATCH 3/5] electrum: fetch from official site, check signature (manually) --- pkgs/applications/misc/electrum/default.nix | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/misc/electrum/default.nix b/pkgs/applications/misc/electrum/default.nix index 1c82572b0f9..64692e66f56 100644 --- a/pkgs/applications/misc/electrum/default.nix +++ b/pkgs/applications/misc/electrum/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, python3, python3Packages, zbar, secp256k1 }: +{ stdenv, fetchurl, python3, python3Packages, zbar, secp256k1 }: let qdarkstyle = python3Packages.buildPythonPackage rec { @@ -16,11 +16,9 @@ python3Packages.buildPythonApplication rec { pname = "electrum"; version = "3.3.5"; - src = fetchFromGitHub { - owner = "spesmilo"; - repo = "electrum"; - rev = version; - sha256 = "039y0z8v65ffzz6qm9wv9n29l3i2ik59xs6z6mg5pi4f5mjq05jj"; + src = fetchurl { + url = "https://download.electrum.org/${version}/Electrum-${version}.tar.gz"; + sha256 = "1csj0n96zlajnrs39wsazfj5lmy7v7n77cdz56lr8nkmchh6k9z1"; }; propagatedBuildInputs = with python3Packages; [ From a879c725525b2321f505519ff0c71f182518f438 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Thu, 9 May 2019 15:24:21 -0500 Subject: [PATCH 4/5] electrum: fixup Exec lines in .desktop Not sure why upstream added $HOME/.local/bin to $PATH for these, but IMO that is for users to handle as they see fit. And it's not very nix-like :). --- pkgs/applications/misc/electrum/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/misc/electrum/default.nix b/pkgs/applications/misc/electrum/default.nix index 64692e66f56..81962208668 100644 --- a/pkgs/applications/misc/electrum/default.nix +++ b/pkgs/applications/misc/electrum/default.nix @@ -62,7 +62,10 @@ python3Packages.buildPythonApplication rec { rm -rf $out/${python3.sitePackages}/nix substituteInPlace $out/share/applications/electrum.desktop \ - --replace "Exec=electrum %u" "Exec=$out/bin/electrum %u" + --replace 'Exec=sh -c "PATH=\"\\$HOME/.local/bin:\\$PATH\"; electrum %u"' \ + "Exec=$out/bin/electrum %u" \ + --replace 'Exec=sh -c "PATH=\"\\$HOME/.local/bin:\\$PATH\"; electrum --testnet %u"' \ + "Exec=$out/bin/electrum --testnet %u" ''; checkInputs = with python3Packages; [ pytest ]; From 66493d7bff73b8a1275b1661972c5f7210c29110 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Thu, 9 May 2019 15:30:05 -0500 Subject: [PATCH 5/5] electrum: grab tests from github, but use signed sources Not crazy about this solution, but seems better than not running tests or ignoring upstream's signatures. --- pkgs/applications/misc/electrum/default.nix | 24 +++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/misc/electrum/default.nix b/pkgs/applications/misc/electrum/default.nix index 81962208668..6185b7d228f 100644 --- a/pkgs/applications/misc/electrum/default.nix +++ b/pkgs/applications/misc/electrum/default.nix @@ -1,6 +1,8 @@ -{ stdenv, fetchurl, python3, python3Packages, zbar, secp256k1 }: +{ stdenv, fetchurl, fetchFromGitHub, python3, python3Packages, zbar, secp256k1 }: let + version = "3.3.5"; + qdarkstyle = python3Packages.buildPythonPackage rec { pname = "QDarkStyle"; version = "2.5.4"; @@ -10,17 +12,35 @@ let }; doCheck = false; # no tests }; + + # Not provided in official source releases, which are what upstream signs. + tests = fetchFromGitHub { + owner = "spesmilo"; + repo = "electrum"; + rev = version; + sha256 = "11rzzrv5xxqazcb7q1ig93d6cisqmd1x0jrgvfgzysbzvi51gg11"; + + extraPostFetch = '' + mv $out ./all + mv ./all/electrum/tests $out + ''; + }; in python3Packages.buildPythonApplication rec { pname = "electrum"; - version = "3.3.5"; + inherit version; src = fetchurl { url = "https://download.electrum.org/${version}/Electrum-${version}.tar.gz"; sha256 = "1csj0n96zlajnrs39wsazfj5lmy7v7n77cdz56lr8nkmchh6k9z1"; }; + postUnpack = '' + # can't symlink, tests get confused + cp -ar ${tests} $sourceRoot/electrum/tests + ''; + propagatedBuildInputs = with python3Packages; [ aiorpcx aiohttp