diff --git a/setup.bat b/setup.bat new file mode 100644 index 00000000..51bb2638 --- /dev/null +++ b/setup.bat @@ -0,0 +1,31 @@ +@echo off +REM Ensure script is run as administrator +net session >nul 2>&1 +if not %errorLevel% == 0 ( + echo This script must be run as administrator. + pause + exit /b 1 +) + +REM Install Scoop if not already installed +where scoop >nul 2>&1 +if %errorLevel% neq 0 ( + echo Installing Scoop... + powershell -Command "Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force; iex (new-object net.webclient).downloadstring('https://get.scoop.sh')" + set PATH=%PATH%;%USERPROFILE%\scoop\shims +) + +REM Install necessary tools using Scoop +echo Installing dependencies... +scoop install git python llvm cmake curl + +REM Install Python dependencies +echo Installing Python dependencies... +pip install mako + +REM Build and run the project using Cargo +echo Building the project... +cargo run + +echo Setup complete. Press any key to exit. +pause diff --git a/setup.sh b/setup.sh new file mode 100644 index 00000000..4edafcb0 --- /dev/null +++ b/setup.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +# Ensure script is run as root +if [ "$(id -u)" != "0" ]; then + echo "This script must be run as root (use sudo)." + exit 1 +fi + +# Install necessary packages based on the package manager available +if [ -x "$(command -v apt-get)" ]; then + echo "Detected Debian-based system. Installing dependencies using apt-get." + sudo apt-get update + sudo apt-get install -y git python3-pip llvm cmake curl + +elif [ -x "$(command -v yum)" ]; then + echo "Detected Red Hat-based system. Installing dependencies using yum." + sudo yum install -y git python3-pip llvm cmake curl + +elif [ -x "$(command -v pacman)" ]; then + echo "Detected Arch-based system. Installing dependencies using pacman." + sudo pacman -Sy --needed git python-pip llvm cmake curl + +elif [ -x "$(command -v brew)" ]; then + echo "Detected macOS. Installing dependencies using Homebrew." + brew install git python3 llvm cmake curl + +else + echo "Unsupported OS or package manager. Please install dependencies manually." + exit 1 +fi + +# Install Python dependencies +echo "Installing Python dependencies..." +pip3 install mako + +# Build and run the project using Cargo +echo "Building the project..." +cargo run