Skip to content

dist(release): prebuilt universal Apple XCFramework and Android AAR for downstream git consumption - #9

Open
sebasbad wants to merge 6 commits into
mainfrom
dist/cocoapods-swiftpm-dual-support
Open

dist(release): prebuilt universal Apple XCFramework and Android AAR for downstream git consumption#9
sebasbad wants to merge 6 commits into
mainfrom
dist/cocoapods-swiftpm-dual-support

Conversation

@sebasbad

Copy link
Copy Markdown
Owner

Summary

This distribution branch is intended for downstream Flutter projects (e.g. flutter-image-to-text-app) that consume llama_cpp_dart directly via a Git dependency in pubspec.yaml.

It contains the identical clean source code, Podspecs, and SwiftPM manifest from the upstream PR branch (feat/cocoapods-swiftpm-dual-support), plus precompiled, universal multi-architecture binaries.

Why This Distribution Branch Exists

1. Direct Git Dependency Resolution

When Flutter apps declare a git dependency in pubspec.yaml (git: url: ... ref: dist/cocoapods-swiftpm-dual-support), Flutter performs a shallow git clone into ~/.pub-cache/git/.
Because CocoaPods does not compile native C++ sources during pod install, the prebuilt .xcframework must physically reside inside the cloned directory.

2. Universal Hardware & Simulator Support

The bundled build/apple/llama.xcframework is a universal fat framework containing:

  • ios-arm64: Physical iPhone and iPad devices.
  • ios-arm64_x86_64-simulator: Universal iOS Simulator (runs natively on Apple Silicon M1-M4 Macs as well as Intel x86_64 Macs / Rosetta).
  • macos-arm64_x86_64: Universal macOS Desktop application support.

3. Android Ready-to-use AAR

Includes native/android/llama-cpp-dart.aar compiled for ARM64, ARMv7, x86, and x86_64 so Android builds link immediately out of the box.

Relationship to Upstream

…anager support

Restores CocoaPods compatibility (llama_cpp_dart.podspec) alongside the newly added SwiftPM manifest (Package.swift) for Flutter iOS apps with CocoaPods-only dependencies (e.g. google_mobile_ads).

Key Changes:
- Added llama_cpp_dart.podspec, ios/llama_cpp_dart.podspec, and darwin/llama_cpp_dart.podspec vendoring llama-xcframework.zip.
- Updated pubspec.yaml with podspecPath: llama_cpp_dart.podspec under iOS/macOS platform declarations.
- Bundled native/android/llama-cpp-dart.aar in repository for git dependency compatibility.
- Fixed iOS dynamic framework symbol lookup (LlamaLibrary.loadFromProcess) to support case-sensitive physical device APFS paths (Llama.framework/Llama).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant