79 lines
2.8 KiB
Bash
Executable file
79 lines
2.8 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
detect_package_manager() {
|
|
if [[ -f /etc/os-release ]]; then
|
|
source /etc/os-release
|
|
case "$ID" in
|
|
arch|manjaro|endeavouros|garuda|cachyos)
|
|
echo "pacman"
|
|
;;
|
|
ubuntu|debian|linuxmint)
|
|
echo "apt"
|
|
;;
|
|
fedora)
|
|
echo "dnf"
|
|
;;
|
|
*)
|
|
echo "unsupported"
|
|
;;
|
|
esac
|
|
else
|
|
echo "unsupported"
|
|
fi
|
|
}
|
|
|
|
install_manual_dependencies_linux() {
|
|
# Build OmniaFramework
|
|
git clone https://github.com/OmniaX-dev/OmniaFramework.git
|
|
cd OmniaFramework
|
|
./build release
|
|
./build install
|
|
cd ../..
|
|
}
|
|
|
|
set -e
|
|
mkdir ../dependencies && cd ../dependencies
|
|
|
|
if [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ]; then
|
|
# Setup environment
|
|
pacman -Syuu --noconfirm
|
|
pacman -S --noconfirm --needed base-devel mingw-w64-ucrt-x86_64-clang mingw-w64-ucrt-x86_64-gdb \
|
|
mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-make mingw-w64-ucrt-x86_64-boost \
|
|
mingw-w64-ucrt-x86_64-glm mingw-w64-ucrt-x86_64-sdl3 mingw-w64-ucrt-x86_64-sdl3-image \
|
|
mingw-w64-ucrt-x86_64-sdl3-ttf
|
|
|
|
# Build OmniaFramework
|
|
pacman -S --noconfirm --needed base-devel mingw-w64-ucrt-x86_64-clang mingw-w64-ucrt-x86_64-gdb \
|
|
mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-make \
|
|
mingw-w64-ucrt-x86_64-boost mingw-w64-ucrt-x86_64-sdl3 mingw-w64-ucrt-x86_64-sdl3-image \
|
|
mingw-w64-ucrt-x86_64-sdl3-ttf
|
|
|
|
|
|
git clone https://github.com/OmniaX-dev/OmniaFramework.git
|
|
cd OmniaFramework
|
|
./build release
|
|
./build install
|
|
cd ../..
|
|
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
|
|
pkgmgr=$(detect_package_manager)
|
|
case "$pkgmgr" in
|
|
pacman) # Arch Based ==================================================================================================
|
|
sudo pacman -Syu --noconfirm
|
|
sudo pacman -S --noconfirm --needed base-devel clang openssl gdb cmake make boost sdl3 sdl3_image sdl3_ttf
|
|
;;
|
|
apt) # Debian Based ==================================================================================================
|
|
sudo apt update
|
|
sudo apt install -y build-essential dkms linux-headers-$(uname -r) clang gdb make cmake libssl-dev libboost-all-dev \
|
|
llibsdl3-dev libsdl3-image-dev libsdl3-ttf-dev libxcb-randr0-dev
|
|
;;
|
|
dnf) # Fedora ==================================================================================================
|
|
sudo dnf install -y gcc gcc-c++ make clang gdb cmake clang-tools-extra boost boost-devel openssl openssl-devel \
|
|
SDL3 SDL3_image SDL3_ttf SDL3-devel SDL3_image-devel SDL3_ttf-devel
|
|
;;
|
|
*)
|
|
echo "Unsupported distro. Supported distros are: Arch, EndeavourOS, Garuda, Manjaro, Ubuntu, Mint, Debian, Fedora."
|
|
exit 1
|
|
;;
|
|
esac
|
|
install_manual_dependencies_linux
|
|
fi
|