From c6fa6d294b853e43fb790b4a00f9d993cbd4bc0f Mon Sep 17 00:00:00 2001 From: Adrian Castro <22133246+castdrian@users.noreply.github.com> Date: Sat, 1 Aug 2026 22:22:49 +0200 Subject: [PATCH] =?UTF-8?q?fix(ios):=20support=20L=C3=96VE=2012=20file=20b?= =?UTF-8?q?ridge?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 5 +++++ mobile/ios/patch_love_src.py | 7 ++++++- scripts/build_ios.sh | 26 +++++++++++++++++++++----- 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b465dab4..a884fb61 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -170,6 +170,11 @@ jobs: set -euo pipefail scripts/build_android.sh --version "${{ steps.ver.outputs.version }}" + - name: Install xcbeautify + run: | + set -euo pipefail + brew list xcbeautify >/dev/null 2>&1 || brew install xcbeautify + - name: Build iOS run: | set -euo pipefail diff --git a/mobile/ios/patch_love_src.py b/mobile/ios/patch_love_src.py index e3b87fe2..9c0fa0ac 100644 --- a/mobile/ios/patch_love_src.py +++ b/mobile/ios/patch_love_src.py @@ -39,6 +39,7 @@ WRAP_INCLUDES = """ #ifdef LOVE_IOS #include #include +#include #include "filesystem/Filesystem.h" #endif """ % MARKER @@ -53,8 +54,12 @@ WRAP_FUNCS = """ #ifdef LOVE_IOS static const char *gr_saveDirectory() { + static std::string saveDirectory; auto fs = Module::getInstance(Module::M_FILESYSTEM); - return fs != nullptr ? fs->getSaveDirectory() : ""; + if (fs == nullptr) + return ""; + saveDirectory = fs->getSaveDirectory(); + return saveDirectory.c_str(); } static int gr_callBridge(lua_State *L, const char *className, diff --git a/scripts/build_ios.sh b/scripts/build_ios.sh index 7011df0e..5e8adc9d 100755 --- a/scripts/build_ios.sh +++ b/scripts/build_ios.sh @@ -543,11 +543,27 @@ run_xcodebuild() { say "xcodebuild love-ios ($config / $sdk)" set +e - ( - cd "$XCODE_DIR" - xcodebuild "${args[@]}" - ) - local xc_status=$? + local xc_status + if command -v xcbeautify >/dev/null 2>&1; then + ( + cd "$XCODE_DIR" + xcodebuild "${args[@]}" + ) 2>&1 | xcbeautify + local pipeline_status=("${PIPESTATUS[@]}") + local xcode_status=${pipeline_status[0]} + local beautify_status=${pipeline_status[1]} + if [ "$xcode_status" -ne 0 ]; then + xc_status=$xcode_status + else + xc_status=$beautify_status + fi + else + ( + cd "$XCODE_DIR" + xcodebuild "${args[@]}" + ) + xc_status=$? + fi set -e if [ "$xc_status" -ne 0 ]; then fail "xcodebuild failed (exit $xc_status).