2015-12-20 14:03:05 +00:00
|
|
|
#!/bin/bash
|
2024-01-02 03:02:09 +00:00
|
|
|
# shellcheck disable=SC2155
|
2016-03-07 01:49:35 +00:00
|
|
|
#
|
|
|
|
# show what you are doing and stop when things break
|
2016-03-06 14:41:11 +00:00
|
|
|
set -x
|
2016-03-06 23:10:54 +00:00
|
|
|
set -e
|
2015-12-20 14:03:05 +00:00
|
|
|
|
2018-04-24 05:07:44 +00:00
|
|
|
DEBUGRELEASE="Release"
|
2024-01-02 03:02:09 +00:00
|
|
|
ARCH="arm64"
|
2018-04-24 05:07:44 +00:00
|
|
|
TARGET="iphoneos"
|
|
|
|
TARGET2="Device"
|
2024-01-02 03:02:09 +00:00
|
|
|
|
2018-04-24 05:07:44 +00:00
|
|
|
# deal with all the command line arguments
|
|
|
|
while [[ $# -gt 0 ]] ; do
|
|
|
|
arg="$1"
|
|
|
|
case $arg in
|
2019-11-03 13:51:57 +00:00
|
|
|
-version)
|
|
|
|
# only update the version info without rebuilding
|
|
|
|
# this is useful when working with Xcode
|
|
|
|
versionOnly="1"
|
|
|
|
;;
|
2018-04-24 05:07:44 +00:00
|
|
|
-debug)
|
|
|
|
# build for debugging
|
|
|
|
DEBUGRELEASE="Debug"
|
|
|
|
;;
|
|
|
|
-simulator)
|
|
|
|
# build for the simulator instead of for a device
|
2024-01-02 03:02:09 +00:00
|
|
|
ARCH="x86_64"
|
2018-04-24 05:07:44 +00:00
|
|
|
TARGET="iphonesimulator"
|
|
|
|
TARGET2="simulator"
|
|
|
|
;;
|
2024-01-02 03:02:09 +00:00
|
|
|
-device)
|
|
|
|
# build for device instead of for the simulator
|
|
|
|
ARCH="arm64"
|
|
|
|
;;
|
2018-06-10 08:16:23 +00:00
|
|
|
-all)
|
|
|
|
# build both debug and release for all devices
|
|
|
|
DEBUGRELEASE="All"
|
|
|
|
;;
|
2022-08-29 22:39:54 +00:00
|
|
|
-quick)
|
|
|
|
# don't rebuild googlemaps and kirigami
|
|
|
|
QUICK="1"
|
|
|
|
;;
|
2018-04-24 05:07:44 +00:00
|
|
|
*)
|
|
|
|
echo "Unknown command line argument $arg"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
2018-04-23 16:27:04 +00:00
|
|
|
|
2016-03-07 01:49:35 +00:00
|
|
|
# set up easy to use variables with the important paths
|
2020-11-19 03:19:08 +00:00
|
|
|
pushd "$(dirname "$0")/../../"
|
|
|
|
export SUBSURFACE_SOURCE=$PWD
|
|
|
|
cd ..
|
|
|
|
export PARENT_DIR=$PWD
|
2018-06-08 14:24:16 +00:00
|
|
|
popd
|
|
|
|
|
2024-01-02 03:02:09 +00:00
|
|
|
IOS_QT=${IOS_QT:-~/Qt}
|
|
|
|
if [ -z "$QT_VERSION" ] ; then
|
|
|
|
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//')
|
|
|
|
fi
|
|
|
|
if [ -z "$QT_VERSION" ] ; then
|
2017-12-06 03:38:42 +00:00
|
|
|
echo "Couldn't determine Qt version; giving up"
|
|
|
|
exit 1
|
|
|
|
fi
|
2015-12-20 21:53:53 +00:00
|
|
|
|
2024-01-02 03:02:09 +00:00
|
|
|
# Xcode / SDK 14 and later trigger a bug in Qt 5.15
|
|
|
|
QMAKE="${IOS_QT}/${QT_VERSION}/ios/bin/qmake"
|
|
|
|
if [[ $QT_VERSION = 5.15* ]] ; then
|
|
|
|
QMAKEARG=" -early QMAKE_DEFAULT_LIBDIRS=$(xcrun -show-sdk-path)/usr/lib"
|
|
|
|
|
|
|
|
# also, one Python script in Qt 5.15 still references the unversioned Python interpreter;
|
|
|
|
# let's fix that...
|
|
|
|
if ! grep -q /usr/bin/python3 "${IOS_QT}/${QT_VERSION}/ios/mkspecs/features/uikit/devices.py" ; then
|
|
|
|
sed -i.bak 's/\/usr\/bin\/python/\/usr\/bin\/python3/' "${IOS_QT}/${QT_VERSION}/ios/mkspecs/features/uikit/devices.py"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2016-03-07 01:49:35 +00:00
|
|
|
# set up the Subsurface versions by hand
|
2023-12-07 12:00:32 +00:00
|
|
|
GITVERSION=$(cd "$SUBSURFACE_SOURCE" ; git describe --match "v[0-9]*" --abbrev=12)
|
2024-01-02 03:02:09 +00:00
|
|
|
CANONICALVERSION=$(echo "$GITVERSION" | sed -e 's/-g.*$// ; s/^v//' | sed -e 's/-/./')
|
2020-12-12 01:15:39 +00:00
|
|
|
echo "#define GIT_VERSION_STRING \"$GITVERSION\"" > "$SUBSURFACE_SOURCE"/ssrf-version.h
|
|
|
|
echo "#define CANONICAL_VERSION_STRING \"$CANONICALVERSION\"" >> "$SUBSURFACE_SOURCE"/ssrf-version.h
|
2016-03-07 01:49:35 +00:00
|
|
|
|
2018-05-10 15:55:09 +00:00
|
|
|
BUNDLE=org.subsurface-divelog.subsurface-mobile
|
|
|
|
if [ "${IOS_BUNDLE_PRODUCT_IDENTIFIER}" != "" ] ; then
|
2018-05-11 06:01:02 +00:00
|
|
|
BUNDLE=${IOS_BUNDLE_PRODUCT_IDENTIFIER}
|
2018-05-10 15:55:09 +00:00
|
|
|
fi
|
|
|
|
|
2020-11-19 03:19:08 +00:00
|
|
|
pushd "$SUBSURFACE_SOURCE"/packaging/ios
|
2016-03-14 13:59:04 +00:00
|
|
|
# create Info.plist with the correct versions
|
2024-01-02 03:02:09 +00:00
|
|
|
# shellcheck disable=SC2002
|
2024-01-03 03:59:18 +00:00
|
|
|
cat Info.plist.in | sed "s/@CANONICAL_VERSION@/$CANONICALVERSION/;s/@PRODUCT_BUNDLE_IDENTIFIER@/$BUNDLE/" > Info.plist
|
2016-03-14 13:59:04 +00:00
|
|
|
|
2020-11-19 03:19:08 +00:00
|
|
|
popd
|
2019-11-03 13:51:57 +00:00
|
|
|
if [ "$versionOnly" = "1" ] ; then
|
2017-11-30 05:53:11 +00:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2020-04-02 16:59:25 +00:00
|
|
|
pushd "$SUBSURFACE_SOURCE"
|
2016-08-14 22:48:48 +00:00
|
|
|
bash scripts/mobilecomponents.sh
|
|
|
|
popd
|
|
|
|
|
2016-03-07 01:49:35 +00:00
|
|
|
|
|
|
|
# now build all the dependencies for the three relevant architectures (x86_64 is for the simulator)
|
|
|
|
|
2018-06-06 11:53:22 +00:00
|
|
|
# get all 3rd part libraries
|
2020-11-19 03:19:08 +00:00
|
|
|
"$SUBSURFACE_SOURCE"/scripts/get-dep-lib.sh ios "$PARENT_DIR"
|
2018-06-06 11:53:22 +00:00
|
|
|
|
2022-08-29 22:39:54 +00:00
|
|
|
if [ "$QUICK" != "1" ] ; then
|
|
|
|
|
2024-01-02 03:02:09 +00:00
|
|
|
echo "building dependencies for $ARCH"
|
2016-03-07 01:49:35 +00:00
|
|
|
|
2024-01-02 03:02:09 +00:00
|
|
|
INSTALL_ROOT="${PARENT_DIR}/install-root/ios/${ARCH}"
|
|
|
|
mkdir -p "${INSTALL_ROOT}/lib" "${INSTALL_ROOT}/bin" "${INSTALL_ROOT}/include"
|
|
|
|
PKG_CONFIG_LIBDIR="${INSTALL_ROOT}/lib/pkgconfig"
|
2016-03-07 01:49:35 +00:00
|
|
|
|
|
|
|
declare -x PKG_CONFIG_PATH=$PKG_CONFIG_LIBDIR
|
|
|
|
declare -x PREFIX=$INSTALL_ROOT
|
|
|
|
|
|
|
|
if [ "$ARCH" = "x86_64" ] ; then
|
|
|
|
declare -x SDK_NAME="iphonesimulator"
|
2020-11-19 03:19:08 +00:00
|
|
|
declare -x TOOLCHAIN_FILE="$SUBSURFACE_SOURCE/packaging/ios/iPhoneSimulatorCMakeToolchain"
|
2016-03-07 01:49:35 +00:00
|
|
|
declare -x IOS_PLATFORM=SIMULATOR64
|
|
|
|
declare -x BUILDCHAIN=x86_64-apple-darwin
|
2016-03-06 23:10:54 +00:00
|
|
|
else
|
2016-03-07 01:49:35 +00:00
|
|
|
declare -x SDK_NAME="iphoneos"
|
2020-11-19 03:19:08 +00:00
|
|
|
declare -x TOOLCHAIN_FILE="$SUBSURFACE_SOURCE/packaging/ios/iPhoneDeviceCMakeToolchain"
|
2016-03-07 01:49:35 +00:00
|
|
|
declare -x IOS_PLATFORM=OS
|
|
|
|
declare -x BUILDCHAIN=arm-apple-darwin
|
|
|
|
fi
|
|
|
|
declare -x ARCH_NAME=$ARCH
|
|
|
|
declare -x SDK=$SDK_NAME
|
2020-04-02 16:59:25 +00:00
|
|
|
declare -x SDK_DIR=$(xcrun --sdk $SDK_NAME --show-sdk-path)
|
|
|
|
declare -x PLATFORM_DIR=$(xcrun --sdk $SDK_NAME --show-sdk-platform-path)
|
2016-03-07 01:49:35 +00:00
|
|
|
|
2020-04-02 16:59:25 +00:00
|
|
|
declare -x CC=$(xcrun -sdk $SDK_NAME -find clang)
|
|
|
|
declare -x CXX=$(xcrun -sdk $SDK_NAME -find clang++)
|
|
|
|
declare -x LD=$(xcrun -sdk $SDK_NAME -find ld)
|
2022-08-29 23:09:46 +00:00
|
|
|
declare -x CFLAGS="-arch $ARCH_NAME -isysroot $SDK_DIR -miphoneos-version-min=12.0 -I$SDK_DIR/usr/include -fembed-bitcode"
|
2016-03-07 01:49:35 +00:00
|
|
|
declare -x CXXFLAGS="$CFLAGS"
|
2018-05-08 15:27:29 +00:00
|
|
|
declare -x LDFLAGS="$CFLAGS -lsqlite3 -lpthread -lc++ -L$SDK_DIR/usr/lib -fembed-bitcode"
|
2016-03-07 01:49:35 +00:00
|
|
|
|
|
|
|
# openssl build stuff.
|
2024-01-02 03:02:09 +00:00
|
|
|
export DEVELOPER=$(xcode-select --print-path)
|
|
|
|
export IPHONEOS_DEPLOYMENT_VERSION="12.0"
|
|
|
|
if [ "$ARCH" = "arm64" ] ; then
|
|
|
|
export IPHONEOS_SDK_VERSION=$(xcrun --sdk iphoneos --show-sdk-version)
|
|
|
|
export IPHONEOS_PLATFORM=$(xcrun --sdk iphoneos --show-sdk-platform-path)
|
|
|
|
export IPHONEOS_SDK=$(xcrun --sdk iphoneos --show-sdk-path)
|
|
|
|
export IPHONESIMULATOR_PLATFORM=""
|
|
|
|
export IPHONESIMULATOR_SDK=""
|
|
|
|
else
|
|
|
|
export IPHONEOS_SDK_VERSION=""
|
|
|
|
export IPHONEOS_PLATFORM=""
|
|
|
|
export IPHONEOS_SDK=""
|
|
|
|
export IPHONESIMULATOR_PLATFORM=$(xcrun --sdk iphonesimulator --show-sdk-platform-path)
|
|
|
|
export IPHONESIMULATOR_SDK=$(xcrun --sdk iphonesimulator --show-sdk-path)
|
|
|
|
fi
|
2016-03-07 01:49:35 +00:00
|
|
|
export OSX_SDK_VERSION=$(xcrun --sdk macosx --show-sdk-version)
|
2024-01-02 03:02:09 +00:00
|
|
|
export OSX_DEPLOYMENT_VERSION="11.0"
|
2016-03-07 01:49:35 +00:00
|
|
|
export OSX_PLATFORM=$(xcrun --sdk macosx --show-sdk-platform-path)
|
|
|
|
export OSX_SDK=$(xcrun --sdk macosx --show-sdk-path)
|
|
|
|
|
2020-04-02 16:36:44 +00:00
|
|
|
# build libxml2 and libxslt
|
|
|
|
if [ ! -e "$PKG_CONFIG_LIBDIR"/libxml-2.0.pc ] ; then
|
|
|
|
if [ ! -e "$PARENT_DIR"/libxml2/configure ] ; then
|
|
|
|
pushd "$PARENT_DIR"/libxml2
|
|
|
|
autoreconf --install
|
|
|
|
popd
|
|
|
|
fi
|
|
|
|
mkdir -p "$PARENT_DIR"/libxml2-build-"$ARCH"
|
|
|
|
pushd "$PARENT_DIR"/libxml2-build-"$ARCH"
|
2020-04-02 19:04:11 +00:00
|
|
|
"$PARENT_DIR"/libxml2/configure --host=${BUILDCHAIN} --prefix="$PREFIX" --without-lzma --without-python --without-iconv --enable-static --disable-shared
|
2020-04-02 16:36:44 +00:00
|
|
|
perl -pi -e 's/runtest\$\(EXEEXT\)//' Makefile
|
|
|
|
perl -pi -e 's/testrecurse\$\(EXEEXT\)//' Makefile
|
2024-01-02 03:02:09 +00:00
|
|
|
make -j
|
2020-04-02 16:36:44 +00:00
|
|
|
make install
|
|
|
|
popd
|
|
|
|
fi
|
2016-03-07 01:49:35 +00:00
|
|
|
|
2020-04-02 16:36:44 +00:00
|
|
|
# the config.sub in libxslt is too old
|
2020-04-02 16:59:25 +00:00
|
|
|
pushd "$PARENT_DIR"/libxslt
|
2018-05-09 04:53:11 +00:00
|
|
|
autoreconf --install
|
|
|
|
popd
|
2020-04-02 16:59:25 +00:00
|
|
|
if [ ! -e "$PKG_CONFIG_LIBDIR"/libxslt.pc ] ; then
|
2024-01-02 03:02:09 +00:00
|
|
|
mkdir -p "${PARENT_DIR}/libxslt-build-${ARCH}"
|
|
|
|
pushd "${PARENT_DIR}/libxslt-build-${ARCH}"
|
2020-04-02 19:04:11 +00:00
|
|
|
"$PARENT_DIR"/libxslt/configure --host=$BUILDCHAIN --prefix="$PREFIX" --with-libxml-include-prefix="$INSTALL_ROOT"/include/libxml2 --without-python --without-crypto --enable-static --disable-shared
|
2024-01-02 03:02:09 +00:00
|
|
|
make -j
|
2016-03-07 01:49:35 +00:00
|
|
|
make install
|
|
|
|
popd
|
|
|
|
fi
|
|
|
|
|
2020-04-02 16:59:25 +00:00
|
|
|
if [ ! -e "$PKG_CONFIG_LIBDIR"/libzip.pc ] ; then
|
|
|
|
pushd "$PARENT_DIR"/libzip
|
2018-08-06 00:31:55 +00:00
|
|
|
# don't waste time on building command line tools, examples, manual, and regression tests - and don't build the BZIP2 support we don't need
|
2019-03-20 21:16:56 +00:00
|
|
|
sed -i.bak 's/ADD_SUBDIRECTORY(src)//;s/ADD_SUBDIRECTORY(examples)//;s/ADD_SUBDIRECTORY(man)//;s/ADD_SUBDIRECTORY(regress)//' CMakeLists.txt
|
2024-01-02 03:02:09 +00:00
|
|
|
mkdir -p "${PARENT_DIR}/libzip-build-${ARCH}"
|
|
|
|
pushd "${PARENT_DIR}/libzip-build-${ARCH}"
|
2018-08-04 21:36:58 +00:00
|
|
|
cmake -DBUILD_SHARED_LIBS="OFF" \
|
|
|
|
-DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN_FILE" \
|
2020-04-02 16:59:25 +00:00
|
|
|
-DCMAKE_INSTALL_PREFIX="$PREFIX" \
|
|
|
|
-DCMAKE_PREFIX_PATH="$PREFIX" \
|
2019-03-20 21:16:56 +00:00
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_BZip2=TRUE \
|
2019-11-03 12:14:43 +00:00
|
|
|
-DENABLE_OPENSSL=FALSE \
|
|
|
|
-DENABLE_GNUTLS=FALSE \
|
2024-01-02 03:02:09 +00:00
|
|
|
"${PARENT_DIR}/libzip"
|
2018-08-06 00:31:55 +00:00
|
|
|
# quiet the super noise warnings
|
|
|
|
sed -i.bak 's/C_FLAGS = /C_FLAGS = -Wno-nullability-completeness -Wno-expansion-to-defined /' lib/CMakeFiles/zip.dir/flags.make
|
2024-01-02 03:02:09 +00:00
|
|
|
make -j
|
2016-03-07 01:49:35 +00:00
|
|
|
make install
|
|
|
|
popd
|
2018-08-06 00:31:55 +00:00
|
|
|
mv CMakeLists.txt.bak CMakeLists.txt
|
|
|
|
popd
|
2016-03-07 01:49:35 +00:00
|
|
|
fi
|
|
|
|
|
2020-04-02 16:59:25 +00:00
|
|
|
pushd "$PARENT_DIR"/libgit2
|
2018-05-09 04:53:11 +00:00
|
|
|
# libgit2 with -Wall on iOS creates megabytes of warnings...
|
|
|
|
sed -i.bak 's/ADD_C_FLAG_IF_SUPPORTED(-W/# ADD_C_FLAG_IF_SUPPORTED(-W/' CMakeLists.txt
|
|
|
|
popd
|
|
|
|
|
2024-01-02 03:02:09 +00:00
|
|
|
if [ ! -e "${PKG_CONFIG_LIBDIR}/libgit2.pc" ] ; then
|
|
|
|
mkdir -p "${PARENT_DIR}/libgit2-build-${ARCH}"
|
|
|
|
pushd "${PARENT_DIR}/libgit2-build-${ARCH}"
|
|
|
|
cmake "${PARENT_DIR}/libgit2" \
|
2016-03-07 01:49:35 +00:00
|
|
|
-G "Unix Makefiles" \
|
|
|
|
-DBUILD_SHARED_LIBS="OFF" \
|
|
|
|
-DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN_FILE" \
|
|
|
|
-DSHA1_TYPE=builtin \
|
|
|
|
-DBUILD_CLAR=OFF \
|
2020-04-02 16:59:25 +00:00
|
|
|
-DCMAKE_INSTALL_PREFIX="$PREFIX" \
|
|
|
|
-DCMAKE_PREFIX_PATH="$PREFIX" \
|
2016-03-07 01:49:35 +00:00
|
|
|
-DCURL=OFF \
|
2017-10-11 12:17:40 +00:00
|
|
|
-DUSE_SSH=OFF \
|
2024-01-02 03:02:09 +00:00
|
|
|
"${PARENT_DIR}/libgit2/"
|
2020-11-19 03:19:08 +00:00
|
|
|
sed -i.bak 's/C_FLAGS = /C_FLAGS = -Wno-nullability-completeness -Wno-expansion-to-defined /' src/CMakeFiles/git2.dir/flags.make
|
2024-01-02 03:02:09 +00:00
|
|
|
make -j
|
2016-03-07 01:49:35 +00:00
|
|
|
make install
|
|
|
|
# Patch away pkg-config dependency to zlib, its there, i promise
|
2024-01-02 03:02:09 +00:00
|
|
|
perl -pi -e 's/^(Requires.private:.*)zlib(.*)$/$1 $2/' "${PKG_CONFIG_LIBDIR}/libgit2.pc"
|
2016-03-07 01:49:35 +00:00
|
|
|
popd
|
2016-03-06 23:10:54 +00:00
|
|
|
fi
|
2015-12-20 21:53:53 +00:00
|
|
|
|
2024-01-02 03:02:09 +00:00
|
|
|
# build libdivecomputer
|
2020-11-19 03:19:08 +00:00
|
|
|
if [ ! -d "$SUBSURFACE_SOURCE"/libdivecomputer/src ] ; then
|
|
|
|
pushd "$SUBSURFACE_SOURCE"
|
2017-12-04 20:53:43 +00:00
|
|
|
git submodule init
|
2018-05-13 11:09:40 +00:00
|
|
|
git submodule update --recursive
|
2018-05-08 09:23:56 +00:00
|
|
|
popd
|
|
|
|
fi
|
2020-11-19 03:19:08 +00:00
|
|
|
if [ ! -f "$SUBSURFACE_SOURCE"/libdivecomputer/configure ] ; then
|
|
|
|
pushd "$SUBSURFACE_SOURCE"/libdivecomputer
|
2017-12-03 20:58:56 +00:00
|
|
|
autoreconf --install
|
2016-03-07 01:49:35 +00:00
|
|
|
autoreconf --install
|
2017-12-03 20:58:56 +00:00
|
|
|
popd
|
2016-03-07 01:49:35 +00:00
|
|
|
fi
|
2024-01-02 03:02:09 +00:00
|
|
|
mkdir -p "${PARENT_DIR}/libdivecomputer-build-${ARCH}"
|
|
|
|
if [ ! -f "${PARENT_DIR}/libdivecomputer-build-${ARCH}/git.SHA" ] ; then
|
|
|
|
echo "" > "${PARENT_DIR}/libdivecomputer-build-${ARCH}/git.SHA"
|
2018-02-12 20:02:14 +00:00
|
|
|
fi
|
2024-01-02 03:02:09 +00:00
|
|
|
CURRENT_SHA=$(cd "${SUBSURFACE_SOURCE}/libdivecomputer" ; git describe)
|
|
|
|
PREVIOUS_SHA=$(cat "${PARENT_DIR}/libdivecomputer-build-${ARCH}/git.SHA")
|
2018-02-12 20:02:14 +00:00
|
|
|
if [ ! "$CURRENT_SHA" = "$PREVIOUS_SHA" ] ; then
|
2024-01-02 03:02:09 +00:00
|
|
|
echo "$CURRENT_SHA" > "${PARENT_DIR}/libdivecomputer-build-${ARCH}/git.SHA"
|
|
|
|
pushd "${PARENT_DIR}/libdivecomputer-build-${ARCH}"
|
|
|
|
"${SUBSURFACE_SOURCE}/libdivecomputer/configure" --host=${BUILDCHAIN} --prefix="$PREFIX" --enable-static --disable-shared --enable-examples=no --without-libusb --without-hidapi
|
|
|
|
make -j
|
2016-03-07 01:49:35 +00:00
|
|
|
make install
|
|
|
|
popd
|
|
|
|
fi
|
2018-03-13 01:25:12 +00:00
|
|
|
|
2016-03-07 01:49:35 +00:00
|
|
|
|
2024-01-02 03:02:09 +00:00
|
|
|
# build googlemaps
|
|
|
|
mkdir -p "$PARENT_DIR"/googlemaps-build
|
|
|
|
pushd "$PARENT_DIR"/googlemaps-build
|
|
|
|
# yes, shellcheck will complain that we don't enclose QMAKEARG in quotes when we use it
|
|
|
|
# that's intentional so that the command line argument actually works
|
|
|
|
# shellcheck disable=SC2086
|
|
|
|
"$QMAKE" $QMAKEARG "$PARENT_DIR"/googlemaps/googlemaps.pro \
|
|
|
|
-spec macx-ios-clang CONFIG+=$TARGET CONFIG+=$TARGET2 CONFIG+=release
|
2019-11-03 12:15:15 +00:00
|
|
|
make
|
2024-01-02 03:02:09 +00:00
|
|
|
if [ "$DEBUGRELEASE" != "Release" ] ; then
|
|
|
|
# shellcheck disable=SC2086
|
|
|
|
"$QMAKE" $QMAKEARG "$PARENT_DIR"/googlemaps/googlemaps.pro \
|
|
|
|
-spec macx-ios-clang CONFIG+=$TARGET CONFIG+=$TARGET2 CONFIG+=debug
|
|
|
|
make clean
|
|
|
|
make -j
|
|
|
|
fi
|
2022-08-29 22:39:54 +00:00
|
|
|
popd
|
2020-12-12 01:14:34 +00:00
|
|
|
|
2024-01-02 03:02:09 +00:00
|
|
|
# build Kirigami
|
|
|
|
mkdir -p "$PARENT_DIR"/kirigami-release-build
|
|
|
|
pushd "$PARENT_DIR"/kirigami-release-build
|
|
|
|
# shellcheck disable=SC2086
|
|
|
|
"$QMAKE" $QMAKEARG "$SUBSURFACE_SOURCE"/mobile-widgets/3rdparty/kirigami/kirigami.pro \
|
|
|
|
-spec macx-ios-clang CONFIG+=$TARGET CONFIG+=$TARGET2 CONFIG+=release
|
|
|
|
make -j
|
|
|
|
# since the install prefix for qmake is rather weirdly implemented, let's copy things by hand into the multiarch destination
|
|
|
|
mkdir -p "$INSTALL_ROOT"/lib/qml/
|
|
|
|
cp -a org "$INSTALL_ROOT"/lib/qml/
|
2018-04-24 05:07:44 +00:00
|
|
|
popd
|
2024-01-02 03:02:09 +00:00
|
|
|
if [ "$DEBUGRELEASE" != "Release" ] ; then
|
|
|
|
mkdir -p "$PARENT_DIR"/kirigami-debug-build
|
|
|
|
pushd "$PARENT_DIR"/kirigami-debug-build
|
|
|
|
# shellcheck disable=SC2086
|
|
|
|
"$QMAKE" $QMAKEARG "$SUBSURFACE_SOURCE"/mobile-widgets/3rdparty/kirigami/kirigami.pro \
|
|
|
|
-spec macx-ios-clang CONFIG+=$TARGET CONFIG+=$TARGET2 CONFIG+=debug
|
|
|
|
make -j
|
|
|
|
# since the install prefix for qmake is rather weirdly implemented, let's copy things by hand into the multiarch destination
|
|
|
|
mkdir -p "$INSTALL_ROOT"/lib/qml/
|
|
|
|
cp -a org "$INSTALL_ROOT"/lib/qml/
|
|
|
|
popd
|
|
|
|
fi
|
2022-08-29 22:39:54 +00:00
|
|
|
fi
|
|
|
|
|
2020-04-02 16:59:25 +00:00
|
|
|
pushd "$SUBSURFACE_SOURCE"/translations
|
|
|
|
SRCS=$(ls ./*.ts | grep -v source)
|
2016-05-04 20:55:14 +00:00
|
|
|
popd
|
2020-11-19 04:09:53 +00:00
|
|
|
mkdir -p "$SUBSURFACE_SOURCE"/packaging/ios/build-ios/translations
|
2016-05-04 20:55:14 +00:00
|
|
|
for src in $SRCS; do
|
2020-11-19 04:09:53 +00:00
|
|
|
"$IOS_QT"/"$QT_VERSION"/ios/bin/lrelease "$SUBSURFACE_SOURCE"/translations/"$src" -qm "$SUBSURFACE_SOURCE"/packaging/ios/build-ios/translations/"${src/.ts/.qm}"
|
2016-05-04 20:55:14 +00:00
|
|
|
done
|
2017-11-29 14:45:47 +00:00
|
|
|
|
|
|
|
# in order to be able to use xcode without going through Qt Creator
|
|
|
|
# call qmake directly
|
2018-04-24 05:07:44 +00:00
|
|
|
|
2018-06-10 08:16:23 +00:00
|
|
|
if [ "$DEBUGRELEASE" = "All" ] ; then
|
|
|
|
BUILD_LOOP="Debug Release"
|
|
|
|
else
|
|
|
|
BUILD_LOOP=$DEBUGRELEASE
|
|
|
|
fi
|
|
|
|
for BUILD_NOW in $BUILD_LOOP; do
|
|
|
|
echo "Building for $BUILD_NOW"
|
|
|
|
if [ "$BUILD_NOW" == "Debug" ] ; then
|
|
|
|
DRCONFIG="qml_debug"
|
|
|
|
else
|
|
|
|
DRCONFIG="release"
|
|
|
|
fi
|
2020-12-12 01:15:39 +00:00
|
|
|
cd "$PARENT_DIR"
|
2020-04-02 16:59:25 +00:00
|
|
|
BUILDX=build-Subsurface-mobile-Qt_$(echo "$QT_VERSION" | tr . _)_for_iOS-"$BUILD_NOW"
|
|
|
|
mkdir -p "$BUILDX"
|
|
|
|
pushd "$BUILDX"
|
2020-12-12 01:15:39 +00:00
|
|
|
rm -f ssrf-version.h
|
|
|
|
ln -s "$SUBSURFACE_SOURCE"/ssrf-version.h .
|
2024-01-02 03:02:09 +00:00
|
|
|
# shellcheck disable=SC2086
|
2024-01-03 03:46:36 +00:00
|
|
|
"$QMAKE" $QMAKEARG ARCH=$ARCH "$SUBSURFACE_SOURCE"/Subsurface-mobile.pro \
|
2018-06-10 08:16:23 +00:00
|
|
|
-spec macx-ios-clang CONFIG+=$TARGET CONFIG+=$TARGET2 CONFIG+=$DRCONFIG
|
2018-04-24 05:07:44 +00:00
|
|
|
|
2024-01-03 03:46:36 +00:00
|
|
|
# it appears that a first make fails with a missing generated file, which a second
|
|
|
|
# invocation of make will happily build
|
|
|
|
make || make
|
2018-06-10 08:16:23 +00:00
|
|
|
popd
|
|
|
|
done
|