aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/wampcc
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/wampcc')
-rw-r--r--vcpkg/ports/wampcc/add-include-chrono.patch12
-rw-r--r--vcpkg/ports/wampcc/fix-dependencies.patch45
-rw-r--r--vcpkg/ports/wampcc/portfile.cmake42
-rw-r--r--vcpkg/ports/wampcc/vcpkg.json29
4 files changed, 128 insertions, 0 deletions
diff --git a/vcpkg/ports/wampcc/add-include-chrono.patch b/vcpkg/ports/wampcc/add-include-chrono.patch
new file mode 100644
index 0000000..759883e
--- /dev/null
+++ b/vcpkg/ports/wampcc/add-include-chrono.patch
@@ -0,0 +1,12 @@
+diff --git a/include/wampcc/protocol.h b/include/wampcc/protocol.h
+index e863768..3c86033 100644
+--- a/include/wampcc/protocol.h
++++ b/include/wampcc/protocol.h
+@@ -11,6 +11,7 @@
+ #include "wampcc/types.h"
+
+ #include <vector>
++#include <chrono>
+ #include <cstddef>
+ #include <memory>
+ #include <stdexcept>
diff --git a/vcpkg/ports/wampcc/fix-dependencies.patch b/vcpkg/ports/wampcc/fix-dependencies.patch
new file mode 100644
index 0000000..16e0bf3
--- /dev/null
+++ b/vcpkg/ports/wampcc/fix-dependencies.patch
@@ -0,0 +1,45 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index ca5a738..5e65bcf 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -95,9 +95,7 @@ set(HAVE_JANSSON ON)
+ ## Find Threads on Linux systems, for compiling EXAMPLES or UTILS
+ ##
+
+-if(CMAKE_HOST_UNIX)
+- find_package(Threads REQUIRED)
+-endif()
++find_package(Threads REQUIRED)
+
+ message(STATUS "OpenSSL_INCLUDE_DIR: " ${OPENSSL_INCLUDE_DIR})
+ message(STATUS "OpenSSL_LIBRARIES: " ${OPENSSL_LIBRARIES})
+diff --git a/cmake/wampccConfig.cmake.in b/cmake/wampccConfig.cmake.in
+index 8c4bed5..7ef2483 100644
+--- a/cmake/wampccConfig.cmake.in
++++ b/cmake/wampccConfig.cmake.in
+@@ -13,9 +13,7 @@ list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_LIST_DIR}/find_modules")
+ find_dependency(OpenSSL REQUIRED)
+ find_dependency(LibUV REQUIRED)
+ find_dependency(Jansson REQUIRED)
+-if(CMAKE_HOST_UNIX)
+- find_dependency(Threads REQUIRED)
+-endif()
++find_dependency(Threads REQUIRED)
+
+ # Restore old path
+ set(CMAKE_MODULE_PATH "${wampcc_original_module_path}")
+diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
+index ee2bb06..0284808 100644
+--- a/examples/CMakeLists.txt
++++ b/examples/CMakeLists.txt
+@@ -14,10 +14,6 @@ endif()
+ macro(Compile_Example example source_path)
+ add_executable(${example} "${PROJECT_SOURCE_DIR}/examples/${source_path}/${example}.cc")
+ target_link_libraries (${example} PRIVATE ${EXTRA_LIBS})
+-
+- if (WIN32)
+- set_target_properties(${example} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libcmtd.lib")
+- endif()
+ endmacro()
+
+
diff --git a/vcpkg/ports/wampcc/portfile.cmake b/vcpkg/ports/wampcc/portfile.cmake
new file mode 100644
index 0000000..5ef3721
--- /dev/null
+++ b/vcpkg/ports/wampcc/portfile.cmake
@@ -0,0 +1,42 @@
+if (VCPKG_TARGET_IS_WINDOWS)
+ message("Shared build is broken under Windows. See https://github.com/darrenjs/wampcc/issues/57")
+ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+endif()
+
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO darrenjs/wampcc
+ REF 2963fd47b6775122aa45f83ed50a58ce2444ec64
+ SHA512 19883f1dffb1967e6da9f613bb1aff93693e66c2617e8ff53eabe7965a2a9ac83d6da67e1629666cbc8f349eba0466f54edd22fc3c0fe0b4bf7e6a6f33c9e25b
+ HEAD_REF master
+ PATCHES
+ add-include-chrono.patch #https://github.com/darrenjs/wampcc/pull/85
+ fix-dependencies.patch
+)
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ examples BUILD_EXAMPLES
+ utils BUILD_UTILS
+)
+
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DBUILD_TESTS:BOOL=OFF # Tests build is broken
+ ${FEATURE_OPTIONS}
+)
+vcpkg_cmake_install()
+
+if("utils" IN_LIST FEATURES)
+ vcpkg_copy_tools(TOOL_NAMES admin AUTO_CLEAN)
+endif()
+
+vcpkg_fixup_pkgconfig()
+vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/wampcc")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
diff --git a/vcpkg/ports/wampcc/vcpkg.json b/vcpkg/ports/wampcc/vcpkg.json
new file mode 100644
index 0000000..dd6eac5
--- /dev/null
+++ b/vcpkg/ports/wampcc/vcpkg.json
@@ -0,0 +1,29 @@
+{
+ "name": "wampcc",
+ "version-date": "2024-07-10",
+ "description": "Wampcc is C++ library that implements the Web Application Messaging Protocol (WAMP) protocol.",
+ "license": "MIT",
+ "supports": "!(windows & arm64)",
+ "dependencies": [
+ "jansson",
+ "libuv",
+ "openssl",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "features": {
+ "examples": {
+ "description": "Build example apps"
+ },
+ "utils": {
+ "description": "Build utility apps",
+ "supports": "!windows"
+ }
+ }
+}