mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2025-01-12 12:26:31 -05:00
Reorganize run.sh (#457)
* Separate dependency installation into separate step in run.sh * Reword awkward wording in run.sh * Ensure go dependencies are installed * Rename run.sh to build.sh
This commit is contained in:
parent
c55d34e935
commit
162252e82d
@ -39,7 +39,7 @@ You can also open the root folder in VSCode. Make sure you have the `ms-vscode.g
|
||||
### Linux
|
||||
|
||||
There are several dependencies which need to be installed additionally.
|
||||
To install them you can use `./run.sh` in the project root folder - this script takes care of the installation for you.
|
||||
To install them you can use `./build.sh` in the project root folder - this script takes care of the installation for you.
|
||||
|
||||
## Contributing
|
||||
|
||||
|
@ -30,55 +30,71 @@ go_install(){
|
||||
wget https://dl.google.com/go/go"$go_version".linux-amd64.tar.gz > /dev/null 2>&1
|
||||
echo "Install Go"
|
||||
sudo tar -C /usr/local -xzf go*.linux-amd64.tar.gz > /dev/null 2>&1
|
||||
echo "Clean unless files"
|
||||
echo "Clean unneeded files"
|
||||
rm go*.linux-amd64.tar.gz
|
||||
echo "Install libraries"
|
||||
sudo yum install -y libX11-devel libXcursor-devel libXrandr-devel libXinerama-devel mesa-libGL-devel alsa-lib-devel libXi-devel > /dev/null 2>&1
|
||||
|
||||
elif [ "$distribution" = "Fedora" ]; then
|
||||
echo "Downloading Go"
|
||||
wget https://dl.google.com/go/go"$go_version".linux-amd64.tar.gz > /dev/null 2>&1
|
||||
echo "Install Go"
|
||||
sudo tar -C /usr/local -xzf go*.linux-amd64.tar.gz > /dev/null 2>&1
|
||||
echo "Clean unless files"
|
||||
echo "Clean unneeded files"
|
||||
rm go*.linux-amd64.tar.gz
|
||||
echo "Install libraries"
|
||||
sudo dnf install -y libX11-devel libXcursor-devel libXrandr-devel libXinerama-devel mesa-libGL-devel alsa-lib-devel libXi-devel > /dev/null 2>&1
|
||||
|
||||
elif [ "$distribution" = "Debian" ] || [ "$distribution" = "Ubuntu" ] || [ "$distribution" = "Deepin" ]; then
|
||||
echo "Downloading Go"
|
||||
wget https://dl.google.com/go/go"$go_version".linux-amd64.tar.gz > /dev/null 2>&1
|
||||
echo "Install Go"
|
||||
sudo tar -C /usr/local -xzf go*.linux-amd64.tar.gz > /dev/null 2>&1
|
||||
echo "Clean unless files"
|
||||
echo "Clean unneeded files"
|
||||
rm go*.linux-amd64.tar.gz
|
||||
echo "Install libraries"
|
||||
sudo apt-get install -y libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libgl1-mesa-dev libsdl2-dev libasound2-dev > /dev/null 2>&1
|
||||
|
||||
elif [ "$distribution" = "Gentoo" ]; then
|
||||
sudo emerge --ask n go libXcursor libXrandr libXinerama libXi libGLw libglvnd libsdl2 alsa-lib
|
||||
sudo emerge --ask n go
|
||||
|
||||
elif [ "$distribution" = "Manjaro" ] || [ "$distribution" = "Arch\ Linux" ]; then
|
||||
sudo pacman -S go libxcursor libxrandr libxinerama libxi mesa libglvnd sdl2 sdl2_mixer sdl2_net alsa-lib --noconfirm
|
||||
sudo pacman -S go --noconfirm
|
||||
|
||||
elif [ "$distribution" = "OpenSUSE" ] || [ "$distribution" = "SUSE" ]; then
|
||||
echo "Downloading Go"
|
||||
wget https://dl.google.com/go/go"$go_version".linux-amd64.tar.gz > /dev/null 2>&1
|
||||
echo "Install Go"
|
||||
sudo tar -C /usr/local -xzf go*.linux-amd64.tar.gz > /dev/null 2>&1
|
||||
echo "Clean unless files"
|
||||
echo "Clean unneeded files"
|
||||
rm go*.linux-amd64.tar.gz
|
||||
echo "Install libraries"
|
||||
sudo zypper install -y libX11-devel libXcursor-devel libXrandr-devel libXinerama-devel Mesa-libGL-devel alsa-lib-devel libXi-devel > /dev/null 2>&1
|
||||
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
dep_install(){
|
||||
if [ "$distribution" = "CentOS" ] || [ "$distribution" = "Red\ Hat" ] || [ "$distribution" = "Oracle" ]; then
|
||||
sudo yum install -y libX11-devel libXcursor-devel libXrandr-devel libXinerama-devel mesa-libGL-devel alsa-lib-devel libXi-devel > /dev/null 2>&1
|
||||
|
||||
elif [ "$distribution" = "Fedora" ]; then
|
||||
sudo dnf install -y libX11-devel libXcursor-devel libXrandr-devel libXinerama-devel mesa-libGL-devel alsa-lib-devel libXi-devel > /dev/null 2>&1
|
||||
|
||||
elif [ "$distribution" = "Debian" ] || [ "$distribution" = "Ubuntu" ] || [ "$distribution" = "Deepin" ]; then
|
||||
sudo apt-get install -y libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libgl1-mesa-dev libsdl2-dev libasound2-dev > /dev/null 2>&1
|
||||
|
||||
elif [ "$distribution" = "Gentoo" ]; then
|
||||
sudo emerge --ask n libXcursor libXrandr libXinerama libXi libGLw libglvnd libsdl2 alsa-lib
|
||||
|
||||
elif [ "$distribution" = "Manjaro" ] || [ "$distribution" = "Arch\ Linux" ]; then
|
||||
sudo pacman -S libxcursor libxrandr libxinerama libxi mesa libglvnd sdl2 sdl2_mixer sdl2_net alsa-lib --noconfirm
|
||||
|
||||
elif [ "$distribution" = "OpenSUSE" ] || [ "$distribution" = "SUSE" ]; then
|
||||
sudo zypper install -y libX11-devel libXcursor-devel libXrandr-devel libXinerama-devel Mesa-libGL-devel alsa-lib-devel libXi-devel > /dev/null 2>&1
|
||||
|
||||
fi
|
||||
}
|
||||
|
||||
# Build
|
||||
echo "Check Go"
|
||||
go_install
|
||||
echo "Install libraries"
|
||||
dep_install
|
||||
echo "Build OpenDiablo 2"
|
||||
go get
|
||||
go get -d
|
||||
go build
|
||||
echo "Build finished. Please edit config.json before running OpenDiablo2"
|
Loading…
Reference in New Issue
Block a user