Last active
April 4, 2024 17:45
-
-
Save thejustinwalsh/0b6f0136d7d9d479f3eace5db728beb0 to your computer and use it in GitHub Desktop.
Build script for building a heaps based project on iOS
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/sh | |
rm -rf ./deps | |
mkdir ./deps | |
pushd deps | |
# Directory Layout | |
# <ProjectRoot> | |
# build | |
# |_ iOS | |
# |_ deps | |
# |_ src | |
# |_ *.c (generated from top level src) | |
# |_ script.sh | |
# |_ project.xcodproj | |
# res | |
# src | |
# |_ *.hx | |
if [ ! -z "${APPCENTER_TRIGGER}" ]; then | |
echo "Installing Haxe" | |
brew install haxe | |
curl -L http://hxbuilds.s3-website-us-east-1.amazonaws.com/builds/haxe/mac/haxe_2019-03-22_development_77068e1.tar.gz | bsdtar -xf - -C . | |
ditto ./haxe_20190322085751_77068e1/ /usr/local/lib/haxe/ | |
echo "Using haxe version "`haxe -version` | |
echo "Setting up haxelib" | |
haxelib setup "/usr/local/lib/haxe/lib" | |
echo "Using haxelib version "`haxelib version` | |
fi | |
echo "Fetching Hashlink Source" | |
git clone https://github.com/HaxeFoundation/hashlink.git | |
if [ ! -z "${APPCENTER_TRIGGER}" ]; then | |
pushd hashlink | |
echo "Fetching Hashlink Dependencies" | |
brew install libpng jpeg-turbo libvorbis sdl2 mbedtls openal-soft libuv | |
echo "Installing Hashlink" | |
make all | |
make install | |
popd | |
echo "Installing Heaps" | |
git clone https://github.com/HeapsIO/heaps.git | |
echo "Linking Haxelib Dependencies" | |
haxelib dev heaps "${APPCENTER_SOURCE_DIRECTORY}/build/iOS/deps/heaps" | |
haxelib dev hlsdl "${APPCENTER_SOURCE_DIRECTORY}/build/iOS/deps/hashlink/libs/sdl" | |
haxelib dev hlopenal "${APPCENTER_SOURCE_DIRECTORY}/build/iOS/deps/hashlink/libs/openal" | |
echo "Installing Haxelib Additional Dependencies" | |
haxelib install hashlink | |
haxelib install hxbit | |
haxelib install format | |
haxelib install stb_ogg_sound | |
fi | |
echo "Fetching SDL2 Dependencies" | |
curl -L https://www.libsdl.org/release/SDL2-2.0.8.zip | bsdtar -xf - -C . | |
mv SDL2-2.0.8 SDL | |
mkdir -p SDL/include/SDL2 | |
cp SDL/include/SDL.h SDL/include/SDL2/SDL.h | |
cp SDL/include/SDL_syswm.h SDL/include/SDL2/SDL_syswm.h | |
echo "Fetching Ogg and Vorbis Dependencies" | |
git clone --depth 1 https://github.com/iosdevzone/IDZPrecompiledOgg.git | |
git clone --depth 1 https://github.com/iosdevzone/IDZPrecompiledVorbis.git | |
echo "Fetching TurboJpeg Dependencies" | |
git clone --depth 1 https://github.com/hjeffrey/turbojpeg.git | |
popd deps | |
#!/bin/sh | |
rm -rf ./src | |
mkdir ./src | |
echo "Generating native code..." | |
pushd src | |
haxe -v --hl myproject.c -p ../../../ -p ../../../src -L heaps -L hlsdl -L hlopenal --main MyProject | |
popd | |
echo "Packing content..." | |
haxe -lib heaps -main hxd.fmt.pak.Build --hl build-pak.hl | |
hl build-pak.hl -res ../../res -out ../../res -wav |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment