From 3a666e53ed2ddbe01b9fe1e314c9354bd608ec94 Mon Sep 17 00:00:00 2001 From: merge-script Date: Tue, 8 Oct 2024 12:09:34 +0100 Subject: [PATCH 1/9] Merge bitcoin/bitcoin#31008: depends: Print ready-to-use `--toolchain` option for CMake invocation 605926da0ab4ac7ae4e9aed55a059f37c31c15b5 depends: Print ready-to-use `--toolchain` option for CMake invocation (Hennadii Stepanov) Pull request description: Requested in https://github.com/bitcoin/bitcoin/pull/30997#issuecomment-2385057317: > P.S. it would be nice if `make` in `depends` provides the incantation needed for the configure stage. An example of a build log with this PR: ``` $ make --no-print-directory -C depends -j16 NO_QT=1 NO_WALLET=1 NO_UPNP=1 NO_NATPMP=1 NO_ZMQ=1 NO_USDT=1 LOG=1 Extracting boost... /home/hebasto/git/bitcoin/depends/sources/boost_1_81_0.tar.gz: OK Preprocessing boost... Configuring boost... Building boost... Staging boost... Postprocessing boost... Caching boost... Extracting libevent... /home/hebasto/git/bitcoin/depends/sources/libevent-2.1.12-stable.tar.gz: OK Preprocessing libevent... Configuring libevent... Building libevent... Staging libevent... Postprocessing libevent... Caching libevent... copying packages: boost libevent to: /home/hebasto/git/bitcoin/depends/x86_64-pc-linux-gnu To build Bitcoin Core with these packages, pass '--toolchain /home/hebasto/git/bitcoin/depends/x86_64-pc-linux-gnu/toolchain.cmake' to the first CMake invocation. ``` ACKs for top commit: Sjors: tACK 605926da0ab4ac7ae4e9aed55a059f37c31c15b5 theuni: ACK 605926da0ab4ac7ae4e9aed55a059f37c31c15b5 jarolrod: ACK 605926da0ab4ac7ae4e9aed55a059f37c31c15b5 pablomartin4btc: ACK 605926da0ab4ac7ae4e9aed55a059f37c31c15b5 Tree-SHA512: 658358cb12a2409486962273d418f8cfa9609c84c6e70b426250173925c0938a6eba0dca72f43d78cc63c9cb927514c959473da04bdcda714228c5d8c248c1fe (cherry picked from commit caf44e500eb257376c36c0e043f71f72b949f743) --- depends/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/depends/Makefile b/depends/Makefile index c63277f091b9..fe4700709ebf 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -211,6 +211,7 @@ $(host_prefix)/.stamp_$(final_build_id): $(native_packages) $(packages) echo copying packages: $^ echo to: $(@D) cd $(@D); $(foreach package,$^, $(build_TAR) xf $($(package)_cached); ) + echo To build Dash Core with these packages, pass \'--toolchain $(@D)/toolchain.cmake\' to the first CMake invocation. touch $@ ifeq ($(host),$(build)) From 322aaad92a5c55dafa4ff2743cd6b357ba117010 Mon Sep 17 00:00:00 2001 From: merge-script Date: Thu, 7 Nov 2024 17:12:21 +0000 Subject: [PATCH 2/9] Merge bitcoin/bitcoin#31171: depends: Specify CMake generator explicitly e2ba8236715ee4530d08312b075d8b41cb592257 depends: Specify CMake generator explicitly (Hennadii Stepanov) Pull request description: Building packages in depends implies using GNU Make. However, this assumption can be wrong in environments where the [`CMAKE_GENERATOR`](https://cmake.org/cmake/help/latest/envvar/CMAKE_GENERATOR.html) variable is set. This change explicitly makes CMake use the "Unix Makefiles" generator. Can be tested as follows: ``` $ env CMAKE_GENERATOR=Ninja make -C depends ``` ACKs for top commit: fanquake: ACK e2ba8236715ee4530d08312b075d8b41cb592257 - Going forward I think we should look at making this work without having to hard code anything. Tree-SHA512: e14ed1cec192434fe089d36a83e1e150727a3b299fada80a61fa5b44b0c50e014a774ef1e6cd6df189e25f7a13042a20d4f9605f6ccd32e7782f10adaf5e788f (cherry picked from commit 3a5f6027e165c1c70e58eb26dbade8df78ea9534) --- depends/funcs.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/depends/funcs.mk b/depends/funcs.mk index db09a2819110..e5d44572b000 100644 --- a/depends/funcs.mk +++ b/depends/funcs.mk @@ -180,7 +180,8 @@ $(1)_cmake=env CC="$$($(1)_cc)" \ CXX="$$($(1)_cxx)" \ CXXFLAGS="$$($(1)_cppflags) $$($(1)_cxxflags)" \ LDFLAGS="$$($(1)_ldflags)" \ - cmake -DCMAKE_INSTALL_PREFIX:PATH="$$($($(1)_type)_prefix)" \ + cmake -G "Unix Makefiles" \ + -DCMAKE_INSTALL_PREFIX:PATH="$$($($(1)_type)_prefix)" \ -DCMAKE_AR=`which $$($(1)_ar)` \ -DCMAKE_NM=`which $$($(1)_nm)` \ -DCMAKE_RANLIB=`which $$($(1)_ranlib)` \ From 8dc6f9ed4302dde3b5d5d41ba3ba6d764a23469f Mon Sep 17 00:00:00 2001 From: merge-script Date: Wed, 20 Nov 2024 10:53:35 +0000 Subject: [PATCH 3/9] partial Merge bitcoin/bitcoin#31276: guix: scope pkg-config to Linux only bcd82b13f4649e57d7d106856aab7b2a6296d728 Remove pkgconfig from toolchain file (TheCharlatan) 319a4e82614283afb3dbc5d38ff3b9d17fb911b3 depends: drop sqlite pkgconfig file (fanquake) a8fe1fd38bf496356dc4f28963d4edfa75fe04a5 depends: better cleanup after fontconfig (fanquake) 17e79c92607e2e32b48ffd388828184c5d1a65df depends: fully remove libtool archives from Qt build (fanquake) 8ca85651c8350a6edb069eae0f88cf03c6eae0d5 guix: move pkg-config to Linux builds (fanquake) e3e648cf410d30185927d031c81a85d5fa890b8c depends: drop pkg-config option from Qt build (fanquake) 0d185bd99f9e40913f678af0fc224add2e1d2f14 doc: update depends doc to prefer .cmake outputs (fanquake) Pull request description: After #31181, `pkg-config` is no-longer needed for macOS or Windows Guix builds. It's still needed for Linux, as it's used by a Qt subdependency (fontconfig to find freetype). However we should also no-longer need it for Qt itself, when building using depends. ACKs for top commit: TheCharlatan: ACK bcd82b13f4649e57d7d106856aab7b2a6296d728 Tree-SHA512: 89ae68281030d43fcb6c5c96429cd038a21f13a8ca19ea828ada47e8f9f0aa7407854a67c9003652817e47ab9565573b7028342e3e11bb1cca1d823c483081cd (cherry picked from commit ab22726def96e9a411fea9de5f91ca94ae2a3ee7) Dash keeps the toolchain's pkg-config setup, pkg-config in the Guix manifest for every host, and the depends/packages.md guidance on .pc outputs. Upstream dropped them once bitcoin#31181 (FindLibevent revamp) had moved its depends builds off pkg-config. Dash still finds libevent, ZeroMQ, zstd, qrencode, miniupnpc and dash_sdk_cxx through pkg-config, so only the Qt, fontconfig and sqlite parts are taken. --- depends/packages/fontconfig.mk | 2 +- depends/packages/qt.mk | 8 +++----- depends/packages/sqlite.mk | 1 + depends/patches/qt/fix_qt_pkgconfig.patch | 11 ----------- 4 files changed, 5 insertions(+), 17 deletions(-) delete mode 100644 depends/patches/qt/fix_qt_pkgconfig.patch diff --git a/depends/packages/fontconfig.mk b/depends/packages/fontconfig.mk index 6baaecc55a76..bd20d7c9ff77 100644 --- a/depends/packages/fontconfig.mk +++ b/depends/packages/fontconfig.mk @@ -29,5 +29,5 @@ define $(package)_stage_cmds endef define $(package)_postprocess_cmds - rm -rf var lib/*.la + rm -rf bin etc share var lib/*.la endef diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index a6742b9ef9c9..740e027c28f3 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -11,7 +11,6 @@ $(package)_linguist_tools = lrelease lupdate lconvert $(package)_patches = qt.pro $(package)_patches += qttools_src.pro $(package)_patches += mac-qmake.conf -$(package)_patches += fix_qt_pkgconfig.patch $(package)_patches += no-xlib.patch $(package)_patches += dont_hardcode_pwd.patch $(package)_patches += qtbase-moc-ignore-gcc-macro.patch @@ -65,6 +64,7 @@ $(package)_config_opts += -no-mimetype-database $(package)_config_opts += -no-mtdev $(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 @@ -85,7 +85,6 @@ $(package)_config_opts += -nomake examples $(package)_config_opts += -nomake tests $(package)_config_opts += -nomake tools $(package)_config_opts += -opensource -$(package)_config_opts += -pkg-config $(package)_config_opts += -prefix $(host_prefix) $(package)_config_opts += -qt-libpng $(package)_config_opts += -qt-pcre @@ -226,7 +225,6 @@ 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)/fix_qt_pkgconfig.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 && \ @@ -274,6 +272,6 @@ define $(package)_stage_cmds endef define $(package)_postprocess_cmds - rm -rf doc/ native/lib/ && \ - rm -f lib/lib*.la + rm -rf doc/ native/lib/ lib/pkgconfig/ && \ + rm -f lib/lib*.la lib/Qt5*.la endef diff --git a/depends/packages/sqlite.mk b/depends/packages/sqlite.mk index 15bc0f4d7a3c..025176dfca5e 100644 --- a/depends/packages/sqlite.mk +++ b/depends/packages/sqlite.mk @@ -31,5 +31,6 @@ define $(package)_stage_cmds endef define $(package)_postprocess_cmds + rm -rf lib/pkgconfig && \ rm lib/*.la endef diff --git a/depends/patches/qt/fix_qt_pkgconfig.patch b/depends/patches/qt/fix_qt_pkgconfig.patch deleted file mode 100644 index 73f4d89f7354..000000000000 --- a/depends/patches/qt/fix_qt_pkgconfig.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- old/qtbase/mkspecs/features/qt_module.prf -+++ new/qtbase/mkspecs/features/qt_module.prf -@@ -269,7 +269,7 @@ load(qt_installs) - load(qt_targets) - - # this builds on top of qt_common --!internal_module:if(unix|mingw):!if(darwin:debug_and_release:CONFIG(debug, debug|release)) { -+if(unix|mingw):!if(darwin:debug_and_release:CONFIG(debug, debug|release)) { - CONFIG += create_pc - QMAKE_PKGCONFIG_DESTDIR = pkgconfig - host_build: \ From e232e3519c0c51803b8b78910a5ee7bc5e16514b Mon Sep 17 00:00:00 2001 From: merge-script Date: Wed, 5 Feb 2025 10:35:25 +0000 Subject: [PATCH 4/9] Merge bitcoin/bitcoin#31358: depends: Avoid hardcoding `host_prefix` in toolchain file d9c8aacce38ab593ea9277976eb64ccadd7d062f depends, refactor: Avoid hardcoding `host_prefix` in toolchain file (Hennadii Stepanov) Pull request description: This PR allows the entire `depends/` directory to be relocatable. Only `libevent` package configuration files are non-relocatable for the version `2.1.12-stable` we use now. However, this issue has been fixed upstream in https://github.com/libevent/libevent/commit/1f1593ff27bdf51c3e1c45b92cfb0ac931960298 and friends. Fixes https://github.com/bitcoin/bitcoin/issues/31050. ACKs for top commit: theuni: Neat. utACK d9c8aacce38ab593ea9277976eb64ccadd7d062f ryanofsky: Code review ACK d9c8aacce38ab593ea9277976eb64ccadd7d062f Tree-SHA512: c4c340722e63fc1da36fba2b15f025a6e1d477da1991194d678f546f2f3ea9454e2f0ff054aae6ae6c332a0781a597c3ce63b9018b46b8c258033f0d19efbef3 (cherry picked from commit 2aa7be1744a441fa8ae6d1299dee15d528f671a6) --- depends/Makefile | 1 - depends/toolchain.cmake.in | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/depends/Makefile b/depends/Makefile index fe4700709ebf..c33c21f084a1 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -234,7 +234,6 @@ $(host_prefix)/toolchain.cmake : toolchain.cmake.in $(host_prefix)/.stamp_$(fina -e 's|@STRIP@|$(host_STRIP)|' \ -e 's|@OBJCOPY@|$(host_OBJCOPY)|' \ -e 's|@OBJDUMP@|$(host_OBJDUMP)|' \ - -e 's|@depends_prefix@|$(host_prefix)|' \ -e 's|@CFLAGS@|$(strip $(host_CFLAGS))|' \ -e 's|@CFLAGS_RELEASE@|$(strip $(host_release_CFLAGS))|' \ -e 's|@CFLAGS_DEBUG@|$(strip $(host_debug_CFLAGS))|' \ diff --git a/depends/toolchain.cmake.in b/depends/toolchain.cmake.in index 818416913616..b139308e6b57 100644 --- a/depends/toolchain.cmake.in +++ b/depends/toolchain.cmake.in @@ -81,12 +81,12 @@ set(CMAKE_OBJDUMP "@OBJDUMP@") # affected by a potentially random environment. set(CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH OFF) -set(CMAKE_FIND_ROOT_PATH "@depends_prefix@") +set(CMAKE_FIND_ROOT_PATH "${CMAKE_CURRENT_LIST_DIR}") set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) -set(QT_TRANSLATIONS_DIR "@depends_prefix@/translations") +set(QT_TRANSLATIONS_DIR "${CMAKE_CURRENT_LIST_DIR}/translations") if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT CMAKE_HOST_APPLE) # The find_package(Qt ...) function internally uses find_library() From 614432d58c0843e731ee447c24e54318d75d600a Mon Sep 17 00:00:00 2001 From: merge-script Date: Fri, 14 Feb 2025 10:49:09 +0100 Subject: [PATCH 5/9] Merge bitcoin/bitcoin#31857: depends: avoid an unset `CMAKE_OBJDUMP` 2434aeab62ba07c5380112838f3600b3dbbceef2 depends: avoid an unset CMAKE_OBJDUMP (fanquake) Pull request description: Similar to #31840, currently our Linux toolchain file contains: ```bash set(CMAKE_AR "aarch64-linux-gnu-ar") set(CMAKE_RANLIB "aarch64-linux-gnu-ranlib") set(CMAKE_STRIP "aarch64-linux-gnu-strip") set(CMAKE_OBJCOPY "aarch64-linux-gnu-objcopy") set(CMAKE_OBJDUMP "") ``` `objdump` is currently only used for the macOS cross build, where it's `llvm-objdump`, but we should be consistent in producing a toolchain file that points to actual tools, rather than leaving variables unset. ACKs for top commit: hebasto: ACK 2434aeab62ba07c5380112838f3600b3dbbceef2. theuni: utACK 2434aeab62ba07c5380112838f3600b3dbbceef2 Tree-SHA512: 65f6b7b9cae79e9c0784c108709139125e52d8f2818afbea5f719bc1b6dc338b870abbdfcb174ae541c0027a7ac07cb56012735b7a37b58b9a6e55a48c0257cf (cherry picked from commit 109bfe9573b9c35b810396936d169d1ec4911d46) --- depends/hosts/default.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/depends/hosts/default.mk b/depends/hosts/default.mk index b0f907f13db0..be4d9c564bb0 100644 --- a/depends/hosts/default.mk +++ b/depends/hosts/default.mk @@ -9,6 +9,7 @@ default_host_RANLIB = $(host_toolchain)ranlib default_host_STRIP = $(host_toolchain)strip default_host_NM = $(host_toolchain)nm default_host_OBJCOPY = $(host_toolchain)objcopy +default_host_OBJDUMP = $(host_toolchain)objdump define add_host_tool_func ifneq ($(filter $(origin $1),undefined default),) From 3140b9c3a5307e54b4418f475c7a1f92387a308d Mon Sep 17 00:00:00 2001 From: merge-script Date: Thu, 27 Mar 2025 15:35:04 +0800 Subject: [PATCH 6/9] Merge bitcoin/bitcoin#31849: depends: set `CMAKE_*_COMPILER_TARGET` in toolchain 963355037fe78eb4fbdda8631ac05a7b07fcec8c depends: set CMAKE_*_COMPILER_TARGET in toolchain (fanquake) Pull request description: According to the CMake docs, this is the correct way to setup a toolchain file for cross-compilation using Clang. See https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-using-clang Internally it looks like CMake will only take this variable into account if it detects the compiler to be Clang, so this shouldn't effect other builds, but in the case of our Apple cross builds, we'd end up with a duplicated `--target=$ARCH-apple-darwin` on the compiler line, given we are already setting `--target` for Darwin builds. Would fix #31748. ACKs for top commit: hebasto: ACK 963355037fe78eb4fbdda8631ac05a7b07fcec8c, tested on Ubuntu 24.10. Tree-SHA512: 1aa0c5d9cb069ce277e53b5551baf5249c449331b0a160edb9a8ceb56209f886a9e2051e2ba63e0874904f652ace0280b7483dd5d81bfff9e993eb18abb961ad (cherry picked from commit e563cb5c60629b2a64c6672a0868d879adf258d7) --- depends/Makefile | 1 + depends/toolchain.cmake.in | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/depends/Makefile b/depends/Makefile index c33c21f084a1..92cfb001c211 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -223,6 +223,7 @@ endif $(host_prefix)/toolchain.cmake : toolchain.cmake.in $(host_prefix)/.stamp_$(final_build_id) @mkdir -p $(@D) sed -e 's|@depends_crosscompiling@|$(crosscompiling)|' \ + -e 's|@host@|$(host)|' \ -e 's|@host_system_name@|$($(host_os)_cmake_system_name)|' \ -e 's|@host_system_version@|$($(host_os)_cmake_system_version)|' \ -e 's|@host_arch@|$(host_arch)|' \ diff --git a/depends/toolchain.cmake.in b/depends/toolchain.cmake.in index b139308e6b57..aa0225867ddd 100644 --- a/depends/toolchain.cmake.in +++ b/depends/toolchain.cmake.in @@ -13,6 +13,10 @@ if(@depends_crosscompiling@) set(CMAKE_SYSTEM_NAME @host_system_name@) set(CMAKE_SYSTEM_VERSION @host_system_version@) set(CMAKE_SYSTEM_PROCESSOR @host_arch@) + + set(CMAKE_C_COMPILER_TARGET @host@) + set(CMAKE_CXX_COMPILER_TARGET @host@) + set(CMAKE_OBJCXX_COMPILER_TARGET @host@) endif() if(NOT DEFINED CMAKE_C_FLAGS_INIT) From 7ac9e152854f4f20dbcd2ac0214eb11504fb73c0 Mon Sep 17 00:00:00 2001 From: merge-script Date: Fri, 9 May 2025 14:04:39 +0100 Subject: [PATCH 7/9] Merge bitcoin/bitcoin#31360: depends: Avoid using helper variables in toolchain file 7343a1846cebf74ffef3c54e05b633df629510a1 depends: Avoid using helper variables in toolchain file (Hennadii Stepanov) Pull request description: Using helper variables has two issues: 1. They contaminate the global namespace of the main build script. 2. They can be used as `set(var)`, effectively [exposing](https://cmake.org/cmake/help/latest/command/set.html) a cache variable `var`, which makes the toolchain file susceptible to the build environment. The [`depends/Makefile`](https://github.com/bitcoin/bitcoin/blob/master/depends/Makefile) can generate values with "not-set" semantics as empty strings or strings containing only spaces. For example:https://github.com/bitcoin/bitcoin/blob/2638fdb4f934be96b7c798dbac38ea5ab8a6374a/depends/Makefile#L157 Therefore, [`MATCHES`](https://cmake.org/cmake/help/latest/command/if.html#matches) must be used rather than [`STREQUAL`](https://cmake.org/cmake/help/latest/command/if.html#strequal). ACKs for top commit: purpleKarrot: ACK 7343a1846cebf74ffef3c54e05b633df629510a1 Tree-SHA512: f2235321ac13daee8e82fa1ae9d02b95097a696265ad3a31fbda9cbc3c387c1dc7d01951154f99828468e50b73ed2889a6fa2720007f519dd11fe25ee5303d23 (cherry picked from commit b070ce16966fe18eb68f886ab9ca02d1d05a2f2a) --- depends/toolchain.cmake.in | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/depends/toolchain.cmake.in b/depends/toolchain.cmake.in index aa0225867ddd..b678bb319727 100644 --- a/depends/toolchain.cmake.in +++ b/depends/toolchain.cmake.in @@ -110,71 +110,64 @@ set(PKG_CONFIG_ARGN --static) # Set configuration options for the main build system. -set(qt_packages @qt_packages@) -if("${qt_packages}" STREQUAL "") +# The depends/Makefile can generate values with "not-set" +# semantics as empty strings or strings containing only spaces. +# Therefore, MATCHES must be used rather than STREQUAL. +if("@qt_packages@" MATCHES "^[ ]*$") set(BUILD_GUI OFF CACHE BOOL "") else() set(BUILD_GUI ON CACHE BOOL "") endif() -set(qrencode_packages @qrencode_packages@) -if("${qrencode_packages}" STREQUAL "") +if("@qrencode_packages@" MATCHES "^[ ]*$") set(WITH_QRENCODE OFF CACHE BOOL "") else() set(WITH_QRENCODE ON CACHE BOOL "") endif() -set(zmq_packages @zmq_packages@) -if("${zmq_packages}" STREQUAL "") +if("@zmq_packages@" MATCHES "^[ ]*$") set(WITH_ZMQ OFF CACHE BOOL "") else() set(WITH_ZMQ ON CACHE BOOL "") endif() -set(zstd_packages @zstd_packages@) -if("${zstd_packages}" STREQUAL "") +if("@zstd_packages@" MATCHES "^[ ]*$") set(WITH_ZSTD OFF CACHE BOOL "") else() set(WITH_ZSTD ON CACHE BOOL "") endif() -set(wallet_packages @wallet_packages@) -if("${wallet_packages}" STREQUAL "") +if("@wallet_packages@" MATCHES "^[ ]*$") set(ENABLE_WALLET OFF CACHE BOOL "") else() set(ENABLE_WALLET ON CACHE BOOL "") endif() -set(bdb_packages @bdb_packages@) -if("${wallet_packages}" STREQUAL "" OR "${bdb_packages}" STREQUAL "") +if("@wallet_packages@" MATCHES "^[ ]*$" OR "@bdb_packages@" MATCHES "^[ ]*$") set(WITH_BDB OFF CACHE BOOL "") else() set(WITH_BDB ON CACHE BOOL "") endif() -set(sqlite_packages @sqlite_packages@) -if("${wallet_packages}" STREQUAL "" OR "${sqlite_packages}" STREQUAL "") +if("@wallet_packages@" MATCHES "^[ ]*$" OR "@sqlite_packages@" MATCHES "^[ ]*$") set(WITH_SQLITE OFF CACHE BOOL "") else() set(WITH_SQLITE ON CACHE BOOL "") endif() -set(upnp_packages @upnp_packages@) -if("${upnp_packages}" STREQUAL "") +if("@upnp_packages@" MATCHES "^[ ]*$") set(WITH_MINIUPNPC OFF CACHE BOOL "") else() set(WITH_MINIUPNPC ON CACHE BOOL "") endif() -set(natpmp_packages @natpmp_packages@) -if("${natpmp_packages}" STREQUAL "") +if("@natpmp_packages@" MATCHES "^[ ]*$") set(WITH_NATPMP OFF CACHE BOOL "") else() set(WITH_NATPMP ON CACHE BOOL "") endif() -set(usdt_packages @usdt_packages@) -if("${usdt_packages}" STREQUAL "") +if("@usdt_packages@" MATCHES "^[ ]*$") set(WITH_USDT OFF CACHE BOOL "") else() set(WITH_USDT ON CACHE BOOL "") From 8513917009b4e017f0bdb5cd3aa590d8c4c5c803 Mon Sep 17 00:00:00 2001 From: merge-script Date: Mon, 14 Jul 2025 13:32:44 +0100 Subject: [PATCH 8/9] Merge bitcoin/bitcoin#32943: depends: Force `CMAKE_EXPORT_NO_PACKAGE_REGISTRY=TRUE` 44f3bae300dcafbe53f9b07e6cc22a112833e579 depends: Force `CMAKE_EXPORT_NO_PACKAGE_REGISTRY=TRUE` (Hennadii Stepanov) Pull request description: When using CMake policies 3.14 and below, the `export(PACKAGE)` command by default populates the user package registry, which is stored outside the build tree. Setting the `CMAKE_EXPORT_NO_PACKAGE_REGISTRY` variable disables this side effect. In CMake 3.15 and later, this behavior is disabled by default, and the variable has no effect. This PR forces `CMAKE_EXPORT_NO_PACKAGE_REGISTRY=TRUE` globally, rather than managing it for each dependency package individually rather. It may be reverted once all CMake-based packages have updated to policies 3.15 or newer. Fixes https://github.com/bitcoin/bitcoin/issues/32938. ACKs for top commit: fanquake: ACK 44f3bae300dcafbe53f9b07e6cc22a112833e579 Tree-SHA512: 0aac398b7182e80185b064d59f81aece4d8477a609fad9cc3fee317da2aff43b66ef7db1efec0135b4f0feaad23b1db664e33bd035fe659712c5b2a9bf2d6fb6 (cherry picked from commit e72cb20c3fb76b892c9d5eb5b13bca6c206ba111) --- depends/funcs.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/depends/funcs.mk b/depends/funcs.mk index e5d44572b000..259448097338 100644 --- a/depends/funcs.mk +++ b/depends/funcs.mk @@ -188,6 +188,7 @@ $(1)_cmake=env CC="$$($(1)_cc)" \ -DCMAKE_INSTALL_LIBDIR=lib/ \ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ -DCMAKE_VERBOSE_MAKEFILE:BOOL=$(V) \ + -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY:BOOL=TRUE \ $$($(1)_config_opts) ifeq ($($(1)_type),build) $(1)_cmake += -DCMAKE_INSTALL_RPATH:PATH="$$($($(1)_type)_prefix)/lib" From 3298b11b48dbd1d00b36d444f1f26e692b27dabf Mon Sep 17 00:00:00 2001 From: pasta Date: Mon, 16 Nov 2026 14:29:58 +0000 Subject: [PATCH 9/9] depends: make staged pkg-config files relocatable bitcoin#31358 lets the toolchain file find a depends prefix wherever it is, but Dash still finds libevent, ZeroMQ, zstd, QRencode, miniupnpc and the Platform SDK through the pkg-config files that depends installs, and those name the absolute prefix the package was built for. A moved prefix, or a package unpacked from a cache built by another checkout, therefore pointed CMake back at the original location. Upstream avoids this by no longer reading depends' pkg-config files (bitcoin#30903, #31181, #31173), which Dash has not backported. After postprocessing, replace the absolute prefix in every staged .pc file with ${pcfiledir}/../.., the same form platform_cxx already writes. Co-Authored-By: Claude Opus 5.5 --- depends/funcs.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/depends/funcs.mk b/depends/funcs.mk index 259448097338..0be61b148656 100644 --- a/depends/funcs.mk +++ b/depends/funcs.mk @@ -243,6 +243,10 @@ $($(1)_staged): | $($(1)_built) $($(1)_postprocessed): | $($(1)_staged) echo Postprocessing $(1)... cd $($(1)_staging_prefix_dir); $($(1)_postprocess_cmds) + cd $($(1)_staging_prefix_dir); \ + for pc in $$$$(find lib/pkgconfig share/pkgconfig -name '*.pc' 2>/dev/null); do \ + sed -e 's|$($($(1)_type)_prefix)|$$$${pcfiledir}/../..|g' "$$$$pc" > "$$$$pc.tmp" && mv "$$$$pc.tmp" "$$$$pc"; \ + done touch $$@ $($(1)_cached): | $($(1)_dependencies) $($(1)_postprocessed) echo Caching $(1)...