From 68cb35f5b3479dc2260d3914df404be951763b1f Mon Sep 17 00:00:00 2001 From: Jatin K Malik Date: Wed, 28 Jan 2026 19:56:52 -0800 Subject: [PATCH] Fix: Handle deprecated appindicator package on Debian 13+ (#70) * Fix: Handle deprecated appindicator package on Debian 13+ Fixes #69 The gir1.2-appindicator3-0.1 package was deprecated in Debian 13 (trixie) and replaced with gir1.2-ayatana-appindicator3. This change adds fallback logic to try the new package if the old one is not available. Changes: - install.sh: Try old package first, fall back to ayatana-appindicator - docs/INSTALL.md: Document both package options - src/vocalinux/main.py: Update error message with Debian 13+ note - CONTRIBUTING.md: Update dev setup instructions Co-Authored-By: Claude Opus 4.5 * fix: clean up whitespace in filtered package list --------- Co-authored-by: Claude Opus --- CONTRIBUTING.md | 8 +++++++- docs/INSTALL.md | 15 +++++++++++++-- install.sh | 25 ++++++++++++++++++++++++- src/vocalinux/main.py | 3 ++- 4 files changed, 46 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6140083..016de86 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -66,8 +66,14 @@ This will: # Ubuntu/Debian sudo apt update sudo apt install -y python3-pip python3-gi python3-gi-cairo \ - gir1.2-gtk-3.0 gir1.2-appindicator3-0.1 libgirepository1.0-dev \ + gir1.2-gtk-3.0 libgirepository1.0-dev \ python3-dev portaudio19-dev python3-venv xdotool + + # For appindicator (system tray icon): + # On older Ubuntu/Debian: + sudo apt install -y gir1.2-appindicator3-0.1 + # On Debian 13+ (trixie) or newer: + sudo apt install -y gir1.2-ayatana-appindicator3 ``` 3. **Set up Python environment:** diff --git a/docs/INSTALL.md b/docs/INSTALL.md index 69556a1..d95e723 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -142,10 +142,16 @@ sudo apt update sudo apt install -y \ python3-pip python3-venv python3-dev \ python3-gi python3-gi-cairo \ - gir1.2-gtk-3.0 gir1.2-appindicator3-0.1 \ + gir1.2-gtk-3.0 \ libgirepository1.0-dev portaudio19-dev \ wget curl unzip +# For appindicator (system tray icon): +# - On older Ubuntu/Debian versions: +sudo apt install -y gir1.2-appindicator3-0.1 +# - On Debian 13+ (trixie) or newer Ubuntu versions: +sudo apt install -y gir1.2-ayatana-appindicator3 + # For X11 sudo apt install -y xdotool @@ -246,7 +252,12 @@ source venv/bin/activate **Solution:** ```bash # Reinstall GTK dependencies -sudo apt install python3-gi python3-gi-cairo gir1.2-appindicator3-0.1 +sudo apt install python3-gi python3-gi-cairo + +# For appindicator (system tray icon) - try one of these: +sudo apt install gir1.2-appindicator3-0.1 # For older Debian/Ubuntu +# OR +sudo apt install gir1.2-ayatana-appindicator3 # For Debian 13+ or newer Ubuntu # Recreate venv with system packages rm -rf venv diff --git a/install.sh b/install.sh index 88b29bc..f3db24c 100755 --- a/install.sh +++ b/install.sh @@ -284,7 +284,30 @@ install_system_dependencies() { if [ -n "$MISSING_PACKAGES" ]; then print_info "Installing missing packages:$MISSING_PACKAGES" sudo apt update || { print_error "Failed to update package lists"; exit 1; } - sudo apt install -y $MISSING_PACKAGES || { print_error "Failed to install dependencies"; exit 1; } + + # Handle appindicator package: old package was deprecated in Debian 13+ + # Try the old package first, fall back to ayatana-appindicator if unavailable + if echo "$MISSING_PACKAGES" | grep -q "gir1.2-appindicator3-0.1"; then + # Remove appindicator from the package list for special handling + FILTERED_PACKAGES=$(echo "$MISSING_PACKAGES" | sed 's/gir1.2-appindicator3-0.1//' | xargs) + + # Try to install the old package first (for older Debian/Ubuntu versions) + if ! sudo apt install -y gir1.2-appindicator3-0.1 2>/dev/null; then + print_info "gir1.2-appindicator3-0.1 not available, trying gir1.2-ayatana-appindicator3..." + if ! sudo apt install -y gir1.2-ayatana-appindicator3; then + print_error "Failed to install appindicator package (tried both gir1.2-appindicator3-0.1 and gir1.2-ayatana-appindicator3)" + exit 1 + fi + print_info "Successfully installed gir1.2-ayatana-appindicator3 (modern replacement)" + fi + + # Install remaining packages + if [ -n "$FILTERED_PACKAGES" ]; then + sudo apt install -y $FILTERED_PACKAGES || { print_error "Failed to install dependencies"; exit 1; } + fi + else + sudo apt install -y $MISSING_PACKAGES || { print_error "Failed to install dependencies"; exit 1; } + fi else print_info "All required packages are already installed." fi diff --git a/src/vocalinux/main.py b/src/vocalinux/main.py index 54a9b72..c5c8178 100644 --- a/src/vocalinux/main.py +++ b/src/vocalinux/main.py @@ -71,7 +71,8 @@ def check_dependencies(): except (ImportError, ValueError): missing_deps.append( "GTK3 and AppIndicator3 (install with: sudo apt install " - "python3-gi gir1.2-appindicator3-0.1)" + "python3-gi gir1.2-appindicator3-0.1) " + "Note: On Debian 13+ use gir1.2-ayatana-appindicator3 instead" ) if missing_deps: