Skip to content

Instantly share code, notes, and snippets.

@matschaffer
Last active November 13, 2022 11:02
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 matschaffer/87220798c79a5d0ace1eaa9afb729d28 to your computer and use it in GitHub Desktop.
Save matschaffer/87220798c79a5d0ace1eaa9afb729d28 to your computer and use it in GitHub Desktop.
Floating Sandbox macos build
#!/usr/bin/env bash
set -euxo pipefail
rm -rf Floating-Sandbox
rm -rf DevIL
rm -rf SFML
# rm -rf wxWidgets
rm -rf fs_libs
rm -rf git
rm -rf dist
#!/usr/bin/env bash
set -euxo pipefail
WORKSPACE="$(pwd)"
FS_LIBS="$(pwd)/fs_libs"
DIST="$(pwd)/dist"
mkdir -p "${FS_LIBS}"
# Should come with xcode CLI tools during homebrew install
gcc --version
g++ --version
brew install cmake
cmake --version
git clone https://github.com/GabrieleGiuseppini/Floating-Sandbox.git
echo "Building Floating-Sandbox rev: " $(cd Floating-Sandbox && git rev-parse HEAD)
git clone https://github.com/DentonW/DevIL
(
cd DevIL
git checkout v1.8.0
git apply ../Floating-Sandbox/devil-issue-95.patch
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DIL_NO_TIF=1 -DIL_NO_JP2=1 -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX="${FS_LIBS}/DevIL" ../DevIL
make install
)
# Hack to install SFML dependencies
brew install sfml; brew uninstall sfml
git clone https://github.com/SFML/SFML.git
(
cd SFML
git checkout 2.5.1
mkdir build
cd build
# Got a vorbis resolution warning here, but was able to just ignore it.
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=FALSE -DSFML_BUILD_WINDOW=FALSE -DSFML_BUILD_GRAPHICS=FALSE -DSFML_BUILD_DOC=FALSE -DSFML_BUILD_EXAMPLES=FALSE -DCMAKE_INSTALL_PREFIX="${FS_LIBS}/SFML" -DSFML_DEPENDENCIES_INSTALL_PREFIX="${FS_LIBS}/SFML" ..
make install
)
brew install wxwidgets
# brew install gtk+3
# git clone --recurse-submodules https://github.com/wxWidgets/wxWidgets.git
# (
# cd wxWidgets
# git checkout v3.1.4
# mkdir my_wx_build
# cd my_wx_build
# ../configure --disable-shared --with-gtk=3 --with-libpng --with-libxpm --with-libjpeg --without-libtiff --without-expat --disable-pnm --disable-gif --disable-pcx --disable-iff --with-opengl --prefix=${HOME}/fs_libs/wxWidgets --exec_prefix="${FS_LIBS}/wxWidgets" --disable-tests --disable-rpath
# make install
# )
mkdir git
(
cd git
git clone https://github.com/kazuho/picojson.git
cd picojson
git checkout v1.3.0
)
(
cd git
git clone https://github.com/google/googletest.git
cd googletest
git checkout release-1.12.1
)
(
cd Floating-Sandbox
cp UserSettings.example-linux.cmake UserSettings.cmake
sed -i '' "s|/home/gg|${WORKSPACE}|g" UserSettings.cmake
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DFS_BUILD_BENCHMARKS=OFF -DFS_USE_STATIC_LIBS=ON -DwxWidgets_USE_DEBUG=OFF -DwxWidgets_USE_UNICODE=ON -DwxWidgets_USE_STATIC=ON -DFS_INSTALL_DIRECTORY="${DIST}" ..
make install
)
cd "${DIST}"
xattr -r -d com.apple.quarantine ./FloatingSandbox
echo "To start the game run: cd ${DIST}; ./FloatingSandbox"
@matschaffer
Copy link
Author

Yeah, I could give it another shot though.

If I recall correctly it was a similar case to SFML where getting all the dependencies was tricky. Maybe the same hack of install/uninstall would do the trick there as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment