From ddaec964c03ae0bd11d7438f37ad7a6f037cff22 Mon Sep 17 00:00:00 2001 From: merge-script Date: Thu, 1 Aug 2024 11:27:32 +0100 Subject: [PATCH] Merge bitcoin/bitcoin#30565: depends: Fix `zeromq` build on OpenBSD 89b1d5c818a33440c0c497aa78721fb9b0af35a5 depends: Fix `zeromq` build on OpenBSD (Hennadii Stepanov) Pull request description: On the master branch @ 66e82dc90c598c9c42ff980693ef5367a845e1d0, the `zeromq` package fails to build on OpenBSD 7.5: ``` [ 19%] Building CXX object CMakeFiles/objects.dir/src/io_thread.cpp.o /home/hebasto/bitcoin/depends/work/build/amd64-unknown-openbsd7.5/zeromq/4.3.5-df5b1b9f936/src/io_thread.cpp:14:22: error: static_cast from 'std::nullptr_t' to 'poller_t::handle_t' (aka 'int') is not allowed _mailbox_handle (static_cast (NULL)) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. ``` This [regression](https://github.com/bitcoin/bitcoin/pull/29723#issuecomment-2261513105) was overlooked by me in https://github.com/bitcoin/bitcoin/pull/29723. This PR fixes the issue by backporting an upstream commit from https://github.com/zeromq/libzmq/pull/4659. ACKs for top commit: theStack: tACK 89b1d5c818a33440c0c497aa78721fb9b0af35a5 Tree-SHA512: 48d22ea99dfd44c5adf858c74e64082390da27b8ccad8c0d5a91d4dabfa3d12267cef98e4bb8c088e4cd0ec477c242cb1d47aace5c88cd86f796715bba957ed8 --- depends/packages/zeromq.mk | 2 ++ .../zeromq/openbsd_kqueue_headers.patch | 24 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 depends/patches/zeromq/openbsd_kqueue_headers.patch diff --git a/depends/packages/zeromq.mk b/depends/packages/zeromq.mk index e7f3000017..a6b12f5b52 100644 --- a/depends/packages/zeromq.mk +++ b/depends/packages/zeromq.mk @@ -8,6 +8,7 @@ $(package)_patches = remove_libstd_link.patch $(package)_patches += macos_mktemp_check.patch $(package)_patches += builtin_sha1.patch $(package)_patches += fix_have_windows.patch +$(package)_patches += openbsd_kqueue_headers.patch $(package)_patches += cmake_minimum.patch $(package)_patches += no_librt.patch $(package)_patches += fix_mingw_link.patch @@ -28,6 +29,7 @@ define $(package)_preprocess_cmds patch -p1 < $($(package)_patch_dir)/macos_mktemp_check.patch && \ patch -p1 < $($(package)_patch_dir)/builtin_sha1.patch && \ patch -p1 < $($(package)_patch_dir)/fix_have_windows.patch && \ + patch -p1 < $($(package)_patch_dir)/openbsd_kqueue_headers.patch && \ patch -p1 < $($(package)_patch_dir)/cmake_minimum.patch && \ patch -p1 < $($(package)_patch_dir)/no_librt.patch && \ patch -p1 < $($(package)_patch_dir)/fix_mingw_link.patch diff --git a/depends/patches/zeromq/openbsd_kqueue_headers.patch b/depends/patches/zeromq/openbsd_kqueue_headers.patch new file mode 100644 index 0000000000..7000e209fe --- /dev/null +++ b/depends/patches/zeromq/openbsd_kqueue_headers.patch @@ -0,0 +1,24 @@ +commit ff231d267370493814f933d151441866bf1e200b +Author: Min RK +Date: Fri Feb 23 13:21:08 2024 +0100 + + Problem: cmake search for kqueue missing headers + + Solution: include sys/types.h and sys/time.h as documented by kqueue + and used in autotools + + fixes kqueue detection on openbsd + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f956f3fd..814d5d46 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -380,7 +380,7 @@ endif(WIN32) + + if(NOT MSVC) + if(POLLER STREQUAL "") +- check_cxx_symbol_exists(kqueue sys/event.h HAVE_KQUEUE) ++ check_cxx_symbol_exists(kqueue "sys/types.h;sys/event.h;sys/time.h" HAVE_KQUEUE) + if(HAVE_KQUEUE) + set(POLLER "kqueue") + endif()