Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
aa78800
Docker: hard-code checksums of downloaded deps
slipher Nov 9, 2025
d690933
Docker: set LANG=C.UTF-8
slipher Nov 13, 2025
839fce2
[squashme]QML: remove version numbers from Qt imports
slipher Nov 6, 2025
88fc92e
[squashme]submodules
slipher Nov 3, 2025
f688cc2
[squashme]WIP: Qt6 + CMake + Fluid + Quazip upgrade
slipher Nov 6, 2025
ad45906
[squashme]Switch to qt_add_qml_module (requires newer cmake)
slipher Nov 6, 2025
082a0ed
[squashme]Improve Qt + Linux Docker builds
slipher Nov 6, 2025
4120cba
[squashme]clean up build-qt.sh
slipher Nov 12, 2025
f2792bb
[squashme]binary size reducing flags
slipher Nov 13, 2025
e345156
[squashme]static link xcb-* libs from debian
slipher Nov 13, 2025
a97d2ca
[squashme]make compression on by default for rcc
slipher Nov 14, 2025
492cfa6
[squashme]apt cleanup from illwieckz
slipher Nov 14, 2025
3ff9dcd
[squashme]Use cmake IPO with 'release' arg
slipher Nov 15, 2025
ac2ba05
[squashme]spam no-pie/no-pic
slipher Nov 15, 2025
1dc5256
[squashme]cleanup
slipher Nov 15, 2025
641ad70
[squashme]Windows Docker build - bump Debian bullseye -> trixie
slipher Nov 15, 2025
3fb787e
[squashme]Windows build
slipher Nov 15, 2025
cfee93c
[squashme]disconnected news fix
slipher Nov 20, 2025
5e58ac4
[squashme]Use customized cmake for Fluid
slipher Nov 21, 2025
5942baa
[squashme]Restore text editing functionality
slipher Nov 22, 2025
9a471c2
[squashme] disable xkb x11 extension
slipher Nov 22, 2025
26f1edb
[squashme] fix folder dialog warning spam
slipher Nov 23, 2025
95eacee
[squashme]no sed separate stream
slipher Nov 27, 2025
4e4079a
[squashme] backport dialog modalness implementation from 6.10
slipher Nov 28, 2025
0a8f417
[squashme] reenable css parser - fixes "continue reading"
slipher Nov 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ aria2/src/.libs
build*
Dockerfile*
!build-aria.sh
!build-qt.sh

150 changes: 150 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
cmake_minimum_required(VERSION 3.21)

project(updater LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# triggers in QML generated files
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-maybe-uninitialized")

# important for quazip
set(BUILD_SHARED_LIBS OFF)

set(CMAKE_AUTORCC ON)

set(ARIA2_LIBS "${CMAKE_CURRENT_SOURCE_DIR}/aria2/src/.libs/libaria2.a" CACHE STRING "aria2 libraries")
set(ARIA2_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/aria2/include" CACHE STRING "aria2 include directory")

find_package(Qt6 REQUIRED COMPONENTS Core Qml Quick QuickControls2 QuickDialogs2 Network Gui Widgets)

if (WIN32)
set(CMAKE_C_FLAGS "-static -static-libgcc ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-static -static-libgcc ${CMAKE_CXX_FLAGS}")
endif()

qt_standard_project_setup(REQUIRES 6.8)

option(FLUID_INSTALL_ICONS "" OFF)
option(FLUID_WITH_DOCUMENTATION "" OFF)
option(FLUID_WITH_GALLERY "" OFF)
option(FLUID_WITH_QML_MODULES "" ON)
function(add_fluid) # Use function to emulate the new scope created by add_subdirectory
find_package(Qt6 6.8
REQUIRED
COMPONENTS
Core
Core5Compat
Gui
#GuiPrivate
Svg
Qml
Quick
QuickControls2
)
set(QT_QML_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/qml_modules")
include(fluid.cmake)
endfunction()
add_fluid()

set(QUAZIP_BZIP2 OFF)
set(QUAZIP_ENABLE_TESTS OFF)
set(QUAZIP_FETCH_LIBS OFF)
if (WIN32)
set(QUAZIP_USE_QT_ZLIB ON)
endif()
add_subdirectory(quazip)

set(SOURCES
ariadownloader.cpp ariadownloader.h
currentversionfetcher.cpp currentversionfetcher.h
downloadtimecalculator.cpp downloadtimecalculator.h
downloadworker.cpp downloadworker.h
gamelauncher.cpp gamelauncher.h
main.cpp
qmldownloader.cpp qmldownloader.h
settings.cpp settings.h
splashcontroller.cpp splashcontroller.h
system.h
)
set(QML_SOURCES
DownloadInfo.qml
main.qml
News.qml
NewsCard.qml
Settings.qml
splash.qml
UpdateFailed.qml
utils.js
)

if(APPLE)
list(APPEND SOURCES osx.cpp)
elseif(WIN32)
list(APPEND SOURCES win.cpp ExecInExplorer.cpp)
else()
list(APPEND SOURCES linux.cpp)
endif()

qt_add_executable(updater WIN32
${SOURCES}
qml.qrc
)

qt_add_qml_module(updater
URI UnvUpdater
QML_FILES ${QML_SOURCES}
RESOURCE_PREFIX "/"
)

target_link_libraries(updater PRIVATE
Qt6::Network
Qt6::Widgets
QuaZip::QuaZip
Fluid
${ARIA2_LIBS}
)

target_link_libraries(updater PRIVATE
Qt6::Qml
Qt6::Quick
Qt6::QuickControls2
Qt6::QuickDialogs2
)


# Platform-specific linking
if(WIN32)
target_link_libraries(updater PRIVATE
crypt32
secur32
ole32
)
#
target_sources(updater PRIVATE updater.rc)
elseif(UNIX)
target_link_libraries(updater PRIVATE
z
)
endif()

# Turn on warning errors since the warnings are hard to see in Docker
if(NOT APPLE)
target_compile_options(updater PRIVATE -Werror)
endif()

# macOS app bundle icon
# UNTESTED, AISLOP
if(APPLE)
set_target_properties(updater PROPERTIES
MACOSX_BUNDLE TRUE
MACOSX_BUNDLE_ICON_FILE Unvanquished.icns
)
set(MACOSX_BUNDLE_ICON_FILE resources/Unvanquished.icns)
set_source_files_properties(${MACOSX_BUNDLE_ICON_FILE} PROPERTIES
MACOSX_PACKAGE_LOCATION Resources
)
target_sources(updater PRIVATE ${MACOSX_BUNDLE_ICON_FILE})
endif()


62 changes: 41 additions & 21 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,37 @@
# See Dockerfile.win for an explanation of some aspects of this file.
FROM docker.io/debian:bullseye-slim

# Prevents warning spam from Qt 6's rcc
ENV LANG=C.UTF-8

# OpenSSL build requires perl
# Qt tarball requires xz-utils
# Qt build requires libgl1-mesa-dev, libxkbcommon-dev, python, zlib1g-dev
# Qt configuration additionally finds libxcb-glx0-dev/libx11-xcb-dev/libxext-dev. Without them, the
# updater builds but icons (gear, download, etc.) are mysteriously missing, when built in the
# Bullseye environment. It may be that not all are necessary.
# Qt build requires libgl1-mesa-dev, libxkbcommon-dev, python, zlib1g-dev................
# aria2 build requires autoconf, autopoint, gettext
# git is used for cleaning unwanted files

# For Qt's xcb_syslibs compile test
ENV XCB_MINIMUM_PACKAGES=' \
libxcb-cursor-dev \
libxcb-icccm4-dev \
libxcb-image0-dev \
libxcb-keysyms1-dev \
libxcb-randr0-dev \
libxcb-render0-dev \
libxcb-render-util0-dev \
libxcb-shape0-dev \
libxcb-shm0-dev \
libxcb-sync-dev \
libxcb-xfixes0-dev \
libxcb-xkb-dev \
libxcb-util-dev \
'
RUN echo 'deb http://archive.debian.org/debian bullseye-backports main' > /etc/apt/sources.list.d/backports.list
RUN apt-get update && apt-get install -y \
autoconf \
autopoint \
cmake/bullseye-backports \
cmake-data/bullseye-backports \
curl \
gettext \
git \
Expand All @@ -19,39 +40,39 @@ RUN apt-get update && apt-get install -y \
libtool \
libx11-xcb-dev \
libxcb-glx0-dev \
libxext-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev \
make \
ninja-build \
perl \
p7zip-full \
pkg-config \
python \
xz-utils \
zlib1g-dev
zlib1g-dev \
$XCB_MINIMUM_PACKAGES
RUN rm /usr/lib/x86_64-linux-gnu/libxcb-*.so

#################
# Build OpenSSL #
#################
WORKDIR /build-ssl
RUN curl -LO https://github.com/openssl/openssl/releases/download/openssl-3.6.0/openssl-3.6.0.tar.gz && \
curl -L https://github.com/openssl/openssl/releases/download/openssl-3.6.0/openssl-3.6.0.tar.gz.sha256 | sha256sum --check
COPY sha256sums-openssl.txt /build-ssl/
RUN curl -LO http://github.com/openssl/openssl/releases/download/openssl-3.6.0/openssl-3.6.0.tar.gz && \
sha256sum --check sha256sums-openssl.txt
RUN tar -xzf openssl-3.6.0.tar.gz
WORKDIR /build-ssl/openssl-3.6.0
RUN ./config --prefix=/openssl --openssldir=/dev/null no-shared no-apps no-autoload-config no-capieng no-dso no-dynamic-engine no-engine no-loadereng no-module -Os
RUN ./config --prefix=/openssl --openssldir=/dev/null no-shared no-apps no-autoload-config no-capieng no-dso no-dynamic-engine no-engine no-loadereng no-module -Os no-pic -fno-pic
RUN make -j`nproc` && make install_sw && rm -rf /build-ssl

############
# Build Qt #
############
WORKDIR /build-qt
ENV UPDATER_MODULES=qtbase,qtquickcontrols,qtquickcontrols2,qtsvg,qtgraphicaleffects
RUN curl -LO https://download.qt.io/archive/qt/5.14/5.14.2/single/qt-everywhere-src-5.14.2.tar.xz && \
curl -L https://download.qt.io/archive/qt/5.14/5.14.2/single/md5sums.txt | md5sum --check --ignore-missing && \
tar -xJf qt-everywhere-src-5.14.2.tar.xz && \
cd qt-everywhere-src-5.14.2 && \
OPENSSL_LIBS='-L/openssl/lib64 -lssl -lcrypto -lpthread -ldl' ./configure -opensource -confirm-license -release -optimize-size -no-shared -static --c++std=14 -nomake tests -nomake tools -nomake examples -no-gif -no-icu -no-glib -no-qml-debug -opengl desktop -no-eglfs -no-opengles3 -no-angle -no-egl -qt-xcb -xkbcommon -dbus-runtime -qt-freetype -qt-pcre -qt-harfbuzz -qt-libpng -qt-libjpeg -system-zlib -I /openssl/include -openssl-linked -prefix /qt && \
bash -c "make -j`nproc` module-{$UPDATER_MODULES} && make module-{$UPDATER_MODULES}-install_subtargets" && \
rm -rf /build-qt
COPY md5sums-qt.txt build-qt.sh qt*.patch /build-qt/
ARG release
# Note: {foo:+bar} here is a syntax of the Dockerfile, not the shell!
ENV IPO_ARG=${release:+-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON}
RUN BUILDQT_CMAKE_ARGS="${IPO_ARG} -DCMAKE_POSITION_INDEPENDENT_CODE=OFF -DFEATURE_reduce_relocations=OFF" CXXFLAGS='-fno-pic -no-pie' CFLAGS='-fno-pic -no-pie' PKG_CONFIG_PATH=/openssl/lib64/pkgconfig ./build-qt.sh linux && mv qt_linux /qt && rm -rf /build-qt

###############
# Build aria2 #
Expand All @@ -61,22 +82,21 @@ COPY .git/modules/aria2 /updater/.git/modules/aria2
COPY build-aria.sh /updater/
WORKDIR /updater/aria2
RUN OPENSSL_LIBS='-L/openssl/lib64 -lssl -lcrypto -lpthread -ldl' OPENSSL_CFLAGS='-I /openssl/include' \
CFLAGS=-Os CXXFLAGS=-Os ../build-aria.sh --with-openssl
CFLAGS='-Os -fno-pic -no-pie' CXXFLAGS='-Os -fno-pic -no-pie' ../build-aria.sh --with-openssl

#################
# Build updater #
#################
COPY . /updater
RUN set -e; for D in . quazip fluid; do cd /updater/$D && git clean -dXff; done
WORKDIR /build
RUN /qt/bin/qmake -config release QMAKE_LFLAGS+="-no-pie" /updater && make -j`nproc`
RUN PKG_CONFIG_PATH=/openssl/lib64/pkgconfig CXXFLAGS='-no-pie -fno-pic' CFLAGS='-no-pie -fno-pic' cmake -G Ninja -DCMAKE_POSITION_INDEPENDENT_CODE=OFF -DCMAKE_FIND_ROOT_PATH=/qt -DCMAKE_BUILD_TYPE=MinSizeRel ${IPO_ARG} /updater && ninja
RUN mv updater updater-nonstripped && strip updater-nonstripped -o updater
# Version check: do not depend on glibc > 2.31
RUN echo GLIBC_2.31 > target_version && \
grep -aoE 'GLIBC_[0-9.]+' updater > symbol_versions && \
cat target_version symbol_versions | sort -V | tail -1 | tee max_version && \
diff -q target_version max_version
ARG release
RUN if [ -n "$release" ]; then cp updater UnvanquishedUpdater && 7z -tzip -mx=9 a UnvUpdaterLinux.zip UnvanquishedUpdater; fi
ENV zipfile=${release:+UnvUpdaterLinux.zip}
CMD cp updater updater-nonstripped $zipfile /build-docker
42 changes: 25 additions & 17 deletions Dockerfile.win
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,45 @@
# from .git since a checked-in file will not be ignored. For aria2 it is assumed that the data
# is stored in the updater/.git/modules directory.

FROM docker.io/debian:bullseye-slim
FROM docker.io/debian:trixie-slim

# Prevents warning spam from Qt 6's rcc
ENV LANG=C.UTF-8

RUN apt-get update && apt-get install -y \
autoconf \
autopoint \
cmake \
curl \
gettext \
g++ \
g++-mingw-w64-i686 \
g++-mingw-w64-i686-posix \
git \
libtool \
make \
ninja-build \
p7zip-full \
pkg-config \
python \
python3 \
xz-utils

# The Schannel dependencies are spelled with capital letters which causes them not to be found
RUN ln -s libsecur32.a /usr/i686-w64-mingw32/lib/libSecur32.a && \
ln -s libcrypt32.a /usr/i686-w64-mingw32/lib/libCrypt32.a

############
# Build Qt #
############
WORKDIR /build-qt
ENV UPDATER_MODULES=qtbase,qtquickcontrols,qtquickcontrols2,qtsvg,qtgraphicaleffects
RUN curl -LO https://download.qt.io/archive/qt/5.14/5.14.2/single/qt-everywhere-src-5.14.2.tar.xz && \
curl -L https://download.qt.io/archive/qt/5.14/5.14.2/single/md5sums.txt | md5sum --check --ignore-missing && \
tar -xJf qt-everywhere-src-5.14.2.tar.xz && \
cd qt-everywhere-src-5.14.2 && \
./configure -release -static -prefix /qt -qt-zlib -qt-libjpeg -qt-libpng -qt-freetype -qt-pcre -qt-harfbuzz -opengl desktop -opensource -confirm-license -no-qml-debug -no-icu -xplatform win32-g++ -device-option CROSS_COMPILE=i686-w64-mingw32- -optimize-size --c++std=14 -nomake tests -nomake tools -nomake examples -schannel -no-feature-d3d12 && \
bash -c "make -j`nproc` module-{$UPDATER_MODULES} && make module-{$UPDATER_MODULES}-install_subtargets" && \
rm -rf /build-qt

# Build host-mode tools and remove everything apart from the installed bin/ and lib/cmake/
COPY md5sums-qt.txt build-qt.sh qt*.patch cross-toolchain-mingw32.cmake /build-qt/
RUN ./build-qt.sh tools qtbase qtdeclarative qtshadertools && \
rm -r build_tools && \
find qt_tools -mindepth 1 -maxdepth 1 ! -name bin ! -name lib ! -name libexec -exec rm -r {} + && \
find qt_tools/lib -mindepth 1 -maxdepth 1 ! -name cmake -exec rm -r {} +

ARG release
# Note: {foo:+bar} here is a syntax of the Dockerfile, not the shell!
ENV IPO_ARG=${release:+-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON}
RUN BUILDQT_CMAKE_ARGS="${IPO_ARG}"
RUN ./build-qt.sh windows && rm -r build_windows

###############
# Build aria2 #
Expand All @@ -59,7 +66,8 @@ RUN CFLAGS=-Os CXXFLAGS=-Os ../build-aria.sh ARIA2_STATIC=yes --host i686-w64-mi
COPY . /updater
RUN set -e; for D in . quazip fluid; do cd /updater/$D && git clean -dXff; done
WORKDIR /build
RUN /qt/bin/qmake -config release QMAKE_LFLAGS+="-static" INCLUDEPATH+=/qt/include/QtZlib /updater && make -j`nproc`
RUN cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE=/build-qt/cross-toolchain-mingw32.cmake -DCMAKE_FIND_ROOT_PATH=/build-qt/qt_windows -DCMAKE_BUILD_TYPE=MinSizeRel ${IPO_ARG} /updater && ninja
RUN mv updater.exe updater-nonstripped.exe && i686-w64-mingw32-strip updater-nonstripped.exe -o updater.exe
WORKDIR /release-win
ARG release
RUN if [ -n "$release" ]; then cp /build/release/updater.exe UnvanquishedUpdater.exe && 7z -tzip -mx=9 a UnvUpdaterWin.zip UnvanquishedUpdater.exe; fi
RUN if [ -n "$release" ]; then cp /build/updater.exe UnvanquishedUpdater.exe && 7z -tzip -mx=9 a UnvUpdaterWin.zip UnvanquishedUpdater.exe; fi
Loading
Loading