diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..bb4070e --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Bochun Bai + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/build_libcurl_dist.sh b/build_libcurl_dist.sh index 3c361a3..d16c20b 100755 --- a/build_libcurl_dist.sh +++ b/build_libcurl_dist.sh @@ -6,15 +6,9 @@ DIST_DIR=${DIST_DIR:-$DFT_DIST_DIR} function check_curl_ver() { echo "#include \"include/curl/curlver.h\" -#if LIBCURL_VERSION_MAJOR < 7 || LIBCURL_VERSION_MINOR < 40 +#if LIBCURL_VERSION_MAJOR < 7 || LIBCURL_VERSION_MINOR < 55 #error Required curl 7.40.0+; See http://curl.haxx.se/docs/adv_20150108A.html -#endif"|gcc -c -o /dev/null -xc -||exit 9 - -echo "#include \"include/curl/curlver.h\" -#if LIBCURL_VERSION_MAJOR == 7 && LIBCURL_VERSION_MINOR <= 52 && LIBCURL_VERSION_PATCH <= 1 -#warning curl 7.52.1 have an issue build with darwinssl; See patch here: https://github.com/curl/curl/commit/8db3afe16c0916ea5acf6aed6e7cf02f06cc8677 -#warning For 7.52.1 is the latest release version, the patch commited just one day later than release cut. I can't automatically apply the patch for you. -#warning Please patch it with: patch -p1 < darwinssl-fix-iOS-build.patch +#error Supported minimal version is 7.55.0 for header file changes, see Issue #12 (https://github.com/sinofool/build-libcurl-ios/issues/12) #endif"|gcc -c -o /dev/null -xc -||exit 9 } @@ -58,12 +52,7 @@ ${DEVROOT}/usr/bin/lipo \ -arch arm64 ${TMP_DIR}/arm64/lib/libcurl.a \ -output ${TMP_DIR}/lib/libcurl.a -create -# -arch armv7 ${TMP_DIR}/armv7/lib/libcurl.a \ -# -arch i386 ${TMP_DIR}/i386/lib/libcurl.a \ - -cp -r ${TMP_DIR}/armv7s/include ${TMP_DIR}/ -curl -O https://raw.githubusercontent.com/sinofool/build-libcurl-ios/master/patch-include.patch -patch ${TMP_DIR}/include/curl/curlbuild.h < patch-include.patch +cp -r ${TMP_DIR}/arm64/include ${TMP_DIR}/ mkdir -p ${DIST_DIR} cp -r ${TMP_DIR}/include ${TMP_DIR}/lib ${DIST_DIR} diff --git a/darwinssl-fix-iOS-build.patch b/darwinssl-fix-iOS-build.patch deleted file mode 100644 index fa0aac9..0000000 --- a/darwinssl-fix-iOS-build.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 8db3afe16c0916ea5acf6aed6e7cf02f06cc8677 Mon Sep 17 00:00:00 2001 -From: Chris Araman -Date: Thu, 22 Dec 2016 18:27:17 -0800 -Subject: [PATCH] darwinssl: fix iOS build - -Reviewed-by: Nick Zitzmann -Fixes #1172 ---- - lib/vtls/darwinssl.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/lib/vtls/darwinssl.c b/lib/vtls/darwinssl.c -index a43e391..2146b56 100644 ---- a/lib/vtls/darwinssl.c -+++ b/lib/vtls/darwinssl.c -@@ -936,7 +936,11 @@ static OSStatus CopyIdentityWithLabel(char *label, - (SecIdentityRef) CFArrayGetValueAtIndex(keys_list, i); - err = SecIdentityCopyCertificate(*out_cert_and_key, &cert); - if(err == noErr) { -+#if CURL_BUILD_IOS -+ common_name = SecCertificateCopySubjectSummary(cert); -+#else // CURL_BUILD_MAC_10_7 - SecCertificateCopyCommonName(cert, &common_name); -+#endif - if(CFStringCompare(common_name, label_cf, 0) == kCFCompareEqualTo) { - CFRelease(cert); - CFRelease(common_name); --- -2.10.1 (Apple Git-78) - diff --git a/patch-include.patch b/patch-include.patch deleted file mode 100644 index dd8c8e1..0000000 --- a/patch-include.patch +++ /dev/null @@ -1,55 +0,0 @@ -diff armv7s/include/curl/curlbuild.h include/curl/curlbuild.h -135a136,138 -> #ifdef __LP64__ -> /* #undef CURL_PULL_STDINT_H */ -> #else -136a140 -> #endif -142a147,149 -> #ifdef __LP64__ -> /* #undef CURL_PULL_INTTYPES_H */ -> #else -143a151 -> #endif -162a171,173 -> #ifdef __LP64__ -> #define CURL_SIZEOF_LONG 8 -> #else -163a175 -> #endif -174a187,189 -> #ifdef __LP64__ -> #define CURL_TYPEOF_CURL_OFF_T long -> #else -175a191 -> #endif -180a197,199 -> #ifdef __LP64__ -> #define CURL_FORMAT_CURL_OFF_T "ld" -> #else -181a201 -> #endif -183a204,206 -> #ifdef __LP64__ -> #define CURL_FORMAT_CURL_OFF_TU "lu" -> #else -184a208 -> #endif -186a211,213 -> #ifdef __LP64__ -> #define CURL_FORMAT_OFF_T "%ld" -> #else -187a215 -> #endif -192a221,223 -> #ifdef __LP64__ -> #define CURL_SUFFIX_CURL_OFF_T L -> #else -193a225 -> #endif -195a228,230 -> #ifdef __LP64__ -> #define CURL_SUFFIX_CURL_OFF_TU UL -> #else -196a232 -> #endif