Skip to content

Commit 12de4bd

Browse files
committed
release: bulid all Qt version
1 parent 649bb0b commit 12de4bd

16 files changed

Lines changed: 309 additions & 44 deletions

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ src/*.o
2828
src/*.a
2929
.qmake.stash
3030
raqcoin-qt-p.app
31+
build-qt
3132

3233
# 编译生成的头文件
3334
src/obj/build.h
@@ -127,6 +128,7 @@ object_script.*.Release
127128
*.pro.user.*
128129
src/qt/locale/*.qm
129130
raqcoin-qt-p
131+
raqcoin-qt-p_plugin_import.cpp
130132
# ============================================
131133
# 保留的文件 (不要清理)
132134
# ============================================

COPYING

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2009-2013 Abcmint Developers
1+
Copyright (c) 2025 Raqcoin Developers
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

Dockerfile.windows

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
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"]

doc/build-msw-qt-cn.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
Windows 下 Raqcoin-Qt 编译指南 (Docker 交叉编译)
2+
========================================================================
3+
4+
本指南介绍如何使用基于 Docker 的交叉编译环境构建 Windows 版 Raqcoin-Qt 钱包。这是官方推荐的构建方式,因为它能确保构建环境的一致性,并自动处理所有复杂的依赖关系(如 MXE, Qt, Boost 等)。
5+
6+
前提条件
7+
-------------
8+
9+
* **Docker**: 请确保您的系统已安装并运行 Docker。
10+
11+
构建步骤
12+
--------------
13+
14+
### 1. 构建构建器镜像 (Builder Image)
15+
16+
首先,您需要构建包含交叉编译工具链的 Docker 镜像。这一步只需要执行一次(除非 `Dockerfile.windows` 发生了更改)。
17+
18+
在项目根目录下打开终端(Windows 下使用 PowerShell,Linux/macOS 下使用 Bash),运行以下命令:
19+
20+
```bash
21+
docker build -t raqcoin-mxe-builder -f Dockerfile.windows .
22+
```
23+
24+
### 2. 编译应用程序
25+
26+
构建器镜像准备好后,您可以使用以下命令编译应用程序。该命令会将您的当前源代码目录挂载到容器中并进行编译。
27+
28+
**Windows (PowerShell):**
29+
30+
```powershell
31+
docker run --rm -v ${PWD}:/app raqcoin-mxe-builder /bin/bash -c "touch raqcoin-qt.pro && x86_64-w64-mingw32.static-qmake-qt5 raqcoin-qt.pro && touch Makefile.Release && make -j4"
32+
```
33+
34+
**Linux / macOS / WSL:**
35+
36+
```bash
37+
docker run --rm -v $(pwd):/app raqcoin-mxe-builder /bin/bash -c "touch raqcoin-qt.pro && x86_64-w64-mingw32.static-qmake-qt5 raqcoin-qt.pro && touch Makefile.Release && make -j4"
38+
```
39+
40+
**注意:** 命令中的 `touch` 操作是为了防止因文件时间戳偏差导致的无限重新配置问题。
41+
42+
### 3. 获取可执行文件
43+
44+
编译成功后,生成的 Windows 可执行文件将位于 `release/` 目录中:
45+
46+
* `release/raqcoin-qt.exe`
47+
48+
清理构建
49+
-----------
50+
51+
如果您需要清理构建生成的中间文件(如 object 文件、moc 文件等),可以运行:
52+
53+
```bash
54+
docker run --rm -v ${PWD}:/app raqcoin-mxe-builder make clean
55+
```

doc/build-msw-qt.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
Build instructions for Raqcoin-Qt on Windows (Docker Cross-Compilation)
2+
========================================================================
3+
4+
This guide describes how to build the Raqcoin-Qt wallet for Windows using a Docker-based cross-compilation environment. This approach is recommended as it ensures a consistent build environment and handles all dependencies (MXE, Qt, Boost, etc.) automatically.
5+
6+
Prerequisites
7+
-------------
8+
9+
* **Docker**: Ensure Docker is installed and running on your system.
10+
11+
Building Steps
12+
--------------
13+
14+
### 1. Build the Builder Image
15+
16+
First, you need to build the Docker image containing the cross-compilation toolchain. This step only needs to be done once (or when `Dockerfile.windows` changes).
17+
18+
Open your terminal (PowerShell on Windows, or Bash on Linux/macOS) in the project root directory and run:
19+
20+
```bash
21+
docker build -t raqcoin-mxe-builder -f Dockerfile.windows .
22+
```
23+
24+
### 2. Compile the Application
25+
26+
Once the builder image is ready, you can compile the application using the following command. This mounts your current source code into the container and compiles it.
27+
28+
**For Windows (PowerShell):**
29+
30+
```powershell
31+
docker run --rm -v ${PWD}:/app raqcoin-mxe-builder /bin/bash -c "touch raqcoin-qt.pro && x86_64-w64-mingw32.static-qmake-qt5 raqcoin-qt.pro && touch Makefile.Release && make -j4"
32+
```
33+
34+
**For Linux / macOS / WSL:**
35+
36+
```bash
37+
docker run --rm -v $(pwd):/app raqcoin-mxe-builder /bin/bash -c "touch raqcoin-qt.pro && x86_64-w64-mingw32.static-qmake-qt5 raqcoin-qt.pro && touch Makefile.Release && make -j4"
38+
```
39+
40+
**Note:** The `touch` commands are used to prevent potential timestamp issues that might cause unnecessary reconfiguration loops.
41+
42+
### 3. Locate the Executable
43+
44+
After the build completes successfully, the compiled Windows executable will be located in the `release/` directory:
45+
46+
* `release/raqcoin-qt.exe` (or similar)
47+
48+
Cleaning Up
49+
-----------
50+
51+
To clean the build artifacts (object files, moc files, etc.), you can run:
52+
53+
```bash
54+
docker run --rm -v ${PWD}:/app raqcoin-mxe-builder make clean
55+
```

0 commit comments

Comments
 (0)