aboutsummaryrefslogtreecommitdiff
path: root/docker/Dockerfile
blob: 153ff621b586a31090c7f0897ad1615afddf2e43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
FROM ubuntu:25.10

ENV DEBIAN_FRONTEND=noninteractive
ENV LANG=C.UTF-8
ENV RUSTUP_HOME=/opt/rust/rustup
ENV CARGO_HOME=/opt/rust/cargo
ENV PATH="/opt/rust/cargo/bin:${PATH}"

# ── System build tools + all library dependencies ──
RUN apt-get update && apt-get install -y --no-install-recommends \
    # Build essentials
    build-essential cmake ninja-build ccache \
    git curl wget file binutils patchelf pkg-config ca-certificates \
    # Library dependencies
    libboost-all-dev \
    libsqlite3-dev \
    libtinyxml2-dev \
    libfontconfig1-dev \
    libspdlog-dev \
    libfuse3-dev fuse3 \
    liblz4-dev zlib1g-dev libzstd-dev libbz2-dev liblzma-dev \
    libssl-dev libcurl4-openssl-dev \
    libtomlplusplus-dev \
    # Qt 6
    qt6-base-dev qt6-base-dev-tools \
    qt6-webengine-dev \
    libqt6websockets6-dev \
    qt6-svg-dev qt6-svg-plugins \
    qt6-wayland \
    kde-style-breeze \
    # Python
    python3 python3-pyqt6 \
    # Misc
    icoutils zip unzip \
    && rm -rf /var/lib/apt/lists/*

# ── uv (Python package manager) ──
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
ENV PATH="/root/.local/bin:${PATH}"

# ── Build-time Python venv (pybind11, sip, etc.) ──
RUN uv venv /opt/build-python --python 3.13 --seed && \
    uv pip install --python /opt/build-python/bin/python \
      pybind11==2.13.6 sip psutil vdf
ENV BUILD_PYTHON=/opt/build-python/bin/python
ENV PATH="/opt/build-python/bin:${PATH}"

# ── Rust toolchain ──
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
    sh -s -- -y --default-toolchain stable --profile minimal

# ── Portable Python runtime (for bundling, not compilation) ──
ARG PORTABLE_PYTHON_VERSION=3.13.9
RUN curl -L --retry 3 -o /tmp/portable-python.zip \
      "https://github.com/bjia56/portable-python/releases/download/cpython-v${PORTABLE_PYTHON_VERSION}-build.0/python-headless-${PORTABLE_PYTHON_VERSION}-linux-x86_64.zip" && \
    mkdir -p /tmp/pp-extract && \
    unzip -q /tmp/portable-python.zip -d /tmp/pp-extract && \
    mv /tmp/pp-extract/python-headless-*/ /opt/portable-python && \
    rm -rf /tmp/portable-python.zip /tmp/pp-extract

# ── Build and install libloot ──
ARG LIBLOOT_REF=master
RUN git clone --depth 1 --branch ${LIBLOOT_REF} \
      https://github.com/loot/libloot.git /tmp/libloot && \
    cmake -S /tmp/libloot/cpp -B /tmp/libloot/build -G Ninja \
      -DCMAKE_BUILD_TYPE=Release \
      -DBUILD_SHARED_LIBS=ON \
      -DLIBLOOT_INSTALL_DOCS=OFF \
      -DBUILD_TESTING=OFF \
      -DCMAKE_INSTALL_PREFIX=/usr/local && \
    cmake --build /tmp/libloot/build --parallel && \
    cmake --install /tmp/libloot/build && \
    # Create pkg-config metadata
    mkdir -p /usr/local/lib/pkgconfig && \
    printf '%s\n' \
      'prefix=/usr/local' \
      'exec_prefix=${prefix}' \
      'libdir=${prefix}/lib' \
      'includedir=${prefix}/include' \
      '' \
      'Name: libloot' \
      'Description: LOOT C++ API library' \
      'Version: 0.29.0' \
      'Libs: -L${libdir} -lloot' \
      'Cflags: -I${includedir}' \
      > /usr/local/lib/pkgconfig/libloot.pc && \
    ldconfig && \
    rm -rf /tmp/libloot

# ── Pre-download linuxdeploy tooling ──
RUN mkdir -p /opt/linuxdeploy && \
    curl -L --retry 3 -o /opt/linuxdeploy/linuxdeploy-x86_64.AppImage \
      https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage && \
    curl -L --retry 3 -o /opt/linuxdeploy/linuxdeploy-plugin-qt-x86_64.AppImage \
      https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage && \
    chmod +x /opt/linuxdeploy/linuxdeploy-x86_64.AppImage \
             /opt/linuxdeploy/linuxdeploy-plugin-qt-x86_64.AppImage && \
    # Extract Qt plugin (avoids FUSE requirement at runtime)
    cd /opt/linuxdeploy && \
    ./linuxdeploy-plugin-qt-x86_64.AppImage --appimage-extract >/dev/null && \
    mv squashfs-root linuxdeploy-plugin-qt.AppDir && \
    chmod +x linuxdeploy-plugin-qt.AppDir/AppRun && \
    ln -sf /opt/linuxdeploy/linuxdeploy-plugin-qt.AppDir/AppRun \
           /opt/linuxdeploy/linuxdeploy-plugin-qt && \
    chmod -x /opt/linuxdeploy/linuxdeploy-plugin-qt-x86_64.AppImage

WORKDIR /build