Commit b0c4f34b authored by Yarny0's avatar Yarny0
Browse files

electrum: substitute with `--replace-fail`

The old `--replace` is deprecated,
we use `--replace-fail` so changes in source code that
might invalidate substitute invocations get noticed.

Cf. commit e07a2fab .
parent 32e09278
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -87,18 +87,18 @@ python3.pkgs.buildPythonApplication rec {
    ''
      # 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,8 +108,8 @@ python3.pkgs.buildPythonApplication rec {

  postInstall = lib.optionalString stdenv.hostPlatform.isLinux ''
    substituteInPlace $out/share/applications/electrum.desktop \
      --replace "Exec=electrum %u" "Exec=$out/bin/electrum %u" \
      --replace "Exec=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 ''