Skip to content

Instantly share code, notes, and snippets.

@Kedrigern
Created December 24, 2017 19:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kedrigern/77168d0cd96210d3164edc94b1d068e4 to your computer and use it in GitHub Desktop.
Save Kedrigern/77168d0cd96210d3164edc94b1d068e4 to your computer and use it in GitHub Desktop.
Vcmi install
#!/usr/bin/env bash
# Clone source code and compile vcmi
# 1. Install dependency at Fedory
# 2. Clone repository $repo
# 3. Compile given tag
# 4. Prepare data from gog exe file
tag="0.99"
repo="https://github.com/vcmi/vcmi.git"
path="~/Donwloads/hommam3.exe"
fedora_dep() {
sudo dnf install cmake gcc-c++ SDL2-devel SDL2_image-devel SDL2_ttf-devel SDL2_mixer-devel boost boost-devel boost-filesystem boost-system boost-thread boost-program-options boost-locale zlib-devel ffmpeg-devel ffmpeg-libs qt5-qtbase-devel
}
compile_vcmi() {
git clone -b develop --depth 20 --recursive "$repo"
git checkout "$tag"
mkdir build && cd build
cmake ../vcmi
cmake --build . -- -j2
cd ..
}
prepare_data() {
echo "Download gog data (exe file)";
if [ -f "$path" ]; then
# vcmibuilder is in original repository
./vcmi/vcmibuilder --gog "$path"
else
echo "$path is not HOMAM3 executable"
fi;
}
if [ -d vcmi ]; then
rm -rf vcmi
fi;
mkdir vcmi && cd vcmi
fedora_dep;
compile_vcmi;
prepare_data;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment