Skip to content

Commit

Permalink
depends: add zeromq mktemp macos patch
Browse files Browse the repository at this point in the history
  • Loading branch information
fanquake committed Jul 19, 2024
1 parent ed739d1 commit 0c86052
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
6 changes: 4 additions & 2 deletions depends/packages/zeromq.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ $(package)_version=4.3.5
$(package)_download_path=https://github.com/zeromq/libzmq/releases/download/v$($(package)_version)/
$(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_sha256_hash=6653ef5910f17954861fe72332e68b03ca6e4d9c7160eb3a8de5a5a913bfab43
$(package)_patches=remove_libstd_link.patch
$(package)_patches = remove_libstd_link.patch
$(package)_patches += macos_mktemp_check.patch

define $(package)_set_vars
$(package)_config_opts = --without-docs --disable-shared --disable-valgrind
Expand All @@ -14,7 +15,8 @@ define $(package)_set_vars
endef

define $(package)_preprocess_cmds
patch -p1 < $($(package)_patch_dir)/remove_libstd_link.patch
patch -p1 < $($(package)_patch_dir)/remove_libstd_link.patch && \
patch -p1 < $($(package)_patch_dir)/macos_mktemp_check.patch
endef

define $(package)_config_cmds
Expand Down
16 changes: 16 additions & 0 deletions depends/patches/zeromq/macos_mktemp_check.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
build: fix mkdtemp check on macOS

On macOS, mkdtemp is in unistd.h. Fix the CMake check so that is works.
Upstreamed in https://github.com/zeromq/libzmq/pull/4668.

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -599,7 +599,7 @@ if(NOT MSVC)

check_cxx_symbol_exists(fork unistd.h HAVE_FORK)
check_cxx_symbol_exists(gethrtime sys/time.h HAVE_GETHRTIME)
- check_cxx_symbol_exists(mkdtemp stdlib.h HAVE_MKDTEMP)
+ check_cxx_symbol_exists(mkdtemp "stdlib.h;unistd.h" HAVE_MKDTEMP)
check_cxx_symbol_exists(accept4 sys/socket.h HAVE_ACCEPT4)
check_cxx_symbol_exists(strnlen string.h HAVE_STRNLEN)
else()

0 comments on commit 0c86052

Please sign in to comment.