From 669ea752e5295d2ef2350ea3f0feda045850c1c9 Mon Sep 17 00:00:00 2001 From: star9029 Date: Fri, 18 Aug 2023 22:51:23 +0800 Subject: [PATCH] flux: add package (#2457) --- packages/f/flux/xmake.lua | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 packages/f/flux/xmake.lua diff --git a/packages/f/flux/xmake.lua b/packages/f/flux/xmake.lua new file mode 100644 index 000000000..5b5cf192b --- /dev/null +++ b/packages/f/flux/xmake.lua @@ -0,0 +1,25 @@ +package("flux") + set_kind("library", {headeronly = true}) + set_homepage("https://tristanbrindle.com/flux/") + set_description("A C++20 library for sequence-orientated programming") + set_license("BSL-1.0") + + add_urls("https://github.com/tcbrindle/flux.git") + add_versions("2023.08.17", "8434e8e0fd131cebc3aed0d845530335bf7fb5e1") + + on_install(function (package) + os.cp("include", package:installdir()) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + constexpr auto result = flux::from(std::array{1, 2, 3, 4, 5}) + .filter(flux::pred::even) + .map([](int i) { return i * 2; }) + .sum(); + static_assert(result == 12); + } + ]]}, {configs = {languages = "c++20"}})) + end)