forked from spacedriveapp/spacedrive
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ENG-1840, ENG-1842] Add native dependencies for iOS (spacedriveapp#2693
) * Implement dowload of mobile native deps - Add a spinner animation to `pnpm prep` - Change abandoned dependency @iarna/toml with smol-toml - Validate cargo config.toml after generating it from mustache template - Disabled HTTP2 downloads with udici, it is very broken * Initial ios native deps xcframework logic * Remove logic for handling dynamic iOS libs, using static libs now * Fix PATH in build-rust.sh - Remove app.json * Restore crates/images/src/pdf.rs * minor fix .editorconfig * Finally ios successfully compiles with ffmpeg enabled - Change SDCore.podspec to add extra libraries required by ffmpeg - Fix heif linking for ios in config.toml template - Add symlink logic for extra libraries required to compile ios in build-rust.sh
- Loading branch information
1 parent
1db7aff
commit 3bbea40
Showing
18 changed files
with
324 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,51 @@ | ||
# | ||
# You will probs wanna add `use_frameworks! :linkage => :static` into your `ios/Podfile` as well. | ||
# | ||
|
||
require 'json' | ||
require "json" | ||
|
||
Pod::Spec.new do |s| | ||
s.name = 'SDCore' | ||
s.version = '0.0.0' | ||
s.summary = 'Spacedrive core for React Native' | ||
s.description = 'Spacedrive core for React Native' | ||
s.author = 'Oscar Beaumont' | ||
s.license = 'APGL-3.0' | ||
s.platform = :ios, '14.0' | ||
s.source = { git: 'https://github.com/spacedriveapp/spacedrive' } | ||
s.homepage = 'https://www.spacedrive.com' | ||
s.name = "SDCore" | ||
s.version = "0.0.0" | ||
s.summary = "Spacedrive core for React Native" | ||
s.description = "Spacedrive core for React Native" | ||
s.author = "Spacedrive Technology Inc" | ||
s.license = "AGPL-3.0" | ||
s.platform = :ios, "14.0" | ||
s.source = { git: "https://github.com/spacedriveapp/spacedrive" } | ||
s.homepage = "https://www.spacedrive.com" | ||
s.static_framework = true | ||
|
||
s.dependency 'ExpoModulesCore' | ||
s.dependency "ExpoModulesCore" | ||
|
||
s.pod_target_xcconfig = { | ||
'DEFINES_MODULE' => 'YES', | ||
'SWIFT_COMPILATION_MODE' => 'wholemodule' | ||
"DEFINES_MODULE" => "YES", | ||
"SWIFT_COMPILATION_MODE" => "wholemodule", | ||
} | ||
|
||
s.script_phase = { | ||
:name => "Build Spacedrive Core!", | ||
:script => "exec \"${PODS_TARGET_SRCROOT}/build-rust.sh\"", | ||
:execution_position => :before_compile, | ||
} | ||
|
||
s.script_phase = { | ||
:name => 'Build Spacedrive Core!', | ||
:script => 'env -i SPACEDRIVE_CI=$SPACEDRIVE_CI CONFIGURATION=$CONFIGURATION PLATFORM_NAME=$PLATFORM_NAME ${PODS_TARGET_SRCROOT}/build-rust.sh', | ||
:execution_position => :before_compile | ||
} | ||
# Add libraries | ||
ffmpeg_libraries = [ | ||
"-lmp3lame", "-lsoxr", "-ltheora", "-lopus", "-lvorbisenc", "-lx265", | ||
"-lpostproc", "-ltheoraenc", "-ltheoradec", "-lde265", "-lvorbisfile", | ||
"-logg", "-lSvtAv1Enc", "-lvpx", "-lhdr10plus", "-lx264", "-lvorbis", | ||
"-lzimg", "-lsoxr-lsr", "-liconv", "-lbz2", "-llzma" | ||
].join(' ') | ||
|
||
s.xcconfig = { | ||
'LIBRARY_SEARCH_PATHS' => '"' + JSON.parse(`cargo metadata`)["target_directory"].to_s + '"', | ||
'OTHER_LDFLAGS[sdk=iphoneos*]' => '$(inherited) -lsd_mobile_ios', | ||
'OTHER_LDFLAGS[sdk=iphonesimulator*]' => '$(inherited) -lsd_mobile_iossim' | ||
} | ||
# Add frameworks | ||
ffmpeg_frameworks = [ | ||
"-framework AudioToolbox", | ||
"-framework VideoToolbox", | ||
"-framework AVFoundation" | ||
].join(' ') | ||
|
||
s.xcconfig = { | ||
"LIBRARY_SEARCH_PATHS" => '"' + JSON.parse(`cargo metadata`)["target_directory"].to_s + '"', | ||
"OTHER_LDFLAGS[sdk=iphoneos*]" => "$(inherited) -lsd_mobile_ios #{ffmpeg_libraries} #{ffmpeg_frameworks}", | ||
"OTHER_LDFLAGS[sdk=iphonesimulator*]" => "$(inherited) -lsd_mobile_iossim #{ffmpeg_libraries} #{ffmpeg_frameworks}", | ||
} | ||
|
||
s.source_files = "**/*.{h,m,mm,swift,hpp,cpp}" | ||
s.module_map = "#{s.name}.modulemap" | ||
s.module_map = "#{s.name}.modulemap" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,5 +74,5 @@ | |
"eslintConfig": { | ||
"root": true | ||
}, | ||
"packageManager": "pnpm@9.7.0" | ||
"packageManager": "pnpm@9.9.0" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.