From 4eb3cee919ed1f11d57f455dc5374131c557c6d2 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Sun, 29 Jun 2025 20:04:49 +0100 Subject: [PATCH 1/2] doc: Update NetBSD Build Guide The `boost-headers` package does not provide CMake configuration files required since https://github.com/bitcoin/bitcoin/pull/32667. Install the `boost` package instead. --- doc/build-netbsd.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/build-netbsd.md b/doc/build-netbsd.md index da51c8744a0..c0abbabdf4c 100644 --- a/doc/build-netbsd.md +++ b/doc/build-netbsd.md @@ -12,7 +12,7 @@ Install the required dependencies the usual way you [install software on NetBSD] The example commands below use `pkgin`. ```bash -pkgin install git cmake pkg-config boost-headers libevent +pkgin install git cmake pkg-config boost libevent ``` NetBSD currently ships with an older version of `gcc` than is needed to build. You should upgrade your `gcc` and then pass this new version to the configure script. From 5a5ddbd78922236402df378c8588a7b0b3f83a13 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Sun, 29 Jun 2025 20:52:01 +0100 Subject: [PATCH 2/2] build: Add workaround for NetBSD bug in `Boost::headers` target Due to a bug in `boost_headers-config.cmake`, the `Boost::headers` target's `INTERFACE_INCLUDE_DIRECTORIES` property is set to "/usr", which is incorrect. --- cmake/module/AddBoostIfNeeded.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmake/module/AddBoostIfNeeded.cmake b/cmake/module/AddBoostIfNeeded.cmake index 178e595ff62..e2eaf5565ac 100644 --- a/cmake/module/AddBoostIfNeeded.cmake +++ b/cmake/module/AddBoostIfNeeded.cmake @@ -31,6 +31,15 @@ function(add_boost_if_needed) find_package(Boost 1.73.0 REQUIRED CONFIG) mark_as_advanced(Boost_INCLUDE_DIR boost_headers_DIR) + # Workaround for a bug in NetBSD pkgsrc. + # See: https://github.com/NetBSD/pkgsrc/issues/167. + if(CMAKE_SYSTEM_NAME STREQUAL "NetBSD") + get_filename_component(_boost_include_dir "${boost_headers_DIR}/../../../include/" ABSOLUTE) + set_target_properties(Boost::headers PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES ${_boost_include_dir} + ) + unset(_boost_include_dir) + endif() set_target_properties(Boost::headers PROPERTIES IMPORTED_GLOBAL TRUE) target_compile_definitions(Boost::headers INTERFACE # We don't use multi_index serialization.