tdlight/example/ios/build-openssl.sh

39 lines
1.1 KiB
Bash
Raw Normal View History

#!/bin/sh
cd $(dirname $0)
git clone https://github.com/beeware/Python-Apple-support
cd Python-Apple-support
git checkout 60b990128d5f1f04c336ff66594574515ab56604 || exit 1
git reset --hard || exit 1
git apply ../Python-Apple-support.patch || exit 1
cd ..
#TODO: change openssl version
platforms="macOS iOS watchOS tvOS"
for platform in $platforms;
do
if [[ $platform = "macOS" ]]; then
simulators="0"
else
simulators="0 1"
fi
for simulator in $simulators;
do
if [[ $simulator = "1" ]]; then
platform="${platform}-simulator"
fi
echo $platform
cd Python-Apple-support
#NB: -j will fail
2022-10-14 22:09:16 +02:00
make OpenSSL-$platform || exit 1
cd ..
2022-10-14 22:09:16 +02:00
rm -rf third_party/openssl/$platform || exit 1
mkdir -p third_party/openssl/$platform/lib || exit 1
cp ./Python-Apple-support/build/$platform/libcrypto.a third_party/openssl/$platform/lib/ || exit 1
cp ./Python-Apple-support/build/$platform/libssl.a third_party/openssl/$platform/lib/ || exit 1
cp -r ./Python-Apple-support/build/$platform/openssl/include/ third_party/openssl/$platform/include || exit 1
done
done