Rewrote Frontend
This commit is contained in:
		
							
								
								
									
										13
									
								
								backend/vcpkg_reg/ports/drogon/drogon_config.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								backend/vcpkg_reg/ports/drogon/drogon_config.patch
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,13 @@
 | 
			
		||||
diff --git a/cmake/templates/DrogonConfig.cmake.in b/cmake/templates/DrogonConfig.cmake.in
 | 
			
		||||
index a21122a..6367259 100644
 | 
			
		||||
--- a/cmake/templates/DrogonConfig.cmake.in
 | 
			
		||||
+++ b/cmake/templates/DrogonConfig.cmake.in
 | 
			
		||||
@@ -19,7 +19,7 @@ find_dependency(UUID REQUIRED)
 | 
			
		||||
 endif(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" AND NOT WIN32)
 | 
			
		||||
 find_dependency(ZLIB REQUIRED)
 | 
			
		||||
 if(@pg_FOUND@)
 | 
			
		||||
-find_dependency(pg)
 | 
			
		||||
+find_dependency(PostgreSQL)
 | 
			
		||||
 endif()
 | 
			
		||||
 if(@SQLite3_FOUND@)
 | 
			
		||||
 find_dependency(SQLite3)
 | 
			
		||||
							
								
								
									
										61
									
								
								backend/vcpkg_reg/ports/drogon/portfile.cmake
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										61
									
								
								backend/vcpkg_reg/ports/drogon/portfile.cmake
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,61 @@
 | 
			
		||||
vcpkg_from_github(
 | 
			
		||||
    OUT_SOURCE_PATH SOURCE_PATH
 | 
			
		||||
    REPO an-tao/drogon
 | 
			
		||||
    REF v1.8.0
 | 
			
		||||
    SHA512 a834d937e3719059223d9bf19d777dbc92eaf09c5c9c44b5a742bfefcbcd95a146a6568cef8c058050fb87e330f221434ffe784dfa29a49de12b031f86ab1a33
 | 
			
		||||
    HEAD_REF master
 | 
			
		||||
    PATCHES
 | 
			
		||||
        vcpkg.patch
 | 
			
		||||
        drogon_config.patch
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
vcpkg_check_features(
 | 
			
		||||
    OUT_FEATURE_OPTIONS FEATURE_OPTIONS
 | 
			
		||||
    FEATURES
 | 
			
		||||
        ctl      BUILD_CTL
 | 
			
		||||
        mysql    BUILD_MYSQL
 | 
			
		||||
        orm      BUILD_ORM
 | 
			
		||||
        postgres BUILD_POSTGRESQL
 | 
			
		||||
        postgres LIBPQ_BATCH_MODE
 | 
			
		||||
        redis    BUILD_REDIS
 | 
			
		||||
        sqlite3  BUILD_SQLITE
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_DROGON_SHARED)
 | 
			
		||||
 | 
			
		||||
vcpkg_cmake_configure(
 | 
			
		||||
    SOURCE_PATH "${SOURCE_PATH}"
 | 
			
		||||
    DISABLE_PARALLEL_CONFIGURE
 | 
			
		||||
    OPTIONS
 | 
			
		||||
        -DBUILD_SHARED_LIBS=${BUILD_DROGON_SHARED}
 | 
			
		||||
        -DBUILD_EXAMPLES=OFF
 | 
			
		||||
        -DCMAKE_DISABLE_FIND_PACKAGE_Boost=ON
 | 
			
		||||
        ${FEATURE_OPTIONS}
 | 
			
		||||
    MAYBE_UNUSED_VARIABLES
 | 
			
		||||
        CMAKE_DISABLE_FIND_PACKAGE_Boost
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
vcpkg_cmake_install(ADD_BIN_TO_PATH)
 | 
			
		||||
 | 
			
		||||
# Fix CMake files
 | 
			
		||||
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/Drogon)
 | 
			
		||||
 | 
			
		||||
vcpkg_fixup_pkgconfig()
 | 
			
		||||
 | 
			
		||||
# Copy drogon_ctl
 | 
			
		||||
if("ctl" IN_LIST FEATURES)
 | 
			
		||||
    vcpkg_copy_tools(TOOL_NAMES drogon_ctl AUTO_CLEAN)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
# 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()
 | 
			
		||||
 | 
			
		||||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
 | 
			
		||||
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
 | 
			
		||||
 | 
			
		||||
# Copy pdb files
 | 
			
		||||
vcpkg_copy_pdbs()
 | 
			
		||||
							
								
								
									
										4
									
								
								backend/vcpkg_reg/ports/drogon/usage
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								backend/vcpkg_reg/ports/drogon/usage
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,4 @@
 | 
			
		||||
The package drogon provides CMake targets:
 | 
			
		||||
 | 
			
		||||
    find_package(Drogon CONFIG REQUIRED)
 | 
			
		||||
    target_link_libraries(main PRIVATE Drogon::Drogon)
 | 
			
		||||
							
								
								
									
										92
									
								
								backend/vcpkg_reg/ports/drogon/vcpkg.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										92
									
								
								backend/vcpkg_reg/ports/drogon/vcpkg.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,92 @@
 | 
			
		||||
{
 | 
			
		||||
  "name": "drogon",
 | 
			
		||||
  "version-semver": "1.8.0",
 | 
			
		||||
  "description": "A C++14/17 based HTTP web application framework running on Linux/macOS/Unix/Windows",
 | 
			
		||||
  "homepage": "https://github.com/an-tao/drogon",
 | 
			
		||||
  "documentation": "https://drogon.docsforge.com/master/overview/",
 | 
			
		||||
  "license": "MIT",
 | 
			
		||||
  "dependencies": [
 | 
			
		||||
    "brotli",
 | 
			
		||||
    "jsoncpp",
 | 
			
		||||
    {
 | 
			
		||||
      "name": "libuuid",
 | 
			
		||||
      "platform": "!windows & !osx"
 | 
			
		||||
    },
 | 
			
		||||
    "trantor",
 | 
			
		||||
    {
 | 
			
		||||
      "name": "vcpkg-cmake",
 | 
			
		||||
      "host": true
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "name": "vcpkg-cmake-config",
 | 
			
		||||
      "host": true
 | 
			
		||||
    },
 | 
			
		||||
    "zlib"
 | 
			
		||||
  ],
 | 
			
		||||
  "features": {
 | 
			
		||||
    "ctl": {
 | 
			
		||||
      "description": "Build drogon_ctl tool."
 | 
			
		||||
    },
 | 
			
		||||
    "mysql": {
 | 
			
		||||
      "description": "Support reading and writing from/to MySQL databases.",
 | 
			
		||||
      "dependencies": [
 | 
			
		||||
        {
 | 
			
		||||
          "name": "drogon",
 | 
			
		||||
          "features": [
 | 
			
		||||
            "orm"
 | 
			
		||||
          ]
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          "name": "libmariadb",
 | 
			
		||||
          "features": [
 | 
			
		||||
            "iconv"
 | 
			
		||||
          ],
 | 
			
		||||
          "platform": "osx"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          "name": "libmariadb",
 | 
			
		||||
          "platform": "!osx"
 | 
			
		||||
        }
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
    "orm": {
 | 
			
		||||
      "description": "Build with object-relational mapping support."
 | 
			
		||||
    },
 | 
			
		||||
    "postgres": {
 | 
			
		||||
      "description": "Support reading and writing from/to Postgres databases.",
 | 
			
		||||
      "dependencies": [
 | 
			
		||||
        {
 | 
			
		||||
          "name": "drogon",
 | 
			
		||||
          "features": [
 | 
			
		||||
            "orm"
 | 
			
		||||
          ]
 | 
			
		||||
        },
 | 
			
		||||
        "libpq"
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
    "redis": {
 | 
			
		||||
      "description": "Support reading and writing from/to Redis databases.",
 | 
			
		||||
      "dependencies": [
 | 
			
		||||
        {
 | 
			
		||||
          "name": "drogon",
 | 
			
		||||
          "features": [
 | 
			
		||||
            "orm"
 | 
			
		||||
          ]
 | 
			
		||||
        },
 | 
			
		||||
        "hiredis"
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
    "sqlite3": {
 | 
			
		||||
      "description": "Support reading and writing from/to SQLite databases.",
 | 
			
		||||
      "dependencies": [
 | 
			
		||||
        {
 | 
			
		||||
          "name": "drogon",
 | 
			
		||||
          "features": [
 | 
			
		||||
            "orm"
 | 
			
		||||
          ]
 | 
			
		||||
        },
 | 
			
		||||
        "sqlite3"
 | 
			
		||||
      ]
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										53
									
								
								backend/vcpkg_reg/ports/drogon/vcpkg.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								backend/vcpkg_reg/ports/drogon/vcpkg.patch
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,53 @@
 | 
			
		||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
 | 
			
		||||
--- a/CMakeLists.txt
 | 
			
		||||
+++ b/CMakeLists.txt
 | 
			
		||||
@@ -120,9 +120,9 @@ if (WIN32)
 | 
			
		||||
         PRIVATE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/third_party/mman-win32>)
 | 
			
		||||
 endif (WIN32)
 | 
			
		||||
 
 | 
			
		||||
-add_subdirectory(trantor)
 | 
			
		||||
+find_package(Trantor CONFIG REQUIRED)
 | 
			
		||||
 
 | 
			
		||||
-target_link_libraries(${PROJECT_NAME} PUBLIC trantor)
 | 
			
		||||
+target_link_libraries(${PROJECT_NAME} PUBLIC Trantor::Trantor)
 | 
			
		||||
 
 | 
			
		||||
 if(${CMAKE_SYSTEM_NAME} STREQUAL "Haiku")
 | 
			
		||||
     target_link_libraries(${PROJECT_NAME} PRIVATE network)
 | 
			
		||||
@@ -316,11 +316,10 @@ endif (NOT WIN32)
 | 
			
		||||
 
 | 
			
		||||
 if (BUILD_POSTGRESQL)
 | 
			
		||||
     # find postgres
 | 
			
		||||
-    find_package(pg)
 | 
			
		||||
-    if (pg_FOUND)
 | 
			
		||||
-        message(STATUS "libpq inc path:" ${PG_INCLUDE_DIRS})
 | 
			
		||||
-        message(STATUS "libpq lib:" ${PG_LIBRARIES})
 | 
			
		||||
-        target_link_libraries(${PROJECT_NAME} PRIVATE pg_lib)
 | 
			
		||||
+    find_package(PostgreSQL REQUIRED)
 | 
			
		||||
+    if(PostgreSQL_FOUND)
 | 
			
		||||
+      set(pg_FOUND true)
 | 
			
		||||
+      target_link_libraries(${PROJECT_NAME} PRIVATE PostgreSQL::PostgreSQL)
 | 
			
		||||
         set(DROGON_SOURCES
 | 
			
		||||
             ${DROGON_SOURCES}
 | 
			
		||||
             orm_lib/src/postgresql_impl/PostgreSQLResultImpl.cc)
 | 
			
		||||
@@ -348,7 +348,7 @@ if (BUILD_POSTGRESQL)
 | 
			
		||||
                 ${private_headers}
 | 
			
		||||
                 orm_lib/src/postgresql_impl/PgConnection.h)
 | 
			
		||||
         endif (libpq_supports_batch)
 | 
			
		||||
-    endif (pg_FOUND)
 | 
			
		||||
+    endif (PostgreSQL_FOUND)
 | 
			
		||||
 endif (BUILD_POSTGRESQL)
 | 
			
		||||
 
 | 
			
		||||
 if (BUILD_MYSQL)
 | 
			
		||||
diff --git a/drogon_ctl/CMakeLists.txt b/drogon_ctl/CMakeLists.txt
 | 
			
		||||
index 9f2f1e7..09871f8 100755
 | 
			
		||||
--- a/drogon_ctl/CMakeLists.txt
 | 
			
		||||
+++ b/drogon_ctl/CMakeLists.txt
 | 
			
		||||
@@ -19,7 +19,7 @@ add_executable(_drogon_ctl
 | 
			
		||||
 target_link_libraries(_drogon_ctl ${PROJECT_NAME})
 | 
			
		||||
 if (WIN32 AND BUILD_SHARED_LIBS)
 | 
			
		||||
   set(DROGON_FILE $<TARGET_FILE:drogon>)
 | 
			
		||||
-  set(TRANTOR_FILE $<TARGET_FILE:trantor>)
 | 
			
		||||
+  set(TRANTOR_FILE $<TARGET_FILE:Trantor::Trantor>)
 | 
			
		||||
   add_custom_command(TARGET _drogon_ctl POST_BUILD
 | 
			
		||||
           COMMAND ${CMAKE_COMMAND}
 | 
			
		||||
           -DCTL_FILE=${DROGON_FILE}
 | 
			
		||||
							
								
								
									
										8
									
								
								backend/vcpkg_reg/versions/baseline.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								backend/vcpkg_reg/versions/baseline.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,8 @@
 | 
			
		||||
{
 | 
			
		||||
  "default": {
 | 
			
		||||
    "drogon": {
 | 
			
		||||
      "baseline": "1.8.0",
 | 
			
		||||
      "port-version": 0
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										9
									
								
								backend/vcpkg_reg/versions/d-/drogon.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								backend/vcpkg_reg/versions/d-/drogon.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,9 @@
 | 
			
		||||
{
 | 
			
		||||
  "versions": [
 | 
			
		||||
    {
 | 
			
		||||
      "version-semver": "1.8.0",
 | 
			
		||||
      "port-version": 0,
 | 
			
		||||
      "path": "$/ports/drogon"
 | 
			
		||||
    }
 | 
			
		||||
  ]
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user