SomberNight 31ed05c05c build: win: change from win-iconv to GNU libiconv
- (zbar requires [0] iconv)
- issues [1][3] compiling win-iconv:
    - pre-existing issue: lots of "-Wincompatible-pointer-types" warnings when compiling zbar with win-iconv
    - new debian means newer GCC
    - new GCC changed that [2] warning type to "error"
- GNU libiconv works as an alternative
    - drawback: win-iconv is more minimal, it uses the win32 API to do most of the work
    - still, is a 25+ year old GNU project with one release every ~2 years, so IMO fine

[0]: https://github.com/mchehab/zbar/blob/a549566ea11eb03622bd4458a1728ffe3f589163/README-windows.md
[1]: https://github.com/SomberNight/electrum/commit/cb00cb60cf9a0cb059dcac5e7acfe5186620cabe
[2]: https://gcc.gnu.org/pipermail/gcc-cvs/2023-December/394351.html

[3]: see snippet when compiling libzbar:
```
decoder.c: In function ‘zbar_decoder_reset’:
decoder.c:116:22: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  116 |     memset(dcode, 0, (long)&dcode->buf_alloc - (long)dcode);
      |                      ^
decoder.c:116:48: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  116 |     memset(dcode, 0, (long)&dcode->buf_alloc - (long)dcode);
      |                                                ^
  CC       processor/libzbar_la-win.lo
/bin/bash ../libtool --tag=RC   \
--mode=compile x86_64-w64-mingw32-windres -DHAVE_CONFIG_H -I. -I../include  \
-I../include  -o libzbar-rc.lo libzbar.rc
  CC       processor/libzbar_la-lock.lo
  CC       decoder/libzbar_la-qr_finder.lo
  CC       qrcode/libzbar_la-qrdec.lo
In file included from ./processor.h:26,
                 from processor/lock.c:25:
../include/config.h:423:9: warning: "_WIN32_WINNT" redefined
  423 | #define _WIN32_WINNT 0x0500
      |         ^~~~~~~~~~~~
In file included from /usr/share/mingw-w64/include/corecrt.h:10,
                 from /usr/share/mingw-w64/include/crtdefs.h:10,
                 from /usr/share/mingw-w64/include/assert.h:15,
                 from processor/lock.c:24:
/usr/share/mingw-w64/include/_mingw.h:232:9: note: this is the location of the previous definition
  232 | #define _WIN32_WINNT 0xa00
      |         ^~~~~~~~~~~~
libtool: compile:  x86_64-w64-mingw32-windres -DHAVE_CONFIG_H -I. -I../include -I../include libzbar.rc  -o .libs/libzbar-rc.o
  CC       qrcode/libzbar_la-qrdectxt.lo
  CC       qrcode/libzbar_la-rs.lo
  CC       qrcode/libzbar_la-isaac.lo
  CC       qrcode/libzbar_la-bch15_5.lo
  CC       qrcode/libzbar_la-binarize.lo
  CC       qrcode/libzbar_la-util.lo
In file included from ./image.h:26,
                 from qrcode/binarize.c:10:
../include/config.h:423:9: warning: "_WIN32_WINNT" redefined
  423 | #define _WIN32_WINNT 0x0500
      |         ^~~~~~~~~~~~
In file included from /usr/share/mingw-w64/include/corecrt.h:10,
                 from /usr/share/mingw-w64/include/crtdefs.h:10,
                 from /usr/share/mingw-w64/include/math.h:13,
                 from qrcode/binarize.c:7:
/usr/share/mingw-w64/include/_mingw.h:232:9: note: this is the location of the previous definition
  232 | #define _WIN32_WINNT 0xa00
      |         ^~~~~~~~~~~~
  CC       video/libzbar_la-dshow.lo
  CC       window/libzbar_la-win.lo
In file included from ./window.h:26,
                 from window/win.c:26:
../include/config.h:423:9: warning: "_WIN32_WINNT" redefined
  423 | #define _WIN32_WINNT 0x0500
      |         ^~~~~~~~~~~~
In file included from /usr/share/mingw-w64/include/corecrt.h:10,
                 from /usr/share/mingw-w64/include/crtdefs.h:10,
                 from /usr/share/mingw-w64/include/ctype.h:9,
                 from window/win.c:24:
/usr/share/mingw-w64/include/_mingw.h:232:9: note: this is the location of the previous definition
  232 | #define _WIN32_WINNT 0xa00
      |         ^~~~~~~~~~~~
In file included from ./processor.h:26,
                 from processor/win.c:29:
../include/config.h:423:9: warning: "_WIN32_WINNT" redefined
  423 | #define _WIN32_WINNT 0x0500
      |         ^~~~~~~~~~~~
In file included from /usr/share/mingw-w64/include/corecrt.h:10,
                 from /usr/share/mingw-w64/include/crtdefs.h:10,
                 from /usr/share/mingw-w64/include/assert.h:15,
                 from processor/win.c:24:
/usr/share/mingw-w64/include/_mingw.h:232:9: note: this is the location of the previous definition
  232 | #define _WIN32_WINNT 0xa00
      |         ^~~~~~~~~~~~
processor/win.c: In function ‘_zbar_processor_open’:
processor/win.c:282:47: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  282 |     proc->display = CreateWindowEx(EXT_STYLE, (LPCTSTR)(long)wca, "ZBar",
      |                                               ^
processor/win.c: In function ‘_zbar_processor_close’:
processor/win.c:297:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  297 |         UnregisterClass((LPCTSTR)(long)proc->state->registeredClass, 0);
      |                         ^
  CC       window/libzbar_la-dib.lo
qrcode/qrdectxt.c: In function ‘qr_code_data_list_extract_text’:
qrcode/qrdectxt.c:302:62: error: passing argument 2 of ‘iconv’ from incompatible pointer type [-Wincompatible-pointer-types]
  302 |                                               iconv(utf8_cd, &in, &inleft, &out,
      |                                                              ^~~
      |                                                              |
      |                                                              char **
In file included from qrcode/qrdectxt.c:12:
/usr/x86_64-w64-mingw32/include/iconv.h:43:56: note: expected ‘const char **’ but argument is of type ‘char **’
   43 |         size_t iconv(iconv_t cd, WINICONV_CONST char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
qrcode/qrdectxt.c:352:71: error: passing argument 2 of ‘iconv’ from incompatible pointer type [-Wincompatible-pointer-types]
  352 |                                             err = iconv(enc_list[ei], &in,
      |                                                                       ^~~
      |                                                                       |
      |                                                                       char **
/usr/x86_64-w64-mingw32/include/iconv.h:43:56: note: expected ‘const char **’ but argument is of type ‘char **’
   43 |         size_t iconv(iconv_t cd, WINICONV_CONST char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
qrcode/qrdectxt.c:374:53: error: passing argument 2 of ‘iconv’ from incompatible pointer type [-Wincompatible-pointer-types]
  374 |                                       iconv(eci_cd, &in, &inleft, &out,
      |                                                     ^~~
      |                                                     |
      |                                                     char **
/usr/x86_64-w64-mingw32/include/iconv.h:43:56: note: expected ‘const char **’ but argument is of type ‘char **’
   43 |         size_t iconv(iconv_t cd, WINICONV_CONST char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
make[2]: *** [Makefile:1089: qrcode/libzbar_la-qrdectxt.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/opt/wine64/drive_c/electrum/contrib/zbar/zbar'
make[1]: *** [Makefile:1895: all-recursive] Error 1
make[1]: Leaving directory '/opt/wine64/drive_c/electrum/contrib/zbar'
make: *** [Makefile:989: all] Error 2
🗯 ERROR: Could not build zbar
🗯 ERROR: Could not build zbar

```
2026-02-28 07:41:45 +00:00
2026-02-26 17:49:31 +00:00
2021-09-13 16:20:54 +00:00
2022-08-10 17:32:23 +02:00
2023-09-05 12:32:38 +00:00
2024-02-21 16:12:22 +00:00
2026-02-26 17:38:12 +00:00
2023-11-13 15:45:05 +00:00

Electrum - Lightweight Bitcoin client

Licence: MIT Licence
Author: Thomas Voegtlin
Language: Python (>= 3.10)
Homepage: https://electrum.org/

Build Status Test coverage statistics Help translate Electrum online

Getting started

(If you've come here looking to simply run Electrum, you may download it here.)

Electrum itself is pure Python, and so are most of the required dependencies, but not everything. The following sections describe how to run from source, but here is a TL;DR:

$ sudo apt-get install libsecp256k1-dev
$ ELECTRUM_ECC_DONT_COMPILE=1 python3 -m pip install --user ".[gui,crypto]"

Not pure-python dependencies

Qt GUI

If you want to use the Qt interface, install the Qt dependencies:

$ sudo apt-get install python3-pyqt6

libsecp256k1

For elliptic curve operations, libsecp256k1 is a required dependency.

If you "pip install" Electrum, by default libsecp will get compiled locally, as part of the electrum-ecc dependency. This can be opted-out of, by setting the ELECTRUM_ECC_DONT_COMPILE=1 environment variable. For the compilation to work, besides a C compiler, you need at least:

$ sudo apt-get install automake libtool

If you opt out of the compilation, you need to provide libsecp in another way, e.g.:

$ sudo apt-get install libsecp256k1-dev

cryptography

Due to the need for fast symmetric ciphers, cryptography is required. Install from your package manager (or from pip):

$ sudo apt-get install python3-cryptography

hardware-wallet support

If you would like hardware wallet support, see this.

Running from tar.gz

If you downloaded the official package (tar.gz), you can run Electrum from its root directory without installing it on your system; all the pure python dependencies are included in the 'packages' directory. To run Electrum from its root directory, just do:

$ ./run_electrum

You can also install Electrum on your system, by running this command:

$ sudo apt-get install python3-setuptools python3-pip
$ python3 -m pip install --user .

This will download and install the Python dependencies used by Electrum instead of using the 'packages' directory. It will also place an executable named electrum in ~/.local/bin, so make sure that is on your PATH variable.

Development version (git clone)

(For OS-specific instructions, see here for Windows, and for macOS)

Check out the code from GitHub:

$ git clone https://github.com/spesmilo/electrum.git
$ cd electrum
$ git submodule update --init

Run install (this should install dependencies):

$ python3 -m pip install --user -e .

Create translations (optional):

$ sudo apt-get install gettext
$ ./contrib/locale/build_locale.sh electrum/locale/locale electrum/locale/locale

Finally, to start Electrum:

$ ./run_electrum

Run tests

Run unit tests with pytest:

$ pytest tests -v

(can be parallelized with -n auto option, using pytest-xdist plugin)

To run a single file, specify it directly like this:

$ pytest tests/test_bitcoin.py -v

Creating Binaries

Contributing

Any help testing the software, reporting or fixing bugs, reviewing pull requests and recent changes, writing tests, or helping with outstanding issues is very welcome. Implementing new features, or improving/refactoring the codebase, is of course also welcome, but to avoid wasted effort, especially for larger changes, we encourage discussing these on the issue tracker or IRC first.

Besides GitHub, most communication about Electrum development happens on IRC, in the #electrum channel on Libera Chat. The easiest way to participate on IRC is with the web client, web.libera.chat.

Please improve translations on Crowdin.

S
Description
repository temporaneo
Readme 73 MiB
Languages
Python 89.2%
QML 8.3%
Shell 1.9%
Dockerfile 0.2%
Java 0.2%
Other 0.2%