From 5d39f792378d8abb2b79fbd395dd83cb74011b67 Mon Sep 17 00:00:00 2001 From: Sergey Minakov Date: Sat, 13 Feb 2021 13:18:15 +0300 Subject: [PATCH] tvOS build script --- build-release.sh | 13 +++++++++++++ build-tvos/build.sh | 46 +++++++++++++++++++++++++++++++++++++++++++++ build.sh | 3 +++ 3 files changed, 62 insertions(+) create mode 100644 build-tvos/build.sh diff --git a/build-release.sh b/build-release.sh index c461c6d..574a774 100755 --- a/build-release.sh +++ b/build-release.sh @@ -258,6 +258,19 @@ if [ "${build_classical}" == "1" ]; then cd .. rm -rf ios_xcode + + ## tvOS (Classical) ## + + rm -rf tvos_xcode + cp -r git/misc/dist/tvos_xcode tvos_xcode + cp out/tvos/templates/libgodot.tvos.opt.fat tvos_xcode/libgodot.tvos.release.fat.a + cp out/tvos/templates/libgodot.tvos.opt.debug.fat tvos_xcode/libgodot.tvos.debug.fat.a + chmod +x tvos_xcode/libgodot.tvos.* + cd tvos_xcode + zip -q -9 -r "${templatesdir}/tvos.zip" * + cd .. + rm -rf tvos_xcode + ## UWP (Classical) ## if [ ! -d "angle" ]; then diff --git a/build-tvos/build.sh b/build-tvos/build.sh new file mode 100644 index 0000000..6274c5d --- /dev/null +++ b/build-tvos/build.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +set -e + +# Config + +export SCONS="scons -j${NUM_CORES} verbose=yes warnings=no progress=no" +export OPTIONS="production=yes" +export OPTIONS_MONO="module_mono_enabled=yes mono_static=yes" +export TERM=xterm + +export TVOS_SDK="14.2" +export TVOS_LIPO="/root/ioscross/arm64/bin/arm-apple-darwin11-lipo" + +rm -rf godot +mkdir godot +cd godot +tar xf /root/godot.tar.gz --strip-components=1 + +# Classical + +if [ "${CLASSICAL}" == "1" ]; then + echo "Starting classical build for tvOS..." + + # tvOS Device + # use_lto is required for Linux-compiled binary to pass App Store checks + + $SCONS platform=tvos $OPTIONS arch=arm64 tools=no target=release_debug \ + TVOSSDK="/root/ioscross/arm64/SDK/AppleTVOS${TVOS_SDK}.sdk" TVOSPATH="/root/ioscross/arm64/" tvos_triple="arm-apple-darwin11-" + $SCONS platform=tvos $OPTIONS arch=arm64 tools=no target=release \ + TVOSSDK="/root/ioscross/arm64/SDK/AppleTVOS${TVOS_SDK}.sdk" TVOSPATH="/root/ioscross/arm64/" tvos_triple="arm-apple-darwin11-" + + # tvOS Simulator + # simulators do not requre `use_lto` to work, so it's diabled to decrease build times. + + $SCONS platform=tvos $OPTIONS arch=x86_64 simulator=yes tools=no use_lto=no target=release_debug \ + TVOSSDK="/root/ioscross/x86_64/SDK/AppleTVSimulator${TVOS_SDK}.sdk" TVOSPATH="/root/ioscross/x86_64/" tvos_triple="x86_64-apple-darwin11-" + $SCONS platform=tvos $OPTIONS arch=x86_64 simulator=yes tools=no use_lto=no target=release \ + TVOSSDK="/root/ioscross/x86_64/SDK/AppleTVSimulator${TVOS_SDK}.sdk" TVOSPATH="/root/ioscross/x86_64/" tvos_triple="x86_64-apple-darwin11-" + + mkdir -p /root/out/templates + $TVOS_LIPO -create bin/libgodot.tvos.opt.arm64.a bin/libgodot.tvos.opt.x86_64.simulator.a -output /root/out/templates/libgodot.tvos.opt.fat + $TVOS_LIPO -create bin/libgodot.tvos.opt.debug.arm64.a bin/libgodot.tvos.opt.debug.x86_64.simulator.a -output /root/out/templates/libgodot.tvos.opt.debug.fat +fi + +echo "tvOS build successful" diff --git a/build.sh b/build.sh index 7a11df7..9488d6f 100755 --- a/build.sh +++ b/build.sh @@ -198,6 +198,9 @@ ${podman_run} -v ${basedir}/build-android:/root/build -v ${basedir}/out/android: mkdir -p ${basedir}/out/ios ${podman_run} -v ${basedir}/build-ios:/root/build -v ${basedir}/out/ios:/root/out localhost/godot-ios:${img_version} bash build/build.sh 2>&1 | tee ${basedir}/out/logs/ios +mkdir -p ${basedir}/out/tvos +${podman_run} -v ${basedir}/build-tvos:/root/build -v ${basedir}/out/tvos:/root/out localhost/godot-tvos:${img_version} bash build/build.sh 2>&1 | tee ${basedir}/out/logs/tvos + mkdir -p ${basedir}/out/server/x64 ${podman_run} -v ${basedir}/build-server:/root/build -v ${basedir}/out/server/x64:/root/out localhost/godot-ubuntu-64:${img_version} bash build/build.sh 2>&1 | tee ${basedir}/out/logs/server