electrum: add patch for aiorpcx 0.24 compatibility (#380708)

authored by

Pavol Rusnak and committed by
GitHub
dffcaa4d fd2451f9

+16 -7
+16 -7
pkgs/applications/misc/electrum/default.nix
··· 85 85 86 86 postPatch = 87 87 '' 88 + # fix compatibility with recent aiorpcx version 89 + # (remove as soon as https://github.com/spesmilo/electrum/commit/171aa5ee5ad4e25b9da10f757d9d398e905b4945 is included in source tarball) 90 + substituteInPlace ./contrib/requirements/requirements.txt \ 91 + --replace-fail "aiorpcx>=0.22.0,<0.24" "aiorpcx>=0.22.0,<0.25" 92 + substituteInPlace ./run_electrum \ 93 + --replace-fail "if not ((0, 22, 0) <= aiorpcx._version < (0, 24)):" "if not ((0, 22, 0) <= aiorpcx._version < (0, 25)):" \ 94 + --replace-fail "aiorpcX version {aiorpcx._version} does not match required: 0.22.0<=ver<0.24" "aiorpcX version {aiorpcx._version} does not match required: 0.22.0<=ver<0.25" 95 + substituteInPlace ./electrum/electrum \ 96 + --replace-fail "if not ((0, 22, 0) <= aiorpcx._version < (0, 24)):" "if not ((0, 22, 0) <= aiorpcx._version < (0, 25)):" \ 97 + --replace-fail "aiorpcX version {aiorpcx._version} does not match required: 0.22.0<=ver<0.24" "aiorpcX version {aiorpcx._version} does not match required: 0.22.0<=ver<0.25" 98 + 88 99 # make compatible with protobuf4 by easing dependencies ... 89 100 substituteInPlace ./contrib/requirements/requirements.txt \ 90 - --replace "protobuf>=3.20,<4" "protobuf>=3.20" 101 + --replace-fail "protobuf>=3.20,<4" "protobuf>=3.20" 91 102 # ... and regenerating the paymentrequest_pb2.py file 92 103 protoc --python_out=. electrum/paymentrequest.proto 93 104 94 105 substituteInPlace ./electrum/ecc_fast.py \ 95 - --replace ${libsecp256k1_name} ${secp256k1}/lib/libsecp256k1${stdenv.hostPlatform.extensions.sharedLibrary} 106 + --replace-fail ${libsecp256k1_name} ${secp256k1}/lib/libsecp256k1${stdenv.hostPlatform.extensions.sharedLibrary} 96 107 '' 97 108 + ( 98 109 if enableQt then 99 110 '' 100 111 substituteInPlace ./electrum/qrscanner.py \ 101 - --replace ${libzbar_name} ${zbar.lib}/lib/libzbar${stdenv.hostPlatform.extensions.sharedLibrary} 112 + --replace-fail ${libzbar_name} ${zbar.lib}/lib/libzbar${stdenv.hostPlatform.extensions.sharedLibrary} 102 113 '' 103 114 else 104 115 '' ··· 108 119 109 120 postInstall = lib.optionalString stdenv.hostPlatform.isLinux '' 110 121 substituteInPlace $out/share/applications/electrum.desktop \ 111 - --replace 'Exec=sh -c "PATH=\"\\$HOME/.local/bin:\\$PATH\"; electrum %u"' \ 112 - "Exec=$out/bin/electrum %u" \ 113 - --replace 'Exec=sh -c "PATH=\"\\$HOME/.local/bin:\\$PATH\"; electrum --testnet %u"' \ 114 - "Exec=$out/bin/electrum --testnet %u" 122 + --replace-fail "Exec=electrum %u" "Exec=$out/bin/electrum %u" \ 123 + --replace-fail "Exec=electrum --testnet %u" "Exec=$out/bin/electrum --testnet %u" 115 124 ''; 116 125 117 126 postFixup = lib.optionalString enableQt ''