Last active
December 19, 2015 13:59
-
-
Save vittorioromeo/5966100 to your computer and use it in GitHub Desktop.
1-click build for Open Hexagon (both for Arch and Debian/Ubuntu)
Open Hexagon Windows build helper (requires human intervention)
Open Hexagon Release build helper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This bash script, called in a repository with submodules, builds and installs all submodules then the project itself | |
# RELEASE MODE, SKIPS RPATH | |
# Takes $1 destination directory parameter | |
if [ -z "${1}" ]; then | |
echo "This script the installation path as an argument!" | |
exit 1 | |
fi | |
absolutePath=$(readlink -f ${1}) | |
projectName="SSVOpenHexagon" | |
buildType="Release" | |
buildSharedLibs="True" | |
makeJobs="8" | |
destinationDir="${absolutePath}/" | |
cmakePrefixPath="${absolutePath}/temp" | |
cmakeFlags="-DCMAKE_BUILD_TYPE=${buildType} -DCMAKE_SKIP_BUILD_RPATH=True" | |
if [ ! -d "${destinationDir}" ]; then | |
echo "${destinationDir} does not exist!" | |
exit 1 | |
fi | |
echo "Building a release version of ${projectName}" | |
echo "cmakeFlags: ${cmakeFlags}" | |
echo "cmakePrefixPath: ${cmakePrefixPath}" | |
echo "destinationDir: ${destinationDir}" | |
echo "All files in ${destinationDir} will be removed" | |
read -p "Continue? [Y/N] " -n 1 | |
if [[ ! $REPLY =~ ^[Yy]$ ]]; then | |
exit 1 | |
fi | |
rm -Rf "${destinationDir}"* | |
dependencies=("SSVJsonCpp" "SSVUtils" "SSVUtilsJson" "SSVMenuSystem" "SSVEntitySystem" "SSVLuaWrapper" "SSVStart") # List of extlibs to build in order | |
export DESTDIR="${cmakePrefixPath}" | |
function warn() { | |
echo "Error occured in: `pwd`"; echo "Error was: "$@ | |
} | |
function die() { | |
status=$1; shift; warn "$@" >&2; exit $status | |
} | |
# Builds a lib, with name $1 - calls CMake, make -j and make install -j | |
function buildLib | |
{ | |
local libName="${1}" | |
echo "Building ${libName}..." | |
cd "${libName}" # Enter lib main directory (where CMakeLists.txt is) | |
mkdir "build"; cd "build" # Create and move to the build directory | |
# Run CMake, make and make install | |
cmake ../ "-DBUILD_SHARED_LIB=${buildSharedLibs} ${cmakeFlags}" || die 1 "cmake failed" | |
make "-j${makeJobs}" || die 1 "make failed" | |
make install "-j${makeJobs}" || die 1 "make install failed" | |
cd ../.. # Go back to extlibs directory | |
echo "Finished building ${libName}..." | |
} | |
cd "extlibs" # Start building... Enter extlibs, and build extlibs | |
for l in "${dependencies[@]}"; do buildLib "${l}"; done | |
cd ".." # Now we are in the main folder | |
echo "Building ${projectName}..." | |
mkdir "build"; cd "build" # Create and move to the build directory | |
## Run CMake, make and make install | |
cmake ../ "${cmakeFlags}" | |
make "-j${makeJobs}"; make install "-j${makeJobs}" | |
cd ".." | |
echo "Finished building ${projectName}..." | |
mv "${cmakePrefixPath}/usr/local/games/SSVOpenHexagon/"* "${destinationDir}" | |
echo "Copying system libraries..." | |
x86Folder="${destinationDir}/x86/" | |
mkdir "${x86Folder}" | |
cp -av "${cmakePrefixPath}/usr/local/lib/"* "${x86Folder}" | |
echo "Removing temp directories..." | |
rm -Rf "${cmakePrefixPath}" | |
searchPaths=("/usr/local/lib/" "/usr/lib/" "/usr/lib/i386-linux-gnu/") | |
for s in "${searchPaths[@]}"; do | |
cp -av "${s}"libsfml*[!d].so* "${x86Folder}" | |
cp -av "${s}"libfreetype*.so* "${x86Folder}" | |
cp -av "${s}"libjpeg*.so* "${x86Folder}" | |
cp -av "${s}"liblua*.so* "${x86Folder}" | |
cp -av "${s}"libGLEW*.so* "${x86Folder}" | |
cp -av "${s}"libopenal*.so* "${x86Folder}" | |
cp -av "${s}"libstdc++*.so* "${x86Folder}" | |
cp -av "${s}"libsfml*.so* "${x86Folder}" | |
cp -av "${s}"libsndfile*.so* "${x86Folder}" | |
cp -av "${s}"libFLAC*.so* "${x86Folder}" | |
cp -av "${s}"libogg.so* "${x86Folder}" | |
cp -av "${s}"libvorbis*.so* "${x86Folder}" | |
cp -av "${s}"ld-linux*.so* "${x86Folder}" | |
cp -av "${s}"libc.so* "${x86Folder}" | |
cp -av "${s}"libdrm.so* "${x86Folder}" | |
cp -av "${s}"libgcc*.so* "${x86Folder}" | |
cp -av "${s}"libglapi.so* "${x86Folder}" | |
cp -av "${s}"libm.so* "${x86Folder}" | |
cp -av "${s}"libpthread.so* "${x86Folder}" | |
cp -av "${s}"librt.so* "${x86Folder}" | |
cp -av "${s}"libz.so* "${x86Folder}" | |
cp -av "${s}"libx*.so* "${x86Folder}" | |
cp -av "${s}"libX*.so* "${x86Folder}" | |
done | |
mv -f "${destinationDir}/SSVOpenHexagon" "${x86Folder}" | |
chmod +x "${x86Folder}/SSVOpenHexagon" | |
touch "${destinationDir}/OpenHexagon" | |
chmod +x "${destinationDir}/OpenHexagon" | |
echo '#!/bin/bash' > "${destinationDir}/OpenHexagon" | |
echo 'export LD_LIBRARY_PATH=./x86/; ./x86/SSVOpenHexagon' >> "${destinationDir}/OpenHexagon" | |
find "${x86Folder}" -name SSV*'.so' | xargs strip -s -g | |
find "${x86Folder}" -name 'SSVOpenHexagon'* | xargs strip -s -g | |
echo "Successfully finished." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd extlibs | |
cd SSVJsonCpp | |
mkdir lib | |
cd lib | |
cmake .. -G "MinGW Makefiles" | |
mingw32-make -j4 | |
mingw32-make install -j4 | |
xcopy /y ..\lib\libSSVJsonCpp.dll ..\..\..\_RELEASE\ | |
cd ../.. | |
cd SSVUtils | |
mkdir lib | |
cd lib | |
cmake .. -G "MinGW Makefiles" | |
mingw32-make -j4 | |
mingw32-make install -j4 | |
xcopy /y ..\lib\libSSVUtils.dll ..\..\..\_RELEASE\ | |
cd ../.. | |
cd SSVUtilsJson | |
mkdir lib | |
cd lib | |
cmake .. -G "MinGW Makefiles" | |
mingw32-make -j4 | |
mingw32-make install -j4 | |
xcopy /y ..\lib\libSSVUtilsJson.dll ..\..\..\_RELEASE\ | |
cd ../.. | |
cd SSVMenuSystem | |
mkdir lib | |
cd lib | |
cmake .. -G "MinGW Makefiles" | |
mingw32-make -j4 | |
mingw32-make install -j4 | |
xcopy /y ..\lib\libSSVMenuSystem.dll ..\..\..\_RELEASE\ | |
cd ../.. | |
cd SSVEntitySystem | |
mkdir lib | |
cd lib | |
cmake .. -G "MinGW Makefiles" | |
mingw32-make -j4 | |
mingw32-make install -j4 | |
xcopy /y ..\lib\libSSVEntitySystem.dll ..\..\..\_RELEASE\ | |
cd ../.. | |
cd SSVStart | |
mkdir lib | |
cd lib | |
cmake .. -G "MinGW Makefiles" | |
mingw32-make -j4 | |
mingw32-make install -j4 | |
xcopy /y ..\lib\libSSVStart.dll ..\..\..\_RELEASE\ | |
cd ../.. | |
cd SSVLuaWrapper | |
mkdir lib | |
cd lib | |
cmake .. -G "MinGW Makefiles" | |
mingw32-make -j4 | |
mingw32-make install -j4 | |
xcopy /y ..\lib\libSSVLuaWrapper.dll ..\..\..\_RELEASE\ | |
cd ../.. | |
xcopy /s/y .\lua .. | |
xcopy /s/y .\SFML .. | |
xcopy /s/y .\lua ..\lua | |
xcopy /s/y .\SFML ..\SFML | |
xcopy /s/y .\lua ..\..\lua | |
xcopy /s/y .\SFML ..\..\SFML | |
cd .. | |
mkdir build | |
cd build | |
cmake .. -G "MinGW Makefiles" | |
mingw32-make -j4 | |
mingw32-make install -j4 | |
xcopy /s/y .\SSVOpenHexagon.exe ..\_RELEASE\ | |
xcopy /s/y ..\lib\sfml-audio-2.dll ..\_RELEASE\ | |
xcopy /s/y ..\lib\sfml-graphics-2.dll ..\_RELEASE\ | |
xcopy /s/y ..\lib\sfml-network-2.dll ..\_RELEASE\ | |
xcopy /s/y ..\lib\sfml-system-2.dll ..\_RELEASE\ | |
xcopy /s/y ..\lib\sfml-window-2.dll ..\_RELEASE\ | |
xcopy /s/y ..\lib\libsndfile-1.dll ..\_RELEASE\ | |
xcopy /s/y ..\lib\lua5.1.dll ..\_RELEASE\ | |
xcopy /s/y ..\lib\lua51.dll ..\_RELEASE\ | |
xcopy /s/y ..\lib\openal32.dll ..\_RELEASE\ | |
strip ..\_RELEASE\SSVOpenHexagon.exe -g -s | |
strip ..\_RELEASE\libSSV*.dll -g -s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
pacman -Syyuu --noconfirm | |
pacman -S --noconfirm --needed base-devel git gcc cmake sfml lua51 | |
git clone https://github.com/SuperV1234/SSVOpenHexagon -b curveWalls | |
(cd SSVOpenHexagon; ./init-repository.sh; mkdir "/home/OH/"; ./build-repository-oh.sh; ./build-repository-rel.sh "/home/OH/") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
apt-get -y install build-essential | |
apt-get dist-upgrade | |
apt-get -y install g++ liblua5.1-dev git cmake libpthread-stubs0-dev libgl1-mesa-dev libx11-dev libxrandr-dev libfreetype6-dev libglew1.5-dev libjpeg8-dev libsndfile1-dev libopenal-dev | |
git clone https://github.com/LaurentGomila/SFML | |
(cd SFML; mkdir build; cd build; cmake ..; make -j4; make install -j4) | |
git clone https://github.com/SuperV1234/SSVOpenHexagon -b curveWalls | |
(cd SSVOpenHexagon; ./init-repository.sh; mkdir "/home/OH/"; ./build-repository-oh.sh; ./build-repository-rel.sh "/home/OH/") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This bash script downloads the game assets | |
# Takes $1 destination directory parameter | |
FOLDERNAME="Testing" | |
export DESTDIR="$1/" | |
echo "downloading assets" | |
echo "DESTDIR = $DESTDIR" | |
read -p "Continue? " -n 1 | |
if [[ ! $REPLY =~ ^[Yy]$ ]]; then | |
exit 1 | |
fi | |
cd "$1" | |
wget -r -nH --cut-dirs=4 --no-parent -e robots=off --reject="*index.html*" "http://vittorioromeo.info/Misc/Linked/OHResources/$FOLDERNAME/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment