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 86 postPatch = 87 '' 88 # make compatible with protobuf4 by easing dependencies ... 89 substituteInPlace ./contrib/requirements/requirements.txt \ 90 - --replace "protobuf>=3.20,<4" "protobuf>=3.20" 91 # ... and regenerating the paymentrequest_pb2.py file 92 protoc --python_out=. electrum/paymentrequest.proto 93 94 substituteInPlace ./electrum/ecc_fast.py \ 95 - --replace ${libsecp256k1_name} ${secp256k1}/lib/libsecp256k1${stdenv.hostPlatform.extensions.sharedLibrary} 96 '' 97 + ( 98 if enableQt then 99 '' 100 substituteInPlace ./electrum/qrscanner.py \ 101 - --replace ${libzbar_name} ${zbar.lib}/lib/libzbar${stdenv.hostPlatform.extensions.sharedLibrary} 102 '' 103 else 104 '' ··· 108 109 postInstall = lib.optionalString stdenv.hostPlatform.isLinux '' 110 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" 115 ''; 116 117 postFixup = lib.optionalString enableQt ''
··· 85 86 postPatch = 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 + 99 # make compatible with protobuf4 by easing dependencies ... 100 substituteInPlace ./contrib/requirements/requirements.txt \ 101 + --replace-fail "protobuf>=3.20,<4" "protobuf>=3.20" 102 # ... and regenerating the paymentrequest_pb2.py file 103 protoc --python_out=. electrum/paymentrequest.proto 104 105 substituteInPlace ./electrum/ecc_fast.py \ 106 + --replace-fail ${libsecp256k1_name} ${secp256k1}/lib/libsecp256k1${stdenv.hostPlatform.extensions.sharedLibrary} 107 '' 108 + ( 109 if enableQt then 110 '' 111 substituteInPlace ./electrum/qrscanner.py \ 112 + --replace-fail ${libzbar_name} ${zbar.lib}/lib/libzbar${stdenv.hostPlatform.extensions.sharedLibrary} 113 '' 114 else 115 '' ··· 119 120 postInstall = lib.optionalString stdenv.hostPlatform.isLinux '' 121 substituteInPlace $out/share/applications/electrum.desktop \ 122 + --replace-fail "Exec=electrum %u" "Exec=$out/bin/electrum %u" \ 123 + --replace-fail "Exec=electrum --testnet %u" "Exec=$out/bin/electrum --testnet %u" 124 ''; 125 126 postFixup = lib.optionalString enableQt ''