#!/bin/bash

set -e

python -m pip install pip --upgrade

git submodule init
git submodule update

# configure fails with autoconf 2.71, so downgrade
# see https://github.com/asdf-vm/asdf-erlang/issues/195
brew install autoconf@2.69 && \
brew link --overwrite autoconf@2.69 && \
autoconf -V

cd htslib
autoheader
autoconf
./configure --enable-libcurl --enable-s3 --enable-lzma --enable-bz2
make

cd ..
pip install -r requirements.txt
