LNURL-W/P can also be encoded in lud-17 form instead of bech32.
https://github.com/lnurl/luds/blob/luds/17.md
e.g.
lnurlw://example.com/api/test123
lnurlp://example.com/api/test123
- (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
```
Extend "create new user to avoid using root" copypasta to support being run as root
(ARG UID=0).
When running build.sh directly on a cirrus CI runner, we are running as root.
from https://stackoverflow.com/a/69088164
I am trying to run the build.sh scripts directly on a cirrus CI runner, and "docker run -it" is erroring due to lack of a tty.
Adds a check to the Windows nsis installer and uninstaller
that will show an error popup if Electrum is still running to prevent
a broken installation that happen if the installer only partly
overwrites the existing installation (see #6748).
This works by trying to open the .exe files in the Electrum installation
directory in append mode, if Electrum is still running the installer
will not be able to open the .exe and the check fails.
Based on https://github.com/Electron-Cash/Electron-Cash/pull/2185
If osslsigncode is missing `build-wine/unsign.sh` fails silently with
status code 0 causing the `release.sh` script to interpret the result as
valid and skipping the actual comparison of the windows binaries.
probably since qt6 migration many symlinks inside the .app in bundled PyQt were broken:
```
$ cp -r $HOME/electrum/dist/Electrum.app Electrum-ghost3.app
cp: /Users/vagrant/electrum/dist/Electrum.app/Contents/Resources/PyQt6/Qt6/lib/QtMultimediaQuick.framework/QtMultimediaQuick: No such file or directory
cp: /Users/vagrant/electrum/dist/Electrum.app/Contents/Resources/PyQt6/Qt6/lib/QtQuickTimeline.framework/QtQuickTimeline: No such file or directory
cp: /Users/vagrant/electrum/dist/Electrum.app/Contents/Resources/PyQt6/Qt6/lib/QtQuickControls2.framework/QtQuickControls2: No such file or directory
```
We were stripping out lots of datas/binaries from Qt from the mac build artifact, leaving behind dangling symlinks.
Instead of adding more hacks on top of the current hacks to also rm the dangling links, I tried to clean up this blacklisting.
There was no issue re the Windows build, no symlinks there, but I like to keep these two spec files in sync.
-----
Some numbers:
- mac:
- without any exclusions at all, the mac .dmg is 80 MiB.
- with these exclusions it is 57 MiB.
- win:
- (haven't built without exclusions.)
- with the previous stripping strategy, exes were 68M/68M/50M
- with these exclusions, exes are 66M/66M/50M
trezor==0.13.10 pulls in new dep "slip10", which relies on importlib magic
see https://github.com/trezor/python-slip10/blob/19561f04298ae24a9623464b82b765504f1f0bcd/slip10/__init__.py#L6
```
10.13 | E | plugins.trezor.trezor | error importing trezor plugin deps
Traceback (most recent call last):
File "importlib/metadata/__init__.py", line 397, in from_name
StopIteration
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "electrum/plugins/trezor/trezor.py", line 29, in <module>
from .clientbase import TrezorClientBase, RecoveryDeviceInputMethod
File "PyInstaller/loader/pyimod02_importers.py", line 450, in exec_module
File "electrum/plugins/trezor/clientbase.py", line 18, in <module>
import trezorlib.device
File "PyInstaller/loader/pyimod02_importers.py", line 450, in exec_module
File "trezorlib/device.py", line 27, in <module>
File "PyInstaller/loader/pyimod02_importers.py", line 450, in exec_module
File "slip10/__init__.py", line 6, in <module>
File "importlib/metadata/__init__.py", line 889, in version
File "importlib/metadata/__init__.py", line 862, in distribution
File "importlib/metadata/__init__.py", line 399, in from_name
importlib.metadata.PackageNotFoundError: No package metadata was found for slip10
```
- this merges `contrib/deterministic-build/locale` and `electrum/locale`
- it is now once again possible have translations when running from a local git clone
- which was already possible in the past before crowdin removed their unauthenticated APIs
- see https://github.com/spesmilo/electrum/issues/9531
- however, the translations available are the often-old frozen strings from electrum-locale
- while previously one could just download the latest strings from crowdin
Haven't checked if electrum-ecc compiles libsecp reproducibly.
For now let's just keep the old flow.
(but if we spent time on making that compilation reproducible,
the appimage and the macos builds could use it directly)
setup exe used to install Electrum to `C:\Program Files (x86)\Electrum`,
but now as the binaries are amd64, we should install to `C:\Program Files\Electrum`.
With this change, based on my experiments, looks like if there is an existing install,
nsis will keep using that path, but if it's a fresh install, it will now use the 64-bit path.
follow-up https://github.com/spesmilo/electrum/commit/fcc4e1d38773da0484910cacc80c16117b9c15c5
Looks like upstream key file changed. Still the same crypto key, just updated expiration date.
```
$ sha256sum winehq_20*
78b185fabdb323971d13bd329fefc8038e08559aa51c4996de18db0639a51df6 *winehq_2019.key
d965d646defe94b3dfba6d5b4406900ac6c81065428bf9d9303ad7a72ee8d1b8 *winehq_2024.key
$ gpg winehq_2019.key
gpg: WARNING: no command supplied. Trying to guess what you mean ...
pub rsa3072 2018-12-10 [SC]
D43F640145369C51D786DDEA76F1A20FF987672F
uid WineHQ packages <wine-devel@winehq.org>
sub rsa3072 2018-12-10 [E] [expired: 2020-12-09]
$ gpg winehq_2024.key
gpg: WARNING: no command supplied. Trying to guess what you mean ...
pub rsa3072 2018-12-10 [SC]
D43F640145369C51D786DDEA76F1A20FF987672F
uid WineHQ packages <wine-devel@winehq.org>
sub rsa3072 2018-12-10 [E]
```
Co-authored-by: SomberNight <somber.night@protonmail.com>
Ah ok, I give up for now... the prev does not really work.
The prior commit works on Windows but not on macOS.
On Windows, it would package all plugins as code and only as code.
On MacOS however, it would not package any plugins at all. And with this commit,
where I mark the plugins folder to be packaged as *data*, it packages all plugins as *both* code and data.
Not sure why.
Let's just package all plugins as both code and data, and ignore the code instances explicitly...