[new port] wangle init (#4133)

* wangle init

* [wangle] Simplification

* [wangle] Fix finding gflags
This commit is contained in:
atkawa7 2018-08-24 22:43:41 +02:00 committed by Robert Schumacher
parent 9a35830ff3
commit c2f4953990
4 changed files with 124 additions and 0 deletions

4
ports/wangle/CONTROL Normal file
View File

@ -0,0 +1,4 @@
Source: wangle
Version: v2018.07.30.00-1
Build-Depends: folly, openssl, gtest, glog, libevent, double-conversion
Description: Wangle is a framework providing a set of common client/server abstractions for building services in a consistent, modular, and composable way.

54
ports/wangle/build.patch Normal file
View File

@ -0,0 +1,54 @@
diff --git a/wangle/CMakeLists.txt b/wangle/CMakeLists.txt
index 0302249..3bf1e6c 100644
--- a/wangle/CMakeLists.txt
+++ b/wangle/CMakeLists.txt
@@ -38,9 +38,9 @@ endif()
find_package(Boost REQUIRED COMPONENTS system thread filesystem regex context)
find_package(OpenSSL REQUIRED)
-find_package(Glog REQUIRED)
-find_package(Gflags REQUIRED)
-find_package(Libevent REQUIRED)
+find_package(Glog CONFIG REQUIRED)
+find_package(Gflags CONFIG REQUIRED)
+find_package(Libevent CONFIG REQUIRED)
find_package(DoubleConversion REQUIRED)
find_package(Threads REQUIRED)
if (UNIX AND NOT APPLE)
@@ -116,11 +116,9 @@ if (BUILD_SHARED_LIBS)
PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION 1)
endif()
-target_include_directories(
- wangle
- PUBLIC
- $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/..>
- $<INSTALL_INTERFACE:${INCLUDE_INSTALL_DIR}>
+include_directories(
+ "${CMAKE_SOURCE_DIR}/.."
+ ${INCLUDE_INSTALL_DIR}
${FOLLY_INCLUDE_DIR}
${Boost_INCLUDE_DIR}
${OPENSSL_INCLUDE_DIR}
@@ -143,15 +141,19 @@ target_link_libraries(wangle PUBLIC
install(
TARGETS wangle
EXPORT wangle-exports
- DESTINATION ${LIB_INSTALL_DIR}
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
)
# We unfortunately cannot install wangle's headers with the install()
# statement above. install(TARGETS) appears to only support installing
# PUBLIC_HEADER in a flat include directory, and not a deeper tree.
+if(NOT DISABLE_INSTALL_HEADERS)
foreach(dir ${WANGLE_HEADER_DIRS})
- install(DIRECTORY ${dir} DESTINATION "${INCLUDE_INSTALL_DIR}/wangle"
+ install(DIRECTORY ${dir} DESTINATION "include/wangle"
FILES_MATCHING PATTERN "*.h")
endforeach()
+endif()
# Install CMake package configuration files for wangle
include(CMakePackageConfigHelpers)

31
ports/wangle/gflags.patch Normal file
View File

@ -0,0 +1,31 @@
diff --git a/wangle/cmake/FindGflags.cmake b/wangle/cmake/FindGflags.cmake
index 0243aa3..be3780f 100644
--- a/wangle/cmake/FindGflags.cmake
+++ b/wangle/cmake/FindGflags.cmake
@@ -7,19 +7,11 @@
include(FindPackageHandleStandardArgs)
-find_library(GFLAGS_LIBRARY gflags
- PATHS ${GFLAGS_LIBRARYDIR})
+find_package(gflags CONFIG REQUIRED)
-find_path(GFLAGS_INCLUDE_DIR gflags/gflags.h
- PATHS ${GFLAGS_INCLUDEDIR})
-
-find_package_handle_standard_args(gflags DEFAULT_MSG
- GFLAGS_LIBRARY
- GFLAGS_INCLUDE_DIR)
-
-mark_as_advanced(
- GFLAGS_LIBRARY
- GFLAGS_INCLUDE_DIR)
-
-set(GFLAGS_LIBRARIES ${GFLAGS_LIBRARY})
-set(GFLAGS_INCLUDE_DIRS ${GFLAGS_INCLUDE_DIR})
+if(TARGET gflags_static)
+ set(GFLAGS_LIBRARIES gflags_static)
+else()
+ set(GFLAGS_LIBRARIES gflags_shared)
+endif()
+set(GFLAGS_INCLUDE_DIRS)

View File

@ -0,0 +1,35 @@
include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO facebook/wangle
REF v2018.07.30.00
SHA512 f83378a8751b47fac2c862e07ffeb2750fd681735e66d778657d7624fe3e839b2e2bfcb049ecd3a3516c206d93f9c168144599ded823720967e44037b536ba5d
HEAD_REF master
PATCHES
build.patch
gflags.patch
)
vcpkg_configure_cmake(
SOURCE_PATH "${SOURCE_PATH}/wangle"
PREFER_NINJA
OPTIONS
-DBUILD_TESTS=OFF
OPTIONS_DEBUG
-DDISABLE_INSTALL_HEADERS=ON
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/wangle")
vcpkg_copy_pdbs()
file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/include/wangle/util/test
${CURRENT_PACKAGES_DIR}/include/wangle/ssl/test/certs
${CURRENT_PACKAGES_DIR}/include/wangle/service/test
${CURRENT_PACKAGES_DIR}/include/wangle/deprecated/rx/test
)
# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/wangle RENAME copyright)