1 Pod::Spec.new do |s|
2 s.name = 'onde_inference'
3 s.version = '1.0.2'
4 s.summary = 'On-device LLM inference SDK for Flutter (macOS).'
5 s.description = 'Runs Qwen 2.5 models locally on macOS with Metal acceleration.'
6 s.homepage = 'https://ondeinference.com'
7 s.license = { :type => 'MIT', :file => '../LICENSE' }
8 s.author = { 'Onde Inference' => 'hello@ondeinference.com' }
9 s.source = { :path => '.' }
10 s.source_files = 'Classes/**/*'
11 s.dependency 'FlutterMacOS'
12 s.platform = :osx, '12.0'
13 s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
14 s.swift_version = '5.0'
15
16 s.script_phases = [
17 {
18 :name => 'Build Rust bridge (onde_inference_dart)',
19 :script => <<~SHELL,
20 set -e
21 # Xcode 27 beta exports deployment vars for the newest SDK version,
22 # which can break Rust proc-macro loading during pod builds.
23 # Keep SDKROOT so clang can find system headers, but clear deployment
24 # and linker overrides so cargo uses stable defaults.
25 unset MACOSX_DEPLOYMENT_TARGET IPHONEOS_DEPLOYMENT_TARGET \
26 TVOS_DEPLOYMENT_TARGET LDFLAGS LD RUSTFLAGS
27 RUST_DIR="${PODS_TARGET_SRCROOT}/../rust"
28 cd "$RUST_DIR"
29 ARCH=$(uname -m)
30 if [[ "$ARCH" == "arm64" ]]; then
31 TARGET="aarch64-apple-darwin"
32 else
33 TARGET="x86_64-apple-darwin"
34 fi
35 cargo build --release --target "$TARGET"
36 cp "target/$TARGET/release/libonde_inference_dart.a" \
37 "${PODS_TARGET_SRCROOT}/libonde_inference_dart.a"
38 SHELL
39 :execution_position => :before_compile,
40 :output_files => ["${PODS_TARGET_SRCROOT}/libonde_inference_dart.a"],
41 }
42 ]
43
44 s.frameworks = 'SystemConfiguration'
45
46 s.pod_target_xcconfig = {
47 'DEFINES_MODULE' => 'YES',
48 'OTHER_LDFLAGS' => '-force_load ${PODS_TARGET_SRCROOT}/libonde_inference_dart.a',
49 }
50 s.preserve_paths = '../rust/**/*'
51 end