aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJackBoosY <47264268+JackBoosY@users.noreply.github.com>2019-09-12 05:24:37 +0800
committerVictor Romero <romerosanchezv@gmail.com>2019-09-11 14:24:37 -0700
commitfa66acbf5a536bb7303bb2831d95808a90059c68 (patch)
tree951280d0e564333a1b1d2aa80a209ba161615ce5
parent63f1f07efbc32160e43ae8490553c61a8b53abab (diff)
downloadvcpkg-fa66acbf5a536bb7303bb2831d95808a90059c68.tar.gz
vcpkg-fa66acbf5a536bb7303bb2831d95808a90059c68.zip
[evpp]Fix linux build. (#8050)
-rw-r--r--ports/evpp/CONTROL4
-rw-r--r--ports/evpp/fix-linux-build.patch112
-rw-r--r--ports/evpp/portfile.cmake39
3 files changed, 126 insertions, 29 deletions
diff --git a/ports/evpp/CONTROL b/ports/evpp/CONTROL
index 7c61e4ebd..b9ec8d278 100644
--- a/ports/evpp/CONTROL
+++ b/ports/evpp/CONTROL
@@ -1,5 +1,5 @@
Source: evpp
-Version: 0.7.0
+Version: 0.7.0-1
Homepage: https://github.com/Qihoo360/evpp
Description: A modern C++ network library based on libevent for developing high performance network services in TCP/UDP/HTTP protocols.
-Build-Depends: glog, libevent, rapidjson
+Build-Depends: glog, libevent, rapidjson, concurrentqueue (!windows), boost-lockfree (!windows)
diff --git a/ports/evpp/fix-linux-build.patch b/ports/evpp/fix-linux-build.patch
new file mode 100644
index 000000000..2b772a145
--- /dev/null
+++ b/ports/evpp/fix-linux-build.patch
@@ -0,0 +1,112 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 7872fc8..2a06614 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -47,7 +47,11 @@ string (REPLACE ";" " " CMAKE_CXX_FLAGS "${CXX_FLAGS}")
+ if (UNIX)
+ SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -ggdb -D_DEBUG -DGOOGLE_STRIP_LOG=0")
+ SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -g -ggdb -DNDEBUG -DGOOGLE_STRIP_LOG=1")
+- SET(DEPENDENT_LIBRARIES event glog pthread)
++ find_package(glog CONFIG REQUIRED)
++ find_path(GLOG_INCLUDE_DIRS logging.h PATH_SUFFIXES glog)
++ find_package(Libevent CONFIG REQUIRED)
++ list(APPEND DEPENDENT_INCLUDE_DIRS "${GLOG_INCLUDE_DIRS}/../")
++ SET(DEPENDENT_LIBRARIES event_static event_core_static event_extra_static event_openssl_static glog::glog pthread)
+ else (UNIX)
+ SET(DEPENDENT_LIBRARIES event glog)
+ endif (UNIX)
+diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt
+index 469ed1c..8219424 100644
+--- a/apps/CMakeLists.txt
++++ b/apps/CMakeLists.txt
+@@ -2,7 +2,7 @@
+ include_directories(${PROJECT_SOURCE_DIR}/apps ${PROJECT_SOURCE_DIR}/3rdparty)
+
+ if (UNIX)
+-set(LIBRARIES evpp_concurrentqueue event glog pthread)
++set(LIBRARIES evpp_concurrentqueue event_static event_core_static event_extra_static event_openssl_static glog::glog pthread)
+ link_directories("/home/s/safe/lib" ${PROJECT_BUILD_DIR}/lib)
+ else(UNIX)
+ set(LIBRARIES evpp_static event glog)
+diff --git a/benchmark/http/libevent/CMakeLists.txt b/benchmark/http/libevent/CMakeLists.txt
+index 1148616..0356b71 100644
+--- a/benchmark/http/libevent/CMakeLists.txt
++++ b/benchmark/http/libevent/CMakeLists.txt
+@@ -1,3 +1,3 @@
+
+ add_executable(benchmark_http_libevent libevent_http_bench.c)
+-target_link_libraries(benchmark_http_libevent event)
++target_link_libraries(benchmark_http_libevent event_static event_core_static event_extra_static event_openssl_static)
+diff --git a/benchmark/ioevent/libevent/CMakeLists.txt b/benchmark/ioevent/libevent/CMakeLists.txt
+index dfa51a3..de4849d 100644
+--- a/benchmark/ioevent/libevent/CMakeLists.txt
++++ b/benchmark/ioevent/libevent/CMakeLists.txt
+@@ -1,3 +1,3 @@
+
+ add_executable(benchmark_ioevent_libevent libevent_ioevent_bench.c)
+-target_link_libraries(benchmark_ioevent_libevent event)
++target_link_libraries(benchmark_ioevent_libevent event_static event_core_static event_extra_static event_openssl_static)
+diff --git a/benchmark/throughput/libevent/CMakeLists.txt b/benchmark/throughput/libevent/CMakeLists.txt
+index 21dab84..aefe698 100644
+--- a/benchmark/throughput/libevent/CMakeLists.txt
++++ b/benchmark/throughput/libevent/CMakeLists.txt
+@@ -1,5 +1,5 @@
+ add_executable(benchmark_tcp_libevent_client client.c)
+-target_link_libraries(benchmark_tcp_libevent_client event)
++target_link_libraries(benchmark_tcp_libevent_client event_static event_core_static event_extra_static event_openssl_static)
+
+ add_executable(benchmark_tcp_libevent_server server.c)
+-target_link_libraries(benchmark_tcp_libevent_server event)
++target_link_libraries(benchmark_tcp_libevent_server event_static event_core_static event_extra_static event_openssl_static)
+diff --git a/examples/recipes/self_control_timer/basic_01/CMakeLists.txt b/examples/recipes/self_control_timer/basic_01/CMakeLists.txt
+index 7834db4..82294c5 100644
+--- a/examples/recipes/self_control_timer/basic_01/CMakeLists.txt
++++ b/examples/recipes/self_control_timer/basic_01/CMakeLists.txt
+@@ -1,7 +1,7 @@
+ file(GLOB SRCS *.cc *.h)
+
+ add_executable(example_recipes_self_control_timer_basic_01 ${SRCS})
+-target_link_libraries(example_recipes_self_control_timer_basic_01 event)
++target_link_libraries(example_recipes_self_control_timer_basic_01 event_static event_core_static event_extra_static event_openssl_static)
+
+
+
+diff --git a/examples/recipes/self_control_timer/basic_02/CMakeLists.txt b/examples/recipes/self_control_timer/basic_02/CMakeLists.txt
+index a8be419..0329ccc 100644
+--- a/examples/recipes/self_control_timer/basic_02/CMakeLists.txt
++++ b/examples/recipes/self_control_timer/basic_02/CMakeLists.txt
+@@ -1,7 +1,7 @@
+ file(GLOB SRCS *.cc *.h)
+
+ add_executable(example_recipes_self_control_timer_basic_02 ${SRCS})
+-target_link_libraries(example_recipes_self_control_timer_basic_02 event)
++target_link_libraries(example_recipes_self_control_timer_basic_02 event_static event_core_static event_extra_static event_openssl_static)
+
+
+
+diff --git a/examples/recipes/self_control_timer/cancel_03/CMakeLists.txt b/examples/recipes/self_control_timer/cancel_03/CMakeLists.txt
+index 1cae9bb..218b771 100644
+--- a/examples/recipes/self_control_timer/cancel_03/CMakeLists.txt
++++ b/examples/recipes/self_control_timer/cancel_03/CMakeLists.txt
+@@ -1,7 +1,7 @@
+ file(GLOB SRCS *.cc *.h)
+
+ add_executable(example_recipes_self_control_timer_cancel_03 ${SRCS})
+-target_link_libraries(example_recipes_self_control_timer_cancel_03 event)
++target_link_libraries(example_recipes_self_control_timer_cancel_03 event_static event_core_static event_extra_static event_openssl_static)
+
+
+
+diff --git a/examples/recipes/self_control_timer/periodic_04/CMakeLists.txt b/examples/recipes/self_control_timer/periodic_04/CMakeLists.txt
+index 749c584..e7c658e 100644
+--- a/examples/recipes/self_control_timer/periodic_04/CMakeLists.txt
++++ b/examples/recipes/self_control_timer/periodic_04/CMakeLists.txt
+@@ -1,7 +1,7 @@
+ file(GLOB SRCS *.cc *.h)
+
+ add_executable(example_recipes_self_control_timer_periodic_04 ${SRCS})
+-target_link_libraries(example_recipes_self_control_timer_periodic_04 event)
++target_link_libraries(example_recipes_self_control_timer_periodic_04 event_static event_core_static event_extra_static event_openssl_static)
+
+
+
diff --git a/ports/evpp/portfile.cmake b/ports/evpp/portfile.cmake
index b20642bdd..b5db0744c 100644
--- a/ports/evpp/portfile.cmake
+++ b/ports/evpp/portfile.cmake
@@ -1,32 +1,18 @@
include(vcpkg_common_functions)
-set(EVPP_LOCAL_TEST OFF)
-
set(EVPP_VERSION 0.7.0)
-if (EVPP_LOCAL_TEST)
- set(EVPP_HASH bfefb3f7c1f620fbca2c3d94e2e7c39aa963156a084caf39bcc348a9380f97c73c9ee965126434d71c8b14836e669d554ed98632b3bb38eb65b421fd8eff49b2)
- set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/evpp)
- vcpkg_download_distfile(ARCHIVE
- URLS "http://127.0.0.1:8000/evpp.zip"
- FILENAME "evpp-${EVPP_VERSION}.zip"
- SHA512 ${EVPP_HASH}
- )
- vcpkg_extract_source_archive(${ARCHIVE})
-else ()
- vcpkg_from_github(
- OUT_SOURCE_PATH SOURCE_PATH
- REPO Qihoo360/evpp
- REF v${EVPP_VERSION}
- SHA512 ddcef8d2af6b3c46473d755c0f0994d63d56240ea85d6b44ceb6b77724c3c56bbf1156f7188e270fb5f9f36f25bfc2f96669d7249a34c921922671e3fe267e88
- HEAD_REF master
- )
- file(REMOVE_RECURSE ${SOURCE_PATH}/3rdparty/rapidjson ${SOURCE_PATH}/3rdparty/concurrentqueue)
- vcpkg_apply_patches(
- SOURCE_PATH ${SOURCE_PATH}
- PATCHES ${CMAKE_CURRENT_LIST_DIR}/fix-rapidjson-1-1.patch
- )
-endif ()
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO Qihoo360/evpp
+ REF v${EVPP_VERSION}
+ SHA512 ddcef8d2af6b3c46473d755c0f0994d63d56240ea85d6b44ceb6b77724c3c56bbf1156f7188e270fb5f9f36f25bfc2f96669d7249a34c921922671e3fe267e88
+ HEAD_REF master
+ PATCHES
+ fix-rapidjson-1-1.patch
+ fix-linux-build.patch
+)
+file(REMOVE_RECURSE ${SOURCE_PATH}/3rdparty/rapidjson ${SOURCE_PATH}/3rdparty/concurrentqueue)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
@@ -40,6 +26,5 @@ vcpkg_install_cmake()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
# Handle copyright
-file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/evpp)
-file(RENAME ${CURRENT_PACKAGES_DIR}/share/evpp/LICENSE ${CURRENT_PACKAGES_DIR}/share/evpp/copyright)
+file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)