From 381b2a854d31d27284a7d9d8c4c5b03d4fdee78b Mon Sep 17 00:00:00 2001 From: IMXEren <96839938+IMXEren@users.noreply.github.com> Date: Thu, 4 Jul 2024 07:51:36 +0530 Subject: [PATCH] metalang99: add package (#4544) * metalang99: add package * metalang99: test against older version * metalang99: improve test * metalang99: use c11 flag * metalang99: test latest version --- packages/m/metalang99/xmake.lua | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 packages/m/metalang99/xmake.lua diff --git a/packages/m/metalang99/xmake.lua b/packages/m/metalang99/xmake.lua new file mode 100644 index 000000000..9a3d694c8 --- /dev/null +++ b/packages/m/metalang99/xmake.lua @@ -0,0 +1,28 @@ +package("metalang99") + set_kind("library", { headeronly = true }) + set_homepage("https://github.com/Hirrolot/metalang99") + set_description("Full-blown preprocessor metaprogramming") + set_license("MIT") + + add_urls("https://github.com/Hirrolot/metalang99/archive/refs/tags/v$(version).tar.gz", + "https://github.com/Hirrolot/metalang99.git") + + add_versions("1.13.2", "912c6d91b872d34d2b6580d25afc38faccacf6c57462ab1c862010ff4afbf790") + add_versions("1.13.3", "91fe8d4edcc2e7f91c5b567a2b90f2e30c2373f1ebbabcf209ea0d74f63bc1e9") + + on_install(function(package) + os.cp("include", package:installdir()) + end) + + on_test(function(package) + assert(package:check_csnippets({test = [[ + typedef struct { + double width, height; + } Rect; + #define Rect_new(...) ML99_OVERLOAD(Rect_new_, __VA_ARGS__) + #define Rect_new_1(x) { x, x } + #define Rect_new_2(x, y) { x, y } + static Rect ra = Rect_new(7, 8); + static Rect rb = Rect_new(10); + ]]}, { configs = { languages = "c11" }, includes = "metalang99.h" })) + end)