15 if stdenv.isLinux then "libsecp256k1.so.{v}"
16 else if stdenv.isDarwin then "libsecp256k1.{v}.dylib"
17 else "libsecp256k1${stdenv.hostPlatform.extensions.sharedLibrary}";
20 if stdenv.isLinux then "libzbar.so.0"
21 else if stdenv.isDarwin then "libzbar.0.dylib"
22 else "libzbar${stdenv.hostPlatform.extensions.sharedLibrary}";
26 python3.pkgs.buildPythonApplication {
27 pname = "electrum-grs";
30 src = fetchFromGitHub {
31 owner = "Groestlcoin";
32 repo = "electrum-grs";
33 rev = "refs/tags/v${version}";
34 sha256 = "0fl01qdvb1z6l6kwipj1lj0qmjk3mzw25wv7yh5j1hh1f5lng0s8";
37 nativeBuildInputs = lib.optionals enableQt [ wrapQtAppsHook ];
39 propagatedBuildInputs = with python3.pkgs; [
62 ] ++ lib.optionals enableQt [
68 # make compatible with protobuf4 by easing dependencies ...
69 substituteInPlace ./contrib/requirements/requirements.txt \
70 --replace "protobuf>=3.20,<4" "protobuf>=3.20"
71 # ... and regenerating the paymentrequest_pb2.py file
72 protoc --python_out=. electrum_grs/paymentrequest.proto
74 substituteInPlace ./electrum_grs/ecc_fast.py \
75 --replace ${libsecp256k1_name} ${secp256k1}/lib/libsecp256k1${stdenv.hostPlatform.extensions.sharedLibrary}
76 '' + (if enableQt then ''
77 substituteInPlace ./electrum_grs/qrscanner.py \
78 --replace ${libzbar_name} ${zbar.lib}/lib/libzbar${stdenv.hostPlatform.extensions.sharedLibrary}
80 sed -i '/qdarkstyle/d' contrib/requirements/requirements.txt
83 postInstall = lib.optionalString stdenv.isLinux ''
84 substituteInPlace $out/share/applications/electrum-grs.desktop \
85 --replace 'Exec=sh -c "PATH=\"\\$HOME/.local/bin:\\$PATH\"; electrum-grs %u"' \
86 "Exec=$out/bin/electrum-grs %u" \
87 --replace 'Exec=sh -c "PATH=\"\\$HOME/.local/bin:\\$PATH\"; electrum-grs --testnet %u"' \
88 "Exec=$out/bin/electrum-grs --testnet %u"
91 postFixup = lib.optionalString enableQt ''
92 wrapQtApp $out/bin/electrum-grs
95 # the tests are currently broken
99 $out/bin/electrum-grs help >/dev/null
103 description = "Lightweight Groestlcoin wallet";
105 An easy-to-use Groestlcoin client featuring wallets generated from
106 mnemonic seeds (in addition to other, more advanced, wallet options)
107 and the ability to perform transactions without downloading a copy
110 homepage = "https://groestlcoin.org/";
111 downloadPage = "https://github.com/Groestlcoin/electrum-grs/releases/tag/v{version}";
112 license = licenses.mit;
113 platforms = platforms.all;
114 maintainers = with maintainers; [ gruve-p ];