diff --git a/package/.gitignore b/package/.gitignore index 7e7aab9..2d577f7 100644 --- a/package/.gitignore +++ b/package/.gitignore @@ -68,6 +68,7 @@ android/keystores/debug.keystore # generated by bob lib/ +libs/ # Skia headers cpp/skia diff --git a/package/example/ios/Podfile.lock b/package/example/ios/Podfile.lock index 21cebe5..c20c56e 100644 --- a/package/example/ios/Podfile.lock +++ b/package/example/ios/Podfile.lock @@ -618,7 +618,7 @@ SPEC CHECKSUMS: React-jsinspector: 8baadae51f01d867c3921213a25ab78ab4fbcd91 React-logger: 8edc785c47c8686c7962199a307015e2ce9a0e4f react-native-skia: 60202ab85d2ea2f90f9e3d70f4dcb00fd589e72e - react-native-skia-skottie: 69f79c001f2beccb9991c40cd684be99d4b45e8f + react-native-skia-skottie: 3b28eefda39685d1bea75d9e3910aef5e505fba5 React-NativeModulesApple: b6868ee904013a7923128892ee4a032498a1024a React-perflogger: 31ea61077185eb1428baf60c0db6e2886f141a5a React-RCTActionSheet: 392090a3abc8992eb269ef0eaa561750588fc39d diff --git a/package/react-native-skia-skottie.podspec b/package/react-native-skia-skottie.podspec index b69fbf0..e8406d2 100644 --- a/package/react-native-skia-skottie.podspec +++ b/package/react-native-skia-skottie.podspec @@ -18,20 +18,25 @@ Pod::Spec.new do |s| s.platforms = { :ios => "12.4" } s.source = { :git => "https://github.com/margelo/react-native-skia-skottie.git", :tag => "#{s.version}" } - # TODO: what does that do, why do we need it? - s.requires_arc = true - s.pod_target_xcconfig = { "GCC_PREPROCESSOR_DEFINITIONS" => "$(inherited) SK_METAL=1 SK_GANESH=1", # TODO: do i need this? "CLANG_CXX_LANGUAGE_STANDARD" => "c++17", "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/cpp/\"/** \"#{skiaPath}/cpp/**\" " } - pwd = Pathname.new(Dir.pwd) - relative_skia_path = Pathname.new(skiaPath).relative_path_from(pwd).to_s + # Unfortunately vendored_frameworks doesn't support relative parent paths, or absolute paths. + # So we have to copy the frameworks to a path on the same level as the podspec. + s.prepare_command = <<-CMD + mkdir -p libs/ + rm -rf libs/ios + mkdir -p libs/ios + cp -r "#{skiaPath}/libs/ios/libsksg.xcframework" libs/ios/ + cp -r "#{skiaPath}/libs/ios/libskottie.xcframework" libs/ios/ + CMD + s.ios.vendored_frameworks = [ - "#{relative_skia_path}/libs/ios/libsksg.xcframework", - "#{relative_skia_path}/libs/ios/libskottie.xcframework", + "libs/ios/libsksg.xcframework", + "libs/ios/libskottie.xcframework" ] s.source_files = "ios/**/*.{h,m,mm}", "cpp/**/*.{h,cpp}"