electron-cash: 4.3.1 -> 4.4.2, fix build and tests (#376281)

authored by Arne Keller and committed by GitHub cb60862b 107f72ad

+39 -24
+39 -22
pkgs/applications/misc/electron-cash/default.nix pkgs/by-name/el/electron-cash/package.nix
··· 1 - { lib, stdenv, fetchFromGitHub, python3Packages, wrapQtAppsHook 2 - , secp256k1, qtwayland }: 3 4 python3Packages.buildPythonApplication rec { 5 pname = "electron-cash"; 6 - version = "4.3.1"; 7 8 src = fetchFromGitHub { 9 owner = "Electron-Cash"; 10 repo = "Electron-Cash"; 11 tag = version; 12 - sha256 = "sha256-xOyj5XerOwgfvI0qj7+7oshDvd18h5IeZvcJTis8nWo="; 13 }; 14 15 build-system = with python3Packages; [ ··· 38 psutil 39 pycryptodomex 40 cryptography 41 42 # requirements-hw 43 trezor ··· 49 pysatochip 50 ]; 51 52 - nativeBuildInputs = [ wrapQtAppsHook ]; 53 54 - buildInputs = [ ] ++ lib.optional stdenv.hostPlatform.isLinux qtwayland; 55 - 56 - postPatch = '' 57 - substituteInPlace contrib/requirements/requirements.txt \ 58 - --replace "qdarkstyle==2.6.8" "qdarkstyle<3" 59 - 60 - substituteInPlace setup.py \ 61 - --replace "(share_dir" "(\"share\"" 62 - ''; 63 64 # If secp256k1 wasn't added to the library path, the following warning is given: 65 # 66 # Electron Cash was unable to find the secp256k1 library on this system. 67 # Elliptic curve cryptography operations will be performed in slow 68 # Python-only mode. 69 preFixup = '' 70 makeWrapperArgs+=("''${qtWrapperArgs[@]}") 71 - makeWrapperArgs+=( 72 - "--prefix" "LD_LIBRARY_PATH" ":" "${secp256k1}/lib" 73 - ) 74 ''; 75 76 doInstallCheck = true; 77 installCheckPhase = '' 78 - $out/bin/electron-cash help >/dev/null 79 ''; 80 81 - meta = with lib; { 82 description = "Bitcoin Cash SPV Wallet"; 83 mainProgram = "electron-cash"; 84 longDescription = '' ··· 88 of the blockchain. 89 ''; 90 homepage = "https://www.electroncash.org/"; 91 - platforms = platforms.unix; 92 - maintainers = with maintainers; [ lassulus nyanloutre oxalica ]; 93 - license = licenses.mit; 94 }; 95 }
··· 1 + { 2 + lib, 3 + stdenv, 4 + fetchFromGitHub, 5 + python3Packages, 6 + qt5, 7 + secp256k1, 8 + }: 9 10 python3Packages.buildPythonApplication rec { 11 pname = "electron-cash"; 12 + version = "4.4.2"; 13 14 src = fetchFromGitHub { 15 owner = "Electron-Cash"; 16 repo = "Electron-Cash"; 17 tag = version; 18 + sha256 = "sha256-hqaPxetS6JONvlRMjNonXUGFpdmnuadD00gcPzY07x0="; 19 }; 20 21 build-system = with python3Packages; [ ··· 44 psutil 45 pycryptodomex 46 cryptography 47 + zxing-cpp 48 49 # requirements-hw 50 trezor ··· 56 pysatochip 57 ]; 58 59 + nativeBuildInputs = [ qt5.wrapQtAppsHook ]; 60 61 + buildInputs = [ ] ++ lib.optional stdenv.hostPlatform.isLinux qt5.qtwayland; 62 63 # If secp256k1 wasn't added to the library path, the following warning is given: 64 # 65 # Electron Cash was unable to find the secp256k1 library on this system. 66 # Elliptic curve cryptography operations will be performed in slow 67 # Python-only mode. 68 + # 69 + # Upstream hardcoded `libsecp256k1.so.0` where we provides 70 + # `libsecp256k1.so.5`. The only breaking change is the removal of two 71 + # functions which seem not used by electron-cash. 72 + # See: <https://github.com/Electron-Cash/Electron-Cash/issues/3009> 73 + postPatch = '' 74 + substituteInPlace setup.py \ 75 + --replace-fail "(share_dir" '("share"' 76 + substituteInPlace electroncash/secp256k1.py \ 77 + --replace-fail "libsecp256k1.so.0" "${secp256k1}/lib/libsecp256k1.so.5" 78 + ''; 79 + 80 preFixup = '' 81 makeWrapperArgs+=("''${qtWrapperArgs[@]}") 82 ''; 83 84 doInstallCheck = true; 85 installCheckPhase = '' 86 + output="$($out/bin/electron-cash help 2>&1)" 87 + if [[ "$output" == *"failed to load"* ]]; then 88 + echo "$output" 89 + echo "Forbidden text detected: failed to load" 90 + exit 1 91 + fi 92 ''; 93 94 + meta = { 95 description = "Bitcoin Cash SPV Wallet"; 96 mainProgram = "electron-cash"; 97 longDescription = '' ··· 101 of the blockchain. 102 ''; 103 homepage = "https://www.electroncash.org/"; 104 + platforms = lib.platforms.unix; 105 + maintainers = with lib.maintainers; [ 106 + lassulus 107 + nyanloutre 108 + oxalica 109 + ]; 110 + license = lib.licenses.mit; 111 }; 112 }
-2
pkgs/top-level/all-packages.nix
··· 13109 inherit (darwin.apple_sdk.frameworks) AppKit; 13110 }; 13111 13112 - electron-cash = libsForQt5.callPackage ../applications/misc/electron-cash { }; 13113 - 13114 electrum = libsForQt5.callPackage ../applications/misc/electrum { }; 13115 13116 electrum-grs = libsForQt5.callPackage ../applications/misc/electrum/grs.nix { };
··· 13109 inherit (darwin.apple_sdk.frameworks) AppKit; 13110 }; 13111 13112 electrum = libsForQt5.callPackage ../applications/misc/electrum { }; 13113 13114 electrum-grs = libsForQt5.callPackage ../applications/misc/electrum/grs.nix { };