Skip to content

Commit

Permalink
chore: Add support for macOS 10.15 with Qt 6.6.3.
Browse files Browse the repository at this point in the history
  • Loading branch information
iphydf committed Jan 20, 2025
1 parent ef4d7b6 commit ad2e494
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 25 deletions.
20 changes: 12 additions & 8 deletions qtox/build_qtbase_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ set -euxo pipefail
readonly SCRIPT_DIR="$(dirname "$(realpath "$0")")"

source "$SCRIPT_DIR/build_utils.sh"
source "$SCRIPT_DIR/download/version_qt.sh"

parse_arch --dep "qtbase" --supported "macos-arm64 macos-x86_64" "$@"

Expand All @@ -18,27 +17,33 @@ export CXXFLAGS="-DQT_MESSAGELOGCONTEXT"
export OBJCXXFLAGS="$CXXFLAGS"

if [ -n "$SANITIZE" ]; then
QT_SANITIZE=(-sanitize "$CLANG_SANITIZER")
QT_CONFIGURE_FLAGS=(-sanitize "$CLANG_SANITIZER")
BUILD_TYPE=debug
else
QT_SANITIZE=()
QT_CONFIGURE_FLAGS=()
fi

if [ "$BUILD_TYPE" = "debug" ]; then
QT_FORCE_DEBUG_INFO="-force-debug-info"
QT_CONFIGURE_FLAGS+=("-force-debug-info")
else
QT_FORCE_DEBUG_INFO="-no-force-debug-info"
QT_CONFIGURE_FLAGS+=("-no-force-debug-info")
fi

if [ "$MACOS_MINIMUM_SUPPORTED_VERSION" != "10.15" ]; then
QT_CONFIGURE_FLAGS+=("-no-feature-printsupport")
fi

# We want -Werror to catch warnings related to macOS version compatibility.
sed -i '' -e 's/-Wextra/-Wextra -Werror "-Wno-#warnings" -Wno-deprecated-declarations/' cmake/QtCompilerFlags.cmake

mkdir _build && pushd _build
../configure \
--prefix="$QT_PREFIX" \
-appstore-compliant \
-static \
-release \
-force-asserts \
"$QT_FORCE_DEBUG_INFO" \
"${QT_SANITIZE[@]}" \
"${QT_CONFIGURE_FLAGS[@]}" \
-qt-doubleconversion \
-qt-freetype \
-qt-harfbuzz \
Expand All @@ -49,7 +54,6 @@ mkdir _build && pushd _build
-no-feature-androiddeployqt \
-no-feature-brotli \
-no-feature-macdeployqt \
-no-feature-printsupport \
-no-feature-qmake \
-no-feature-sql \
-no-feature-dbus \
Expand Down
8 changes: 6 additions & 2 deletions qtox/build_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

set -euxo pipefail

MACOS_MINIMUM_SUPPORTED_VERSION=10.15

usage() {
# note: this is the usage from the build script's context, so the usage
# doesn't include --dep argument, since that comes from the build script
Expand All @@ -34,6 +32,7 @@ parse_arch() {
BUILD_TYPE=release
SANITIZE=
EXTRA_ARGS=()
MACOS_MINIMUM_SUPPORTED_VERSION=12.0

while (($# > 0)); do
case $1 in
Expand All @@ -57,6 +56,10 @@ parse_arch() {
BUILD_TYPE=$2
shift 2
;;
--macos)
MACOS_MINIMUM_SUPPORTED_VERSION=$2
shift 2
;;
--sanitize)
SANITIZE=$2
shift 2
Expand All @@ -83,6 +86,7 @@ parse_arch() {
done

assert_supported "$SCRIPT_ARCH" "$SUPPORTED"
export MACOS_MINIMUM_SUPPORTED_VERSION

if [ "$SCRIPT_ARCH" == "win32" ] || [ "$SCRIPT_ARCH" == "win64" ]; then
if [ "$SCRIPT_ARCH" == "win32" ]; then
Expand Down
2 changes: 0 additions & 2 deletions qtox/download/download_qtbase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

set -euo pipefail

QTBASE_HASH=40b14562ef3bd779bc0e0418ea2ae08fa28235f8ea6e8c0cb3bce1d6ad58dcaf

source "$(dirname "$(realpath "$0")")/common.sh"
source "$(dirname "$(realpath "$0")")/version_qt.sh"

Expand Down
2 changes: 0 additions & 2 deletions qtox/download/download_qtimageformats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

set -euo pipefail

QTIMAGEFORMATS_HASH=138cc2909aa98f5ff7283e36eb3936eb5e625d3ca3b4febae2ca21d8903dd237

source "$(dirname "$(realpath "$0")")/common.sh"
source "$(dirname "$(realpath "$0")")/version_qt.sh"

Expand Down
2 changes: 0 additions & 2 deletions qtox/download/download_qtremoteobjects.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

set -euo pipefail

QTREMOTEOBJECTS_HASH=7ef2870f05614b71d1cfdd7ac12acef5294abc43da244a6e9e411f21208f59f8

source "$(dirname "$(realpath "$0")")/common.sh"
source "$(dirname "$(realpath "$0")")/version_qt.sh"

Expand Down
2 changes: 0 additions & 2 deletions qtox/download/download_qtsvg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

set -euo pipefail

QTSVG_HASH=3d0de73596e36b2daa7c48d77c4426bb091752856912fba720215f756c560dd0

source "$(dirname "$(realpath "$0")")/common.sh"
source "$(dirname "$(realpath "$0")")/version_qt.sh"

Expand Down
2 changes: 0 additions & 2 deletions qtox/download/download_qttools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

set -euo pipefail

QTTOOLS_HASH=9d43d409be08b8681a0155a9c65114b69c9a3fc11aef6487bb7fdc5b283c432d

source "$(dirname "$(realpath "$0")")/common.sh"
source "$(dirname "$(realpath "$0")")/version_qt.sh"

Expand Down
2 changes: 0 additions & 2 deletions qtox/download/download_qtwayland.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

set -euo pipefail

QTWAYLAND_HASH=2226fbde4e2ddd12f8bf4b239c8f38fd706a54e789e63467dfddc77129eca203

source "$(dirname "$(realpath "$0")")/common.sh"
source "$(dirname "$(realpath "$0")")/version_qt.sh"

Expand Down
32 changes: 29 additions & 3 deletions qtox/download/version_qt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,33 @@
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright © 2024-2025 The TokTok team

QT_VERSION="6.8.1"
# shellcheck disable=SC2034

QT_MAJOR=6
QT_MINOR=8
QT_PATCH=1

if [ "$MACOS_MINIMUM_SUPPORTED_VERSION" = "10.15" ]; then
QT_MINOR=6
QT_PATCH=3

QTBASE_HASH=0493fd0b380c4edf8872f011a7f26d245aa4cdd75b349904ef340a22dedf7462
QTIMAGEFORMATS_HASH="3ca5ea60176603ce6ffc1bff59a4dcea139375233ce8e5e86c38f4e84c44627c"
QTREMOTEOBJECTS_HASH="???"
QTSVG_HASH=4acb1e576eca55e955cf2b0d15c914a200df290e737accd7c1901fa1e33a25c7
QTTOOLS_HASH=aa6d4c822d8cb74066ef30ab42283ac24e5cc702f33e6d78a9ebef5b0df91bc0
QTWAYLAND_HASH="???"
elif [ "$MACOS_MINIMUM_SUPPORTED_VERSION" = "12.0" ]; then
QT_MINOR=8
QT_PATCH=1

QTBASE_HASH=40b14562ef3bd779bc0e0418ea2ae08fa28235f8ea6e8c0cb3bce1d6ad58dcaf
QTIMAGEFORMATS_HASH=138cc2909aa98f5ff7283e36eb3936eb5e625d3ca3b4febae2ca21d8903dd237
QTREMOTEOBJECTS_HASH=7ef2870f05614b71d1cfdd7ac12acef5294abc43da244a6e9e411f21208f59f8
QTSVG_HASH=3d0de73596e36b2daa7c48d77c4426bb091752856912fba720215f756c560dd0
QTTOOLS_HASH=9d43d409be08b8681a0155a9c65114b69c9a3fc11aef6487bb7fdc5b283c432d
QTWAYLAND_HASH=2226fbde4e2ddd12f8bf4b239c8f38fd706a54e789e63467dfddc77129eca203
else
echo "Unsupported macOS version: $MACOS_MINIMUM_SUPPORTED_VERSION"
exit 1
fi

QT_VERSION="$QT_MAJOR.$QT_MINOR.$QT_PATCH"

0 comments on commit ad2e494

Please sign in to comment.