mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 14:10:33 +03:00
electrum: add patch for aiorpcx 0.24 compatibility (#380708)
This commit is contained in:
commit
dffcaa4da0
1 changed files with 16 additions and 7 deletions
|
@ -85,20 +85,31 @@ python3.pkgs.buildPythonApplication rec {
|
|||
|
||||
postPatch =
|
||||
''
|
||||
# fix compatibility with recent aiorpcx version
|
||||
# (remove as soon as https://github.com/spesmilo/electrum/commit/171aa5ee5ad4e25b9da10f757d9d398e905b4945 is included in source tarball)
|
||||
substituteInPlace ./contrib/requirements/requirements.txt \
|
||||
--replace-fail "aiorpcx>=0.22.0,<0.24" "aiorpcx>=0.22.0,<0.25"
|
||||
substituteInPlace ./run_electrum \
|
||||
--replace-fail "if not ((0, 22, 0) <= aiorpcx._version < (0, 24)):" "if not ((0, 22, 0) <= aiorpcx._version < (0, 25)):" \
|
||||
--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"
|
||||
substituteInPlace ./electrum/electrum \
|
||||
--replace-fail "if not ((0, 22, 0) <= aiorpcx._version < (0, 24)):" "if not ((0, 22, 0) <= aiorpcx._version < (0, 25)):" \
|
||||
--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"
|
||||
|
||||
# make compatible with protobuf4 by easing dependencies ...
|
||||
substituteInPlace ./contrib/requirements/requirements.txt \
|
||||
--replace "protobuf>=3.20,<4" "protobuf>=3.20"
|
||||
--replace-fail "protobuf>=3.20,<4" "protobuf>=3.20"
|
||||
# ... and regenerating the paymentrequest_pb2.py file
|
||||
protoc --python_out=. electrum/paymentrequest.proto
|
||||
|
||||
substituteInPlace ./electrum/ecc_fast.py \
|
||||
--replace ${libsecp256k1_name} ${secp256k1}/lib/libsecp256k1${stdenv.hostPlatform.extensions.sharedLibrary}
|
||||
--replace-fail ${libsecp256k1_name} ${secp256k1}/lib/libsecp256k1${stdenv.hostPlatform.extensions.sharedLibrary}
|
||||
''
|
||||
+ (
|
||||
if enableQt then
|
||||
''
|
||||
substituteInPlace ./electrum/qrscanner.py \
|
||||
--replace ${libzbar_name} ${zbar.lib}/lib/libzbar${stdenv.hostPlatform.extensions.sharedLibrary}
|
||||
--replace-fail ${libzbar_name} ${zbar.lib}/lib/libzbar${stdenv.hostPlatform.extensions.sharedLibrary}
|
||||
''
|
||||
else
|
||||
''
|
||||
|
@ -108,10 +119,8 @@ python3.pkgs.buildPythonApplication rec {
|
|||
|
||||
postInstall = lib.optionalString stdenv.hostPlatform.isLinux ''
|
||||
substituteInPlace $out/share/applications/electrum.desktop \
|
||||
--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"
|
||||
--replace-fail "Exec=electrum %u" "Exec=$out/bin/electrum %u" \
|
||||
--replace-fail "Exec=electrum --testnet %u" "Exec=$out/bin/electrum --testnet %u"
|
||||
'';
|
||||
|
||||
postFixup = lib.optionalString enableQt ''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue