improve sfparse includedirs

pull/4037/head
star9029 9 months ago
parent 2a9c93af55
commit 6248342ec5
  1. 26
      packages/n/nghttp3/patches/vendor.patch
  2. 5
      packages/n/nghttp3/xmake.lua
  3. 15
      packages/s/sfparse/xmake.lua

@ -1,26 +0,0 @@
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 2f7e31c..3e3d7fb 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -60,12 +60,12 @@ set(nghttp3_SOURCES
nghttp3_opl.c
nghttp3_objalloc.c
nghttp3_unreachable.c
- sfparse/sfparse.c
)
# 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}
@@ -81,6 +81,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}

@ -5,9 +5,8 @@ package("nghttp3")
add_urls("https://github.com/ngtcp2/nghttp3/archive/refs/tags/$(version).tar.gz",
"https://github.com/ngtcp2/nghttp3.git")
add_versions("v1.3.0", "a83c6a4f589ae777a5f967652969d99b3399a85971340b8de9bed79119a11f88")
add_patches("v1.3.0", "patches/vendor.patch", "51ab785328270b8df854283a8c20403c09813b0586eb84702a9c20241ff14980")
add_versions("v1.3.0", "a83c6a4f589ae777a5f967652969d99b3399a85971340b8de9bed79119a11f88")
add_deps("cmake", "sfparse")
@ -18,7 +17,7 @@ package("nghttp3")
end)
on_install("windows", "macosx", "linux", function (package)
io.replace("lib/nghttp3_http.c", "sfparse/sfparse.h", "sfparse.h", {plain = true})
io.replace("lib/CMakeLists.txt", "sfparse/sfparse.c", "", {plain = true})
local configs = {"-DENABLE_LIB_ONLY=ON", "-DBUILD_TESTING=OFF"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))

@ -1,28 +1,25 @@
package("sfparse")
set_homepage("https://github.com/ngtcp2/sfparse")
set_description("Structured Field Values parser")
set_license("MIT")
set_urls("https://github.com/ngtcp2/sfparse.git")
set_urls("https://github.com/ngtcp2/sfparse.git", {submodules = false})
add_versions("2024.05.12", "c669673012f9d535ec3bcf679fe911c8c75a479f")
add_includedirs("include", "include/sfparse")
on_install(function (package)
io.writefile("xmake.lua", [[
add_rules("mode.debug", "mode.release")
target("sfparse")
set_kind("$(kind)")
add_files("sfparse.c")
add_headerfiles("sfparse.h")
add_headerfiles("sfparse.h", {prefixdir = "sfparse"})
if is_plat("windows") and is_kind("shared") then
add_rules("utils.symbols.export_all", {export_classes = true})
add_rules("utils.symbols.export_all")
end
]])
local configs = {}
if package:config("shared") then
configs.kind = "shared"
end
import("package.tools.xmake").install(package, configs)
import("package.tools.xmake").install(package)
end)
on_test(function (package)

Loading…
Cancel
Save