Fix launcher script to use venv python directly

- Replace activate script sourcing with direct venv python usage
- This avoids hardcoded build paths in activate script
- Bump pkgrel to 7
This commit is contained in:
goodroot 2025-09-06 16:03:35 -07:00
parent b8672ebb03
commit a4c5cdc4f6
2 changed files with 27 additions and 2 deletions

View file

@ -1,7 +1,7 @@
pkgbase = hyprwhspr
pkgdesc = Native Whisper speech-to-text for Arch/Omarchy with Waybar integration
pkgver = 1.2.0
pkgrel = 6
pkgrel = 7
url = https://github.com/goodroot/hyprwhspr
install = hyprwhspr.install
arch = x86_64

View file

@ -2,7 +2,7 @@
pkgname=hyprwhspr
pkgver=1.2.0
pkgrel=3
pkgrel=4
pkgdesc="Native Whisper speech-to-text for Arch/Omarchy with Waybar integration"
arch=('x86_64')
url="https://github.com/goodroot/hyprwhspr"
@ -52,6 +52,31 @@ package() {
chmod +x "${pkgdir}/opt/${pkgname}/scripts/"*.sh
chmod +x "${pkgdir}/opt/${pkgname}/bin/hyprwhspr"
# Fix the launcher script to use venv python directly
cat > "${pkgdir}/opt/${pkgname}/bin/hyprwhspr" << 'EOF'
#!/bin/bash
# HyprWhspr - Hyprland-optimized voice dictation application
# Main launcher script
# Get the directory where this script is located
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PACKAGE_ROOT="$(dirname "$SCRIPT_DIR")"
# Set environment variables
export HYPRWHSPR_ROOT="$PACKAGE_ROOT"
export PYTHONPATH="$PACKAGE_ROOT/lib:$PYTHONPATH"
# Use virtual environment's python directly if it exists
if [ -f "$PACKAGE_ROOT/venv/bin/python" ]; then
exec "$PACKAGE_ROOT/venv/bin/python" "$PACKAGE_ROOT/lib/main.py" "$@"
else
# Fallback to system python
exec python3 "$PACKAGE_ROOT/lib/main.py" "$@"
fi
EOF
chmod +x "${pkgdir}/opt/${pkgname}/bin/hyprwhspr"
# Create Python virtual environment and install pip-only dependencies
cd "${pkgdir}/opt/${pkgname}"
python -m venv venv