|
| 1 | +# Dockerfile for building Raqcoin-Qt for Windows (x64) |
| 2 | +# Uses manual MXE setup on Ubuntu 20.04 (Focal) which is well supported by MXE. |
| 3 | + |
| 4 | +FROM ubuntu:20.04 |
| 5 | + |
| 6 | +# Avoid interactive prompts during apt install |
| 7 | +ENV DEBIAN_FRONTEND=noninteractive |
| 8 | + |
| 9 | +# Install basic tools |
| 10 | +RUN apt-get update && apt-get install -y \ |
| 11 | + gnupg \ |
| 12 | + ca-certificates \ |
| 13 | + apt-transport-https \ |
| 14 | + software-properties-common \ |
| 15 | + wget \ |
| 16 | + git \ |
| 17 | + build-essential \ |
| 18 | + autoconf \ |
| 19 | + automake \ |
| 20 | + libtool \ |
| 21 | + pkg-config \ |
| 22 | + pkg-config \ |
| 23 | + python3 \ |
| 24 | + python3 \ |
| 25 | + dos2unix \ |
| 26 | + ntp \ |
| 27 | + && rm -rf /var/lib/apt/lists/* |
| 28 | + |
| 29 | +# Add MXE repository |
| 30 | +# Use direct download for the key |
| 31 | +RUN wget -q -O - http://pkg.mxe.cc/repos/apt/client-conf/mxeapt.gpg | apt-key add - |
| 32 | +RUN echo "deb http://pkg.mxe.cc/repos/apt focal main" > /etc/apt/sources.list.d/mxeapt.list |
| 33 | + |
| 34 | +# Install MXE packages for x86_64-w64-mingw32.static |
| 35 | +# Removed qrencode as it was causing 404 errors (likely named libqrencode or not available) |
| 36 | +RUN apt-get update && apt-get install -y \ |
| 37 | + mxe-x86-64-w64-mingw32.static-qtbase \ |
| 38 | + mxe-x86-64-w64-mingw32.static-qttools \ |
| 39 | + mxe-x86-64-w64-mingw32.static-boost \ |
| 40 | + mxe-x86-64-w64-mingw32.static-openssl \ |
| 41 | + mxe-x86-64-w64-mingw32.static-db \ |
| 42 | + mxe-x86-64-w64-mingw32.static-miniupnpc \ |
| 43 | + && rm -rf /var/lib/apt/lists/* |
| 44 | + |
| 45 | +# Add MXE bin to PATH immediately so subsequent RUN commands can find the toolchain |
| 46 | +ENV PATH="/usr/lib/mxe/usr/bin:${PATH}" |
| 47 | + |
| 48 | +# Build binutils 2.37 from source to replace buggy 2.28 |
| 49 | +# Configure for x86_64-w64-mingw32.static target |
| 50 | +RUN wget -q -O binutils-2.37.tar.gz https://ftp.gnu.org/gnu/binutils/binutils-2.37.tar.gz && \ |
| 51 | + tar -xzvf binutils-2.37.tar.gz && \ |
| 52 | + cd binutils-2.37 && \ |
| 53 | + ./configure --target=x86_64-w64-mingw32.static --prefix=/usr/lib/mxe/usr --disable-nls --disable-werror --enable-static --disable-shared && \ |
| 54 | + make -j4 && \ |
| 55 | + make install && \ |
| 56 | + cd .. && \ |
| 57 | + rm -rf binutils-2.37 binutils-2.37.tar.gz |
| 58 | + |
| 59 | +# Build libqrencode from source (MXE package missing) |
| 60 | +# Explicitly set compilers to ensure cross-compilation works (avoids ELF format) |
| 61 | +RUN wget -q -O libqrencode.tar.gz https://github.com/fukuchi/libqrencode/archive/v4.1.1.tar.gz && \ |
| 62 | + mkdir libqrencode && \ |
| 63 | + tar -xzvf libqrencode.tar.gz -C libqrencode --strip-components=1 && \ |
| 64 | + cd libqrencode && \ |
| 65 | + ./autogen.sh && \ |
| 66 | + ./configure --host=x86_64-w64-mingw32.static --prefix=/usr/lib/mxe/usr/x86_64-w64-mingw32.static --enable-static --disable-shared \ |
| 67 | + CC=x86_64-w64-mingw32.static-gcc \ |
| 68 | + CXX=x86_64-w64-mingw32.static-g++ \ |
| 69 | + AR=x86_64-w64-mingw32.static-ar \ |
| 70 | + RANLIB=x86_64-w64-mingw32.static-ranlib \ |
| 71 | + LDFLAGS="-static" && \ |
| 72 | + make -j4 && \ |
| 73 | + make install && \ |
| 74 | + cd .. && \ |
| 75 | + rm -rf libqrencode libqrencode.tar.gz |
| 76 | + |
| 77 | +# Set up build directory |
| 78 | +WORKDIR /app |
| 79 | + |
| 80 | +# The source will be mounted here |
| 81 | +CMD ["/bin/bash"] |
0 commit comments