Skip to content

Commit

Permalink
linux: fix install scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
elibroftw committed Apr 12, 2024
1 parent 743a026 commit 7f1d40a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 81 deletions.
24 changes: 2 additions & 22 deletions scripts/arch-install.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,5 @@
#!/usr/bin/env bash
echo "arch-based distro detected"
PYTHON=$1

# Check for python3.12
if ! pacman -Q "$PYTHON" &> /dev/null; then
echo "$PYTHON not found. Installing..."
sudo pacman -Sy --noconfirm "$PYTHON" "$PYTHON-dev" "$PYTHON-virtualenv" "$PYTHON-tk"
fi

# Check for pip
if ! $PYTHON -m pip --version &> /dev/null; then
echo "pip not found. Installing..."
sudo pacman -Sy --noconfirm python-pip
fi

# Check for tkinter
if ! $PYTHON -c "import tkinter" &> /dev/null; then
echo "tkinter not found. Installing..."
sudo pacman -Sy --noconfirm $PYTHON-tk
fi

# Check for python3-venv
echo "Ensuring $PYTHON-virtualenv is insalled"
sudo pacman -Sy --noconfirm "$PYTHON-virtualenv"
echo "Installing Arch system dependencies"
sudo pacman -Sy --noconfirm python-pip $PYTHON "$PYTHON-dev" "$PYTHON-virtualenv" "$PYTHON-tk" python3-pyaudio
20 changes: 3 additions & 17 deletions scripts/debian-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,9 @@ if ! $PYTHON --version &> /dev/null; then
echo "Python 3.12 not found. Installing..."
sudo add-apt-repository -y ppa:deadsnakes/ppa
sudo apt update
sudo apt install -y python3.12 "${PYTHON}-venv" "${PYTHON}-tk"
sudo apt install -y python3.12
fi

# Check for pip
if ! $PYTHON -m pip --version &> /dev/null; then
echo "pip not found. Installing..."
sudo apt update
sudo apt install -y python3-pip
fi

# Check for tkinter
if ! $PYTHON -c "import tkinter" &> /dev/null; then
echo "tkinter not found. Installing..."
sudo apt update
sudo apt install -y "${PYTHON}-tk"
fi

echo "Ensuring $PYTHON-venv is insalled"
echo "Installing system dependencies"
sudo apt update
sudo apt install -y "${PYTHON}-venv"
sudo apt install -y python3-pip "${PYTHON}-venv" "${PYTHON}-tk" python3-pyaudio "${PYTHON}-venv"
23 changes: 2 additions & 21 deletions scripts/fedora-install.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,5 @@
#!/usr/bin/env bash
echo "fedora-based distro detected"
PYTHON=$1

# Check for $PYTHON
if ! dnf list installed "$PYTHON" &> /dev/null; then
echo "$PYTHON not found. Installing..."
sudo dnf install -y "$PYTHON" "$PYTHON-devel" "$PYTHON-virtualenv"
fi

# Check for pip
if ! $PYTHON -m pip --version &> /dev/null; then
echo "pip not found. Installing..."
sudo dnf install -y python-pip
fi

# Check for tkinter
if ! "$PYTHON" -c "import tkinter" &> /dev/null; then
echo "tkinter not found. Installing..."
sudo dnf install -y "$PYTHON-tkinter"
fi

echo "Ensuring $PYTHON-virtualenv is insalled"
sudo dnf install -y "$PYTHON-virtualenv"
echo "Installing Fedora system dependencies"
sudo dnf install -y "$PYTHON" python-pip "$PYTHON-devel" "$PYTHON-virtualenv" "$PYTHON-tkinter" python3-pyaudio
23 changes: 2 additions & 21 deletions scripts/suse-install.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,5 @@
#!/usr/bin/env bash
echo "suse-based distro detected"
PYTHON=$1

# Check for $PYTHON
if ! zypper info "$PYTHON" &> /dev/null; then
echo "$PYTHON not found. Installing..."
sudo zypper install -y "$PYTHON" "$PYTHON-devel" "$PYTHON-virtualenv"
fi

# Check for pip
if ! $PYTHON -m pip --version &> /dev/null; then
echo "pip not found. Installing..."
sudo zypper install -y "$PYTHON-pip"
fi

# Check for tkinter
if ! "$PYTHON" -c "import tkinter" &> /dev/null; then
echo "tkinter not found. Installing..."
sudo zypper install -y "$PYTHON-tk"
fi

echo "Ensuring $PYTHON-virtualenv is insalled"
sudo zypper install -y "$PYTHON-virtualenv"
echo "Installing SUSE system dependencies"
sudo zypper install -y "$PYTHON" "$PYTHON-devel" "$PYTHON-tk" "$PYTHON-virtualenv" python3-pyaudio

0 comments on commit 7f1d40a

Please sign in to comment.