From f5024a73d48ffe2ca9fb778fabf21d556b09b4a6 Mon Sep 17 00:00:00 2001 From: apocelipes Date: Sat, 7 Sep 2024 22:53:38 +0800 Subject: [PATCH] croncpp: add package (#5171) --- packages/c/croncpp/xmake.lua | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 packages/c/croncpp/xmake.lua diff --git a/packages/c/croncpp/xmake.lua b/packages/c/croncpp/xmake.lua new file mode 100644 index 000000000..f8e822064 --- /dev/null +++ b/packages/c/croncpp/xmake.lua @@ -0,0 +1,27 @@ +package("croncpp") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/mariusbancila/croncpp") + set_description("A C++11/14/17 header-only cross-platform library for handling CRON expressions") + set_license("MIT") + + add_urls("https://github.com/mariusbancila/croncpp/archive/refs/tags/$(version).tar.gz", + "https://github.com/mariusbancila/croncpp.git") + + add_versions("v2023.03.30", "0731b7f900a670c009585eb5e9639722aeff6531dbbd5bfc9ce895459733837e") + + on_install(function (package) + os.cp("include", package:installdir()) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + #include + int main() { + auto cr = cron::make_cron("* 0/5 * * * ?"); + auto time = cron::utils::to_tm("2024-08-28 20:01:00"); + auto next = cron::cron_next(cr, time); + std::cout << std::asctime(&next); + } + ]]}, {configs = {languages = "c++14"}, includes = "croncpp.h"})) + end)