diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index edff69c..b3df8a9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,8 @@ permissions: env: # Objectively is a source dependency (resolved via ObjectivelyGPU.xcworkspace). # Override to point a GPU release/branch at a specific Objectively ref. - # SDL3 is the jdolan/SDL ObjectivelyGPU tag (fetch-sdl3.sh); curl lives in build-libcurl.sh. + # SDL3 is the jdolan/SDL ObjectivelyGPU tag, a source dependency built by the workspace; + # curl lives in build-libcurl.sh. OBJECTIVELY_REF: "main" jobs: @@ -44,9 +45,12 @@ jobs: working-directory: Objectively run: bash ./Frameworks/build-libcurl.sh - - name: Fetch SDL3.xcframework - working-directory: ObjectivelyGPU - run: ./Frameworks/fetch-sdl3.sh + - name: Checkout SDL3 + uses: actions/checkout@v6 + with: + repository: jdolan/SDL + ref: ObjectivelyGPU + path: SDL3 # Archive the framework target (single source of truth — no duplicated file # list) per platform, then combine. iOS compiles the Objectively dep from diff --git a/Documentation/install.md b/Documentation/install.md index 1e3a170..ffe92a9 100644 --- a/Documentation/install.md +++ b/Documentation/install.md @@ -23,14 +23,15 @@ ObjectivelyMVC and Quetoo MUST build against that tag. Against any other SDL3, O * Linux and macOS (autotools): build SDL from source with `git clone --branch ObjectivelyGPU https://github.com/jdolan/SDL.git`. -* macOS and iOS (Xcode): `Frameworks/fetch-sdl3.sh` downloads `SDL3.xcframework` from the tag's release. It - records the tag's commit, and downloads again if the tag moves. +* macOS and iOS (Xcode): `ObjectivelyGPU.xcworkspace` builds `SDL3.framework` from SDL's own + `Xcode/SDL/SDL.xcodeproj`, in a sibling checkout named `SDL3`: + `git clone --branch ObjectivelyGPU https://github.com/jdolan/SDL.git ../SDL3`. After the tag moves, run + `git -C ../SDL3 fetch --force --tags && git -C ../SDL3 checkout ObjectivelyGPU`. * Windows (Visual Studio): `ObjectivelyGPU.vs15/sdl3.targets` downloads `SDL3-devel-VC.zip` from the tag's release on first build. Delete `ObjectivelyGPU.vs15/libs/` to pick up a moved tag. -To change the SDL3 revision for the whole stack, move the tag, then publish its artifacts. The publish run -MUST finish before any consumer builds, because until then the release still serves the previous assets. -`fetch-sdl3.sh` refuses a release that was built from another commit. +To change the SDL3 revision for the whole stack, move the tag, then publish the Windows artifacts. The publish +run MUST finish before any Windows build, because until then the release still serves the previous assets. ```sh git tag -f ObjectivelyGPU && git push -f origin ObjectivelyGPU diff --git a/Frameworks/fetch-sdl3.sh b/Frameworks/fetch-sdl3.sh deleted file mode 100755 index 07edce1..0000000 --- a/Frameworks/fetch-sdl3.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env bash -# -# fetch-sdl3.sh — downloads SDL3.xcframework from the jdolan/SDL release for SDL3_TAG and caches it -# under Frameworks/. -# -# The whole stack (ObjectivelyGPU, ObjectivelyMVC, Quetoo) pins SDL3 to one tag in jdolan/SDL, which -# carries the SDL_gpu query API. The tag's commit SHA is stored next to the cache, so moving the tag -# causes a new download. The release notes name the commit its assets were built from; if that is -# not the tag's commit, the publish workflow has not run for the moved tag yet, and this script -# fails. This mirrors ObjectivelyGPU.vs15/sdl3.targets on Windows. -# -set -euo pipefail - -SDL3_REPO="${SDL3_REPO:-jdolan/SDL}" -SDL3_TAG="${SDL3_TAG:-ObjectivelyGPU}" - -SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" -XCFRAMEWORK="$SCRIPT_DIR/SDL3.xcframework" -STAMP="$SCRIPT_DIR/SDL3.xcframework.sha" - -sha="$(git ls-remote "https://github.com/$SDL3_REPO.git" "refs/tags/$SDL3_TAG" "refs/tags/$SDL3_TAG^{}" | tail -1 | cut -f1)" -if [ -z "$sha" ]; then - echo "error: tag $SDL3_TAG not found in $SDL3_REPO" >&2 - exit 1 -fi - -cached() { - [ -d "$XCFRAMEWORK" ] && [ ! -L "$XCFRAMEWORK" ] && [ "$(cat "$STAMP" 2>/dev/null)" = "$sha" ] -} - -if cached; then - exit 0 -fi - -released="$(curl -fsSL "https://api.github.com/repos/$SDL3_REPO/releases/tags/$SDL3_TAG" | grep -Eo 'at [0-9a-f]{40}' | head -1 | cut -c4- || true)" -if [ "$released" != "$sha" ]; then - echo "error: the $SDL3_TAG release of $SDL3_REPO was built from ${released:-an unknown commit}, not $sha" >&2 - echo "error: run: gh workflow run objectivelygpu.yml -R $SDL3_REPO" >&2 - exit 1 -fi - -# Serialize concurrent invocations (parallel target builds) on a lock dir, -# the shell equivalent of the Global mutex used by sdl3.targets on Windows. -LOCK="$SCRIPT_DIR/.sdl3.lock" -while ! mkdir "$LOCK" 2>/dev/null; do - sleep 1 -done - -TMP="$(mktemp -d)" -MNT="$TMP/mnt" - -cleanup() { - hdiutil detach "$MNT" -quiet 2>/dev/null || true - rm -rf "$TMP" - rmdir "$LOCK" 2>/dev/null || true -} -trap cleanup EXIT - -# Re-check after acquiring the lock; another build may have just finished. -if cached; then - exit 0 -fi - -DMG_URL="https://github.com/$SDL3_REPO/releases/download/$SDL3_TAG/SDL3.dmg" - -echo "==> Downloading SDL3 $SDL3_REPO@$SDL3_TAG ($sha)" -curl -fL --retry 3 "$DMG_URL" -o "$TMP/SDL3.dmg" - -echo "==> Mounting SDL3.dmg" -mkdir -p "$MNT" -hdiutil attach "$TMP/SDL3.dmg" -nobrowse -quiet -mountpoint "$MNT" - -src="$(find "$MNT" -maxdepth 2 -name SDL3.xcframework -type d | head -1)" -if [ -z "$src" ]; then - echo "error: SDL3.xcframework not found in $DMG_URL" >&2 - exit 1 -fi - -# Replace the cache, and the .stable/.local directories of the former use-sdl3.sh layout. -echo "==> Caching SDL3.xcframework" -rm -f "$STAMP" -rm -rf "$XCFRAMEWORK" "$SCRIPT_DIR/SDL3.xcframework.stable" "$SCRIPT_DIR/SDL3.xcframework.local" -cp -R "$src" "$XCFRAMEWORK" -echo "$sha" > "$STAMP" - -echo "==> SDL3.xcframework $SDL3_TAG ready at Frameworks/SDL3.xcframework" diff --git a/ObjectivelyGPU.xcodeproj/project.pbxproj b/ObjectivelyGPU.xcodeproj/project.pbxproj index 174013b..bd66cac 100644 --- a/ObjectivelyGPU.xcodeproj/project.pbxproj +++ b/ObjectivelyGPU.xcodeproj/project.pbxproj @@ -50,7 +50,7 @@ 8D678937240347D29F529D34 /* TransferBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = F20F19F296684FA89413FFC0 /* TransferBuffer.h */; settings = {ATTRIBUTES = (Public, ); }; }; 90C29A39257729BE8D4FDDF8 /* Types.h in Headers */ = {isa = PBXBuildFile; fileRef = 38F069D0DBE26C7E00B5B5EE /* Types.h */; settings = {ATTRIBUTES = (Public, ); }; }; A09AD953AC672E0DE9D1E26D /* ObjectivelyGPU.h in Headers */ = {isa = PBXBuildFile; fileRef = C16D60B0E94469E649953EC5 /* ObjectivelyGPU.h */; settings = {ATTRIBUTES = (Public, ); }; }; - AA000000000000000000FF01 /* SDL3.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA000000000000000000EE01 /* SDL3.xcframework */; }; + AA000000000000000000FF01 /* SDL3.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA000000000000000000EE01 /* SDL3.framework */; }; CCCB11DB70E4A962360A2119 /* CopyPass.c in Sources */ = {isa = PBXBuildFile; fileRef = C862954A9DD435C1FF7CD31D /* CopyPass.c */; }; CE1643392FF413C000863996 /* HelloCompute.comp.metal in CopyFiles */ = {isa = PBXBuildFile; fileRef = CECF83AB2FEF712F00CB0CCA /* HelloCompute.comp.metal */; }; CE16433A2FF413C000863996 /* HelloCompute.comp.spv in CopyFiles */ = {isa = PBXBuildFile; fileRef = CECF83AC2FEF712F00CB0CCA /* HelloCompute.comp.spv */; }; @@ -85,16 +85,16 @@ EE00100000000000000000B1 /* Hello.c in Sources */ = {isa = PBXBuildFile; fileRef = EE00010000000000000000B1 /* Hello.c */; }; EE00110000000000000000B2 /* HelloCompute.c in Sources */ = {isa = PBXBuildFile; fileRef = EE00020000000000000000B2 /* HelloCompute.c */; }; EE00120000000000000000B3 /* ObjectivelyGPU.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6251F22589273797656C269E /* ObjectivelyGPU.framework */; }; - EE00130000000000000000B4 /* SDL3.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA000000000000000000EE01 /* SDL3.xcframework */; }; + EE00130000000000000000B4 /* SDL3.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA000000000000000000EE01 /* SDL3.framework */; }; EE00140000000000000000B5 /* Objectively.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEA0030000000000000000F0 /* Objectively.framework */; }; EE00150000000000000000B6 /* ObjectivelyGPU.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6251F22589273797656C269E /* ObjectivelyGPU.framework */; }; - EE00160000000000000000B7 /* SDL3.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA000000000000000000EE01 /* SDL3.xcframework */; }; + EE00160000000000000000B7 /* SDL3.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA000000000000000000EE01 /* SDL3.framework */; }; EE00170000000000000000B8 /* Objectively.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEA0030000000000000000F0 /* Objectively.framework */; }; EI00100000000000000000B1 /* Hello.c in Sources */ = {isa = PBXBuildFile; fileRef = EE00010000000000000000B1 /* Hello.c */; }; EI00200000000000000000B1 /* Hello.frag.metal in Resources */ = {isa = PBXBuildFile; fileRef = CECF83A52FEF712F00CB0CCA /* Hello.frag.metal */; }; EI00300000000000000000B1 /* Hello.vert.metal in Resources */ = {isa = PBXBuildFile; fileRef = CECF83A82FEF712F00CB0CCA /* Hello.vert.metal */; }; - EI00400000000000000000B4 /* SDL3.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA000000000000000000EE01 /* SDL3.xcframework */; }; - EI00700000000000000000B7 /* SDL3.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = AA000000000000000000EE01 /* SDL3.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + EI00400000000000000000B4 /* SDL3.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA000000000000000000EE01 /* SDL3.framework */; }; + EI00700000000000000000B7 /* SDL3.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = AA000000000000000000EE01 /* SDL3.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; F73340493879CD8034F99D51 /* ComputePass.c in Sources */ = {isa = PBXBuildFile; fileRef = ED8024CA4186E352C1EC4CA1 /* ComputePass.c */; }; FF30FF2D56F9E4EA3C492CBB /* RenderPass.c in Sources */ = {isa = PBXBuildFile; fileRef = 669BE73362E651792735CB1C /* RenderPass.c */; }; /* End PBXBuildFile section */ @@ -174,7 +174,7 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - EI00700000000000000000B7 /* SDL3.xcframework in Embed Frameworks */, + EI00700000000000000000B7 /* SDL3.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -195,7 +195,7 @@ 872CC6C6CBA08F1A36626F57 /* QueryPool.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = QueryPool.c; sourceTree = ""; }; 9220C57BBAA3C951D8083799 /* RenderDevice.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RenderDevice.h; sourceTree = ""; }; 989E64805790578A941CB5B9 /* QueryPool.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = QueryPool.h; sourceTree = ""; }; - AA000000000000000000EE01 /* SDL3.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = SDL3.xcframework; path = Frameworks/SDL3.xcframework; sourceTree = ""; }; + AA000000000000000000EE01 /* SDL3.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = SDL3.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B89C52ADCD12486D934D4F78 /* Fence.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Fence.h; sourceTree = ""; }; C16D60B0E94469E649953EC5 /* ObjectivelyGPU.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ObjectivelyGPU.h; sourceTree = ""; }; C862954A9DD435C1FF7CD31D /* CopyPass.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = CopyPass.c; sourceTree = ""; }; @@ -215,7 +215,6 @@ CEBA3F692FF3211F00758CA6 /* Shader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Shader.h; sourceTree = ""; }; CEBA3F6A2FF3211F00758CA6 /* Shader.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = Shader.c; sourceTree = ""; }; CEBA3F742FF330A700758CA6 /* ComputePipeline.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = ComputePipeline.c; sourceTree = ""; }; - CEBA3F7C2FF36E2300758CA6 /* fetch-sdl3.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; name = "fetch-sdl3.sh"; path = "Frameworks/fetch-sdl3.sh"; sourceTree = ""; }; CECF83942FEF65EB00CB0CCA /* Makefile.am */ = {isa = PBXFileReference; lastKnownFileType = text; path = Makefile.am; sourceTree = ""; }; CECF83952FEF65FF00CB0CCA /* Makefile.am */ = {isa = PBXFileReference; lastKnownFileType = text; path = Makefile.am; sourceTree = ""; }; CECF83962FEF65FF00CB0CCA /* ObjectivelyGPU.pc.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = ObjectivelyGPU.pc.in; sourceTree = ""; }; @@ -263,7 +262,7 @@ buildActionMask = 2147483647; files = ( CEA0030000000000000000F1 /* Objectively.framework in Frameworks */, - AA000000000000000000FF01 /* SDL3.xcframework in Frameworks */, + AA000000000000000000FF01 /* SDL3.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -271,7 +270,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - EE00130000000000000000B4 /* SDL3.xcframework in Frameworks */, + EE00130000000000000000B4 /* SDL3.framework in Frameworks */, EE00140000000000000000B5 /* Objectively.framework in Frameworks */, EE00120000000000000000B3 /* ObjectivelyGPU.framework in Frameworks */, ); @@ -281,7 +280,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - EE00160000000000000000B7 /* SDL3.xcframework in Frameworks */, + EE00160000000000000000B7 /* SDL3.framework in Frameworks */, EE00170000000000000000B8 /* Objectively.framework in Frameworks */, EE00150000000000000000B6 /* ObjectivelyGPU.framework in Frameworks */, ); @@ -291,7 +290,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - EI00400000000000000000B4 /* SDL3.xcframework in Frameworks */, + EI00400000000000000000B4 /* SDL3.framework in Frameworks */, CEBA3F772FF3418E00758CA6 /* Objectively.framework in Frameworks */, CEBA3F782FF3419100758CA6 /* ObjectivelyGPU.framework in Frameworks */, ); @@ -383,8 +382,7 @@ isa = PBXGroup; children = ( CEA0030000000000000000F0 /* Objectively.framework */, - AA000000000000000000EE01 /* SDL3.xcframework */, - CEBA3F7C2FF36E2300758CA6 /* fetch-sdl3.sh */, + AA000000000000000000EE01 /* SDL3.framework */, ); name = Frameworks; sourceTree = ""; @@ -712,7 +710,7 @@ "$(inherited)", "$(SRCROOT)/Sources", "$(WORKSPACE_PREFIX)/Objectively/Sources", - "$(SRCROOT)/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Headers", + "$(SRCROOT)/../SDL3/include", ); INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = ( @@ -749,7 +747,7 @@ "$(inherited)", "$(SRCROOT)/Sources", "$(WORKSPACE_PREFIX)/Objectively/Sources", - "$(SRCROOT)/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Headers", + "$(SRCROOT)/../SDL3/include", ); INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = ( @@ -838,7 +836,7 @@ "$(inherited)", "$(SRCROOT)/Sources", "$(WORKSPACE_PREFIX)/Objectively/Sources", - "$(SRCROOT)/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Headers", + "$(SRCROOT)/../SDL3/include", ); PRODUCT_NAME = "$(TARGET_NAME)"; }; @@ -856,7 +854,7 @@ "$(inherited)", "$(SRCROOT)/Sources", "$(WORKSPACE_PREFIX)/Objectively/Sources", - "$(SRCROOT)/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Headers", + "$(SRCROOT)/../SDL3/include", ); PRODUCT_NAME = "$(TARGET_NAME)"; }; @@ -874,7 +872,7 @@ "$(inherited)", "$(SRCROOT)/Sources", "$(WORKSPACE_PREFIX)/Objectively/Sources", - "$(SRCROOT)/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Headers", + "$(SRCROOT)/../SDL3/include", ); PRODUCT_NAME = "$(TARGET_NAME)"; }; @@ -892,7 +890,7 @@ "$(inherited)", "$(SRCROOT)/Sources", "$(WORKSPACE_PREFIX)/Objectively/Sources", - "$(SRCROOT)/Frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework/Headers", + "$(SRCROOT)/../SDL3/include", ); PRODUCT_NAME = "$(TARGET_NAME)"; }; @@ -910,7 +908,7 @@ ); HEADER_SEARCH_PATHS = ( "$(SRCROOT)/Sources", - "$(SRCROOT)/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers", + "$(SRCROOT)/../SDL3/include", "$(SRCROOT)/Frameworks/Objectively.xcframework/ios-arm64/Objectively.framework/Headers", "$(inherited)", ); @@ -939,7 +937,7 @@ ); HEADER_SEARCH_PATHS = ( "$(SRCROOT)/Sources", - "$(SRCROOT)/Frameworks/SDL3.xcframework/ios-arm64/SDL3.framework/Headers", + "$(SRCROOT)/../SDL3/include", "$(SRCROOT)/Frameworks/Objectively.xcframework/ios-arm64/Objectively.framework/Headers", "$(inherited)", ); diff --git a/ObjectivelyGPU.xcworkspace/contents.xcworkspacedata b/ObjectivelyGPU.xcworkspace/contents.xcworkspacedata index fbd9b6c..e0761d4 100644 --- a/ObjectivelyGPU.xcworkspace/contents.xcworkspacedata +++ b/ObjectivelyGPU.xcworkspace/contents.xcworkspacedata @@ -4,6 +4,9 @@ + +