Commit e3d7bbab authored by Yarny0's avatar Yarny0
Browse files

electrum: patch for aiorpcx 0.24 compatibility

electrum is quite strict about the aiorpcx version is accepts.
With commit 4bbf5300 ,

Upstream already has a patch to extend
the range of aiorpcx versions it permits:
https://github.com/spesmilo/electrum/commit/171aa5ee5ad4e25b9da10f757d9d398e905b4945
As the patch does not cleanly apply to the
distribution tarball we're using, we instead apply the
required changes "by hand", with `substituteInPlace`.
On top of the changes adapted from the upstream commit,
we have to change the file `./electrum/electrum`:
It is not part of the upstream source repository,
but it gets created from `./run_electrum` when
upstream creates the distribution tarball.

Note that the commit at hand is similar to
0e513f04 .
parent b0c4f34b
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -85,6 +85,17 @@ 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-fail "protobuf>=3.20,<4" "protobuf>=3.20"