diff --git a/.gitignore b/.gitignore index 9a83bd9d..08a12ff8 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,8 @@ bin src lib +frameworks include/openssl *.gz *.framework +Carthage \ No newline at end of file diff --git a/Gemfile b/Gemfile deleted file mode 100755 index d1bf7c6f..00000000 --- a/Gemfile +++ /dev/null @@ -1,3 +0,0 @@ -source "https://rubygems.org" - -gem "cocoapods" diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100755 index aed9389f..00000000 --- a/Gemfile.lock +++ /dev/null @@ -1,83 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - CFPropertyList (3.0.1) - activesupport (4.2.11.1) - i18n (~> 0.7) - minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) - tzinfo (~> 1.1) - algoliasearch (1.27.0) - httpclient (~> 2.8, >= 2.8.3) - json (>= 1.5.1) - atomos (0.1.3) - claide (1.0.3) - cocoapods (1.8.0) - activesupport (>= 4.0.2, < 5) - claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.8.0) - cocoapods-deintegrate (>= 1.0.3, < 2.0) - cocoapods-downloader (>= 1.2.2, < 2.0) - cocoapods-plugins (>= 1.0.0, < 2.0) - cocoapods-search (>= 1.0.0, < 2.0) - cocoapods-stats (>= 1.0.0, < 2.0) - cocoapods-trunk (>= 1.4.0, < 2.0) - cocoapods-try (>= 1.1.0, < 2.0) - colored2 (~> 3.1) - escape (~> 0.0.4) - fourflusher (>= 2.3.0, < 3.0) - gh_inspector (~> 1.0) - molinillo (~> 0.6.6) - nap (~> 1.0) - ruby-macho (~> 1.4) - xcodeproj (>= 1.11.1, < 2.0) - cocoapods-core (1.8.0) - activesupport (>= 4.0.2, < 6) - algoliasearch (~> 1.0) - concurrent-ruby (~> 1.0) - fuzzy_match (~> 2.0.4) - nap (~> 1.0) - cocoapods-deintegrate (1.0.4) - cocoapods-downloader (1.2.2) - cocoapods-plugins (1.0.0) - nap - cocoapods-search (1.0.0) - cocoapods-stats (1.1.0) - cocoapods-trunk (1.4.0) - nap (>= 0.8, < 2.0) - netrc (~> 0.11) - cocoapods-try (1.1.0) - colored2 (3.1.2) - concurrent-ruby (1.1.5) - escape (0.0.4) - fourflusher (2.3.1) - fuzzy_match (2.0.4) - gh_inspector (1.1.3) - httpclient (2.8.3) - i18n (0.9.5) - concurrent-ruby (~> 1.0) - json (2.2.0) - minitest (5.12.0) - molinillo (0.6.6) - nanaimo (0.2.6) - nap (1.1.0) - netrc (0.11.0) - ruby-macho (1.4.0) - thread_safe (0.3.6) - tzinfo (1.2.5) - thread_safe (~> 0.1) - xcodeproj (1.12.0) - CFPropertyList (>= 2.3.3, < 4.0) - atomos (~> 0.1.3) - claide (>= 1.0.2, < 2.0) - colored2 (~> 3.1) - nanaimo (~> 0.2.6) - -PLATFORMS - ruby - -DEPENDENCIES - cocoapods - -BUNDLED WITH - 2.0.2 diff --git a/OPENSSL-LICENSE b/OPENSSL-LICENSE deleted file mode 100755 index e953f590..00000000 --- a/OPENSSL-LICENSE +++ /dev/null @@ -1,125 +0,0 @@ - - LICENSE ISSUES - ============== - - The OpenSSL toolkit stays under a double license, i.e. both the conditions of - the OpenSSL License and the original SSLeay license apply to the toolkit. - See below for the actual license texts. - - OpenSSL License - --------------- - -/* ==================================================================== - * Copyright (c) 1998-2018 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - - Original SSLeay License - ----------------------- - -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - diff --git a/OpenSSL-Apple.podspec.template b/OpenSSL-Apple.podspec.template deleted file mode 100755 index 60e0a384..00000000 --- a/OpenSSL-Apple.podspec.template +++ /dev/null @@ -1,28 +0,0 @@ -Pod::Spec.new do |s| - openssl_version = "%OPENSSL-VERSION%" - script_version = "4" - - s.name = "OpenSSL-Apple" - s.version = "#{openssl_version}.#{script_version}" - s.summary = "A script for compiling OpenSSL for Apple Devices" - s.authors = "Felix Schulze", "Davide De Rosa", "Ezat Hashim" - - s.homepage = "https://github.com/keeshux/openssl-apple.git" - s.source = { :git => s.homepage.to_s, :tag => "v#{script_version}" } - s.license = { :type => 'Apache', :file => 'LICENSE' } - - s.prepare_command = <<-CMD -./build-libssl.sh --version=#{openssl_version} -./create-openssl-framework.sh dynamic - CMD - - s.ios.deployment_target = "11.0" - s.ios.vendored_frameworks = "frameworks/iPhone/openssl.framework" - s.tvos.deployment_target = "11.0" - s.tvos.vendored_frameworks = "frameworks/AppleTV/openssl.framework" - s.osx.deployment_target = "10.11" - s.osx.vendored_frameworks = "frameworks/MacOSX/openssl.framework" - s.watchos.deployment_target = "4.0" - s.watchos.vendored_frameworks = "frameworks/WatchOS/openssl.framework" - s.requires_arc = false -end diff --git a/OpenSSL-ContainerFramework.json b/OpenSSL-ContainerFramework.json new file mode 100644 index 00000000..646610d7 --- /dev/null +++ b/OpenSSL-ContainerFramework.json @@ -0,0 +1,3 @@ +{ + "1.1.14": "https://github.com/balthisar/openssl-xcframeworks/releases/download/1.1.1d/OpenSSL-ContainerFramework.framework.zip" +} diff --git a/OpenSSL-ContainerFramework.xcodeproj/project.pbxproj b/OpenSSL-ContainerFramework.xcodeproj/project.pbxproj new file mode 100644 index 00000000..c3b5f577 --- /dev/null +++ b/OpenSSL-ContainerFramework.xcodeproj/project.pbxproj @@ -0,0 +1,352 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + D053F3D42394890800F3B166 /* OpenSSL-Container.h in Headers */ = {isa = PBXBuildFile; fileRef = D05FFEAB238DAFA200E46F46 /* OpenSSL-Container.h */; settings = {ATTRIBUTES = (Public, ); }; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + D05FFEA8238DAFA200E46F46 /* OpenSSL-ContainerFramework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = "OpenSSL-ContainerFramework.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + D05FFEAB238DAFA200E46F46 /* OpenSSL-Container.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "OpenSSL-Container.h"; sourceTree = ""; }; + D05FFEAC238DAFA200E46F46 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + D05FFEA5238DAFA200E46F46 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + D05FFE9E238DAFA200E46F46 = { + isa = PBXGroup; + children = ( + D05FFEAA238DAFA200E46F46 /* OpenSSL-ContainerFramework */, + D05FFEA9238DAFA200E46F46 /* Products */, + ); + sourceTree = ""; + }; + D05FFEA9238DAFA200E46F46 /* Products */ = { + isa = PBXGroup; + children = ( + D05FFEA8238DAFA200E46F46 /* OpenSSL-ContainerFramework.framework */, + ); + name = Products; + sourceTree = ""; + }; + D05FFEAA238DAFA200E46F46 /* OpenSSL-ContainerFramework */ = { + isa = PBXGroup; + children = ( + D05FFEAB238DAFA200E46F46 /* OpenSSL-Container.h */, + D05FFEAC238DAFA200E46F46 /* Info.plist */, + ); + path = "OpenSSL-ContainerFramework"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + D05FFEA3238DAFA200E46F46 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + D053F3D42394890800F3B166 /* OpenSSL-Container.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + D05FFEA7238DAFA200E46F46 /* OpenSSL-ContainerFramework */ = { + isa = PBXNativeTarget; + buildConfigurationList = D05FFEB0238DAFA200E46F46 /* Build configuration list for PBXNativeTarget "OpenSSL-ContainerFramework" */; + buildPhases = ( + D05FFEA3238DAFA200E46F46 /* Headers */, + D05FFEA4238DAFA200E46F46 /* Sources */, + D05FFEA5238DAFA200E46F46 /* Frameworks */, + D05FFEA6238DAFA200E46F46 /* Resources */, + D05FFEB3238DB12500E46F46 /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "OpenSSL-ContainerFramework"; + productName = CarthageFakeFramework; + productReference = D05FFEA8238DAFA200E46F46 /* OpenSSL-ContainerFramework.framework */; + productType = "com.apple.product-type.framework"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + D05FFE9F238DAFA200E46F46 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1120; + ORGANIZATIONNAME = "Jim Derry"; + TargetAttributes = { + D05FFEA7238DAFA200E46F46 = { + CreatedOnToolsVersion = 11.1; + }; + }; + }; + buildConfigurationList = D05FFEA2238DAFA200E46F46 /* Build configuration list for PBXProject "OpenSSL-ContainerFramework" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = D05FFE9E238DAFA200E46F46; + productRefGroup = D05FFEA9238DAFA200E46F46 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + D05FFEA7238DAFA200E46F46 /* OpenSSL-ContainerFramework */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + D05FFEA6238DAFA200E46F46 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + D05FFEB3238DB12500E46F46 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + "$(BUILT_PRODUCTS_DIR)/openssl-apple/lib", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "BUILD=\"${BUILT_PRODUCTS_DIR}/OpenSSL-ContainerFramework.framework/Versions/A/Resources/openssl-xcframeworks\"\nmkdir -p \"$BUILD\"\n\nsource \"${HOME}/.zshenv\"\n\n./build-libssl.sh --directory=\"$BUILD\" --verbose\n./create-openssl-framework.sh --directory=\"$BUILD\" --frameworks=\"xcframework-dynamic\" xcdynamic\n./create-openssl-framework.sh --directory=\"$BUILD\" --frameworks=\"xcframework-static\" xcstatic\n./create-openssl-framework.sh --directory=\"$BUILD\" --frameworks=\"framework-dynamic\" dynamic\n./create-openssl-framework.sh --directory=\"$BUILD\" --frameworks=\"framework-static\" static\n\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + D05FFEA4238DAFA200E46F46 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + D05FFEAE238DAFA200E46F46 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + 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_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; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + 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; + MACOSX_DEPLOYMENT_TARGET = 10.11; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + D05FFEAF238DAFA200E46F46 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + 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_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; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + 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; + MACOSX_DEPLOYMENT_TARGET = 10.11; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = macosx; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + D05FFEB1238DAFA200E46F46 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "OpenSSL-ContainerFramework/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.balthisar.ContainerFramework; + PRODUCT_NAME = "OpenSSL-ContainerFramework"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + D05FFEB2238DAFA200E46F46 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "OpenSSL-ContainerFramework/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.balthisar.ContainerFramework; + PRODUCT_NAME = "OpenSSL-ContainerFramework"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SKIP_INSTALL = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + D05FFEA2238DAFA200E46F46 /* Build configuration list for PBXProject "OpenSSL-ContainerFramework" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D05FFEAE238DAFA200E46F46 /* Debug */, + D05FFEAF238DAFA200E46F46 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + D05FFEB0238DAFA200E46F46 /* Build configuration list for PBXNativeTarget "OpenSSL-ContainerFramework" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D05FFEB1238DAFA200E46F46 /* Debug */, + D05FFEB2238DAFA200E46F46 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = D05FFE9F238DAFA200E46F46 /* Project object */; +} diff --git a/OpenSSL-ContainerFramework.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/OpenSSL-ContainerFramework.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..971abac7 --- /dev/null +++ b/OpenSSL-ContainerFramework.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/OpenSSL-ContainerFramework.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/OpenSSL-ContainerFramework.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/OpenSSL-ContainerFramework.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/OpenSSL-ContainerFramework.xcodeproj/project.xcworkspace/xcuserdata/jderry.xcuserdatad/UserInterfaceState.xcuserstate b/OpenSSL-ContainerFramework.xcodeproj/project.xcworkspace/xcuserdata/jderry.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 00000000..9605cf45 Binary files /dev/null and b/OpenSSL-ContainerFramework.xcodeproj/project.xcworkspace/xcuserdata/jderry.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/OpenSSL-ContainerFramework.xcodeproj/xcshareddata/xcschemes/OpenSSL-Container.xcscheme b/OpenSSL-ContainerFramework.xcodeproj/xcshareddata/xcschemes/OpenSSL-Container.xcscheme new file mode 100644 index 00000000..97cb050f --- /dev/null +++ b/OpenSSL-ContainerFramework.xcodeproj/xcshareddata/xcschemes/OpenSSL-Container.xcscheme @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OpenSSL-ContainerFramework.xcodeproj/xcuserdata/jderry.xcuserdatad/xcschemes/xcschememanagement.plist b/OpenSSL-ContainerFramework.xcodeproj/xcuserdata/jderry.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 00000000..a534aa55 --- /dev/null +++ b/OpenSSL-ContainerFramework.xcodeproj/xcuserdata/jderry.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + CarthageFakeFramework.xcscheme_^#shared#^_ + + orderHint + 0 + + OpenSSL-Container.xcscheme_^#shared#^_ + + orderHint + 0 + + + SuppressBuildableAutocreation + + D05FFEA7238DAFA200E46F46 + + primary + + + + + diff --git a/OpenSSL-ContainerFramework/Info.plist b/OpenSSL-ContainerFramework/Info.plist new file mode 100644 index 00000000..588f717f --- /dev/null +++ b/OpenSSL-ContainerFramework/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSHumanReadableCopyright + Copyright © 2019 Jim Derry. All rights reserved. + + diff --git a/OpenSSL-ContainerFramework/OpenSSL-Container.h b/OpenSSL-ContainerFramework/OpenSSL-Container.h new file mode 100644 index 00000000..1a6abfe3 --- /dev/null +++ b/OpenSSL-ContainerFramework/OpenSSL-Container.h @@ -0,0 +1,19 @@ +// +// FakeLibraries.h +// FakeLibraries +// +// Created by Jim Derry on 11/26/19. +// Copyright © 2019 Jim Derry. All rights reserved. +// + +#import + +//! Project version number for CarthageFakeFramework. +FOUNDATION_EXPORT double FakeLibrariesVersionNumber; + +//! Project version string for CarthageFakeFramework. +FOUNDATION_EXPORT const unsigned char FakeLibrariesVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + + diff --git a/README.md b/README.md index 055addf6..e8290232 100755 --- a/README.md +++ b/README.md @@ -1,41 +1,50 @@ -# OpenSSL-Apple +# openssl-xcframeworks +![macOS support](https://img.shields.io/badge/macOS-10.11+-blue.svg) ![iOS support](https://img.shields.io/badge/iOS-11+-blue.svg) ![tvOS support](https://img.shields.io/badge/tvOS-11+-blue.svg) -![macOS support](https://img.shields.io/badge/macOS-10.11+-blue.svg) ![watchOS support](https://img.shields.io/badge/watchOS-4.0+-blue.svg) -![OpenSSL version](https://img.shields.io/badge/OpenSSL-1.1.0i-green.svg) -![OpenSSL version](https://img.shields.io/badge/OpenSSL-1.0.2o-green.svg) +![macOS Catalyst support](https://img.shields.io/badge/macOS%20Catalyst-10.15+-blue.svg) +![OpenSSL version](https://img.shields.io/badge/OpenSSL-1.1.1d-green.svg) +![OpenSSL version](https://img.shields.io/badge/OpenSSL-1.0.2t-green.svg) [![license](https://img.shields.io/badge/license-Apache%202.0-lightgrey.svg)](LICENSE) -This is a fork of the popular work by [Felix Schulze](https://github.com/x2on), that is a set of scripts for using self-compiled builds of the OpenSSL library on the iPhone and the Apple TV. +This is fork of the [OpenSSL-Apple project](https://github.com/keeshux/openssl-apple) by +Davide De Rosa, which is itself a fork of the popular work by +[Felix Schulze](https://github.com/x2on), that is a set of scripts for using self-compiled +builds of the OpenSSL library on the iPhone, Apple TV, Apple Watch, macOS, and Catalyst. + +However, this repository branches from Davide's repository by emphasizing support for: + +- macOS Catalyst +- building XCFrameworks +- installation via Carthage -However, this repository focuses more on framework-based setups and also adds macOS and watchOS support. # Compile library -Compile OpenSSL 1.0.2k for all archs: +Compile OpenSSL 1.0.2t for default archs: ``` -./build-libssl.sh --version=1.0.2k +./build-libssl.sh --version=1.0.2t ``` -Compile OpenSSL 1.1.0f for all targets: +Compile OpenSSL 1.1.1d for default targets: ``` -./build-libssl.sh --version=1.1.0f +./build-libssl.sh --version=1.1.1d ``` -Compile OpenSSL 1.0.2k for specific archs: +Compile OpenSSL 1.0.2d for specific archs: ``` -./build-libssl.sh --version=1.0.2k --archs="ios_armv7 ios_arm64 mac_i386" +./build-libssl.sh --version=1.0.2d --archs="ios_armv7 ios_arm64 mac_i386" ``` -Compile OpenSSL 1.1.0f for specific targets: +Compile OpenSSL 1.1.1d for specific targets: ``` -./build-libssl.sh --version=1.1.0f --targets="ios-cross-armv7 macos64-x86_64" +./build-libssl.sh --version=1.1.1d --targets="ios-cross-armv7 macos64-x86_64" ``` For all options see: @@ -44,6 +53,7 @@ For all options see: ./build-libssl.sh --help ``` + # Generate frameworks Statically linked: @@ -52,16 +62,123 @@ Statically linked: ./create-openssl-framework.sh static ``` +Statically linked as XCFramework: + +``` +./create-openssl-framework.sh xcstatic +``` + Dynamically linked: ``` ./create-openssl-framework.sh dynamic ``` +Dynamically linked as XCFramework: + +``` +./create-openssl-framework.sh xcdynamic +``` + + +# Use from Carthage + + +## Carthage notes + +Carthage only supports frameworks, and does not support standalone dynamic or static libraries, and +does not currently support XCFrameworks, and so support for all of these is provided by building +these in a fake macOS framework ("OpenSSL-ContainerFramework"), from where you can add whatever you +need to your Xcode project in the usual way. It's kind of a hacky solution, but provides everything +you could need once built or downloaded: + +- `$(SRCROOT)/Carthage/Build/Mac/OpenSSL-ContainerFramework.framework/Versions/A/Resources/openssl-xcframeworks/` + + - `framework-dynamic/*/`: Contains an `openssl.framework` for dynamic linking for each platform. + + - `framework-static/*/`: Contains an `openssl.framework` for static linking for each platform. + + - `xcframework-dynamic/`: Contains the `openssl.xcframework` as a dynamic-linked framework. + + - `xcframework-static/`: Contains the `openssl.xcframework` as a static-linked framework. + + - `lib/`: Contains static `libcrypto-*.a` and `libssl-*.a` for each platform. These are fat + binaries that should cover all current architectures for a platform. + + - `bin/*.sdk/lib/`: Contains static `libcrypto.a` and `libssl.a` for each architecture and + platform. + +Remember, although the `OpenSSL-ContainerFramework.framework` is a macOS project, binaries for +_all_ platforms are in Carthage's `Mac/` build directory. + +When Carthage is eventually updated to support XCFrameworks, then the strategy above is likely to +change. + + +## Installation (will build from **openssl**'s source) + +You can add this repository to your Cartfile as so: + +``` +github "balthisar/openssl-xcframeworks" +``` + +Upon issuing `carthage update`, Carthage will download and build the OpenSSL frameworks for each +platform and architecture. This process can be time consuming, but only has to be performed one +time for each build environment. You can also choose to use the pre-built binaries, next. + +As mentioned above, when Carthage is updated to support XCFrameworks, the framework location in the +Carthage build directory is likely to change. You can freeze Carthage to a certain tag or hash in +your Cartfile, if you like. + + +## Installation (will use binaries that I built) + +Other OpenSSL for macOS/iOS distributions tend to distribute binaries in repositories, which seems +to be pretty popular. It's unwise for a couple of reasons: + +- You have no idea whether or not the maintainer compiled anything nefarious into the binaries; + +- Binaries should not be under version control; they just inflate the repository size. + +If you trust my binaries and prefer not to build your own per the previous section (although it's a +one-time requirement only), you can add the following to your Cartfile instead of the repository as +in the previous section: + +``` +binary "https://raw.githubusercontent.com/balthisar/openssl-xcframeworks/master/OpenSSL-ContainerFramework.json" ~> 1.1.14 +``` + +Upon issuing `carthage update`, the binary framework will be downloaded and unzipped. + +Note: the semantic version "1.1.14" corresponds to **openssl**'s version "1.1.1d"; if **openssl** +releases "1.1.1e" then the real semantic version would be "1.1.15", etc. This is required because +Carthage only works with real semantic version numbers. + + +# Download the Binaries (without Carthage) + +You can download and manually manage binaries with the same zip file that Carthage would manage for +you automatically. Take a look at the Github [releases page](https://github.com/balthisar/openssl-xcframeworks/releases) +for this repository. + + +# Use from Cocoapods + +Not currently possible until Cocoapods is updated to work with XCFrameworks. + + # Original project * + +# Davide de Rosa's project + +* + + # Acknowledgements -This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit. () +This product includes software developed by the OpenSSL Project for use in the OpenSSL +Toolkit. () diff --git a/assets/Catalyst/Info.plist b/assets/Catalyst/Info.plist new file mode 100755 index 00000000..1c276cdc --- /dev/null +++ b/assets/Catalyst/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + openssl + CFBundleIdentifier + org.openssl.OpenSSL + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + openssl + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + MinimumOSVersion + 10.15 + + diff --git a/assets/WatchOS/Info.plist b/assets/Watch/Info.plist similarity index 100% rename from assets/WatchOS/Info.plist rename to assets/Watch/Info.plist diff --git a/build-libssl.sh b/build-libssl.sh index 7bc5af89..180d5311 100755 --- a/build-libssl.sh +++ b/build-libssl.sh @@ -1,7 +1,6 @@ #!/bin/sh -# Automatic build script for libssl and libcrypto -# for iPhoneOS and iPhoneSimulator +# Automatic build script for libssl and libcrypto for macOS and other Apple devices. # # Created by Felix Schulze on 16.12.10. # Copyright 2010-2017 Felix Schulze. All rights reserved. @@ -18,67 +17,102 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# 2019-November (Jim Derry ): changes to build for macOS Catalyst and to +# build an XCFramework. Other small updates. +# # -u Attempt to use undefined variable outputs error message, and forces an exit set -u +# Determine script directory +SCRIPTDIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) + +# # SCRIPT DEFAULTS +# # Default version in case no version is specified -DEFAULTVERSION="1.1.0i" +DEFAULTVERSION="1.1.1d" -# Default (=full) set of architectures (OpenSSL <= 1.0.2) or targets (OpenSSL >= 1.1.0) to build -#DEFAULTARCHS="ios_x86_64 ios_arm64 ios_armv7s ios_armv7 tv_x86_64 tv_arm64 mac_x86_64" -#DEFAULTTARGETS="ios-sim-cross-x86_64 ios64-cross-arm64 ios-cross-armv7s ios-cross-armv7 tvos-sim-cross-x86_64 tvos64-cross-arm64 macos64-x86_64" -DEFAULTARCHS="ios_x86_64 ios_arm64 tv_x86_64 tv_arm64 mac_x86_64 watchos_armv7k watchos_arm64_32 watchos_i386" -DEFAULTTARGETS="ios-sim-cross-x86_64 ios64-cross-arm64 tvos-sim-cross-x86_64 tvos64-cross-arm64 macos64-x86_64 watchos-cross-armv7k watchos-cross-arm64_32 watchos-sim-cross-i386" +# Available set of architectures (OpenSSL <= 1.0.2) or targets (OpenSSL >= 1.1.1) to build. +# These are distinct from the default sets, below, in that these are shown in help as available, +# and are supported by OpenSSL, but we don't really want to build all of them all the time. +ARCHS_AVAIL="ios_x86_64 ios_arm64 tv_x86_64 tv_arm64 mac_x86_64 watchos_armv7k watchos_arm64_32 watchos_i386 catalyst_x86_64" +TRGTS_AVAIL="ios-sim-cross-x86_64 ios64-cross-arm64 tvos-sim-cross-x86_64 tvos64-cross-arm64 macos64-x86_64 watchos-cross-armv7k watchos-cross-arm64_32 watchos-sim-cross-i386 mac-catalyst-x86_64" -# Minimum iOS/tvOS SDK version to build for -MACOS_MIN_SDK_VERSION="10.11" -IOS_MIN_SDK_VERSION="11.0" -TVOS_MIN_SDK_VERSION="11.0" -WATCHOS_MIN_SDK_VERSION="4.0" +# Default set of architectures (OpenSSL <= 1.0.2) or targets (OpenSSL >= 1.1.1) to build +ARCHS_DEFAULT="ios_x86_64 ios_arm64 tv_x86_64 tv_arm64 mac_x86_64 watchos_arm64_32 watchos_i386 catalyst_x86_64" +TRGTS_DEFAULT="ios-sim-cross-x86_64 ios64-cross-arm64 tvos-sim-cross-x86_64 tvos64-cross-arm64 macos64-x86_64 watchos-cross-arm64_32 watchos-sim-cross-i386 mac-catalyst-x86_64" + +# Minimum SDK versions to build for +source "${SCRIPTDIR}/scripts/min-sdk-versions.sh" # Init optional env variables (use available variable or default to empty string) CURL_OPTIONS="${CURL_OPTIONS:-}" CONFIG_OPTIONS="${CONFIG_OPTIONS:-}" + +# +# Help +# echo_help() { - echo "Usage: $0 [options...]" - echo "Generic options" - echo " --branch=BRANCH Select OpenSSL branch to build. The script will determine and download the latest release for that branch" - echo " --cleanup Clean up build directories (bin, include/openssl, lib, src) before starting build" - echo " --ec-nistp-64-gcc-128 Enable configure option enable-ec_nistp_64_gcc_128 for 64 bit builds" - echo " -h, --help Print help (this message)" - echo " --macos-sdk=SDKVERSION Override macOS SDK version" - echo " --ios-sdk=SDKVERSION Override iOS SDK version" - echo " --noparallel Disable running make with parallel jobs (make -j)" - echo " --tvos-sdk=SDKVERSION Override tvOS SDK version" - echo " --disable-bitcode Disable embedding Bitcode" - echo " -v, --verbose Enable verbose logging" - echo " --verbose-on-error Dump last 500 lines from log file if an error occurs (for Travis builds)" - echo " --version=VERSION OpenSSL version to build (defaults to ${DEFAULTVERSION})" - echo - echo "Options for OpenSSL 1.0.2 and lower ONLY" - echo " --archs=\"ARCH ARCH ...\" Space-separated list of architectures to build" - echo " Options: ${DEFAULTARCHS}" - echo - echo "Options for OpenSSL 1.1.0 and higher ONLY" - echo " --deprecated Exclude no-deprecated configure option and build with deprecated methods" - echo " --targets=\"TARGET TARGET ...\" Space-separated list of build targets" - echo " Options: ${DEFAULTTARGETS}" - echo - echo "For custom configure options, set variable CONFIG_OPTIONS" - echo "For custom cURL options, set variable CURL_OPTIONS" - echo " Example: CURL_OPTIONS=\"--proxy 192.168.1.1:8080\" ./build-libssl.sh" + cat <= 1.1. The type "archs" matches the key variable +# Significant changes to the build process were introduced with OpenSSL 1.1.1. As a result, this script was updated +# to include two separate build loops for versions < 1.1 and versions >= 1.1. The type "archs" matches the key variable # used to determine for which platforms to build for the 1.0 branch. Since 1.1, all platforms are defined in a separate/ # custom configuration file as build targets. Therefore the key variable and type are called targets for 1.1 (and later). @@ -331,7 +400,7 @@ if [[ "${VERSION}" =~ ^(0\.9|1\.0) ]]; then # Set default for ARCHS if not specified if [ ! -n "${ARCHS}" ]; then - ARCHS="${DEFAULTARCHS}" + ARCHS="${ARCHS_DEFAULT}" fi # OpenSSL branches >= 1.1 @@ -340,7 +409,7 @@ else # Set default for TARGETS if not specified if [ ! -n "${TARGETS}" ]; then - TARGETS="${DEFAULTTARGETS}" + TARGETS="${TRGTS_DEFAULT}" fi # Add no-deprecated config option (if not overwritten) @@ -353,6 +422,9 @@ fi if [ ! -n "${MACOS_SDKVERSION}" ]; then MACOS_SDKVERSION=$(xcrun -sdk macosx --show-sdk-version) fi +if [ ! -n "${CATALYST_SDKVERSION}" ]; then + CATALYST_SDKVERSION=$(xcrun -sdk macosx --show-sdk-version) +fi if [ ! -n "${IOS_SDKVERSION}" ]; then IOS_SDKVERSION=$(xcrun -sdk iphoneos --show-sdk-version) fi @@ -369,17 +441,19 @@ if [ "${PARALLEL}" != "false" ]; then BUILD_THREADS=$(sysctl hw.ncpu | awk '{print $2}') fi -# Determine script directory -SCRIPTDIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) - # Write files relative to current location and validate directory -CURRENTPATH=$(pwd) +CURRENTPATH=${BUILD_DIR:-$(pwd)} case "${CURRENTPATH}" in *\ * ) echo "Your path contains whitespaces, which is not supported by 'make install'." exit 1 ;; esac +if [[ ! -d ${CURRENTPATH} ]]; then + echo "The root build directory must already exist." + exit 1 +fi + cd "${CURRENTPATH}" # Validate Xcode Developer path @@ -410,6 +484,7 @@ else echo " Targets: ${TARGETS}" fi echo " macOS SDK: ${MACOS_SDKVERSION}" +echo " macOS SDK (Catalyst): ${CATALYST_SDKVERSION}" echo " iOS SDK: ${IOS_SDKVERSION}" echo " tvOS SDK: ${TVOS_SDKVERSION}" echo " watchOS SDK: ${WATCHOS_SDKVERSION}" @@ -426,7 +501,7 @@ echo # Download OpenSSL when not present OPENSSL_ARCHIVE_BASE_NAME="openssl-${VERSION}" OPENSSL_ARCHIVE_FILE_NAME="${OPENSSL_ARCHIVE_BASE_NAME}.tar.gz" -if [ ! -e ${OPENSSL_ARCHIVE_FILE_NAME} ]; then +if [ ! -e "${CURRENTPATH}/${OPENSSL_ARCHIVE_FILE_NAME}" ]; then echo "Downloading ${OPENSSL_ARCHIVE_FILE_NAME}..." OPENSSL_ARCHIVE_URL="https://www.openssl.org/source/${OPENSSL_ARCHIVE_FILE_NAME}" @@ -451,13 +526,13 @@ if [ ! -e ${OPENSSL_ARCHIVE_FILE_NAME} ]; then # Archive was found, so proceed with download. # -O Use server-specified filename for download - curl ${CURL_OPTIONS} -O "${OPENSSL_ARCHIVE_URL}" + (cd ${CURRENTPATH} && curl ${CURL_OPTIONS} -O "${OPENSSL_ARCHIVE_URL}") else echo "Using ${OPENSSL_ARCHIVE_FILE_NAME}" fi -# Set reference to custom configuration (OpenSSL 1.1.0) +# Set reference to custom configuration (OpenSSL 1.1.1) # See: https://github.com/openssl/openssl/commit/afce395cba521e395e6eecdaf9589105f61e4411 export OPENSSL_LOCAL_CONFIG_DIR="${SCRIPTDIR}/config" @@ -485,12 +560,15 @@ fi mkdir -p "${CURRENTPATH}/bin" mkdir -p "${CURRENTPATH}/lib" mkdir -p "${CURRENTPATH}/src" +mkdir -p "${CURRENTPATH}/include" # Init vars for library references INCLUDE_DIR="" OPENSSLCONF_ALL=() LIBSSL_MACOS=() LIBCRYPTO_MACOS=() +LIBSSL_CATALYST=() +LIBCRYPTO_CATALYST=() LIBSSL_IOS=() LIBCRYPTO_IOS=() LIBSSL_TVOS=() @@ -512,6 +590,13 @@ if [ ${#LIBSSL_MACOS[@]} -gt 0 ]; then lipo -create ${LIBCRYPTO_MACOS[@]} -output "${CURRENTPATH}/lib/libcrypto-MacOSX.a" fi +#Build catalyst library if selected for build +if [ ${#LIBSSL_CATALYST[@]} -gt 0 ]; then + echo "Build library for catalyst..." + lipo -create ${LIBSSL_CATALYST[@]} -output "${CURRENTPATH}/lib/libssl-Catalyst.a" + lipo -create ${LIBCRYPTO_CATALYST[@]} -output "${CURRENTPATH}/lib/libcrypto-Catalyst.a" +fi + # Build iOS library if selected for build if [ ${#LIBSSL_IOS[@]} -gt 0 ]; then echo "Build library for iOS..." @@ -543,7 +628,7 @@ if [ ${#OPENSSLCONF_ALL[@]} -gt 1 ]; then # Prepare intermediate header file # This overwrites opensslconf.h that was copied from $INCLUDE_DIR OPENSSLCONF_INTERMEDIATE="${CURRENTPATH}/include/openssl/opensslconf.h" - cp "${CURRENTPATH}/include/opensslconf-template.h" "${OPENSSLCONF_INTERMEDIATE}" + cp "${SCRIPTDIR}/include/opensslconf-template.h" "${OPENSSLCONF_INTERMEDIATE}" # Loop all header files LOOPCOUNT=0 @@ -590,6 +675,8 @@ if [ ${#OPENSSLCONF_ALL[@]} -gt 1 ]; then *_watchos_i386.h) DEFINE_CONDITION="TARGET_OS_SIMULATOR && TARGET_CPU_X86 || TARGET_OS_EMBEDDED" ;; + *_catalyst_x86_64.h) + DEFINE_CONDITION="(TARGET_OS_MACCATALYST || (TARGET_OS_IOS && TARGET_OS_SIMULATOR)) && TARGET_CPU_X86_64" ;; *) # Don't run into unexpected cases by setting the default condition to false DEFINE_CONDITION="0" diff --git a/config/20-all-platforms.conf b/config/20-all-platforms.conf index c888c19f..b18434a0 100755 --- a/config/20-all-platforms.conf +++ b/config/20-all-platforms.conf @@ -1,5 +1,7 @@ ## -*- mode: perl; -*- +my %targets = (); + %targets = ( ## Base settings for cross-compile # Based on 10-main.conf: iphoneos-cross @@ -119,7 +121,7 @@ # Based on 10-main.conf: ios64-cross "tvos64-cross-arm64" => { inherit_from => [ "darwin-common", "tvos-cross-base", asm("aarch64_asm") ], - cflags => add("-arch arm64"), + cflags => add("-arch arm64 -fembed-bitcode"), bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR", perlasm_scheme => "ios64", sys_id => "tvOS", @@ -136,4 +138,21 @@ inherit_from => [ "darwin-i386-cc", "macos-base" ], sys_id => "macOS", }, + + ## Catalyst + # Based on + "mac-catalyst-base" => { + inherit_from => [ "all-base" ], + template => 1, +# cflags => add(sub { defined($ENV{'CATALYST_MIN_SDK_VERSION'}) ? '-mmacosx-version-min=$(CATALYST_MIN_SDK_VERSION)' : '-mmacosx-version-min=10.15'; }), + }, + + ## Catalyst (armv7s) + # Based on 10-main.conf: ios-cross + "mac-catalyst-x86_64" => { + inherit_from => [ "darwin64-x86_64-cc", "mac-catalyst-base" ], + cflags => add("-target x86_64-apple-ios13.0-macabi"), + sys_id => "MacOSX", + }, + ); diff --git a/create-openssl-framework.sh b/create-openssl-framework.sh index 8506d10d..8be12fe1 100755 --- a/create-openssl-framework.sh +++ b/create-openssl-framework.sh @@ -1,28 +1,52 @@ #!/bin/bash set -euo pipefail +set -x +# Determine script directory +SCRIPTDIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) -if [ $# == 0 ]; then - echo "Usage: `basename $0` static|dynamic" - exit 1 -fi -if [ ! -d lib ]; then - echo "Please run build-libssl.sh first!" - exit 1 -fi +# System types we support. Note the matching directories in assets, and that these are +# used as prefixes for many operations of this script. +ALL_SYSTEMS=("iPhone" "AppleTV" "MacOSX" "Watch" "Catalyst") + + +# Minimum SDK versions to build for +source "${SCRIPTDIR}/scripts/min-sdk-versions.sh" -FWTYPE=$1 -FWNAME=openssl -FWROOT=frameworks -if [ -d $FWROOT ]; then - echo "Removing previous $FWNAME.framework copies" - rm -rf $FWROOT -fi -ALL_SYSTEMS=("iPhone" "AppleTV" "MacOSX" "WatchOS") +# +# Output help information. +# +echo_help() +{ + cat <