dreader-hal/install_dev.sh
2025-11-10 18:06:11 +01:00

100 lines
2.5 KiB
Bash
Executable File

#!/bin/bash
# Development installation script for dreader-hal
# Installs all external dependencies in development mode
set -e
echo "========================================="
echo "DReader HAL Development Installation"
echo "========================================="
echo ""
# Check if we're in a virtual environment
if [ -z "$VIRTUAL_ENV" ]; then
echo "⚠️ Warning: Not in a virtual environment!"
echo "Consider activating venv first:"
echo " source venv/bin/activate"
echo ""
read -p "Continue anyway? (y/N) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 1
fi
fi
# Get the directory where this script is located
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$SCRIPT_DIR"
echo "Installing external driver dependencies..."
echo ""
# IT8951 - E-ink display
echo "[1/5] Installing IT8951 (E-ink display driver)..."
cd external/IT8951
pip install -e . || {
echo "⚠️ IT8951 installation failed (Cython build may need python3-dev)"
echo "Continuing anyway..."
}
cd ../..
echo "✓ IT8951 installed"
echo ""
# PyFTtxx6 - Touch controller
echo "[2/5] Installing PyFTtxx6 (Touch controller)..."
cd external/PyFTtxx6/pyft5xx6
pip install -e .
cd ../../..
echo "✓ PyFTtxx6 installed"
echo ""
# PyBMA400 - Accelerometer
echo "[3/5] Installing PyBMA400 (Accelerometer)..."
cd external/PyBMA400
pip install -e .
cd ../..
echo "✓ PyBMA400 installed"
echo ""
# PyPCF8523 - RTC
echo "[4/5] Installing PyPCF8523 (RTC)..."
cd external/PyPCF8523
pip install -e .
cd ../..
echo "✓ PyPCF8523 installed"
echo ""
# pi_ina219 - Power monitor
echo "[5/5] Installing pi_ina219 (Power monitor)..."
cd external/pi_ina219
pip install -e .
cd ../..
echo "✓ pi_ina219 installed"
echo ""
# Install dreader-hal itself
echo "Installing dreader-hal (development mode)..."
pip install -e .
echo "✓ dreader-hal installed"
echo ""
# Install development tools (optional)
read -p "Install development dependencies (pytest, black, etc.)? (Y/n) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Nn]$ ]]; then
echo "Installing development dependencies..."
pip install -r requirements-dev.txt
echo "✓ Development dependencies installed"
echo ""
fi
echo "========================================="
echo "✓ Installation complete!"
echo "========================================="
echo ""
echo "Next steps:"
echo " 1. Run tests: pytest tests/"
echo " 2. Try examples: python examples/simple_display.py"
echo " 3. Check imports: python -c 'from dreader_hal import EReaderDisplayHAL; print(\"OK\")'"
echo ""