2019-07-28 07:08:56 +00:00
|
|
|
#!/usr/bin/env bash
|
2015-02-02 12:53:36 -07:00
|
|
|
#
|
|
|
|
|
# This script creates a virtualenv named 'env' and installs all
|
|
|
|
|
# python dependencies before activating the env and running Electrum.
|
|
|
|
|
# If 'env' already exists, it is activated and Electrum is started
|
|
|
|
|
# without any installations. Additionally, the PYTHONPATH environment
|
2020-12-11 15:53:33 +01:00
|
|
|
# variable is set so that system packages such as e.g. apt installed
|
|
|
|
|
# PyQt5 will also be visible.
|
2015-02-02 12:53:36 -07:00
|
|
|
#
|
2020-12-11 15:53:33 +01:00
|
|
|
# By default, only pure python dependencies are installed.
|
|
|
|
|
# If you would like more extras to be installed, do e.g.:
|
|
|
|
|
# $ source ./env/bin/activate
|
|
|
|
|
# $ pip install -e '.[crypto,gui,hardware]'
|
|
|
|
|
# $ deactivate
|
|
|
|
|
|
|
|
|
|
set -e
|
2015-02-02 12:53:36 -07:00
|
|
|
|
2018-02-23 05:38:24 -06:00
|
|
|
PYTHON_VER="$(python3 -c 'import sys; print(sys.version[:3])')"
|
|
|
|
|
|
2018-03-27 22:21:07 +03:00
|
|
|
cd $(dirname $0)
|
2015-02-02 12:53:36 -07:00
|
|
|
if [ -e ./env/bin/activate ]; then
|
2016-01-27 20:21:20 +05:30
|
|
|
source ./env/bin/activate
|
2020-12-11 15:53:33 +01:00
|
|
|
# FIXME what if this is an old directory and our requirements
|
|
|
|
|
# changed in the meantime? should run "pip install -e . --upgrade"
|
2015-02-02 12:53:36 -07:00
|
|
|
else
|
2020-12-11 15:53:33 +01:00
|
|
|
python3 -m venv env
|
2016-01-27 20:21:20 +05:30
|
|
|
source ./env/bin/activate
|
2020-12-11 15:53:33 +01:00
|
|
|
pip install -e .
|
2015-02-02 12:53:36 -07:00
|
|
|
fi
|
|
|
|
|
|
2020-12-11 15:53:33 +01:00
|
|
|
export PYTHONPATH="$PYTHONPATH:"\
|
|
|
|
|
"/usr/local/lib/python${PYTHON_VER}/site-packages:"\
|
|
|
|
|
"/usr/local/lib/python${PYTHON_VER}/dist-packages:"\
|
|
|
|
|
"/usr/lib/python3/dist-packages:"\
|
2022-03-11 14:17:38 +01:00
|
|
|
"/usr/lib/python${PYTHON_VER}/site-packages:"
|
2015-02-02 12:53:36 -07:00
|
|
|
|
|
|
|
|
|
2020-12-11 15:53:33 +01:00
|
|
|
./run_electrum "$@"
|