16 if stdenv.hostPlatform.isLinux then "libsecp256k1.so.{v}"
17 else if stdenv.hostPlatform.isDarwin then "libsecp256k1.{v}.dylib"
18 else "libsecp256k1${stdenv.hostPlatform.extensions.sharedLibrary}";
21 if stdenv.hostPlatform.isLinux then "libzbar.so.0"
22 else if stdenv.hostPlatform.isDarwin then "libzbar.0.dylib"
23 else "libzbar${stdenv.hostPlatform.extensions.sharedLibrary}";
27 python3.pkgs.buildPythonApplication {
28 pname = "electrum-grs";
31 src = fetchFromGitHub {
32 owner = "Groestlcoin";
33 repo = "electrum-grs";
34 rev = "refs/tags/v${version}";
35 sha256 = "1k078jg3bw4n3kcxy917m30x1skxm679w8hcw8mlxb94ikrjc66h";
38 nativeBuildInputs = lib.optionals enableQt [ wrapQtAppsHook ];
39 buildInputs = lib.optional (stdenv.hostPlatform.isLinux && enableQt) qtwayland;
41 propagatedBuildInputs = with python3.pkgs; [
68 ] ++ lib.optionals enableQt [
73 checkInputs = with python3.pkgs; lib.optionals enableQt [
78 # make compatible with protobuf4 by easing dependencies ...
79 substituteInPlace ./contrib/requirements/requirements.txt \
80 --replace "protobuf>=3.20,<4" "protobuf>=3.20"
81 # ... and regenerating the paymentrequest_pb2.py file
82 protoc --python_out=. electrum_grs/paymentrequest.proto
84 substituteInPlace ./electrum_grs/ecc_fast.py \
85 --replace ${libsecp256k1_name} ${secp256k1}/lib/libsecp256k1${stdenv.hostPlatform.extensions.sharedLibrary}
86 '' + (if enableQt then ''
87 substituteInPlace ./electrum_grs/qrscanner.py \
88 --replace ${libzbar_name} ${zbar.lib}/lib/libzbar${stdenv.hostPlatform.extensions.sharedLibrary}
90 sed -i '/qdarkstyle/d' contrib/requirements/requirements.txt
93 postInstall = lib.optionalString stdenv.hostPlatform.isLinux ''
94 substituteInPlace $out/share/applications/electrum-grs.desktop \
95 --replace 'Exec=sh -c "PATH=\"\\$HOME/.local/bin:\\$PATH\"; electrum-grs %u"' \
96 "Exec=$out/bin/electrum-grs %u" \
97 --replace 'Exec=sh -c "PATH=\"\\$HOME/.local/bin:\\$PATH\"; electrum-grs --testnet %u"' \
98 "Exec=$out/bin/electrum-grs --testnet %u"
101 postFixup = lib.optionalString enableQt ''
102 wrapQtApp $out/bin/electrum-grs
105 # the tests are currently broken
109 $out/bin/electrum-grs help >/dev/null
113 description = "Lightweight Groestlcoin wallet";
115 An easy-to-use Groestlcoin client featuring wallets generated from
116 mnemonic seeds (in addition to other, more advanced, wallet options)
117 and the ability to perform transactions without downloading a copy
120 homepage = "https://groestlcoin.org/";
121 downloadPage = "https://github.com/Groestlcoin/electrum-grs/releases/tag/v{version}";
122 license = licenses.mit;
123 platforms = platforms.all;
124 maintainers = with maintainers; [ gruve-p ];
125 mainProgram = "electrum-grs";