2019-07-28 07:08:56 +00:00
|
|
|
#!/usr/bin/env bash
|
2015-02-02 12:53:36 -07:00
|
|
|
#
|
2025-07-20 16:53:38 +00:00
|
|
|
# This script creates a virtualenv named 'env' and installs all pinned
|
2015-02-02 12:53:36 -07:00
|
|
|
# python dependencies before activating the env and running Electrum.
|
|
|
|
|
# If 'env' already exists, it is activated and Electrum is started
|
2025-07-20 16:53:38 +00:00
|
|
|
# without any installations (unless the pins have changed).
|
2015-02-02 12:53:36 -07:00
|
|
|
#
|
2025-07-20 16:53:38 +00:00
|
|
|
# By default, not all optional dependencies are installed.
|
|
|
|
|
# E.g. for hardware wallet support, do:
|
2020-12-11 15:53:33 +01:00
|
|
|
# $ source ./env/bin/activate
|
2025-07-20 16:53:38 +00:00
|
|
|
# $ pip install -r contrib/deterministic-build/requirements-hw.txt
|
2020-12-11 15:53:33 +01:00
|
|
|
# $ deactivate
|
|
|
|
|
|
|
|
|
|
set -e
|
2015-02-02 12:53:36 -07:00
|
|
|
|
2025-09-02 17:29:48 +00:00
|
|
|
cd "$(dirname "$0")"
|
2025-07-20 16:53:38 +00:00
|
|
|
if [ -e ./env/bin/activate ]; then # existing venv
|
2016-01-27 20:21:20 +05:30
|
|
|
source ./env/bin/activate
|
2025-07-20 16:53:38 +00:00
|
|
|
else # create new venv
|
|
|
|
|
echo "Creating new venv."
|
2020-12-11 15:53:33 +01:00
|
|
|
python3 -m venv env
|
2016-01-27 20:21:20 +05:30
|
|
|
source ./env/bin/activate
|
2025-07-20 16:53:38 +00:00
|
|
|
pip install -r contrib/deterministic-build/requirements.txt
|
|
|
|
|
pip install -r contrib/deterministic-build/requirements-binaries.txt
|
|
|
|
|
pip install --no-dependencies -e .
|
|
|
|
|
echo "Done creating venv."
|
2015-02-02 12:53:36 -07:00
|
|
|
fi
|
|
|
|
|
|
2025-07-20 16:53:38 +00:00
|
|
|
# This might be an old directory and our requirements might have changed in the meantime:
|
|
|
|
|
DEPS_CHANGED_TIME=$(stat --printf %Y contrib/deterministic-build/requirements.txt)
|
|
|
|
|
if [ "$DEPS_CHANGED_TIME" -gt "$(stat --printf %Y env)" ] ; then
|
|
|
|
|
echo "Detected changed requirements.txt. Updating dependencies now..."
|
|
|
|
|
pip install -r contrib/deterministic-build/requirements.txt
|
|
|
|
|
pip install -r contrib/deterministic-build/requirements-binaries.txt
|
|
|
|
|
touch env
|
|
|
|
|
echo "Done updating deps."
|
|
|
|
|
fi
|
2015-02-02 12:53:36 -07:00
|
|
|
|
2020-12-11 15:53:33 +01:00
|
|
|
./run_electrum "$@"
|