Skip to content

Commit bf75c99

Browse files
committed
Merge bitcoin/bitcoin#32828: build, docs: Fix Boost-related issues on NetBSD
5a5ddbd build: Add workaround for NetBSD bug in `Boost::headers` target (Hennadii Stepanov) 4eb3cee doc: Update NetBSD Build Guide (Hennadii Stepanov) Pull request description: The recently merged bitcoin/bitcoin#32667 broke builds on NetBSD due to the following issues: 1. The `boost-headers` package does not provide CMake configuration files now required since bitcoin/bitcoin#32667. The first commit updates the Build Guide to recommend using the `boost` package instead. 2. The CMake configuration file provided by the `boost` package is [broken](NetBSD/pkgsrc#167). The second commit adds a workaround for this issue. Upstream issues: - NetBSD/pkgsrc#167 - NetBSD/pkgsrc#168 Successful CI job: https://github.com/hebasto/bitcoin-core-nightly/actions/runs/15958818914/job/45008576879. ACKs for top commit: purpleKarrot: ACK 5a5ddbd Tree-SHA512: 617543edf2216c3673195cc562541d7637d7ea199320916c3660a91f6ee1ff01c014f519c5eeb3fc224f7a7304fdb75965ee3f4554d7fb277dd05ba3a6583b45
2 parents 7fa9b58 + 5a5ddbd commit bf75c99

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

cmake/module/AddBoostIfNeeded.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ function(add_boost_if_needed)
3131

3232
find_package(Boost 1.73.0 REQUIRED CONFIG)
3333
mark_as_advanced(Boost_INCLUDE_DIR boost_headers_DIR)
34+
# Workaround for a bug in NetBSD pkgsrc.
35+
# See: https://github.com/NetBSD/pkgsrc/issues/167.
36+
if(CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
37+
get_filename_component(_boost_include_dir "${boost_headers_DIR}/../../../include/" ABSOLUTE)
38+
set_target_properties(Boost::headers PROPERTIES
39+
INTERFACE_INCLUDE_DIRECTORIES ${_boost_include_dir}
40+
)
41+
unset(_boost_include_dir)
42+
endif()
3443
set_target_properties(Boost::headers PROPERTIES IMPORTED_GLOBAL TRUE)
3544
target_compile_definitions(Boost::headers INTERFACE
3645
# We don't use multi_index serialization.

doc/build-netbsd.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Install the required dependencies the usual way you [install software on NetBSD]
1212
The example commands below use `pkgin`.
1313

1414
```bash
15-
pkgin install git cmake pkg-config boost-headers libevent
15+
pkgin install git cmake pkg-config boost libevent
1616
```
1717

1818
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.

0 commit comments

Comments
 (0)