#!/usr/bin/env bash # Set up FeNigma: a venv for the pip deps, plus checks for the system # packages that can't come from pip (GTK4/libadwaita bindings, tesseract). set -euo pipefail cd "$(dirname "${BASH_SOURCE[0]}")" missing=() python3 -c "import gi; gi.require_version('Gtk', '4.0'); gi.require_version('Adw', '1')" 2>/dev/null \ || missing+=("PyGObject (GTK4 + libadwaita bindings)") command -v tesseract >/dev/null 2>&1 || missing+=("tesseract") if [ "${#missing[@]}" -gt 0 ]; then echo "Missing system packages:" for m in "${missing[@]}"; do echo " - $m"; done echo echo "These come from your distro's package manager, not pip. For example:" echo " Fedora: sudo dnf install python3-gobject gtk4 libadwaita tesseract" echo " Debian/Ubuntu: sudo apt install python3-gi gir1.2-gtk-4.0 gir1.2-adw-1 tesseract-ocr" echo " Arch: sudo pacman -S python-gobject gtk4 libadwaita tesseract" echo echo "Install those, then re-run this script." exit 1 fi # --system-site-packages so the venv can still see the system-installed # PyGObject above (pip can't build it reliably) while everything else in # requirements.txt installs normally into the venv. python3 -m venv --system-site-packages .venv .venv/bin/pip install --upgrade pip .venv/bin/pip install -r requirements.txt echo echo "Done. Run the app with ./run.sh"