#!/bin/sh
set -eu
dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
python=${PYTHON:-python3}
"$python" -c 'import sys, gi; gi.require_version("Gst","1.0"); from gi.repository import Gst; assert sys.version_info >= (3,13), "Python 3.13 or later is required"'
"$python" -m venv --system-site-packages "$dir/.venv"
"$dir/.venv/bin/python" -m pip install --find-links "$dir/wheels" "$dir"/wheels/mopidy_pandora-*.whl "$dir"/wheels/pydora-*.whl
printf '%s\n' 'Add your Pandora account in ~/.config/mopidy/mopidy.conf and run ./mopidy.'
