From 44b31551168efc4dc6afc71bdf6ef8d44638d91c Mon Sep 17 00:00:00 2001 From: such-gitea Date: Mon, 5 Jan 2026 06:42:31 -0800 Subject: [PATCH] Update .gitea/workflows/build.yaml --- .gitea/workflows/build.yaml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 7551813..570d252 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -39,11 +39,20 @@ jobs: - name: Patch for macOS (Remove librt) run: | - echo "Patching src/CMakeLists.txt to remove Linux-only 'rt' library..." - # Use sed to find " rt " and replace it with a space. - # The -i '' is required for macOS sed to edit in-place. - sed -i '' 's/ rt / /g' src/CMakeLists.txt - sed -i '' 's/ rt)/ )/g' src/CMakeLists.txt + echo "Patching CMakeLists to remove Linux-only 'rt' library..." + + # 1. Use Perl to replace 'rt' with nothing, respecting word boundaries (\b). + # This catches " rt ", " rt)", " rt", etc., regardless of whitespace. + perl -i -pe 's/\brt\b//g' src/CMakeLists.txt + + # 2. Just in case it's in the root file too (some forks do this) + if [ -f "CMakeLists.txt" ]; then + perl -i -pe 's/\brt\b//g' CMakeLists.txt + fi + + # 3. Print the file to the log so we can verify the patch worked (Debugging) + echo "--- DEBUG: src/CMakeLists.txt content after patch ---" + grep -C 5 "target_link_libraries" src/CMakeLists.txt || true - name: Build macOS run: |