Skip to content

Commit cb60862

Browse files
electron-cash: 4.3.1 -> 4.4.2, fix build and tests (#376281)
2 parents 107f72a + cf28b96 commit cb60862

File tree

2 files changed

+39
-24
lines changed

2 files changed

+39
-24
lines changed

pkgs/applications/misc/electron-cash/default.nix renamed to pkgs/by-name/el/electron-cash/package.nix

Lines changed: 39 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
1-
{ lib, stdenv, fetchFromGitHub, python3Packages, wrapQtAppsHook
2-
, secp256k1, qtwayland }:
1+
{
2+
lib,
3+
stdenv,
4+
fetchFromGitHub,
5+
python3Packages,
6+
qt5,
7+
secp256k1,
8+
}:
39

410
python3Packages.buildPythonApplication rec {
511
pname = "electron-cash";
6-
version = "4.3.1";
12+
version = "4.4.2";
713

814
src = fetchFromGitHub {
915
owner = "Electron-Cash";
1016
repo = "Electron-Cash";
1117
tag = version;
12-
sha256 = "sha256-xOyj5XerOwgfvI0qj7+7oshDvd18h5IeZvcJTis8nWo=";
18+
sha256 = "sha256-hqaPxetS6JONvlRMjNonXUGFpdmnuadD00gcPzY07x0=";
1319
};
1420

1521
build-system = with python3Packages; [
@@ -38,6 +44,7 @@ python3Packages.buildPythonApplication rec {
3844
psutil
3945
pycryptodomex
4046
cryptography
47+
zxing-cpp
4148

4249
# requirements-hw
4350
trezor
@@ -49,36 +56,42 @@ python3Packages.buildPythonApplication rec {
4956
pysatochip
5057
];
5158

52-
nativeBuildInputs = [ wrapQtAppsHook ];
59+
nativeBuildInputs = [ qt5.wrapQtAppsHook ];
5360

54-
buildInputs = [ ] ++ lib.optional stdenv.hostPlatform.isLinux qtwayland;
55-
56-
postPatch = ''
57-
substituteInPlace contrib/requirements/requirements.txt \
58-
--replace "qdarkstyle==2.6.8" "qdarkstyle<3"
59-
60-
substituteInPlace setup.py \
61-
--replace "(share_dir" "(\"share\""
62-
'';
61+
buildInputs = [ ] ++ lib.optional stdenv.hostPlatform.isLinux qt5.qtwayland;
6362

6463
# If secp256k1 wasn't added to the library path, the following warning is given:
6564
#
6665
# Electron Cash was unable to find the secp256k1 library on this system.
6766
# Elliptic curve cryptography operations will be performed in slow
6867
# Python-only mode.
68+
#
69+
# Upstream hardcoded `libsecp256k1.so.0` where we provides
70+
# `libsecp256k1.so.5`. The only breaking change is the removal of two
71+
# functions which seem not used by electron-cash.
72+
# See: <https://github.com/Electron-Cash/Electron-Cash/issues/3009>
73+
postPatch = ''
74+
substituteInPlace setup.py \
75+
--replace-fail "(share_dir" '("share"'
76+
substituteInPlace electroncash/secp256k1.py \
77+
--replace-fail "libsecp256k1.so.0" "${secp256k1}/lib/libsecp256k1.so.5"
78+
'';
79+
6980
preFixup = ''
7081
makeWrapperArgs+=("''${qtWrapperArgs[@]}")
71-
makeWrapperArgs+=(
72-
"--prefix" "LD_LIBRARY_PATH" ":" "${secp256k1}/lib"
73-
)
7482
'';
7583

7684
doInstallCheck = true;
7785
installCheckPhase = ''
78-
$out/bin/electron-cash help >/dev/null
86+
output="$($out/bin/electron-cash help 2>&1)"
87+
if [[ "$output" == *"failed to load"* ]]; then
88+
echo "$output"
89+
echo "Forbidden text detected: failed to load"
90+
exit 1
91+
fi
7992
'';
8093

81-
meta = with lib; {
94+
meta = {
8295
description = "Bitcoin Cash SPV Wallet";
8396
mainProgram = "electron-cash";
8497
longDescription = ''
@@ -88,8 +101,12 @@ python3Packages.buildPythonApplication rec {
88101
of the blockchain.
89102
'';
90103
homepage = "https://www.electroncash.org/";
91-
platforms = platforms.unix;
92-
maintainers = with maintainers; [ lassulus nyanloutre oxalica ];
93-
license = licenses.mit;
104+
platforms = lib.platforms.unix;
105+
maintainers = with lib.maintainers; [
106+
lassulus
107+
nyanloutre
108+
oxalica
109+
];
110+
license = lib.licenses.mit;
94111
};
95112
}

pkgs/top-level/all-packages.nix

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13109,8 +13109,6 @@ with pkgs;
1310913109
inherit (darwin.apple_sdk.frameworks) AppKit;
1311013110
};
1311113111

13112-
electron-cash = libsForQt5.callPackage ../applications/misc/electron-cash { };
13113-
1311413112
electrum = libsForQt5.callPackage ../applications/misc/electrum { };
1311513113

1311613114
electrum-grs = libsForQt5.callPackage ../applications/misc/electrum/grs.nix { };

0 commit comments

Comments
 (0)