react-native-lingua 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Lingua.podspec +39 -1
- package/package.json +1 -1
package/Lingua.podspec
CHANGED
|
@@ -19,7 +19,45 @@ Pod::Spec.new do |s|
|
|
|
19
19
|
|
|
20
20
|
# Build Rust library from source during pod install
|
|
21
21
|
s.prepare_command = <<-CMD
|
|
22
|
-
|
|
22
|
+
set -e
|
|
23
|
+
|
|
24
|
+
# Check if Rust is installed
|
|
25
|
+
if ! command -v cargo &> /dev/null; then
|
|
26
|
+
echo "❌ Error: Rust is not installed."
|
|
27
|
+
echo "Please install Rust: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh"
|
|
28
|
+
exit 1
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
# Check if iOS targets are installed
|
|
32
|
+
if ! rustup target list --installed | grep -q "aarch64-apple-ios"; then
|
|
33
|
+
echo "❌ Error: iOS Rust targets not installed."
|
|
34
|
+
echo "Please run: rustup target add aarch64-apple-ios aarch64-apple-ios-sim"
|
|
35
|
+
exit 1
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
# Build the xcframework
|
|
39
|
+
cd rust
|
|
40
|
+
make header
|
|
41
|
+
|
|
42
|
+
# Build for iOS targets
|
|
43
|
+
echo "Building Rust library for iOS..."
|
|
44
|
+
cargo build --release --target aarch64-apple-ios
|
|
45
|
+
cargo build --release --target aarch64-apple-ios-sim
|
|
46
|
+
|
|
47
|
+
# Create xcframework
|
|
48
|
+
mkdir -p generated/include
|
|
49
|
+
xcodebuild -create-xcframework \
|
|
50
|
+
-library target/aarch64-apple-ios/release/liblingua_native.a \
|
|
51
|
+
-headers generated/include \
|
|
52
|
+
-library target/aarch64-apple-ios-sim/release/liblingua_native.a \
|
|
53
|
+
-headers generated/include \
|
|
54
|
+
-output generated/liblingua_native.xcframework
|
|
55
|
+
|
|
56
|
+
# Copy to ios directory
|
|
57
|
+
cp -rf generated/*.xcframework ../ios/
|
|
58
|
+
cp -f generated/include/liblingua.h ../cpp/
|
|
59
|
+
|
|
60
|
+
echo "✅ Rust library built successfully"
|
|
23
61
|
CMD
|
|
24
62
|
|
|
25
63
|
install_modules_dependencies(s)
|