From 5e45a67b52c0e528c648464e13d287ffdc4537a8 Mon Sep 17 00:00:00 2001 From: Jason Cox Date: Mon, 20 Jan 2025 09:23:10 -0800 Subject: [PATCH] Update script to allow single platform builds #76 --- .gitignore | 8 +- README.md | 29 +- build.sh | 368 +++++---- curl/libcurl-build.sh | 165 ++-- example/iOS Test App/README.md | 9 + .../iOS Test App.xcodeproj/project.pbxproj | 4 +- .../iOS Test App/ViewController.m | 6 +- example/macOS Test App | 1 + example/tvOS Test App/README.md | 31 + .../tvOS Test App.xcodeproj/project.pbxproj | 712 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../tvOS Test App/tvOS Test App/AppDelegate.h | 18 + .../tvOS Test App/tvOS Test App/AppDelegate.m | 54 ++ .../AccentColor.colorset/Contents.json | 11 + .../Content.imageset/Contents.json | 11 + .../Back.imagestacklayer/Contents.json | 6 + .../Contents.json | 17 + .../Content.imageset/Contents.json | 11 + .../Front.imagestacklayer/Contents.json | 6 + .../Content.imageset/Contents.json | 11 + .../Middle.imagestacklayer/Contents.json | 6 + .../Content.imageset/Contents.json | 16 + .../Back.imagestacklayer/Contents.json | 6 + .../App Icon.imagestack/Contents.json | 17 + .../Content.imageset/Contents.json | 16 + .../Front.imagestacklayer/Contents.json | 6 + .../Content.imageset/Contents.json | 16 + .../Middle.imagestacklayer/Contents.json | 6 + .../Contents.json | 32 + .../Contents.json | 16 + .../Top Shelf Image.imageset/Contents.json | 16 + .../Assets.xcassets/Contents.json | 6 + .../Base.lproj/LaunchScreen.storyboard | 24 + .../tvOS Test App/Base.lproj/Main.storyboard | 80 ++ .../tvOS Test App/ViewController.h | 36 + .../tvOS Test App/ViewController.m | 260 +++++++ example/tvOS Test App/tvOS Test App/main.m | 18 + nghttp2/nghttp2-build.sh | 177 +++-- openssl/openssl-build-phase1.sh | 114 +-- openssl/openssl-build-phase2.sh | 155 ++-- 41 files changed, 2108 insertions(+), 408 deletions(-) create mode 160000 example/macOS Test App create mode 100644 example/tvOS Test App/README.md create mode 100644 example/tvOS Test App/tvOS Test App.xcodeproj/project.pbxproj create mode 100644 example/tvOS Test App/tvOS Test App.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 example/tvOS Test App/tvOS Test App.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 example/tvOS Test App/tvOS Test App/AppDelegate.h create mode 100644 example/tvOS Test App/tvOS Test App/AppDelegate.m create mode 100644 example/tvOS Test App/tvOS Test App/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Contents.json create mode 100644 example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Contents.json create mode 100644 example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Contents.json create mode 100644 example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Contents.json create mode 100644 example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Contents.json create mode 100644 example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json create mode 100644 example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Contents.json create mode 100644 example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json create mode 100644 example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Contents.json create mode 100644 example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Contents.json create mode 100644 example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json create mode 100644 example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Contents.json create mode 100644 example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json create mode 100644 example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Contents.json create mode 100644 example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json create mode 100644 example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json create mode 100644 example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json create mode 100644 example/tvOS Test App/tvOS Test App/Assets.xcassets/Contents.json create mode 100644 example/tvOS Test App/tvOS Test App/Base.lproj/LaunchScreen.storyboard create mode 100644 example/tvOS Test App/tvOS Test App/Base.lproj/Main.storyboard create mode 100644 example/tvOS Test App/tvOS Test App/ViewController.h create mode 100644 example/tvOS Test App/tvOS Test App/ViewController.m create mode 100644 example/tvOS Test App/tvOS Test App/main.m diff --git a/.gitignore b/.gitignore index 61dae4e..8ceba4d 100755 --- a/.gitignore +++ b/.gitignore @@ -42,7 +42,7 @@ cURLtv.sh *.orig test.sh -# Library Archives +# Build Artifacts ###################### archive/ libcrypto.a @@ -55,3 +55,9 @@ openssl-ios-x86_64-maccatalyst.a releases sandbox/ example/iOS\ Test\ App/libs/ +example/tvOS\ Test\ App/libs/ +example/macOS\ Test\ App/libs/ +example/iOS\ Test\ App/include/ +example/tvOS\ Test\ App/include/ +example/macOS\ Test\ App/include/ +cacert.pem diff --git a/README.md b/README.md index a6c99c5..e515f0d 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ This Script builds OpenSSL, nghttp2 and cURL/libcurl for MacOS (x86_64, arm64), ## News +* 19-Jan-2025: Updated build script to allow building for single platform targets: macOS, iOS or tvOS. Specify with `-p macOS`. Default build is for "all" as it has been. Added examples apps for tvOS and macOS. * 17-Mar-2024: Updated tvOS build script to work with XCode 15.3 and added `--without-libpsl` for cURL due to on-by-default policy (see [cURL blog](https://daniel.haxx.se/blog/2024/01/10/psl-in-curl/)). TODO: Get a static build of libpsl for cross-compile. * 19-Jul-2023: Added OpenSSL 3.0.x (LTS) Support and removed EOL bitcode for builds going forward. * 13-Feb-2021: Update now builds XCFrameworks which supports all platforms and targets for easy import into your projects. @@ -23,9 +24,9 @@ The build script accepts several arguments to adjust versions and toggle feature ``` ./build.sh [-o ] [-c ] [-n ] [-d] [-e] [-3] [-x] [-h] [...] - -o Build OpenSSL version (default 3.0.9) - -c Build curl version (default 8.1.2) - -n Build nghttp2 version (default 1.55.1) + -o Build OpenSSL version (default 3.0.15) + -c Build curl version (default 8.11.1) + -n Build nghttp2 version (default 1.64.0) -d Compile without HTTP2 support -e Compile with OpenSSL engine support -b Compile without bitcode @@ -34,9 +35,11 @@ The build script accepts several arguments to adjust versions and toggle feature -3 Compile with SSLv3 -s iOS min target version (default 8.0) -t tvOS min target version (default 9.0) - -i macOS 86_64 min target version (default 11.6.6) - -a macOS arm64 min target version (default 11.6.6) + -i macOS 86_64 min target version (default 14.6.1) + -a macOS arm64 min target version (default 14.6.1) -x No color output + -p Build only for specified platform (iOS, tvOS, macOS, or all [default]) + -y Skip build confirmation -h Show usage ``` @@ -55,7 +58,15 @@ Minimum macOS, iOS and tvOS target build versions are set by default in the buil ```bash git clone https://github.com/jasonacox/Build-OpenSSL-cURL.git cd Build-OpenSSL-cURL + +# Build for all: macOS, iOS, and tvOS ./build.sh + +# Build for macOS only +./build.sh -p macos + +# build for iOS only +./build.sh -p ios ``` Default versions are specified in the `build.sh` script but you can specify the version you want to build via the command line, e.g.: @@ -74,9 +85,9 @@ You can update the default version by editing this section in the `build.sh` scr # EDIT this section to Select Default Versions # ################################################ -OPENSSL="3.0.9" # https://www.openssl.org/source/ -LIBCURL="8.1.2" # https://curl.haxx.se/download.html -NGHTTP2="1.55.1" # https://nghttp2.org/ +OPENSSL="3.0.15" # https://www.openssl.org/source/ - LTS Version +LIBCURL="8.11.1" # https://curl.haxx.se/download.html +NGHTTP2="1.64.0" # https://nghttp2.org/ ################################################ ``` @@ -402,3 +413,5 @@ If you see "FATAL ERROR" during the nghttp2 build phase, this is likely due to n If you are on a new macOS installation and wonder why the build is failing, you might need to set the correct path for the command line tools: xcode-select --switch /Applications/Xcode.app + +If the build fails for a newer version of one of the libraries, submit a ticket. Please note, the project focuses on supporting long term support (LTS) versions of libraries. OpenSSL in particular, has many dev or short term support versions. These change too freuqently to adequately support. Switch to a LTS version. Submit any errors you get with LTS versions. diff --git a/build.sh b/build.sh index 3b16159..25cf09c 100755 --- a/build.sh +++ b/build.sh @@ -23,10 +23,13 @@ NGHTTP2="1.64.0" # https://nghttp2.org/ BUILD_MACHINE=`uname -m` BUILD_CMD=$* +# Compile Cache - Optional +# export CMAKE_CXX_COMPILER_LAUNCHER="ccache" + # Set minimum OS versions for target MACOS_X86_64_VERSION="" # Empty = use host version MACOS_ARM64_VERSION="" # Min supported is MacOS 11.0 Big Sur -CATALYST_IOS="15.0" # Min supported is iOS 15.0 for Mac Catalyst +CATALYST_IOS="15.0" # Min supported is iOS 15.0 for Mac Catalyst IOS_MIN_SDK_VERSION="8.0" TVOS_MIN_SDK_VERSION="9.0" @@ -45,6 +48,9 @@ if version_lte $MACOS_ARM64_VERSION 11.0; then MACOS_ARM64_VERSION="11.0" # Min support for Apple Silicon is 11.0 fi +# Defaults +BUILDFOR="all" + # Global flags engine="" buildnghttp2="-n" @@ -52,6 +58,7 @@ disablebitcode="" colorflag="" catalyst="" sslv3="" +autobuild="" # Formatting default="\033[39m" @@ -66,10 +73,14 @@ normal="${white}\033[0m" dim="\033[0m${white}\033[2m" alert="\033[0m${red}\033[1m" alertdim="\033[0m${red}\033[2m" +archbold="\033[0m${yellow}\033[1m" + +# Set trap to alert on error and show line +trap 'echo -e "${alert}** ERROR occurred on line $LINENO ($0) - exit code: $?"' ERR +trap 'echo -e "\n${alertdim}Cancelled by User${normal}"; exit 1' INT # Show Usage -usage () -{ +usage () { echo echo -e "${bold}Usage:${normal}" echo @@ -89,74 +100,57 @@ usage () echo " -i macOS 86_64 min target version (default $MACOS_X86_64_VERSION)" echo " -a macOS arm64 min target version (default $MACOS_ARM64_VERSION)" echo " -x No color output" + echo " -p Build only for specified platform (iOS, tvOS, macOS, or all [default])" + echo " -y Skip build confirmation" echo " -h Show usage" echo exit 127 } # Process command line arguments -while getopts "o:c:n:u:s:t:i:a:debm3xh\?" o; do - case "${o}" in - o) - OPENSSL="${OPTARG}" - ;; - c) - LIBCURL="${OPTARG}" - ;; - n) - NGHTTP2="${OPTARG}" - ;; - d) - buildnghttp2="" - ;; - e) - engine="-e" - ;; - b) - disablebitcode="-b" - ;; - m) - catalyst="-m" - ;; - u) - catalyst="-m -u ${OPTARG}" - CATALYST_IOS="${OPTARG}" - ;; - 3) - echo "WARNING: SSLv3 is requested. SSLv3 is not secure and has been deprecated." +while getopts "o:c:n:u:s:t:i:a:p:debm3xhy\?" o; do + case "${o}" in + o) OPENSSL="${OPTARG}" ;; + c) LIBCURL="${OPTARG}" ;; + n) NGHTTP2="${OPTARG}" ;; + d) buildnghttp2="" ;; + e) engine="-e" ;; + b) disablebitcode="-b" ;; + m) catalyst="-m" ;; + u) catalyst="-m -u ${OPTARG}"; CATALYST_IOS="${OPTARG}" ;; + 3) + echo "WARNING: SSLv3 is requested. SSLv3 is not secure and has been deprecated." echo "If you proceed, builds may fail as SSLv3 is no longer supported by curl." read -p "Do you want to continue (y/N)? " choice case "$choice" in - y|Y ) echo "Continuing with SSLv3 build"; echo "";; - * ) echo "Exiting"; exit 1;; + y|Y ) echo "Continuing with SSLv3 build"; echo "" ;; + * ) echo "Exiting"; exit 1 ;; esac sslv3="-3" ;; - s) - IOS_MIN_SDK_VERSION="${OPTARG}" - ;; - t) - TVOS_MIN_SDK_VERSION="${OPTARG}" - ;; - i) - MACOS_X86_64_VERSION="${OPTARG}" - ;; - a) - MACOS_ARM64_VERSION="${OPTARG}" - ;; - x) - bold="" - subbold="" - normal="" - dim="" - alert="" - alertdim="" + s) IOS_MIN_SDK_VERSION="${OPTARG}" ;; + t) TVOS_MIN_SDK_VERSION="${OPTARG}" ;; + i) MACOS_X86_64_VERSION="${OPTARG}" ;; + a) MACOS_ARM64_VERSION="${OPTARG}" ;; + x) + bold=""; subbold=""; normal=""; dim=""; alert=""; alertdim=""; archbold="" colorflag="-x" ;; - *) - usage + p) + BUILDFOR=$(echo "$OPTARG" | tr '[:upper:]' '[:lower:]') + BUILDFORARGS="-p $BUILDFOR" + if [ "$BUILDFOR" == "all" ]; then + BUILDFORARGS="" + elif [ "$BUILDFOR" != "ios" ] && [ "$BUILDFOR" != "tvos" ] && [ "$BUILDFOR" != "macos" ]; then + echo -e "${alert}Invalid platform requested${normal}: $BUILDFOR" + echo "Please specify iOS, tvOS or macOS" + exit 127 + fi + catalyst="" # Clear catalyst if not building for all ;; - esac + y) autobuild="-y" ;; + *) usage ;; + esac done shift $((OPTIND-1)) @@ -165,12 +159,38 @@ OSARGS="-s ${IOS_MIN_SDK_VERSION} -t ${TVOS_MIN_SDK_VERSION} -i ${MACOS_X86_64_V ## Welcome echo -e "${bold}Build-OpenSSL-cURL${dim}" -if [ "$catalyst" != "" ]; then - echo "This script builds OpenSSL, nghttp2 and libcurl for MacOS, Catalyst, iOS and tvOS devices." +echo +echo -e " - OpenSSL version: ${subbold}${OPENSSL}${dim}" +echo -e " - cURL version: ${subbold}${LIBCURL}${dim}" +if [ "$buildnghttp2" == "" ]; then + echo "" + echo -n "This script builds OpenSSL and libcurl for " else - echo "This script builds OpenSSL, nghttp2 and libcurl for MacOS, iOS and tvOS devices." + echo -e " - nghttp2 version: ${subbold}${NGHTTP2}${dim}" + echo "" + echo -n "This script builds OpenSSL, nghttp2 and libcurl for " +fi +case "$BUILDFOR" in + ios) echo -e "${archbold}iOS${dim}" ;; + tvos) echo -e "${archbold}tvOS${dim}" ;; + macos) echo -e "${archbold}macOS${dim}" ;; + *) + if [ "$catalyst" != "" ]; then + echo -e "${archbold}macOS${dim}, ${archbold}catalyst${dim}, ${archbold}iOS${dim} and ${archbold}tvOS${dim}" + else + echo -e "${archbold}macOS${dim}, ${archbold}iOS${dim} and ${archbold}tvOS${dim}" + fi + ;; +esac + +## Ask for confirmation to continue +if [ "$autobuild" == "" ]; then + read -p "Continue (Y/n)? " choice + case "$choice" in + n|N ) echo "Exiting"; exit 1 ;; + * ) echo "Continuing..."; echo "" ;; + esac fi -echo "Targets: x86_64, armv7, armv7s, arm64 and arm64e" ## Start Counter START=$(date +%s) @@ -184,7 +204,7 @@ fi echo cd openssl echo -e "${bold}Building OpenSSL${normal}" -./openssl-build.sh -v "$OPENSSL" $engine $colorflag $catalyst $sslv3 $OSARGS +./openssl-build.sh -v "$OPENSSL" $engine $colorflag $catalyst $sslv3 $OSARGS $BUILDFORARGS cd .. ## Nghttp2 Build @@ -194,7 +214,7 @@ else echo echo -e "${bold}Building nghttp2 for HTTP2 support${normal}" cd nghttp2 - ./nghttp2-build.sh -v "$NGHTTP2" $colorflag $catalyst $OSARGS + ./nghttp2-build.sh -v "$NGHTTP2" $colorflag $catalyst $OSARGS $BUILDFORARGS cd .. fi @@ -202,7 +222,7 @@ fi echo echo -e "${bold}Building Curl${normal}" cd curl -./libcurl-build.sh -v "$LIBCURL" $disablebitcode $colorflag $buildnghttp2 $catalyst $sslv3 $OSARGS +./libcurl-build.sh -v "$LIBCURL" $disablebitcode $colorflag $buildnghttp2 $catalyst $sslv3 $OSARGS $BUILDFORARGS cd .. ## Archive Libraries and Clean Up @@ -220,7 +240,6 @@ echo echo -e "${subbold}libcurl (rename to libcurl.a)${normal} [${dim}$LIBCURL${normal}]${dim}" xcrun -sdk iphoneos lipo -info curl/lib/*.a -EXAMPLE="example/iOS Test App" ARCHIVE="archive/libcurl-$LIBCURL-openssl-$OPENSSL-nghttp2-$NGHTTP2" echo @@ -244,26 +263,33 @@ mkdir -p "$ARCHIVE/framework" mkdir -p "$ARCHIVE/xcframework" # libraries for libcurl, libcrypto and libssl -cp curl/lib/libcurl_iOS.a $ARCHIVE/lib/iOS/libcurl.a -cp curl/lib/libcurl_iOS-simulator.a $ARCHIVE/lib/iOS-simulator/libcurl.a -cp curl/lib/libcurl_iOS-fat.a $ARCHIVE/lib/iOS-fat/libcurl.a -cp curl/lib/libcurl_tvOS.a $ARCHIVE/lib/tvOS/libcurl.a -cp curl/lib/libcurl_tvOS-simulator.a $ARCHIVE/lib/tvOS-simulator/libcurl.a -cp curl/lib/libcurl_Mac.a $ARCHIVE/lib/MacOS/libcurl.a - -cp openssl/iOS/lib/libcrypto.a $ARCHIVE/lib/iOS/libcrypto.a -cp openssl/iOS-simulator/lib/libcrypto.a $ARCHIVE/lib/iOS-simulator/libcrypto.a -cp openssl/iOS-fat/lib/libcrypto.a $ARCHIVE/lib/iOS-fat/libcrypto.a -cp openssl/tvOS/lib/libcrypto.a $ARCHIVE/lib/tvOS/libcrypto.a -cp openssl/tvOS-simulator/lib/libcrypto.a $ARCHIVE/lib/tvOS-simulator/libcrypto.a -cp openssl/Mac/lib/libcrypto.a $ARCHIVE/lib/MacOS/libcrypto.a - -cp openssl/iOS/lib/libssl.a $ARCHIVE/lib/iOS/libssl.a -cp openssl/iOS-simulator/lib/libssl.a $ARCHIVE/lib/iOS-simulator/libssl.a -cp openssl/iOS-fat/lib/libssl.a $ARCHIVE/lib/iOS-fat/libssl.a -cp openssl/tvOS/lib/libssl.a $ARCHIVE/lib/tvOS/libssl.a -cp openssl/tvOS-simulator/lib/libssl.a $ARCHIVE/lib/tvOS-simulator/libssl.a -cp openssl/Mac/lib/libssl.a $ARCHIVE/lib/MacOS/libssl.a +if [ "$BUILDFOR" == "ios" ] || [ "$BUILDFOR" == "all" ]; then + # Copy iOS libraries + cp curl/lib/libcurl_iOS.a $ARCHIVE/lib/iOS/libcurl.a + cp curl/lib/libcurl_iOS-simulator.a $ARCHIVE/lib/iOS-simulator/libcurl.a + cp curl/lib/libcurl_iOS-fat.a $ARCHIVE/lib/iOS-fat/libcurl.a + cp openssl/iOS/lib/libcrypto.a $ARCHIVE/lib/iOS/libcrypto.a + cp openssl/iOS-simulator/lib/libcrypto.a $ARCHIVE/lib/iOS-simulator/libcrypto.a + cp openssl/iOS-fat/lib/libcrypto.a $ARCHIVE/lib/iOS-fat/libcrypto.a + cp openssl/iOS/lib/libssl.a $ARCHIVE/lib/iOS/libssl.a + cp openssl/iOS-simulator/lib/libssl.a $ARCHIVE/lib/iOS-simulator/libssl.a + cp openssl/iOS-fat/lib/libssl.a $ARCHIVE/lib/iOS-fat/libssl.a +fi +if [ "$BUILDFOR" == "tvos" ] || [ "$BUILDFOR" == "all" ]; then + # Copy tvOS libraries + cp curl/lib/libcurl_tvOS.a $ARCHIVE/lib/tvOS/libcurl.a + cp curl/lib/libcurl_tvOS-simulator.a $ARCHIVE/lib/tvOS-simulator/libcurl.a + cp openssl/tvOS/lib/libcrypto.a $ARCHIVE/lib/tvOS/libcrypto.a + cp openssl/tvOS-simulator/lib/libcrypto.a $ARCHIVE/lib/tvOS-simulator/libcrypto.a + cp openssl/tvOS/lib/libssl.a $ARCHIVE/lib/tvOS/libssl.a + cp openssl/tvOS-simulator/lib/libssl.a $ARCHIVE/lib/tvOS-simulator/libssl.a +fi +if [ "$BUILDFOR" == "macos" ] || [ "$BUILDFOR" == "all" ]; then + # Copy MacOS libraries + cp curl/lib/libcurl_Mac.a $ARCHIVE/lib/MacOS/libcurl.a + cp openssl/Mac/lib/libcrypto.a $ARCHIVE/lib/MacOS/libcrypto.a + cp openssl/Mac/lib/libssl.a $ARCHIVE/lib/MacOS/libssl.a +fi if [ "$catalyst" != "" ]; then # Add catalyst libraries @@ -308,7 +334,7 @@ if [ "$catalyst" != "" ]; then -library $ARCHIVE/lib/Catalyst/libssl.a \ -library $ARCHIVE/lib/MacOS/libssl.a \ -output $ARCHIVE/xcframework/libssl.xcframework -else +elif [ "$BUILDFOR" == "all" ]; then # Build XCFrameworks xcodebuild -create-xcframework \ -library $ARCHIVE/lib/iOS/libcurl.a \ @@ -341,19 +367,71 @@ else -library $ARCHIVE/lib/tvOS-simulator/libssl.a \ -library $ARCHIVE/lib/MacOS/libssl.a \ -output $ARCHIVE/xcframework/libssl.xcframework + # openssl/openssl-ios-armv7_armv7s_arm64_arm64e.a + # openssl/openssl-ios-i386_x86_64_arm64-simulator.a + cp openssl/*.a $ARCHIVE/framework +elif [ "$BUILDFOR" == "ios" ]; then + # Build XCFrameworks + xcodebuild -create-xcframework \ + -library $ARCHIVE/lib/iOS/libcurl.a \ + -headers curl/include \ + -library $ARCHIVE/lib/iOS-simulator/libcurl.a \ + -headers curl/include \ + -output $ARCHIVE/xcframework/libcurl.xcframework + xcodebuild -create-xcframework \ + -library $ARCHIVE/lib/iOS/libcrypto.a \ + -headers openssl/iOS/include \ + -library $ARCHIVE/lib/iOS-simulator/libcrypto.a \ + -headers openssl/iOS-simulator/include \ + -output $ARCHIVE/xcframework/libcrypto.xcframework + xcodebuild -create-xcframework \ + -library $ARCHIVE/lib/iOS/libssl.a \ + -library $ARCHIVE/lib/iOS-simulator/libssl.a \ + -output $ARCHIVE/xcframework/libssl.xcframework + # openssl/openssl-ios-armv7_armv7s_arm64_arm64e.a + # openssl/openssl-ios-i386_x86_64_arm64-simulator.a + cp openssl/*.a $ARCHIVE/framework +elif [ "$BUILDFOR" == "tvos" ]; then + # Build XCFrameworks + xcodebuild -create-xcframework \ + -library $ARCHIVE/lib/tvOS/libcurl.a \ + -headers curl/include \ + -library $ARCHIVE/lib/tvOS-simulator/libcurl.a \ + -headers curl/include \ + -output $ARCHIVE/xcframework/libcurl.xcframework + xcodebuild -create-xcframework \ + -library $ARCHIVE/lib/tvOS/libcrypto.a \ + -headers openssl/tvOS/include \ + -library $ARCHIVE/lib/tvOS-simulator/libcrypto.a \ + -headers openssl/tvOS-simulator/include \ + -output $ARCHIVE/xcframework/libcrypto.xcframework + xcodebuild -create-xcframework \ + -library $ARCHIVE/lib/tvOS/libssl.a \ + -library $ARCHIVE/lib/tvOS-simulator/libssl.a \ + -output $ARCHIVE/xcframework/libssl.xcframework +elif [ "$BUILDFOR" == "macos" ]; then + # Build XCFrameworks + xcodebuild -create-xcframework \ + -library $ARCHIVE/lib/MacOS/libcurl.a \ + -headers curl/include \ + -output $ARCHIVE/xcframework/libcurl.xcframework fi -cp openssl/*.a $ARCHIVE/framework - # libraries for nghttp2 if [ "$buildnghttp2" != "" ]; then - # nghttp2 libraries - cp nghttp2/lib/libnghttp2_iOS.a $ARCHIVE/lib/iOS/libnghttp2.a - cp nghttp2/lib/libnghttp2_iOS-simulator.a $ARCHIVE/lib/iOS-simulator/libnghttp2.a - cp nghttp2/lib/libnghttp2_iOS-fat.a $ARCHIVE/lib/iOS-fat/libnghttp2.a - cp nghttp2/lib/libnghttp2_tvOS.a $ARCHIVE/lib/tvOS/libnghttp2.a - cp nghttp2/lib/libnghttp2_tvOS-simulator.a $ARCHIVE/lib/tvOS-simulator/libnghttp2.a - cp nghttp2/lib/libnghttp2_Mac.a $ARCHIVE/lib/MacOS/libnghttp2.a + # nghttp2 libraries + if [ "$BUILDFOR" == "ios" ] || [ "$BUILDFOR" == "all" ]; then + cp nghttp2/lib/libnghttp2_iOS.a $ARCHIVE/lib/iOS/libnghttp2.a + cp nghttp2/lib/libnghttp2_iOS-simulator.a $ARCHIVE/lib/iOS-simulator/libnghttp2.a + cp nghttp2/lib/libnghttp2_iOS-fat.a $ARCHIVE/lib/iOS-fat/libnghttp2.a + fi + if [ "$BUILDFOR" == "tvos" ] || [ "$BUILDFOR" == "all" ]; then + cp nghttp2/lib/libnghttp2_tvOS.a $ARCHIVE/lib/tvOS/libnghttp2.a + cp nghttp2/lib/libnghttp2_tvOS-simulator.a $ARCHIVE/lib/tvOS-simulator/libnghttp2.a + fi + if [ "$BUILDFOR" == "macos" ] || [ "$BUILDFOR" == "all" ]; then + cp nghttp2/lib/libnghttp2_Mac.a $ARCHIVE/lib/MacOS/libnghttp2.a + fi if [ "$catalyst" != "" ]; then cp nghttp2/lib/libnghttp2_Catalyst.a $ARCHIVE/lib/Catalyst/libnghttp2.a xcodebuild -create-xcframework \ @@ -364,7 +442,21 @@ if [ "$buildnghttp2" != "" ]; then -library $ARCHIVE/lib/Catalyst/libnghttp2.a \ -library $ARCHIVE/lib/MacOS/libnghttp2.a \ -output $ARCHIVE/xcframework/libnghttp2.xcframework - else + elif [ "$BUILDFOR" == "macos" ]; then + xcodebuild -create-xcframework \ + -library $ARCHIVE/lib/MacOS/libnghttp2.a \ + -output $ARCHIVE/xcframework/libnghttp2.xcframework + elif [ "$BUILDFOR" == "ios" ]; then + xcodebuild -create-xcframework \ + -library $ARCHIVE/lib/iOS/libnghttp2.a \ + -library $ARCHIVE/lib/iOS-simulator/libnghttp2.a \ + -output $ARCHIVE/xcframework/libnghttp2.xcframework + elif [ "$BUILDFOR" == "tvos" ]; then + xcodebuild -create-xcframework \ + -library $ARCHIVE/lib/tvOS/libnghttp2.a \ + -library $ARCHIVE/lib/tvOS-simulator/libnghttp2.a \ + -output $ARCHIVE/xcframework/libnghttp2.xcframework + else # all xcodebuild -create-xcframework \ -library $ARCHIVE/lib/iOS/libnghttp2.a \ -library $ARCHIVE/lib/iOS-simulator/libnghttp2.a \ @@ -376,7 +468,13 @@ if [ "$buildnghttp2" != "" ]; then fi # archive header files -cp openssl/iOS/include/openssl/* "$ARCHIVE/include/openssl" +if [ "$BUILDFOR" == "ios" ] || [ "$BUILDFOR" == "all" ]; then + cp openssl/iOS/include/openssl/* "$ARCHIVE/include/openssl" +elif [ "$BUILDFOR" == "tvos" ]; then + cp openssl/tvOS/include/openssl/* "$ARCHIVE/include/openssl" +elif [ "$BUILDFOR" == "macos" ]; then + cp openssl/Mac/include/openssl/* "$ARCHIVE/include/openssl" +fi cp curl/include/curl/* "$ARCHIVE/include/curl" # grab root certs @@ -386,40 +484,54 @@ curl -sL https://curl.se/ca/cacert.pem > $ARCHIVE/cacert.pem sed -e "s/ZZZCMDS/$BUILD_CMD/g" -e "s/ZZZLIBCURL/$LIBCURL/g" -e "s/ZZZOPENSSL/$OPENSSL/g" -e "s/ZZZNGHTTP2/$NGHTTP2/g" archive/release-template.md > $ARCHIVE/README.md echo -# EXAMPLE App - update test app with latest includes and XCFrameworks -echo -e "${bold}Copying libraries to Test App ...${dim}" -echo " See $EXAMPLE" -mkdir -p "$EXAMPLE/libs" -mkdir -p "$EXAMPLE/include" -# Includes -cp openssl/iOS-fat/include/openssl/* "$EXAMPLE/include/openssl/" -cp curl/include/curl/* "$EXAMPLE/include/curl/" -cp $ARCHIVE/cacert.pem "$EXAMPLE/iOS Test App/cacert.pem" -# XCFrameworks -cp -R $ARCHIVE/xcframework/libcrypto.xcframework "$EXAMPLE/libs/" -cp -R $ARCHIVE/xcframework/libssl.xcframework "$EXAMPLE/libs/" -cp -R $ARCHIVE/xcframework/libcurl.xcframework "$EXAMPLE/libs/" -if [ "$buildnghttp2" != "" ]; then - #cp nghttp2/lib/libnghttp2_iOS-fat.a "$EXAMPLE/libs/libnghttp2.a" - cp -R $ARCHIVE/xcframework/libnghttp2.xcframework "$EXAMPLE/libs/" +# EXAMPLE iOS and tvOS App - update test app with latest includes and XCFrameworks +echo -e "${bold}Copying libraries to Test Apps ...${dim}" +if [[ "$BUILDFOR" == "all" ]]; then + EXAMPLES=("example/iOS Test App" "example/tvOS Test App" "example/macOS Test App") +elif [[ "$BUILDFOR" == "ios" ]]; then + EXAMPLES=("example/iOS Test App") +elif [[ "$BUILDFOR" == "tvos" ]]; then + EXAMPLES=("example/tvOS Test App") +elif [[ "$BUILDFOR" == "macos" ]]; then + EXAMPLES=("example/macOS Test App") fi - -echo -# create universal Mac binaries and run test -echo -e "${bold}Archiving Mac binaries for curl and openssl...${dim}" -echo " See $ARCHIVE/bin" -lipo -create -output $ARCHIVE/bin/curl /tmp/curl-x86_64 /tmp/curl-arm64 -mv /tmp/curl-* $ARCHIVE/bin -lipo -create -output $ARCHIVE/bin/openssl /tmp/openssl-x86_64 /tmp/openssl-arm64 -mv /tmp/openssl-* $ARCHIVE/bin +for EXAMPLE in "${EXAMPLES[@]}"; do + echo " Upating: $EXAMPLE" + # Create necessary directories + mkdir -p "$EXAMPLE/libs" "$EXAMPLE/include/curl" "$EXAMPLE/include/openssl" + # Copy includes + if [[ "$EXAMPLE" == *"macOS"* ]]; then + cp openssl/Mac/include/openssl/* "$EXAMPLE/include/openssl/" + elif [[ "$EXAMPLE" == *"iOS"* ]]; then + cp openssl/iOS/include/openssl/* "$EXAMPLE/include/openssl/" + elif [[ "$EXAMPLE" == *"tvOS"* ]]; then + cp openssl/tvOS/include/openssl/* "$EXAMPLE/include/openssl/" + fi + cp curl/include/curl/* "$EXAMPLE/include/curl/" + # Copy certificate bundle + cp $ARCHIVE/cacert.pem "$EXAMPLE/cacert.pem" + # Copy XCFrameworks + cp -R $ARCHIVE/xcframework/*.xcframework "$EXAMPLE/libs/" +done echo -echo -e "${bold}Testing Universal Mac binaries for ${BUILD_MACHINE}...${dim}" -echo -e " ${bold}cURL${dim}" -file $ARCHIVE/bin/curl -$ARCHIVE/bin/curl -V -echo -e " ${bold}OpenSSL${dim}" -file $ARCHIVE/bin/openssl -$ARCHIVE/bin/openssl version + +# Create universal Mac binaries and run test +if [ "$BUILDFOR" == "macos" ] || [ "$BUILDFOR" == "all" ]; then + echo -e "${bold}Archiving Mac binaries for curl and openssl...${dim}" + echo " See $ARCHIVE/bin" + lipo -create -output $ARCHIVE/bin/curl /tmp/curl-x86_64 /tmp/curl-arm64 + mv /tmp/curl-* $ARCHIVE/bin + lipo -create -output $ARCHIVE/bin/openssl /tmp/openssl-x86_64 /tmp/openssl-arm64 + mv /tmp/openssl-* $ARCHIVE/bin + echo + echo -e "${bold}Testing Universal Mac binaries for ${BUILD_MACHINE}...${dim}" + echo -e " ${bold}cURL${dim}" + file $ARCHIVE/bin/curl + $ARCHIVE/bin/curl -V + echo -e " ${bold}OpenSSL${dim}" + file $ARCHIVE/bin/openssl + $ARCHIVE/bin/openssl version +fi ## Done - Display Build Duration echo diff --git a/curl/libcurl-build.sh b/curl/libcurl-build.sh index e663267..1515947 100755 --- a/curl/libcurl-build.sh +++ b/curl/libcurl-build.sh @@ -31,7 +31,8 @@ alert="\033[0m${red}\033[1m" alertdim="\033[0m${red}\033[2m" # Set trap to help debug any build errors -trap 'echo -e "${alert}** ERROR with Build - Check /tmp/curl*.log${alertdim}"; tail -30 /tmp/curl*.log' INT TERM EXIT +trap 'echo -e "${alert}** ERROR with Build on line $LINENO ($0) - Check /tmp/curl*.log${alertdim}"; tail -30 /tmp/curl*.log' ERR TERM EXIT +trap 'exit 1' INT # Set defaults CURL_VERSION="curl-7.74.0" @@ -39,6 +40,7 @@ nohttp2="0" catalyst="0" FORCE_SSLV3="no" CONF_FLAGS="--without-libidn2 --disable-shared --enable-static -with-random=/dev/urandom --without-libpsl" +BUILDFOR="all" # Set minimum OS versions for target MACOS_X86_64_VERSION="" # Empty = use host version @@ -82,13 +84,14 @@ usage () echo " -m compile Mac Catalyst library [beta]" echo " -x disable color output" echo " -3 enable SSLv3 support" + echo " -p build only for specified platform (iOS, tvOS, macOS)" echo " -h show usage" echo trap - INT TERM EXIT exit 127 } -while getopts "v:s:t:i:a:u:nmb3xh\?" o; do +while getopts "v:s:t:i:a:u:p:nmb3xh\?" o; do case "${o}" in v) CURL_VERSION="curl-${OPTARG}" @@ -130,6 +133,15 @@ while getopts "v:s:t:i:a:u:nmb3xh\?" o; do 3) FORCE_SSLV3="yes" ;; + p) + BUILDFOR=$(echo "${OPTARG}" | tr '[:upper:]' '[:lower:]') + # Check for valid platform + if [ "$BUILDFOR" != "ios" ] && [ "$BUILDFOR" != "tvos" ] && [ "$BUILDFOR" != "macos" ]; then + echo -e "${alert}Invalid platform requested${normal}: $BUILDFOR" + echo "Please specify iOS, tvOS or macOS" + exit 127 + fi + ;; *) usage ;; @@ -558,67 +570,73 @@ if [ ${FORCE_SSLV3} == 'yes' ]; then fi fi -echo -e "${bold}Building Mac libraries${dim}" -buildMac "x86_64" -buildMac "arm64" +if ! [[ "${NOBITCODE}" == "yes" ]]; then + BITCODE="bitcode" +else + BITCODE="nobitcode" +fi -echo -e " ${dim}Copying headers" -cp /tmp/${CURL_VERSION}-x86_64/include/curl/* include/curl/ +if [ $BUILDFOR == "macos" ] || [ $BUILDFOR == "all" ]; then + echo -e "${bold}Building Mac libraries${dim}" + buildMac "x86_64" + buildMac "arm64" -lipo \ - "/tmp/${CURL_VERSION}-x86_64/lib/libcurl.a" \ - "/tmp/${CURL_VERSION}-arm64/lib/libcurl.a" \ - -create -output lib/libcurl_Mac.a + echo -e " ${dim}Copying headers" + cp /tmp/${CURL_VERSION}-x86_64/include/curl/* include/curl/ -if [ $catalyst == "1" ]; then -echo -e "${bold}Building Catalyst libraries${dim}" -buildCatalyst "x86_64" "bitcode" -buildCatalyst "arm64" "bitcode" + lipo \ + "/tmp/${CURL_VERSION}-x86_64/lib/libcurl.a" \ + "/tmp/${CURL_VERSION}-arm64/lib/libcurl.a" \ + -create -output lib/libcurl_Mac.a -lipo \ - "/tmp/${CURL_VERSION}-catalyst-x86_64-bitcode/lib/libcurl.a" \ - "/tmp/${CURL_VERSION}-catalyst-arm64-bitcode/lib/libcurl.a" \ - -create -output lib/libcurl_Catalyst.a -fi + if [ $catalyst == "1" ]; then + echo -e "${bold}Building Catalyst libraries${dim}" + buildCatalyst "x86_64" "bitcode" + buildCatalyst "arm64" "bitcode" -if ! [[ "${NOBITCODE}" == "yes" ]]; then - BITCODE="bitcode" -else - BITCODE="nobitcode" + lipo \ + "/tmp/${CURL_VERSION}-catalyst-x86_64-bitcode/lib/libcurl.a" \ + "/tmp/${CURL_VERSION}-catalyst-arm64-bitcode/lib/libcurl.a" \ + -create -output lib/libcurl_Catalyst.a + fi fi -echo -e "${bold}Building iOS libraries (${BITCODE})${dim}" -buildIOS "armv7" "${BITCODE}" -buildIOS "armv7s" "${BITCODE}" -buildIOS "arm64" "${BITCODE}" -buildIOS "arm64e" "${BITCODE}" - -lipo \ - "/tmp/${CURL_VERSION}-iOS-armv7-${BITCODE}/lib/libcurl.a" \ - "/tmp/${CURL_VERSION}-iOS-armv7s-${BITCODE}/lib/libcurl.a" \ - "/tmp/${CURL_VERSION}-iOS-arm64-${BITCODE}/lib/libcurl.a" \ - "/tmp/${CURL_VERSION}-iOS-arm64e-${BITCODE}/lib/libcurl.a" \ - -create -output lib/libcurl_iOS.a - -buildIOSsim "i386" "${BITCODE}" -buildIOSsim "x86_64" "${BITCODE}" -buildIOSsim "arm64" "${BITCODE}" - -lipo \ - "/tmp/${CURL_VERSION}-iOS-simulator-i386-${BITCODE}/lib/libcurl.a" \ - "/tmp/${CURL_VERSION}-iOS-simulator-x86_64-${BITCODE}/lib/libcurl.a" \ - "/tmp/${CURL_VERSION}-iOS-simulator-arm64-${BITCODE}/lib/libcurl.a" \ - -create -output lib/libcurl_iOS-simulator.a - -lipo \ - "/tmp/${CURL_VERSION}-iOS-armv7-${BITCODE}/lib/libcurl.a" \ - "/tmp/${CURL_VERSION}-iOS-armv7s-${BITCODE}/lib/libcurl.a" \ - "/tmp/${CURL_VERSION}-iOS-arm64-${BITCODE}/lib/libcurl.a" \ - "/tmp/${CURL_VERSION}-iOS-arm64e-${BITCODE}/lib/libcurl.a" \ - "/tmp/${CURL_VERSION}-iOS-simulator-i386-${BITCODE}/lib/libcurl.a" \ - "/tmp/${CURL_VERSION}-iOS-simulator-x86_64-${BITCODE}/lib/libcurl.a" \ - -create -output lib/libcurl_iOS-fat.a - +if [ $BUILDFOR == "ios" ] || [ $BUILDFOR == "all" ]; then + echo -e "${bold}Building iOS libraries (${BITCODE})${dim}" + buildIOS "armv7" "${BITCODE}" + buildIOS "armv7s" "${BITCODE}" + buildIOS "arm64" "${BITCODE}" + buildIOS "arm64e" "${BITCODE}" + + echo -e " ${dim}Copying headers" + cp /tmp/${CURL_VERSION}-iOS-armv7-${BITCODE}/include/curl/* include/curl/ + + lipo \ + "/tmp/${CURL_VERSION}-iOS-armv7-${BITCODE}/lib/libcurl.a" \ + "/tmp/${CURL_VERSION}-iOS-armv7s-${BITCODE}/lib/libcurl.a" \ + "/tmp/${CURL_VERSION}-iOS-arm64-${BITCODE}/lib/libcurl.a" \ + "/tmp/${CURL_VERSION}-iOS-arm64e-${BITCODE}/lib/libcurl.a" \ + -create -output lib/libcurl_iOS.a + + buildIOSsim "i386" "${BITCODE}" + buildIOSsim "x86_64" "${BITCODE}" + buildIOSsim "arm64" "${BITCODE}" + + lipo \ + "/tmp/${CURL_VERSION}-iOS-simulator-i386-${BITCODE}/lib/libcurl.a" \ + "/tmp/${CURL_VERSION}-iOS-simulator-x86_64-${BITCODE}/lib/libcurl.a" \ + "/tmp/${CURL_VERSION}-iOS-simulator-arm64-${BITCODE}/lib/libcurl.a" \ + -create -output lib/libcurl_iOS-simulator.a + + lipo \ + "/tmp/${CURL_VERSION}-iOS-armv7-${BITCODE}/lib/libcurl.a" \ + "/tmp/${CURL_VERSION}-iOS-armv7s-${BITCODE}/lib/libcurl.a" \ + "/tmp/${CURL_VERSION}-iOS-arm64-${BITCODE}/lib/libcurl.a" \ + "/tmp/${CURL_VERSION}-iOS-arm64e-${BITCODE}/lib/libcurl.a" \ + "/tmp/${CURL_VERSION}-iOS-simulator-i386-${BITCODE}/lib/libcurl.a" \ + "/tmp/${CURL_VERSION}-iOS-simulator-x86_64-${BITCODE}/lib/libcurl.a" \ + -create -output lib/libcurl_iOS-fat.a +fi # if [[ "${NOBITCODE}" == "yes" ]]; then # echo -e "${bold}Building iOS libraries (nobitcode)${dim}" @@ -639,25 +657,30 @@ lipo \ # -create -output lib/libcurl_iOS_nobitcode.a # fi -echo -e "${bold}Building tvOS libraries${dim}" -buildTVOS "arm64" "${BITCODE}" +if [ $BUILDFOR == "tvos" ] || [ $BUILDFOR == "all" ]; then + echo -e "${bold}Building tvOS libraries${dim}" + buildTVOS "arm64" "${BITCODE}" + + echo -e " ${dim}Copying headers" + cp /tmp/${CURL_VERSION}-tvOS-arm64/include/curl/* include/curl/ -lipo \ - "/tmp/${CURL_VERSION}-tvOS-arm64/lib/libcurl.a" \ - -create -output lib/libcurl_tvOS.a + lipo \ + "/tmp/${CURL_VERSION}-tvOS-arm64/lib/libcurl.a" \ + -create -output lib/libcurl_tvOS.a -buildTVOSsim "x86_64" "${BITCODE}" -buildTVOSsim "arm64" "${BITCODE}" + buildTVOSsim "x86_64" "${BITCODE}" + buildTVOSsim "arm64" "${BITCODE}" -lipo \ - "/tmp/${CURL_VERSION}-tvOS-arm64/lib/libcurl.a" \ - "/tmp/${CURL_VERSION}-tvOS-simulator-x86_64/lib/libcurl.a" \ - -create -output lib/libcurl_tvOS-fat.a + lipo \ + "/tmp/${CURL_VERSION}-tvOS-arm64/lib/libcurl.a" \ + "/tmp/${CURL_VERSION}-tvOS-simulator-x86_64/lib/libcurl.a" \ + -create -output lib/libcurl_tvOS-fat.a -lipo \ - "/tmp/${CURL_VERSION}-tvOS-simulator-x86_64/lib/libcurl.a" \ - "/tmp/${CURL_VERSION}-tvOS-simulator-arm64/lib/libcurl.a" \ - -create -output lib/libcurl_tvOS-simulator.a + lipo \ + "/tmp/${CURL_VERSION}-tvOS-simulator-x86_64/lib/libcurl.a" \ + "/tmp/${CURL_VERSION}-tvOS-simulator-arm64/lib/libcurl.a" \ + -create -output lib/libcurl_tvOS-simulator.a +fi echo -e "${bold}Cleaning up${dim}" rm -rf /tmp/${CURL_VERSION}-* diff --git a/example/iOS Test App/README.md b/example/iOS Test App/README.md index 051fa75..dc3e927 100644 --- a/example/iOS Test App/README.md +++ b/example/iOS Test App/README.md @@ -24,3 +24,12 @@ Mac Catalyst Build image image + + +## New Project Setup Details + +If you are setting up a new Xcode project, there are few things you will need to set up. These are all set up for you already in the xcodeproj file: + +* You will also need to add the xcframework files (libs) and header files (include). You will also need to add libz.tbd to the Xcode project ("General"). + Image + diff --git a/example/iOS Test App/iOS Test App.xcodeproj/project.pbxproj b/example/iOS Test App/iOS Test App.xcodeproj/project.pbxproj index 1c2fdb6..a09bcbf 100644 --- a/example/iOS Test App/iOS Test App.xcodeproj/project.pbxproj +++ b/example/iOS Test App/iOS Test App.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -336,6 +336,7 @@ "$(inherited)", "$(PROJECT_DIR)/include/**", ); + IDEPreferLogStreaming = YES; INFOPLIST_FILE = "iOS Test App/Info.plist"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -366,6 +367,7 @@ "$(inherited)", "$(PROJECT_DIR)/include/**", ); + IDEPreferLogStreaming = YES; INFOPLIST_FILE = "iOS Test App/Info.plist"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", diff --git a/example/iOS Test App/iOS Test App/ViewController.m b/example/iOS Test App/iOS Test App/ViewController.m index f6109c3..12e5e1c 100644 --- a/example/iOS Test App/iOS Test App/ViewController.m +++ b/example/iOS Test App/iOS Test App/ViewController.m @@ -197,7 +197,7 @@ - (IBAction)Get:(id)sender curl_easy_setopt(_curl, CURLOPT_WRITEFUNCTION, iOSCurlWriteCallback); // function to get write data to view curl_easy_setopt(_curl, CURLOPT_WRITEDATA, self); // prevent libcurl from writing the data to stdout curl_easy_setopt(_curl, CURLOPT_NOPROGRESS, 0L); - curl_easy_setopt(_curl, CURLOPT_PROGRESSFUNCTION, iOSCurlProgressCallback); + curl_easy_setopt(_curl, CURLOPT_XFERINFOFUNCTION, iOSCurlProgressCallback); curl_easy_setopt(_curl, CURLOPT_PROGRESSDATA, self); // libcurl will pass back dl data progress // Set some CURL options @@ -232,8 +232,8 @@ - (IBAction)Get:(id)sender char *redirect_url2 = NULL; curl_easy_getinfo(_curl, CURLINFO_RESPONSE_CODE, &http_code); curl_easy_getinfo(_curl, CURLINFO_TOTAL_TIME, &total_time); - curl_easy_getinfo(_curl, CURLINFO_SIZE_DOWNLOAD, &total_size); - curl_easy_getinfo(_curl, CURLINFO_SPEED_DOWNLOAD, &total_speed); // total + curl_easy_getinfo(_curl, CURLINFO_SIZE_DOWNLOAD_T, &total_size); + curl_easy_getinfo(_curl, CURLINFO_SPEED_DOWNLOAD_T, &total_speed); // total curl_easy_getinfo(_curl, CURLINFO_APPCONNECT_TIME, &timing_ssl); // ssl handshake time curl_easy_getinfo(_curl, CURLINFO_CONNECT_TIME, &timing_tcp); // tcp connect curl_easy_getinfo(_curl, CURLINFO_NAMELOOKUP_TIME, &timing_ns); // name server lookup diff --git a/example/macOS Test App b/example/macOS Test App new file mode 160000 index 0000000..f621ff7 --- /dev/null +++ b/example/macOS Test App @@ -0,0 +1 @@ +Subproject commit f621ff72fc3ecbc316b9b0d5357f424c12d12b70 diff --git a/example/tvOS Test App/README.md b/example/tvOS Test App/README.md new file mode 100644 index 0000000..de182f8 --- /dev/null +++ b/example/tvOS Test App/README.md @@ -0,0 +1,31 @@ +# tvOS Test App + +This is a test app for tvOS using the curl, openssl and nghttp2 libraries. + +## Screenshots + +tvOS Test Build + +![Image](https://github.com/user-attachments/assets/fd0b1e2b-6f2c-4295-853a-574dc8533461) + +## Build Instructions + +Build the libraries with tvOS support: + +```bash +# Standard Build +./build.sh + +# Option: Build only tvOS +./build.sh -p tvos +``` + +Load and build the project using Xcode. Example lib binaries (xcframework) and header files are included but will be replaced when you run the build script. + +## New Project Setup Details + +If you are setting up a new Xcode project, there are few things you will need to set up. These are all set up for you already in the xcodeproj file: + +* You will also need to add the xcframework files (libs) and header files (include). You will also need to add libz.tbd to the Xcode project ("General"). + Image + diff --git a/example/tvOS Test App/tvOS Test App.xcodeproj/project.pbxproj b/example/tvOS Test App/tvOS Test App.xcodeproj/project.pbxproj new file mode 100644 index 0000000..736112b --- /dev/null +++ b/example/tvOS Test App/tvOS Test App.xcodeproj/project.pbxproj @@ -0,0 +1,712 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 56; + objects = { + +/* Begin PBXBuildFile section */ + 96F21F942D3E14FE00642B03 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 96F21F932D3E14FE00642B03 /* AppDelegate.m */; }; + 96F21F972D3E14FE00642B03 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 96F21F962D3E14FE00642B03 /* ViewController.m */; }; + 96F21F9A2D3E14FE00642B03 /* Base in Resources */ = {isa = PBXBuildFile; fileRef = 96F21F992D3E14FE00642B03 /* Base */; }; + 96F21F9C2D3E14FF00642B03 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96F21F9B2D3E14FF00642B03 /* Assets.xcassets */; }; + 96F21F9F2D3E14FF00642B03 /* Base in Resources */ = {isa = PBXBuildFile; fileRef = 96F21F9E2D3E14FF00642B03 /* Base */; }; + 96F21FA12D3E14FF00642B03 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 96F21FA02D3E14FF00642B03 /* main.m */; }; + 96F21FAC2D3E1AE700642B03 /* libssl.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96F21FA82D3E1AE700642B03 /* libssl.xcframework */; }; + 96F21FAE2D3E1AE700642B03 /* libcurl.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96F21FA92D3E1AE700642B03 /* libcurl.xcframework */; }; + 96F21FB02D3E1AE700642B03 /* libnghttp2.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96F21FAA2D3E1AE700642B03 /* libnghttp2.xcframework */; }; + 96F21FB22D3E1AE700642B03 /* libcrypto.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96F21FAB2D3E1AE700642B03 /* libcrypto.xcframework */; }; + 96F2204D2D3E1E9B00642B03 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 96F2204C2D3E1E9200642B03 /* libz.tbd */; }; + 96F220502D3E25A900642B03 /* cacert.pem in Resources */ = {isa = PBXBuildFile; fileRef = 96F2204F2D3E25A900642B03 /* cacert.pem */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 96F21F8F2D3E14FE00642B03 /* tvOS Test App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "tvOS Test App.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 96F21F922D3E14FE00642B03 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 96F21F932D3E14FE00642B03 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 96F21F952D3E14FE00642B03 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 96F21F962D3E14FE00642B03 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 96F21F992D3E14FE00642B03 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 96F21F9B2D3E14FF00642B03 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 96F21F9E2D3E14FF00642B03 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 96F21FA02D3E14FF00642B03 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 96F21FA82D3E1AE700642B03 /* libssl.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libssl.xcframework; path = libs/libssl.xcframework; sourceTree = ""; }; + 96F21FA92D3E1AE700642B03 /* libcurl.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libcurl.xcframework; path = libs/libcurl.xcframework; sourceTree = ""; }; + 96F21FAA2D3E1AE700642B03 /* libnghttp2.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libnghttp2.xcframework; path = libs/libnghttp2.xcframework; sourceTree = ""; }; + 96F21FAB2D3E1AE700642B03 /* libcrypto.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libcrypto.xcframework; path = libs/libcrypto.xcframework; sourceTree = ""; }; + 96F21FB52D3E1B0600642B03 /* curl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = curl.h; sourceTree = ""; }; + 96F21FB62D3E1B0600642B03 /* curlver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = curlver.h; sourceTree = ""; }; + 96F21FB72D3E1B0600642B03 /* easy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = easy.h; sourceTree = ""; }; + 96F21FB82D3E1B0600642B03 /* header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = header.h; sourceTree = ""; }; + 96F21FB92D3E1B0600642B03 /* mprintf.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mprintf.h; sourceTree = ""; }; + 96F21FBA2D3E1B0600642B03 /* multi.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = multi.h; sourceTree = ""; }; + 96F21FBB2D3E1B0600642B03 /* options.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = options.h; sourceTree = ""; }; + 96F21FBC2D3E1B0600642B03 /* stdcheaders.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = stdcheaders.h; sourceTree = ""; }; + 96F21FBD2D3E1B0600642B03 /* system.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = system.h; sourceTree = ""; }; + 96F21FBE2D3E1B0600642B03 /* typecheck-gcc.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "typecheck-gcc.h"; sourceTree = ""; }; + 96F21FBF2D3E1B0600642B03 /* urlapi.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = urlapi.h; sourceTree = ""; }; + 96F21FC02D3E1B0600642B03 /* websockets.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = websockets.h; sourceTree = ""; }; + 96F21FC22D3E1B0600642B03 /* aes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = aes.h; sourceTree = ""; }; + 96F21FC32D3E1B0600642B03 /* asn1_mac.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = asn1_mac.h; sourceTree = ""; }; + 96F21FC42D3E1B0600642B03 /* asn1.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = asn1.h; sourceTree = ""; }; + 96F21FC52D3E1B0600642B03 /* asn1err.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = asn1err.h; sourceTree = ""; }; + 96F21FC62D3E1B0600642B03 /* asn1t.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = asn1t.h; sourceTree = ""; }; + 96F21FC72D3E1B0600642B03 /* async.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = async.h; sourceTree = ""; }; + 96F21FC82D3E1B0600642B03 /* asyncerr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = asyncerr.h; sourceTree = ""; }; + 96F21FC92D3E1B0600642B03 /* bio.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = bio.h; sourceTree = ""; }; + 96F21FCA2D3E1B0600642B03 /* bioerr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = bioerr.h; sourceTree = ""; }; + 96F21FCB2D3E1B0600642B03 /* blowfish.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = blowfish.h; sourceTree = ""; }; + 96F21FCC2D3E1B0600642B03 /* bn.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = bn.h; sourceTree = ""; }; + 96F21FCD2D3E1B0600642B03 /* bnerr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = bnerr.h; sourceTree = ""; }; + 96F21FCE2D3E1B0600642B03 /* buffer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = buffer.h; sourceTree = ""; }; + 96F21FCF2D3E1B0600642B03 /* buffererr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = buffererr.h; sourceTree = ""; }; + 96F21FD02D3E1B0600642B03 /* camellia.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = camellia.h; sourceTree = ""; }; + 96F21FD12D3E1B0600642B03 /* cast.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cast.h; sourceTree = ""; }; + 96F21FD22D3E1B0600642B03 /* cmac.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cmac.h; sourceTree = ""; }; + 96F21FD32D3E1B0600642B03 /* cmp_util.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cmp_util.h; sourceTree = ""; }; + 96F21FD42D3E1B0600642B03 /* cmp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cmp.h; sourceTree = ""; }; + 96F21FD52D3E1B0600642B03 /* cmperr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cmperr.h; sourceTree = ""; }; + 96F21FD62D3E1B0600642B03 /* cms.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cms.h; sourceTree = ""; }; + 96F21FD72D3E1B0600642B03 /* cmserr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cmserr.h; sourceTree = ""; }; + 96F21FD82D3E1B0600642B03 /* comp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = comp.h; sourceTree = ""; }; + 96F21FD92D3E1B0600642B03 /* comperr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = comperr.h; sourceTree = ""; }; + 96F21FDA2D3E1B0600642B03 /* conf_api.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = conf_api.h; sourceTree = ""; }; + 96F21FDB2D3E1B0600642B03 /* conf.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = conf.h; sourceTree = ""; }; + 96F21FDC2D3E1B0600642B03 /* conferr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = conferr.h; sourceTree = ""; }; + 96F21FDD2D3E1B0600642B03 /* configuration.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = configuration.h; sourceTree = ""; }; + 96F21FDE2D3E1B0600642B03 /* conftypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = conftypes.h; sourceTree = ""; }; + 96F21FDF2D3E1B0600642B03 /* core_dispatch.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = core_dispatch.h; sourceTree = ""; }; + 96F21FE02D3E1B0600642B03 /* core_names.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = core_names.h; sourceTree = ""; }; + 96F21FE12D3E1B0600642B03 /* core_object.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = core_object.h; sourceTree = ""; }; + 96F21FE22D3E1B0600642B03 /* core.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = core.h; sourceTree = ""; }; + 96F21FE32D3E1B0600642B03 /* crmf.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = crmf.h; sourceTree = ""; }; + 96F21FE42D3E1B0600642B03 /* crmferr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = crmferr.h; sourceTree = ""; }; + 96F21FE52D3E1B0600642B03 /* crypto.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = crypto.h; sourceTree = ""; }; + 96F21FE62D3E1B0600642B03 /* cryptoerr_legacy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cryptoerr_legacy.h; sourceTree = ""; }; + 96F21FE72D3E1B0600642B03 /* cryptoerr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cryptoerr.h; sourceTree = ""; }; + 96F21FE82D3E1B0600642B03 /* ct.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ct.h; sourceTree = ""; }; + 96F21FE92D3E1B0600642B03 /* cterr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cterr.h; sourceTree = ""; }; + 96F21FEA2D3E1B0600642B03 /* decoder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = decoder.h; sourceTree = ""; }; + 96F21FEB2D3E1B0600642B03 /* decodererr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = decodererr.h; sourceTree = ""; }; + 96F21FEC2D3E1B0600642B03 /* des.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = des.h; sourceTree = ""; }; + 96F21FED2D3E1B0600642B03 /* dh.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = dh.h; sourceTree = ""; }; + 96F21FEE2D3E1B0600642B03 /* dherr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = dherr.h; sourceTree = ""; }; + 96F21FEF2D3E1B0600642B03 /* dsa.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = dsa.h; sourceTree = ""; }; + 96F21FF02D3E1B0600642B03 /* dsaerr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = dsaerr.h; sourceTree = ""; }; + 96F21FF12D3E1B0600642B03 /* dtls1.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = dtls1.h; sourceTree = ""; }; + 96F21FF22D3E1B0600642B03 /* e_os2.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = e_os2.h; sourceTree = ""; }; + 96F21FF32D3E1B0600642B03 /* ebcdic.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ebcdic.h; sourceTree = ""; }; + 96F21FF42D3E1B0600642B03 /* ec.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ec.h; sourceTree = ""; }; + 96F21FF52D3E1B0600642B03 /* ecdh.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ecdh.h; sourceTree = ""; }; + 96F21FF62D3E1B0600642B03 /* ecdsa.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ecdsa.h; sourceTree = ""; }; + 96F21FF72D3E1B0600642B03 /* ecerr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ecerr.h; sourceTree = ""; }; + 96F21FF82D3E1B0600642B03 /* encoder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = encoder.h; sourceTree = ""; }; + 96F21FF92D3E1B0600642B03 /* encodererr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = encodererr.h; sourceTree = ""; }; + 96F21FFA2D3E1B0600642B03 /* engine.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = engine.h; sourceTree = ""; }; + 96F21FFB2D3E1B0600642B03 /* engineerr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = engineerr.h; sourceTree = ""; }; + 96F21FFC2D3E1B0600642B03 /* err.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = err.h; sourceTree = ""; }; + 96F21FFD2D3E1B0600642B03 /* ess.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ess.h; sourceTree = ""; }; + 96F21FFE2D3E1B0600642B03 /* esserr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = esserr.h; sourceTree = ""; }; + 96F21FFF2D3E1B0600642B03 /* evp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = evp.h; sourceTree = ""; }; + 96F220002D3E1B0600642B03 /* evperr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = evperr.h; sourceTree = ""; }; + 96F220012D3E1B0600642B03 /* fips_names.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = fips_names.h; sourceTree = ""; }; + 96F220022D3E1B0600642B03 /* fipskey.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = fipskey.h; sourceTree = ""; }; + 96F220032D3E1B0600642B03 /* hmac.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = hmac.h; sourceTree = ""; }; + 96F220042D3E1B0600642B03 /* http.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = http.h; sourceTree = ""; }; + 96F220052D3E1B0600642B03 /* httperr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = httperr.h; sourceTree = ""; }; + 96F220062D3E1B0600642B03 /* idea.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = idea.h; sourceTree = ""; }; + 96F220072D3E1B0600642B03 /* kdf.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = kdf.h; sourceTree = ""; }; + 96F220082D3E1B0600642B03 /* kdferr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = kdferr.h; sourceTree = ""; }; + 96F220092D3E1B0600642B03 /* lhash.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = lhash.h; sourceTree = ""; }; + 96F2200A2D3E1B0600642B03 /* macros.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = macros.h; sourceTree = ""; }; + 96F2200B2D3E1B0600642B03 /* md2.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = md2.h; sourceTree = ""; }; + 96F2200C2D3E1B0600642B03 /* md4.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = md4.h; sourceTree = ""; }; + 96F2200D2D3E1B0600642B03 /* md5.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = md5.h; sourceTree = ""; }; + 96F2200E2D3E1B0600642B03 /* mdc2.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mdc2.h; sourceTree = ""; }; + 96F2200F2D3E1B0600642B03 /* modes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = modes.h; sourceTree = ""; }; + 96F220102D3E1B0600642B03 /* obj_mac.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = obj_mac.h; sourceTree = ""; }; + 96F220112D3E1B0600642B03 /* objects.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = objects.h; sourceTree = ""; }; + 96F220122D3E1B0600642B03 /* objectserr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = objectserr.h; sourceTree = ""; }; + 96F220132D3E1B0600642B03 /* ocsp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ocsp.h; sourceTree = ""; }; + 96F220142D3E1B0600642B03 /* ocsperr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ocsperr.h; sourceTree = ""; }; + 96F220152D3E1B0600642B03 /* opensslconf.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = opensslconf.h; sourceTree = ""; }; + 96F220162D3E1B0600642B03 /* opensslv.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = opensslv.h; sourceTree = ""; }; + 96F220172D3E1B0600642B03 /* ossl_typ.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ossl_typ.h; sourceTree = ""; }; + 96F220182D3E1B0600642B03 /* param_build.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = param_build.h; sourceTree = ""; }; + 96F220192D3E1B0600642B03 /* params.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = params.h; sourceTree = ""; }; + 96F2201A2D3E1B0600642B03 /* pem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = pem.h; sourceTree = ""; }; + 96F2201B2D3E1B0600642B03 /* pem2.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = pem2.h; sourceTree = ""; }; + 96F2201C2D3E1B0600642B03 /* pemerr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = pemerr.h; sourceTree = ""; }; + 96F2201D2D3E1B0600642B03 /* pkcs7.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = pkcs7.h; sourceTree = ""; }; + 96F2201E2D3E1B0600642B03 /* pkcs7err.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = pkcs7err.h; sourceTree = ""; }; + 96F2201F2D3E1B0600642B03 /* pkcs12.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = pkcs12.h; sourceTree = ""; }; + 96F220202D3E1B0600642B03 /* pkcs12err.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = pkcs12err.h; sourceTree = ""; }; + 96F220212D3E1B0600642B03 /* prov_ssl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = prov_ssl.h; sourceTree = ""; }; + 96F220222D3E1B0600642B03 /* proverr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = proverr.h; sourceTree = ""; }; + 96F220232D3E1B0600642B03 /* provider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = provider.h; sourceTree = ""; }; + 96F220242D3E1B0600642B03 /* rand.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = rand.h; sourceTree = ""; }; + 96F220252D3E1B0600642B03 /* randerr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = randerr.h; sourceTree = ""; }; + 96F220262D3E1B0600642B03 /* rc2.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = rc2.h; sourceTree = ""; }; + 96F220272D3E1B0600642B03 /* rc4.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = rc4.h; sourceTree = ""; }; + 96F220282D3E1B0600642B03 /* rc5.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = rc5.h; sourceTree = ""; }; + 96F220292D3E1B0600642B03 /* ripemd.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ripemd.h; sourceTree = ""; }; + 96F2202A2D3E1B0600642B03 /* rsa.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = rsa.h; sourceTree = ""; }; + 96F2202B2D3E1B0600642B03 /* rsaerr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = rsaerr.h; sourceTree = ""; }; + 96F2202C2D3E1B0600642B03 /* safestack.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = safestack.h; sourceTree = ""; }; + 96F2202D2D3E1B0600642B03 /* seed.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = seed.h; sourceTree = ""; }; + 96F2202E2D3E1B0600642B03 /* self_test.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = self_test.h; sourceTree = ""; }; + 96F2202F2D3E1B0600642B03 /* sha.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = sha.h; sourceTree = ""; }; + 96F220302D3E1B0600642B03 /* srp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = srp.h; sourceTree = ""; }; + 96F220312D3E1B0600642B03 /* srtp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = srtp.h; sourceTree = ""; }; + 96F220322D3E1B0600642B03 /* ssl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ssl.h; sourceTree = ""; }; + 96F220332D3E1B0600642B03 /* ssl2.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ssl2.h; sourceTree = ""; }; + 96F220342D3E1B0600642B03 /* ssl3.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ssl3.h; sourceTree = ""; }; + 96F220352D3E1B0600642B03 /* sslerr_legacy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = sslerr_legacy.h; sourceTree = ""; }; + 96F220362D3E1B0600642B03 /* sslerr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = sslerr.h; sourceTree = ""; }; + 96F220372D3E1B0600642B03 /* stack.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = stack.h; sourceTree = ""; }; + 96F220382D3E1B0600642B03 /* store.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = store.h; sourceTree = ""; }; + 96F220392D3E1B0600642B03 /* storeerr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = storeerr.h; sourceTree = ""; }; + 96F2203A2D3E1B0600642B03 /* symhacks.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = symhacks.h; sourceTree = ""; }; + 96F2203B2D3E1B0600642B03 /* tls1.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = tls1.h; sourceTree = ""; }; + 96F2203C2D3E1B0600642B03 /* trace.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = trace.h; sourceTree = ""; }; + 96F2203D2D3E1B0600642B03 /* ts.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ts.h; sourceTree = ""; }; + 96F2203E2D3E1B0600642B03 /* tserr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = tserr.h; sourceTree = ""; }; + 96F2203F2D3E1B0600642B03 /* txt_db.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = txt_db.h; sourceTree = ""; }; + 96F220402D3E1B0600642B03 /* types.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = types.h; sourceTree = ""; }; + 96F220412D3E1B0600642B03 /* ui.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ui.h; sourceTree = ""; }; + 96F220422D3E1B0600642B03 /* uierr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = uierr.h; sourceTree = ""; }; + 96F220432D3E1B0600642B03 /* whrlpool.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = whrlpool.h; sourceTree = ""; }; + 96F220442D3E1B0600642B03 /* x509_vfy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = x509_vfy.h; sourceTree = ""; }; + 96F220452D3E1B0600642B03 /* x509.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = x509.h; sourceTree = ""; }; + 96F220462D3E1B0600642B03 /* x509err.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = x509err.h; sourceTree = ""; }; + 96F220472D3E1B0600642B03 /* x509v3.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = x509v3.h; sourceTree = ""; }; + 96F220482D3E1B0600642B03 /* x509v3err.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = x509v3err.h; sourceTree = ""; }; + 96F2204C2D3E1E9200642B03 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; + 96F2204F2D3E25A900642B03 /* cacert.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cacert.pem; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 96F21F8C2D3E14FE00642B03 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 96F21FB22D3E1AE700642B03 /* libcrypto.xcframework in Frameworks */, + 96F21FAC2D3E1AE700642B03 /* libssl.xcframework in Frameworks */, + 96F21FAE2D3E1AE700642B03 /* libcurl.xcframework in Frameworks */, + 96F21FB02D3E1AE700642B03 /* libnghttp2.xcframework in Frameworks */, + 96F2204D2D3E1E9B00642B03 /* libz.tbd in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 96F21F862D3E14FE00642B03 = { + isa = PBXGroup; + children = ( + 96F21F912D3E14FE00642B03 /* tvOS Test App */, + 96F21F902D3E14FE00642B03 /* Products */, + 96F21FA72D3E1AE700642B03 /* Frameworks */, + ); + sourceTree = ""; + }; + 96F21F902D3E14FE00642B03 /* Products */ = { + isa = PBXGroup; + children = ( + 96F21F8F2D3E14FE00642B03 /* tvOS Test App.app */, + ); + name = Products; + sourceTree = ""; + }; + 96F21F912D3E14FE00642B03 /* tvOS Test App */ = { + isa = PBXGroup; + children = ( + 96F21F922D3E14FE00642B03 /* AppDelegate.h */, + 96F21F932D3E14FE00642B03 /* AppDelegate.m */, + 96F21F952D3E14FE00642B03 /* ViewController.h */, + 96F21F962D3E14FE00642B03 /* ViewController.m */, + 96F21F982D3E14FE00642B03 /* Main.storyboard */, + 96F21F9B2D3E14FF00642B03 /* Assets.xcassets */, + 96F21F9D2D3E14FF00642B03 /* LaunchScreen.storyboard */, + 96F21FA02D3E14FF00642B03 /* main.m */, + 96F2204F2D3E25A900642B03 /* cacert.pem */, + ); + path = "tvOS Test App"; + sourceTree = ""; + }; + 96F21FA72D3E1AE700642B03 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 96F2204C2D3E1E9200642B03 /* libz.tbd */, + 96F2204A2D3E1B0600642B03 /* include */, + 96F21FAB2D3E1AE700642B03 /* libcrypto.xcframework */, + 96F21FA92D3E1AE700642B03 /* libcurl.xcframework */, + 96F21FAA2D3E1AE700642B03 /* libnghttp2.xcframework */, + 96F21FA82D3E1AE700642B03 /* libssl.xcframework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 96F21FC12D3E1B0600642B03 /* curl */ = { + isa = PBXGroup; + children = ( + 96F21FB52D3E1B0600642B03 /* curl.h */, + 96F21FB62D3E1B0600642B03 /* curlver.h */, + 96F21FB72D3E1B0600642B03 /* easy.h */, + 96F21FB82D3E1B0600642B03 /* header.h */, + 96F21FB92D3E1B0600642B03 /* mprintf.h */, + 96F21FBA2D3E1B0600642B03 /* multi.h */, + 96F21FBB2D3E1B0600642B03 /* options.h */, + 96F21FBC2D3E1B0600642B03 /* stdcheaders.h */, + 96F21FBD2D3E1B0600642B03 /* system.h */, + 96F21FBE2D3E1B0600642B03 /* typecheck-gcc.h */, + 96F21FBF2D3E1B0600642B03 /* urlapi.h */, + 96F21FC02D3E1B0600642B03 /* websockets.h */, + ); + path = curl; + sourceTree = ""; + }; + 96F220492D3E1B0600642B03 /* openssl */ = { + isa = PBXGroup; + children = ( + 96F21FC22D3E1B0600642B03 /* aes.h */, + 96F21FC32D3E1B0600642B03 /* asn1_mac.h */, + 96F21FC42D3E1B0600642B03 /* asn1.h */, + 96F21FC52D3E1B0600642B03 /* asn1err.h */, + 96F21FC62D3E1B0600642B03 /* asn1t.h */, + 96F21FC72D3E1B0600642B03 /* async.h */, + 96F21FC82D3E1B0600642B03 /* asyncerr.h */, + 96F21FC92D3E1B0600642B03 /* bio.h */, + 96F21FCA2D3E1B0600642B03 /* bioerr.h */, + 96F21FCB2D3E1B0600642B03 /* blowfish.h */, + 96F21FCC2D3E1B0600642B03 /* bn.h */, + 96F21FCD2D3E1B0600642B03 /* bnerr.h */, + 96F21FCE2D3E1B0600642B03 /* buffer.h */, + 96F21FCF2D3E1B0600642B03 /* buffererr.h */, + 96F21FD02D3E1B0600642B03 /* camellia.h */, + 96F21FD12D3E1B0600642B03 /* cast.h */, + 96F21FD22D3E1B0600642B03 /* cmac.h */, + 96F21FD32D3E1B0600642B03 /* cmp_util.h */, + 96F21FD42D3E1B0600642B03 /* cmp.h */, + 96F21FD52D3E1B0600642B03 /* cmperr.h */, + 96F21FD62D3E1B0600642B03 /* cms.h */, + 96F21FD72D3E1B0600642B03 /* cmserr.h */, + 96F21FD82D3E1B0600642B03 /* comp.h */, + 96F21FD92D3E1B0600642B03 /* comperr.h */, + 96F21FDA2D3E1B0600642B03 /* conf_api.h */, + 96F21FDB2D3E1B0600642B03 /* conf.h */, + 96F21FDC2D3E1B0600642B03 /* conferr.h */, + 96F21FDD2D3E1B0600642B03 /* configuration.h */, + 96F21FDE2D3E1B0600642B03 /* conftypes.h */, + 96F21FDF2D3E1B0600642B03 /* core_dispatch.h */, + 96F21FE02D3E1B0600642B03 /* core_names.h */, + 96F21FE12D3E1B0600642B03 /* core_object.h */, + 96F21FE22D3E1B0600642B03 /* core.h */, + 96F21FE32D3E1B0600642B03 /* crmf.h */, + 96F21FE42D3E1B0600642B03 /* crmferr.h */, + 96F21FE52D3E1B0600642B03 /* crypto.h */, + 96F21FE62D3E1B0600642B03 /* cryptoerr_legacy.h */, + 96F21FE72D3E1B0600642B03 /* cryptoerr.h */, + 96F21FE82D3E1B0600642B03 /* ct.h */, + 96F21FE92D3E1B0600642B03 /* cterr.h */, + 96F21FEA2D3E1B0600642B03 /* decoder.h */, + 96F21FEB2D3E1B0600642B03 /* decodererr.h */, + 96F21FEC2D3E1B0600642B03 /* des.h */, + 96F21FED2D3E1B0600642B03 /* dh.h */, + 96F21FEE2D3E1B0600642B03 /* dherr.h */, + 96F21FEF2D3E1B0600642B03 /* dsa.h */, + 96F21FF02D3E1B0600642B03 /* dsaerr.h */, + 96F21FF12D3E1B0600642B03 /* dtls1.h */, + 96F21FF22D3E1B0600642B03 /* e_os2.h */, + 96F21FF32D3E1B0600642B03 /* ebcdic.h */, + 96F21FF42D3E1B0600642B03 /* ec.h */, + 96F21FF52D3E1B0600642B03 /* ecdh.h */, + 96F21FF62D3E1B0600642B03 /* ecdsa.h */, + 96F21FF72D3E1B0600642B03 /* ecerr.h */, + 96F21FF82D3E1B0600642B03 /* encoder.h */, + 96F21FF92D3E1B0600642B03 /* encodererr.h */, + 96F21FFA2D3E1B0600642B03 /* engine.h */, + 96F21FFB2D3E1B0600642B03 /* engineerr.h */, + 96F21FFC2D3E1B0600642B03 /* err.h */, + 96F21FFD2D3E1B0600642B03 /* ess.h */, + 96F21FFE2D3E1B0600642B03 /* esserr.h */, + 96F21FFF2D3E1B0600642B03 /* evp.h */, + 96F220002D3E1B0600642B03 /* evperr.h */, + 96F220012D3E1B0600642B03 /* fips_names.h */, + 96F220022D3E1B0600642B03 /* fipskey.h */, + 96F220032D3E1B0600642B03 /* hmac.h */, + 96F220042D3E1B0600642B03 /* http.h */, + 96F220052D3E1B0600642B03 /* httperr.h */, + 96F220062D3E1B0600642B03 /* idea.h */, + 96F220072D3E1B0600642B03 /* kdf.h */, + 96F220082D3E1B0600642B03 /* kdferr.h */, + 96F220092D3E1B0600642B03 /* lhash.h */, + 96F2200A2D3E1B0600642B03 /* macros.h */, + 96F2200B2D3E1B0600642B03 /* md2.h */, + 96F2200C2D3E1B0600642B03 /* md4.h */, + 96F2200D2D3E1B0600642B03 /* md5.h */, + 96F2200E2D3E1B0600642B03 /* mdc2.h */, + 96F2200F2D3E1B0600642B03 /* modes.h */, + 96F220102D3E1B0600642B03 /* obj_mac.h */, + 96F220112D3E1B0600642B03 /* objects.h */, + 96F220122D3E1B0600642B03 /* objectserr.h */, + 96F220132D3E1B0600642B03 /* ocsp.h */, + 96F220142D3E1B0600642B03 /* ocsperr.h */, + 96F220152D3E1B0600642B03 /* opensslconf.h */, + 96F220162D3E1B0600642B03 /* opensslv.h */, + 96F220172D3E1B0600642B03 /* ossl_typ.h */, + 96F220182D3E1B0600642B03 /* param_build.h */, + 96F220192D3E1B0600642B03 /* params.h */, + 96F2201A2D3E1B0600642B03 /* pem.h */, + 96F2201B2D3E1B0600642B03 /* pem2.h */, + 96F2201C2D3E1B0600642B03 /* pemerr.h */, + 96F2201D2D3E1B0600642B03 /* pkcs7.h */, + 96F2201E2D3E1B0600642B03 /* pkcs7err.h */, + 96F2201F2D3E1B0600642B03 /* pkcs12.h */, + 96F220202D3E1B0600642B03 /* pkcs12err.h */, + 96F220212D3E1B0600642B03 /* prov_ssl.h */, + 96F220222D3E1B0600642B03 /* proverr.h */, + 96F220232D3E1B0600642B03 /* provider.h */, + 96F220242D3E1B0600642B03 /* rand.h */, + 96F220252D3E1B0600642B03 /* randerr.h */, + 96F220262D3E1B0600642B03 /* rc2.h */, + 96F220272D3E1B0600642B03 /* rc4.h */, + 96F220282D3E1B0600642B03 /* rc5.h */, + 96F220292D3E1B0600642B03 /* ripemd.h */, + 96F2202A2D3E1B0600642B03 /* rsa.h */, + 96F2202B2D3E1B0600642B03 /* rsaerr.h */, + 96F2202C2D3E1B0600642B03 /* safestack.h */, + 96F2202D2D3E1B0600642B03 /* seed.h */, + 96F2202E2D3E1B0600642B03 /* self_test.h */, + 96F2202F2D3E1B0600642B03 /* sha.h */, + 96F220302D3E1B0600642B03 /* srp.h */, + 96F220312D3E1B0600642B03 /* srtp.h */, + 96F220322D3E1B0600642B03 /* ssl.h */, + 96F220332D3E1B0600642B03 /* ssl2.h */, + 96F220342D3E1B0600642B03 /* ssl3.h */, + 96F220352D3E1B0600642B03 /* sslerr_legacy.h */, + 96F220362D3E1B0600642B03 /* sslerr.h */, + 96F220372D3E1B0600642B03 /* stack.h */, + 96F220382D3E1B0600642B03 /* store.h */, + 96F220392D3E1B0600642B03 /* storeerr.h */, + 96F2203A2D3E1B0600642B03 /* symhacks.h */, + 96F2203B2D3E1B0600642B03 /* tls1.h */, + 96F2203C2D3E1B0600642B03 /* trace.h */, + 96F2203D2D3E1B0600642B03 /* ts.h */, + 96F2203E2D3E1B0600642B03 /* tserr.h */, + 96F2203F2D3E1B0600642B03 /* txt_db.h */, + 96F220402D3E1B0600642B03 /* types.h */, + 96F220412D3E1B0600642B03 /* ui.h */, + 96F220422D3E1B0600642B03 /* uierr.h */, + 96F220432D3E1B0600642B03 /* whrlpool.h */, + 96F220442D3E1B0600642B03 /* x509_vfy.h */, + 96F220452D3E1B0600642B03 /* x509.h */, + 96F220462D3E1B0600642B03 /* x509err.h */, + 96F220472D3E1B0600642B03 /* x509v3.h */, + 96F220482D3E1B0600642B03 /* x509v3err.h */, + ); + path = openssl; + sourceTree = ""; + }; + 96F2204A2D3E1B0600642B03 /* include */ = { + isa = PBXGroup; + children = ( + 96F21FC12D3E1B0600642B03 /* curl */, + 96F220492D3E1B0600642B03 /* openssl */, + ); + path = include; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 96F21F8E2D3E14FE00642B03 /* tvOS Test App */ = { + isa = PBXNativeTarget; + buildConfigurationList = 96F21FA42D3E14FF00642B03 /* Build configuration list for PBXNativeTarget "tvOS Test App" */; + buildPhases = ( + 96F21F8B2D3E14FE00642B03 /* Sources */, + 96F21F8C2D3E14FE00642B03 /* Frameworks */, + 96F21F8D2D3E14FE00642B03 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "tvOS Test App"; + productName = "tvOS Test App"; + productReference = 96F21F8F2D3E14FE00642B03 /* tvOS Test App.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 96F21F872D3E14FE00642B03 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastUpgradeCheck = 1540; + TargetAttributes = { + 96F21F8E2D3E14FE00642B03 = { + CreatedOnToolsVersion = 15.4; + }; + }; + }; + buildConfigurationList = 96F21F8A2D3E14FE00642B03 /* Build configuration list for PBXProject "tvOS Test App" */; + compatibilityVersion = "Xcode 14.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 96F21F862D3E14FE00642B03; + productRefGroup = 96F21F902D3E14FE00642B03 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 96F21F8E2D3E14FE00642B03 /* tvOS Test App */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 96F21F8D2D3E14FE00642B03 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 96F220502D3E25A900642B03 /* cacert.pem in Resources */, + 96F21F9C2D3E14FF00642B03 /* Assets.xcassets in Resources */, + 96F21F9F2D3E14FF00642B03 /* Base in Resources */, + 96F21F9A2D3E14FE00642B03 /* Base in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 96F21F8B2D3E14FE00642B03 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 96F21F972D3E14FE00642B03 /* ViewController.m in Sources */, + 96F21FA12D3E14FF00642B03 /* main.m in Sources */, + 96F21F942D3E14FE00642B03 /* AppDelegate.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 96F21F982D3E14FE00642B03 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 96F21F992D3E14FE00642B03 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 96F21F9D2D3E14FF00642B03 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 96F21F9E2D3E14FF00642B03 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 96F21FA22D3E14FF00642B03 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = appletvos; + TVOS_DEPLOYMENT_TARGET = 17.5; + }; + name = Debug; + }; + 96F21FA32D3E14FF00642B03 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = appletvos; + TVOS_DEPLOYMENT_TARGET = 17.5; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 96F21FA52D3E14FF00642B03 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 3VBZPX2GZ9; + GENERATE_INFOPLIST_FILE = YES; + IDEPreferLogStreaming = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UIMainStoryboardFile = Main; + INFOPLIST_KEY_UIUserInterfaceStyle = Automatic; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "com.jasonacox.tvOS-Test-App"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 12.0; + }; + name = Debug; + }; + 96F21FA62D3E14FF00642B03 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 3VBZPX2GZ9; + GENERATE_INFOPLIST_FILE = YES; + IDEPreferLogStreaming = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UIMainStoryboardFile = Main; + INFOPLIST_KEY_UIUserInterfaceStyle = Automatic; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "com.jasonacox.tvOS-Test-App"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 12.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 96F21F8A2D3E14FE00642B03 /* Build configuration list for PBXProject "tvOS Test App" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 96F21FA22D3E14FF00642B03 /* Debug */, + 96F21FA32D3E14FF00642B03 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 96F21FA42D3E14FF00642B03 /* Build configuration list for PBXNativeTarget "tvOS Test App" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 96F21FA52D3E14FF00642B03 /* Debug */, + 96F21FA62D3E14FF00642B03 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 96F21F872D3E14FE00642B03 /* Project object */; +} diff --git a/example/tvOS Test App/tvOS Test App.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/example/tvOS Test App/tvOS Test App.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/example/tvOS Test App/tvOS Test App.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/example/tvOS Test App/tvOS Test App.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/example/tvOS Test App/tvOS Test App.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/example/tvOS Test App/tvOS Test App.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/example/tvOS Test App/tvOS Test App/AppDelegate.h b/example/tvOS Test App/tvOS Test App/AppDelegate.h new file mode 100644 index 0000000..2f04bdc --- /dev/null +++ b/example/tvOS Test App/tvOS Test App/AppDelegate.h @@ -0,0 +1,18 @@ +// +// AppDelegate.h +// tvOS Test App +// +// Created by Jason Cox on 1/19/25. +// + +#import +#import +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + + +@end + diff --git a/example/tvOS Test App/tvOS Test App/AppDelegate.m b/example/tvOS Test App/tvOS Test App/AppDelegate.m new file mode 100644 index 0000000..f5b8027 --- /dev/null +++ b/example/tvOS Test App/tvOS Test App/AppDelegate.m @@ -0,0 +1,54 @@ +// +// AppDelegate.m +// tvOS Test App +// +// Created by Jason Cox on 1/19/25. +// + +#import "AppDelegate.h" +#import "opensslv.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. + + // libcurl - see http://curl.haxx.se/libcurl/ + curl_global_init(0L); + + return YES; +} + + +- (void)applicationWillResignActive:(UIApplication *)application { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. +} + + +- (void)applicationDidEnterBackground:(UIApplication *)application { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. +} + + +- (void)applicationWillEnterForeground:(UIApplication *)application { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. +} + + +- (void)applicationDidBecomeActive:(UIApplication *)application { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. +} + +- (void)applicationWillTerminate:(UIApplication *)application { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + // libcurl cleanup + curl_global_cleanup(); +} + +@end diff --git a/example/tvOS Test App/tvOS Test App/Assets.xcassets/AccentColor.colorset/Contents.json b/example/tvOS Test App/tvOS Test App/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/example/tvOS Test App/tvOS Test App/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Contents.json b/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 0000000..2e00335 --- /dev/null +++ b/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,11 @@ +{ + "images" : [ + { + "idiom" : "tv" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Contents.json b/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Contents.json b/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Contents.json new file mode 100644 index 0000000..de59d88 --- /dev/null +++ b/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Contents.json @@ -0,0 +1,17 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + }, + "layers" : [ + { + "filename" : "Front.imagestacklayer" + }, + { + "filename" : "Middle.imagestacklayer" + }, + { + "filename" : "Back.imagestacklayer" + } + ] +} diff --git a/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Contents.json b/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 0000000..2e00335 --- /dev/null +++ b/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,11 @@ +{ + "images" : [ + { + "idiom" : "tv" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Contents.json b/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json b/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 0000000..2e00335 --- /dev/null +++ b/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,11 @@ +{ + "images" : [ + { + "idiom" : "tv" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Contents.json b/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json b/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 0000000..795cce1 --- /dev/null +++ b/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,16 @@ +{ + "images" : [ + { + "idiom" : "tv", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Contents.json b/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Contents.json b/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Contents.json new file mode 100644 index 0000000..de59d88 --- /dev/null +++ b/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Contents.json @@ -0,0 +1,17 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + }, + "layers" : [ + { + "filename" : "Front.imagestacklayer" + }, + { + "filename" : "Middle.imagestacklayer" + }, + { + "filename" : "Back.imagestacklayer" + } + ] +} diff --git a/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json b/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 0000000..795cce1 --- /dev/null +++ b/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,16 @@ +{ + "images" : [ + { + "idiom" : "tv", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Contents.json b/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json b/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 0000000..795cce1 --- /dev/null +++ b/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,16 @@ +{ + "images" : [ + { + "idiom" : "tv", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Contents.json b/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json b/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json new file mode 100644 index 0000000..f47ba43 --- /dev/null +++ b/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json @@ -0,0 +1,32 @@ +{ + "assets" : [ + { + "filename" : "App Icon - App Store.imagestack", + "idiom" : "tv", + "role" : "primary-app-icon", + "size" : "1280x768" + }, + { + "filename" : "App Icon.imagestack", + "idiom" : "tv", + "role" : "primary-app-icon", + "size" : "400x240" + }, + { + "filename" : "Top Shelf Image Wide.imageset", + "idiom" : "tv", + "role" : "top-shelf-image-wide", + "size" : "2320x720" + }, + { + "filename" : "Top Shelf Image.imageset", + "idiom" : "tv", + "role" : "top-shelf-image", + "size" : "1920x720" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json b/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json new file mode 100644 index 0000000..795cce1 --- /dev/null +++ b/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json @@ -0,0 +1,16 @@ +{ + "images" : [ + { + "idiom" : "tv", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json b/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json new file mode 100644 index 0000000..795cce1 --- /dev/null +++ b/example/tvOS Test App/tvOS Test App/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json @@ -0,0 +1,16 @@ +{ + "images" : [ + { + "idiom" : "tv", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/example/tvOS Test App/tvOS Test App/Assets.xcassets/Contents.json b/example/tvOS Test App/tvOS Test App/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/example/tvOS Test App/tvOS Test App/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/example/tvOS Test App/tvOS Test App/Base.lproj/LaunchScreen.storyboard b/example/tvOS Test App/tvOS Test App/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..660ba53 --- /dev/null +++ b/example/tvOS Test App/tvOS Test App/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/example/tvOS Test App/tvOS Test App/Base.lproj/Main.storyboard b/example/tvOS Test App/tvOS Test App/Base.lproj/Main.storyboard new file mode 100644 index 0000000..c913952 --- /dev/null +++ b/example/tvOS Test App/tvOS Test App/Base.lproj/Main.storyboard @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/example/tvOS Test App/tvOS Test App/ViewController.h b/example/tvOS Test App/tvOS Test App/ViewController.h new file mode 100644 index 0000000..e88fc4f --- /dev/null +++ b/example/tvOS Test App/tvOS Test App/ViewController.h @@ -0,0 +1,36 @@ +// +// ViewController.h +// tvOS Test App +// +// Created by Jason Cox on 1/19/25. +// + +#import +#import +#import + +@interface ViewController : UIViewController +{ + IBOutlet UITextField *_urlText; // user field for URL address + IBOutlet UITextView *_resultText; // user field for resulting cURL data + IBOutlet UIButton *_getButton; // user button to start GET + IBOutlet UILabel *_appTitle; // application title to update for version + + // CURL global data + CURL *_curl; // curl handle + NSData *_dataToSend; + size_t _dataToSendBookmark; + NSMutableData *_dataReceived; + NSString *cacertPath; // path to cacert.pem file +} + +@property (retain, nonatomic) UITextField *_urlText; +@property (retain, nonatomic) UITextView *_resultText; +@property (retain, nonatomic) UIButton *_getButton; +@property (retain, nonatomic) UILabel *_appTitle; + +- (IBAction)Get: (id)sender; // action method to run GET + +@end + + diff --git a/example/tvOS Test App/tvOS Test App/ViewController.m b/example/tvOS Test App/tvOS Test App/ViewController.m new file mode 100644 index 0000000..db76738 --- /dev/null +++ b/example/tvOS Test App/tvOS Test App/ViewController.m @@ -0,0 +1,260 @@ +// +// ViewController.m +// tvOS Test App +// +// Created by Jason Cox on 1/19/25. +// + +#import "ViewController.h" + +// Create private interface +@interface ViewController (Private) +- (size_t)copyUpToThisManyBytes:(size_t)bytes intoThisPointer:(void *)pointer; +- (void)displayText:(NSString *)text; +- (void)receivedData:(NSData *)data; +@end + + +// Function called by libcurl to deliver info/debug and payload data +int tvOSCurlDebugCallback(CURL *curl, curl_infotype infotype, char *info, size_t infoLen, void *contextInfo) { + ViewController *vc = (__bridge ViewController *)contextInfo; + NSData *infoData = [NSData dataWithBytes:info length:infoLen]; + NSString *infoStr = [[NSString alloc] initWithData:infoData encoding:NSUTF8StringEncoding]; + if (infoStr) { + infoStr = [infoStr stringByReplacingOccurrencesOfString:@"\r\n" withString:@"\n"]; // convert CR/LF to LF + infoStr = [infoStr stringByReplacingOccurrencesOfString:@"\r" withString:@"\n"]; // convert CR to LF + switch (infotype) { + case CURLINFO_DATA_IN: + [vc displayText:infoStr]; + break; + case CURLINFO_DATA_OUT: + [vc displayText:[infoStr stringByAppendingString:@"\n"]]; + break; + case CURLINFO_HEADER_IN: + [vc displayText:[@"" stringByAppendingString:infoStr]]; + break; + case CURLINFO_HEADER_OUT: + infoStr = [infoStr stringByReplacingOccurrencesOfString:@"\n" withString:@"\n>> "]; + [vc displayText:[NSString stringWithFormat:@">> %@\n", infoStr]]; + break; + case CURLINFO_TEXT: + [vc displayText:[@"-- " stringByAppendingString:infoStr]]; + break; + default: // ignore the other CURLINFOs + break; + } + } + return 0; +} + +// Function called by libcurl to get data for uploads to web server +size_t tvOSCurlReadCallback(void *ptr, size_t size, size_t nmemb, void *userdata) { + const size_t sizeInBytes = size*nmemb; + ViewController *vc = (__bridge ViewController *)userdata; + + return [vc copyUpToThisManyBytes:sizeInBytes intoThisPointer:ptr]; +} + +// Function called by libcurl to deliver packets from web response +size_t tvOSCurlWriteCallback(char *ptr, size_t size, size_t nmemb, void *userdata) { + const size_t sizeInBytes = size*nmemb; + ViewController *vc = (__bridge ViewController *)userdata; + NSData *data = [[NSData alloc] initWithBytes:ptr length:sizeInBytes]; + + [vc receivedData:data]; // send to viewcontroller + return sizeInBytes; +} + +// Function called by libcurl to update progress +int tvOSCurlProgressCallback(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow) { + // Placeholder - add progress bar? + // NSLog(@"tvOSCurlProgressCallback %f of %f", dlnow, dltotal); + return 0; +} + +// +// Private methods to display data +// + +@implementation ViewController (Private) + +- (size_t)copyUpToThisManyBytes:(size_t)bytes intoThisPointer:(void *)pointer +{ + size_t bytesToGo = _dataToSend.length-_dataToSendBookmark; + size_t bytesToGet = MIN(bytes, bytesToGo); + + if (bytesToGo) { + [_dataToSend getBytes:pointer range:NSMakeRange(_dataToSendBookmark, bytesToGet)]; + _dataToSendBookmark += bytesToGet; + return bytesToGet; + } + return 0U; +} + +// Transfer data from libcurl to view controller text box +- (void)displayText:(NSString *)text +{ + @autoreleasepool + { + _resultText.text = [_resultText.text stringByAppendingString:text]; + // allow run loop to run and do rendering while curl_easy_perform() hasn't returned yet + [[NSRunLoop mainRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; + } +} + +- (void)receivedData:(NSData *)data +{ + [_dataReceived appendData:data]; +} + +@end + +// +// Main Interface and Methods +// + +@interface ViewController () + +@end + +@implementation ViewController + +@synthesize _resultText; +@synthesize _urlText; +@synthesize _appTitle; +@synthesize _getButton; + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + // CURL Setup + if (self) { + // _dataReceived = [[NSMutableData alloc] init]; + _curl = curl_easy_init(); + } + + // Update Title + _appTitle.text = [@"tvOS cURL Test App v" stringByAppendingFormat:@"%@",[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]]; + + // Display version and library info in view + _resultText.text = [@"" stringByAppendingFormat:@"tvOS cURL Test App v%@\n@jasonacox/Build-OpenSSL-cURL\n\nUsing: %s\n\n\n\n",[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"], curl_version()]; + + // Set up display to allow user to scroll contents + _resultText.showsVerticalScrollIndicator = YES; + _resultText.panGestureRecognizer.allowedTouchTypes = @[@(UITouchTypeIndirect)]; + _resultText.selectable = YES; + _resultText.scrollEnabled = YES; + _resultText.userInteractionEnabled = YES; + +} + +// GET URL - display results interactively via textview +- (IBAction)Get:(id)sender +{ + _resultText.text = @""; // clear viewer + + // Give some render time to show response before we hit the network + [[NSRunLoop mainRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; + + // Verify URL + if (!_urlText.text || [_urlText.text isEqualToString:@""]) { + _urlText.text = @"http://www.apple.com"; // no address provided, fill in default + } + + if (_urlText.text && ![_urlText.text isEqualToString:@""]) { + CURLcode theResult; + NSURL *url = [NSURL URLWithString:_urlText.text]; + [_dataReceived setLength:0U]; + _dataToSendBookmark = 0U; + + // Set CURL callback functions + curl_easy_setopt(_curl, CURLOPT_DEBUGFUNCTION, tvOSCurlDebugCallback); // function to get debug data to view + curl_easy_setopt(_curl, CURLOPT_DEBUGDATA, self); + curl_easy_setopt(_curl, CURLOPT_WRITEFUNCTION, tvOSCurlWriteCallback); // function to get write data to view + curl_easy_setopt(_curl, CURLOPT_WRITEDATA, self); // prevent libcurl from writing the data to stdout + curl_easy_setopt(_curl, CURLOPT_NOPROGRESS, 0L); + curl_easy_setopt(_curl, CURLOPT_XFERINFOFUNCTION, tvOSCurlProgressCallback); + curl_easy_setopt(_curl, CURLOPT_PROGRESSDATA, self); // libcurl will pass back dl data progress + + // Set some CURL options + curl_easy_setopt(_curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); // user/pass may be in URL + curl_easy_setopt(_curl, CURLOPT_USERAGENT, curl_version()); // set a default user agent + curl_easy_setopt(_curl, CURLOPT_VERBOSE, 1L); // turn on verbose + curl_easy_setopt(_curl, CURLOPT_TIMEOUT, 60L); // seconds + curl_easy_setopt(_curl, CURLOPT_MAXCONNECTS, 0L); // this should disallow connection sharing + curl_easy_setopt(_curl, CURLOPT_FORBID_REUSE, 1L); // enforce connection to be closed + curl_easy_setopt(_curl, CURLOPT_DNS_CACHE_TIMEOUT, 0L); // Disable DNS cache + curl_easy_setopt(_curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0); // enable HTTP2 Protocol + curl_easy_setopt(_curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_DEFAULT); // Force TLSv1 protocol - Default + curl_easy_setopt(_curl, CURLOPT_SSL_CIPHER_LIST, [@"ALL" UTF8String]); + curl_easy_setopt(_curl, CURLOPT_SSL_VERIFYHOST, 0L); // 1L to verify, 0L to disable + curl_easy_setopt(_curl, CURLOPT_UPLOAD, 0L); + curl_easy_setopt(_curl, CURLOPT_HTTPHEADER, NULL); // no headers sent + curl_easy_setopt(_curl, CURLOPT_CUSTOMREQUEST,nil); + curl_easy_setopt(_curl, CURLOPT_HTTPGET, 1L); // use HTTP GET method + // CA root certs - loaded into project from libcurl http://curl.haxx.se/ca/cacert.pem + cacertPath = [[NSBundle mainBundle] pathForResource:@"cacert" ofType:@"pem"]; + curl_easy_setopt(_curl, CURLOPT_CAINFO, [cacertPath UTF8String]); // set root CA certs + + + // set URL + curl_easy_setopt(_curl, CURLOPT_URL, url.absoluteString.UTF8String); + + // PERFORM the Curl + theResult = curl_easy_perform(_curl); + if (theResult == CURLE_OK) { + long http_code, http_ver; + double total_time, total_size, total_speed, timing_ns, timing_tcp, timing_ssl, timing_fb; + char *redirect_url2 = NULL; + curl_easy_getinfo(_curl, CURLINFO_RESPONSE_CODE, &http_code); + curl_easy_getinfo(_curl, CURLINFO_TOTAL_TIME, &total_time); + curl_easy_getinfo(_curl, CURLINFO_SIZE_DOWNLOAD_T, &total_size); + curl_easy_getinfo(_curl, CURLINFO_SPEED_DOWNLOAD_T, &total_speed); // total + curl_easy_getinfo(_curl, CURLINFO_APPCONNECT_TIME, &timing_ssl); // ssl handshake time + curl_easy_getinfo(_curl, CURLINFO_CONNECT_TIME, &timing_tcp); // tcp connect + curl_easy_getinfo(_curl, CURLINFO_NAMELOOKUP_TIME, &timing_ns); // name server lookup + curl_easy_getinfo(_curl, CURLINFO_STARTTRANSFER_TIME, &timing_fb); // firstbyte + curl_easy_getinfo(_curl, CURLINFO_REDIRECT_URL, &redirect_url2); // redirect URL + curl_easy_getinfo(_curl, CURLINFO_HTTP_VERSION, &http_ver); // HTTP protocol + + NSString *http_ver_s, *http_h=@""; + if(http_ver == CURL_HTTP_VERSION_1_0) { + http_ver_s = @"HTTP/1.0"; + http_h = @"HTTP/1.0"; + } + if(http_ver == CURL_HTTP_VERSION_1_1) { + http_ver_s = @"HTTP/1.1"; + http_h = @"HTTP/1.1"; + } + if(http_ver == CURL_HTTP_VERSION_2_0) { + http_ver_s = @"HTTP/2"; + http_h = @"HTTP/2"; + } + + // timings + _resultText.text = [_resultText.text stringByAppendingFormat:@"\n** Timing Details **\n-- \tName Lookup:\t%0.2fs\n-- \tTCP Connect: \t%0.2fs\n-- \tSSL Handshake: \t%0.2fs\n-- \tFirst Byte: \t\t%0.2fs\n-- \tTotal Download: \t%0.2fs\n-- Size: %0.0f bytes\n-- Speed: %0.0f bytes/sec\n-- Using: %@\n** RESULT CODE: %ld**", + timing_ns,timing_tcp,timing_ssl,timing_fb, + total_time,total_size, total_speed, http_ver_s, http_code]; + + } + else { + _resultText.text = [_resultText.text stringByAppendingFormat:@"\n** TRANSFER INTERRUPTED - ERROR [%d]\n", theResult]; + + if (theResult == 6) { + _resultText.text = [_resultText.text stringByAppendingString:@"\n** Host Not Found - Check URL or Network\n"]; + + } + } + + } else { + NSLog(@"ERROR: Invalid _urlText passed."); + } +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git a/example/tvOS Test App/tvOS Test App/main.m b/example/tvOS Test App/tvOS Test App/main.m new file mode 100644 index 0000000..55f8c7a --- /dev/null +++ b/example/tvOS Test App/tvOS Test App/main.m @@ -0,0 +1,18 @@ +// +// main.m +// tvOS Test App +// +// Created by Jason Cox on 1/19/25. +// + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + NSString * appDelegateClassName; + @autoreleasepool { + // Setup code that might create autoreleased objects goes here. + appDelegateClassName = NSStringFromClass([AppDelegate class]); + } + return UIApplicationMain(argc, argv, nil, appDelegateClassName); +} diff --git a/nghttp2/nghttp2-build.sh b/nghttp2/nghttp2-build.sh index bd368c6..7f49a51 100755 --- a/nghttp2/nghttp2-build.sh +++ b/nghttp2/nghttp2-build.sh @@ -31,7 +31,8 @@ alert="\033[0m${red}\033[1m" alertdim="\033[0m${red}\033[2m" # set trap to help debug build errors -trap 'echo -e "${alert}** ERROR with Build - Check /tmp/nghttp2*.log${alertdim}"; tail -5 /tmp/nghttp2*.log' INT TERM EXIT +trap 'echo -e "${alert}** ERROR with Build on line $LINENO ($0) - Check /tmp/nghttp2*.log${alertdim}"; tail -5 /tmp/nghttp2*.log' ERR TERM EXIT +trap 'exit 1' INT # --- Edit this to update default version --- NGHTTP2_VERNUM="1.41.0" @@ -39,6 +40,7 @@ NGHTTP2_VERNUM="1.41.0" # Set defaults VERSION="1.1.1i" # OpenSSL version default catalyst="0" +BUILDFOR="all" # Set minimum OS versions for target MACOS_X86_64_VERSION="" # Empty = use host version @@ -75,13 +77,14 @@ usage () echo " -m compile Mac Catalyst library" echo " -u Mac Catalyst iOS min target version (default $CATALYST_IOS)" echo " -x disable color output" + echo " -p build only for specified platform (iOS, tvOS, macOS)" echo " -h show usage" echo trap - INT TERM EXIT exit 127 } -while getopts "v:s:t:i:a:u:mxh\?" o; do +while getopts "v:s:t:i:a:u:p:mxh\?" o; do case "${o}" in v) NGHTTP2_VERNUM="${OPTARG}" @@ -114,6 +117,15 @@ while getopts "v:s:t:i:a:u:mxh\?" o; do alertdim="" archbold="" ;; + p) + BUILDFOR=$(echo "${OPTARG}" | tr '[:upper:]' '[:lower:]') + # Check for valid platform + if [ "$BUILDFOR" != "ios" ] && [ "$BUILDFOR" != "tvos" ] && [ "$BUILDFOR" != "macos" ]; then + echo -e "${alert}Invalid platform requested${normal}: $BUILDFOR" + echo "Please specify iOS, tvOS or macOS" + exit 127 + fi + ;; *) usage ;; @@ -321,11 +333,11 @@ buildIOS() PLATFORM="iPhoneOS" fi - if [[ "${BITCODE}" == "nobitcode" ]]; then - CC_BITCODE_FLAG="" - else - CC_BITCODE_FLAG="-fembed-bitcode" - fi + if [[ "${BITCODE}" == "nobitcode" ]]; then + CC_BITCODE_FLAG="" + else + CC_BITCODE_FLAG="-fembed-bitcode" + fi export $PLATFORM export CROSS_TOP="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer" @@ -335,7 +347,7 @@ buildIOS() export CFLAGS="-arch ${ARCH} -pipe -Os -gdwarf-2 -isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} -miphoneos-version-min=${IOS_MIN_SDK_VERSION} ${CC_BITCODE_FLAG}" export LDFLAGS="-arch ${ARCH} -isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK}" - echo -e "${subbold}Building ${NGHTTP2_VERSION} for ${PLATFORM} ${IOS_SDK_VERSION} ${archbold}${ARCH}${dim} (iOS ${IOS_MIN_SDK_VERSION})" + echo -e "${subbold}Building ${NGHTTP2_VERSION} for ${PLATFORM} ${IOS_SDK_VERSION} ${archbold}${ARCH}${dim} (iOS ${IOS_MIN_SDK_VERSION}) ${BITCODE}" if [[ "${ARCH}" == "arm64" || "${ARCH}" == "arm64e" ]]; then ./configure --disable-shared --disable-app --disable-threads --enable-lib-only --prefix="${NGHTTP2}/iOS/${ARCH}" --host="arm-apple-darwin" &> "/tmp/${NGHTTP2_VERSION}-iOS-${ARCH}-${BITCODE}.log" else @@ -389,7 +401,7 @@ buildIOSsim() export CFLAGS="-arch ${ARCH} -pipe -Os -gdwarf-2 -isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} -miphoneos-version-min=${MIPHONEOS} ${CC_BITCODE_FLAG} ${RUNTARGET} " export LDFLAGS="-arch ${ARCH} -isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK}" - echo -e "${subbold}Building ${NGHTTP2_VERSION} for ${PLATFORM} ${IOS_SDK_VERSION} ${archbold}${ARCH}${dim} (iOS ${IOS_MIN_SDK_VERSION})" + echo -e "${subbold}Building ${NGHTTP2_VERSION} for ${PLATFORM} ${IOS_SDK_VERSION} ${archbold}${ARCH}${dim} (iOS ${IOS_MIN_SDK_VERSION}) ${BITCODE}" if [[ "${ARCH}" == "arm64" || "${ARCH}" == "arm64e" ]]; then ./configure --disable-shared --disable-app --disable-threads --enable-lib-only --prefix="${NGHTTP2}/iOS-simulator/${ARCH}" --host="arm-apple-darwin" &> "/tmp/${NGHTTP2_VERSION}-iOS-${ARCH}-${BITCODE}.log" else @@ -431,7 +443,7 @@ buildTVOS() export LDFLAGS="-arch ${ARCH} -isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} ${NGHTTP2LIB}" export LC_CTYPE=C - echo -e "${subbold}Building ${NGHTTP2_VERSION} for ${PLATFORM} ${TVOS_SDK_VERSION} ${archbold}${ARCH}${dim} (tvOS ${TVOS_MIN_SDK_VERSION})" + echo -e "${subbold}Building ${NGHTTP2_VERSION} for ${PLATFORM} ${TVOS_SDK_VERSION} ${archbold}${ARCH}${dim} (tvOS ${TVOS_MIN_SDK_VERSION}) ${BITCODE}" # Patch apps/speed.c to not use fork() since it's not available on tvOS # LANG=C sed -i -- 's/define HAVE_FORK 1/define HAVE_FORK 0/' "./apps/speed.c" @@ -479,7 +491,7 @@ buildTVOSsim() export LDFLAGS="-arch ${ARCH} -isysroot ${SYSROOT} ${NGHTTP2LIB}" export LC_CTYPE=C - echo -e "${subbold}Building ${NGHTTP2_VERSION} for ${PLATFORM} ${TVOS_SDK_VERSION} ${archbold}${ARCH}${dim} (tvOS Simulator ${TVOS_MIN_SDK_VERSION})" + echo -e "${subbold}Building ${NGHTTP2_VERSION} for ${PLATFORM} ${TVOS_SDK_VERSION} ${archbold}${ARCH}${dim} (tvOS Simulator ${TVOS_MIN_SDK_VERSION}) ${BITCODE}" # Patch apps/speed.c to not use fork() since it's not available on tvOS # LANG=C sed -i -- 's/define HAVE_FORK 1/define HAVE_FORK 0/' "./apps/speed.c" @@ -540,77 +552,86 @@ fi echo -e "${dim}Unpacking nghttp2" tar xfz "${NGHTTP2_VERSION}.tar.gz" -echo -e "${bold}Building Mac libraries${dim}" -buildMac "x86_64" -buildMac "arm64" +if [ "$BUILDFOR" == "macos" ] || [ "$BUILDFOR" == "all" ]; then + # MacOS + echo -e "${bold}Building Mac libraries${dim}" + buildMac "x86_64" + buildMac "arm64" + + lipo \ + "${NGHTTP2}/Mac/x86_64/lib/libnghttp2.a" \ + "${NGHTTP2}/Mac/arm64/lib/libnghttp2.a" \ + -create -output "${NGHTTP2}/lib/libnghttp2_Mac.a" + + if [ $catalyst == "1" ]; then + echo -e "${bold}Building Catalyst libraries${dim}" + buildCatalyst "x86_64" + buildCatalyst "arm64" + + lipo \ + "${NGHTTP2}/Catalyst/x86_64/lib/libnghttp2.a" \ + "${NGHTTP2}/Catalyst/arm64/lib/libnghttp2.a" \ + -create -output "${NGHTTP2}/lib/libnghttp2_Catalyst.a" + fi +fi -lipo \ - "${NGHTTP2}/Mac/x86_64/lib/libnghttp2.a" \ - "${NGHTTP2}/Mac/arm64/lib/libnghttp2.a" \ - -create -output "${NGHTTP2}/lib/libnghttp2_Mac.a" +if [ "$BUILDFOR" == "ios" ] || [ "$BUILDFOR" == "all" ]; then + # iOS + echo -e "${bold}Building iOS libraries (bitcode)${dim}" + buildIOS "armv7" "bitcode" + buildIOS "armv7s" "bitcode" + buildIOS "arm64" "bitcode" + buildIOS "arm64e" "bitcode" + + buildIOSsim "x86_64" "bitcode" + buildIOSsim "arm64" "bitcode" + buildIOSsim "i386" "bitcode" + + lipo \ + "${NGHTTP2}/iOS/armv7/lib/libnghttp2.a" \ + "${NGHTTP2}/iOS/armv7s/lib/libnghttp2.a" \ + "${NGHTTP2}/iOS-simulator/i386/lib/libnghttp2.a" \ + "${NGHTTP2}/iOS/arm64/lib/libnghttp2.a" \ + "${NGHTTP2}/iOS/arm64e/lib/libnghttp2.a" \ + "${NGHTTP2}/iOS-simulator/x86_64/lib/libnghttp2.a" \ + -create -output "${NGHTTP2}/lib/libnghttp2_iOS-fat.a" + + lipo \ + "${NGHTTP2}/iOS/armv7/lib/libnghttp2.a" \ + "${NGHTTP2}/iOS/armv7s/lib/libnghttp2.a" \ + "${NGHTTP2}/iOS/arm64/lib/libnghttp2.a" \ + "${NGHTTP2}/iOS/arm64e/lib/libnghttp2.a" \ + -create -output "${NGHTTP2}/lib/libnghttp2_iOS.a" + + lipo \ + "${NGHTTP2}/iOS-simulator/i386/lib/libnghttp2.a" \ + "${NGHTTP2}/iOS-simulator/x86_64/lib/libnghttp2.a" \ + "${NGHTTP2}/iOS-simulator/arm64/lib/libnghttp2.a" \ + -create -output "${NGHTTP2}/lib/libnghttp2_iOS-simulator.a" +fi -if [ $catalyst == "1" ]; then -echo -e "${bold}Building Catalyst libraries${dim}" -buildCatalyst "x86_64" -buildCatalyst "arm64" +if [ "$BUILDFOR" == "tvos" ] || [ "$BUILDFOR" == "all" ]; then + # tvOS + echo -e "${bold}Building tvOS libraries${dim}" + buildTVOS "arm64" -lipo \ - "${NGHTTP2}/Catalyst/x86_64/lib/libnghttp2.a" \ - "${NGHTTP2}/Catalyst/arm64/lib/libnghttp2.a" \ - -create -output "${NGHTTP2}/lib/libnghttp2_Catalyst.a" -fi + lipo \ + "${NGHTTP2}/tvOS/arm64/lib/libnghttp2.a" \ + -create -output "${NGHTTP2}/lib/libnghttp2_tvOS.a" -echo -e "${bold}Building iOS libraries (bitcode)${dim}" -buildIOS "armv7" "bitcode" -buildIOS "armv7s" "bitcode" -buildIOS "arm64" "bitcode" -buildIOS "arm64e" "bitcode" - -buildIOSsim "x86_64" "bitcode" -buildIOSsim "arm64" "bitcode" -buildIOSsim "i386" "bitcode" - -lipo \ - "${NGHTTP2}/iOS/armv7/lib/libnghttp2.a" \ - "${NGHTTP2}/iOS/armv7s/lib/libnghttp2.a" \ - "${NGHTTP2}/iOS-simulator/i386/lib/libnghttp2.a" \ - "${NGHTTP2}/iOS/arm64/lib/libnghttp2.a" \ - "${NGHTTP2}/iOS/arm64e/lib/libnghttp2.a" \ - "${NGHTTP2}/iOS-simulator/x86_64/lib/libnghttp2.a" \ - -create -output "${NGHTTP2}/lib/libnghttp2_iOS-fat.a" - -lipo \ - "${NGHTTP2}/iOS/armv7/lib/libnghttp2.a" \ - "${NGHTTP2}/iOS/armv7s/lib/libnghttp2.a" \ - "${NGHTTP2}/iOS/arm64/lib/libnghttp2.a" \ - "${NGHTTP2}/iOS/arm64e/lib/libnghttp2.a" \ - -create -output "${NGHTTP2}/lib/libnghttp2_iOS.a" - -lipo \ - "${NGHTTP2}/iOS-simulator/i386/lib/libnghttp2.a" \ - "${NGHTTP2}/iOS-simulator/x86_64/lib/libnghttp2.a" \ - "${NGHTTP2}/iOS-simulator/arm64/lib/libnghttp2.a" \ - -create -output "${NGHTTP2}/lib/libnghttp2_iOS-simulator.a" - -echo -e "${bold}Building tvOS libraries${dim}" -buildTVOS "arm64" - -lipo \ - "${NGHTTP2}/tvOS/arm64/lib/libnghttp2.a" \ - -create -output "${NGHTTP2}/lib/libnghttp2_tvOS.a" - -buildTVOSsim "x86_64" -buildTVOSsim "arm64" - -lipo \ - "${NGHTTP2}/tvOS/arm64/lib/libnghttp2.a" \ - "${NGHTTP2}/tvOS-simulator/x86_64/lib/libnghttp2.a" \ - -create -output "${NGHTTP2}/lib/libnghttp2_tvOS-fat.a" - -lipo \ - "${NGHTTP2}/tvOS-simulator/x86_64/lib/libnghttp2.a" \ - "${NGHTTP2}/tvOS-simulator/arm64/lib/libnghttp2.a" \ - -create -output "${NGHTTP2}/lib/libnghttp2_tvOS-simulator.a" + buildTVOSsim "x86_64" + buildTVOSsim "arm64" + + lipo \ + "${NGHTTP2}/tvOS/arm64/lib/libnghttp2.a" \ + "${NGHTTP2}/tvOS-simulator/x86_64/lib/libnghttp2.a" \ + -create -output "${NGHTTP2}/lib/libnghttp2_tvOS-fat.a" + + lipo \ + "${NGHTTP2}/tvOS-simulator/x86_64/lib/libnghttp2.a" \ + "${NGHTTP2}/tvOS-simulator/arm64/lib/libnghttp2.a" \ + -create -output "${NGHTTP2}/lib/libnghttp2_tvOS-simulator.a" +fi echo -e "${bold}Cleaning up${dim}" rm -rf /tmp/${NGHTTP2_VERSION}-* diff --git a/openssl/openssl-build-phase1.sh b/openssl/openssl-build-phase1.sh index eefac4c..cb594b9 100755 --- a/openssl/openssl-build-phase1.sh +++ b/openssl/openssl-build-phase1.sh @@ -27,11 +27,13 @@ alert="\033[0m${red}\033[1m" alertdim="\033[0m${red}\033[2m" # Set trap to help debug build errors -trap 'echo -e "${alert}** ERROR with Build - Check /tmp/openssl*.log${alertdim}"; tail -3 /tmp/openssl*.log' INT TERM EXIT +trap 'echo -e "${alert}** ERROR with Build on line $LINENO ($0) - Check /tmp/openssl*.log${alertdim}"; tail -3 /tmp/openssl*.log' ERR TERM EXIT +trap 'exit 1' INT # Set defaults -VERSION="3.0.9" # OpenSSL version default +VERSION="3.0.9" # OpenSSL version default catalyst="0" +BUILDFOR="all" # Default to build all platforms # Set minimum OS versions for target MACOS_X86_64_VERSION="" # Empty = use host version @@ -69,6 +71,7 @@ usage () echo " -u Mac Catalyst iOS min target version (default $CATALYST_IOS)" echo " -3 compile with SSLv3 support" echo " -x disable color output" + echo " -p build only for specified platform (iOS, tvOS, macOS)" echo " -h show usage" echo trap - INT TERM EXIT @@ -77,7 +80,7 @@ usage () engine=0 -while getopts "v:s:t:i:a:u:emx3h\?" o; do +while getopts "v:s:t:i:a:u:p:emx3h\?" o; do case "${o}" in v) OPENSSL_VERSION="openssl-${OPTARG}" @@ -116,6 +119,15 @@ while getopts "v:s:t:i:a:u:emx3h\?" o; do 3) CUSTOMCONFIG="enable-ssl3 enable-ssl3-method enable-ssl-trace" ;; + p) + BUILDFOR=$(echo "${OPTARG}" | tr '[:upper:]' '[:lower:]') + # Check for valid platform + if [ "$BUILDFOR" != "ios" ] && [ "$BUILDFOR" != "tvos" ] && [ "$BUILDFOR" != "macos" ]; then + echo -e "${alert}Invalid platform requested${normal}: $BUILDFOR" + echo "Please specify iOS, tvOS or macOS" + exit 127 + fi + ;; *) usage ;; @@ -172,7 +184,7 @@ buildMac() fi fi - echo -e "${subbold}Building ${OPENSSL_VERSION} for ${archbold}${ARCH}${dim} (MacOS ${MACOS_VER})" + echo -e "${subbold}Building ${OPENSSL_VERSION} for ${archbold}${ARCH}${dim} (MacOS ${MACOS_VER})}" pushd . > /dev/null cd "${OPENSSL_VERSION}" @@ -254,7 +266,7 @@ buildCatalyst() fi fi - echo -e "${subbold}Building ${OPENSSL_VERSION} for ${archbold}${ARCH}${dim} (MacOS ${MACOS_VER} Catalyst iOS ${CATALYST_IOS})" + echo -e "${subbold}Building ${OPENSSL_VERSION} for ${archbold}${ARCH}${dim} (MacOS ${MACOS_VER} Catalyst iOS ${CATALYST_IOS}) ${BITCODE}" if [[ "$OPENSSL_VERSION" = "openssl-1.0"* ]]; then ./Configure no-asm ${TARGET} -no-shared --openssldir="/tmp/${OPENSSL_VERSION}-catalyst-${ARCH}" $CUSTOMCONFIG &> "/tmp/${OPENSSL_VERSION}-catalyst-${ARCH}.log" @@ -485,22 +497,24 @@ if [ "$engine" == "1" ]; then fi ## Mac -echo -e "${bold}Building Mac libraries${dim}" -buildMac "x86_64" -buildMac "arm64" +if [ $BUILDFOR == "macos" ] || [ $BUILDFOR == "all" ]; then + echo -e "${bold}Building Mac libraries${dim}" + buildMac "x86_64" + buildMac "arm64" -echo -e " ${dim}Copying headers and libraries" -cp /tmp/${OPENSSL_VERSION}-x86_64/include/openssl/* Mac/include/openssl/ + echo -e " ${dim}Copying headers and libraries" + cp /tmp/${OPENSSL_VERSION}-x86_64/include/openssl/* Mac/include/openssl/ -lipo \ - "/tmp/${OPENSSL_VERSION}-x86_64/lib/libcrypto.a" \ - "/tmp/${OPENSSL_VERSION}-arm64/lib/libcrypto.a" \ - -create -output Mac/lib/libcrypto.a + lipo \ + "/tmp/${OPENSSL_VERSION}-x86_64/lib/libcrypto.a" \ + "/tmp/${OPENSSL_VERSION}-arm64/lib/libcrypto.a" \ + -create -output Mac/lib/libcrypto.a -lipo \ - "/tmp/${OPENSSL_VERSION}-x86_64/lib/libssl.a" \ - "/tmp/${OPENSSL_VERSION}-arm64/lib/libssl.a" \ - -create -output Mac/lib/libssl.a + lipo \ + "/tmp/${OPENSSL_VERSION}-x86_64/lib/libssl.a" \ + "/tmp/${OPENSSL_VERSION}-arm64/lib/libssl.a" \ + -create -output Mac/lib/libssl.a +fi ## Catalyst if [ $catalyst == "1" ]; then @@ -523,47 +537,49 @@ if [ $catalyst == "1" ]; then fi ## tvOS -echo -e "${bold}Building tvOS libraries${dim}" -buildTVOS "arm64" +if [ $BUILDFOR == "tvos" ] || [ $BUILDFOR == "all" ]; then + echo -e "${bold}Building tvOS libraries${dim}" + buildTVOS "arm64" -echo -e " ${dim}Copying headers and libraries" -cp /tmp/${OPENSSL_VERSION}-tvOS-arm64/include/openssl/* tvOS/include/openssl/ + echo -e " ${dim}Copying headers and libraries" + cp /tmp/${OPENSSL_VERSION}-tvOS-arm64/include/openssl/* tvOS/include/openssl/ -lipo \ - "/tmp/${OPENSSL_VERSION}-tvOS-arm64/lib/libcrypto.a" \ - -create -output tvOS/lib/libcrypto.a + lipo \ + "/tmp/${OPENSSL_VERSION}-tvOS-arm64/lib/libcrypto.a" \ + -create -output tvOS/lib/libcrypto.a -lipo \ - "/tmp/${OPENSSL_VERSION}-tvOS-arm64/lib/libssl.a" \ - -create -output tvOS/lib/libssl.a + lipo \ + "/tmp/${OPENSSL_VERSION}-tvOS-arm64/lib/libssl.a" \ + -create -output tvOS/lib/libssl.a -echo -e "${bold}Building tvOS simulator libraries${dim}" -buildTVOSsim "arm64" -buildTVOSsim "x86_64" + echo -e "${bold}Building tvOS simulator libraries${dim}" + buildTVOSsim "arm64" + buildTVOSsim "x86_64" -lipo \ - "/tmp/${OPENSSL_VERSION}-tvOS-arm64/lib/libcrypto.a" \ - "/tmp/${OPENSSL_VERSION}-tvOS-Simulator-x86_64/lib/libcrypto.a" \ - -create -output tvOS-fat/lib/libcrypto.a + lipo \ + "/tmp/${OPENSSL_VERSION}-tvOS-arm64/lib/libcrypto.a" \ + "/tmp/${OPENSSL_VERSION}-tvOS-Simulator-x86_64/lib/libcrypto.a" \ + -create -output tvOS-fat/lib/libcrypto.a -lipo \ - "/tmp/${OPENSSL_VERSION}-tvOS-arm64/lib/libssl.a" \ - "/tmp/${OPENSSL_VERSION}-tvOS-Simulator-x86_64/lib/libssl.a" \ - -create -output tvOS-fat/lib/libssl.a + lipo \ + "/tmp/${OPENSSL_VERSION}-tvOS-arm64/lib/libssl.a" \ + "/tmp/${OPENSSL_VERSION}-tvOS-Simulator-x86_64/lib/libssl.a" \ + -create -output tvOS-fat/lib/libssl.a -echo -e " ${dim}Copying headers and libraries" -cp /tmp/${OPENSSL_VERSION}-tvOS-Simulator-x86_64/include/openssl/* tvOS-simulator/include/openssl/ + echo -e " ${dim}Copying headers and libraries" + cp /tmp/${OPENSSL_VERSION}-tvOS-Simulator-x86_64/include/openssl/* tvOS-simulator/include/openssl/ -lipo \ - "/tmp/${OPENSSL_VERSION}-tvOS-Simulator-arm64/lib/libcrypto.a" \ - "/tmp/${OPENSSL_VERSION}-tvOS-Simulator-x86_64/lib/libcrypto.a" \ - -create -output tvOS-simulator/lib/libcrypto.a + lipo \ + "/tmp/${OPENSSL_VERSION}-tvOS-Simulator-arm64/lib/libcrypto.a" \ + "/tmp/${OPENSSL_VERSION}-tvOS-Simulator-x86_64/lib/libcrypto.a" \ + -create -output tvOS-simulator/lib/libcrypto.a -lipo \ - "/tmp/${OPENSSL_VERSION}-tvOS-Simulator-arm64/lib/libssl.a" \ - "/tmp/${OPENSSL_VERSION}-tvOS-Simulator-x86_64/lib/libssl.a" \ - -create -output tvOS-simulator/lib/libssl.a + lipo \ + "/tmp/${OPENSSL_VERSION}-tvOS-Simulator-arm64/lib/libssl.a" \ + "/tmp/${OPENSSL_VERSION}-tvOS-Simulator-x86_64/lib/libssl.a" \ + -create -output tvOS-simulator/lib/libssl.a +fi if [ $catalyst == "1" ]; then libtool -no_warning_for_no_symbols -static -o openssl-ios-x86_64-maccatalyst.a Catalyst/lib/libcrypto.a Catalyst/lib/libssl.a diff --git a/openssl/openssl-build-phase2.sh b/openssl/openssl-build-phase2.sh index c1933c1..f757c73 100755 --- a/openssl/openssl-build-phase2.sh +++ b/openssl/openssl-build-phase2.sh @@ -27,7 +27,8 @@ alert="\033[0m${red}\033[1m" alertdim="\033[0m${red}\033[2m" # set trap to help debug build errors -trap 'echo -e "${alert}** ERROR with Build - Check /tmp/openssl*.log${alertdim}"; tail -3 /tmp/openssl*.log' INT TERM EXIT +trap 'echo -e "${alert}** ERROR with Build on line $LINENO ($0) - Check /tmp/openssl*.log${alertdim}"; tail -3 /tmp/openssl*.log' ERR TERM EXIT +trap 'exit 1' INT # Set minimum OS versions for target MACOS_X86_64_VERSION="" # Empty = use host version @@ -39,6 +40,7 @@ TVOS_MIN_SDK_VERSION="9.0" TVOS_SDK_VERSION="" catalyst="0" VERSION="3.0.9" # OpenSSL version default +BUILDFOR="all" CORES=$(sysctl -n hw.ncpu) OPENSSL_VERSION="openssl-${VERSION}" @@ -67,6 +69,7 @@ usage () echo " -u Mac Catalyst iOS min target version (default $CATALYST_IOS)" echo " -3 compile with SSLv3 support" echo " -x disable color output" + echo " -p build only for specified platform (iOS, tvOS, macOS)" echo " -h show usage" echo trap - INT TERM EXIT @@ -75,7 +78,7 @@ usage () engine=0 -while getopts "v:s:t:i:a:u:emx3h\?" o; do +while getopts "v:s:t:i:a:u:p:emx3h\?" o; do case "${o}" in v) OPENSSL_VERSION="openssl-${OPTARG}" @@ -114,6 +117,15 @@ while getopts "v:s:t:i:a:u:emx3h\?" o; do 3) CUSTOMCONFIG="enable-ssl3 enable-ssl3-method enable-ssl-trace" ;; + p) + BUILDFOR=$(echo "${OPTARG}" | tr '[:upper:]' '[:lower:]') + # Check for valid platform + if [ "$BUILDFOR" != "ios" ] && [ "$BUILDFOR" != "tvos" ] && [ "$BUILDFOR" != "macos" ]; then + echo -e "${alert}Invalid platform requested${normal}: $BUILDFOR" + echo "Please specify iOS, tvOS or macOS" + exit 127 + fi + ;; *) usage ;; @@ -153,6 +165,7 @@ buildIOS() DSO_LDFLAGS="DSO_LDFLAGS=-fembed-bitcode" if [[ "$OPENSSL_VERSION" = "openssl-3"* ]]; then # disable bitcode for openssl 3 + BITCODE="nobitcode" export CC="${BUILD_TOOLS}/usr/bin/gcc -arch ${ARCH}" DSO_LDFLAGS="" if [[ "${ARCH}" == "armv7" || "${ARCH}" == "armv7s" ]]; then @@ -161,9 +174,10 @@ buildIOS() fi else export CC="${BUILD_TOOLS}/usr/bin/gcc -fembed-bitcode -arch ${ARCH}" + BITCODE="bitcode" fi - echo -e "${subbold}Building ${OPENSSL_VERSION} for ${PLATFORM} ${IOS_SDK_VERSION} ${archbold}${ARCH}${dim} (iOS ${IOS_MIN_SDK_VERSION})" + echo -e "${subbold}Building ${OPENSSL_VERSION} for ${PLATFORM} ${IOS_SDK_VERSION} ${archbold}${ARCH}${dim} (iOS ${IOS_MIN_SDK_VERSION}) ${BITCODE}" if [[ "$OPENSSL_VERSION" = "openssl-1.0"* ]]; then ./Configure iphoneos-cross -no-shared --openssldir="/tmp/${OPENSSL_VERSION}-iOS-${ARCH}" $CUSTOMCONFIG &> "/tmp/${OPENSSL_VERSION}-iOS-${ARCH}.log" @@ -320,72 +334,75 @@ if [ "$engine" == "1" ]; then sed -ie 's/\"engine/\"dynamic-engine/' ${OPENSSL_VERSION}/Configurations/15-ios.conf fi -echo -e "${bold}Building iOS libraries${dim}" - -buildIOS "armv7" -buildIOS "armv7s" -buildIOS "arm64" -buildIOS "arm64e" - -buildIOSsim "i386" -buildIOSsim "x86_64" -buildIOSsim "arm64" - -echo -e " ${dim}Copying headers and libraries" -cp /tmp/${OPENSSL_VERSION}-iOS-arm64/include/openssl/* iOS/include/openssl/ - -lipo \ - "/tmp/${OPENSSL_VERSION}-iOS-armv7/lib/libcrypto.a" \ - "/tmp/${OPENSSL_VERSION}-iOS-armv7s/lib/libcrypto.a" \ - "/tmp/${OPENSSL_VERSION}-iOS-arm64/lib/libcrypto.a" \ - "/tmp/${OPENSSL_VERSION}-iOS-arm64e/lib/libcrypto.a" \ - -create -output iOS/lib/libcrypto.a - -lipo \ - "/tmp/${OPENSSL_VERSION}-iOS-armv7/lib/libssl.a" \ - "/tmp/${OPENSSL_VERSION}-iOS-armv7s/lib/libssl.a" \ - "/tmp/${OPENSSL_VERSION}-iOS-arm64/lib/libssl.a" \ - "/tmp/${OPENSSL_VERSION}-iOS-arm64e/lib/libssl.a" \ - -create -output iOS/lib/libssl.a - - -cp /tmp/${OPENSSL_VERSION}-iOS-Simulator-x86_64/include/openssl/* iOS-simulator/include/openssl/ - -lipo \ - "/tmp/${OPENSSL_VERSION}-iOS-Simulator-i386/lib/libcrypto.a" \ - "/tmp/${OPENSSL_VERSION}-iOS-Simulator-x86_64/lib/libcrypto.a" \ - "/tmp/${OPENSSL_VERSION}-iOS-Simulator-arm64/lib/libcrypto.a" \ - -create -output iOS-simulator/lib/libcrypto.a - -lipo \ - "/tmp/${OPENSSL_VERSION}-iOS-Simulator-i386/lib/libssl.a" \ - "/tmp/${OPENSSL_VERSION}-iOS-Simulator-x86_64/lib/libssl.a" \ - "/tmp/${OPENSSL_VERSION}-iOS-Simulator-arm64/lib/libssl.a" \ - -create -output iOS-simulator/lib/libssl.a - -cp /tmp/${OPENSSL_VERSION}-iOS-arm64/include/openssl/* iOS-fat/include/openssl/ - -lipo \ - "/tmp/${OPENSSL_VERSION}-iOS-armv7/lib/libcrypto.a" \ - "/tmp/${OPENSSL_VERSION}-iOS-armv7s/lib/libcrypto.a" \ - "/tmp/${OPENSSL_VERSION}-iOS-arm64/lib/libcrypto.a" \ - "/tmp/${OPENSSL_VERSION}-iOS-arm64e/lib/libcrypto.a" \ - "/tmp/${OPENSSL_VERSION}-iOS-Simulator-i386/lib/libcrypto.a" \ - "/tmp/${OPENSSL_VERSION}-iOS-Simulator-x86_64/lib/libcrypto.a" \ - -create -output iOS-fat/lib/libcrypto.a - -lipo \ - "/tmp/${OPENSSL_VERSION}-iOS-armv7/lib/libssl.a" \ - "/tmp/${OPENSSL_VERSION}-iOS-armv7s/lib/libssl.a" \ - "/tmp/${OPENSSL_VERSION}-iOS-arm64/lib/libssl.a" \ - "/tmp/${OPENSSL_VERSION}-iOS-arm64e/lib/libssl.a" \ - "/tmp/${OPENSSL_VERSION}-iOS-Simulator-x86_64/lib/libssl.a" \ - "/tmp/${OPENSSL_VERSION}-iOS-Simulator-i386/lib/libssl.a" \ - -create -output iOS-fat/lib/libssl.a - -echo -e " ${dim}Creating combined OpenSSL libraries for iOS" -libtool -no_warning_for_no_symbols -static -o openssl-ios-armv7_armv7s_arm64_arm64e.a iOS/lib/libcrypto.a iOS/lib/libssl.a -libtool -no_warning_for_no_symbols -static -o openssl-ios-i386_x86_64_arm64-simulator.a iOS-simulator/lib/libcrypto.a iOS-simulator/lib/libssl.a +# iOS +if [ $BUILDFOR == "ios" ] || [ $BUILDFOR == "all" ]; then + echo -e "${bold}Building iOS libraries${dim}" + + buildIOS "armv7" + buildIOS "armv7s" + buildIOS "arm64" + buildIOS "arm64e" + + buildIOSsim "i386" + buildIOSsim "x86_64" + buildIOSsim "arm64" + + echo -e " ${dim}Copying headers and libraries" + cp /tmp/${OPENSSL_VERSION}-iOS-arm64/include/openssl/* iOS/include/openssl/ + + lipo \ + "/tmp/${OPENSSL_VERSION}-iOS-armv7/lib/libcrypto.a" \ + "/tmp/${OPENSSL_VERSION}-iOS-armv7s/lib/libcrypto.a" \ + "/tmp/${OPENSSL_VERSION}-iOS-arm64/lib/libcrypto.a" \ + "/tmp/${OPENSSL_VERSION}-iOS-arm64e/lib/libcrypto.a" \ + -create -output iOS/lib/libcrypto.a + + lipo \ + "/tmp/${OPENSSL_VERSION}-iOS-armv7/lib/libssl.a" \ + "/tmp/${OPENSSL_VERSION}-iOS-armv7s/lib/libssl.a" \ + "/tmp/${OPENSSL_VERSION}-iOS-arm64/lib/libssl.a" \ + "/tmp/${OPENSSL_VERSION}-iOS-arm64e/lib/libssl.a" \ + -create -output iOS/lib/libssl.a + + + cp /tmp/${OPENSSL_VERSION}-iOS-Simulator-x86_64/include/openssl/* iOS-simulator/include/openssl/ + + lipo \ + "/tmp/${OPENSSL_VERSION}-iOS-Simulator-i386/lib/libcrypto.a" \ + "/tmp/${OPENSSL_VERSION}-iOS-Simulator-x86_64/lib/libcrypto.a" \ + "/tmp/${OPENSSL_VERSION}-iOS-Simulator-arm64/lib/libcrypto.a" \ + -create -output iOS-simulator/lib/libcrypto.a + + lipo \ + "/tmp/${OPENSSL_VERSION}-iOS-Simulator-i386/lib/libssl.a" \ + "/tmp/${OPENSSL_VERSION}-iOS-Simulator-x86_64/lib/libssl.a" \ + "/tmp/${OPENSSL_VERSION}-iOS-Simulator-arm64/lib/libssl.a" \ + -create -output iOS-simulator/lib/libssl.a + + cp /tmp/${OPENSSL_VERSION}-iOS-arm64/include/openssl/* iOS-fat/include/openssl/ + + lipo \ + "/tmp/${OPENSSL_VERSION}-iOS-armv7/lib/libcrypto.a" \ + "/tmp/${OPENSSL_VERSION}-iOS-armv7s/lib/libcrypto.a" \ + "/tmp/${OPENSSL_VERSION}-iOS-arm64/lib/libcrypto.a" \ + "/tmp/${OPENSSL_VERSION}-iOS-arm64e/lib/libcrypto.a" \ + "/tmp/${OPENSSL_VERSION}-iOS-Simulator-i386/lib/libcrypto.a" \ + "/tmp/${OPENSSL_VERSION}-iOS-Simulator-x86_64/lib/libcrypto.a" \ + -create -output iOS-fat/lib/libcrypto.a + + lipo \ + "/tmp/${OPENSSL_VERSION}-iOS-armv7/lib/libssl.a" \ + "/tmp/${OPENSSL_VERSION}-iOS-armv7s/lib/libssl.a" \ + "/tmp/${OPENSSL_VERSION}-iOS-arm64/lib/libssl.a" \ + "/tmp/${OPENSSL_VERSION}-iOS-arm64e/lib/libssl.a" \ + "/tmp/${OPENSSL_VERSION}-iOS-Simulator-x86_64/lib/libssl.a" \ + "/tmp/${OPENSSL_VERSION}-iOS-Simulator-i386/lib/libssl.a" \ + -create -output iOS-fat/lib/libssl.a + + echo -e " ${dim}Creating combined OpenSSL libraries for iOS" + libtool -no_warning_for_no_symbols -static -o openssl-ios-armv7_armv7s_arm64_arm64e.a iOS/lib/libcrypto.a iOS/lib/libssl.a + libtool -no_warning_for_no_symbols -static -o openssl-ios-i386_x86_64_arm64-simulator.a iOS-simulator/lib/libcrypto.a iOS-simulator/lib/libssl.a +fi echo -e "${bold}Cleaning up${dim}" rm -rf /tmp/${OPENSSL_VERSION}-*