From 66493d7bff73b8a1275b1661972c5f7210c29110 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Thu, 9 May 2019 15:30:05 -0500 Subject: [PATCH] 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 819622086689..6185b7d228f8 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