#!/usr/bin/env bash

set -e
set -v

# Run only for Linux for now
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then exit 0; fi

if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then
    sudo apt-get update
    MINICONDAVERSION="Linux"
else
    MINICONDAVERSION="MacOSX"
fi

if [[ "$CONDAPY" == "2.7" ]]; then
  wget https://repo.continuum.io/miniconda/Miniconda2-latest-$MINICONDAVERSION-x86_64.sh -O miniconda.sh;
else
  wget https://repo.continuum.io/miniconda/Miniconda3-latest-$MINICONDAVERSION-x86_64.sh -O miniconda.sh;
fi

bash miniconda.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"
# Keep exported paths for now
# hash -r
conda config --set always_yes yes --set changeps1 no
conda update -q conda
conda config --add channels conda-forge pkgw-forge
# Useful for debugging any issues with conda
conda info -a
which python
# The used dependencies are not the one advertised via the readme
# but can be more easily installed and suffice for the tests for now.
conda create -q -n condaenv python=$CONDAPY gtk3=3.14.15 pygobject gdk-pixbuf adwaita-icon-theme

Add install deps for conda env
[resources] Add install deps for conda env
