Skip to content

Commit

Permalink
Merge pull request #48 from omar-st/master
Browse files Browse the repository at this point in the history
Better OS-checker for the install script
  • Loading branch information
EchterAlsFake committed Jul 29, 2024
2 parents dc82c21 + 1b9d9e1 commit 2d9cc28
Showing 1 changed file with 25 additions and 27 deletions.
52 changes: 25 additions & 27 deletions src/scripts/install.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash

# Automatic compile script
# Detect distribution
# If not on a Linux distro, the OS name is used to ensure compatibility

if [ -f /etc/os-release ]; then
. /etc/os-release
OS=$ID
Expand All @@ -22,34 +23,13 @@ fi
OS=$(echo $OS | tr '[:upper:]' '[:lower:]')

case $OS in
"arch"|"archlinux"|"endeavouros")
# Arch Linux commands
echo "Detected Arch Linux"
sudo pacman -S python-virtualenv git
;;
"ubuntu"|"linuxmint")
# Ubuntu commands
echo "Detected Ubuntu"
sudo apt-get update
sudo apt-get install build-essential cmake python3-dev libssl-dev qtbase5-dev qtdeclarative5-dev qttools5-dev libqt5svg5-dev qt5-default git wget python3-venv -y
;;
"termux")
# Termux commands
echo "Detected Termux"
apt-get update
apt-get full-upgrade -y
apt-get install python3 python-pip git wget ldd binutils
;;
"fedora")
# Fedora commands
echo "Detected Fedora"
sudo dnf install -y git python3-virtualenv qt5-devel
;;
"opensuse"|"suse")
# OpenSUSE commands
echo "Detected OpenSUSE"
sudo zypper install -y git python3-virtualenv libqt5-qtbase-devel
;;
"darwin")
# macOS commands
echo "Detected macOS"
Expand All @@ -61,11 +41,29 @@ case $OS in
fi
brew install python3 git
;;
*)
echo "Unsupported distribution: $OS"
exit 1
;;
esac
esac

# For most Linux Distros
# Detect Package Manager
if command -v pacman ; then
# Arch Linux commands
echo "Detected Arch Linux"
sudo pacman -S python-virtualenv git
elif command -v apt ; then
# Ubuntu commands
echo "Detected Ubuntu/Debian"
sudo apt-get update
sudo apt-get install build-essential cmake python3-dev libssl-dev qtbase5-dev qtdeclarative5-dev qttools5-dev libqt5svg5-dev qt5-default git wget python3-venv -y
elif command -v dnf ; then
# Fedora commands
echo "Detected Fedora"
sudo dnf install -y git python3-virtualenv qt5-devel
elif command -v zypper ; then
# OpenSUSE commands
echo "Detected OpenSUSE"
sudo zypper install -y git python3-virtualenv libqt5-qtbase-devel
fi


# Common commands
git clone https://github.com/EchterAlsFake/Porn_Fetch
Expand Down

0 comments on commit 2d9cc28

Please sign in to comment.