diff --git a/.github/ISSUE_TEMPLATE/good_first_issue.yml b/.github/ISSUE_TEMPLATE/good_first_issue.yml index 133937c011a..2a486b3f2b4 100644 --- a/.github/ISSUE_TEMPLATE/good_first_issue.yml +++ b/.github/ISSUE_TEMPLATE/good_first_issue.yml @@ -28,7 +28,7 @@ body: id: useful-skills attributes: label: Useful Skills - description: For example, “`std::thread`”, “Qt5 GUI and async GUI design” or “basic understanding of Bitcoin mining and the Bitcoin Core RPC interface”. + description: For example, “`std::thread`”, “Qt6 GUI and async GUI design” or “basic understanding of Bitcoin mining and the Bitcoin Core RPC interface”. value: | * Compiling Bitcoin Core from source * Running the C++ unit tests and the Python functional tests diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 12f8b2486b4..2ef7bd78e9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,7 +73,7 @@ jobs: echo "TEST_BASE=$(git rev-list -n$((${{ env.MAX_COUNT }} + 1)) --reverse HEAD $EXCLUDE_MERGE_BASE_ANCESTORS | head -1)" >> "$GITHUB_ENV" - run: | sudo apt-get update - sudo apt-get install clang ccache build-essential cmake pkgconf python3-zmq libevent-dev libboost-dev libsqlite3-dev libdb++-dev systemtap-sdt-dev libzmq3-dev qtbase5-dev qttools5-dev qttools5-dev-tools qtwayland5 libqrencode-dev -y + sudo apt-get install clang ccache build-essential cmake ninja-build pkgconf python3-zmq libevent-dev libboost-dev libsqlite3-dev libdb++-dev systemtap-sdt-dev libzmq3-dev qt6-base-dev qt6-tools-dev qt6-l10n-tools libqrencode-dev -y - name: Compile and run tests run: | # Run tests on commits after the last merge commit and before the PR head commit @@ -130,7 +130,7 @@ jobs: run: | # A workaround for "The `brew link` step did not complete successfully" error. brew install --quiet python@3 || brew link --overwrite python@3 - brew install --quiet coreutils ninja pkgconf gnu-getopt ccache boost libevent zeromq qt@5 qrencode + brew install --quiet coreutils ninja pkgconf gnu-getopt ccache boost libevent zeromq qt@6 qrencode - name: Set Ccache directory run: echo "CCACHE_DIR=${RUNNER_TEMP}/ccache_dir" >> "$GITHUB_ENV" diff --git a/CMakeLists.txt b/CMakeLists.txt index c5ebd2f04d5..006e0cc41b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -174,7 +174,7 @@ if(BUILD_GUI) if(BUILD_GUI_TESTS) list(APPEND qt_components Test) endif() - find_package(Qt 5.11.3 MODULE REQUIRED + find_package(Qt 6.2 MODULE REQUIRED COMPONENTS ${qt_components} ) unset(qt_components) diff --git a/ci/test/00_setup_env.sh b/ci/test/00_setup_env.sh index 9f794c25235..cf8fbb006f5 100755 --- a/ci/test/00_setup_env.sh +++ b/ci/test/00_setup_env.sh @@ -64,7 +64,7 @@ export BASE_OUTDIR=${BASE_OUTDIR:-$BASE_SCRATCH_DIR/out} # The folder for previous release binaries. # This folder exists only on the ci guest, and on the ci host as a volume. export PREVIOUS_RELEASES_DIR=${PREVIOUS_RELEASES_DIR:-$BASE_ROOT_DIR/prev_releases} -export CI_BASE_PACKAGES=${CI_BASE_PACKAGES:-build-essential pkgconf curl ca-certificates ccache python3 rsync git procps bison e2fsprogs cmake} +export CI_BASE_PACKAGES=${CI_BASE_PACKAGES:-build-essential pkgconf curl ca-certificates ccache python3 rsync git procps bison e2fsprogs cmake ninja-build} export GOAL=${GOAL:-install} export DIR_QA_ASSETS=${DIR_QA_ASSETS:-${BASE_SCRATCH_DIR}/qa-assets} export CI_RETRY_EXE=${CI_RETRY_EXE:-"retry --"} diff --git a/ci/test/00_setup_env_native_asan.sh b/ci/test/00_setup_env_native_asan.sh index 4066b14fc9b..bd67dba6888 100755 --- a/ci/test/00_setup_env_native_asan.sh +++ b/ci/test/00_setup_env_native_asan.sh @@ -20,7 +20,7 @@ fi export CONTAINER_NAME=ci_native_asan export APT_LLVM_V="20" -export PACKAGES="systemtap-sdt-dev clang-${APT_LLVM_V} llvm-${APT_LLVM_V} libclang-rt-${APT_LLVM_V}-dev python3-zmq qtbase5-dev qttools5-dev qttools5-dev-tools libevent-dev libboost-dev libdb5.3++-dev libzmq3-dev libqrencode-dev libsqlite3-dev ${BPFCC_PACKAGE}" +export PACKAGES="systemtap-sdt-dev clang-${APT_LLVM_V} llvm-${APT_LLVM_V} libclang-rt-${APT_LLVM_V}-dev python3-zmq qt6-base-dev qt6-tools-dev qt6-l10n-tools libevent-dev libboost-dev libdb5.3++-dev libzmq3-dev libqrencode-dev libsqlite3-dev ${BPFCC_PACKAGE}" export NO_DEPENDS=1 export GOAL="install" export BITCOIN_CONFIG="\ diff --git a/ci/test/00_setup_env_native_centos.sh b/ci/test/00_setup_env_native_centos.sh index c423d788eb8..4f06a29daf4 100755 --- a/ci/test/00_setup_env_native_centos.sh +++ b/ci/test/00_setup_env_native_centos.sh @@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_native_centos export CI_IMAGE_NAME_TAG="quay.io/centos/centos:stream10" -export CI_BASE_PACKAGES="gcc-c++ glibc-devel libstdc++-devel ccache make git python3 python3-pip which patch xz procps-ng ksh rsync coreutils bison e2fsprogs cmake" +export CI_BASE_PACKAGES="gcc-c++ glibc-devel libstdc++-devel ccache make ninja-build git python3 python3-pip which patch xz procps-ng ksh rsync coreutils bison e2fsprogs cmake" export PIP_PACKAGES="pyzmq" export DEP_OPTS="DEBUG=1" # Temporarily enable a DEBUG=1 build to check for GCC-bug-117966 regressions. This can be removed once the minimum GCC version is bumped to 12 in the previous releases task, see https://github.com/bitcoin/bitcoin/issues/31436#issuecomment-2530717875 export GOAL="install" diff --git a/ci/test/00_setup_env_native_tidy.sh b/ci/test/00_setup_env_native_tidy.sh index b5277d13949..08a7cbbf7e4 100755 --- a/ci/test/00_setup_env_native_tidy.sh +++ b/ci/test/00_setup_env_native_tidy.sh @@ -10,7 +10,7 @@ export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04" export CONTAINER_NAME=ci_native_tidy export TIDY_LLVM_V="19" export APT_LLVM_V="${TIDY_LLVM_V}" -export PACKAGES="clang-${TIDY_LLVM_V} libclang-${TIDY_LLVM_V}-dev llvm-${TIDY_LLVM_V}-dev libomp-${TIDY_LLVM_V}-dev clang-tidy-${TIDY_LLVM_V} jq libevent-dev libboost-dev libzmq3-dev systemtap-sdt-dev qtbase5-dev qttools5-dev qttools5-dev-tools libqrencode-dev libsqlite3-dev libdb++-dev" +export PACKAGES="clang-${TIDY_LLVM_V} libclang-${TIDY_LLVM_V}-dev llvm-${TIDY_LLVM_V}-dev libomp-${TIDY_LLVM_V}-dev clang-tidy-${TIDY_LLVM_V} jq libevent-dev libboost-dev libzmq3-dev systemtap-sdt-dev qt6-base-dev qt6-tools-dev qt6-l10n-tools libqrencode-dev libsqlite3-dev libdb++-dev" export NO_DEPENDS=1 export RUN_UNIT_TESTS=false export RUN_FUNCTIONAL_TESTS=false diff --git a/ci/test/01_base_install.sh b/ci/test/01_base_install.sh index 1344563268f..d61aaca3f0c 100755 --- a/ci/test/01_base_install.sh +++ b/ci/test/01_base_install.sh @@ -34,7 +34,8 @@ fi if [[ $CI_IMAGE_NAME_TAG == *centos* ]]; then bash -c "dnf -y install epel-release" - bash -c "dnf -y --allowerasing install $CI_BASE_PACKAGES $PACKAGES" + # The ninja-build package is available in the CRB repository. + bash -c "dnf -y --allowerasing --enablerepo crb install $CI_BASE_PACKAGES $PACKAGES" elif [ "$CI_OS_NAME" != "macos" ]; then if [[ -n "${APPEND_APT_SOURCES_LIST}" ]]; then echo "${APPEND_APT_SOURCES_LIST}" >> /etc/apt/sources.list diff --git a/cmake/module/FindQt.cmake b/cmake/module/FindQt.cmake index 2e43294a996..d98af5bb56b 100644 --- a/cmake/module/FindQt.cmake +++ b/cmake/module/FindQt.cmake @@ -27,19 +27,6 @@ if(CMAKE_HOST_APPLE) endif() endif() -# Save CMAKE_FIND_ROOT_PATH_MODE_LIBRARY state. -unset(_qt_find_root_path_mode_library_saved) -if(DEFINED CMAKE_FIND_ROOT_PATH_MODE_LIBRARY) - set(_qt_find_root_path_mode_library_saved ${CMAKE_FIND_ROOT_PATH_MODE_LIBRARY}) -endif() - -# The Qt config files internally use find_library() calls for all -# dependencies to ensure their availability. In turn, the find_library() -# inspects the well-known locations on the file system; therefore, it must -# be able to find platform-specific system libraries, for example: -# /usr/x86_64-w64-mingw32/lib/libm.a or /usr/arm-linux-gnueabihf/lib/libm.a. -set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH) - find_package(Qt${Qt_FIND_VERSION_MAJOR} ${Qt_FIND_VERSION} COMPONENTS ${Qt_FIND_COMPONENTS} HINTS ${_qt_homebrew_prefix} @@ -47,14 +34,6 @@ find_package(Qt${Qt_FIND_VERSION_MAJOR} ${Qt_FIND_VERSION} ) unset(_qt_homebrew_prefix) -# Restore CMAKE_FIND_ROOT_PATH_MODE_LIBRARY state. -if(DEFINED _qt_find_root_path_mode_library_saved) - set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ${_qt_find_root_path_mode_library_saved}) - unset(_qt_find_root_path_mode_library_saved) -else() - unset(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY) -endif() - include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Qt REQUIRED_VARS Qt${Qt_FIND_VERSION_MAJOR}_DIR diff --git a/contrib/devtools/symbol-check.py b/contrib/devtools/symbol-check.py index 564f1db5ac0..17ea6d60e54 100755 --- a/contrib/devtools/symbol-check.py +++ b/contrib/devtools/symbol-check.py @@ -112,6 +112,7 @@ ELF_ALLOWED_LIBRARIES = { 'libfontconfig.so.1', # font support 'libfreetype.so.6', # font parsing 'libdl.so.2', # programming interface to dynamic linker +'libxcb-cursor.so.0', 'libxcb-icccm.so.4', 'libxcb-image.so.0', 'libxcb-shm.so.0', @@ -146,8 +147,9 @@ MACHO_ALLOWED_LIBRARIES = { 'IOSurface', # cross process image/drawing buffers 'libobjc.A.dylib', # Objective-C runtime library 'Metal', # 3D graphics -'Security', # access control and authentication 'QuartzCore', # animation +'Security', # access control and authentication +'UniformTypeIdentifiers', # collection of types that map to MIME and file types } PE_ALLOWED_LIBRARIES = { @@ -158,7 +160,17 @@ PE_ALLOWED_LIBRARIES = { 'SHELL32.dll', # shell API 'WS2_32.dll', # sockets # bitcoin-qt only +'api-ms-win-core-synch-l1-2-0.dll', # Synchronization Primitives API +'api-ms-win-core-winrt-l1-1-0.dll', # Windows Runtime API +'api-ms-win-core-winrt-string-l1-1-0.dll', # WinRT String API +'AUTHZ.dll', # Windows Authorization Framework +'comdlg32.dll', # Common Dialog Box Library +'d3d11.dll', # Direct3D 11 API +'d3d12.dll', # Direct3D 12 API +'d3d9.dll', # Direct3D 9 API 'dwmapi.dll', # desktop window manager +'DWrite.dll', # DirectX Typography Services +'dxgi.dll', # DirectX Graphics Infrastructure 'GDI32.dll', # graphics device interface 'IMM32.dll', # input method editor 'NETAPI32.dll', # network management @@ -171,6 +183,8 @@ PE_ALLOWED_LIBRARIES = { 'VERSION.dll', # version checking 'WINMM.dll', # WinMM audio API 'WTSAPI32.dll', # Remote Desktop +'SETUPAPI.dll', # Windows Setup API +'SHCORE.dll', # Stream Handler Core } def check_version(max_versions, version, arch) -> bool: diff --git a/contrib/guix/libexec/build.sh b/contrib/guix/libexec/build.sh index 389706a8cf4..26180bae24b 100755 --- a/contrib/guix/libexec/build.sh +++ b/contrib/guix/libexec/build.sh @@ -69,8 +69,9 @@ unset CPLUS_INCLUDE_PATH unset OBJC_INCLUDE_PATH unset OBJCPLUS_INCLUDE_PATH -export C_INCLUDE_PATH="${NATIVE_GCC}/include" -export CPLUS_INCLUDE_PATH="${NATIVE_GCC}/include/c++:${NATIVE_GCC}/include" +# Set native toolchain +build_CC="${NATIVE_GCC}/bin/gcc -isystem ${NATIVE_GCC}/include" +build_CXX="${NATIVE_GCC}/bin/g++ -isystem ${NATIVE_GCC}/include/c++ -isystem ${NATIVE_GCC}/include" case "$HOST" in *darwin*) export LIBRARY_PATH="${NATIVE_GCC}/lib" ;; # Required for qt/qmake @@ -171,6 +172,8 @@ make -C depends --jobs="$JOBS" HOST="$HOST" \ ${SOURCES_PATH+SOURCES_PATH="$SOURCES_PATH"} \ ${BASE_CACHE+BASE_CACHE="$BASE_CACHE"} \ ${SDK_PATH+SDK_PATH="$SDK_PATH"} \ + ${build_CC+build_CC="$build_CC"} \ + ${build_CXX+build_CXX="$build_CXX"} \ x86_64_linux_CC=x86_64-linux-gnu-gcc \ x86_64_linux_CXX=x86_64-linux-gnu-g++ \ x86_64_linux_AR=x86_64-linux-gnu-gcc-ar \ @@ -181,8 +184,6 @@ make -C depends --jobs="$JOBS" HOST="$HOST" \ case "$HOST" in *darwin*) # Unset now that Qt is built - unset C_INCLUDE_PATH - unset CPLUS_INCLUDE_PATH unset LIBRARY_PATH ;; esac diff --git a/contrib/guix/manifest.scm b/contrib/guix/manifest.scm index 4e7e9552182..c1e72bd1e64 100644 --- a/contrib/guix/manifest.scm +++ b/contrib/guix/manifest.scm @@ -13,6 +13,7 @@ ((gnu packages linux) #:select (linux-libre-headers-6.1)) (gnu packages llvm) (gnu packages mingw) + (gnu packages ninja) (gnu packages pkg-config) ((gnu packages python) #:select (python-minimal)) ((gnu packages python-build) #:select (python-tomli python-poetry-core)) @@ -547,6 +548,7 @@ inspecting signatures in Mach-O binaries.") gcc-toolchain-13 cmake-minimal gnu-make + ninja ;; Scripting python-minimal ;; (3.10) ;; Git diff --git a/depends/Makefile b/depends/Makefile index f03db29eb30..9eb00a425a5 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -157,6 +157,7 @@ libevent_packages_$(NO_LIBEVENT) = $(libevent_packages) qrencode_packages_$(NO_QR) = $(qrencode_$(host_os)_packages) qt_packages_$(NO_QT) = $(qt_packages) $(qt_$(host_os)_packages) $(qt_$(host_arch)_$(host_os)_packages) $(qrencode_packages_) +qt_native_packages_$(NO_QT) = $(qt_native_packages) bdb_packages_$(NO_BDB) = $(bdb_packages) wallet_packages_$(NO_WALLET) = $(bdb_packages_) $(sqlite_packages) @@ -166,7 +167,7 @@ multiprocess_packages_$(MULTIPROCESS) = $(multiprocess_packages) usdt_packages_$(NO_USDT) = $(usdt_$(host_os)_packages) packages += $($(host_arch)_$(host_os)_packages) $($(host_os)_packages) $(boost_packages_) $(libevent_packages_) $(qt_packages_) $(wallet_packages_) $(usdt_packages_) -native_packages += $($(host_arch)_$(host_os)_native_packages) $($(host_os)_native_packages) +native_packages += $($(host_arch)_$(host_os)_native_packages) $($(host_os)_native_packages) $(qt_native_packages_) ifneq ($(zmq_packages_),) packages += $(zmq_packages) diff --git a/depends/README.md b/depends/README.md index 87d607e371c..ab1df59a884 100644 --- a/depends/README.md +++ b/depends/README.md @@ -47,7 +47,7 @@ The paths are automatically configured and no other options are needed. Skip the following packages if you don't intend to use the GUI and will build with [`NO_QT=1`](#dependency-options): - apt install bison g++ pkgconf python3 xz-utils + apt install bison g++ ninja-build pkgconf python3 xz-utils #### For macOS cross compilation diff --git a/depends/funcs.mk b/depends/funcs.mk index b07432adec9..e7cc288bfd6 100644 --- a/depends/funcs.mk +++ b/depends/funcs.mk @@ -40,7 +40,8 @@ define fetch_file endef define int_get_build_recipe_hash -$(eval $(1)_all_file_checksums:=$(shell $(build_SHA256SUM) $(meta_depends) packages/$(1).mk $(addprefix $(PATCHES_PATH)/$(1)/,$($(1)_patches)) | cut -d" " -f1)) +$(eval $(1)_patches_path?=$(PATCHES_PATH)/$(1)) +$(eval $(1)_all_file_checksums:=$(shell $(build_SHA256SUM) $(meta_depends) packages/$(1).mk $(addprefix $($(1)_patches_path)/,$($(1)_patches)) | cut -d" " -f1)) $(eval $(1)_recipe_hash:=$(shell echo -n "$($(1)_all_file_checksums)" | $(build_SHA256SUM) | cut -d" " -f1)) endef @@ -219,7 +220,7 @@ $($(1)_extracted): | $($(1)_fetched) $($(1)_preprocessed): | $($(1)_extracted) echo Preprocessing $(1)... mkdir -p $$(@D) $($(1)_patch_dir) - $(foreach patch,$($(1)_patches),cd $(PATCHES_PATH)/$(1); cp $(patch) $($(1)_patch_dir) ;) + $(foreach patch,$($(1)_patches),cd $($(1)_patches_path); cp $(patch) $($(1)_patch_dir) ;) { cd $$(@D); $($(1)_preprocess_cmds); } $$($(1)_logging) touch $$@ $($(1)_configured): | $($(1)_dependencies) $($(1)_preprocessed) diff --git a/depends/packages/libxcb_util_cursor.mk b/depends/packages/libxcb_util_cursor.mk new file mode 100644 index 00000000000..b308890638d --- /dev/null +++ b/depends/packages/libxcb_util_cursor.mk @@ -0,0 +1,31 @@ +package=libxcb_util_cursor +$(package)_version=0.1.5 +$(package)_download_path=https://xcb.freedesktop.org/dist +$(package)_file_name=xcb-util-cursor-$($(package)_version).tar.gz +$(package)_sha256_hash=0e9c5446dc6f3beb8af6ebfcc9e27bcc6da6fe2860f7fc07b99144dfa568e93b +$(package)_dependencies=libxcb libxcb_util_render libxcb_util_image + +define $(package)_set_vars +$(package)_config_opts = --disable-static +$(package)_config_opts += --disable-dependency-tracking --enable-option-checking +endef + +define $(package)_preprocess_cmds + cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub . +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef + +define $(package)_postprocess_cmds + rm lib/*.la +endef diff --git a/depends/packages/native_qt.mk b/depends/packages/native_qt.mk new file mode 100644 index 00000000000..d4f41bf58f1 --- /dev/null +++ b/depends/packages/native_qt.mk @@ -0,0 +1,152 @@ +package=native_qt +include packages/qt_details.mk +$(package)_version=$(qt_details_version) +$(package)_download_path=$(qt_details_download_path) +$(package)_file_name=$(qt_details_qtbase_file_name) +$(package)_sha256_hash=$(qt_details_qtbase_sha256_hash) +$(package)_patches_path := $(qt_details_patches_path) +$(package)_patches := dont_hardcode_pwd.patch +$(package)_patches += qtbase-moc-ignore-gcc-macro.patch +$(package)_patches += qtbase_skip_tools.patch +$(package)_patches += rcc_hardcode_timestamp.patch +$(package)_patches += qttools_skip_dependencies.patch + +$(package)_qttranslations_file_name=$(qt_details_qttranslations_file_name) +$(package)_qttranslations_sha256_hash=$(qt_details_qttranslations_sha256_hash) + +$(package)_qttools_file_name=$(qt_details_qttools_file_name) +$(package)_qttools_sha256_hash=$(qt_details_qttools_sha256_hash) + +$(package)_extra_sources := $($(package)_qttranslations_file_name) +$(package)_extra_sources += $($(package)_qttools_file_name) + +$(package)_top_download_path=$(qt_details_top_download_path) +$(package)_top_cmakelists_file_name=$(qt_details_top_cmakelists_file_name) +$(package)_top_cmakelists_download_file=$(qt_details_top_cmakelists_download_file) +$(package)_top_cmakelists_sha256_hash=$(qt_details_top_cmakelists_sha256_hash) +$(package)_top_cmake_download_path=$(qt_details_top_cmake_download_path) +$(package)_top_cmake_ecmoptionaladdsubdirectory_file_name=$(qt_details_top_cmake_ecmoptionaladdsubdirectory_file_name) +$(package)_top_cmake_ecmoptionaladdsubdirectory_download_file=$(qt_details_top_cmake_ecmoptionaladdsubdirectory_download_file) +$(package)_top_cmake_ecmoptionaladdsubdirectory_sha256_hash=$(qt_details_top_cmake_ecmoptionaladdsubdirectory_sha256_hash) +$(package)_top_cmake_qttoplevelhelpers_file_name=$(qt_details_top_cmake_qttoplevelhelpers_file_name) +$(package)_top_cmake_qttoplevelhelpers_download_file=$(qt_details_top_cmake_qttoplevelhelpers_download_file) +$(package)_top_cmake_qttoplevelhelpers_sha256_hash=$(qt_details_top_cmake_qttoplevelhelpers_sha256_hash) + +$(package)_extra_sources += $($(package)_top_cmakelists_file_name)-$($(package)_version) +$(package)_extra_sources += $($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name)-$($(package)_version) +$(package)_extra_sources += $($(package)_top_cmake_qttoplevelhelpers_file_name)-$($(package)_version) + +define $(package)_set_vars +# Build options. +$(package)_config_opts := -release +$(package)_config_opts += -make tools +$(package)_config_opts += -no-pkg-config +$(package)_config_opts += -no-reduce-relocations +$(package)_config_opts += -no-use-gold-linker +$(package)_config_opts += -prefix $(host_prefix) +$(package)_config_opts += -static + +# Modules. +$(package)_config_opts += -no-feature-concurrent +$(package)_config_opts += -no-feature-network +$(package)_config_opts += -no-feature-printsupport +$(package)_config_opts += -no-feature-sql +$(package)_config_opts += -no-feature-testlib +$(package)_config_opts += -no-feature-xml +$(package)_config_opts += -no-gui +$(package)_config_opts += -no-widgets + +$(package)_config_opts += -no-glib +$(package)_config_opts += -no-icu +$(package)_config_opts += -no-libudev +$(package)_config_opts += -no-openssl +$(package)_config_opts += -no-zstd +$(package)_config_opts += -qt-pcre +$(package)_config_opts += -qt-zlib +$(package)_config_opts += -no-feature-backtrace +$(package)_config_opts += -no-feature-permissions +$(package)_config_opts += -no-feature-process +$(package)_config_opts += -no-feature-settings + +# Core tools. +$(package)_config_opts += -no-feature-androiddeployqt +$(package)_config_opts += -no-feature-macdeployqt +$(package)_config_opts += -no-feature-windeployqt +$(package)_config_opts += -no-feature-qmake + +# Qt Tools module. +$(package)_config_opts += -feature-linguist +$(package)_config_opts += -no-feature-assistant +$(package)_config_opts += -no-feature-clang +$(package)_config_opts += -no-feature-clangcpp +$(package)_config_opts += -no-feature-designer +$(package)_config_opts += -no-feature-pixeltool +$(package)_config_opts += -no-feature-qdoc +$(package)_config_opts += -no-feature-qtattributionsscanner +$(package)_config_opts += -no-feature-qtdiag +$(package)_config_opts += -no-feature-qtplugininfo + +$(package)_config_env := CC="$$(build_CC)" +$(package)_config_env += CXX="$$(build_CXX)" + +$(package)_cmake_opts := -DCMAKE_EXE_LINKER_FLAGS="$$(build_LDFLAGS)" +ifneq ($(V),) +$(package)_cmake_opts += --log-level=STATUS +endif +endef + +define $(package)_fetch_cmds +$(call fetch_file,$(package),$($(package)_download_path),$($(package)_download_file),$($(package)_file_name),$($(package)_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qttranslations_file_name),$($(package)_qttranslations_file_name),$($(package)_qttranslations_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qttools_file_name),$($(package)_qttools_file_name),$($(package)_qttools_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_top_download_path),$($(package)_top_cmakelists_download_file),$($(package)_top_cmakelists_file_name)-$($(package)_version),$($(package)_top_cmakelists_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_top_cmake_download_path),$($(package)_top_cmake_ecmoptionaladdsubdirectory_download_file),$($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name)-$($(package)_version),$($(package)_top_cmake_ecmoptionaladdsubdirectory_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_top_cmake_download_path),$($(package)_top_cmake_qttoplevelhelpers_download_file),$($(package)_top_cmake_qttoplevelhelpers_file_name)-$($(package)_version),$($(package)_top_cmake_qttoplevelhelpers_sha256_hash)) +endef + +define $(package)_extract_cmds + mkdir -p $($(package)_extract_dir) && \ + echo "$($(package)_sha256_hash) $($(package)_source)" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + echo "$($(package)_qttranslations_sha256_hash) $($(package)_source_dir)/$($(package)_qttranslations_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + echo "$($(package)_qttools_sha256_hash) $($(package)_source_dir)/$($(package)_qttools_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + echo "$($(package)_top_cmakelists_sha256_hash) $($(package)_source_dir)/$($(package)_top_cmakelists_file_name)-$($(package)_version)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + echo "$($(package)_top_cmake_ecmoptionaladdsubdirectory_sha256_hash) $($(package)_source_dir)/$($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name)-$($(package)_version)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + echo "$($(package)_top_cmake_qttoplevelhelpers_sha256_hash) $($(package)_source_dir)/$($(package)_top_cmake_qttoplevelhelpers_file_name)-$($(package)_version)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + $(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + mkdir qtbase && \ + $(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source) -C qtbase && \ + mkdir qttranslations && \ + $(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttranslations_file_name) -C qttranslations && \ + mkdir qttools && \ + $(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttools_file_name) -C qttools && \ + cp $($(package)_source_dir)/$($(package)_top_cmakelists_file_name)-$($(package)_version) ./$($(package)_top_cmakelists_file_name) && \ + mkdir cmake && \ + cp $($(package)_source_dir)/$($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name)-$($(package)_version) cmake/$($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name) && \ + cp $($(package)_source_dir)/$($(package)_top_cmake_qttoplevelhelpers_file_name)-$($(package)_version) cmake/$($(package)_top_cmake_qttoplevelhelpers_file_name) +endef + +define $(package)_preprocess_cmds + patch -p1 -i $($(package)_patch_dir)/dont_hardcode_pwd.patch && \ + patch -p1 -i $($(package)_patch_dir)/qtbase-moc-ignore-gcc-macro.patch && \ + patch -p1 -i $($(package)_patch_dir)/qtbase_skip_tools.patch && \ + patch -p1 -i $($(package)_patch_dir)/rcc_hardcode_timestamp.patch && \ + patch -p1 -i $($(package)_patch_dir)/qttools_skip_dependencies.patch +endef + +define $(package)_config_cmds + cd qtbase && \ + ./configure -top-level $($(package)_config_opts) -- $($(package)_cmake_opts) +endef + +define $(package)_build_cmds + cmake --build . -- $$(filter -j%,$$(MAKEFLAGS)) +endef + +define $(package)_stage_cmds + cmake --install . --prefix $($(package)_staging_prefix_dir) +endef + +define $(package)_postprocess_cmds + rm -rf doc/ && \ + mv -t .. translations/ +endef diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk index 61cf66230c7..7a3699fedb3 100644 --- a/depends/packages/packages.mk +++ b/depends/packages/packages.mk @@ -8,9 +8,12 @@ qrencode_linux_packages = qrencode qrencode_darwin_packages = qrencode qrencode_mingw32_packages = qrencode -qt_linux_packages:=qt expat libxcb xcb_proto libXau xproto freetype fontconfig libxkbcommon libxcb_util libxcb_util_render libxcb_util_keysyms libxcb_util_image libxcb_util_wm +qt_linux_packages:=qt expat libxcb xcb_proto libXau xproto freetype fontconfig libxkbcommon libxcb_util libxcb_util_cursor libxcb_util_render libxcb_util_keysyms libxcb_util_image libxcb_util_wm qt_darwin_packages=qt qt_mingw32_packages=qt +ifneq ($(host),$(build)) +qt_native_packages := native_qt +endif bdb_packages=bdb sqlite_packages=sqlite diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index d41ac4e784e..a0354a427ea 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -1,119 +1,104 @@ package=qt -$(package)_version=5.15.16 -$(package)_download_path=https://download.qt.io/official_releases/qt/5.15/$($(package)_version)/submodules -$(package)_suffix=everywhere-opensource-src-$($(package)_version).tar.xz -$(package)_file_name=qtbase-$($(package)_suffix) -$(package)_sha256_hash=b04815058c18058b6ba837206756a2c87d1391f07a0dcb0dd314f970fd041592 -$(package)_linux_dependencies=freetype fontconfig libxcb libxkbcommon libxcb_util libxcb_util_render libxcb_util_keysyms libxcb_util_image libxcb_util_wm -$(package)_qt_libs=corelib network widgets gui plugins testlib -$(package)_linguist_tools = lrelease lupdate lconvert -$(package)_patches = qt.pro -$(package)_patches += qttools_src.pro -$(package)_patches += mac-qmake.conf -$(package)_patches += no-xlib.patch -$(package)_patches += dont_hardcode_pwd.patch +include packages/qt_details.mk +$(package)_version=$(qt_details_version) +$(package)_download_path=$(qt_details_download_path) +$(package)_file_name=$(qt_details_qtbase_file_name) +$(package)_sha256_hash=$(qt_details_qtbase_sha256_hash) +ifneq ($(host),$(build)) +$(package)_dependencies := native_$(package) +endif +$(package)_linux_dependencies=freetype fontconfig libxcb libxkbcommon libxcb_util libxcb_util_cursor libxcb_util_render libxcb_util_keysyms libxcb_util_image libxcb_util_wm +$(package)_patches_path := $(qt_details_patches_path) +$(package)_patches := dont_hardcode_pwd.patch $(package)_patches += qtbase-moc-ignore-gcc-macro.patch -$(package)_patches += no_warnings_for_symbols.patch +$(package)_patches += qtbase_avoid_native_float16.patch +$(package)_patches += qtbase_avoid_qmain.patch +$(package)_patches += qtbase_platformsupport.patch +$(package)_patches += qtbase_plugins_cocoa.patch +$(package)_patches += qtbase_skip_tools.patch $(package)_patches += rcc_hardcode_timestamp.patch -$(package)_patches += duplicate_lcqpafonts.patch -$(package)_patches += guix_cross_lib_path.patch -$(package)_patches += memory_resource.patch -$(package)_patches += clang_18_libpng.patch -$(package)_patches += utc_from_string_no_optimize.patch -$(package)_patches += windows_lto.patch -$(package)_patches += darwin_no_libm.patch +$(package)_patches += qttools_skip_dependencies.patch -$(package)_qttranslations_file_name=qttranslations-$($(package)_suffix) -$(package)_qttranslations_sha256_hash=415dbbb82a75dfc9a7be969e743bee54c0e6867be37bce4cf8f03da39f20112a +$(package)_qttranslations_file_name=$(qt_details_qttranslations_file_name) +$(package)_qttranslations_sha256_hash=$(qt_details_qttranslations_sha256_hash) -$(package)_qttools_file_name=qttools-$($(package)_suffix) -$(package)_qttools_sha256_hash=1cab11887faca54af59f4995ee435c9ad98d194e9e6889c846692c8b6815fc1c +$(package)_qttools_file_name=$(qt_details_qttools_file_name) +$(package)_qttools_sha256_hash=$(qt_details_qttools_sha256_hash) -$(package)_extra_sources = $($(package)_qttranslations_file_name) +$(package)_extra_sources := $($(package)_qttranslations_file_name) $(package)_extra_sources += $($(package)_qttools_file_name) +$(package)_top_download_path=$(qt_details_top_download_path) +$(package)_top_cmakelists_file_name=$(qt_details_top_cmakelists_file_name) +$(package)_top_cmakelists_download_file=$(qt_details_top_cmakelists_download_file) +$(package)_top_cmakelists_sha256_hash=$(qt_details_top_cmakelists_sha256_hash) +$(package)_top_cmake_download_path=$(qt_details_top_cmake_download_path) +$(package)_top_cmake_ecmoptionaladdsubdirectory_file_name=$(qt_details_top_cmake_ecmoptionaladdsubdirectory_file_name) +$(package)_top_cmake_ecmoptionaladdsubdirectory_download_file=$(qt_details_top_cmake_ecmoptionaladdsubdirectory_download_file) +$(package)_top_cmake_ecmoptionaladdsubdirectory_sha256_hash=$(qt_details_top_cmake_ecmoptionaladdsubdirectory_sha256_hash) +$(package)_top_cmake_qttoplevelhelpers_file_name=$(qt_details_top_cmake_qttoplevelhelpers_file_name) +$(package)_top_cmake_qttoplevelhelpers_download_file=$(qt_details_top_cmake_qttoplevelhelpers_download_file) +$(package)_top_cmake_qttoplevelhelpers_sha256_hash=$(qt_details_top_cmake_qttoplevelhelpers_sha256_hash) + +$(package)_extra_sources += $($(package)_top_cmakelists_file_name)-$($(package)_version) +$(package)_extra_sources += $($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name)-$($(package)_version) +$(package)_extra_sources += $($(package)_top_cmake_qttoplevelhelpers_file_name)-$($(package)_version) + define $(package)_set_vars -$(package)_config_env = QT_MAC_SDK_NO_VERSION_CHECK=1 -$(package)_config_opts_release = -release -$(package)_config_opts_release += -silent -$(package)_config_opts_debug = -debug -$(package)_config_opts_debug += -optimized-tools -$(package)_config_opts += -bindir $(build_prefix)/bin -$(package)_config_opts += -c++std c++2a -$(package)_config_opts += -confirm-license -$(package)_config_opts += -hostprefix $(build_prefix) -$(package)_config_opts += -no-compile-examples -$(package)_config_opts += -no-cups -$(package)_config_opts += -no-egl +$(package)_config_opts_release := -release +$(package)_config_opts_debug := -debug +$(package)_config_opts := -no-egl $(package)_config_opts += -no-eglfs $(package)_config_opts += -no-evdev $(package)_config_opts += -no-gif $(package)_config_opts += -no-glib $(package)_config_opts += -no-icu $(package)_config_opts += -no-ico -$(package)_config_opts += -no-iconv $(package)_config_opts += -no-kms $(package)_config_opts += -no-linuxfb $(package)_config_opts += -no-libjpeg $(package)_config_opts += -no-libproxy $(package)_config_opts += -no-libudev -$(package)_config_opts += -no-mimetype-database $(package)_config_opts += -no-mtdev +$(package)_config_opts += -no-opengl $(package)_config_opts += -no-openssl $(package)_config_opts += -no-openvg -$(package)_config_opts += -no-pkg-config $(package)_config_opts += -no-reduce-relocations $(package)_config_opts += -no-schannel $(package)_config_opts += -no-sctp $(package)_config_opts += -no-securetransport -$(package)_config_opts += -no-sql-db2 -$(package)_config_opts += -no-sql-ibase -$(package)_config_opts += -no-sql-oci -$(package)_config_opts += -no-sql-tds -$(package)_config_opts += -no-sql-mysql -$(package)_config_opts += -no-sql-odbc -$(package)_config_opts += -no-sql-psql -$(package)_config_opts += -no-sql-sqlite -$(package)_config_opts += -no-sql-sqlite2 $(package)_config_opts += -no-system-proxies $(package)_config_opts += -no-use-gold-linker $(package)_config_opts += -no-zstd $(package)_config_opts += -nomake examples $(package)_config_opts += -nomake tests -$(package)_config_opts += -nomake tools -$(package)_config_opts += -opensource $(package)_config_opts += -prefix $(host_prefix) +$(package)_config_opts += -qt-doubleconversion +$(package)_config_opts += -qt-harfbuzz +ifneq ($(host),$(build)) +$(package)_config_opts += -qt-host-path $(build_prefix) +endif $(package)_config_opts += -qt-libpng $(package)_config_opts += -qt-pcre -$(package)_config_opts += -qt-harfbuzz $(package)_config_opts += -qt-zlib $(package)_config_opts += -static -$(package)_config_opts += -v -$(package)_config_opts += -no-feature-bearermanagement +$(package)_config_opts += -no-feature-backtrace $(package)_config_opts += -no-feature-colordialog -$(package)_config_opts += -no-feature-commandlineparser $(package)_config_opts += -no-feature-concurrent $(package)_config_opts += -no-feature-dial -$(package)_config_opts += -no-feature-fontcombobox -$(package)_config_opts += -no-feature-ftp +$(package)_config_opts += -no-feature-gssapi $(package)_config_opts += -no-feature-http $(package)_config_opts += -no-feature-image_heuristic_mask $(package)_config_opts += -no-feature-keysequenceedit $(package)_config_opts += -no-feature-lcdnumber +$(package)_config_opts += -no-feature-libresolv $(package)_config_opts += -no-feature-networkdiskcache $(package)_config_opts += -no-feature-networkproxy -$(package)_config_opts += -no-feature-pdf -$(package)_config_opts += -no-feature-printdialog -$(package)_config_opts += -no-feature-printer -$(package)_config_opts += -no-feature-printpreviewdialog -$(package)_config_opts += -no-feature-printpreviewwidget +$(package)_config_opts += -no-feature-printsupport $(package)_config_opts += -no-feature-sessionmanager $(package)_config_opts += -no-feature-socks5 $(package)_config_opts += -no-feature-sql -$(package)_config_opts += -no-feature-sqlmodel -$(package)_config_opts += -no-feature-statemachine -$(package)_config_opts += -no-feature-syntaxhighlighter -$(package)_config_opts += -no-feature-textbrowser +$(package)_config_opts += -no-feature-textmarkdownreader $(package)_config_opts += -no-feature-textmarkdownwriter $(package)_config_opts += -no-feature-textodfwriter $(package)_config_opts += -no-feature-topleveldomain @@ -123,150 +108,172 @@ $(package)_config_opts += -no-feature-undogroup $(package)_config_opts += -no-feature-undostack $(package)_config_opts += -no-feature-undoview $(package)_config_opts += -no-feature-vnc -$(package)_config_opts += -no-feature-wizard -$(package)_config_opts += -no-feature-xml +$(package)_config_opts += -no-feature-vulkan -$(package)_config_opts_darwin = -no-dbus -$(package)_config_opts_darwin += -no-opengl -$(package)_config_opts_darwin += -pch -$(package)_config_opts_darwin += -no-feature-corewlan +# Core tools. +$(package)_config_opts += -no-feature-androiddeployqt +$(package)_config_opts += -no-feature-macdeployqt +$(package)_config_opts += -no-feature-qmake +$(package)_config_opts += -no-feature-windeployqt + +ifeq ($(host),$(build)) +# Qt Tools module. +$(package)_config_opts += -feature-linguist +$(package)_config_opts += -no-feature-assistant +$(package)_config_opts += -no-feature-clang +$(package)_config_opts += -no-feature-clangcpp +$(package)_config_opts += -no-feature-designer +$(package)_config_opts += -no-feature-pixeltool +$(package)_config_opts += -no-feature-qdoc +$(package)_config_opts += -no-feature-qtattributionsscanner +$(package)_config_opts += -no-feature-qtdiag +$(package)_config_opts += -no-feature-qtplugininfo +endif + +$(package)_config_opts_darwin := -no-dbus +$(package)_config_opts_darwin += -no-feature-printsupport $(package)_config_opts_darwin += -no-freetype -$(package)_config_opts_darwin += QMAKE_MACOSX_DEPLOYMENT_TARGET=$(OSX_MIN_VERSION) +$(package)_config_opts_darwin += -no-pkg-config -ifneq ($(build_os),darwin) -$(package)_config_opts_darwin += -xplatform macx-clang-linux -$(package)_config_opts_darwin += -device-option MAC_SDK_PATH=$(OSX_SDK) -$(package)_config_opts_darwin += -device-option MAC_SDK_VERSION=$(OSX_SDK_VERSION) -$(package)_config_opts_darwin += -device-option CROSS_COMPILE="llvm-" -$(package)_config_opts_darwin += -device-option MAC_TARGET=$(host) -$(package)_config_opts_darwin += -device-option XCODE_VERSION=$(XCODE_VERSION) -endif - -ifneq ($(build_arch),$(host_arch)) -$(package)_config_opts_aarch64_darwin += -device-option QMAKE_APPLE_DEVICE_ARCHS=arm64 -$(package)_config_opts_x86_64_darwin += -device-option QMAKE_APPLE_DEVICE_ARCHS=x86_64 -endif - -$(package)_config_opts_linux = -xcb -$(package)_config_opts_linux += -no-xcb-xlib -$(package)_config_opts_linux += -no-feature-xlib -$(package)_config_opts_linux += -system-freetype +$(package)_config_opts_linux := -dbus-runtime $(package)_config_opts_linux += -fontconfig -$(package)_config_opts_linux += -no-opengl -$(package)_config_opts_linux += -no-feature-vulkan -$(package)_config_opts_linux += -dbus-runtime +$(package)_config_opts_linux += -no-feature-process +$(package)_config_opts_linux += -no-feature-xlib +$(package)_config_opts_linux += -no-xcb-xlib +$(package)_config_opts_linux += -pkg-config +$(package)_config_opts_linux += -system-freetype +$(package)_config_opts_linux += -xcb ifneq ($(LTO),) $(package)_config_opts_linux += -ltcg endif -ifneq (,$(findstring clang,$($(package)_cxx))) - ifneq (,$(findstring -stdlib=libc++,$($(package)_cxx))) - $(package)_config_opts_linux += -platform linux-clang-libc++ -xplatform linux-clang-libc++ - else - $(package)_config_opts_linux += -platform linux-clang -xplatform linux-clang - endif -else - $(package)_config_opts_linux += -platform linux-g++ -xplatform bitcoin-linux-g++ -endif - -$(package)_config_opts_mingw32 = -no-opengl -$(package)_config_opts_mingw32 += -no-dbus +$(package)_config_opts_mingw32 := -no-dbus $(package)_config_opts_mingw32 += -no-freetype -$(package)_config_opts_mingw32 += -xplatform win32-g++ -$(package)_config_opts_mingw32 += "QMAKE_CFLAGS = '$($(package)_cflags) $($(package)_cppflags)'" -$(package)_config_opts_mingw32 += "QMAKE_CXX = '$($(package)_cxx)'" -$(package)_config_opts_mingw32 += "QMAKE_CXXFLAGS = '$($(package)_cxxflags) $($(package)_cppflags)'" -$(package)_config_opts_mingw32 += "QMAKE_LINK = '$($(package)_cxx)'" -$(package)_config_opts_mingw32 += "QMAKE_LFLAGS = '$($(package)_ldflags)'" -$(package)_config_opts_mingw32 += "QMAKE_LIB = '$($(package)_ar) rc'" -$(package)_config_opts_mingw32 += -device-option CROSS_COMPILE="$(host)-" -$(package)_config_opts_mingw32 += -pch +$(package)_config_opts_mingw32 += -no-pkg-config ifneq ($(LTO),) $(package)_config_opts_mingw32 += -ltcg endif + +# CMake build options. +$(package)_config_env := CC="$$($(package)_cc)" +$(package)_config_env += CXX="$$($(package)_cxx)" +$(package)_config_env_darwin := OBJC="$$($(package)_cc)" +$(package)_config_env_darwin += OBJCXX="$$($(package)_cxx)" + +$(package)_cmake_opts := -DCMAKE_PREFIX_PATH=$(host_prefix) +$(package)_cmake_opts += -DQT_FEATURE_cxx20=ON +$(package)_cmake_opts += -DQT_ENABLE_CXX_EXTENSIONS=OFF +ifneq ($(V),) +$(package)_cmake_opts += --log-level=STATUS +endif + +$(package)_cmake_opts += -DQT_USE_DEFAULT_CMAKE_OPTIMIZATION_FLAGS=ON +$(package)_cmake_opts += -DCMAKE_C_FLAGS="$$($(package)_cppflags) $$($$($(package)_type)_CFLAGS) -ffile-prefix-map=$$($(package)_extract_dir)=/usr" +$(package)_cmake_opts += -DCMAKE_C_FLAGS_RELEASE="$$($$($(package)_type)_release_CFLAGS)" +$(package)_cmake_opts += -DCMAKE_C_FLAGS_DEBUG="$$($$($(package)_type)_debug_CFLAGS)" +$(package)_cmake_opts += -DCMAKE_CXX_FLAGS="$$($(package)_cppflags) $$($$($(package)_type)_CXXFLAGS) -ffile-prefix-map=$$($(package)_extract_dir)=/usr" +$(package)_cmake_opts += -DCMAKE_CXX_FLAGS_RELEASE="$$($$($(package)_type)_release_CXXFLAGS)" +$(package)_cmake_opts += -DCMAKE_CXX_FLAGS_DEBUG="$$($$($(package)_type)_debug_CXXFLAGS)" +ifeq ($(host_os),darwin) +$(package)_cmake_opts += -DCMAKE_OBJC_FLAGS="$$($(package)_cppflags) $$($$($(package)_type)_CFLAGS) -ffile-prefix-map=$$($(package)_extract_dir)=/usr" +$(package)_cmake_opts += -DCMAKE_OBJC_FLAGS_RELEASE="$$($$($(package)_type)_release_CFLAGS)" +$(package)_cmake_opts += -DCMAKE_OBJC_FLAGS_DEBUG="$$($$($(package)_type)_debug_CFLAGS)" +$(package)_cmake_opts += -DCMAKE_OBJCXX_FLAGS="$$($(package)_cppflags) $$($$($(package)_type)_CXXFLAGS) -ffile-prefix-map=$$($(package)_extract_dir)=/usr" +$(package)_cmake_opts += -DCMAKE_OBJCXX_FLAGS_RELEASE="$$($$($(package)_type)_release_CXXFLAGS)" +$(package)_cmake_opts += -DCMAKE_OBJCXX_FLAGS_DEBUG="$$($$($(package)_type)_debug_CXXFLAGS)" +endif +$(package)_cmake_opts += -DCMAKE_EXE_LINKER_FLAGS="$$($$($(package)_type)_LDFLAGS)" +$(package)_cmake_opts += -DCMAKE_EXE_LINKER_FLAGS_RELEASE="$$($$($(package)_type)_release_LDFLAGS)" +$(package)_cmake_opts += -DCMAKE_EXE_LINKER_FLAGS_DEBUG="$$($$($(package)_type)_debug_LDFLAGS)" + +ifneq ($(host),$(build)) +$(package)_cmake_opts += -DCMAKE_SYSTEM_NAME=$($(host_os)_cmake_system_name) +$(package)_cmake_opts += -DCMAKE_SYSTEM_VERSION=$($(host_os)_cmake_system_version) +$(package)_cmake_opts += -DCMAKE_SYSTEM_PROCESSOR=$(host_arch) +endif +ifeq ($(host_os),darwin) +$(package)_cmake_opts += -DCMAKE_INSTALL_NAME_TOOL=true +$(package)_cmake_opts += -DCMAKE_FRAMEWORK_PATH=$(OSX_SDK)/System/Library/Frameworks +$(package)_cmake_opts += -DQT_INTERNAL_APPLE_SDK_VERSION=$(OSX_SDK_VERSION) +$(package)_cmake_opts += -DQT_INTERNAL_XCODE_VERSION=$(XCODE_VERSION) +$(package)_cmake_opts += -DQT_NO_APPLE_SDK_MAX_VERSION_CHECK=ON +endif endef define $(package)_fetch_cmds $(call fetch_file,$(package),$($(package)_download_path),$($(package)_download_file),$($(package)_file_name),$($(package)_sha256_hash)) && \ $(call fetch_file,$(package),$($(package)_download_path),$($(package)_qttranslations_file_name),$($(package)_qttranslations_file_name),$($(package)_qttranslations_sha256_hash)) && \ -$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qttools_file_name),$($(package)_qttools_file_name),$($(package)_qttools_sha256_hash)) +$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qttools_file_name),$($(package)_qttools_file_name),$($(package)_qttools_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_top_download_path),$($(package)_top_cmakelists_download_file),$($(package)_top_cmakelists_file_name)-$($(package)_version),$($(package)_top_cmakelists_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_top_cmake_download_path),$($(package)_top_cmake_ecmoptionaladdsubdirectory_download_file),$($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name)-$($(package)_version),$($(package)_top_cmake_ecmoptionaladdsubdirectory_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_top_cmake_download_path),$($(package)_top_cmake_qttoplevelhelpers_download_file),$($(package)_top_cmake_qttoplevelhelpers_file_name)-$($(package)_version),$($(package)_top_cmake_qttoplevelhelpers_sha256_hash)) endef +ifeq ($(host),$(build)) define $(package)_extract_cmds mkdir -p $($(package)_extract_dir) && \ echo "$($(package)_sha256_hash) $($(package)_source)" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \ echo "$($(package)_qttranslations_sha256_hash) $($(package)_source_dir)/$($(package)_qttranslations_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ echo "$($(package)_qttools_sha256_hash) $($(package)_source_dir)/$($(package)_qttools_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + echo "$($(package)_top_cmakelists_sha256_hash) $($(package)_source_dir)/$($(package)_top_cmakelists_file_name)-$($(package)_version)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + echo "$($(package)_top_cmake_ecmoptionaladdsubdirectory_sha256_hash) $($(package)_source_dir)/$($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name)-$($(package)_version)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + echo "$($(package)_top_cmake_qttoplevelhelpers_sha256_hash) $($(package)_source_dir)/$($(package)_top_cmake_qttoplevelhelpers_file_name)-$($(package)_version)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ $(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \ mkdir qtbase && \ $(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source) -C qtbase && \ mkdir qttranslations && \ $(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttranslations_file_name) -C qttranslations && \ mkdir qttools && \ - $(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttools_file_name) -C qttools + $(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttools_file_name) -C qttools && \ + cp $($(package)_source_dir)/$($(package)_top_cmakelists_file_name)-$($(package)_version) ./$($(package)_top_cmakelists_file_name) && \ + mkdir cmake && \ + cp $($(package)_source_dir)/$($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name)-$($(package)_version) cmake/$($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name) && \ + cp $($(package)_source_dir)/$($(package)_top_cmake_qttoplevelhelpers_file_name)-$($(package)_version) cmake/$($(package)_top_cmake_qttoplevelhelpers_file_name) endef +else +define $(package)_extract_cmds + mkdir -p $($(package)_extract_dir) && \ + echo "$($(package)_sha256_hash) $($(package)_source)" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + echo "$($(package)_top_cmakelists_sha256_hash) $($(package)_source_dir)/$($(package)_top_cmakelists_file_name)-$($(package)_version)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + echo "$($(package)_top_cmake_ecmoptionaladdsubdirectory_sha256_hash) $($(package)_source_dir)/$($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name)-$($(package)_version)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + echo "$($(package)_top_cmake_qttoplevelhelpers_sha256_hash) $($(package)_source_dir)/$($(package)_top_cmake_qttoplevelhelpers_file_name)-$($(package)_version)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + $(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + mkdir qtbase && \ + $(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source) -C qtbase && \ + cp $($(package)_source_dir)/$($(package)_top_cmakelists_file_name)-$($(package)_version) ./$($(package)_top_cmakelists_file_name) && \ + mkdir cmake && \ + cp $($(package)_source_dir)/$($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name)-$($(package)_version) cmake/$($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name) && \ + cp $($(package)_source_dir)/$($(package)_top_cmake_qttoplevelhelpers_file_name)-$($(package)_version) cmake/$($(package)_top_cmake_qttoplevelhelpers_file_name) +endef +endif -# Preprocessing steps work as follows: -# -# 1. Apply our patches to the extracted source. See each patch for more info. -# -# 2. Create a macOS-Clang-Linux mkspec using our mac-qmake.conf. -# -# 3. After making a copy of the mkspec for the linux-arm-gnueabi host, named -# bitcoin-linux-g++, replace tool names with $($($(package)_type)_TOOL). -# -# 4. Put our C, CXX and LD FLAGS into gcc-base.conf. Only used for non-host builds. -# -# 5. In clang.conf, swap out clang & clang++, for our compiler + flags. See #17466. define $(package)_preprocess_cmds - cp $($(package)_patch_dir)/qt.pro qt.pro && \ - cp $($(package)_patch_dir)/qttools_src.pro qttools/src/src.pro && \ patch -p1 -i $($(package)_patch_dir)/dont_hardcode_pwd.patch && \ - patch -p1 -i $($(package)_patch_dir)/no-xlib.patch && \ patch -p1 -i $($(package)_patch_dir)/qtbase-moc-ignore-gcc-macro.patch && \ - patch -p1 -i $($(package)_patch_dir)/memory_resource.patch && \ - patch -p1 -i $($(package)_patch_dir)/no_warnings_for_symbols.patch && \ - patch -p1 -i $($(package)_patch_dir)/clang_18_libpng.patch && \ - patch -p1 -i $($(package)_patch_dir)/rcc_hardcode_timestamp.patch && \ - patch -p1 -i $($(package)_patch_dir)/duplicate_lcqpafonts.patch && \ - patch -p1 -i $($(package)_patch_dir)/utc_from_string_no_optimize.patch && \ - patch -p1 -i $($(package)_patch_dir)/guix_cross_lib_path.patch && \ - patch -p1 -i $($(package)_patch_dir)/windows_lto.patch && \ - patch -p1 -i $($(package)_patch_dir)/darwin_no_libm.patch && \ - mkdir -p qtbase/mkspecs/macx-clang-linux &&\ - cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\ - cp -f $($(package)_patch_dir)/mac-qmake.conf qtbase/mkspecs/macx-clang-linux/qmake.conf && \ - cp -r qtbase/mkspecs/linux-arm-gnueabi-g++ qtbase/mkspecs/bitcoin-linux-g++ && \ - sed -i.old "s|arm-linux-gnueabi-gcc|$($($(package)_type)_CC)|" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \ - sed -i.old "s|arm-linux-gnueabi-g++|$($($(package)_type)_CXX)|" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \ - sed -i.old "s|arm-linux-gnueabi-ar|$($($(package)_type)_AR)|" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \ - sed -i.old "s|arm-linux-gnueabi-objcopy|$($($(package)_type)_OBJCOPY)|" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \ - sed -i.old "s|arm-linux-gnueabi-nm|$($($(package)_type)_NM)|" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \ - sed -i.old "s|arm-linux-gnueabi-strip|$($($(package)_type)_STRIP)|" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \ - echo "!host_build: QMAKE_CFLAGS += $($(package)_cflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ - echo "!host_build: QMAKE_CXXFLAGS += $($(package)_cxxflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ - echo "!host_build: QMAKE_LFLAGS += $($(package)_ldflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ - sed -i.old "s|QMAKE_CC = \$$$$\$$$${CROSS_COMPILE}clang|QMAKE_CC = $($(package)_cc)|" qtbase/mkspecs/common/clang.conf && \ - sed -i.old "s|QMAKE_CXX = \$$$$\$$$${CROSS_COMPILE}clang++|QMAKE_CXX = $($(package)_cxx)|" qtbase/mkspecs/common/clang.conf + patch -p1 -i $($(package)_patch_dir)/qtbase_avoid_native_float16.patch && \ + patch -p1 -i $($(package)_patch_dir)/qtbase_avoid_qmain.patch && \ + patch -p1 -i $($(package)_patch_dir)/qtbase_platformsupport.patch && \ + patch -p1 -i $($(package)_patch_dir)/qtbase_plugins_cocoa.patch && \ + patch -p1 -i $($(package)_patch_dir)/qtbase_skip_tools.patch && \ + patch -p1 -i $($(package)_patch_dir)/rcc_hardcode_timestamp.patch endef +ifeq ($(host),$(build)) + $(package)_preprocess_cmds += && patch -p1 -i $($(package)_patch_dir)/qttools_skip_dependencies.patch +endif define $(package)_config_cmds cd qtbase && \ - ./configure -top-level $($(package)_config_opts) + ./configure -top-level $($(package)_config_opts) -- $($(package)_cmake_opts) endef define $(package)_build_cmds - $(MAKE) + cmake --build . -- $$(filter -j%,$$(MAKEFLAGS)) endef -# TODO: Investigate whether specific targets can be used here to minimize the amount of files/components installed. define $(package)_stage_cmds - $(MAKE) -C qtbase INSTALL_ROOT=$($(package)_staging_dir) install && \ - $(MAKE) -C qttools INSTALL_ROOT=$($(package)_staging_dir) install && \ - $(MAKE) -C qttranslations INSTALL_ROOT=$($(package)_staging_dir) install_subtargets + cmake --install . --prefix $($(package)_staging_prefix_dir) endef define $(package)_postprocess_cmds - rm -rf doc/ native/lib/ lib/pkgconfig/ && \ - rm -f lib/lib*.la lib/Qt5*.la + rm -rf doc/ endef diff --git a/depends/packages/qt_details.mk b/depends/packages/qt_details.mk new file mode 100644 index 00000000000..341448149e3 --- /dev/null +++ b/depends/packages/qt_details.mk @@ -0,0 +1,26 @@ +qt_details_version := 6.7.3 +qt_details_download_path := https://download.qt.io/archive/qt/6.7/$(qt_details_version)/submodules +qt_details_suffix := everywhere-src-$(qt_details_version).tar.xz + +qt_details_qtbase_file_name := qtbase-$(qt_details_suffix) +qt_details_qtbase_sha256_hash := 8ccbb9ab055205ac76632c9eeddd1ed6fc66936fc56afc2ed0fd5d9e23da3097 + +qt_details_qttranslations_file_name := qttranslations-$(qt_details_suffix) +qt_details_qttranslations_sha256_hash := dcc762acac043b9bb5e4d369b6d6f53e0ecfcf76a408fe0db5f7ef071c9d6dc8 + +qt_details_qttools_file_name := qttools-$(qt_details_suffix) +qt_details_qttools_sha256_hash := f03bb7df619cd9ac9dba110e30b7bcab5dd88eb8bdc9cc752563b4367233203f + +qt_details_patches_path := $(PATCHES_PATH)/qt + +qt_details_top_download_path := https://code.qt.io/cgit/qt/qt5.git/plain +qt_details_top_cmakelists_file_name := CMakeLists.txt +qt_details_top_cmakelists_download_file := $(qt_details_top_cmakelists_file_name)?h=$(qt_details_version) +qt_details_top_cmakelists_sha256_hash := 9fb720a633c0c0a21c31fe62a34bf617726fed72480d4064f29ca5d6973d513f +qt_details_top_cmake_download_path := $(qt_details_top_download_path)/cmake +qt_details_top_cmake_ecmoptionaladdsubdirectory_file_name := ECMOptionalAddSubdirectory.cmake +qt_details_top_cmake_ecmoptionaladdsubdirectory_download_file := $(qt_details_top_cmake_ecmoptionaladdsubdirectory_file_name)?h=$(qt_details_version) +qt_details_top_cmake_ecmoptionaladdsubdirectory_sha256_hash := 97ee8bbfcb0a4bdcc6c1af77e467a1da0c5b386c42be2aa97d840247af5f6f70 +qt_details_top_cmake_qttoplevelhelpers_file_name := QtTopLevelHelpers.cmake +qt_details_top_cmake_qttoplevelhelpers_download_file := $(qt_details_top_cmake_qttoplevelhelpers_file_name)?h=$(qt_details_version) +qt_details_top_cmake_qttoplevelhelpers_sha256_hash := 5ac2a7159ee27b5b86d26ecff44922e7b8f319aa847b7b5766dc17932fd4a294 diff --git a/depends/patches/qt/clang_18_libpng.patch b/depends/patches/qt/clang_18_libpng.patch deleted file mode 100644 index e807905b321..00000000000 --- a/depends/patches/qt/clang_18_libpng.patch +++ /dev/null @@ -1,40 +0,0 @@ -fix Qt macOS build with Clang 18 - - See: - https://github.com/pnggroup/libpng/commit/893b8113f04d408cc6177c6de19c9889a48faa24. - - In a similar manner as zlib (madler/zlib#895), - libpng contains a header configuration that's no longer valid and - hasn't been exercised for the macOS target. - - - The target OS conditional macros are misused. Specifically - `TARGET_OS_MAC` covers all Apple targets, including iOS, and it - should not be checked with `#if defined` as they would always be - defined (to either 1 or 0) on Apple platforms. - - `#include ` no longer works for the macOS target and results - in a compilation failure. macOS ships all required functions in - `math.h`, and clients should use `math.h` instead. - ---- a/qtbase/src/3rdparty/libpng/pngpriv.h -+++ b/qtbase/src/3rdparty/libpng/pngpriv.h -@@ -514,18 +514,8 @@ - */ - # include - --# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \ -- defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC) -- /* We need to check that hasn't already been included earlier -- * as it seems it doesn't agree with , yet we should really use -- * if possible. -- */ --# if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__) --# include --# endif --# else --# include --# endif -+# include -+ - # if defined(_AMIGA) && defined(__SASC) && defined(_M68881) - /* Amiga SAS/C: We must include builtin FPU functions when compiling using - * MATH=68881 diff --git a/depends/patches/qt/darwin_no_libm.patch b/depends/patches/qt/darwin_no_libm.patch deleted file mode 100644 index 38a94beeb7a..00000000000 --- a/depends/patches/qt/darwin_no_libm.patch +++ /dev/null @@ -1,17 +0,0 @@ -build: remove explicit -lm link from qttools - -This causes issues with at least the macOS cross build, and shouldn't -actually be required anywhere else. GCC with libstdc++ will already get libm. - ---- a/qtbase/src/corelib/tools/tools.pri -+++ b/qtbase/src/corelib/tools/tools.pri -@@ -111,9 +111,6 @@ qtConfig(easingcurve) { - tools/qtimeline.cpp - } - --# Note: libm should be present by default becaue this is C++ --unix:!macx-icc:!vxworks:!haiku:!integrity:!wasm: LIBS_PRIVATE += -lm -- - TR_EXCLUDE += ../3rdparty/* - - # MIPS DSP diff --git a/depends/patches/qt/dont_hardcode_pwd.patch b/depends/patches/qt/dont_hardcode_pwd.patch index f6955b2f20c..217b6bec15b 100644 --- a/depends/patches/qt/dont_hardcode_pwd.patch +++ b/depends/patches/qt/dont_hardcode_pwd.patch @@ -13,15 +13,39 @@ diff --git a/qtbase/configure b/qtbase/configure index 08b49a8d..faea5b55 100755 --- a/qtbase/configure +++ b/qtbase/configure -@@ -36,9 +36,9 @@ - relconf=`basename $0` +@@ -9,9 +9,9 @@ + # the directory of this script is the "source tree" - relpath=`dirname $0` + relpath=`dirname "$0"` -relpath=`(cd "$relpath"; /bin/pwd)` +relpath=`(cd "$relpath"; pwd)` # the current directory is the "build tree" or "object tree" -outpath=`/bin/pwd` +outpath=`pwd` + outpathPrefix=$outpath + + # do this early so we don't store it in config.status - WHICH="which" +--- a/qtbase/bin/qt-cmake.in ++++ b/qtbase/bin/qt-cmake.in +@@ -2,7 +2,7 @@ + + # The directory of this script is the expanded absolute path of the "$qt_prefix/bin" directory. + script_dir_path=`dirname $0` +-script_dir_path=`(cd "$script_dir_path"; /bin/pwd)` ++script_dir_path=`(cd "$script_dir_path"; pwd)` + + # Try to use original cmake, otherwise to make it relocatable, use any cmake found in PATH. + original_cmake_path="@CMAKE_COMMAND@" +--- a/qtbase/bin/qt-configure-module.in ++++ b/qtbase/bin/qt-configure-module.in +@@ -2,7 +2,7 @@ + set -eu + + script_dir_path=`dirname $0` +-script_dir_path=`(cd "$script_dir_path"; /bin/pwd)` ++script_dir_path=`(cd "$script_dir_path"; pwd)` + + printUsage() + { diff --git a/depends/patches/qt/duplicate_lcqpafonts.patch b/depends/patches/qt/duplicate_lcqpafonts.patch deleted file mode 100644 index c460b51dcff..00000000000 --- a/depends/patches/qt/duplicate_lcqpafonts.patch +++ /dev/null @@ -1,104 +0,0 @@ -QtGui: Fix duplication of logging category lcQpaFonts - -Move it to qplatformfontdatabase.h. - -Upstream commit: - - Qt 6.0: ab01885e48873fb2ad71841a3f1627fe4d9cd835 - ---- a/qtbase/src/gui/text/qplatformfontdatabase.cpp -+++ b/qtbase/src/gui/text/qplatformfontdatabase.cpp -@@ -52,6 +52,8 @@ - - QT_BEGIN_NAMESPACE - -+Q_LOGGING_CATEGORY(lcQpaFonts, "qt.qpa.fonts") -+ - void qt_registerFont(const QString &familyname, const QString &stylename, - const QString &foundryname, int weight, - QFont::Style style, int stretch, bool antialiased, - ---- a/qtbase/src/gui/text/qplatformfontdatabase.h -+++ b/qtbase/src/gui/text/qplatformfontdatabase.h -@@ -50,6 +50,7 @@ - // - - #include -+#include - #include - #include - #include -@@ -62,6 +63,7 @@ - - QT_BEGIN_NAMESPACE - -+Q_DECLARE_LOGGING_CATEGORY(lcQpaFonts) - - class QWritingSystemsPrivate; - - ---- a/qtbase/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm -+++ b/qtbase/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm -@@ -86,8 +86,6 @@ - - QT_BEGIN_NAMESPACE - --Q_LOGGING_CATEGORY(lcQpaFonts, "qt.qpa.fonts") -- - static float SYNTHETIC_ITALIC_SKEW = std::tan(14.f * std::acos(0.f) / 90.f); - - bool QCoreTextFontEngine::ct_getSfntTable(void *user_data, uint tag, uchar *buffer, uint *length) - ---- a/qtbase/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h -+++ b/qtbase/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h -@@ -64,8 +64,6 @@ - - QT_BEGIN_NAMESPACE - --Q_DECLARE_LOGGING_CATEGORY(lcQpaFonts) -- - class QCoreTextFontEngine : public QFontEngine - { - Q_GADGET - ---- a/qtbase/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp -+++ b/qtbase/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp -@@ -68,8 +68,6 @@ - - QT_BEGIN_NAMESPACE - --Q_LOGGING_CATEGORY(lcQpaFonts, "qt.qpa.fonts") -- - #ifndef QT_NO_DIRECTWRITE - // ### fixme: Consider direct linking of dwrite.dll once Windows Vista pre SP2 is dropped (QTBUG-49711) - - ---- a/qtbase/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h -+++ b/qtbase/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h -@@ -63,8 +63,6 @@ - - QT_BEGIN_NAMESPACE - --Q_DECLARE_LOGGING_CATEGORY(lcQpaFonts) -- - class QWindowsFontEngineData - { - Q_DISABLE_COPY_MOVE(QWindowsFontEngineData) - ---- a/qtbase/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp -+++ b/qtbase/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp -@@ -40,6 +40,7 @@ - #include "qgenericunixthemes_p.h" - - #include "qpa/qplatformtheme_p.h" -+#include "qpa/qplatformfontdatabase.h" - - #include - #include -@@ -76,7 +77,6 @@ - QT_BEGIN_NAMESPACE - - Q_DECLARE_LOGGING_CATEGORY(qLcTray) --Q_LOGGING_CATEGORY(lcQpaFonts, "qt.qpa.fonts") - - ResourceHelper::ResourceHelper() - { diff --git a/depends/patches/qt/guix_cross_lib_path.patch b/depends/patches/qt/guix_cross_lib_path.patch deleted file mode 100644 index 7911dc21d7d..00000000000 --- a/depends/patches/qt/guix_cross_lib_path.patch +++ /dev/null @@ -1,17 +0,0 @@ -Facilitate guix building with CROSS_LIBRARY_PATH - -See discussion in https://github.com/bitcoin/bitcoin/pull/15277. - ---- a/qtbase/mkspecs/features/toolchain.prf -+++ b/qtbase/mkspecs/features/toolchain.prf -@@ -236,8 +236,8 @@ isEmpty($${target_prefix}.INCDIRS) { - add_libraries = false - for (line, output) { - line ~= s/^[ \\t]*// # remove leading spaces -- contains(line, "LIBRARY_PATH=.*") { -- line ~= s/^LIBRARY_PATH=// # remove leading LIBRARY_PATH= -+ contains(line, "(CROSS_)?LIBRARY_PATH=.*") { -+ line ~= s/^(CROSS_)?LIBRARY_PATH=// # remove leading (CROSS_)?LIBRARY_PATH= - equals(QMAKE_HOST.os, Windows): \ - paths = $$split(line, ;) - else: \ diff --git a/depends/patches/qt/mac-qmake.conf b/depends/patches/qt/mac-qmake.conf deleted file mode 100644 index a29db20004b..00000000000 --- a/depends/patches/qt/mac-qmake.conf +++ /dev/null @@ -1,23 +0,0 @@ -MAKEFILE_GENERATOR = UNIX -CONFIG += app_bundle incremental lib_version_first absolute_library_soname -QMAKE_INCREMENTAL_STYLE = sublib -include(../common/macx.conf) -include(../common/gcc-base-mac.conf) -include(../common/clang.conf) -include(../common/clang-mac.conf) -QMAKE_MAC_SDK_PATH=$${MAC_SDK_PATH} -QMAKE_XCODE_VERSION = $${XCODE_VERSION} -QMAKE_XCODE_DEVELOPER_PATH=/Developer -QMAKE_MAC_SDK=macosx -QMAKE_MAC_SDK.macosx.Path = $${MAC_SDK_PATH} -QMAKE_MAC_SDK.macosx.platform_name = macosx -QMAKE_MAC_SDK.macosx.SDKVersion = $${MAC_SDK_VERSION} -QMAKE_MAC_SDK.macosx.PlatformPath = /phony -QMAKE_CXXFLAGS += -fuse-ld=lld -!host_build: QMAKE_CFLAGS += -target $${MAC_TARGET} -!host_build: QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_CFLAGS -!host_build: QMAKE_CXXFLAGS += -target $${MAC_TARGET} -!host_build: QMAKE_LFLAGS += -target $${MAC_TARGET} -QMAKE_AR = $${CROSS_COMPILE}ar cq -QMAKE_RANLIB=$${CROSS_COMPILE}ranlib -load(qt_config) diff --git a/depends/patches/qt/no-xlib.patch b/depends/patches/qt/no-xlib.patch deleted file mode 100644 index 0f7965d2ea8..00000000000 --- a/depends/patches/qt/no-xlib.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 9563cef873ae82e06f60708d706d054717e801ce Mon Sep 17 00:00:00 2001 -From: Carl Dong -Date: Thu, 18 Jul 2019 17:22:05 -0400 -Subject: [PATCH] Wrap xlib related code blocks in #if's - -They are not necessary to compile QT. - ---- a/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp -+++ b/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp -@@ -49,7 +49,9 @@ - #include - #include - #include -+#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) - #include -+#endif - #include - #include - -@@ -391,6 +393,7 @@ void QXcbCursor::changeCursor(QCursor *cursor, QWindow *window) - xcb_flush(xcb_connection()); - } - -+#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) - static int cursorIdForShape(int cshape) - { - int cursorId = 0; -@@ -444,6 +447,7 @@ static int cursorIdForShape(int cshape) - } - return cursorId; - } -+#endif - - xcb_cursor_t QXcbCursor::createNonStandardCursor(int cshape) - { -@@ -558,7 +562,9 @@ static xcb_cursor_t loadCursor(void *dpy, int cshape) - xcb_cursor_t QXcbCursor::createFontCursor(int cshape) - { - xcb_connection_t *conn = xcb_connection(); -+#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) - int cursorId = cursorIdForShape(cshape); -+#endif - xcb_cursor_t cursor = XCB_NONE; - - #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) -@@ -590,6 +596,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape) - // Non-standard X11 cursors are created from bitmaps - cursor = createNonStandardCursor(cshape); - -+#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) - // Create a glpyh cursor if everything else failed - if (!cursor && cursorId) { - cursor = xcb_generate_id(conn); -@@ -597,6 +604,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape) - cursorId, cursorId + 1, - 0xFFFF, 0xFFFF, 0xFFFF, 0, 0, 0); - } -+#endif - - if (cursor && cshape >= 0 && cshape < Qt::LastCursor && connection()->hasXFixes()) { - const char *name = cursorNames[cshape].front(); diff --git a/depends/patches/qt/no_warnings_for_symbols.patch b/depends/patches/qt/no_warnings_for_symbols.patch deleted file mode 100644 index 11cdc599ed3..00000000000 --- a/depends/patches/qt/no_warnings_for_symbols.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/qtbase/mkspecs/features/mac/no_warn_empty_obj_files.prf -+++ b/qtbase/mkspecs/features/mac/no_warn_empty_obj_files.prf -@@ -1,7 +1,7 @@ - # Prevent warnings about object files without any symbols. This is a common - # thing in Qt as we tend to build files unconditionally, and then use ifdefs - # to compile out parts that are not relevant. --QMAKE_RANLIB += -no_warning_for_no_symbols -+# QMAKE_RANLIB += -no_warning_for_no_symbols - - # We have to tell 'ar' to not run ranlib by itself - QMAKE_AR += -S diff --git a/depends/patches/qt/qt.pro b/depends/patches/qt/qt.pro deleted file mode 100644 index 6d8b7fdb6a2..00000000000 --- a/depends/patches/qt/qt.pro +++ /dev/null @@ -1,12 +0,0 @@ -# Create the super cache so modules will add themselves to it. -cache(, super) - -!QTDIR_build: cache(CONFIG, add, $$list(QTDIR_build)) - -TEMPLATE = subdirs -SUBDIRS = qtbase qttools qttranslations - -qttools.depends = qtbase -qttranslations.depends = qttools - -load(qt_configure) diff --git a/depends/patches/qt/qtbase-moc-ignore-gcc-macro.patch b/depends/patches/qt/qtbase-moc-ignore-gcc-macro.patch index f0c14a9400e..e5e7b126f62 100644 --- a/depends/patches/qt/qtbase-moc-ignore-gcc-macro.patch +++ b/depends/patches/qt/qtbase-moc-ignore-gcc-macro.patch @@ -7,7 +7,7 @@ Upstream report: https://bugreports.qt.io/browse/QTBUG-83160 diff --git a/qtbase/src/tools/moc/main.cpp b/qtbase/src/tools/moc/main.cpp --- a/qtbase/src/tools/moc/main.cpp +++ b/qtbase/src/tools/moc/main.cpp -@@ -238,6 +238,7 @@ int runMoc(int argc, char **argv) +@@ -186,6 +186,7 @@ int runMoc(int argc, char **argv) dummyVariadicFunctionMacro.arguments += Symbol(0, PP_IDENTIFIER, "__VA_ARGS__"); pp.macros["__attribute__"] = dummyVariadicFunctionMacro; pp.macros["__declspec"] = dummyVariadicFunctionMacro; diff --git a/depends/patches/qt/qtbase_avoid_native_float16.patch b/depends/patches/qt/qtbase_avoid_native_float16.patch new file mode 100644 index 00000000000..ec03d140e3f --- /dev/null +++ b/depends/patches/qt/qtbase_avoid_native_float16.patch @@ -0,0 +1,37 @@ +Avoid using native float16 types in Qt's qfloat16 + +Using native float16 types may introduce compatibility issues +in release binaries for Linux platforms. + +See: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=e42d2d2a20f2bb59928bc895ec9f46503a1b5c73 + +This patch can be dropped once the minimum required libgcc version +is updated to 12.x or newer. + + +--- a/qtbase/src/corelib/global/qtypes.h ++++ b/qtbase/src/corelib/global/qtypes.h +@@ -258,23 +258,8 @@ using qsizetype = QIntegerForSizeof::Signed; + + // Define a native float16 type + namespace QtPrivate { +-#if defined(__STDCPP_FLOAT16_T__) +-# define QFLOAT16_IS_NATIVE 1 +-using NativeFloat16Type = std::float16_t; +-#elif defined(Q_CC_CLANG) && defined(__FLT16_MAX__) && 0 +-// disabled due to https://github.com/llvm/llvm-project/issues/56963 +-# define QFLOAT16_IS_NATIVE 1 +-using NativeFloat16Type = decltype(__FLT16_MAX__); +-#elif defined(Q_CC_GNU_ONLY) && defined(__FLT16_MAX__) && defined(__ARM_FP16_FORMAT_IEEE) +-# define QFLOAT16_IS_NATIVE 1 +-using NativeFloat16Type = __fp16; +-#elif defined(Q_CC_GNU_ONLY) && defined(__FLT16_MAX__) && defined(__SSE2__) +-# define QFLOAT16_IS_NATIVE 1 +-using NativeFloat16Type = _Float16; +-#else + # define QFLOAT16_IS_NATIVE 0 + using NativeFloat16Type = void; +-#endif + } // QtPrivate + + #endif // __cplusplus diff --git a/depends/patches/qt/qtbase_avoid_qmain.patch b/depends/patches/qt/qtbase_avoid_qmain.patch new file mode 100644 index 00000000000..45a54fe881e --- /dev/null +++ b/depends/patches/qt/qtbase_avoid_qmain.patch @@ -0,0 +1,21 @@ +Avoid defining QT_NEEDS_QMAIN macro + +Qt's QT_NEEDS_QMAIN macro renames our main() function to qMain(), +which breaks our assumptions regarding exported symbols. In particular, +the CONTROL_FLOW security check fails for Windows builds in Guix. + +The QT_NEEDS_QMAIN macro is required for linking to the Qt DLLs only, +so we can safely disable it. + + +--- a/qtbase/src/entrypoint/CMakeLists.txt ++++ b/qtbase/src/entrypoint/CMakeLists.txt +@@ -104,8 +104,6 @@ if(WIN32) + APPEND PROPERTY INTERFACE_QT_MODULE_LDFLAGS "-lmingw32" + ) + +- target_compile_definitions(EntryPointPrivate INTERFACE QT_NEEDS_QMAIN) +- qt_internal_extend_target(EntryPointImplementation DEFINES QT_NEEDS_QMAIN) + endif() + + qt_internal_add_sync_header_dependencies(EntryPointImplementation Core) diff --git a/depends/patches/qt/qtbase_platformsupport.patch b/depends/patches/qt/qtbase_platformsupport.patch new file mode 100644 index 00000000000..45ccaea53a7 --- /dev/null +++ b/depends/patches/qt/qtbase_platformsupport.patch @@ -0,0 +1,34 @@ +CMake: Prevent creation of empty InputSupportPrivate module + +The combination of + -no-feature-evdev + -no-feature-tslib + -no-feature-libinput +led to the creation of the InputSupportPrivate module without source +files. + +This triggered CMake upstream issue 23464 when using CMake < 3.25. + +Fix this by adjusting the inexact condition that decides whether to +build InputSupportPrivate. + + +See: https://codereview.qt-project.org/c/qt/qtbase/+/633612 + + +--- a/qtbase/src/platformsupport/CMakeLists.txt ++++ b/qtbase/src/platformsupport/CMakeLists.txt +@@ -3,7 +3,12 @@ + + add_subdirectory(devicediscovery) + add_subdirectory(fbconvenience) +-if(QT_FEATURE_evdev OR QT_FEATURE_integrityhid OR QT_FEATURE_libinput OR QT_FEATURE_tslib OR QT_FEATURE_xkbcommon) ++if(QT_FEATURE_evdev ++ OR QT_FEATURE_vxworksevdev ++ OR QT_FEATURE_integrityhid ++ OR QT_FEATURE_libinput ++ OR QT_FEATURE_tslib ++ OR (QT_FEATURE_libinput AND QT_FEATURE_xkbcommon)) + add_subdirectory(input) + endif() + if(QT_FEATURE_kms) diff --git a/depends/patches/qt/qtbase_plugins_cocoa.patch b/depends/patches/qt/qtbase_plugins_cocoa.patch new file mode 100644 index 00000000000..118a72d66e7 --- /dev/null +++ b/depends/patches/qt/qtbase_plugins_cocoa.patch @@ -0,0 +1,21 @@ +CMake: Fix macOS -no-feature-sessionmanager build with CMake < 3.25 + +Work around CMake issue 23464. + + +See: https://codereview.qt-project.org/c/qt/qtbase/+/634002 + + +--- a/qtbase/src/plugins/platforms/cocoa/CMakeLists.txt ++++ b/qtbase/src/plugins/platforms/cocoa/CMakeLists.txt +@@ -102,3 +102,10 @@ qt_internal_extend_target(QCocoaIntegrationPlugin CONDITION QT_FEATURE_sessionma + SOURCES + qcocoasessionmanager.cpp qcocoasessionmanager.h + ) ++ ++# Work around CMake issue 23464 ++if(CMAKE_VERSION VERSION_LESS "3.25" AND NOT QT_FEATURE_sessionmanager) ++ set_target_properties(QCocoaIntegrationPlugin PROPERTIES ++ DISABLE_PRECOMPILE_HEADERS ON ++ ) ++endif() diff --git a/depends/patches/qt/qtbase_skip_tools.patch b/depends/patches/qt/qtbase_skip_tools.patch new file mode 100644 index 00000000000..bbd87e8689f --- /dev/null +++ b/depends/patches/qt/qtbase_skip_tools.patch @@ -0,0 +1,61 @@ +Skip building/installing unneeded tools: + +1. Wrapper CMake scripts. +2. CI support files. +3. tracepointgen and tracegen tools. +4. Qt Look Ahead LR Parser Generator (qlalr). +5. Qt Vulkan Header Generator (qvkgen). + + +--- a/qtbase/cmake/QtBaseGlobalTargets.cmake ++++ b/qtbase/cmake/QtBaseGlobalTargets.cmake +@@ -118,9 +118,6 @@ qt_generate_global_module_pri_file() + qt_generate_global_device_pri_file() + qt_generate_qmake_and_qtpaths_wrapper_for_target() + +-# Depends on the global features being evaluated. +-qt_internal_create_wrapper_scripts() +- + add_library(Qt::GlobalConfig ALIAS GlobalConfig) + + add_library(GlobalConfigPrivate INTERFACE) + +--- a/qtbase/cmake/QtBaseGlobalTargets.cmake ++++ b/qtbase/cmake/QtBaseGlobalTargets.cmake +@@ -349,12 +349,3 @@ elseif(WASM) + qt_install(PROGRAMS "${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}/qt-wasmtestrunner.py" + DESTINATION "${INSTALL_LIBEXECDIR}") + endif() +- +-# Install CI support files to libexec. +-qt_path_join(__qt_libexec_install_dir "${QT_INSTALL_DIR}" "${INSTALL_LIBEXECDIR}") +-qt_copy_or_install(FILES coin/instructions/qmake/ensure_pro_file.cmake +- DESTINATION "${__qt_libexec_install_dir}") +-qt_copy_or_install(PROGRAMS "util/testrunner/qt-testrunner.py" +- DESTINATION "${__qt_libexec_install_dir}") +-qt_copy_or_install(PROGRAMS "util/testrunner/sanitizer-testrunner.py" +- DESTINATION "${__qt_libexec_install_dir}") + + +--- a/qtbase/src/CMakeLists.txt ++++ b/qtbase/src/CMakeLists.txt +@@ -21,8 +21,6 @@ function(find_or_build_bootstrap_names) + endif() + add_subdirectory(tools/moc) + add_subdirectory(tools/rcc) +- add_subdirectory(tools/tracepointgen) +- add_subdirectory(tools/tracegen) + add_subdirectory(tools/cmake_automoc_parser) + endfunction() + +--- a/qtbase/src/tools/CMakeLists.txt ++++ b/qtbase/src/tools/CMakeLists.txt +@@ -11,8 +11,6 @@ if (QT_FEATURE_dbus) + add_subdirectory(qdbuscpp2xml) + add_subdirectory(qdbusxml2cpp) + endif() +-add_subdirectory(qlalr) +-add_subdirectory(qvkgen) + if (QT_FEATURE_commandlineparser) + add_subdirectory(qtpaths) + endif() diff --git a/depends/patches/qt/qttools_skip_dependencies.patch b/depends/patches/qt/qttools_skip_dependencies.patch new file mode 100644 index 00000000000..09f66f4497f --- /dev/null +++ b/depends/patches/qt/qttools_skip_dependencies.patch @@ -0,0 +1,36 @@ +QtTools: Skip unnecessary dependencies: + +1. The LLVM installatiion. +2. Build only required tools. + + +--- a/qttools/configure.cmake ++++ b/qttools/configure.cmake +@@ -17,7 +17,7 @@ + # Presumably because 6.0 ClangConfig.cmake files are not good enough? + # In any case explicitly request a minimum version of 8.x for now, otherwise + # building with CMake will fail at compilation time. +-qt_find_package(WrapLibClang 8 PROVIDED_TARGETS WrapLibClang::WrapLibClang) ++#qt_find_package(WrapLibClang 8 PROVIDED_TARGETS WrapLibClang::WrapLibClang) + # special case end + + if(TARGET WrapLibClang::WrapLibClang) + +--- a/qttools/src/linguist/CMakeLists.txt ++++ b/qttools/src/linguist/CMakeLists.txt +@@ -9,15 +9,8 @@ if(NOT QT_FEATURE_linguist) + return() + endif() + add_subdirectory(lconvert) +-add_subdirectory(lprodump) + add_subdirectory(lrelease) +-add_subdirectory(lrelease-pro) + add_subdirectory(lupdate) +-add_subdirectory(lupdate-pro) +-if(QT_FEATURE_process AND QT_FEATURE_pushbutton AND QT_FEATURE_toolbutton +- AND QT_FEATURE_png AND QT_FEATURE_printsupport AND TARGET Qt::Widgets) +- add_subdirectory(linguist) +-endif() + + # Create a fake module that would emulate the Qt5::LinguistTools CMake Config package + qt_internal_add_module(Linguist diff --git a/depends/patches/qt/qttools_src.pro b/depends/patches/qt/qttools_src.pro deleted file mode 100644 index 6ef71a09427..00000000000 --- a/depends/patches/qt/qttools_src.pro +++ /dev/null @@ -1,6 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS = linguist - -fb = force_bootstrap -CONFIG += $$fb -cache(CONFIG, add, fb) diff --git a/depends/patches/qt/rcc_hardcode_timestamp.patch b/depends/patches/qt/rcc_hardcode_timestamp.patch index 03f38979756..e72f4bd037f 100644 --- a/depends/patches/qt/rcc_hardcode_timestamp.patch +++ b/depends/patches/qt/rcc_hardcode_timestamp.patch @@ -6,11 +6,11 @@ the SOURCE_DATE_EPOCH variable set, e.g., for Guix builds. --- old/qtbase/src/tools/rcc/rcc.cpp +++ new/qtbase/src/tools/rcc/rcc.cpp -@@ -227,14 +227,7 @@ void RCCFileInfo::writeDataInfo(RCCResourceLibrary &lib) +@@ -201,14 +201,7 @@ void RCCFileInfo::writeDataInfo(RCCResourceLibrary &lib) if (lib.formatVersion() >= 2) { // last modified time stamp -- const QDateTime lastModified = m_fileInfo.lastModified(); +- const QDateTime lastModified = m_fileInfo.lastModified(QTimeZone::UTC); - quint64 lastmod = quint64(lastModified.isValid() ? lastModified.toMSecsSinceEpoch() : 0); - static const quint64 sourceDate = 1000 * qgetenv("QT_RCC_SOURCE_DATE_OVERRIDE").toULongLong(); - if (sourceDate != 0) diff --git a/depends/patches/qt/utc_from_string_no_optimize.patch b/depends/patches/qt/utc_from_string_no_optimize.patch deleted file mode 100644 index 533ef59b379..00000000000 --- a/depends/patches/qt/utc_from_string_no_optimize.patch +++ /dev/null @@ -1,84 +0,0 @@ -Modify optimisation flags for various functions. -This fixes non-determinism issues in the asm produced for -these function when cross-compiling on x86_64 and aarch64 for -the arm64-apple-darwin HOST. - ---- a/qtbase/src/corelib/itemmodels/qitemselectionmodel.cpp -+++ b/qtbase/src/corelib/itemmodels/qitemselectionmodel.cpp -@@ -1078,9 +1078,9 @@ void QItemSelectionModelPrivate::_q_layoutChanged(const QList &parents = QList(), QAbstractItemModel::LayoutChangeHint hint = QAbstractItemModel::NoLayoutChangeHint); -- void _q_layoutChanged(const QList &parents = QList(), QAbstractItemModel::LayoutChangeHint hint = QAbstractItemModel::NoLayoutChangeHint); -+ __attribute__ ((optnone)) void _q_layoutChanged(const QList &parents = QList(), QAbstractItemModel::LayoutChangeHint hint = QAbstractItemModel::NoLayoutChangeHint); - - inline void remove(QList &r) - { - ---- a/qtbase/src/corelib/time/qdatetimeparser_p.h -+++ b/qtbase/src/corelib/time/qdatetimeparser_p.h -@@ -215,7 +215,7 @@ private: - : value(ok == Invalid ? -1 : val), used(read), zeroes(zs), state(ok) - {} - }; -- ParsedSection parseSection(const QDateTime ¤tValue, int sectionIndex, -+ __attribute__ ((optnone)) ParsedSection parseSection(const QDateTime ¤tValue, int sectionIndex, - int offset, QString *text) const; - int findMonth(const QString &str1, int monthstart, int sectionIndex, - int year, QString *monthName = nullptr, int *used = nullptr) const; - ---- a/qtbase/src/corelib/time/qtimezoneprivate_p.h -+++ b/qtbase/src/corelib/time/qtimezoneprivate_p.h -@@ -191,7 +191,7 @@ public: - virtual ~QUtcTimeZonePrivate(); - - // Fall-back for UTC[+-]\d+(:\d+){,2} IDs. -- static qint64 offsetFromUtcString(const QByteArray &id); -+ static __attribute__ ((optnone)) qint64 offsetFromUtcString(const QByteArray &id); - - QUtcTimeZonePrivate *clone() const override; - ---- a/qtbase/src/widgets/widgets/qcalendarwidget.cpp -+++ b/qtbase/src/widgets/widgets/qcalendarwidget.cpp -@@ -329,13 +329,13 @@ class QCalendarYearValidator : public QCalendarDateSectionValidator - - public: - QCalendarYearValidator(); -- virtual Section handleKey(int key) override; -+ __attribute__ ((optnone)) virtual Section handleKey(int key) override; - virtual QDate applyToDate(QDate date, QCalendar cal) const override; - virtual void setDate(QDate date, QCalendar cal) override; - virtual QString text() const override; - virtual QString text(QDate date, QCalendar cal, int repeat) const override; - private: -- int pow10(int n); -+ __attribute__ ((optnone)) int pow10(int n); - int m_pos; - int m_year; - int m_oldYear; diff --git a/depends/patches/qt/windows_lto.patch b/depends/patches/qt/windows_lto.patch deleted file mode 100644 index ea379a60f14..00000000000 --- a/depends/patches/qt/windows_lto.patch +++ /dev/null @@ -1,31 +0,0 @@ -Qt (for Windows) fails to build under LTO, due to multiple definition issues, i.e - -multiple definition of `QAccessibleLineEdit::~QAccessibleLineEdit()'; - -Possibly related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94156. - -diff --git a/qtbase/src/widgets/accessible/simplewidgets.cpp b/qtbase/src/widgets/accessible/simplewidgets.cpp -index 107fd729fe..0e61878f39 100644 ---- a/qtbase/src/widgets/accessible/simplewidgets.cpp -+++ b/qtbase/src/widgets/accessible/simplewidgets.cpp -@@ -109,6 +109,8 @@ QString qt_accHotKey(const QString &text); - \ingroup accessibility - */ - -+QAccessibleLineEdit::~QAccessibleLineEdit(){}; -+ - /*! - Creates a QAccessibleButton object for \a w. - */ -diff --git a/qtbase/src/widgets/accessible/simplewidgets_p.h b/qtbase/src/widgets/accessible/simplewidgets_p.h -index 73572e3059..658da86143 100644 ---- a/qtbase/src/widgets/accessible/simplewidgets_p.h -+++ b/qtbase/src/widgets/accessible/simplewidgets_p.h -@@ -155,6 +155,7 @@ class QAccessibleLineEdit : public QAccessibleWidget, public QAccessibleTextInte - public: - explicit QAccessibleLineEdit(QWidget *o, const QString &name = QString()); - -+ ~QAccessibleLineEdit(); - QString text(QAccessible::Text t) const override; - void setText(QAccessible::Text t, const QString &text) override; - QAccessible::State state() const override; diff --git a/depends/toolchain.cmake.in b/depends/toolchain.cmake.in index 28188f6347c..837abe1cd8a 100644 --- a/depends/toolchain.cmake.in +++ b/depends/toolchain.cmake.in @@ -100,12 +100,27 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT CMAKE_HOST_APPLE) set(CMAKE_FRAMEWORK_PATH "@OSX_SDK@/System/Library/Frameworks") endif() + +if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + # Customize pkg-config behavior for finding dependencies + # of the xcb QPA platform plugin: + # 1. Restrict search paths to the depends. + # 2. Make output suitable for static linking. + cmake_path(APPEND CMAKE_CURRENT_LIST_DIR "lib" "pkgconfig" OUTPUT_VARIABLE pkg_config_path) + set(ENV{PKG_CONFIG_PATH} ${pkg_config_path}) + set(ENV{PKG_CONFIG_LIBDIR} ${pkg_config_path}) + unset(pkg_config_path) + set(PKG_CONFIG_ARGN --static) +endif() + + # Set configuration options for the main build system. set(qt_packages @qt_packages@) if("${qt_packages}" STREQUAL "") set(BUILD_GUI OFF CACHE BOOL "") else() set(BUILD_GUI ON CACHE BOOL "") + set(Qt6_ROOT "${CMAKE_CURRENT_LIST_DIR}" CACHE PATH "") endif() set(qrencode_packages @qrencode_packages@) diff --git a/doc/build-freebsd.md b/doc/build-freebsd.md index 1c78b5c127a..432a2ee2bec 100644 --- a/doc/build-freebsd.md +++ b/doc/build-freebsd.md @@ -62,13 +62,13 @@ sh/bash: export BDB_PREFIX=[path displayed above] ``` #### GUI Dependencies -###### Qt5 +###### Qt6 Bitcoin Core includes a GUI built with the cross-platform Qt Framework. To compile the GUI, we need to install the necessary parts of Qt, the libqrencode and pass `-DBUILD_GUI=ON`. Skip if you don't intend to use the GUI. ```bash -pkg install qt5-buildtools qt5-core qt5-gui qt5-linguisttools qt5-testlib qt5-widgets +pkg install qt6-buildtools qt6-core qt6-gui qt6-linguisttools qt6-testlib qt6-widgets ``` ###### libqrencode diff --git a/doc/build-netbsd.md b/doc/build-netbsd.md index 988f3b93a7a..31cac3f6b68 100644 --- a/doc/build-netbsd.md +++ b/doc/build-netbsd.md @@ -64,13 +64,13 @@ pkgin install db4 ``` #### GUI Dependencies -###### Qt5 +###### Qt6 Bitcoin Core includes a GUI built with the cross-platform Qt Framework. To compile the GUI, we need to install the necessary parts of Qt, the libqrencode and pass `-DBUILD_GUI=ON`. Skip if you don't intend to use the GUI. ```bash -pkgin install qt5-qtbase qt5-qttools +pkgin install qt6-qtbase qt6-qttools ``` ###### libqrencode diff --git a/doc/build-openbsd.md b/doc/build-openbsd.md index e55f2aec9e8..8beda3259fb 100644 --- a/doc/build-openbsd.md +++ b/doc/build-openbsd.md @@ -56,13 +56,13 @@ export BDB_PREFIX="[path displayed above]" ``` #### GUI Dependencies -###### Qt5 +###### Qt6 Bitcoin Core includes a GUI built with the cross-platform Qt Framework. To compile the GUI, we need to install the necessary parts of Qt, the libqrencode and pass `-DBUILD_GUI=ON`. Skip if you don't intend to use the GUI. ```bash -pkg_add qtbase qttools +pkg_add qt6-qtbase qt6-qttools ``` ###### libqrencode @@ -100,7 +100,7 @@ pkg_add python py3-zmq # Select the newest version of the python package if nec There are many ways to configure Bitcoin Core, here are a few common examples: ##### Descriptor Wallet and GUI: -This enables descriptor wallet support and the GUI, assuming SQLite and Qt 5 are installed. +This enables descriptor wallet support and the GUI, assuming SQLite and Qt 6 are installed. ```bash cmake -B build -DBUILD_GUI=ON diff --git a/doc/build-osx.md b/doc/build-osx.md index 4d92abfc215..6f921b77827 100644 --- a/doc/build-osx.md +++ b/doc/build-osx.md @@ -92,11 +92,9 @@ Bitcoin Core includes a GUI built with the cross-platform Qt Framework. To compi Qt, libqrencode and pass `-DBUILD_GUI=ON`. Skip if you don't intend to use the GUI. ``` bash -brew install qt@5 +brew install qt@6 ``` -Note: Building may fail if Qt 6 is installed (`qt` or `qt@6`) - Note: Building with Qt binaries downloaded from the Qt website is not officially supported. See the notes in [#7714](https://github.com/bitcoin/bitcoin/issues/7714). diff --git a/doc/build-unix.md b/doc/build-unix.md index 7ebff97bbcb..df7d6f3349b 100644 --- a/doc/build-unix.md +++ b/doc/build-unix.md @@ -73,11 +73,13 @@ GUI dependencies: Bitcoin Core includes a GUI built with the cross-platform Qt Framework. To compile the GUI, we need to install the necessary parts of Qt, the libqrencode and pass `-DBUILD_GUI=ON`. Skip if you don't intend to use the GUI. - sudo apt-get install qtbase5-dev qttools5-dev qttools5-dev-tools + sudo apt-get install qt6-base-dev qt6-tools-dev qt6-l10n-tools + +For Qt 6.5 and later, the `libxcb-cursor0` package must be installed at runtime. Additionally, to support Wayland protocol for modern desktop environments: - sudo apt install qtwayland5 + sudo apt install qt6-wayland The GUI will be able to encode addresses in QR codes unless this feature is explicitly disabled. To install libqrencode, run: @@ -121,11 +123,13 @@ GUI dependencies: Bitcoin Core includes a GUI built with the cross-platform Qt Framework. To compile the GUI, we need to install the necessary parts of Qt, the libqrencode and pass `-DBUILD_GUI=ON`. Skip if you don't intend to use the GUI. - sudo dnf install qt5-qttools-devel qt5-qtbase-devel + sudo dnf install qt6-qtbase-devel qt6-qttools-devel + +For Qt 6.5 and later, the `xcb-util-cursor` package must be installed at runtime. Additionally, to support Wayland protocol for modern desktop environments: - sudo dnf install qt5-qtwayland + sudo dnf install qt6-qtwayland The GUI will be able to encode addresses in QR codes unless this feature is explicitly disabled. To install libqrencode, run: diff --git a/doc/dependencies.md b/doc/dependencies.md index 7c866a433db..332e6d87003 100644 --- a/doc/dependencies.md +++ b/doc/dependencies.md @@ -30,7 +30,7 @@ Bitcoin Core requires one of the following compilers. | [Fontconfig](../depends/packages/fontconfig.mk) (gui) | [link](https://www.freedesktop.org/wiki/Software/fontconfig/) | [2.12.6](https://github.com/bitcoin/bitcoin/pull/23495) | 2.6 | Yes | | [FreeType](../depends/packages/freetype.mk) (gui) | [link](https://freetype.org) | [2.11.0](https://github.com/bitcoin/bitcoin/commit/01544dd78ccc0b0474571da854e27adef97137fb) | 2.3.0 | Yes | | [qrencode](../depends/packages/qrencode.mk) (gui) | [link](https://fukuchi.org/works/qrencode/) | [4.1.1](https://github.com/bitcoin/bitcoin/pull/27312) | N/A | No | -| [Qt](../depends/packages/qt.mk) (gui) | [link](https://download.qt.io/official_releases/qt/) | [5.15.16](https://github.com/bitcoin/bitcoin/pull/30774) | [5.11.3](https://github.com/bitcoin/bitcoin/pull/24132) | No | +| [Qt](../depends/packages/qt.mk) (gui) | [link](https://download.qt.io/archive/qt/) | [6.7.3](https://github.com/bitcoin/bitcoin/pull/30997) | [6.2](https://github.com/bitcoin/bitcoin/pull/30997) | No | | [ZeroMQ](../depends/packages/zeromq.mk) (notifications) | [link](https://github.com/zeromq/libzmq/releases) | [4.3.4](https://github.com/bitcoin/bitcoin/pull/23956) | 4.0.0 | No | | [Berkeley DB](../depends/packages/bdb.mk) (legacy wallet) | [link](https://www.oracle.com/technetwork/database/database-technologies/berkeleydb/downloads/index.html) | 4.8.30 | 4.8.x | No | | [SQLite](../depends/packages/sqlite.mk) (wallet) | [link](https://sqlite.org) | [3.38.5](https://github.com/bitcoin/bitcoin/pull/25378) | [3.7.17](https://github.com/bitcoin/bitcoin/pull/19077) | No | diff --git a/src/qt/CMakeLists.txt b/src/qt/CMakeLists.txt index 797b49c624d..fe311bb062c 100644 --- a/src/qt/CMakeLists.txt +++ b/src/qt/CMakeLists.txt @@ -11,21 +11,35 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") string(APPEND CMAKE_OBJCXX_COMPILE_OBJECT " ${APPEND_CPPFLAGS} ${APPEND_CXXFLAGS}") endif() -get_target_property(qt_lib_type Qt5::Core TYPE) +get_target_property(qt_lib_type Qt6::Core TYPE) function(import_plugins target) if(qt_lib_type STREQUAL "STATIC_LIBRARY") - set(plugins Qt5::QMinimalIntegrationPlugin) + set(plugins Qt6::QMinimalIntegrationPlugin) if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - list(APPEND plugins Qt5::QXcbIntegrationPlugin) + list(APPEND plugins Qt6::QXcbIntegrationPlugin) elseif(WIN32) - list(APPEND plugins Qt5::QWindowsIntegrationPlugin Qt5::QWindowsVistaStylePlugin) + list(APPEND plugins Qt6::QWindowsIntegrationPlugin Qt6::QModernWindowsStylePlugin) elseif(APPLE) - list(APPEND plugins Qt5::QCocoaIntegrationPlugin Qt5::QMacStylePlugin) + list(APPEND plugins Qt6::QCocoaIntegrationPlugin Qt6::QMacStylePlugin) endif() - qt5_import_plugins(${target} + qt6_import_plugins(${target} INCLUDE ${plugins} - EXCLUDE_BY_TYPE imageformats iconengines + EXCLUDE_BY_TYPE + accessiblebridge + platforms + platforms_darwin + xcbglintegrations + platformthemes + platforminputcontexts + generic + iconengines + imageformats + egldeviceintegrations + styles + networkaccess + networkinformation + tls ) endif() endfunction() @@ -45,7 +59,7 @@ set(CMAKE_AUTOUIC_SEARCH_PATHS forms) # to https://github.com/bitcoin-core/bitcoin-maintainer-tools/blob/main/update-translations.py file(GLOB ts_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} locale/*.ts) set_source_files_properties(${ts_files} PROPERTIES OUTPUT_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/locale) -qt5_add_translation(qm_files ${ts_files}) +qt6_add_translation(qm_files ${ts_files}) configure_file(bitcoin_locale.qrc bitcoin_locale.qrc USE_SOURCE_PERMISSIONS COPYONLY) @@ -128,7 +142,7 @@ set_property(SOURCE macnotificationhandler.mm ) target_link_libraries(bitcoinqt PUBLIC - Qt5::Widgets + Qt6::Widgets PRIVATE core_interface bitcoin_cli @@ -206,19 +220,33 @@ if(ENABLE_WALLET) target_link_libraries(bitcoinqt PRIVATE bitcoin_wallet - Qt5::Network + Qt6::Network ) endif() if(WITH_DBUS) - target_link_libraries(bitcoinqt PRIVATE Qt5::DBus) + target_link_libraries(bitcoinqt PRIVATE Qt6::DBus) endif() if(qt_lib_type STREQUAL "STATIC_LIBRARY") # We want to define static plugins to link ourselves, thus preventing # automatic linking against a "sane" set of default static plugins. - qt5_import_plugins(bitcoinqt - EXCLUDE_BY_TYPE bearer iconengines imageformats platforms styles + qt6_import_plugins(bitcoinqt + EXCLUDE_BY_TYPE + accessiblebridge + platforms + platforms_darwin + xcbglintegrations + platformthemes + platforminputcontexts + generic + iconengines + imageformats + egldeviceintegrations + styles + networkaccess + networkinformation + tls ) endif() @@ -321,8 +349,8 @@ else() file(GLOB ui_files ${CMAKE_CURRENT_SOURCE_DIR}/forms/*.ui) add_custom_target(translate COMMAND ${CMAKE_COMMAND} -E env XGETTEXT=${XGETTEXT_EXECUTABLE} COPYRIGHT_HOLDERS=${COPYRIGHT_HOLDERS} ${Python3_EXECUTABLE} ${PROJECT_SOURCE_DIR}/share/qt/extract_strings_qt.py ${translatable_sources} - COMMAND Qt5::lupdate -no-obsolete -I ${PROJECT_SOURCE_DIR}/src -locations relative ${CMAKE_CURRENT_SOURCE_DIR}/bitcoinstrings.cpp ${ui_files} ${qt_translatable_sources} -ts ${CMAKE_CURRENT_SOURCE_DIR}/locale/bitcoin_en.ts - COMMAND Qt5::lconvert -drop-translations -o ${CMAKE_CURRENT_SOURCE_DIR}/locale/bitcoin_en.xlf -i ${CMAKE_CURRENT_SOURCE_DIR}/locale/bitcoin_en.ts + COMMAND Qt6::lupdate -no-obsolete -I ${PROJECT_SOURCE_DIR}/src -locations relative ${CMAKE_CURRENT_SOURCE_DIR}/bitcoinstrings.cpp ${ui_files} ${qt_translatable_sources} -ts ${CMAKE_CURRENT_SOURCE_DIR}/locale/bitcoin_en.ts + COMMAND Qt6::lconvert -drop-translations -o ${CMAKE_CURRENT_SOURCE_DIR}/locale/bitcoin_en.xlf -i ${CMAKE_CURRENT_SOURCE_DIR}/locale/bitcoin_en.ts COMMAND ${SED_EXECUTABLE} -i.old -e "s|source-language=\"en\" target-language=\"en\"|source-language=\"en\"|" -e "/<\\/target>/d" ${CMAKE_CURRENT_SOURCE_DIR}/locale/bitcoin_en.xlf COMMAND ${CMAKE_COMMAND} -E rm ${CMAKE_CURRENT_SOURCE_DIR}/locale/bitcoin_en.xlf.old WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/src diff --git a/src/qt/README.md b/src/qt/README.md index 4a662b2a12d..b82c3021e23 100644 --- a/src/qt/README.md +++ b/src/qt/README.md @@ -1,6 +1,6 @@ This directory contains the source code for the Bitcoin Core graphical user interface (GUI). It uses the [Qt](https://www1.qt.io/developers/) cross-platform framework. -The current precise version for Qt 5 is specified in [qt.mk](/depends/packages/qt.mk). +The current precise version for Qt is specified in [qt_details.mk](/depends/packages/qt_details.mk). ## Compile and run diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 0ee1b359fa9..48496c51355 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -88,7 +88,11 @@ SendCoinsDialog::SendCoinsDialog(const PlatformStyle *_platformStyle, QWidget *p // Coin Control connect(ui->pushButtonCoinControl, &QPushButton::clicked, this, &SendCoinsDialog::coinControlButtonClicked); +#if (QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)) + connect(ui->checkBoxCoinControlChange, &QCheckBox::checkStateChanged, this, &SendCoinsDialog::coinControlChangeChecked); +#else connect(ui->checkBoxCoinControlChange, &QCheckBox::stateChanged, this, &SendCoinsDialog::coinControlChangeChecked); +#endif connect(ui->lineEditCoinControlChange, &QValidatedLineEdit::textEdited, this, &SendCoinsDialog::coinControlChangeEdited); // Coin Control: clipboard actions @@ -183,8 +187,13 @@ void SendCoinsDialog::setModel(WalletModel *_model) #endif connect(ui->customFee, &BitcoinAmountField::valueChanged, this, &SendCoinsDialog::coinControlUpdateLabels); +#if (QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)) + connect(ui->optInRBF, &QCheckBox::checkStateChanged, this, &SendCoinsDialog::updateSmartFeeLabel); + connect(ui->optInRBF, &QCheckBox::checkStateChanged, this, &SendCoinsDialog::coinControlUpdateLabels); +#else connect(ui->optInRBF, &QCheckBox::stateChanged, this, &SendCoinsDialog::updateSmartFeeLabel); connect(ui->optInRBF, &QCheckBox::stateChanged, this, &SendCoinsDialog::coinControlUpdateLabels); +#endif CAmount requiredFee = model->wallet().getRequiredFee(1000); ui->customFee->SetMinValue(requiredFee); if (ui->customFee->value() < requiredFee) { @@ -944,7 +953,11 @@ void SendCoinsDialog::coinControlButtonClicked() } // Coin Control: checkbox custom change address +#if (QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)) +void SendCoinsDialog::coinControlChangeChecked(Qt::CheckState state) +#else void SendCoinsDialog::coinControlChangeChecked(int state) +#endif { if (state == Qt::Unchecked) { diff --git a/src/qt/sendcoinsdialog.h b/src/qt/sendcoinsdialog.h index 4e861e55bb3..6ab26df1778 100644 --- a/src/qt/sendcoinsdialog.h +++ b/src/qt/sendcoinsdialog.h @@ -103,7 +103,11 @@ private Q_SLOTS: void refreshBalance(); void coinControlFeatureChanged(bool); void coinControlButtonClicked(); +#if (QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)) + void coinControlChangeChecked(Qt::CheckState); +#else void coinControlChangeChecked(int); +#endif void coinControlChangeEdited(const QString &); void coinControlUpdateLabels(); void coinControlClipboardQuantity(); diff --git a/src/qt/test/CMakeLists.txt b/src/qt/test/CMakeLists.txt index 3acdfeade34..cbfb144596b 100644 --- a/src/qt/test/CMakeLists.txt +++ b/src/qt/test/CMakeLists.txt @@ -20,7 +20,7 @@ target_link_libraries(test_bitcoin-qt test_util bitcoin_node Boost::headers - Qt5::Test + Qt6::Test ) import_plugins(test_bitcoin-qt) diff --git a/test/sanitizer_suppressions/lsan b/test/sanitizer_suppressions/lsan index 7ccb22515f9..c157447884a 100644 --- a/test/sanitizer_suppressions/lsan +++ b/test/sanitizer_suppressions/lsan @@ -1,2 +1,2 @@ # Suppress warnings triggered in dependencies -leak:libQt5Widgets +leak:libQt6Widgets diff --git a/test/sanitizer_suppressions/ubsan b/test/sanitizer_suppressions/ubsan index 6e636b56b8e..a92b16b1d9c 100644 --- a/test/sanitizer_suppressions/ubsan +++ b/test/sanitizer_suppressions/ubsan @@ -17,6 +17,7 @@ unsigned-integer-overflow:test/fuzz/crypto_diff_fuzz_chacha20.cpp implicit-integer-sign-change:*/include/boost/ implicit-integer-sign-change:*/include/c++/ implicit-integer-sign-change:*/new_allocator.h +implicit-integer-sign-change:*/qarraydata.h implicit-integer-sign-change:crc32c/ implicit-integer-sign-change:minisketch/ implicit-integer-sign-change:secp256k1/ diff --git a/vcpkg.json b/vcpkg.json index 66ffb85e726..4ff3f34406c 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -8,7 +8,7 @@ "libevent" ], "default-features": [ - "qt5", + "qt", "tests", "wallet", "berkeleydb", @@ -21,11 +21,11 @@ "berkeleydb" ] }, - "qt5": { - "description": "Build GUI, Qt 5", + "qt": { + "description": "Build GUI, Qt 6", "dependencies": [ - "qt5-base", - "qt5-tools", + "qtbase", + "qttools", "libqrencode" ] },