Use custom image + wind build fixes
This commit is contained in:
4 files changed
+108
-57
No files matched your search
@@ -0,0 +1,61 @@
|
||||
FROM ubuntu:24.04
|
||||
|
||||
ARG QT_VERSION=6.10.1
|
||||
ARG QT_INSTALL_DIR=/opt/qt
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV QT_VERSION=${QT_VERSION}
|
||||
ENV QT_INSTALL_DIR=${QT_INSTALL_DIR}
|
||||
|
||||
# ── Build tools & native deps ──────────────────────────────────────────────────
|
||||
RUN apt-get update -qq && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
python3 python3-pip \
|
||||
cmake ninja-build pkg-config git \
|
||||
build-essential libgl1-mesa-dev \
|
||||
gcc g++ mingw-w64 \
|
||||
libuchardet-dev \
|
||||
libquazip1-qt6-dev libminizip-dev \
|
||||
libdjvulibre-dev libwpd-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# ── aqtinstall ─────────────────────────────────────────────────────────────────
|
||||
RUN pip3 install --quiet --break-system-packages aqtinstall
|
||||
|
||||
# ── Qt 6 for Linux (native build + host tools for cross-compile) ───────────────
|
||||
RUN aqt install-qt linux desktop ${QT_VERSION} linux_gcc_64 \
|
||||
--outputdir ${QT_INSTALL_DIR}
|
||||
|
||||
# ── Qt 6 for Windows (MinGW cross-compile target) ─────────────────────────────
|
||||
RUN aqt install-qt windows desktop ${QT_VERSION} win64_mingw \
|
||||
--outputdir ${QT_INSTALL_DIR}
|
||||
|
||||
# ── libiconv for MinGW (static, cross-compiled) ───────────────────────────────
|
||||
COPY scripts/mingw-w64-toolchain.cmake /opt/mingw-w64-toolchain.cmake
|
||||
|
||||
RUN apt-get update -qq && apt-get install -y --no-install-recommends wget && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN wget -q https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.17.tar.gz -O /tmp/libiconv.tar.gz && \
|
||||
tar -xf /tmp/libiconv.tar.gz -C /tmp && \
|
||||
cd /tmp/libiconv-1.17 && \
|
||||
./configure --host=x86_64-w64-mingw32 --prefix=/opt/mingw-sysroot \
|
||||
--enable-static --disable-shared --disable-nls && \
|
||||
make -j$(nproc) && make install && \
|
||||
rm -rf /tmp/libiconv-1.17 /tmp/libiconv.tar.gz
|
||||
|
||||
# ── uchardet for MinGW (static, cross-compiled) ───────────────────────────────
|
||||
RUN git clone --depth 1 https://gitlab.freedesktop.org/uchardet/uchardet.git /tmp/uchardet && \
|
||||
cmake -B /tmp/uchardet-build /tmp/uchardet -G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_TOOLCHAIN_FILE=/opt/mingw-w64-toolchain.cmake \
|
||||
-DCMAKE_INSTALL_PREFIX=/opt/mingw-sysroot \
|
||||
-DBUILD_SHARED_LIBS=OFF && \
|
||||
cmake --build /tmp/uchardet-build && \
|
||||
cmake --install /tmp/uchardet-build && \
|
||||
rm -rf /tmp/uchardet /tmp/uchardet-build
|
||||
|
||||
ENV QT_LINUX_DIR=${QT_INSTALL_DIR}/${QT_VERSION}/gcc_64
|
||||
ENV QT_WINDOWS_DIR=${QT_INSTALL_DIR}/${QT_VERSION}/mingw_64
|
||||
ENV MINGW_SYSROOT=/opt/mingw-sysroot
|
||||
|
||||
WORKDIR /build
|
||||
Reference in new issue
Block a user