mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
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 <dirk@hohndel.org>
This commit is contained in:
parent
a3435e87df
commit
f1baa575e6
2 changed files with 3 additions and 85 deletions
|
@ -112,15 +112,12 @@ SOURCES += ../../../subsurface-mobile-main.cpp \
|
||||||
|
|
||||||
RESOURCES += qml.qrc ../../../subsurface.qrc ../../../mobile-widgets/qml/mobile-resources.qrc translations.qrc
|
RESOURCES += qml.qrc ../../../subsurface.qrc ../../../mobile-widgets/qml/mobile-resources.qrc translations.qrc
|
||||||
|
|
||||||
LIBS += ../install-root/lib/libcrypto.a \
|
LIBS += ../install-root/lib/libdivecomputer.a \
|
||||||
../install-root/lib/libdivecomputer.a \
|
|
||||||
../install-root/lib/libgit2.a \
|
../install-root/lib/libgit2.a \
|
||||||
../install-root/lib/libsqlite3.a \
|
../install-root/lib/libsqlite3.a \
|
||||||
../install-root/lib/libzip.a \
|
../install-root/lib/libzip.a \
|
||||||
../install-root/lib/libxslt.a \
|
../install-root/lib/libxslt.a \
|
||||||
../install-root/lib/libxml2.a \
|
../install-root/lib/libxml2.a \
|
||||||
../install-root/lib/libssh2.a \
|
|
||||||
../install-root/lib/libssl.a \
|
|
||||||
-liconv
|
-liconv
|
||||||
|
|
||||||
INCLUDEPATH += ../install-root/include/ \
|
INCLUDEPATH += ../install-root/include/ \
|
||||||
|
|
|
@ -16,8 +16,6 @@ LIBXML2_VERSION=2.9.2
|
||||||
LIBXSLT_VERSION=1.1.28
|
LIBXSLT_VERSION=1.1.28
|
||||||
LIBZIP_VERSION=0.11.2
|
LIBZIP_VERSION=0.11.2
|
||||||
LIBGIT2_VERSION=0.23.4
|
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
|
# not on iOS so far, but kept here for completeness
|
||||||
LIBUSB_VERSION=1.0.19
|
LIBUSB_VERSION=1.0.19
|
||||||
|
@ -118,7 +116,7 @@ echo next building for $ARCH
|
||||||
# so let's hack around that
|
# so let's hack around that
|
||||||
make libsqlite3.la
|
make libsqlite3.la
|
||||||
touch sqlite3
|
touch sqlite3
|
||||||
make install
|
make install-libLTLIBRARIES
|
||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -175,79 +173,6 @@ echo next building for $ARCH
|
||||||
popd
|
popd
|
||||||
fi
|
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
|
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
|
wget -O libgit2-${LIBGIT2_VERSION}.tar.gz https://github.com/libgit2/libgit2/archive/v${LIBGIT2_VERSION}.tar.gz
|
||||||
fi
|
fi
|
||||||
|
@ -266,11 +191,7 @@ echo next building for $ARCH
|
||||||
-DCMAKE_INSTALL_PREFIX=${PREFIX} \
|
-DCMAKE_INSTALL_PREFIX=${PREFIX} \
|
||||||
-DCMAKE_PREFIX_PATH=${PREFIX} \
|
-DCMAKE_PREFIX_PATH=${PREFIX} \
|
||||||
-DCURL=OFF \
|
-DCURL=OFF \
|
||||||
-DUSE_SSH=ON \
|
-DUSE_SSH=OFF \
|
||||||
-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 \
|
|
||||||
../libgit2-${LIBGIT2_VERSION}/
|
../libgit2-${LIBGIT2_VERSION}/
|
||||||
make
|
make
|
||||||
make install
|
make install
|
||||||
|
|
Loading…
Reference in a new issue