forked from irungentoo/toxcore
-
Notifications
You must be signed in to change notification settings - Fork 292
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Support arm64 iphone simulator.
- Loading branch information
Showing
9 changed files
with
155 additions
and
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../LICENSE |
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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#!/bin/bash | ||
|
||
set -eux -o pipefail | ||
|
||
# Make a Tox.xcframework for iOS, iPhone simulator, and macOS from the nightly builds. | ||
for arch in arm64 armv7 armv7s; do | ||
rm -rf "ios/$arch" | ||
mkdir -p "ios/$arch" | ||
tar -C "ios/$arch" --strip-components=1 -zxf \ | ||
<(curl -L "https://github.com/TokTok/c-toxcore/releases/download/nightly/toxcore-nightly-ios-$arch.tar.gz") | ||
done | ||
|
||
for arch in arm64 x86_64; do | ||
rm -rf "iphonesimulator/$arch" | ||
mkdir -p "iphonesimulator/$arch" | ||
tar -C "iphonesimulator/$arch" --strip-components=1 -zxf \ | ||
<(curl -L "https://github.com/TokTok/c-toxcore/releases/download/nightly/toxcore-nightly-iphonesimulator-$arch.tar.gz") | ||
done | ||
|
||
for arch in arm64 x86_64; do | ||
rm -rf "macos/$arch" | ||
mkdir -p "macos/$arch" | ||
tar -C "macos/$arch" --strip-components=1 -zxf \ | ||
<(curl -L "https://github.com/TokTok/c-toxcore/releases/download/nightly/toxcore-nightly-macos-$arch.tar.gz") | ||
done | ||
|
||
# Make a Tox.framework for iOS. | ||
rm -rf ios/Tox.framework | ||
mkdir -p ios/Tox.framework | ||
cp -r ios/arm64/include/tox ios/Tox.framework/Headers | ||
lipo -create -output ios/Tox.framework/Tox ios/arm64/lib/libtoxcore.dylib ios/armv7/lib/libtoxcore.dylib ios/armv7s/lib/libtoxcore.dylib | ||
install_name_tool -id @rpath/Tox.framework/Tox ios/Tox.framework/Tox | ||
|
||
# Make a Tox.framework for iPhone simulator. | ||
rm -rf iphonesimulator/Tox.framework | ||
mkdir -p iphonesimulator/Tox.framework | ||
cp -r iphonesimulator/arm64/include/tox iphonesimulator/Tox.framework/Headers | ||
lipo -create -output iphonesimulator/Tox.framework/Tox iphonesimulator/arm64/lib/libtoxcore.dylib iphonesimulator/x86_64/lib/libtoxcore.dylib | ||
install_name_tool -id @rpath/Tox.framework/Tox iphonesimulator/Tox.framework/Tox | ||
|
||
# Make a Tox.framework for macOS. | ||
rm -rf macos/Tox.framework | ||
mkdir -p macos/Tox.framework | ||
cp -r macos/arm64/include/tox macos/Tox.framework/Headers | ||
lipo -create -output macos/Tox.framework/Tox macos/arm64/lib/libtoxcore.dylib macos/x86_64/lib/libtoxcore.dylib | ||
install_name_tool -id @rpath/Tox.framework/Tox macos/Tox.framework/Tox | ||
|
||
# Make a Tox.xcframework for iOS, iPhone simulator, and macOS. | ||
rm -rf Tox.xcframework | ||
xcodebuild -create-xcframework -framework ios/Tox.framework -framework iphonesimulator/Tox.framework -framework macos/Tox.framework -output Tox.xcframework | ||
|
||
# Test the Tox.xcframework. | ||
cat >smoke-test.c <<'EOF' | ||
#include <stdio.h> | ||
#pragma GCC diagnostic push | ||
#pragma GCC diagnostic ignored "-Wdocumentation-deprecated-sync" | ||
#include <tox/tox.h> | ||
#pragma GCC diagnostic pop | ||
int main(void) { | ||
Tox *tox = tox_new(NULL, NULL); | ||
if (tox == NULL) { | ||
fprintf(stderr, "tox_new failed\n"); | ||
return 1; | ||
} | ||
tox_kill(tox); | ||
return 0; | ||
} | ||
EOF | ||
pod lib lint toxcore.podspec |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Pod::Spec.new do |s| | ||
s.name = "toxcore" | ||
s.version = "0.2.20" | ||
s.summary = "Cocoapods wrapper for toxcore" | ||
s.homepage = "https://github.com/TokTok/c-toxcore" | ||
s.license = 'GPLv3' | ||
s.author = { "Iphigenia Df" => "[email protected]" } | ||
s.source = { | ||
:git => "https://github.com/TokTok/c-toxcore.git", | ||
:tag => s.version.to_s, | ||
:submodules => true | ||
} | ||
|
||
s.requires_arc = false | ||
|
||
s.ios.deployment_target = '12.0' | ||
s.osx.deployment_target = '10.15' | ||
|
||
s.vendored_frameworks = 'Tox.xcframework' | ||
s.xcconfig = { 'FRAMEWORK_SEARCH_PATHS' => '"${PODS_ROOT}"' } | ||
s.test_spec 'Tests' do |test_spec| | ||
test_spec.source_files = 'smoketest.c' | ||
end | ||
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