From f1baa575e6100f09d0cac14a46c1cf3cee30b9d6 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 11 Oct 2017 05:17:40 -0700 Subject: [PATCH] iOS build: we don't use ssh and can't use OpenSSL On iOS we don't need to enable ssh-based git access - and we can no longer build against OpenSSL (instead use the platform SSL libraries. Signed-off-by: Dirk Hohndel --- .../Subsurface-mobile/Subsurface-mobile.pro | 5 +- packaging/ios/build.sh | 83 +------------------ 2 files changed, 3 insertions(+), 85 deletions(-) diff --git a/packaging/ios/Subsurface-mobile/Subsurface-mobile.pro b/packaging/ios/Subsurface-mobile/Subsurface-mobile.pro index 215da75ea..d705254af 100644 --- a/packaging/ios/Subsurface-mobile/Subsurface-mobile.pro +++ b/packaging/ios/Subsurface-mobile/Subsurface-mobile.pro @@ -112,15 +112,12 @@ SOURCES += ../../../subsurface-mobile-main.cpp \ RESOURCES += qml.qrc ../../../subsurface.qrc ../../../mobile-widgets/qml/mobile-resources.qrc translations.qrc -LIBS += ../install-root/lib/libcrypto.a \ - ../install-root/lib/libdivecomputer.a \ +LIBS += ../install-root/lib/libdivecomputer.a \ ../install-root/lib/libgit2.a \ ../install-root/lib/libsqlite3.a \ ../install-root/lib/libzip.a \ ../install-root/lib/libxslt.a \ ../install-root/lib/libxml2.a \ - ../install-root/lib/libssh2.a \ - ../install-root/lib/libssl.a \ -liconv INCLUDEPATH += ../install-root/include/ \ diff --git a/packaging/ios/build.sh b/packaging/ios/build.sh index 0493d65e5..3fff41d76 100644 --- a/packaging/ios/build.sh +++ b/packaging/ios/build.sh @@ -16,8 +16,6 @@ LIBXML2_VERSION=2.9.2 LIBXSLT_VERSION=1.1.28 LIBZIP_VERSION=0.11.2 LIBGIT2_VERSION=0.23.4 -LIBSSH2_VERSION=1.6.0 -OPENSSL_VERSION=1.0.1p # not on iOS so far, but kept here for completeness LIBUSB_VERSION=1.0.19 @@ -118,7 +116,7 @@ echo next building for $ARCH # so let's hack around that make libsqlite3.la touch sqlite3 - make install + make install-libLTLIBRARIES popd fi @@ -175,79 +173,6 @@ echo next building for $ARCH popd fi - configure_openssl() { - OS=$1 - ARCH=$2 - PLATFORM=$3 - SDK_VERSION=$4 - DEPLOYMENT_VERSION=$5 - - export CROSS_TOP="${PLATFORM}/Developer" - export CROSS_SDK="${OS}${SDK_VERSION}.sdk" - if [ "$ARCH_NAME" == "x86_64" ]; then - ./Configure darwin64-${ARCH}-cc --openssldir="${PREFIX}" --prefix="${PREFIX}" - sed -ie "s!^CFLAG=!CFLAG=-isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} -arch $ARCH -mios-simulator-version-min=${DEPLOYMENT_VERSION} -fembed-bitcode !" "Makefile" - else - ./Configure iphoneos-cross -no-asm --openssldir="${PREFIX}" - sed -ie "s!^CFLAG=!CFLAG=-isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} -arch $ARCH -miphoneos-version-min=${DEPLOYMENT_VERSION} -fembed-bitcode !" "Makefile" - perl -i -pe 's|static volatile sig_atomic_t intr_signal|static volatile int intr_signal|' crypto/ui/ui_openssl.c - fi - } - - build_openssl() - { - ARCH=$1 - SDK=$2 - TYPE=$3 - export BUILD_TOOLS="${DEVELOPER}" - mkdir -p "lib-${TYPE}" - - rm -rf openssl-${OPENSSL_VERSION} - tar xfz openssl-${OPENSSL_VERSION}.tar.gz - pushd . - cd "openssl-${OPENSSL_VERSION}" - #fix header for Swift - sed -ie "s/BIGNUM \*I,/BIGNUM \*i,/g" crypto/rsa/rsa.h - if [ "$TYPE" == "ios" ]; then - if [ "$ARCH" == "x86_64" ]; then - configure_openssl "iPhoneSimulator" $ARCH ${IPHONESIMULATOR_PLATFORM} ${IPHONEOS_SDK_VERSION} ${IPHONEOS_DEPLOYMENT_VERSION} - else - configure_openssl "iPhoneOS" $ARCH ${IPHONEOS_PLATFORM} ${IPHONEOS_SDK_VERSION} ${IPHONEOS_DEPLOYMENT_VERSION} - fi - fi - make - make install_sw - popd - } - - if [ ! -e openssl-${OPENSSL_VERSION}.tar.gz ] ; then - wget -O openssl-${OPENSSL_VERSION}.tar.gz http://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz - fi - if [ ! -e openssl-build-$ARCH ] ; then - tar -zxf openssl-${OPENSSL_VERSION}.tar.gz - mv openssl-${OPENSSL_VERSION} openssl-build-$ARCH - fi - if [ ! -e $PKG_CONFIG_LIBDIR/libssl.pc ] ; then - build_openssl "$ARCH" "${IPHONESIMULATOR_SDK}" "ios" - fi - - if [ ! -e libssh2-${LIBSSH2_VERSION}.tar.gz ] ; then - wget http://www.libssh2.org/download/libssh2-${LIBSSH2_VERSION}.tar.gz - fi - if [ ! -e libssh2-${LIBSSH2_VERSION} ] ; then - tar -zxf libssh2-${LIBSSH2_VERSION}.tar.gz - fi - if [ ! -e $PKG_CONFIG_LIBDIR/libssh2.pc ] ; then - mkdir -p libssh2-build-$ARCH - pushd libssh2-build-$ARCH - ../libssh2-${LIBSSH2_VERSION}/configure --host=${BUILDCHAIN} --prefix=${PREFIX} --enable-static --disable-shared - make - make install - # Patch away pkg-config dependency to zlib, its there, i promise - perl -pi -e 's/^(Requires.private:.*),zlib$/$1 $2/' $PKG_CONFIG_LIBDIR/libssh2.pc - popd - fi - if [ ! -e libgit2-${LIBGIT2_VERSION}.tar.gz ] ; then wget -O libgit2-${LIBGIT2_VERSION}.tar.gz https://github.com/libgit2/libgit2/archive/v${LIBGIT2_VERSION}.tar.gz fi @@ -266,11 +191,7 @@ echo next building for $ARCH -DCMAKE_INSTALL_PREFIX=${PREFIX} \ -DCMAKE_PREFIX_PATH=${PREFIX} \ -DCURL=OFF \ - -DUSE_SSH=ON \ - -DOPENSSL_SSL_LIBRARY=${PREFIX}/lib/libssl.a \ - -DOPENSSL_CRYPTO_LIBRARY=${PREFIX}/lib/libcrypto.a \ - -DOPENSSL_INCLUDE_DIR=${PREFIX}/include/openssl \ - -D_OPENSSL_VERSION=1.0.1p \ + -DUSE_SSH=OFF \ ../libgit2-${LIBGIT2_VERSION}/ make make install