✓ This binary should be reproducible, meaning you should be able to generate binaries that match the official releases.
This guide explains how to build Electrum binaries for macOS systems.
This needs to be done on a system running macOS or OS X.
The script is only tested on Intel-based (x86_64) Macs, and the binary built
targets x86_64
currently.
Notes about compatibility with different macOS versions:
altool
and the newer notarytool
. altool
was deprecated by Apple.
notarytool
requires Xcode 13+, and that in turn requires macOS 11.3+.We currently build the release binaries on macOS 11.7.10, and these seem to run on 10.14 or newer. (note: 10.13 might also work, haven't tested)
We recommend creating a VM with a macOS guest, e.g. using VirtualBox, and building there.
The guest should run macOS 11.7.10 (that specific version).
The unix username should be vagrant
, and electrum
should be cloned directly
to the user's home dir: /Users/vagrant/electrum
.
Builders need to use the same version of Xcode; and note that full Xcode and Xcode commandline tools differ! We use the Xcode CLI tools as installed by brew. (version 13.2)
Sanity checks:
$ xcode-select -p
/Library/Developer/CommandLineTools
$ xcrun --show-sdk-path
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
$ pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
package-id: com.apple.pkg.CLTools_Executables
version: 13.2.0.0.1.1638488800
volume: /
location: /
install-time: XXXXXXXXXX
groups: com.apple.FindSystemFiles.pkg-group
$ gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 13.0.0 (clang-1300.0.29.30)
Target: x86_64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
Installing extraneous brew packages can result in build differences.
For example, pyinstaller seems to pick up and bundle brew-installed libffi
.
So having a dedicated "electrum binary builder macOS VM" is recommended.
Make sure that you are building from a fresh clone of electrum
(or run e.g. git clean -ffxd
to rm all local changes).
Install brew
.
Let brew install the Xcode CLI tools.
cd electrum
./contrib/osx/make_osx.sh
This creates both a folder named Electrum.app and the .dmg file (both unsigned).
If you want the binaries codesigned for macOS and notarised by Apple's central server,
also run the sign_osx.sh
script:
CODESIGN_CERT="Developer ID Application: Electrum Technologies GmbH (L6P37P7P56)" \
APPLE_TEAM_ID="L6P37P7P56" \
APPLE_ID_USER="me@email.com" \
APPLE_ID_PASSWORD="1234" \
./contrib/osx/sign_osx.sh
(note: APPLE_ID_PASSWORD
is an app-specific password, not the account password)
Every user can verify that the official binary was created from the source code in this repository.
compare_dmg
script to compare the binary you built with
the official release binary.
$ ./contrib/osx/compare_dmg dist/electrum-*.dmg electrum_dmg_official_release.dmg
compare_dmg
script is mostly only needed as the official release binary is
codesigned and notarized. Otherwise, the built .app
bundles should be byte-identical.
(Note that we are using hdutil
to create the .dmg
, and its output is not
deterministic, but we cannot compare the .dmg
files directly anyway as they contain
codesigned files)此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。