Skip to content

Commit ba447c6

Browse files
fix: build opus + whisper xcframeworks from source during pod install
1 parent c22a27f commit ba447c6

4 files changed

Lines changed: 20 additions & 5 deletions

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ package-lock.json
7070
ios/generated/
7171
android/generated/
7272

73+
# Vendored XCFrameworks (built from source by prepare_command / build scripts)
74+
ios/opus/lib/
75+
ios/whisper/lib/
76+
7377
# Build artifacts
7478
*.tgz
7579

.npmignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Build artifacts
22
ios/opus/build/
3-
ios/opus/build-opus.sh
43
ios/whisper/build/
5-
ios/whisper/build-whisper.sh
64
ios/whisper/models/
75
ios/build/
86
android/build/

WebmPlayer.podspec

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,20 @@ Pod::Spec.new do |s|
1313
s.platforms = { :ios => "15.1" }
1414
s.source = { :git => "https://github.com/holepunchto/webm-player.git", :tag => "#{s.version}" }
1515

16+
# Build vendored XCFrameworks from source during pod install (parity with Android CMake FetchContent).
17+
# Requires: Xcode CLI tools, cmake (for whisper). Runs once per pod install/update.
18+
s.prepare_command = <<-SCRIPT
19+
set -e
20+
if [ ! -f ios/opus/lib/opus.xcframework/Info.plist ]; then
21+
echo "[WebmPlayer] Building Opus 1.6.1 XCFramework from source..."
22+
bash ios/opus/build-opus.sh build
23+
fi
24+
if [ ! -f ios/whisper/lib/whisper.xcframework/Info.plist ]; then
25+
echo "[WebmPlayer] Building whisper.cpp v1.8.4 XCFramework from source..."
26+
bash ios/whisper/build-whisper.sh build
27+
fi
28+
SCRIPT
29+
1630
# iOS-specific sources (Objective-C++)
1731
# libwebm mkvparser sources vendored under cpp/third_party/libwebm/
1832
# SpeexDSP resampler sources vendored under cpp/third_party/speexdsp/

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@
2424
"ios/common/**/*",
2525
"ios/playback/**/*",
2626
"ios/video/**/*",
27-
"ios/opus/lib/**/*",
28-
"ios/whisper/lib/**/*",
29-
"ios/transcript/**/*",
27+
"ios/opus/build-opus.sh",
28+
"ios/whisper/build-whisper.sh",
3029
"cpp/**/*",
3130
"*.podspec",
3231
"react-native.config.js"

0 commit comments

Comments
 (0)