Skip to content

Commit 4d8cbbb

Browse files
committed
Qt6 update:
Add required new build files Update some qt patch files Update makefile and packages Update qt makefile Fix x86_64-linux-gnu, aarch64-linux-gnu and x86_64-w64-mingw32 Fix not recognizing compiler problem Test for cross compilation on CI Reafctor: deprecated QRegExp -> QRegularExpression Refactor: replace the function in QDataTime to compatible with Qt6: - Add qtcompat header file to better maintainability - Replace deprecated QDateTime::fromTime_t() with fromSecsSinceEpoch() - Replace deprecated QDateTime::toTime_t() with toSecsSinceEpoch() - Add QT_DATETIME_FROM_TIME_T() and QT_DATETIME_TO_TIME_T() macros Refactor: update key combination handling for Qt 6 compatibility Refactor: deprecated QDesktopWidget -> QScreen Refactor: add Qt::ItemFlag compatibility for Qt 6 Refactor: remove Qt compatibility layer and update to Qt 6 APIs Refactor: rename the functions and structure to avoid the conflict (Qt6+ use blake2 withing itself) Refactor: replace copy constructor with constructor (copy constructor is protected in Qt6) Add translation file generation and dependencies for firoqt Refactor: add some include header and some minor changes Remove skiping rpath in cmake Refactor: change parameter type from long to qintptr in nativeEventFilter method Add patch file for native_qt to resolve native f16 issue on apple targets Refactor: enhance the toolchain file (according to Bitcoin toolchain) Fix a definition of env in zeromq.mk Update the funcs to be like Bitcoin Pass pkg_config_path in CI + install binutils for windows target Add some flags for cross-compiling for apple targets Pass pkg_config_path and unset some env variables for apple targets in build.sh Update qt.mk: . Pass the compilers and flags as basic flags. . Pass windres for mingw target.
1 parent 0fb0139 commit 4d8cbbb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1420
-759
lines changed

.github/workflows/ci-master.yml

Lines changed: 78 additions & 170 deletions
Large diffs are not rendered by default.

CMakeLists.txt

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ if(BUILD_GUI)
245245
if(BUILD_GUI_TESTS)
246246
list(APPEND qt_components Test)
247247
endif()
248-
find_package(Qt 5.11.3 MODULE REQUIRED
248+
find_package(Qt 6.7.3 MODULE REQUIRED
249249
COMPONENTS ${qt_components}
250250
)
251251
unset(qt_components)
@@ -831,15 +831,6 @@ if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.29)
831831
set(CMAKE_SKIP_TEST_ALL_DEPENDENCY FALSE)
832832
endif()
833833

834-
# TODO: The `CMAKE_SKIP_BUILD_RPATH` variable setting can be deleted
835-
# in the future after reordering Guix script commands to
836-
# perform binary checks after the installation step.
837-
# Relevant discussions:
838-
# - https://github.com/hebasto/firo/pull/236#issuecomment-2183120953
839-
# - https://github.com/firo/firo/pull/30312#issuecomment-2191235833
840-
set(CMAKE_SKIP_BUILD_RPATH TRUE)
841-
set(CMAKE_SKIP_INSTALL_RPATH TRUE)
842-
843834
if(BUILD_TESTS)
844835
# Create test configuration file
845836
# This file is used by the test framework to configure the tests.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ If you use a later version of Ubuntu, you may need to replace `python` with `pyt
121121
sudo dnf update
122122
sudo dnf install bzip2 perl-lib perl-FindBin gcc-c++ make cmake patch which
123123
# Also needed for GUI wallet only:
124-
sudo dnf install qt5-qttools-devel qt5-qtbase-devel xz bison
124+
sudo dnf install qt6-qttools-devel qt6-qtbase-devel xz bison
125125
sudo ln /usr/bin/bison /usr/bin/yacc
126126
```
127127
- Arch:

cmake/module/FindQt.cmake

Lines changed: 0 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -27,34 +27,13 @@ if(CMAKE_HOST_APPLE)
2727
endif()
2828
endif()
2929

30-
# Save CMAKE_FIND_ROOT_PATH_MODE_LIBRARY state.
31-
unset(_qt_find_root_path_mode_library_saved)
32-
if(DEFINED CMAKE_FIND_ROOT_PATH_MODE_LIBRARY)
33-
set(_qt_find_root_path_mode_library_saved ${CMAKE_FIND_ROOT_PATH_MODE_LIBRARY})
34-
endif()
35-
36-
# The Qt config files internally use find_library() calls for all
37-
# dependencies to ensure their availability. In turn, the find_library()
38-
# inspects the well-known locations on the file system; therefore, it must
39-
# be able to find platform-specific system libraries, for example:
40-
# /usr/x86_64-w64-mingw32/lib/libm.a or /usr/arm-linux-gnueabihf/lib/libm.a.
41-
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
42-
4330
find_package(Qt${Qt_FIND_VERSION_MAJOR} ${Qt_FIND_VERSION}
4431
COMPONENTS ${Qt_FIND_COMPONENTS}
4532
HINTS ${_qt_homebrew_prefix}
4633
PATH_SUFFIXES Qt${Qt_FIND_VERSION_MAJOR} # Required on OpenBSD systems.
4734
)
4835
unset(_qt_homebrew_prefix)
4936

50-
# Restore CMAKE_FIND_ROOT_PATH_MODE_LIBRARY state.
51-
if(DEFINED _qt_find_root_path_mode_library_saved)
52-
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ${_qt_find_root_path_mode_library_saved})
53-
unset(_qt_find_root_path_mode_library_saved)
54-
else()
55-
unset(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY)
56-
endif()
57-
5837
include(FindPackageHandleStandardArgs)
5938
find_package_handle_standard_args(Qt
6039
REQUIRED_VARS Qt${Qt_FIND_VERSION_MAJOR}_DIR
@@ -64,130 +43,3 @@ find_package_handle_standard_args(Qt
6443
foreach(component IN LISTS Qt_FIND_COMPONENTS ITEMS "")
6544
mark_as_advanced(Qt${Qt_FIND_VERSION_MAJOR}${component}_DIR)
6645
endforeach()
67-
68-
# Prioritize finding static libraries
69-
set(_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
70-
set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${_CMAKE_FIND_LIBRARY_SUFFIXES})
71-
72-
find_library(LIB_QTLIBPNG NAMES qtlibpng REQUIRED)
73-
message(STATUS "Found Qt5 dependency: qtlibpng : ${LIB_QTLIBPNG}")
74-
75-
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT MINGW)
76-
find_library(LIB_FONTCONFIG NAMES fontconfig REQUIRED)
77-
message(STATUS "Found Qt5 dependency: fontconfig : ${LIB_FONTCONFIG}")
78-
79-
find_library(LIB_EXPAT NAMES expat REQUIRED)
80-
message(STATUS "Found Qt5 dependency: expat : ${LIB_EXPAT}")
81-
82-
find_library(LIB_FREETYPE NAMES freetype REQUIRED)
83-
message(STATUS "Found Qt5 dependency: freetype : ${LIB_FREETYPE}")
84-
85-
find_library(LIB_XCB_EWMH NAMES xcb-ewmh REQUIRED)
86-
message(STATUS "Found Qt5 dependency: xcb-ewmh : ${LIB_XCB_EWMH}")
87-
88-
find_library(LIB_XCB_ICCCM NAMES xcb-icccm REQUIRED)
89-
message(STATUS "Found Qt5 dependency: xcb-icccm : ${LIB_XCB_ICCCM}")
90-
91-
find_library(LIB_XCB_IMAGE NAMES xcb-image REQUIRED)
92-
message(STATUS "Found Qt5 dependency: xcb-image : ${LIB_XCB_IMAGE}")
93-
94-
find_library(LIB_XCB_KEYSYMS NAMES xcb-keysyms REQUIRED)
95-
message(STATUS "Found Qt5 dependency: xcb-keysyms : ${LIB_XCB_KEYSYMS}")
96-
97-
find_library(LIB_XCB_RANDR NAMES xcb-randr REQUIRED)
98-
message(STATUS "Found Qt5 dependency: xcb-randr : ${LIB_XCB_RANDR}")
99-
100-
find_library(LIB_XCB_RENDER_UTIL NAMES xcb-render-util REQUIRED)
101-
message(STATUS "Found Qt5 dependency: xcb-render-util : ${LIB_XCB_RENDER_UTIL}")
102-
103-
find_library(LIB_XCB_RENDER NAMES xcb-render REQUIRED)
104-
message(STATUS "Found Qt5 dependency: xcb-render : ${LIB_XCB_RENDER}")
105-
106-
find_library(LIB_XCB_SHAPE NAMES xcb-shape REQUIRED)
107-
message(STATUS "Found Qt5 dependency: xcb-shape : ${LIB_XCB_SHAPE}")
108-
109-
find_library(LIB_XCB_SHM NAMES xcb-shm REQUIRED)
110-
message(STATUS "Found Qt5 dependency: xcb-shm : ${LIB_XCB_SHM}")
111-
112-
find_library(LIB_XCB_SYNC NAMES xcb-sync REQUIRED)
113-
message(STATUS "Found Qt5 dependency: xcb-sync : ${LIB_XCB_SYNC}")
114-
115-
find_library(LIB_XCB_UTIL NAMES xcb-util REQUIRED)
116-
message(STATUS "Found Qt5 dependency: xcb-util : ${LIB_XCB_UTIL}")
117-
118-
find_library(LIB_XCB_XFIXES NAMES xcb-xfixes REQUIRED)
119-
message(STATUS "Found Qt5 dependency: xcb-xfixes : ${LIB_XCB_XFIXES}")
120-
121-
find_library(LIB_XCB_XINERAMA NAMES xcb-xinerama REQUIRED)
122-
message(STATUS "Found Qt5 dependency: xcb-xinerama : ${LIB_XCB_XINERAMA}")
123-
124-
find_library(LIB_XCB_XKB NAMES xcb-xkb REQUIRED)
125-
message(STATUS "Found Qt5 dependency: xcb-xkb : ${LIB_XCB_XKB}")
126-
127-
find_library(LIB_XCB NAMES xcb REQUIRED)
128-
message(STATUS "Found Qt5 dependency: xcb : ${LIB_XCB}")
129-
130-
find_library(LIB_XKBCOMMON_X11 NAMES xkbcommon-x11 REQUIRED)
131-
message(STATUS "Found Qt5 dependency: xkbcommon-x11 : ${LIB_XKBCOMMON_X11}")
132-
133-
find_library(LIB_XKBCOMMON NAMES xkbcommon REQUIRED)
134-
message(STATUS "Found Qt5 dependency: xkbcommon : ${LIB_XKBCOMMON}")
135-
136-
find_library(LIB_XAU NAMES Xau REQUIRED)
137-
message(STATUS "Found Qt5 dependency: Xau : ${LIB_XAU}")
138-
139-
endif()
140-
141-
find_library(LIB_QTHARFBUZZ NAMES qtharfbuzz REQUIRED)
142-
message(STATUS "Found Qt5 dependency: qtharfbuzz : ${LIB_QTHARFBUZZ}")
143-
144-
find_library(LIB_QTPCR2 NAMES qtpcre2 REQUIRED)
145-
message(STATUS "Found Qt5 dependency: qtpcre2 : ${LIB_QTPCR2}")
146-
147-
find_library(LIB_Z NAMES z REQUIRED)
148-
message(STATUS "Found Qt5 dependency: z : ${LIB_Z}")
149-
150-
# Qt5 dependencies libraries, order is important, should be last
151-
add_library(Qt5_Dependencies
152-
INTERFACE
153-
)
154-
target_link_libraries(Qt5_Dependencies
155-
INTERFACE
156-
${LIB_QTLIBPNG}
157-
${LIB_QTHARFBUZZ}
158-
${LIB_QTPCR2}
159-
$<$<PLATFORM_ID:Linux>:${LIB_FONTCONFIG}>
160-
$<$<PLATFORM_ID:Linux>:${LIB_FREETYPE}>
161-
$<$<PLATFORM_ID:Linux>:${LIB_EXPAT}>
162-
$<$<PLATFORM_ID:Linux>:${LIB_XCB_EWMH}>
163-
$<$<PLATFORM_ID:Linux>:${LIB_XCB_ICCCM}>
164-
$<$<PLATFORM_ID:Linux>:${LIB_XCB_IMAGE}>
165-
$<$<PLATFORM_ID:Linux>:${LIB_XCB_KEYSYMS}>
166-
$<$<PLATFORM_ID:Linux>:${LIB_XCB_RANDR}>
167-
$<$<PLATFORM_ID:Linux>:${LIB_XCB_RENDER_UTIL}>
168-
$<$<PLATFORM_ID:Linux>:${LIB_XCB_RENDER}>
169-
$<$<PLATFORM_ID:Linux>:${LIB_XCB_SHAPE}>
170-
$<$<PLATFORM_ID:Linux>:${LIB_XCB_SHM}>
171-
$<$<PLATFORM_ID:Linux>:${LIB_XCB_SYNC}>
172-
$<$<PLATFORM_ID:Linux>:${LIB_XCB_UTIL}>
173-
$<$<PLATFORM_ID:Linux>:${LIB_XCB_XFIXES}>
174-
$<$<PLATFORM_ID:Linux>:${LIB_XCB_XINERAMA}>
175-
$<$<PLATFORM_ID:Linux>:${LIB_XCB_XKB}>
176-
$<$<PLATFORM_ID:Linux>:${LIB_XCB}>
177-
$<$<PLATFORM_ID:Linux>:${LIB_XKBCOMMON_X11}>
178-
$<$<PLATFORM_ID:Linux>:${LIB_XKBCOMMON}>
179-
$<$<PLATFORM_ID:Linux>:${LIB_XAU}>
180-
${LIB_Z}
181-
)
182-
183-
if(NOT WIN32 AND NOT MINGW)
184-
target_link_libraries(Qt5_Dependencies
185-
INTERFACE
186-
${CMAKE_DL_LIBS} # Ensure dynamic loading is available.
187-
)
188-
endif()
189-
190-
add_library(Qt5::Dependencies ALIAS Qt5_Dependencies)
191-
192-
# Restore CMAKE_FIND_LIBRARY_SUFFIXES state.
193-
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_CMAKE_FIND_LIBRARY_SUFFIXES})

contrib/debian/changelog

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ bitcoin (0.13.1-trusty1) trusty; urgency=medium
4545
* New upstream release.
4646
* Backport updated bitcoin-qt.desktop from upstream master
4747
* Add zmq dependency
48-
* Switch to Qt5 (breaks precise, but that was already broken by C++11)
48+
* Switch to Qt6 (breaks precise, but that was already broken by C++11)
4949

5050
-- Matt Corallo (BlueMatt) <[email protected]> Thu, 27 Oct 2016 17:32:00 -0400
5151

contrib/debian/rules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ override_dh_auto_clean:
1212
if [ -f Makefile ]; then $(MAKE) distclean; fi
1313
rm -rf Makefile.in aclocal.m4 configure src/Makefile.in src/bitcoin-config.h.in src/build-aux src/qt/Makefile.in src/qt/test/Makefile.in src/test/Makefile.in
1414

15-
QT=$(shell dpkg-vendor --derives-from Ubuntu && echo qt4 || echo qt5)
15+
QT=$(shell dpkg-vendor --derives-from Ubuntu && echo qt4 || echo qt6)
1616

1717
# Yea, autogen should be run on the source archive, but I like doing git archive
1818
override_dh_auto_configure:

contrib/guix/libexec/build.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -365,20 +365,22 @@ mkdir -p "$DISTSRC"
365365
;;
366366
esac
367367

368-
# Empty environment variables for x86_64-apple-darwin
369-
if [[ "$HOST" == "x86_64-apple-darwin"* ]]; then
370-
unset LIBRARY_PATH
368+
# Empty environment variables for all Darwin builds to prevent GCC header conflicts
369+
if [[ "$HOST" == *"darwin"* ]]; then
371370
unset CPATH
372371
unset C_INCLUDE_PATH
373372
unset CPLUS_INCLUDE_PATH
374373
unset OBJC_INCLUDE_PATH
375374
unset OBJCPLUS_INCLUDE_PATH
375+
unset CC
376+
unset CXX
377+
unset CPP
376378
fi
377379

378380

379381
# Configure this DISTSRC for $HOST
380382
# shellcheck disable=SC2086
381-
env CFLAGS="${HOST_CFLAGS}" CXXFLAGS="${HOST_CXXFLAGS}" OBJCXXFLAGS="${HOST_OBJCXXFLAGS}" \
383+
env PKG_CONFIG_PATH="${BASEPREFIX}/${HOST}/lib/pkgconfig:$PKG_CONFIG_PATH" CFLAGS="${HOST_CFLAGS}" CXXFLAGS="${HOST_CXXFLAGS}" OBJCXXFLAGS="${HOST_OBJCXXFLAGS}" LDFLAGS="${HOST_LDFLAGS}" \
382384
cmake --toolchain "${BASEPREFIX}/${HOST}/toolchain.cmake" -S . -B build \
383385
-DCMAKE_INSTALL_PREFIX="${INSTALLPATH}" \
384386
-DCMAKE_EXE_LINKER_FLAGS="${HOST_LDFLAGS}" \

contrib/rpm/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ difficult for a user to recover from backup in the event of a system failure.
7272

7373
## Graphical User Interface and Qt Version
7474

75-
The RPM spec file will by default build the GUI client linked against the Qt5
75+
The RPM spec file will by default build the GUI client linked against the Qt6
7676
libraries. If you wish instead to link against the Qt4 libraries you need to
7777
pass the switch `-D '_use_qt4 1'` at build time to the `rpmbuild` or `mock`
7878
command used to build the packages.

contrib/rpm/bitcoin.spec

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
%if 0%{?_use_qt4}
1010
%define buildargs --with-qrencode --with-gui=qt4
1111
%else
12-
%define buildargs --with-qrencode --with-gui=qt5
12+
%define buildargs --with-qrencode --with-gui=qt6
1313
%endif
1414
%endif
1515

@@ -67,9 +67,9 @@ Provides: %{name} = %{version}-%{release}
6767
%if 0%{?_use_qt4}
6868
BuildRequires: qt-devel
6969
%else
70-
BuildRequires: qt5-qtbase-devel
71-
# for /usr/bin/lrelease-qt5
72-
BuildRequires: qt5-linguist
70+
BuildRequires: qt6-qtbase-devel
71+
# for /usr/bin/lrelease-qt6
72+
BuildRequires: qt6-linguist
7373
%endif
7474
BuildRequires: protobuf-devel
7575
BuildRequires: qrencode-devel
@@ -429,7 +429,7 @@ rm -rf %{buildroot}
429429
* Fri Feb 26 2016 Alice Wonder <[email protected]> - 0.12.0-2
430430
- Rename Qt package from bitcoin to bitcoin-core
431431
- Make building of the Qt package optional
432-
- When building the Qt package, default to Qt5 but allow building
432+
- When building the Qt package, default to Qt6 but allow building
433433
- against Qt4
434434
- Only run SELinux stuff in post scripts if it is not set to disabled
435435

depends/Makefile

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ FALLBACK_DOWNLOAD_PATH ?= https://firo.org/depends-sources
4747
FALLBACK_DOWNLOAD_PATH_ALTERNATIVE ?= https://bitcoincore.org/depends-sources
4848

4949
C_STANDARD ?= c11
50-
CXX_STANDARD ?= c++17
50+
CXX_STANDARD ?= c++20
5151

5252
BUILD = $(shell ./config.guess)
5353
PATCHES_PATH = $(BASEDIR)/patches
@@ -169,7 +169,7 @@ zmq_packages_$(NO_ZMQ) = $(zmq_packages)
169169
multiprocess_packages_$(MULTIPROCESS) = $(multiprocess_packages)
170170

171171
packages += $($(host_arch)_$(host_os)_packages) $($(host_os)_packages) $(boost_packages_) $(libevent_packages_) $(qt_packages_) $(wallet_packages_)
172-
native_packages += $($(host_arch)_$(host_os)_native_packages) $($(host_os)_native_packages)
172+
native_packages += $($(host_arch)_$(host_os)_native_packages) $($(host_os)_native_packages) $(qt_native_packages_)
173173

174174
ifneq ($(zmq_packages_),)
175175
packages += $(zmq_packages)
@@ -203,32 +203,6 @@ else
203203
crosscompiling=TRUE
204204
endif
205205

206-
$(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_build_id)
207-
$(AT)@mkdir -p $(@D)Add commentMore actions
208-
$(AT)sed -e 's|@HOST@|$(host)|' \
209-
-e 's|@CC@|$(host_CC)|' \
210-
-e 's|@CXX@|$(host_CXX)|' \
211-
-e 's|@AR@|$(host_AR)|' \
212-
-e 's|@RANLIB@|$(host_RANLIB)|' \
213-
-e 's|@NM@|$(host_NM)|' \
214-
-e 's|@STRIP@|$(host_STRIP)|' \
215-
-e 's|@build_os@|$(build_os)|' \
216-
-e 's|@host_os@|$(host_os)|' \
217-
-e 's|@CFLAGS@|$(strip $(host_CFLAGS) $(host_$(release_type)_CFLAGS))|' \
218-
-e 's|@CXXFLAGS@|$(strip $(host_CXXFLAGS) $(host_$(release_type)_CXXFLAGS))|' \
219-
-e 's|@CPPFLAGS@|$(strip $(host_CPPFLAGS) $(host_$(release_type)_CPPFLAGS))|' \
220-
-e 's|@LDFLAGS@|$(strip $(host_LDFLAGS) $(host_$(release_type)_LDFLAGS))|' \
221-
-e 's|@allow_host_packages@|$(ALLOW_HOST_PACKAGES)|' \
222-
-e 's|@no_qt@|$(NO_QT)|' \
223-
-e 's|@no_qr@|$(NO_QR)|' \
224-
-e 's|@no_zmq@|$(NO_ZMQ)|' \
225-
-e 's|@no_wallet@|$(NO_WALLET)|' \
226-
-e 's|@no_bdb@|$(NO_BDB)|' \
227-
-e 's|@no_sqlite@|$(NO_SQLITE)|' \
228-
-e 's|@debug@|$(DEBUG)|' \
229-
$< > $@
230-
$(AT)touch $@
231-
232206
$(host_prefix)/toolchain.cmake : toolchain.cmake.in $(host_prefix)/.stamp_$(final_build_id)
233207
@mkdir -p $(@D)
234208
sed -e 's|@depends_crosscompiling@|$(crosscompiling)|' \
@@ -298,7 +272,7 @@ clean-all: clean
298272
clean:
299273
@rm -rf $(WORK_PATH) $(BASE_CACHE) $(BUILD) *.log
300274

301-
install: check-packages $(host_prefix)/toolchain.cmake $(host_prefix)/share/config.site
275+
install: check-packages $(host_prefix)/toolchain.cmake
302276

303277

304278
download-one: check-sources $(all_sources)

0 commit comments

Comments
 (0)