2013-08-04 15:57:39 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
2015-03-01 08:56:01 -05:00
|
|
|
PYTHON=python3
|
2016-05-27 19:28:19 -04:00
|
|
|
ret=`$PYTHON -c "import sys; print(int(sys.version_info[:2] >= (3, 4)))"`
|
|
|
|
if [ $ret -ne 1 ]; then
|
|
|
|
echo "Python 3.4+ required. Aborting."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2013-08-04 15:57:39 -04:00
|
|
|
|
2016-05-25 21:15:56 -04:00
|
|
|
if [ -d ".git" ]; then
|
|
|
|
git submodule init
|
|
|
|
git submodule update
|
|
|
|
fi
|
|
|
|
|
2013-08-04 15:57:39 -04:00
|
|
|
if [ ! -d "env" ]; then
|
|
|
|
echo "No virtualenv. Creating one"
|
2014-03-28 16:21:05 -04:00
|
|
|
# We need a "system-site-packages" env to have PyQt, but we also need to ensure a local pip
|
|
|
|
# install. To achieve our latter goal, we start with a normal venv, which we later upgrade to
|
|
|
|
# a system-site-packages once pip is installed.
|
2015-03-01 08:56:01 -05:00
|
|
|
if ! $PYTHON -m venv env ; then
|
2016-05-27 19:28:19 -04:00
|
|
|
echo "Creation of our virtualenv failed. If you're on Ubuntu, you probably need python3-venv."
|
|
|
|
exit 1
|
2014-03-28 16:21:05 -04:00
|
|
|
fi
|
2014-03-30 10:26:09 -04:00
|
|
|
if [ "$(uname)" != "Darwin" ]; then
|
2016-05-27 19:28:19 -04:00
|
|
|
$PYTHON -m venv env --upgrade --system-site-packages
|
2014-03-30 10:26:09 -04:00
|
|
|
fi
|
2013-08-04 15:57:39 -04:00
|
|
|
fi
|
|
|
|
|
2014-03-28 16:21:05 -04:00
|
|
|
source env/bin/activate
|
2014-01-26 09:41:15 -05:00
|
|
|
|
2013-08-04 15:57:39 -04:00
|
|
|
echo "Installing pip requirements"
|
|
|
|
if [ "$(uname)" == "Darwin" ]; then
|
2016-07-01 17:12:31 -04:00
|
|
|
./env/bin/pip install -r requirements-osx.txt
|
2013-08-04 15:57:39 -04:00
|
|
|
else
|
2016-05-27 19:28:19 -04:00
|
|
|
./env/bin/python -c "import PyQt5" >/dev/null 2>&1 || { echo >&2 "PyQt 5.4+ required. Install it and try again. Aborting"; exit 1; }
|
2016-07-01 17:12:31 -04:00
|
|
|
./env/bin/pip install -r requirements.txt
|
2013-08-04 15:57:39 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Bootstrapping complete! You can now configure, build and run dupeGuru with:"
|
2016-05-31 20:21:07 -04:00
|
|
|
echo ". env/bin/activate && python build.py && python run.py"
|