Przeglądaj źródła

Auto-update nghttp3 to v1.4.0 (#4363)

* Update nghttp3 to v1.4.0

* add patch

* enable all platform

---------

Co-authored-by: star9029 <[email protected]>
ruki 1 rok temu
rodzic
commit
86fc7efaac

+ 0 - 0
packages/n/nghttp3/patches/vendor.patch → packages/n/nghttp3/patches/1.3.0/vendor.patch


+ 28 - 0
packages/n/nghttp3/patches/1.4.0/vendor.patch

@@ -0,0 +1,28 @@
+diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
+index 2196dd0..ea839e5 100644
+--- a/lib/CMakeLists.txt
++++ b/lib/CMakeLists.txt
+@@ -60,7 +60,6 @@ set(nghttp3_SOURCES
+   nghttp3_opl.c
+   nghttp3_objalloc.c
+   nghttp3_unreachable.c
+-  sfparse/sfparse.c
+ )
+ 
+ set(NGHTTP3_GENERATED_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated")
+@@ -90,6 +89,7 @@ install(
+ # Public shared library
+ if(ENABLE_SHARED_LIB)
+   add_library(nghttp3 SHARED ${nghttp3_SOURCES})
++  target_link_libraries(nghttp3 sfparse)
+   set_target_properties(nghttp3 PROPERTIES
+     COMPILE_FLAGS "${WARNCFLAGS}"
+     VERSION ${LT_VERSION} SOVERSION ${LT_SOVERSION}
+@@ -106,6 +106,7 @@ endif()
+ if(ENABLE_STATIC_LIB)
+   # Public static library
+   add_library(nghttp3_static STATIC ${nghttp3_SOURCES})
++  target_link_libraries(nghttp3_static sfparse)
+   set_target_properties(nghttp3_static PROPERTIES
+     COMPILE_FLAGS "${WARNCFLAGS}"
+     VERSION ${LT_VERSION} SOVERSION ${LT_SOVERSION}

+ 7 - 8
packages/n/nghttp3/xmake.lua

@@ -6,19 +6,15 @@ package("nghttp3")
     add_urls("https://github.com/ngtcp2/nghttp3/archive/refs/tags/$(version).tar.gz",
              "https://github.com/ngtcp2/nghttp3.git")
 
+    add_versions("v1.4.0", "522c8952ccae1815f34425f0c8bc6d8a4660e72dada1b4e97b8223e4c459a84a")
     add_versions("v1.3.0", "a83c6a4f589ae777a5f967652969d99b3399a85971340b8de9bed79119a11f88")
 
-    add_patches("v1.3.0", "patches/vendor.patch", "51ab785328270b8df854283a8c20403c09813b0586eb84702a9c20241ff14980")
+    add_patches("1.4.0", "patches/1.4.0/vendor.patch", "a6d611938c797d721a0345c5c772a1405ae0d6587ae46e16c1b73c89090a5c08")
+    add_patches("1.3.0", "patches/1.3.0/vendor.patch", "51ab785328270b8df854283a8c20403c09813b0586eb84702a9c20241ff14980")
 
     add_deps("cmake", "sfparse")
 
-    on_load("windows", function (package)
-        if not package:config("shared") then
-            package:add("defines", "NGHTTP3_STATICLIB")
-        end
-    end)
-
-    on_install("windows", "macosx", "linux", function (package)
+    on_install(function (package)
         local configs = {"-DENABLE_LIB_ONLY=ON", "-DBUILD_TESTING=OFF"}
         table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
         table.insert(configs, "-DENABLE_SHARED_LIB=" .. (package:config("shared") and "ON" or "OFF"))
@@ -27,6 +23,9 @@ package("nghttp3")
             table.insert(configs, "-DENABLE_STATIC_CRT=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF"))
         end
         import("package.tools.cmake").install(package, configs, {packagedeps = "sfparse"})
+        if not package:config("shared") then
+            package:add("defines", "NGHTTP3_STATICLIB")
+        end
     end)
 
     on_test(function (package)