diff --git a/.gitignore b/.gitignore index f4457a7df..19e54b349 100644 --- a/.gitignore +++ b/.gitignore @@ -35,11 +35,6 @@ Subsurface.app !android/**/*.xml build* mobile-widgets/qml/kirigami -packaging/ios/translations/ -packaging/ios/googlemaps* -packaging/ios/install-root* -packaging/ios/lib* -packaging/ios/kirigami -packaging/ios/breeze-icons +packaging/ios/install-root packaging/ios/Info.plist packaging/ios/Qt diff --git a/packaging/ios/Subsurface-mobile.pro b/packaging/ios/Subsurface-mobile.pro index 7686a454b..911557399 100644 --- a/packaging/ios/Subsurface-mobile.pro +++ b/packaging/ios/Subsurface-mobile.pro @@ -109,7 +109,7 @@ LIBS += ./install-root/lib/libdivecomputer.a \ ./install-root/lib/libgit2.a \ ./install-root/lib/libzip.a \ ./install-root/lib/libxslt.a \ - ./googlemaps-build/libqtgeoservices_googlemaps.a \ + ./build-ios/googlemaps-build/libqtgeoservices_googlemaps.a \ -liconv \ -lsqlite3 \ -lxml2 diff --git a/packaging/ios/build.sh b/packaging/ios/build.sh index 6679992a0..7b29fa1ec 100755 --- a/packaging/ios/build.sh +++ b/packaging/ios/build.sh @@ -39,6 +39,9 @@ pushd ${SUBSURFACE_SOURCE}/.. SSRF_CLONE=$(pwd) popd +# prepare build dir +mkdir -p build-ios + IOS_QT=${TOP}/Qt QT_VERSION=$(cd ${IOS_QT}; ls -d [1-9]* | awk -F. '{ printf("%02d.%02d.%02d\n", $1,$2,$3); }' | sort -n | tail -1 | sed -e 's/\.0/\./g;s/^0//') @@ -84,7 +87,7 @@ for ARCH in $ARCHS; do echo next building for $ARCH - INSTALL_ROOT=$TOP/install-root-$ARCH + INSTALL_ROOT=$TOP/build-ios/install-root-$ARCH mkdir -p $INSTALL_ROOT/lib $INSTALL_ROOT/bin $INSTALL_ROOT/include PKG_CONFIG_LIBDIR=$INSTALL_ROOT/lib/pkgconfig @@ -136,8 +139,8 @@ for ARCH in $ARCHS; do autoreconf --install popd if [ ! -e $PKG_CONFIG_LIBDIR/libxslt.pc ] ; then - mkdir -p libxslt-build-$ARCH_NAME - pushd libxslt-build-$ARCH_NAME + mkdir -p build-ios/libxslt-build-$ARCH_NAME + pushd build-ios/libxslt-build-$ARCH_NAME ${SSRF_CLONE}/libxslt/configure --host=${BUILDCHAIN} --prefix=${PREFIX} --without-python --without-crypto --enable-static --disable-shared make make install @@ -145,8 +148,8 @@ for ARCH in $ARCHS; do fi if [ ! -e $PKG_CONFIG_LIBDIR/libzip.pc ] ; then - mkdir -p libzip-build-$ARCH_NAME - pushd libzip-build-$ARCH_NAME + mkdir -p build-ios/libzip-build-$ARCH_NAME + pushd build-ios/libzip-build-$ARCH_NAME ${SSRF_CLONE}/libzip/configure --host=${BUILDCHAIN} --prefix=${PREFIX} --enable-static --disable-shared make make install @@ -159,8 +162,8 @@ for ARCH in $ARCHS; do popd if [ ! -e $PKG_CONFIG_LIBDIR/libgit2.pc ] ; then - mkdir -p libgit2-build-$ARCH - pushd libgit2-build-$ARCH + mkdir -p build-ios/libgit2-build-$ARCH + pushd build-ios/libgit2-build-$ARCH cmake ${SSRF_CLONE}/libgit2 \ -G "Unix Makefiles" \ -DBUILD_SHARED_LIBS="OFF" \ @@ -193,16 +196,16 @@ for ARCH in $ARCHS; do autoreconf --install popd fi - if [ ! -f libdivecomputer-${ARCH}.SHA ] ; then - echo "" > libdivecomputer-${ARCH}.SHA + if [ ! -f build-ios/libdivecomputer-${ARCH}.SHA ] ; then + echo "" > build-ios/libdivecomputer-${ARCH}.SHA fi CURRENT_SHA=$(cd ../../libdivecomputer ; git describe) - PREVIOUS_SHA=$(cat libdivecomputer-${ARCH}.SHA) + PREVIOUS_SHA=$(cat build-ios/libdivecomputer-${ARCH}.SHA) if [ ! "$CURRENT_SHA" = "$PREVIOUS_SHA" ] ; then - echo $CURRENT_SHA > libdivecomputer-${ARCH}.SHA - mkdir -p libdivecomputer-build-$ARCH - pushd libdivecomputer-build-$ARCH - ../../../libdivecomputer/configure --host=${BUILDCHAIN} --prefix=${PREFIX} --enable-static --disable-shared --enable-examples=no --without-libusb --without-hidapi --enable-ble + echo $CURRENT_SHA > build-ios/libdivecomputer-${ARCH}.SHA + mkdir -p build-ios/libdivecomputer-build-$ARCH + pushd build-ios/libdivecomputer-build-$ARCH + ../../../../libdivecomputer/configure --host=${BUILDCHAIN} --prefix=${PREFIX} --enable-static --disable-shared --enable-examples=no --without-libusb --without-hidapi --enable-ble make make install popd @@ -211,19 +214,19 @@ for ARCH in $ARCHS; do done # build googlemaps -mkdir -p googlemaps-build -pushd googlemaps-build +mkdir -p build-ios/googlemaps-build +pushd build-ios/googlemaps-build ${IOS_QT}/${QT_VERSION}/ios/bin/qmake ${SSRF_CLONE}/googlemaps/googlemaps.pro CONFIG+=release make popd # now combine the libraries into fat libraries rm -rf install-root -cp -a install-root-x86_64 install-root +cp -a build-ios/install-root-x86_64 install-root if [ "$TARGET" = "iphoneos" ] ; then pushd install-root/lib for LIB in $(find . -type f -name \*.a); do - lipo ../../install-root-armv7/lib/$LIB ../../install-root-arm64/lib/$LIB ../../install-root-x86_64/lib/$LIB -create -output $LIB + lipo ../../build-ios/install-root-armv7/lib/$LIB ../../build-ios/install-root-arm64/lib/$LIB ../../build-ios/install-root-x86_64/lib/$LIB -create -output $LIB done popd fi @@ -231,16 +234,17 @@ fi pushd ${SUBSURFACE_SOURCE}/translations SRCS=$(ls *.ts | grep -v source) popd -mkdir -p translations +mkdir -p build-ios/translations for src in $SRCS; do - ${IOS_QT}/${QT_VERSION}/ios/bin/lrelease ${SUBSURFACE_SOURCE}/translations/$src -qm translations/${src/.ts/.qm} + ${IOS_QT}/${QT_VERSION}/ios/bin/lrelease ${SUBSURFACE_SOURCE}/translations/$src -qm build-ios/translations/${src/.ts/.qm} done # in order to be able to use xcode without going through Qt Creator # call qmake directly -mkdir -p build-Subsurface-mobile-Qt_$(echo ${QT_VERSION} | tr . _)_for_iOS-${DEBUGRELEASE} -cd build-Subsurface-mobile-Qt_$(echo ${QT_VERSION} | tr . _)_for_iOS-${DEBUGRELEASE} +BUILDX=build-Subsurface-mobile-Qt_$(echo ${QT_VERSION} | tr . _)_for_iOS-${DEBUGRELEASE} +mkdir -p ${BUILDX} +cd ${BUILDX} ${IOS_QT}/${QT_VERSION}/ios/bin/qmake ../Subsurface-mobile.pro \ -spec macx-ios-clang CONFIG+=$TARGET CONFIG+=$TARGET2 CONFIG+=$DRCONFIG diff --git a/packaging/ios/translations.qrc b/packaging/ios/translations.qrc index 43f841814..85d7325f8 100644 --- a/packaging/ios/translations.qrc +++ b/packaging/ios/translations.qrc @@ -1,27 +1,27 @@ - translations/subsurface_bg_BG.qm - translations/subsurface_cs.qm - translations/subsurface_da_DK.qm - translations/subsurface_de_CH.qm - translations/subsurface_de_DE.qm - translations/subsurface_en_GB.qm - translations/subsurface_en_US.qm - translations/subsurface_es_ES.qm - translations/subsurface_et_EE.qm - translations/subsurface_fi_FI.qm - translations/subsurface_fr_FR.qm - translations/subsurface_he.qm - translations/subsurface_it_IT.qm - translations/subsurface_nb_NO.qm - translations/subsurface_nl_NL.qm - translations/subsurface_pl_PL.qm - translations/subsurface_pt_BR.qm - translations/subsurface_pt_PT.qm - translations/subsurface_ro_RO.qm - translations/subsurface_ru_RU.qm - translations/subsurface_sk_SK.qm - translations/subsurface_sv_SE.qm - translations/subsurface_zh_TW.qm + build-ios/translations/subsurface_bg_BG.qm + build-ios/translations/subsurface_cs.qm + build-ios/translations/subsurface_da_DK.qm + build-ios/translations/subsurface_de_CH.qm + build-ios/translations/subsurface_de_DE.qm + build-ios/translations/subsurface_en_GB.qm + build-ios/translations/subsurface_en_US.qm + build-ios/translations/subsurface_es_ES.qm + build-ios/translations/subsurface_et_EE.qm + build-ios/translations/subsurface_fi_FI.qm + build-ios/translations/subsurface_fr_FR.qm + build-ios/translations/subsurface_he.qm + build-ios/translations/subsurface_it_IT.qm + build-ios/translations/subsurface_nb_NO.qm + build-ios/translations/subsurface_nl_NL.qm + build-ios/translations/subsurface_pl_PL.qm + build-ios/translations/subsurface_pt_BR.qm + build-ios/translations/subsurface_pt_PT.qm + build-ios/translations/subsurface_ro_RO.qm + build-ios/translations/subsurface_ru_RU.qm + build-ios/translations/subsurface_sk_SK.qm + build-ios/translations/subsurface_sv_SE.qm + build-ios/translations/subsurface_zh_TW.qm