Skip to content

Commit c64d2db

Browse files
committed
Add qt6-qtlottie as a build dep
1 parent 2d37cfd commit c64d2db

16 files changed

Lines changed: 38 additions & 8754 deletions

File tree

.github/workflows/wasm_tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
shell: bash
4949
run: |
5050
# Qt for wasm needs the desktop linux installation
51-
python -m aqt install-qt -O /opt linux desktop $QTVERSION linux_gcc_64 -m qtshadertools
51+
python -m aqt install-qt -O /opt linux desktop $QTVERSION linux_gcc_64 -m qtshadertools qtlottie
5252
python -m aqt install-qt -O /opt all_os wasm $QTVERSION wasm_singlethread -m qtwebsockets qtshadertools
5353
5454
- name: Setup emsdk

linux/debian/control

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ Build-Depends: debhelper (>= 13),
5353
qt6-declarative-dev (>=6.2.0~),
5454
qt6-declarative-private-dev (>=6.2.0~),
5555
qt6-declarative-dev-tools (>=6.2.0~),
56+
qt6-lottie-dev (>=6.2.0~),
5657
qt6-l10n-tools (>=6.2.0~),
5758
qt6-tools-dev-tools (>=6.2.0~),
5859
qt6-websockets-dev (>=6.2.0~) | libqt6websockets6-dev (>=6.2.0~)
@@ -98,6 +99,7 @@ Depends: wireguard (>=1.0.20200319),
9899
qml6-module-qtquick-templates (>=6.2.0~),
99100
qml6-module-qtquick-window (>=6.2.0~),
100101
qml6-module-qtquick-shapes (>=6.2.0~),
102+
qml6-module-qt-labs-lottieqt (>=6.2.0~),
101103
qml6-module-qtqml (>=6.2.0~),
102104
qml6-module-qtqml-models (>=6.2.0~),
103105
qml6-module-qtqml-workerscript (>=6.2.0~),

linux/mozillavpn.spec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Requires: qt6-qtbase >= 6.0
1414
Requires: qt6-qtnetworkauth >= 6.0
1515
Requires: qt6-qtquickcontrols2 >= 6.0
1616
Requires: qt6-qtsvg >= 6.0
17+
Requires: qt6-qtlottie >= 6.0
1718
Requires: wireguard-tools
1819

1920
BuildRequires: cmake
@@ -29,6 +30,7 @@ BuildRequires: qt6-qtbase-devel >= 6.0
2930
BuildRequires: qt6-qtbase-private-devel >= 6.0
3031
BuildRequires: qt6-qtnetworkauth-devel >= 6.0
3132
BuildRequires: qt6-qtdeclarative-devel >= 6.0
33+
BuildRequires: qt6-qtlottie-devel >= 6.0
3234
BuildRequires: qt6-qtsvg-devel >= 6.0
3335
BuildRequires: qt6-qttools-devel >= 6.0
3436
BuildRequires: qt6-qtwebsockets-devel >= 6.0

scripts/android/conda_setup_qt.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ fi
4242
export QT_DIR=$CONDA_PREFIX/Qt
4343

4444
# QT_Host Tools
45-
echo "aqt install-qt --outputdir $QT_DIR $HOST_TARGET"
46-
python -m aqt install-qt --outputdir $QT_DIR $HOST_TARGET
45+
echo "aqt install-qt --outputdir $QT_DIR $HOST_TARGET -m qtlottie"
46+
python -m aqt install-qt --outputdir $QT_DIR $HOST_TARGET -m qtlottie
4747
for QT_HOST_DIR in $(find ${QT_DIR} -type d -name "${HOST_FOLDER_NAME}"); do
4848
find ${QT_HOST_DIR} -type f -name 'lib*.a' -delete
4949
done

scripts/utils/qt6_compile.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ mkdir -p $BUILDDIR
204204
-skip qtdatavis3d \
205205
-skip qtgrpc \
206206
-skip qtremoteobjects \
207-
-skip qtlottie \
208207
-skip qtmqtt \
209208
-skip qtopcua \
210209
-skip qtpositioning \

src/cmake/lottietoqml.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ function(mz_target_qml_from_lottie target)
3030

3131
add_custom_command(
3232
OUTPUT "${result}"
33-
COMMAND Qt6::lottietoqml -c -p "${file_absolute}" "${result}"
33+
COMMAND ${CMAKE_COMMAND} -E env QT_QPA_PLATFORM=offscreen
34+
$<TARGET_FILE:Qt6::lottietoqml> -c -p "${file_absolute}" "${result}"
3435
DEPENDS "${file_absolute}" Qt6::lottietoqml
3536
VERBATIM
3637
)

src/ui/CMakeLists.txt

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -165,34 +165,28 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
165165
endif()
166166

167167

168-
# The onboarding animations are plain QML generated from the Lottie JSON. When
169-
# the Qt lottietoqml generator is available (Qt 6.11+) we regenerate it at build
170-
# time; otherwise we fall back to the checked-in copies under animations/. Either
171-
# way no Lottie runtime is bundled.
168+
# The onboarding animations are plain QML generated from the Lottie JSON at build
169+
# time by the Qt6::lottietoqml tool. No Lottie runtime is bundled.
172170
include(${CMAKE_SOURCE_DIR}/src/cmake/lottietoqml.cmake)
173171
find_package(Qt6 QUIET COMPONENTS LottieTools)
174-
if(TARGET Qt6::lottietoqml)
175-
message(STATUS "Onboarding animations: regenerating QML from Lottie JSON with Qt6::lottietoqml")
176-
mz_target_qml_from_lottie(
177-
mozillavpn-ui
178-
FILES
179-
resources/animations/globe_animation.json
180-
resources/animations/lock_animation.json
181-
resources/animations/vpnactive_animation.json
182-
resources/animations/vpnlogo-drop_animation.json
183-
OUTPUTS
184-
animations/GlobeAnimation.qml
185-
animations/LockAnimation.qml
186-
animations/VpnActiveAnimation.qml
187-
animations/VpnLogoDropAnimation.qml
188-
)
189-
else()
190-
message(STATUS "Onboarding animations: Qt6::lottietoqml not found, using checked-in QML under src/ui/animations/")
191-
qt_target_qml_sources(mozillavpn-ui
192-
QML_FILES
193-
animations/GlobeAnimation.qml
194-
animations/LockAnimation.qml
195-
animations/VpnActiveAnimation.qml
196-
animations/VpnLogoDropAnimation.qml
197-
)
198-
endif()
172+
if(NOT TARGET Qt6::lottietoqml)
173+
message(FATAL_ERROR
174+
"Qt6::lottietoqml not found. It is required to generate the onboarding "
175+
"animations from Lottie JSON. Install the Qt Lottie tools in the toolchain "
176+
"(note: finding the LottieTools package is not enough - the generator tool "
177+
"ships separately).")
178+
endif()
179+
message(STATUS "Onboarding animations: regenerating QML from Lottie JSON with Qt6::lottietoqml")
180+
mz_target_qml_from_lottie(
181+
mozillavpn-ui
182+
FILES
183+
resources/animations/globe_animation.json
184+
resources/animations/lock_animation.json
185+
resources/animations/vpnactive_animation.json
186+
resources/animations/vpnlogo-drop_animation.json
187+
OUTPUTS
188+
animations/GlobeAnimation.qml
189+
animations/LockAnimation.qml
190+
animations/VpnActiveAnimation.qml
191+
animations/VpnLogoDropAnimation.qml
192+
)

0 commit comments

Comments
 (0)