aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2016-12-07 21:30:06 -0800
committerGitHub <noreply@github.com>2016-12-07 21:30:06 -0800
commitf2a8323be23fee1b64edd6c33a7b8731b6fe26bc (patch)
tree899cdb5dbd9e27bba65a04b556637d9c18f3c159
parenta73feb7c99c62bc97a53e8497c41f1854e524108 (diff)
parent7a061e8d90818b9058ff9b31376445c9dac2cfd9 (diff)
downloadvcpkg-f2a8323be23fee1b64edd6c33a7b8731b6fe26bc.tar.gz
vcpkg-f2a8323be23fee1b64edd6c33a7b8731b6fe26bc.zip
Merge pull request #393 from cguebert/uWS
Add uWebSockets.
-rw-r--r--ports/uwebsockets/0001_cmake.patch40
-rw-r--r--ports/uwebsockets/CONTROL4
-rw-r--r--ports/uwebsockets/portfile.cmake26
3 files changed, 70 insertions, 0 deletions
diff --git a/ports/uwebsockets/0001_cmake.patch b/ports/uwebsockets/0001_cmake.patch
new file mode 100644
index 000000000..f4004a5bb
--- /dev/null
+++ b/ports/uwebsockets/0001_cmake.patch
@@ -0,0 +1,40 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 1fadf72..6ee984d 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -18,7 +18,11 @@ if(NOT LIBUV_INCLUDE_DIR)
+ find_path(LIBUV_INCLUDE_DIR uv.h)
+ endif()
+ if(NOT LIBUV_LIBRARY)
+- find_library(LIBUV_LIBRARY NAMES uv uv1)
++ if(WIN32)
++ find_library(LIBUV_LIBRARY NAMES libuv)
++ else()
++ find_library(LIBUV_LIBRARY NAMES uv uv1)
++ endif()
+ endif()
+
+ add_library(uWS src/Extensions.cpp src/Group.cpp src/WebSocketImpl.cpp src/Networking.cpp src/Hub.cpp src/Node.cpp src/WebSocket.cpp src/HTTPSocket.cpp src/Socket.cpp)
+@@ -38,4 +42,20 @@ install (TARGETS uWS DESTINATION /usr/lib64)
+ install (FILES src/Extensions.h src/WebSocketProtocol.h src/Networking.h src/WebSocket.h src/Hub.h src/Group.h src/Node.h src/Socket.h src/HTTPSocket.h src/uWS.h DESTINATION /usr/include/uWS)
+ endif (UNIX)
+
+-add_subdirectory(examples)
++#add_subdirectory(examples)
++
++if(WIN32)
++ target_link_libraries (uWS PUBLIC psapi.lib iphlpapi.lib userenv.lib)
++ install (FILES src/Extensions.h src/WebSocketProtocol.h src/Networking.h src/WebSocket.h src/Hub.h src/Group.h src/Node.h src/Socket.h src/HTTPSocket.h src/uWS.h DESTINATION include/uWS)
++
++ if(BUILD_SHARED_LIBS)
++ target_link_libraries (uWS PUBLIC ws2_32.lib)
++ endif()
++endif()
++
++install(
++ TARGETS uWS
++ RUNTIME DESTINATION bin
++ LIBRARY DESTINATION lib
++ ARCHIVE DESTINATION lib
++)
+\ No newline at end of file \ No newline at end of file
diff --git a/ports/uwebsockets/CONTROL b/ports/uwebsockets/CONTROL
new file mode 100644
index 000000000..840990004
--- /dev/null
+++ b/ports/uwebsockets/CONTROL
@@ -0,0 +1,4 @@
+Source: uwebsockets
+Version: 0.12.0
+Build-Depends: libuv, openssl, zlib
+Description: Highly scalable cross-platform WebSocket & HTTP library for C++11 and Node.js \ No newline at end of file
diff --git a/ports/uwebsockets/portfile.cmake b/ports/uwebsockets/portfile.cmake
new file mode 100644
index 000000000..881f35086
--- /dev/null
+++ b/ports/uwebsockets/portfile.cmake
@@ -0,0 +1,26 @@
+include(vcpkg_common_functions)
+set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/uwebsockets-0.12.0)
+vcpkg_download_distfile(ARCHIVE
+ URLS "https://github.com/uWebSockets/uWebSockets/archive/v0.12.0.zip"
+ FILENAME "uwebsockets-v0.12.0.zip"
+ SHA512 ea10682608d5f6c8b246f186dfc2f14f496858cc7e468880b96b111f10058daf529f1aa9662a851e21494dde9a4faadf2b9904483dac5350d0ca8736500cdda8
+)
+vcpkg_extract_source_archive(${ARCHIVE})
+
+vcpkg_apply_patches(
+ SOURCE_PATH ${SOURCE_PATH}
+ PATCHES
+ ${CMAKE_CURRENT_LIST_DIR}/0001_cmake.patch
+)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+)
+
+vcpkg_install_cmake()
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+
+file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/uwebsockets)
+file(RENAME ${CURRENT_PACKAGES_DIR}/share/uwebsockets/LICENSE ${CURRENT_PACKAGES_DIR}/share/uwebsockets/copyright)
+vcpkg_copy_pdbs()