Skip to content

Commit

Permalink
[cnats] Update to 3.9.2 (#43172)
Browse files Browse the repository at this point in the history
  • Loading branch information
mtmk authored Jan 14, 2025
1 parent 60215b1 commit 1743897
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 57 deletions.
14 changes: 8 additions & 6 deletions ports/cnats/fix-sodium-dep.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 02adc2e..ccd5492 100644
index 305198f..0b559b8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -110,6 +110,11 @@ if(NATS_BUILD_STREAMING)
Expand All @@ -15,25 +15,27 @@ index 02adc2e..ccd5492 100644
SET(NATS_SODIUM_DIR "$ENV{NATS_SODIUM_DIR}")
ENDIF()
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index ea536de..6198776 100644
index 971ddf0..65fee5a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -63,7 +63,7 @@ if(NATS_BUILD_LIB_SHARED)
@@ -65,7 +65,7 @@ if(NATS_BUILD_LIB_SHARED)
install(TARGETS nats EXPORT cnats-targets DESTINATION ${NATS_LIBDIR})
install(EXPORT cnats-targets
NAMESPACE cnats::
- FILE cnats-config.cmake
+ FILE cnats-targets.cmake
DESTINATION ${NATS_LIBDIR}/cmake/cnats)
endif(NATS_BUILD_LIB_SHARED)

@@ -75,10 +75,14 @@ if(NATS_BUILD_LIB_STATIC)
install(FILES "${PROJECT_BINARY_DIR}/cnats-config-version.cmake"
DESTINATION ${NATS_LIBDIR}/cmake/cnats)
@@ -79,12 +79,16 @@ if(NATS_BUILD_LIB_STATIC)
install(TARGETS nats_static EXPORT cnats-targets ARCHIVE DESTINATION ${NATS_LIBDIR})
install(EXPORT cnats-targets
NAMESPACE cnats::
- FILE cnats-config.cmake
+ FILE cnats-targets.cmake
DESTINATION ${NATS_LIBDIR}/cmake/cnats)
install(FILES "${PROJECT_BINARY_DIR}/cnats-config-version.cmake"
DESTINATION ${NATS_LIBDIR}/cmake/cnats)
endif(NATS_BUILD_LIB_STATIC)

+include(CMakePackageConfigHelpers)
Expand Down
56 changes: 28 additions & 28 deletions ports/cnats/fix_install_path.patch
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b3f376c..8e6d06a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -60,7 +60,10 @@ if(NATS_BUILD_LIB_SHARED)
target_include_directories(nats PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include>)
- install(TARGETS nats EXPORT cnats-targets DESTINATION ${NATS_LIBDIR})
+ install(TARGETS nats EXPORT cnats-targets
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib
+ RUNTIME DESTINATION bin)
install(EXPORT cnats-targets
NAMESPACE cnats::
FILE cnats-targets.cmake
@@ -72,7 +75,10 @@ if(NATS_BUILD_LIB_STATIC)
target_include_directories(nats_static PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include>)
- install(TARGETS nats_static EXPORT cnats-targets ARCHIVE DESTINATION ${NATS_LIBDIR})
+ install(TARGETS nats_static EXPORT cnats-targets
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib
+ RUNTIME DESTINATION bin)
install(EXPORT cnats-targets
NAMESPACE cnats::
FILE cnats-targets.cmake
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 65fee5a..3731b86 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -62,7 +62,10 @@ if(NATS_BUILD_LIB_SHARED)
target_include_directories(nats PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include>)
- install(TARGETS nats EXPORT cnats-targets DESTINATION ${NATS_LIBDIR})
+ install(TARGETS nats EXPORT cnats-targets
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib
+ RUNTIME DESTINATION bin)
install(EXPORT cnats-targets
NAMESPACE cnats::
FILE cnats-targets.cmake
@@ -76,7 +79,10 @@ if(NATS_BUILD_LIB_STATIC)
target_include_directories(nats_static PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include>)
- install(TARGETS nats_static EXPORT cnats-targets ARCHIVE DESTINATION ${NATS_LIBDIR})
+ install(TARGETS nats_static EXPORT cnats-targets
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib
+ RUNTIME DESTINATION bin)
install(EXPORT cnats-targets
NAMESPACE cnats::
FILE cnats-targets.cmake
40 changes: 40 additions & 0 deletions ports/cnats/fix_test_backtrace_warning.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Subject: [PATCH] [FIXED] Build: failure with Android NDK

When building against Android NDK testsuit compilation fails due to
missing execinfo.h/backtrace implementation in platforms with id less
than 33. Because this is only in tests just checking for Android should
be enough to keep things simple.
---
test/test.c | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/test/test.c b/test/test.c
index 1919af2..9b20774 100644
--- a/test/test.c
+++ b/test/test.c
@@ -37025,12 +37025,22 @@ void test_StanSubTimeout(void)

#ifndef _WIN32
static void _sigsegv_handler(int sig) {
+
+// Android doesn't support backtrace before API Level 33.
+// Because this is for tests it's good enough to check
+// for Android only, until there is need for a better solution.
+#ifndef ANDROID
void *array[20];
int size = backtrace(array, 20);
+#endif // ANDROID

// print out all the frames to stderr
fprintf(stderr, "Error: signal %d:\n", sig);
+
+#ifndef ANDROID
backtrace_symbols_fd(array, size, STDERR_FILENO);
+#endif // ANDROID
+
exit(1);
}
#endif // _WIN32
--
2.45.2.windows.1

19 changes: 0 additions & 19 deletions ports/cnats/lowercase_ws2_32.patch

This file was deleted.

4 changes: 2 additions & 2 deletions ports/cnats/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO nats-io/nats.c
REF "v${VERSION}"
SHA512 4cc127a461a5074d8a49d8cee633577951152cd54f57b4118ff6e4a8c0da73e2f61e9e54546a34c9e79a4557165a80bedc7e9cf6ed0fde28134019eb59a241b9
SHA512 4d6ddb23733ca4dd7a4a54ea72d83f5bfce5e5634b3ea91a99610886e5e5ad99a119af8dba87665cb1d6cc1af25bfca41e533d9653e862ce281bd38ed588b94b
HEAD_REF main
PATCHES
fix-sodium-dep.patch
fix_install_path.patch
lowercase_ws2_32.patch
fix_test_backtrace_warning.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
Expand Down
2 changes: 1 addition & 1 deletion ports/cnats/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cnats",
"version": "3.8.2",
"version": "3.9.2",
"description": "A C client for the NATS messaging system",
"homepage": "https://github.com/nats-io/nats.c",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -1753,7 +1753,7 @@
"port-version": 3
},
"cnats": {
"baseline": "3.8.2",
"baseline": "3.9.2",
"port-version": 0
},
"cnl": {
Expand Down
5 changes: 5 additions & 0 deletions versions/c-/cnats.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "6a2319bfe5bc7b053e9ff322d23c866a6aa80119",
"version": "3.9.2",
"port-version": 0
},
{
"git-tree": "a521d9641d065db79cce09b63daef612a0a34c41",
"version": "3.8.2",
Expand Down

0 comments on commit 1743897

Please sign in to comment.