update drogon (#416)

* update drogon

* fix drogon

* fix again

* update leveldb and snappy

* fix snappy
pull/417/head
Hoildkv 4 years ago committed by GitHub
parent ccfda9db01
commit 68185a64ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      packages/d/drogon/patches/1.4.1/resolv.patch
  2. 28
      packages/d/drogon/patches/1.6.0/resolv.patch
  3. 16
      packages/d/drogon/patches/1.6.0/trantor.patch
  4. 6
      packages/d/drogon/xmake.lua
  5. 1
      packages/l/leveldb/xmake.lua
  6. 13
      packages/s/snappy/patches/1.1.9/inline.patch
  7. 7
      packages/s/snappy/xmake.lua
  8. 1
      packages/t/trantor/xmake.lua

@ -11,3 +11,17 @@ diff --git a/drogon_ctl/CMakeLists.txt b/drogon_ctl/CMakeLists.txt
message(STATUS "bin:" ${INSTALL_BIN_DIR})
install(TARGETS drogon_ctl RUNTIME DESTINATION ${INSTALL_BIN_DIR})
if(WIN32)
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -58,6 +58,9 @@
else(BUILD_DROGON_SHARED)
add_library(${PROJECT_NAME} STATIC)
endif(BUILD_DROGON_SHARED)
+if(APPLE)
+ target_link_libraries(${PROJECT_NAME} PUBLIC resolv)
+endif()
include(cmake/DrogonUtilities.cmake)
include(CheckIncludeFileCXX)

@ -0,0 +1,28 @@
diff --git a/drogon_ctl/CMakeLists.txt b/drogon_ctl/CMakeLists.txt
--- a/drogon_ctl/CMakeLists.txt
+++ b/drogon_ctl/CMakeLists.txt
@@ -55,6 +55,9 @@
if(WIN32)
target_link_libraries(drogon_ctl PRIVATE ws2_32 Rpcrt4)
endif(WIN32)
+if(APPLE)
+ target_link_libraries(drogon_ctl PRIVATE resolv)
+endif()
message(STATUS "bin:" ${INSTALL_BIN_DIR})
install(TARGETS drogon_ctl RUNTIME DESTINATION ${INSTALL_BIN_DIR})
if(WIN32)
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -68,7 +68,10 @@
else (BUILD_DROGON_SHARED)
add_library(${PROJECT_NAME} STATIC)
endif (BUILD_DROGON_SHARED)
+if (APPLE)
+ target_link_libraries(${PROJECT_NAME} PUBLIC resolv)
+endif (APPLE)
if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Werror)
endif()

@ -0,0 +1,16 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1efecf8..198f429 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -106,9 +106,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 (NOT WIN32)
if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")

@ -7,9 +7,12 @@ package("drogon")
add_urls("https://github.com/an-tao/drogon/archive/refs/tags/$(version).tar.gz",
"https://github.com/an-tao/drogon.git")
add_versions("v1.4.1", "ad794d7744b600240178348c15e216c919fe7a2bc196cf1239f129aee2af19c7")
add_versions("v1.6.0", "9f8802b579aac29e9eddfb156e432276727a3d3c49fffdf453a2ddcd1cb69093")
add_patches("1.4.1", path.join(os.scriptdir(), "patches", "1.4.1", "trantor.patch"), "7f9034a27bb63de8dedb80dd9f246ea7aa7724c87f2c0d0054f4b6097ea2a862")
add_patches("1.4.1", path.join(os.scriptdir(), "patches", "1.4.1", "resolv.patch"), "84bff60e9ad632f585fadc2384eccb193aec95ccc14ec9c18196cd40a527538c")
add_patches("1.4.1", path.join(os.scriptdir(), "patches", "1.4.1", "resolv.patch"), "a1054822bf91f5f06de8bca9b1bd8859233228159a8ff8014ce6329d6c000f26")
add_patches("1.6.0", path.join(os.scriptdir(), "patches", "1.6.0", "trantor.patch"), "87e317bf5e45b3f3dfe781db8a0af9603ebdab057a6aedbc36d8aec9e0da58a7")
add_patches("1.6.0", path.join(os.scriptdir(), "patches", "1.6.0", "resolv.patch"), "dc144ff1cdcfee413efbcdc568fed587318289e8fa1bb0da9d2ea94a15588b25")
add_deps("cmake")
add_deps("trantor", "jsoncpp", "brotli", "zlib")
@ -26,7 +29,6 @@ package("drogon")
on_install("windows|x64", "macosx", "linux", function (package)
io.replace("cmake/templates/config.h.in", "\"@COMPILATION_FLAGS@@DROGON_CXX_STANDARD@\"", "R\"(@COMPILATION_FLAGS@@DROGON_CXX_STANDARD@)\"", {plain = true})
io.replace("CMakeLists.txt", "else(BUILD_DROGON_SHARED)\n", "if(APPLE)\ntarget_link_libraries(${PROJECT_NAME} PUBLIC resolv)\nendif(APPLE)\nelse(BUILD_DROGON_SHARED)\n", {plain = true})
local configs = {"-DBUILD_EXAMPLES=OFF"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))

@ -6,6 +6,7 @@ package("leveldb")
add_urls("https://github.com/google/leveldb/archive/$(version).tar.gz",
"https://github.com/google/leveldb.git")
add_versions("1.22", "55423cac9e3306f4a9502c738a001e4a339d1a38ffbee7572d4a07d5d63949b2")
add_versions("1.23", "9a37f8a6174f09bd622bc723b55881dc541cd50747cbd08831c2a82d620f6d76")
add_deps("cmake")
if is_plat("linux") then

@ -0,0 +1,13 @@
diff --git a/snappy.cc b/snappy.cc
index 79dc0e8..51157be 100644
--- a/snappy.cc
+++ b/snappy.cc
@@ -1014,7 +1014,7 @@ void MemMove(ptrdiff_t dst, const void* src, size_t size) {
}
SNAPPY_ATTRIBUTE_ALWAYS_INLINE
-size_t AdvanceToNextTag(const uint8_t** ip_p, size_t* tag) {
+inline size_t AdvanceToNextTag(const uint8_t** ip_p, size_t* tag) {
const uint8_t*& ip = *ip_p;
// This section is crucial for the throughput of the decompression loop.
// The latency of an iteration is fundamentally constrained by the

@ -7,14 +7,17 @@ package("snappy")
"https://github.com/google/snappy.git")
add_versions("1.1.8", "16b677f07832a612b0836178db7f374e414f94657c138e6993cbfc5dcc58651f")
add_versions("1.1.9", "75c1fbb3d618dd3a0483bff0e26d0a92b495bbe5059c8b4f1c962b478b6e06e7")
add_patches("1.1.9", path.join(os.scriptdir(), "patches", "1.1.9", "inline.patch"), "ed6b247d19486ab3f08f268269133193d7cdadd779523c5e69b5e653f82d535b")
add_deps("cmake")
add_configs("avx", {description = "Use the AVX instruction set", default = false, type = "boolean"})
add_configs("avx2", {description = "Use the AVX2 instruction set", default = false, type = "boolean"})
on_install(function (package)
local configs = {"-DSNAPPY_BUILD_TESTS=OFF"}
on_install("windows", "linux", "macosx", "mingw", "android", function (package)
local configs = {"-DSNAPPY_BUILD_TESTS=OFF", "-DSNAPPY_BUILD_BENCHMARKS=OFF"}
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
table.insert(configs, "-DSNAPPY_REQUIRE_AVX=" .. (package:config("avx") and "ON" or "OFF"))
table.insert(configs, "-DSNAPPY_REQUIRE_AVX2=" .. (package:config("avx2") and "ON" or "OFF"))

@ -7,6 +7,7 @@ package("trantor")
add_urls("https://github.com/an-tao/trantor/archive/refs/tags/$(version).tar.gz",
"https://github.com/an-tao/trantor.git")
add_versions("v1.3.0", "524589dc9258e1ace3b2f887b835cfbeccab3c5efc4ba94963c59f3528248d9b")
add_versions("v1.4.1", "aa3f4dddfd3fd1a6e04f79744e69f23bb6472c314724eaa3051872a2a03bbda9")
add_deps("cmake")
add_deps("openssl", "c-ares", {optional = true})

Loading…
Cancel
Save