[zeromq] Download patch files for GitHub PRs (#23435)

* [zeromq] Download patch files for GitHub PRs

This is needed to have a stable checksum for the patches because GitHub
is returning a different checksum for the patches now because the index
objects are abbreviated to 9 characters instead of 10 characters, e.g.
for patch4311:

```diff
+ index 24cce83d1..c6d625188 100644
- index 24cce83d11..c6d625188d 100644
```
Reported at <https://github.com/microsoft/vcpkg/pull/22681#issuecomment-1061312320>.

A possible long-term fix is reported to GitHub at
<https://github.com/github/feedback/discussions/12531>.

* [zeromq] Update version
This commit is contained in:
Zaki Mughal [sivoais] 2022-03-15 17:07:53 -04:00 committed by GitHub
parent 3d55d7185e
commit b0d88dd9ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 82 additions and 16 deletions

View File

@ -1,15 +1,3 @@
vcpkg_download_distfile(patch4310
URLS "https://patch-diff.githubusercontent.com/raw/zeromq/libzmq/pull/4310.diff"
FILENAME "zeromq-libzmq-4310.diff"
SHA512 64e6d37ab843e5b9aa9e56ba7904423ce0a2c6b4101dbd86b7b8b22c52c384ed7ea9764f9e0a53be04e7ade09923ca95452104e9760b66ebc0ed3ffef08a75c5
)
vcpkg_download_distfile(patch4311
URLS "https://patch-diff.githubusercontent.com/raw/zeromq/libzmq/pull/4311.diff"
FILENAME "zeromq-libzmq-4311.diff"
SHA512 2b04e0ce4743d27070ea832c45e2d8fa0091c755757937cfa2a2bb43283ee38dc9f27343989e1ad8c45fda8a3cfaa012250b0c581e2f0407938cbb61b2a21e63
)
vcpkg_from_github( vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH OUT_SOURCE_PATH SOURCE_PATH
REPO zeromq/libzmq REPO zeromq/libzmq
@ -17,8 +5,8 @@ vcpkg_from_github(
SHA512 ad828b1ab5a87983285a6b44b08240816ed1c4e2c73306ab1a851bf80df1892b5e2f92064a49fbadc1f4c75043625ace77dd25b64d5d1c2a7d1d61cc916fba0b SHA512 ad828b1ab5a87983285a6b44b08240816ed1c4e2c73306ab1a851bf80df1892b5e2f92064a49fbadc1f4c75043625ace77dd25b64d5d1c2a7d1d61cc916fba0b
PATCHES PATCHES
fix-arm.patch fix-arm.patch
${patch4310} zeromq-libzmq-4310-64e6d37ab8.diff # https://patch-diff.githubusercontent.com/raw/zeromq/libzmq/pull/4310.diff
${patch4311} zeromq-libzmq-4311-2b04e0ce47.diff # https://patch-diff.githubusercontent.com/raw/zeromq/libzmq/pull/4311.diff
) )
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC)

View File

@ -1,7 +1,7 @@
{ {
"name": "zeromq", "name": "zeromq",
"version": "4.3.4", "version": "4.3.4",
"port-version": 4, "port-version": 5,
"description": "The ZeroMQ lightweight messaging kernel is a library which extends the standard socket interfaces with features traditionally provided by specialised messaging middleware products", "description": "The ZeroMQ lightweight messaging kernel is a library which extends the standard socket interfaces with features traditionally provided by specialised messaging middleware products",
"homepage": "https://github.com/zeromq/libzmq", "homepage": "https://github.com/zeromq/libzmq",
"license": "LGPL-3.0-only", "license": "LGPL-3.0-only",

View File

@ -0,0 +1,55 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6c983c6698..21bcd414a0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15,6 +15,7 @@ include(CheckCSourceCompiles)
include(CheckCSourceRuns)
include(CMakeDependentOption)
include(CheckCXXSymbolExists)
+include(CheckStructHasMember)
include(CheckTypeSize)
include(FindThreads)
include(GNUInstallDirs)
@@ -495,8 +496,12 @@ endif()
if(NOT WIN32)
set(ZMQ_HAVE_IPC 1)
+ set(ZMQ_HAVE_STRUCT_SOCKADDR_UN 1)
else()
check_include_files("winsock2.h;afunix.h" ZMQ_HAVE_IPC)
+ if(ZMQ_HAVE_IPC)
+ check_struct_has_member("struct sockaddr_un" sun_path "winsock2.h;afunix.h" ZMQ_HAVE_STRUCT_SOCKADDR_UN)
+ endif()
endif()
# ##################### BEGIN condition_variable_t selection
diff --git a/builds/cmake/platform.hpp.in b/builds/cmake/platform.hpp.in
index 2d23e8b288..18064362fe 100644
--- a/builds/cmake/platform.hpp.in
+++ b/builds/cmake/platform.hpp.in
@@ -59,6 +59,7 @@
#cmakedefine ZMQ_HAVE_LIBBSD
#cmakedefine ZMQ_HAVE_IPC
+#cmakedefine ZMQ_HAVE_STRUCT_SOCKADDR_UN
#cmakedefine ZMQ_USE_BUILTIN_SHA1
#cmakedefine ZMQ_USE_NSS
diff --git a/src/windows.hpp b/src/windows.hpp
index 11c7581dee..24cce83d11 100644
--- a/src/windows.hpp
+++ b/src/windows.hpp
@@ -98,3 +98,13 @@ static inline int poll (struct pollfd *pfd, unsigned long nfds, int timeout)
#define snprintf(buffer_, count_, format_, ...) \
_snprintf_s (buffer_, count_, _TRUNCATE, format_, __VA_ARGS__)
#endif
+
+// Workaround missing struct sockaddr_un in afunix.h.
+// Fix #3949.
+#if defined(ZMQ_HAVE_IPC) && !defined(ZMQ_HAVE_STRUCT_SOCKADDR_UN)
+struct sockaddr_un
+{
+ ADDRESS_FAMILY sun_family; /* AF_UNIX */
+ char sun_path[108]; /* pathname */
+};
+#endif

View File

@ -0,0 +1,18 @@
diff --git a/src/windows.hpp b/src/windows.hpp
index 24cce83d11..c6d625188d 100644
--- a/src/windows.hpp
+++ b/src/windows.hpp
@@ -90,7 +90,6 @@ static inline int poll (struct pollfd *pfd, unsigned long nfds, int timeout)
#ifndef AI_NUMERICSERV
#define AI_NUMERICSERV 0x0400
#endif
-#endif
// In MSVC prior to v14, snprintf is not available
// The closest implementation is the _snprintf_s function
@@ -108,3 +107,5 @@ struct sockaddr_un
char sun_path[108]; /* pathname */
};
#endif
+
+#endif

View File

@ -7594,7 +7594,7 @@
}, },
"zeromq": { "zeromq": {
"baseline": "4.3.4", "baseline": "4.3.4",
"port-version": 4 "port-version": 5
}, },
"zfp": { "zfp": {
"baseline": "0.5.5", "baseline": "0.5.5",

View File

@ -1,5 +1,10 @@
{ {
"versions": [ "versions": [
{
"git-tree": "246f585e58f536087c5f70f918459d5500a4dc43",
"version": "4.3.4",
"port-version": 5
},
{ {
"git-tree": "efc9d6229adaef7b036d222004dd786353f8cd4e", "git-tree": "efc9d6229adaef7b036d222004dd786353f8cd4e",
"version": "4.3.4", "version": "4.3.4",