#!/bin/sh

set -e

apt-get install -y --no-install-recommends \
    meson \
    ninja-build \
    autogen

curl -L https://github.com/libsndfile/libsndfile/archive/refs/tags/1.2.2.tar.gz | tar -xz
cd libsndfile-1.2.2
autoreconf -vif
./configure --disable-shared --disable-alsa --disable-full-suite --disable-bow-docs --disable-sqlite --disable-external-libs --disable-mpeg
make -j install
cd ..
rm -rf libsndfile-1.2.2

curl -L https://breakfastquay.com/files/releases/rubberband-3.3.0.tar.bz2 | tar -xj
cd rubberband-3.3.0
meson setup build -Dcmdline=enabled
ninja -C build
mv build/rubberband /opt/venv/bin/
cd ..
rm -rf rubberband-3.3.0
