Last active
November 13, 2022 11:02
-
-
Save matschaffer/87220798c79a5d0ace1eaa9afb729d28 to your computer and use it in GitHub Desktop.
Floating Sandbox macos build
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
#!/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 |
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
#!/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" |
Thank you Matt. Darn, I wasn't expecting wxWidgets there, that's a setback. The other dynamic libraries are quite general and one could easily say they are requirements, but wxWidgets is not, and the Ubuntu instructions were geared towards building wxWidgets as static libs, and linking them statically in Floating Sandbox.
I see your shell script install wxWidgets instead of building it (statically) - the build step is commented out. Were you having problems with building them?
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
That's what
macos.sh
does. Assuming you have at least homebrew installed.clean.sh
just removes all the assets so I can re-run build fresh.It seems like maybe
ldd
isn't available on mac. I found https://stackoverflow.com/a/67818942 which recommends otool, so I tried that:Most of it looks like system-provided stuff, but these are homebrew assets
flac, jpeg-turbo, libogg, libpng, libvorbis, wxwidgets
so I suspect this binary will only work on another mac which has them installed.