From cff00f9a25aa055897fb1f605ebbad4cd14efddc Mon Sep 17 00:00:00 2001 From: star9029 Date: Wed, 18 Oct 2023 10:22:17 +0800 Subject: [PATCH] libfyaml: add package (#2731) * libfyaml: add package * disable plat --- packages/l/libfyaml/xmake.lua | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 packages/l/libfyaml/xmake.lua diff --git a/packages/l/libfyaml/xmake.lua b/packages/l/libfyaml/xmake.lua new file mode 100644 index 000000000..362efe43d --- /dev/null +++ b/packages/l/libfyaml/xmake.lua @@ -0,0 +1,29 @@ +package("libfyaml") + set_homepage("https://github.com/pantoniou/libfyaml") + set_description("Fully feature complete YAML parser and emitter, supporting the latest YAML spec and passing the full YAML testsuite.") + set_license("MIT") + + add_urls("https://github.com/pantoniou/libfyaml/archive/refs/tags/$(version).tar.gz", + "https://github.com/pantoniou/libfyaml.git") + + add_versions("v0.9", "927306fc85c7566904751766d36178650766b34e59ce56882eaa5b60f791668c") + + add_deps("cmake") + + on_install("linux", "macosx", "android", "iphoneos", "cross", function (package) + if package:is_plat("android") then + import("core.tool.toolchain") + local ndk = toolchain.load("ndk", {plat = package:plat(), arch = package:arch()}) + local ndk_sdkver = ndk:config("ndk_sdkver") + assert(ndk_sdkver and tonumber(ndk_sdkver) > 21, "package(libfyaml): need ndk api level > 21 for android") + end + + local configs = {} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("fy_library_version", {includes = "libfyaml.h"})) + end)