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 (iOS).'
5 s.description = 'Runs Qwen 2.5 models locally on iOS 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 'Flutter'
12 s.platform = :ios, '15.0'
13
14 s.pod_target_xcconfig = {
15 'DEFINES_MODULE' => 'YES',
16 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386',
17 }
18 s.swift_version = '5.0'
19
20 s.script_phases = [
21 {
22 :name => 'Build Rust bridge (onde_inference_dart)',
23 :script => <<~SHELL,
24 set -e
25 # Keep SDKROOT for Apple headers; clear deployment/linker overrides
26 # so cargo doesn't inherit incompatible beta toolchain settings.
27 unset IPHONEOS_DEPLOYMENT_TARGET MACOSX_DEPLOYMENT_TARGET \
28 TVOS_DEPLOYMENT_TARGET LDFLAGS LD RUSTFLAGS
29 RUST_DIR="${PODS_TARGET_SRCROOT}/../rust"
30 cd "$RUST_DIR"
31
32 if [[ "$PLATFORM_NAME" == "iphonesimulator" ]]; then
33 TARGET="aarch64-apple-ios-sim"
34 else
35 TARGET="aarch64-apple-ios"
36 fi
37
38 cargo build --release --target "$TARGET"
39
40 cp "target/$TARGET/release/libonde_inference_dart.a" \
41 "${PODS_TARGET_SRCROOT}/libonde_inference_dart.a"
42 SHELL
43 :execution_position => :before_compile,
44 :output_files => ["${PODS_TARGET_SRCROOT}/libonde_inference_dart.a"],
45 }
46 ]
47
48 s.pod_target_xcconfig = {
49 'DEFINES_MODULE' => 'YES',
50 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386',
51 'OTHER_LDFLAGS' =>
52 '-force_load ${PODS_TARGET_SRCROOT}/libonde_inference_dart.a',
53 }
54 s.preserve_paths = '../rust/**/*'
55 end