#!/bin/bash

install_packages python3 python3-pyqt5 python3-pyqt5.qtwebkit python3-pip python3-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-alsa gstreamer1.0-libav || error "Failed to install dependencies"
pipx_install --system-site-packages git+https://github.com/ksharindam/quartz-browser-qt5.git || exit 1

# add .desktop symlinks since pipx does not create them https://github.com/pypa/pipx/issues/717
sudo mkdir -p /usr/local/share/applications /usr/local/share/icons
sudo ln -sf /usr/local/pipx/venvs/quartz-browser/share/applications/quartz-browser.desktop /usr/local/share/applications/quartz-browser.desktop
sudo ln -sf /usr/local/pipx/venvs/quartz-browser/share/icons/quartz-browser.png /usr/local/share/icons/quartz-browser.png
