Skip to content

Instantly share code, notes, and snippets.

@JosiahWI
Forked from Jordach/build_mt_version.sh
Last active Jul 18, 2021
Embed
What would you like to do?
##!/bin/bash
mv ~/Dropbox/Minetest\ Mac/*.zip ~/Dropbox/Minetest\ Mac/Outdated
# Build IrrlichtMT
cd Development/irrMT;
# Get current or previous commit, update and get latest commit.
oldirr=`git rev-parse --short HEAD`
git pull --quiet;
irrver=`git rev-parse --short HEAD`
# Check if Irrlicht needs to be recompiled due to new commits.
if [ "$oldirr" = "$irrver" ]; then
echo "IrrlichtMT already at latest version: 1.9-dev-${irrver}.";
cd ..;
else
# UNIVERSAL
echo "Will build IrrlichtMT 1.9-dev-${irrver}."; sleep 5;
# Remove potentially obsoleted CMakeCache from git pull.
rm CMakeCache.txt;
# For some reason, git pull likes to fuck with files, so I have to manually rebuild the CMake data.
cmake . -DPNG_PNG_INCLUDE_DIR=/usr/local/libpng/1_6_37/include -DPNG_LIBRARY=/usr/local/libpng/1_6_37/lib/libpng16.a -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_INSTALL_PREFIX=bin/
# Build shared libraries.
make clean; make -j8; make install; sleep 5;
cd ..;
# x64_JIT MAVERICKS
cd irrMT_mav;
git pull --quiet;
echo "Will build IrrlichtMT 1.9-dev-${irrver}."; sleep 5;
# Remove potentially obsoleted CMakeCache from git pull.
rm CMakeCache.txt;
# For some reason, git pull likes to fuck with files, so I have to manually rebuild the CMake data.
cmake . -DBUILD_SHARED_LIBS=FALSE -DPNG_PNG_INCLUDE_DIR=/usr/local/libpng/1_6_37/include -DPNG_LIBRARY=/usr/local/libpng/1_6_37/lib/libpng16.a -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 -DCMAKE_INSTALL_PREFIX=bin/
# Build shared libraries.
make clean; make -j8; make install; sleep 5;
cd ..;
fi
# UNIVERSAL
# Update minetest_game in the Universal Binary;
cd minetest/games/minetest_game; git pull --quiet;
mtgver=`git rev-parse --short HEAD`; cd ..; cd ..;
# Get current or previous commit, update and get latest commit.
git pull --quiet;
mtver=`git rev-parse --short HEAD`
# Build Minetest Universal
echo "Will build Minetest 5.5.0-dev-${mtver}-Universal, with minetest_game-${mtgver}."; sleep 5;
# Remove old cruft to avoid a -dirty build.
rm -rf _CPack_Packages install_manifest.txt CMakeCache.txt;
# For some reason, git pull likes to fuck with files, so I have to manually rebuild the CMake data.
cmake . -DRUN_IN_PLACE=FALSE -DCMAKE_PREFIX_PATH=/Users/jordach/Development/irrMT/bin -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"
# Build the actual app.
make clean; make package -j8;
# Install Minetest Universal to /Applications/
echo "Updating Minetest.app to Minetest-5.5.0-dev-${mtver}.";
unzip -q minetest-5.5.0-dev-osx.zip; rm -rf /Applications/Minetest.app; mv Minetest.app /Applications/Minetest.app;
# Add recently built arch specific versions of Minetest to shared Dropbox.
echo "Moving generated zipball to the public builds directory.";
mv /Users/jordach/Development/minetest/minetest-5.5.0-dev-osx.zip "/Users/jordach/Dropbox/Minetest Mac/minetest-5.5.0-dev-${mtver}-BigSur-Universal-Lua.zip"
cd ..;
# x64_JIT MAVERICKS
# Update minetest_game in the JIT-x64 binary;
cd minetest_mav/games/minetest_game; git pull --quiet;
mtgver=`git rev-parse --short HEAD`; cd ..; cd ..;
# Build x64-JIT minetest
git pull --quiet;
echo "Will build Minetest 5.5.0-dev-${mtver}-x64-JIT, with minetest_game-${mtgver}."; sleep 5;
# Remove old cruft to avoid a -dirty build.
rm -rf _CPack_Packages install_manifest.txt CMakeCache.txt;
# For some reason, git pull likes to fuck with files, so I have to manually rebuild the CMake data.
cmake . -DRUN_IN_PLACE=FALSE -DCMAKE_PREFIX_PATH=/Users/jordach/Development/irrMT_mav/bin -DLUA_LIBRARY="/Users/jordach/Development/LuaJIT_mav/src/libluajit.a" -DLUA_INCLUDE_DIR="/Users/jordach/Development/LuaJIT_mav/src" -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9
# Build the actual app.
make clean; make package -j8;
# Add recently built arch specific versions of Minetest to shared Dropbox.
echo "Moving generated zipball to the public builds directory.";
mv /Users/jordach/Development/minetest_mav/minetest-5.5.0-dev-osx.zip "/Users/jordach/Dropbox/Minetest Mac/minetest-5.5.0-dev-${mtver}-Mavericks-Intel-LuaJIT.zip"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment