-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[backport] fix(ios): publish libcrypto, libssl, libevent, libtor, lib…
…z frameworks This diff backports #1372 to the release/3.19 bran. This diff fixes ooni/probe#2569. While there, consolidate quick bash-based tests into the `checks.yml` action. While there, expect Xcode 15.0 for local builds.
- Loading branch information
1 parent
53cad17
commit a2b71cb
Showing
25 changed files
with
790 additions
and
152 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 was deleted.
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
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,2 +1,3 @@ | ||
/oonimkall.framework/ | ||
/oonimkall.* | ||
/*.xcframework/ | ||
/*.zip | ||
/*.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
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
__version=$(date -u +%Y.%m.%d-%H%M%S) | ||
__release="${1:-$(git describe --tags || echo '0.0.0-dev')}" | ||
|
||
# Save original variable before substitution so we can unit test it | ||
__orig=${__release} | ||
|
||
# determine whether we're publishing to a release or to rolling | ||
# | ||
# when publishing to rolling the __release variable is like: 'v3.19.0-alpha-27-g4678578b' | ||
# otherwise it's like `v3.19.0`, `v3.19.0-alpha`, or `v3.19.0-beta.555`. | ||
if ! [[ $__release =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[a-z]+(\.[0-9]+)?)?$ ]]; then | ||
__release=rolling | ||
fi | ||
|
||
if [[ ${CREATE_POD_SPECS_DEBUG:-0} == 1 ]]; then | ||
echo "$__orig -> $__release" | ||
exit 0 | ||
fi | ||
|
||
for name in libcrypto libevent libssl libtor libz oonimkall; do | ||
cat ./MOBILE/ios/${name}-template.podspec | sed -e "s/@VERSION@/$__version/g" \ | ||
-e "s/@RELEASE@/$__release/g" >./MOBILE/ios/${name}.podspec | ||
done |
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,32 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
export CREATE_POD_SPECS_DEBUG=1 | ||
|
||
function check() { | ||
local expect=$1 | ||
local got=$2 | ||
echo -n "checking whether '$expect' equals '$got'... " 1>&2 | ||
if [[ "$got" != "$expect" ]]; then | ||
echo "NO" 1>&2 | ||
exit 1 | ||
fi | ||
echo "yes" | ||
} | ||
|
||
expect="v3.10.9-beta.116-44-g1777474 -> rolling" | ||
got=$(./MOBILE/ios/createpodspecs v3.10.9-beta.116-44-g1777474) | ||
check "$expect" "$got" | ||
|
||
expect="v3.10.0 -> v3.10.0" | ||
got=$(./MOBILE/ios/createpodspecs v3.10.0) | ||
check "$expect" "$got" | ||
|
||
expect="v3.10.0-alpha -> v3.10.0-alpha" | ||
got=$(./MOBILE/ios/createpodspecs v3.10.0-alpha) | ||
check "$expect" "$got" | ||
|
||
expect="v3.10.0-alpha.1 -> v3.10.0-alpha.1" | ||
got=$(./MOBILE/ios/createpodspecs v3.10.0-alpha.1) | ||
check "$expect" "$got" | ||
|
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,13 @@ | ||
Pod::Spec.new do |s| | ||
s.name = "libcrypto" | ||
s.version = "@VERSION@" | ||
s.summary = "OpenSSL libcrypto compiled for OONI Probe iOS" | ||
s.author = "Simone Basso" | ||
s.homepage = "https://github.com/ooni/probe-cli" | ||
s.license = { :type => "Apache" } | ||
s.source = { | ||
:http => "https://github.com/ooni/probe-cli/releases/download/@RELEASE@/libcrypto.xcframework.zip" | ||
} | ||
s.platform = :ios, "9.0" | ||
s.ios.vendored_frameworks = "libcrypto.xcframework" | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Pod::Spec.new do |s| | ||
s.name = "libevent" | ||
s.version = "@VERSION@" | ||
s.summary = "Libevent compiled for OONI Probe iOS" | ||
s.author = "Simone Basso" | ||
s.homepage = "https://github.com/ooni/probe-cli" | ||
s.license = { :type => "BSD" } | ||
s.source = { | ||
:http => "https://github.com/ooni/probe-cli/releases/download/@RELEASE@/libevent.xcframework.zip" | ||
} | ||
s.platform = :ios, "9.0" | ||
s.ios.vendored_frameworks = "libevent.xcframework" | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Pod::Spec.new do |s| | ||
s.name = "libssl" | ||
s.version = "@VERSION@" | ||
s.summary = "OpenSSL libssl compiled for OONI Probe iOS" | ||
s.author = "Simone Basso" | ||
s.homepage = "https://github.com/ooni/probe-cli" | ||
s.license = { :type => "Apache" } | ||
s.source = { | ||
:http => "https://github.com/ooni/probe-cli/releases/download/@RELEASE@/libssl.xcframework.zip" | ||
} | ||
s.platform = :ios, "9.0" | ||
s.ios.vendored_frameworks = "libssl.xcframework" | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Pod::Spec.new do |s| | ||
s.name = "libtor" | ||
s.version = "@VERSION@" | ||
s.summary = "tor compiled for OONI Probe iOS" | ||
s.author = "Simone Basso" | ||
s.homepage = "https://github.com/ooni/probe-cli" | ||
s.license = { :type => "BSD" } | ||
s.source = { | ||
:http => "https://github.com/ooni/probe-cli/releases/download/@RELEASE@/libtor.xcframework.zip" | ||
} | ||
s.platform = :ios, "9.0" | ||
s.ios.vendored_frameworks = "libtor.xcframework" | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Pod::Spec.new do |s| | ||
s.name = "libz" | ||
s.version = "@VERSION@" | ||
s.summary = "zlib compiled for OONI Probe iOS" | ||
s.author = "Simone Basso" | ||
s.homepage = "https://github.com/ooni/probe-cli" | ||
s.license = { :type => "zlib" } | ||
s.source = { | ||
:http => "https://github.com/ooni/probe-cli/releases/download/@RELEASE@/libz.xcframework.zip" | ||
} | ||
s.platform = :ios, "9.0" | ||
s.ios.vendored_frameworks = "libz.xcframework" | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/bash | ||
set -euxo pipefail | ||
|
||
TOPDIR=$(dirname $(dirname $(dirname $(realpath $0)))) | ||
WORK=$(mktemp -d) | ||
|
||
# make_framework constructs a framework. | ||
# | ||
# This function does not bother itself with installing headers because we have | ||
# already used the relevant headers when invoking `gomobile bind`. | ||
# | ||
# Arguments: | ||
# | ||
# - $1 is the name of the framework to create. | ||
function make_framework() { | ||
local name=$1 | ||
shift | ||
|
||
# Start afresh. | ||
rm -rf MOBILE/ios/${name}.xcframework | ||
|
||
# Create iphoneos/arm64 framework. | ||
mkdir -p $WORK/iphoneos/${name}.framework/Versions/A/Headers | ||
ln -s A $WORK/iphoneos/${name}.framework/Versions/Current | ||
ln -s Versions/Current/Headers $WORK/iphoneos/${name}.framework/Headers | ||
ln -s Versions/Current/${name} $WORK/iphoneos/${name}.framework/${name} | ||
xcrun lipo $TOPDIR/internal/libtor/iphoneos/arm64/lib/${name}.a -create \ | ||
-o $WORK/iphoneos/${name}.framework/Versions/A/${name} | ||
|
||
# Create iphonesimulator/{amd,arm}64 framework. | ||
mkdir -p $WORK/iphonesimulator/${name}.framework/Versions/A/Headers | ||
ln -s A $WORK/iphonesimulator/${name}.framework/Versions/Current | ||
ln -s Versions/Current/Headers $WORK/iphonesimulator/${name}.framework/Headers | ||
ln -s Versions/Current/${name} $WORK/iphonesimulator/${name}.framework/${name} | ||
xcrun lipo $TOPDIR/internal/libtor/iphonesimulator/amd64/lib/${name}.a \ | ||
$TOPDIR/internal/libtor/iphonesimulator/arm64/lib/${name}.a \ | ||
-create -output $WORK/iphonesimulator/${name}.framework/Versions/A/${name} | ||
|
||
# Create a .xcframework. | ||
xcodebuild -create-xcframework -framework /private$WORK/iphoneos/${name}.framework \ | ||
-framework /private$WORK/iphonesimulator/${name}.framework -output MOBILE/ios/${name}.xcframework | ||
} | ||
|
||
make_framework libz | ||
make_framework libcrypto | ||
make_framework libssl | ||
make_framework libevent | ||
make_framework libtor |
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
set -euxo pipefail | ||
( | ||
cd ./MOBILE/ios | ||
for name in libcrypto libevent libssl libtor libz oonimkall; do | ||
rm -rf ${name}.xcframework.zip | ||
zip -yr ${name}.xcframework.zip ${name}.xcframework | ||
done | ||
) |
Oops, something went wrong.