Commit ef6692ea authored by SOLIMAN Sylvain's avatar SOLIMAN Sylvain
Browse files

trying to make install.sh more re-executable and more verbose

parent 43dd146b
......@@ -8,19 +8,31 @@ then
if hash brew 2>/dev/null
then
echo "Using existing homebrew…"
brew update
else
echo "Installing homebrew…"
## xcode-select --install will need a GUI :/
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
brew install swi-prolog gsl gnuplot graphviz pkg-config ppl
# https://stackoverflow.com/questions/43619480/upgrade-or-install-a-homebrew-formula
function install_or_upgrade {
if brew ls --versions "$1" >/dev/null; then
HOMEBREW_NO_AUTO_UPDATE=1 brew upgrade "$1"
else
HOMEBREW_NO_AUTO_UPDATE=1 brew install "$1"
fi
}
brew tap brewsci/science
brew install libsbml nusmv
brew install node
brew upgrade
brew cleanup
brewlings='swi-prolog gsl gnuplot graphviz pkg-config ppl libsbml nusmv node'
for brewling in $brewlings ; do
install_or_upgrade "$brewling"
done
release=
elif [[ -r /etc/debian_version ]]
then
conda_arch="Linux"
......@@ -110,28 +122,33 @@ else
fi
### Glucose
if [[ "$conda_arch" == "Linux" ]]
then
sudo cp glucose.py /usr/local/bin
else
cp glucose.py /usr/local/bin
if [[ ! -f /usr/local/bin/glucose.py ]] ; then
echo "Copying biocham's glucose.py to /usr/local/bin/"
if [[ "$conda_arch" == "Linux" ]]
then
sudo cp glucose.py /usr/local/bin
else
cp glucose.py /usr/local/bin
fi
fi
### Jupyter and python-sat
packages='python-sat jupyter bokeh ipywidgets'
if (hash pip3 2>/dev/null) || \
(hash pip 2> /dev/null) && [[ $(pip --version) == *"python 3"* ]]
if python3 -m pip --version 2>/dev/null
then
python3 -m pip install -U $packages
echo "Using existing pip for python3…"
else
if hash conda 2>/dev/null
then
echo "Using existing conda install to get pip…"
conda install -y pip
else
if [[ "$conda_arch" == "Linux" ]]
then
echo "Using apt to get python3-pip…"
sudo apt-get -qy install python3-pip
else
echo "Installing miniconda3…"
# Note that miniconda is available through brew cask, but to avoid adding
# brew cask if not necessary, we just do without
curl -fsSLO https://repo.continuum.io/miniconda/Miniconda3-latest-${conda_arch}-x86_64.sh
......@@ -142,8 +159,9 @@ else
conda install -y pip
fi
fi
python3 -m pip install -U $packages
fi
echo "installing python packages ($packages)…"
python3 -m pip install -U $packages
### trust all our notebooks but make them read-only
find . -name '*.ipynb' -print0 | xargs -0 jupyter trust
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment