1
0
Commit Graph

95 Commits

Author SHA1 Message Date
SomberNight
ecf4e3db48 mac build: compare_dmg script: if binaries mismatch, print the diff 2022-05-27 17:48:18 +02:00
SomberNight
2362d6d010 follow-up "remove email plugin"
follow-up c67c4e95dc
2022-05-24 18:33:19 +02:00
Jamie C. Driver
15f108aaa5 Add support for the Blockstream Jade hww 2022-05-20 16:03:46 +01:00
SomberNight
6c05de6fb9 osx arm notes: simplify
note: `pip install ".[crypto]"` needs quotes on macOS, at least in the default `zsh` shell.
The quotes are not needed on Ubuntu using bash, or on Windows using powershell.
```
user@users-iMac electrum % python3 -m pip install --user -e .[crypto]
zsh: no matches found: .[crypto]
```
2022-04-08 20:22:50 +02:00
Bitkarrot
36a685d560 Notes for Apple M1 build from source (#7747)
* Create notes_for_arm.md
2022-04-08 18:12:12 +00:00
SomberNight
ea21ae35e8 mac build: add workaround for installing pyinstaller with setuptools 61
- the mac build broke with 184e122c36
- upstream fix is at https://github.com/pyinstaller/pyinstaller/pull/6701
  however, we are using an old version of pyinstaller atm, so this workaround is easier

log excerpt of failed build:
```
💬 INFO:  Installing PyInstaller.
Processing ./contrib/osx/.cache/pyinstaller
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [42 lines of output]
      Traceback (most recent call last):
        File "/Users/user/wspace/electrum/contrib/osx/build-venv/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/Users/user/wspace/electrum/contrib/osx/build-venv/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/Users/user/wspace/electrum/contrib/osx/build-venv/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 164, in prepare_metadata_for_build_wheel
          return hook(metadata_directory, config_settings)
        File "/Users/user/wspace/electrum/contrib/osx/build-venv/lib/python3.9/site-packages/setuptools/build_meta.py", line 188, in prepare_metadata_for_build_wheel
          self.run_setup()
        File "/Users/user/wspace/electrum/contrib/osx/build-venv/lib/python3.9/site-packages/setuptools/build_meta.py", line 281, in run_setup
          super(_BuildMetaLegacyBackend,
        File "/Users/user/wspace/electrum/contrib/osx/build-venv/lib/python3.9/site-packages/setuptools/build_meta.py", line 174, in run_setup
          exec(compile(code, __file__, 'exec'), locals())
        File "setup.py", line 75, in <module>
          setup(
        File "/Users/user/wspace/electrum/contrib/osx/build-venv/lib/python3.9/site-packages/setuptools/__init__.py", line 87, in setup
          return distutils.core.setup(**attrs)
        File "/Users/user/wspace/electrum/contrib/osx/build-venv/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 122, in setup
          dist.parse_config_files()
        File "/Users/user/wspace/electrum/contrib/osx/build-venv/lib/python3.9/site-packages/setuptools/dist.py", line 850, in parse_config_files
          setupcfg.parse_configuration(
        File "/Users/user/wspace/electrum/contrib/osx/build-venv/lib/python3.9/site-packages/setuptools/config/setupcfg.py", line 167, in parse_configuration
          meta.parse()
        File "/Users/user/wspace/electrum/contrib/osx/build-venv/lib/python3.9/site-packages/setuptools/config/setupcfg.py", line 446, in parse
          section_parser_method(section_options)
        File "/Users/user/wspace/electrum/contrib/osx/build-venv/lib/python3.9/site-packages/setuptools/config/setupcfg.py", line 417, in parse_section
          self[name] = value
        File "/Users/user/wspace/electrum/contrib/osx/build-venv/lib/python3.9/site-packages/setuptools/config/setupcfg.py", line 238, in __setitem__
          value = parser(value)
        File "/Users/user/wspace/electrum/contrib/osx/build-venv/lib/python3.9/site-packages/setuptools/config/setupcfg.py", line 552, in _parse_version
          return expand.version(self._parse_attr(value, self.package_dir, self.root_dir))
        File "/Users/user/wspace/electrum/contrib/osx/build-venv/lib/python3.9/site-packages/setuptools/config/setupcfg.py", line 372, in _parse_attr
          return expand.read_attr(attr_desc, package_dir, root_dir)
        File "/Users/user/wspace/electrum/contrib/osx/build-venv/lib/python3.9/site-packages/setuptools/config/expand.py", line 194, in read_attr
          module = _load_spec(spec, module_name)
        File "/Users/user/wspace/electrum/contrib/osx/build-venv/lib/python3.9/site-packages/setuptools/config/expand.py", line 214, in _load_spec
          spec.loader.exec_module(module)  # type: ignore
        File "<frozen importlib._bootstrap_external>", line 850, in exec_module
        File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
        File "/Users/user/wspace/electrum/contrib/osx/.cache/pyinstaller/PyInstaller.py", line 16, in <module>
          from PyInstaller.__main__ import run
      ModuleNotFoundError: No module named 'PyInstaller.__main__'; 'PyInstaller' is not a package
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
```
2022-04-06 21:01:15 +02:00
SomberNight
3bae7dfd90 mac build: git clone pyinstaller to allow using custom commits
This allows more freedom than using releases from PyPI.
(atm there is no released version that fixes https://github.com/pyinstaller/pyinstaller/pull/6701 )
Also, we now build the pyinstaller bootloader, just like in the windows build:
one fewer binary blob to trust.
2022-04-06 21:01:11 +02:00
SomberNight
98d32f41d5 build: (reproducibility) always uses "pip install" with "--no-build-isolation"
fixes https://github.com/spesmilo/electrum/issues/7737
fixes https://github.com/spesmilo/electrum/issues/7736
related 8559d1eb72
2022-03-26 02:45:47 +01:00
SomberNight
1bb7ef92e7 binaries: bump python 3.9.10->3.9.11; and for android 3.8.12->3.8.13
This is bumping the python versions bundled inside our binaries.
For macOS and AppImage, from 3.9.10 to 3.9.11.
For Android, from 3.8.12 to 3.8.13.

Windows is left untouched as I am having issues with the wine build when using 3.9.11.
(see https://github.com/spesmilo/electrum/pull/7721#issuecomment-1071901116 )
2022-03-18 16:21:24 +01:00
SomberNight
f9b07d15af macos build: brew now requires xcode cli tools (not full xcode)
Which means we need *both* xcode cli tools and full xcode.
Document this weirdness, including the exact paths they should be at.

excerpt from terminal when running make_osx:
```
Warning: You are using macOS 10.14.
We (and Apple) do not provide support for this old version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Twitter or any other official channels. You are responsible for resolving
any issues you experience while you are running this
old version.

==> Downloading https://ftp.gnu.org/gnu/coreutils/coreutils-9.0.tar.xz
Already downloaded: /Users/vagrant/Library/Caches/Homebrew/downloads/5744bb33344b6180adca9d909a87e830d55982a1b3229c61e9dc0e35cfacbf25--coreutils-9.0.tar.xz
Error: Xcode alone is not sufficient on Mojave.
Install the Command Line Tools for Xcode 11.3.1 from:
  https://developer.apple.com/download/all/
```
2022-03-15 19:59:56 +01:00
SomberNight
bb5b52f2d7 binaries: bump python 3.9.7->3.9.10 2022-02-17 16:51:13 +01:00
SomberNight
f01ca726e4 mac build: bump python 3.7.9->3.9.7 2021-11-02 18:38:17 +01:00
bitromortac
28bbb4bdda android+osx: add lightning uri handlers 2021-07-30 08:44:15 +02:00
SomberNight
5115e14aed mac build: reuse previously built dylibs if available 2021-07-29 18:17:51 +02:00
SomberNight
d35a68d2d1 release.sh: fix bugs discovered during last release 2021-07-19 21:48:47 +02:00
SomberNight
8e71361d29 mac build: README: mention Xcode path intricacies 2021-07-19 21:46:17 +02:00
SomberNight
c1d28bcf53 mac build: compare_dmg: "diff" should handle missing directory
(as in, non-existent path)
2021-07-19 17:08:02 +02:00
SomberNight
9c2807cbb1 mac build: README: clarify note about reproducibility of unsigned dmg 2021-07-19 16:13:27 +02:00
ThomasV
1dfbba76d0 make_osx: disable set -e during test of signing identity 2021-07-19 14:57:20 +02:00
SomberNight
f50882d8df mac build: attempt at "reproducible" codesigned builds
- added notes about reproducibility requirements
- adapted build scripts from Bitcoin Core that can
    - extract signatures from a signed .app
    - apply previously extracted signatures to an unsigned .app
2021-07-19 07:34:05 +02:00
SomberNight
71b02df832 mac build: re-add note about needing full Xcode...
Turns out the Xcode CLI tools are still not enough, and we need full Xcode :(
This is only for notarization; as `altool` (which we need there) is only part
of full Xcode. So we need to download 8 gigs just for that single script...

related c1dbcab9bb
2021-07-19 07:33:08 +02:00
SomberNight
fa04c762c5 mac build: rm pyinstaller monkey-patch used to codesign embedded files
When the monkey-patch was added, we were building pyinstaller onefile
binaries; but since then we changed to build pyinstaller onedir binaries
instead. So I believe there are no embedded files inside the main executable
anymore, so doing `codesign --deep *.app` (near the end of make_osx)
should be sufficient.
2021-07-19 07:33:04 +02:00
SomberNight
e679e6074f mac build: add "set -e"
for sanity...

re touching these files: not sure they are really needed
(but the ~/Library/Python/ and ~/.pyenv folders are no longer there
on the build machine)
2021-07-16 16:38:31 +02:00
ThomasV
9278a26a7d make_osx: do not download python pkg unnecessarily 2021-07-16 15:55:33 +02:00
ThomasV
09f7d65b31 Merge pull request #7411 from SomberNight/20210715_macos_build
mac build: download python from python.org instead of using pyenv
2021-07-16 15:46:12 +02:00
ThomasV
4dd82cef74 set -e in compare_dmg 2021-07-16 15:41:15 +02:00
SomberNight
4fd6282f51 mac build: download python from python.org instead of using pyenv 2021-07-16 01:19:56 +02:00
SomberNight
8c1380ca8b mac build: trivial clean-up 2021-07-15 19:43:15 +02:00
ThomasV
ea24ab593f Merge pull request #7400 from SomberNight/202107_mac_build_pyc
mac build: don't create __pycache__ folders
2021-07-14 12:08:06 +02:00
ThomasV
ace113358a fix typo (follow-up prev) 2021-07-13 10:21:14 +02:00
ThomasV
0c17b49e2c compare_dmg: compare two files 2021-07-13 10:01:09 +02:00
SomberNight
659c00e06b mac build: don't create __pycache__ folders
The .pyc files would get created when a .py module is imported,
which is done during the build for some source files by pyinstaller
(when it analyses imports).

I considered setting PYTHONDONTWRITEBYTECODE=1 in build_tools_util.sh,
to apply to all builds, but am not sure how it would affect the Android build,
where we actually want .pyc files included in the apk.
2021-07-12 18:07:31 +02:00
ThomasV
b7cc5f329c osx: add script to compare dmg binaries 2021-07-12 15:58:36 +02:00
SomberNight
5b627208f1 mac build: build libusb from source
fixes https://github.com/spesmilo/electrum/issues/7393
2021-07-06 19:38:49 +02:00
ThomasV
0b30cf80de macOS builds: remove zip file after notarization 2021-07-03 14:42:53 +02:00
SomberNight
013cf869f1 qt: qrreader: keep both old and new toolchain; try to abstract it away 2021-06-25 16:52:02 +02:00
SomberNight
c1dbcab9bb qt: new qrreader using QtMultimedia; drop CalinsQRReader(mac)
This commit ports the work of EchterAgo and cculianu from Electron-Cash,
to implement a new toolchain to scan qr codes.

Previously, on Linux and Win, we have been using zbar to access the camera
and read qrcodes; and on macOS we used CalinsQRReader (an objective-C
project by cculianu).

The new toolchain added here can use QtMultimedia to access the camera,
and then feed that image into zbar. When used this way, zbar needs
fewer dependencies and is easier to compile, in particular it can be
compiled for macOS.

The new toolchain works on all three platforms, with some caveats
(see code comments in related commits) -- so we also keep the end-to-end
zbar toolchain; but at least we can drop CalinsQRReader.

The related changes in Electron-Cash are spread over 50+ commits (several PRs and direct
pushes to master), but see in particular:
https://github.com/Electron-Cash/Electron-Cash/pull/1376

some other interesting links:
b2b737001c
163224cf1f
3b31e0fcb1
eda015908e
https://github.com/Electron-Cash/Electron-Cash/pull/1545
052aa06c23
2021-06-25 16:51:58 +02:00
SomberNight
f1e77b6e43 build: update zbar to fix build issue with autoconf 2.70
see https://github.com/Electron-Cash/Electron-Cash/pull/2143
see https://github.com/mchehab/zbar/issues/132
2021-06-25 16:44:35 +02:00
ThomasV
4380f68564 contrib/osx/package.sh: fix paths, add link to issue regarding GCC 10.1 2021-06-24 11:45:29 +02:00
ghost43
b828627dc6 Merge pull request #6917 from andrewkozlik/slip39
SLIP-0039 wallet recovery
2021-06-22 19:44:02 +02:00
SomberNight
5dcafaf082 mac build: link to issue in README 2021-05-01 06:40:28 +02:00
Andrew Kozlik
be7a332624 Add SLIP-0039 wordlist. 2021-04-30 19:43:53 +02:00
Alex Recuenco
bc72e0fc15 Prevent spaces from causing issues in make_osx (#7191)
In some places in the script if some directory name had spaces it could cause issues. 

I also added quotes around a few other directory names that currently are hardcoded with names without spaces as a way to prevent any future mishap
2021-04-08 15:12:14 +00:00
SomberNight
c23fca37d4 build: clarify which locale files are included
related: 2cb4e56be3
2021-03-31 17:00:39 +02:00
SomberNight
eaffced6dd binaries: bump python version 2021-03-13 16:52:19 +01:00
SomberNight
19f806ddf4 build: don't allow setuptools to sneakily install build-time deps
see https://pip.pypa.io/en/stable/reference/pip_install/#controlling-setup-requires
> Setuptools offers the setup_requires setup() keyword for specifying
> dependencies that need to be present in order for the setup.py
> script to run. Internally, Setuptools uses easy_install to
> fulfill these dependencies.
> pip has no way to control how these dependencies are located.
> None of the package index options have an effect.

With these changes, we will now instead hard fail if this were to happen.

related: https://github.com/spesmilo/electrum/issues/5859#issuecomment-743621898
2020-12-12 02:52:38 +01:00
SomberNight
756d2eb004 mac build: call git describe after git submodule update
otherwise it could be that `git describe` will say "dirty" but the binary
will not actually be dirty as it just needed `git submodule update`
2020-11-21 19:29:29 +01:00
SomberNight
7ac968b406 mac build: use a virtualenv instead of global python packages
This helps to avoid older versions of pip-installed dependencies interfering with the build.
2020-11-14 06:58:56 +01:00
SomberNight
77f75f102b mac build: bundle old PyQt5 so that .app runs on macOS 11 "Big Sur"
This is the time of the year Apple breaks our mac builds, as usual.
mac now has its own "binaries" requirements. This allows us to use
an older version of PyQt5 in the mac binaries. For some reason
if we bundle newer PyQt5, the built app will not start on macOS 11
(but will on older macOS).

related: #6461
in particular, see https://github.com/spesmilo/electrum/issues/6461#issuecomment-713888921
2020-11-14 05:17:24 +01:00
SomberNight
a4e342ac58 requirements: rename some files 2020-11-14 04:30:48 +01:00