@@ -6,6 +6,7 @@ package("nghttp3")
66 add_urls (" https://github.com/ngtcp2/nghttp3/archive/refs/tags/$(version).tar.gz" ,
77 " https://github.com/ngtcp2/nghttp3.git" , {submodules = false })
88
9+ add_versions (" v1.12.0" , " cefeb231f58c27258548f4c7aab2e5c5921b44631c384c750c3dc5592c6c7d7c" )
910 add_versions (" v1.11.0" , " 2fc58fbb8a4b463e62ce985dbc6ef5e215bfd41dc23ee625225e0589b97ac82a" )
1011 add_versions (" v1.10.1" , " 6d8714b9a077e02c17b85a0a5d8e90ceb26e9c91b149d3238130a91ca3df3e3a" )
1112 add_versions (" v1.8.0" , " d2cac7cd17966c915f87fa6b823963db4b555397e43c69d16d289765af7ab442" )
@@ -15,14 +16,13 @@ package("nghttp3")
1516 add_versions (" v1.4.0" , " 522c8952ccae1815f34425f0c8bc6d8a4660e72dada1b4e97b8223e4c459a84a" )
1617 add_versions (" v1.3.0" , " a83c6a4f589ae777a5f967652969d99b3399a85971340b8de9bed79119a11f88" )
1718
18- add_patches (" >=1.11.0" , " patches/1.11.0/vendor.patch" , " 29cd87f12c695021ea25f33bee2aa950e29806eadf2134ff043147414e33839d" )
1919 add_patches (" >=1.4.0<1.11.0" , " patches/1.4.0/vendor.patch" , " a6d611938c797d721a0345c5c772a1405ae0d6587ae46e16c1b73c89090a5c08" )
2020 add_patches (" 1.3.0" , " patches/1.3.0/vendor.patch" , " 51ab785328270b8df854283a8c20403c09813b0586eb84702a9c20241ff14980" )
2121
2222 add_deps (" cmake" )
2323
2424 on_load (function (package )
25- if package :version () or package :version ():ge (" 1.7.0" ) then
25+ if package :version () and package :version ():ge (" 1.7.0" ) then
2626 package :add (" deps" , " sfparse" )
2727 else
2828 package :add (" deps" , " sfparse 2024.05.12" )
@@ -35,13 +35,20 @@ package("nghttp3")
3535
3636 on_install (function (package )
3737 io .replace (" CMakeLists.txt" , [[ set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")]] , " " , {plain = true })
38+ if package :version () and package :version ():ge (" 1.11.0" ) then
39+ io .replace (" lib/CMakeLists.txt" , [[ sfparse/sfparse.c]] , " " , {plain = true })
40+ io .replace (" lib/CMakeLists.txt" , [[ add_library(nghttp3 SHARED ${nghttp3_SOURCES})]] , [[ add_library(nghttp3 SHARED ${nghttp3_SOURCES})
41+ target_link_libraries(nghttp3 sfparse)]] , {plain = true })
42+ io .replace (" lib/CMakeLists.txt" , [[ add_library(nghttp3_static STATIC ${nghttp3_SOURCES})]] , [[ add_library(nghttp3_static STATIC ${nghttp3_SOURCES})
43+ target_link_libraries(nghttp3_static sfparse)]] , {plain = true })
44+ end
3845
3946 local configs = {" -DENABLE_LIB_ONLY=ON" , " -DBUILD_TESTING=OFF" }
4047 table.insert (configs , " -DCMAKE_BUILD_TYPE=" .. (package :is_debug () and " Debug" or " Release" ))
4148 table.insert (configs , " -DENABLE_SHARED_LIB=" .. (package :config (" shared" ) and " ON" or " OFF" ))
4249 table.insert (configs , " -DENABLE_STATIC_LIB=" .. (package :config (" shared" ) and " OFF" or " ON" ))
4350 if package :is_plat (" windows" ) then
44- table.insert (configs , " -DENABLE_STATIC_CRT=" .. (package :config ( " vs_runtime " ):startswith (" MT" ) and " ON" or " OFF" ))
51+ table.insert (configs , " -DENABLE_STATIC_CRT=" .. (package :runtimes ( ):startswith (" MT" ) and " ON" or " OFF" ))
4552 end
4653 import (" package.tools.cmake" ).install (package , configs , {packagedeps = " sfparse" })
4754 end )
0 commit comments