early-access version 2853

This commit is contained in:
pineappleEA
2022-07-23 03:01:36 +02:00
parent 1f2b5081b5
commit 1f111bb69c
8955 changed files with 418777 additions and 999 deletions

74
externals/vcpkg/ports/zookeeper/cmake.patch vendored Executable file
View File

@@ -0,0 +1,74 @@
diff --git a/zookeeper-client/zookeeper-client-c/CMakeLists.txt b/zookeeper-client/zookeeper-client-c/CMakeLists.txt
index 24a5a1b..40fa67e 100644
--- a/zookeeper-client/zookeeper-client-c/CMakeLists.txt
+++ b/zookeeper-client/zookeeper-client-c/CMakeLists.txt
@@ -147,13 +147,15 @@ endforeach()
include(CheckStructHasMember)
check_struct_has_member("struct sockaddr_in6" sin6_addr "netinet/in.h" ZOO_IPV6_ENABLED)
+include(GNUInstallDirs)
+
# configure
configure_file(cmake_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/config.h)
# hashtable library
set(hashtable_sources src/hashtable/hashtable_itr.c src/hashtable/hashtable.c)
add_library(hashtable STATIC ${hashtable_sources})
-target_include_directories(hashtable PUBLIC include)
+target_include_directories(hashtable PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
target_link_libraries(hashtable PUBLIC $<$<OR:$<PLATFORM_ID:Linux>,$<PLATFORM_ID:FreeBSD>>:m>)
# zookeeper library
@@ -176,11 +178,16 @@ if(WIN32)
endif()
add_library(zookeeper STATIC ${zookeeper_sources})
-target_include_directories(zookeeper PUBLIC include ${CMAKE_CURRENT_BINARY_DIR}/include generated)
+target_include_directories(zookeeper PUBLIC
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/generated>)
+
target_link_libraries(zookeeper PUBLIC
- hashtable
$<$<PLATFORM_ID:Linux>:rt> # clock_gettime
- $<$<PLATFORM_ID:Windows>:ws2_32>) # Winsock 2.0
+ $<$<PLATFORM_ID:Windows>:ws2_32> # Winsock 2.0
+ PRIVATE hashtable)
if(WANT_SYNCAPI AND NOT WIN32)
find_package(Threads REQUIRED)
@@ -189,7 +196,7 @@ endif()
# cli executable
add_executable(cli src/cli.c)
-target_link_libraries(cli zookeeper)
+target_link_libraries(cli PRIVATE zookeeper)
# load_gen executable
if(WANT_SYNCAPI AND NOT WIN32)
@@ -247,3 +254,23 @@ if(WANT_CPPUNIT)
"ZKROOT=${CMAKE_CURRENT_SOURCE_DIR}/../.."
"CLASSPATH=$CLASSPATH:$CLOVER_HOME/lib/clover*.jar")
endif()
+
+
+target_compile_definitions(zookeeper PRIVATE _CRT_SECURE_NO_WARNINGS _WINSOCK_DEPRECATED_NO_WARNINGS _CRT_NONSTDC_NO_DEPRECATE)
+target_compile_definitions(cli PRIVATE _CRT_SECURE_NO_WARNINGS)
+
+file(GLOB ZOOKEEPER_HEADERS include/*.h)
+
+install(FILES ${ZOOKEEPER_HEADERS} generated/zookeeper.jute.h DESTINATION include/zookeeper)
+
+install(TARGETS zookeeper hashtable
+ EXPORT zookeeperConfig
+ RUNTIME DESTINATION bin
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib
+)
+install(EXPORT zookeeperConfig
+ FILE zookeeperConfig.cmake
+ NAMESPACE zookeeper::
+ DESTINATION "${CMAKE_INSTALL_PREFIX}/share/zookeeper"
+)

View File

@@ -0,0 +1,38 @@
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_download_distfile(ARCHIVE
URLS "https://archive.apache.org/dist/zookeeper/zookeeper-3.5.6/apache-zookeeper-3.5.6.tar.gz"
FILENAME "zookeeper-3.5.6.tar.gz"
SHA512 7f45817cbbc42aec5a7817fa2ae99656128e666dc58ace23d86bcfc5ca0dc49e418d1a7d1f082ad80ccb916f9f1b490167d16f836886af1a56fbcf720ad3b9d0
)
vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
PATCHES
cmake.patch
win32.patch
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
sync WANT_SYNCAPI
)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}/zookeeper-client/zookeeper-client-c"
DISABLE_PARALLEL_CONFIGURE
OPTIONS
-DWANT_CPPUNIT=OFF
${FEATURE_OPTIONS}
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL "${SOURCE_PATH}/zookeeper-client/zookeeper-client-c/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
vcpkg_copy_pdbs()

25
externals/vcpkg/ports/zookeeper/vcpkg.json vendored Executable file
View File

@@ -0,0 +1,25 @@
{
"name": "zookeeper",
"version": "3.5.6",
"description": "ZooKeeper C bindings",
"homepage": "https://github.com/apache/zookeeper",
"license": "BSD-3-Clause",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"default-features": [
"sync"
],
"features": {
"sync": {
"description": "ZooKeeper with the sync API"
}
}
}

29
externals/vcpkg/ports/zookeeper/win32.patch vendored Executable file
View File

@@ -0,0 +1,29 @@
diff --git a/zookeeper-client/zookeeper-client-c/src/zk_log.c b/zookeeper-client/zookeeper-client-c/src/zk_log.c
index 436485e..1902b09 100644
--- a/zookeeper-client/zookeeper-client-c/src/zk_log.c
+++ b/zookeeper-client/zookeeper-client-c/src/zk_log.c
@@ -108,8 +108,11 @@ static const char* time_now(char* now_str){
gettimeofday(&tv,0);
now = tv.tv_sec;
+#ifdef WIN32
+ localtime_s(&lt, &now);
+#else
localtime_r(&now, &lt);
-
+#endif
// clone the format used by log4j ISO8601DateFormat
// specifically: "yyyy-MM-dd HH:mm:ss,SSS"
diff --git a/zookeeper-client/zookeeper-client-c/src/zookeeper.c b/zookeeper-client/zookeeper-client-c/src/zookeeper.c
index 25baa9c..96ed379 100644
--- a/zookeeper-client/zookeeper-client-c/src/zookeeper.c
+++ b/zookeeper-client/zookeeper-client-c/src/zookeeper.c
@@ -90,6 +90,7 @@
#define EAI_ADDRFAMILY WSAEINVAL /* is this still needed? */
#define EHOSTDOWN EPIPE
#define ESTALE ENODEV
+#define strtok_r strtok_s
#endif
#define IF_DEBUG(x) if(logLevel==ZOO_LOG_LEVEL_DEBUG) {x;}