Skip to content

Commit

Permalink
[drogon] Update to 1.0.0.beta20 (#12931)
Browse files Browse the repository at this point in the history
Co-authored-by: Lily <[email protected]>
  • Loading branch information
an-tao and LilyWangL authored Aug 18, 2020
1 parent f8c167c commit 356e6b8
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 34 deletions.
2 changes: 1 addition & 1 deletion ports/drogon/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: drogon
Version: v1.0.0-beta18
Version: v1.0.0-beta20
Homepage: https:/an-tao/drogon
Description:Drogon: A C++14/17 based HTTP web application framework running on Linux/macOS/Unix/Windows
Build-Depends: trantor, zlib, jsoncpp, libmariadb, libpq, sqlite3, brotli
27 changes: 27 additions & 0 deletions ports/drogon/pg.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
diff --git a/cmake_modules/Findpg.cmake b/cmake_modules/Findpg.cmake
index 53037f2..d13f384 100644
--- a/cmake_modules/Findpg.cmake
+++ b/cmake_modules/Findpg.cmake
@@ -4,20 +4,14 @@
#
# This module defines PG_INCLUDE_DIRS, where to find header, etc. PG_LIBRARIES,
# the libraries needed to use PostgreSQL. pg_FOUND, If false, do not try to use
-# PostgreSQL.
-# pg_lib - The imported target library.
+# PostgreSQL. pg_lib - The imported target library.

find_package(PostgreSQL)
if(PostgreSQL_FOUND)
set(PG_LIBRARIES ${PostgreSQL_LIBRARIES})
set(PG_INCLUDE_DIRS ${PostgreSQL_INCLUDE_DIRS})
- message(STATUS "pg inc: " ${PostgreSQL_INCLUDE_DIRS})
add_library(pg_lib INTERFACE IMPORTED)
- set_target_properties(pg_lib
- PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
- "${PostgreSQL_INCLUDE_DIRS}"
- INTERFACE_LINK_LIBRARIES
- "${PostgreSQL_LIBRARIES}")
+ target_link_libraries(pg_lib INTERFACE PostgreSQL::PostgreSQL)
mark_as_advanced(PG_INCLUDE_DIRS PG_LIBRARIES)
endif(PostgreSQL_FOUND)
include(FindPackageHandleStandardArgs)
70 changes: 37 additions & 33 deletions ports/drogon/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,33 +1,37 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO an-tao/drogon
REF v1.0.0-beta18
SHA512 38d57e6b5cc43bd1ac07c980453dda1f4c23a8c78eca942dd531d20661d7f088fc0a3d0f4e7cedddf98bac5a32be0330911cbf839d4956e05ee0265a68c7faa6
HEAD_REF master
PATCHES
vcpkg.patch
drogon_ctl_install.patch
)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DBUILD_EXAMPLES=OFF
)

vcpkg_install_cmake()

# Fix CMake files
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/drogon)

# # Remove includes in debug
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)

# Copy pdb files
vcpkg_copy_pdbs()

vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/drogon)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO an-tao/drogon
REF v1.0.0-beta20
SHA512 10da2765df24848964358ea3f6a8843664d142bfd1d276649438c5d79ad88f98467ac742d3ff23e9fda93b89ab9568b2ecea8c3ee4d527d0b6b4a5892025e24e
HEAD_REF master
PATCHES
vcpkg.patch
drogon_ctl_install.patch
pg.patch
)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DBUILD_EXAMPLES=OFF
)

vcpkg_install_cmake()

# Fix CMake files
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT})

# # Remove includes in debug
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()
# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)

# Copy pdb files
vcpkg_copy_pdbs()

vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/drogon)

0 comments on commit 356e6b8

Please sign in to comment.