From 941db4214c74d51c193c942e9e7ff633a5ff3a36 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Thu, 9 Jun 2022 17:40:57 +0200 Subject: [PATCH] README: add Windows- & macOS-specific "how to run from source" readmes note: unclear where to put these files... `contrib/build-wine/` and `contrib/osx/` contain binary-building-related files. maybe we could have a `doc/` folder if the need for more similar files arise. atm there are these two, plus maybe `contrib/docker_notes.md`. --- README.md | 5 +- contrib/build-wine/README_windows.md | 61 +++++++++++++++++++ .../osx/{notes_for_arm.md => README_macos.md} | 36 +++++------ 3 files changed, 84 insertions(+), 18 deletions(-) create mode 100644 contrib/build-wine/README_windows.md rename contrib/osx/{notes_for_arm.md => README_macos.md} (50%) diff --git a/README.md b/README.md index 173b52798..38ebe003d 100644 --- a/README.md +++ b/README.md @@ -82,9 +82,12 @@ so make sure that is on your :code:`PATH` variable. ### Development version (git clone) +_(For OS-specific instructions, see [here for Windows](contrib/build-wine/README_windows.md), +and [for macOS](contrib/osx/README_macos.md))_ + Check out the code from GitHub: ``` -$ git clone git://github.com/spesmilo/electrum.git +$ git clone https://github.com/spesmilo/electrum.git $ cd electrum $ git submodule update --init ``` diff --git a/contrib/build-wine/README_windows.md b/contrib/build-wine/README_windows.md new file mode 100644 index 000000000..82c0efca9 --- /dev/null +++ b/contrib/build-wine/README_windows.md @@ -0,0 +1,61 @@ +# Running Electrum from source on Windows (development version) + +## Prerequisites + +- [python3](https://www.python.org/) +- [git](https://gitforwindows.org/) + +## Main steps + +### 1. 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 most dependencies): +``` +> python3 -m pip install --user -e ".[gui,crypto]" +``` + +### 2. Install `libsecp256k1` + +[libsecp256k1](https://github.com/bitcoin-core/secp256k1) is a required dependency. +This is a C library, which you need to compile yourself. +Electrum needs a dll, named `libsecp256k1-0.dll`, placed into the inner `electrum/` folder. + +For Unix-like systems, the (`contrib/make_libsecp256k1.sh`) script does this for you, +however it does not work on Windows. +If you have access to a Linux machine (e.g. VM) or perhaps even using +WSL (Windows Subsystem for Linux), you can cross-compile from there to Windows, +and build this dll: +``` +$ GCC_TRIPLET_HOST="x86_64-w64-mingw32" ./contrib/make_libsecp256k1.sh +``` + +Alternatively, MSYS2 and MinGW-w64 can be used directly on Windows, as follows. + +- download and install [MSYS2](https://www.msys2.org/) +- run MSYS2 +- inside the MSYS2 shell: + ``` + $ pacman -Syu + $ pacman -S --needed git base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-autotools + $ export PATH="$PATH:/mingw64/bin" + ``` + `cd` into the git clone, e.g. `C:\wspace\electrum` (auto-mounted at `/c/wspace/electrum`) + ``` + $ cd /c/wspace/electrum + $ GCC_TRIPLET_HOST="x86_64-w64-mingw32" ./contrib/make_libsecp256k1.sh + ``` + +(note: this is a bit cumbersome, see [issue #5976](https://github.com/spesmilo/electrum/issues/5976) +for discussion) + +### 3. Run electrum: + +``` +> python3 ./run_electrum +``` + diff --git a/contrib/osx/notes_for_arm.md b/contrib/osx/README_macos.md similarity index 50% rename from contrib/osx/notes_for_arm.md rename to contrib/osx/README_macos.md index bfc163b46..ce03731f7 100644 --- a/contrib/osx/notes_for_arm.md +++ b/contrib/osx/README_macos.md @@ -1,9 +1,14 @@ -# Notes on running Electrum from source on ARM-based Macs (Apple M1 OSX) +# Running Electrum from source on macOS (development version) -Development version (git clone) +## Prerequisites -1. Check out the code from GitHub: +- [brew](https://brew.sh/) +- python3 +- git +## Main steps + +### 1. Check out the code from GitHub: ``` $ git clone https://github.com/spesmilo/electrum.git $ cd electrum @@ -15,15 +20,21 @@ Run install (this should install most dependencies): $ python3 -m pip install --user -e ".[crypto]" ``` -2. Install libsecp256k1 - +### 2. Install libsecp256k1 ``` +$ brew install autoconf automake libtool coreutils $ contrib/make_libsecp256k1.sh ``` -3. `pip install pyqt5` would work on intel x86, however there are no prebuilt wheels on PyPI for M1. -As a workaround, we can install it from brew: +### 3. Install PyQt5 + +On Intel-based (x86_64) Macs: +``` +$ python3 -m pip install --user pyqt5 +``` +Re ARM-based Macs (Apple M1), there are no prebuilt wheels on PyPI. +As a workaround, we can install it from `brew`: ``` $ brew install pyqt5 $ echo 'export PATH="/opt/homebrew/opt/qt@5/bin:$PATH"' >> ~/.zshrc @@ -31,16 +42,7 @@ $ echo 'export PATH="/opt/homebrew/opt/pyqt@5/5.15.4_1/bin:$PATH"' >> ~/.zshrc $ source ~/.zshrc ``` -Try it in python to ensure it works: - -``` -$ python3 ->>> import PyQt5 -``` - -4. Run electrum: - +### 4. Run electrum: ``` $ ./run_electrum ``` -